Commit 76798144 authored by 1483922988@qq.com's avatar 1483922988@qq.com

6

parent a5b25c53
import request from "@/utils/request";
import request from "@/utils/request"
// 创建出货
export function createbox(data) {
return request({
url: "/shipment/box/createAir",
method: "post",
data: data,
});
data: data
})
}
// 更新出货
......@@ -14,8 +14,8 @@ export function updatebox(data) {
return request({
url: "/shipment/box/update",
method: "put",
data: data,
});
data: data
})
}
/**
......@@ -30,15 +30,15 @@ export function booking(data) {
return request({
url: "/shipment/box-book-air/update",
method: "put",
data,
});
data
})
}
return request({
url: "/shipment/box-book-air/create",
method: "post",
data,
});
data
})
}
/**
......@@ -52,8 +52,8 @@ export function preloadPage(data) {
return request({
url: "/ecw/box-preload-goods/preloadPageAir",
method: "post",
data,
});
data
})
}
/**
......@@ -67,8 +67,8 @@ export function createGoods(data) {
return request({
url: "/ecw/box-preload-goods/createAir",
method: "post",
data,
});
data
})
}
/***************************** 合包 start **********************************/
......@@ -84,8 +84,8 @@ export function getMergePkgList(params) {
return request({
url: "/ecw/box-merge-pkg/page",
method: "get",
params,
});
params
})
}
/**
......@@ -99,8 +99,8 @@ export function createMergePkg(data) {
return request({
url: "/ecw/box-merge-pkg/create",
method: "post",
data,
});
data
})
}
/**
......@@ -114,8 +114,8 @@ export function updateMergePkg(data) {
return request({
url: "/ecw/box-merge-pkg/update",
method: "put",
data,
});
data
})
}
/**
......@@ -127,9 +127,9 @@ export function updateMergePkg(data) {
*/
export function deleteMergePkg(id) {
return request({
url: `/ecw/box-merge-pkg/delete?id=`+id,
method: "delete",
});
url: `/ecw/box-merge-pkg/delete?id=` + id,
method: "delete"
})
}
/**
......@@ -143,8 +143,8 @@ export function getUnPkgPage(params) {
return request({
url: "/ecw/box-merge-pkg/getUnPkgPage",
method: "get",
params,
});
params
})
}
/**
......@@ -158,8 +158,8 @@ export function getPkgPageByPkgId(params) {
return request({
url: "/ecw/box-merge-pkg/getPkgPageByPkgId",
method: "get",
params,
});
params
})
}
/**
......@@ -173,8 +173,8 @@ export function createPkgOrder(data) {
return request({
url: "/ecw/box-pkg-order/create",
method: "post",
data,
});
data
})
}
/**
......@@ -188,8 +188,8 @@ export function createBatchPkgOrder(data) {
return request({
url: "/ecw/box-pkg-order/createBatch",
method: "post",
data,
});
data
})
}
/**
......@@ -203,11 +203,11 @@ export function deleteRelate(pkgId, orderId) {
return request({
url: `/ecw/box-pkg-order/deleteRelate`,
method: "delete",
headers:{
'Content-type': 'application/x-www-form-urlencoded'
headers: {
"Content-type": "application/x-www-form-urlencoded"
},
data: 'pkgId='+pkgId+'&orderId='+orderId
});
data: "pkgId=" + pkgId + "&orderId=" + orderId
})
}
/**
......@@ -222,7 +222,7 @@ export function deleteBatchRelate(data) {
url: `/ecw/box-pkg-order/deleteBatchRelate`,
method: "post",
data: data
});
})
}
/**
......@@ -234,9 +234,9 @@ export function deleteBatchRelate(data) {
*/
export function getMergePkgInfoById(id) {
return request({
url: "/ecw/box-merge-pkg/getMergePkgInfoById?id="+id,
url: "/ecw/box-merge-pkg/getMergePkgInfoById?id=" + id,
method: "get"
});
})
}
/**
......@@ -248,9 +248,9 @@ export function getMergePkgInfoById(id) {
*/
export function getMergeTagById(id) {
return request({
url: "/ecw/box-merge-pkg/getMergeTagById?id="+id,
url: "/ecw/box-merge-pkg/getMergeTagById?id=" + id,
method: "get"
});
})
}
/**
......@@ -262,29 +262,27 @@ export function getMergeTagById(id) {
*/
export function finishMergePkg(shipmentId) {
return request({
url: "/ecw/box-merge-pkg/finishMergePkg?shipmentId="+shipmentId,
url: "/ecw/box-merge-pkg/finishMergePkg?shipmentId=" + shipmentId,
method: "get"
});
})
}
/***************************** 合包 end **********************************/
/***************************** 起运 start *******************************/
export function takeoffCreate(data) {
if (data.id) {
return request({
url: "/ecw/box-air-fly/update",
method: "put",
data,
});
data
})
}
return request({
url: "/ecw/box-air-fly/create",
method: "post",
data,
});
data
})
}
/***************************** 起运 end *******************************/
......@@ -297,9 +295,9 @@ export function takeoffCreate(data) {
*/
export function shipmentOrderList(shipmentId) {
return request({
url: "/shipment/box/shipmentOrderList?shipmentId="+shipmentId,
url: "/shipment/box/shipmentOrderList?shipmentId=" + shipmentId,
method: "get"
});
})
}
/**
......@@ -314,7 +312,7 @@ export function updateOrderArrival(data) {
url: `/ecw/box-arrival-air/updateOrderArrival`,
method: "post",
data: data
});
})
}
/**
......@@ -329,7 +327,7 @@ export function createOrderArrival(data) {
url: `/ecw/box-arrival-air/create`,
method: "post",
data: data
});
})
}
/**
......@@ -344,7 +342,7 @@ export function updateAllOrderArrival(data) {
url: `/ecw/box-arrival-air/updateAllOrderArrival`,
method: "post",
data: data
});
})
}
/**
......@@ -359,7 +357,7 @@ export function updateOrderClearance(data) {
url: `/ecw/box-clearance/updateOrderClearance`,
method: "post",
data: data
});
})
}
/**
......@@ -374,7 +372,7 @@ export function updateAllOrderClearance(data) {
url: `/ecw/box-clearance/updateAllOrderClearance`,
method: "post",
data: data
});
})
}
/**
......@@ -389,7 +387,7 @@ export function getLineInfo(params) {
url: `/ecw/warehouse/getLineInfo`,
method: "get",
params
});
})
}
/**
......@@ -400,7 +398,7 @@ export function downloadLoadGoods(params) {
url: "/ecw/box-preload-goods/downloadAirLoadGoodsList",
method: "get",
timeout: 120000,
params,
params
})
}
......@@ -416,7 +414,7 @@ export function checkInfoSingleCreate(data) {
url: `/ecw/box-order-check-info/singleCreate`,
method: "post",
data: data
});
})
}
/**
......@@ -431,7 +429,7 @@ export function checkInfoBatchCreate(data) {
url: `/ecw/box-order-check-info/batchCreate`,
method: "post",
data: data
});
})
}
/**
......@@ -446,7 +444,7 @@ export function checkInfoSingleDelete(data) {
url: `/ecw/box-order-check-info/singleDelete`,
method: "post",
data: data
});
})
}
/**
......@@ -461,7 +459,7 @@ export function checkInfoBatchDelete(data) {
url: `/ecw/box-order-check-info/batchDelete`,
method: "post",
data: data
});
})
}
/**
......@@ -476,7 +474,7 @@ export function getOrderTagList(params) {
url: `/ecw/box-order-check-info/orderTagList`,
method: "get",
params
});
})
}
/**
......@@ -491,7 +489,7 @@ export function searchLoadOrderByBoxNo(data) {
url: `/ecw/box-order-check-info/searchLoadOrderByBoxNo`,
method: "post",
data: data
});
})
}
/**
......@@ -506,7 +504,7 @@ export function confirmAirCheckout(params) {
url: `/ecw/box-air-checkout/confirmAirCheckout`,
method: "get",
params
});
})
}
/**
......@@ -520,8 +518,8 @@ export function singleAirCreate(data) {
return request({
url: "/ecw/box-load-info/singleAirCreate",
method: "post",
data,
});
data
})
}
/**
* 批量装柜
......@@ -534,6 +532,6 @@ export function batchAirCreate(data) {
return request({
url: "/ecw/box-load-info/batchAirCreate",
method: "post",
data,
});
data
})
}
This diff is collapsed.
This diff is collapsed.
<template>
<div style="display: inline-block">
<template v-if="text">
<el-button size="mini" type="text" style="margin-right: 10px" @click="handleOpen">{{ num }}{{$t('混箱')}}})</el-button>
</template>
<template v-else>
<el-button size="mini" type="primary" style="margin-right: 10px" @click="handleOpen">{{ title }}</el-button>
</template>
<el-dialog
append-to-body
:title="title"
:visible.sync="dialogVisible"
width="1024px"
:before-close="handleClose">
<template v-slot:title>
<div class="flex flex-items-center">
<div class="title flex-1 flex flex-items-center">{{title}}</div>
<el-button v-if="showChooseOrderItem" type="primary" size="mini" @click="handleShowChooseDialog">{{$t('选择订单商品')}}</el-button>
<div style="width: 100px"><!--占位,防止被关闭按钮挡住--></div>
</div>
</template>
<el-form v-if="dialogVisible">
<WarehouseRecordDetailItem
v-for="(item, index) in dataList"
:key="index" v-model="dataList[index]"
:index="index" :attr-list="attrList"
@handle-delete="handleDelete(index)"
:readonly="readonly"
/>
</el-form>
<el-button v-show="!readonly" type="primary" size="mini" @click="handleAddItem">{{$t('添加一条明细')}}</el-button>
<span v-show="!readonly" slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">{{$t('取消')}}</el-button>
<el-button type="primary" @click="handleSave">{{$t('确定')}}</el-button>
</span>
</el-dialog>
<choose-order-products
v-if="showChooseDialog"
:order-id="orderId"
:warehouse-in-id="warehouseInId"
@close="showChooseDialog=false"
@success="handleChooseOrderProducts"></choose-order-products>
</div>
</template>
<script>
import ProductSelector from "@/components/ProductSelector/index.vue";
import WarehouseRecordDetailItem from "@/views/ecw/order/warehousing/components/WarehouseRecordDetailItem.vue";
import {getProductAttrList} from "@/api/ecw/productAttr";
import {getOrderItemCommonAttr} from "@/api/ecw/order";
import ChooseOrderProducts from "@/views/ecw/order/stocking/components/ChooseOrderProducts.vue";
/**
* 入仓明细弹窗
*/
export default {
name: 'WarehouseRecordDetail',
components: {ChooseOrderProducts, WarehouseRecordDetailItem, ProductSelector},
props: {
value: {
type: Array,
default: () => []
},
readonly: {
type: Boolean,
default: false
},
text: {
type: Boolean,
default: false
},
num:{
type:Number,
default:0
},
// 是否显示添加订单商品按钮
showChooseOrderItem:Boolean,
orderId: Number,
warehouseInId: Number
},
data() {
return {
dialogVisible: false,
dataList: [],
// 特性列表
attrList: [],
showChooseDialog: false
};
},
watch:{
dialogVisible(v){
if(!v){
this.$emit("close")
}
}
},
mounted() {
this.getAttrList()
},
methods: {
init() {
if (!this.value || this.value.length === 0) {
this.dataList = [{
"boxGauge": "",
"brand": undefined,
"cartonsNum": undefined,
"createTime": "",
"expressNo": "",
"prodAttrIds": '',
"prodId": undefined,
"quantityAll": undefined,
"specificationType": undefined,
"unit": "",
"usageIds": "",
"volume": undefined,
"weight": undefined,
"material": undefined
}]
} else {
this.dataList = JSON.parse(JSON.stringify(this.value))
}
},
/** 获取产品属性列表 */
getAttrList() {
getProductAttrList().then(response => {
this.attrList = response.data;
})
},
handleAddItem() {
this.dataList.push({
"boxGauge": "",
"brand": undefined,
"cartonsNum": undefined,
"createTime": "",
"expressNo": "",
"prodAttrIds": '',
"prodId": undefined,
"quantityAll": undefined,
"specificationType": undefined,
"unit": "",
"usageIds": "",
"volume": undefined,
"weight": undefined,
"material": undefined
})
},
handleDelete(index) {
this.dataList.splice(index, 1)
},
handleOpen() {
this.init()
this.dialogVisible = true
},
handleClose(done) {
if (this.readonly) {
return done()
}
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {});
},
handleSave() {
for (let i = 0; i < this.dataList.length; i++) {
if (!this.dataList[i].prodId) {
return this.$notify({
title: this.$t("填写第{n}条明细的品名", {n: i=1}),
type: "warning"
})
}
if (!this.dataList[i].brand) {
return this.$notify({
title: this.$t("填写第{n}条明细的品牌", {n: i=1}),
type: "warning"
})
}
if(!this.dataList[i].quantityAll){
return this.$notify({
title: this.$t("填写第{n}条明细的数量", {n: i=1}),
type: "warning"
})
}
}
this.$emit('input', this.dataList)
this.dialogVisible = false
},
handleShowChooseDialog(){
this.showChooseDialog = true
},
handleChooseOrderProducts(data){
this.showChooseDialog = false
if(!data?.length) return
// 如果最后一条是空的,则删除先
if(this.dataList?.length){
const index = this.dataList.length - 1
let lastItem = this.dataList[index]
if(!lastItem.prodId && !lastItem.brand && !lastItem.prodAttrIds && !lastItem.material && !lastItem.quantityAll){
this.dataList.splice(index, 1)
}
}
data.forEach(item => {
this.dataList.push({
"boxGauge": "",
"brand": item.brand,
"cartonsNum": undefined,
"createTime": "",
"expressNo": "",
"prodAttrIds": item.prodAttrIds,
"prodId": item.prodId,
"quantityAll": item.quantityAll,
"specificationType": undefined,
"unit": "",
"usageIds": item.usageIds || "",
"volume": undefined,
"weight": undefined,
"material": item.material
})
})
}
},
computed: {
title() {
if (this.readonly) {
return this.$t('查看箱明细')
}
return !this.value || this.value.length === 0 ? this.$t('添加箱明细') : this.$t('编辑箱明细')
}
}
}
</script>
<style scoped lang="scss">
.title{
font-size: 16px;
}
</style>
<template>
<el-card style="margin-bottom: 10px">
<div slot="header">
<span>序号{{ index + 1 }}</span>
<el-link v-show="!readonly" type="danger" @click="handleDelete" style="float: right">删除</el-link>
</div>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item :label="$t('中文品名')" required>
<product-selector v-model="value.prodId" @change="onProductChange" determined :disabled="readonly" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('品牌')" required>
<el-select
v-model="value.brand"
:placeholder="$t('可修改')"
filterable
remote
:remote-method="getProductBrandPage"
:disabled="readonly"
clearable>
<el-option
v-for="item in brandList"
:key="item.id"
:label="item.titleZh"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="4">
<el-form-item :label="$t('材质')">
<dict-selector :type="DICT_TYPE.ECW_PRODUCT_MATERIAL" v-model="material" clearable :disabled="readonly"></dict-selector>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="$t('商品特性')">
<el-checkbox-group v-model="prodAttrIds">
<el-checkbox v-for="item in attrList" :key="item.id" :label="item.id" :disabled="readonly">{{ item.attrName }}</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="$t('用途')">
<el-checkbox-group v-model="usageIds">
<el-checkbox v-for="item in getDictDatas(DICT_TYPE.WAREHOUSING_RECORD_DETAIL_USAGE)" :key="item.value" :label="item.value" :disabled="readonly">{{ $l(item, 'label') }}</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-col>
</el-row>
<!--<el-row :gutter="10">
<el-col :span="4">
<el-form-item :label="$t('长')">
<el-input v-model="boxGauge1" type="number" :disabled="readonly" />
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item :label="$t('宽')">
<el-input v-model="boxGauge2" type="number" :disabled="readonly" />
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item :label="$t('高')">
<el-input v-model="boxGauge3" type="number" :disabled="readonly" />
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item :label="$t('重量')">
<el-input v-model="value.weight" type="number" :disabled="readonly" />
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item :label="$t('体积')">
<el-input v-model="value.volume" type="number" :disabled="readonly" />
</el-form-item>
</el-col>
</el-row>-->
<el-row :gutter="10">
<!--<el-col :span="4">
<el-form-item :label="$t('快递单号')">
<el-input v-model="value.expressNo" :disabled="readonly" />
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item :label="$t('包装类型')">
<dict-selector :type="DICT_TYPE.ECW_PACKAGING_TYPE" v-model="value.unit" :disabled="readonly"></dict-selector>
</el-form-item>
</el-col>-->
<el-col :span="4">
<el-form-item :label="$t('数量')" required>
<el-input v-model="value.quantityAll" type="number" :disabled="readonly" />
</el-form-item>
</el-col>
</el-row>
</el-card>
</template>
<script>
import ProductSelector from "@/components/ProductSelector/index.vue"
import { getProductBrank, getProductBrankPage } from '@/api/ecw/productBrank'
import {getProductAttrList} from "@/api/ecw/productAttr"
import {DICT_TYPE, getDictDatas} from '@/utils/dict'
export default {
name: "WarehouseRecordDetailItem",
computed: {
DICT_TYPE() {
return DICT_TYPE
}
},
components: {ProductSelector},
props: {
value: {
type: Object,
default: () => {}
},
index: {
type: Number,
default: 0
},
readonly: {
type: Boolean,
default: false
},
// 特性列表
attrList: {
type: Array,
default: () => []
}
},
data() {
return {
brandList: [],
prodAttrIds: [],
usageIds: [],
material: '',
boxGauge1: '',
boxGauge2: '',
boxGauge3: '',
}
},
async mounted() {
// 品牌回显
if (this.value.brand) {
await getProductBrank(this.value.brand).then(r => {
this.brandList = [r.data]
})
} else {
this.getProductBrandPage()
}
if(this.value.material){
this.$set(this, 'material', this.value.material)
}
if (typeof this.value.prodAttrIds === 'string' && this.value.prodAttrIds.length > 0) {
this.prodAttrIds = this.value.prodAttrIds.split(',').map(e => +e)
}
if (this.value.usageIds) {
this.usageIds = this.value.usageIds.split(',') || []
if (this.usageIds.length > 0 && this.usageIds[0] === ''){
this.usageIds.splice(0, 1)
}
}
if (this.value.boxGauge) {
const boxGauge = this.value.boxGauge.split('*')
if (boxGauge?.length === 3) {
this.boxGauge1 = boxGauge[0]
this.boxGauge2 = boxGauge[1]
this.boxGauge3 = boxGauge[2]
}
}
},
methods: {
getDictDatas,
/** 获取产品属性列表 */
getAttrList() {
getProductAttrList().then(response => {
this.attrList = response.data;
})
},
getProductBrandPage(titleZh = undefined) {
getProductBrankPage({pageSize: 20, titleZh}).then(r => {
this.brandList = r.data.list
})
},
handleDelete() {
this.$emit('handle-delete')
},
onProductChange(product){
if (!product || this.readonly) {
return
}
this.prodAttrIds = product.attrId ? product.attrId.split(',').map(e => +e) : []
}
},
watch: {
prodAttrIds(val) {
this.value.prodAttrIds = val.join(',')
},
usageIds(val) {
this.$nextTick(() => {
this.value.usageIds = val.join(',')
})
},
boxGauge1() {
if (this.boxGauge1 < 0 ) {
this.boxGauge1 = -this.boxGauge1
}
this.value.boxGauge = this.boxGauge1 + '*' + this.boxGauge2 + '*' + this.boxGauge3
this.value.volume = (this.boxGauge1 * this.boxGauge2 * this.boxGauge3 / 1000000).toFixed(2)
},
boxGauge2() {
if (this.boxGauge2 < 0 ) {
this.boxGauge2 = -this.boxGauge2
}
this.value.boxGauge = this.boxGauge1 + '*' + this.boxGauge2 + '*' + this.boxGauge3
this.value.volume = (this.boxGauge1 * this.boxGauge2 * this.boxGauge3 / 1000000).toFixed(2)
},
boxGauge3() {
if (this.boxGauge3 < 0 ) {
this.boxGauge3 = -this.boxGauge3
}
this.value.boxGauge = this.boxGauge1 + '*' + this.boxGauge2 + '*' + this.boxGauge3
this.value.volume = (this.boxGauge1 * this.boxGauge2 * this.boxGauge3 / 1000000).toFixed(2)
},
material(material){
this.value.material = material
},
'value.volume'() {
if (this.value.volume < 0) {
this.value.volume = -this.value.volume
}
},
'value.quantityAll'() {
if (this.value.quantityAll < 0) {
this.value.quantityAll = -this.value.quantityAll
}
},
'value.weight'() {
if (this.value.weight < 0) {
this.value.weight = -this.value.weight
}
},
'value.brand'(val){
if(!val) return
const index = this.brandList.findIndex(item => item.id == val)
getProductBrank(val).then(res => {
this.brandList.push(res.data)
})
},
"value.usageIds"(val) {
this.usageIds = val?.split(',') || []
if (this.usageIds.length > 0 && this.usageIds[0] === ''){
this.usageIds.splice(0, 1)
}
},
"value.material"(val) {
this.material = val
},
}
}
</script>
<style scoped lang="scss">
</style>
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment