Commit e21ed582 authored by zhengyi's avatar zhengyi

Merge branch 'dev-zs' into dev

parents 8a6c94db 40c6242f
import request from "@/utils/request"; import request from "@/utils/request"
// 创建出货 // 创建出货
export function createbox(data) { export function createbox(data) {
return request({ return request({
url: "/shipment/box/createAir", url: "/shipment/box/createAir",
method: "post", method: "post",
data: data, data: data
}); })
} }
// 更新出货 // 更新出货
...@@ -14,8 +14,8 @@ export function updatebox(data) { ...@@ -14,8 +14,8 @@ export function updatebox(data) {
return request({ return request({
url: "/shipment/box/update", url: "/shipment/box/update",
method: "put", method: "put",
data: data, data: data
}); })
} }
/** /**
...@@ -30,15 +30,15 @@ export function booking(data) { ...@@ -30,15 +30,15 @@ export function booking(data) {
return request({ return request({
url: "/shipment/box-book-air/update", url: "/shipment/box-book-air/update",
method: "put", method: "put",
data, data
}); })
} }
return request({ return request({
url: "/shipment/box-book-air/create", url: "/shipment/box-book-air/create",
method: "post", method: "post",
data, data
}); })
} }
/** /**
...@@ -52,8 +52,8 @@ export function preloadPage(data) { ...@@ -52,8 +52,8 @@ export function preloadPage(data) {
return request({ return request({
url: "/ecw/box-preload-goods/preloadPageAir", url: "/ecw/box-preload-goods/preloadPageAir",
method: "post", method: "post",
data, data
}); })
} }
/** /**
...@@ -67,8 +67,8 @@ export function createGoods(data) { ...@@ -67,8 +67,8 @@ export function createGoods(data) {
return request({ return request({
url: "/ecw/box-preload-goods/createAir", url: "/ecw/box-preload-goods/createAir",
method: "post", method: "post",
data, data
}); })
} }
/***************************** 合包 start **********************************/ /***************************** 合包 start **********************************/
...@@ -84,8 +84,8 @@ export function getMergePkgList(params) { ...@@ -84,8 +84,8 @@ export function getMergePkgList(params) {
return request({ return request({
url: "/ecw/box-merge-pkg/page", url: "/ecw/box-merge-pkg/page",
method: "get", method: "get",
params, params
}); })
} }
/** /**
...@@ -99,8 +99,8 @@ export function createMergePkg(data) { ...@@ -99,8 +99,8 @@ export function createMergePkg(data) {
return request({ return request({
url: "/ecw/box-merge-pkg/create", url: "/ecw/box-merge-pkg/create",
method: "post", method: "post",
data, data
}); })
} }
/** /**
...@@ -114,8 +114,8 @@ export function updateMergePkg(data) { ...@@ -114,8 +114,8 @@ export function updateMergePkg(data) {
return request({ return request({
url: "/ecw/box-merge-pkg/update", url: "/ecw/box-merge-pkg/update",
method: "put", method: "put",
data, data
}); })
} }
/** /**
...@@ -127,9 +127,9 @@ export function updateMergePkg(data) { ...@@ -127,9 +127,9 @@ export function updateMergePkg(data) {
*/ */
export function deleteMergePkg(id) { export function deleteMergePkg(id) {
return request({ return request({
url: `/ecw/box-merge-pkg/delete?id=`+id, url: `/ecw/box-merge-pkg/delete?id=` + id,
method: "delete", method: "delete"
}); })
} }
/** /**
...@@ -143,8 +143,8 @@ export function getUnPkgPage(params) { ...@@ -143,8 +143,8 @@ export function getUnPkgPage(params) {
return request({ return request({
url: "/ecw/box-merge-pkg/getUnPkgPage", url: "/ecw/box-merge-pkg/getUnPkgPage",
method: "get", method: "get",
params, params
}); })
} }
/** /**
...@@ -158,8 +158,8 @@ export function getPkgPageByPkgId(params) { ...@@ -158,8 +158,8 @@ export function getPkgPageByPkgId(params) {
return request({ return request({
url: "/ecw/box-merge-pkg/getPkgPageByPkgId", url: "/ecw/box-merge-pkg/getPkgPageByPkgId",
method: "get", method: "get",
params, params
}); })
} }
/** /**
...@@ -173,8 +173,8 @@ export function createPkgOrder(data) { ...@@ -173,8 +173,8 @@ export function createPkgOrder(data) {
return request({ return request({
url: "/ecw/box-pkg-order/create", url: "/ecw/box-pkg-order/create",
method: "post", method: "post",
data, data
}); })
} }
/** /**
...@@ -188,8 +188,8 @@ export function createBatchPkgOrder(data) { ...@@ -188,8 +188,8 @@ export function createBatchPkgOrder(data) {
return request({ return request({
url: "/ecw/box-pkg-order/createBatch", url: "/ecw/box-pkg-order/createBatch",
method: "post", method: "post",
data, data
}); })
} }
/** /**
...@@ -203,11 +203,11 @@ export function deleteRelate(pkgId, orderId) { ...@@ -203,11 +203,11 @@ export function deleteRelate(pkgId, orderId) {
return request({ return request({
url: `/ecw/box-pkg-order/deleteRelate`, url: `/ecw/box-pkg-order/deleteRelate`,
method: "delete", method: "delete",
headers:{ headers: {
'Content-type': 'application/x-www-form-urlencoded' "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) { ...@@ -222,7 +222,7 @@ export function deleteBatchRelate(data) {
url: `/ecw/box-pkg-order/deleteBatchRelate`, url: `/ecw/box-pkg-order/deleteBatchRelate`,
method: "post", method: "post",
data: data data: data
}); })
} }
/** /**
...@@ -234,9 +234,9 @@ export function deleteBatchRelate(data) { ...@@ -234,9 +234,9 @@ export function deleteBatchRelate(data) {
*/ */
export function getMergePkgInfoById(id) { export function getMergePkgInfoById(id) {
return request({ return request({
url: "/ecw/box-merge-pkg/getMergePkgInfoById?id="+id, url: "/ecw/box-merge-pkg/getMergePkgInfoById?id=" + id,
method: "get" method: "get"
}); })
} }
/** /**
...@@ -248,9 +248,9 @@ export function getMergePkgInfoById(id) { ...@@ -248,9 +248,9 @@ export function getMergePkgInfoById(id) {
*/ */
export function getMergeTagById(id) { export function getMergeTagById(id) {
return request({ return request({
url: "/ecw/box-merge-pkg/getMergeTagById?id="+id, url: "/ecw/box-merge-pkg/getMergeTagById?id=" + id,
method: "get" method: "get"
}); })
} }
/** /**
...@@ -262,29 +262,27 @@ export function getMergeTagById(id) { ...@@ -262,29 +262,27 @@ export function getMergeTagById(id) {
*/ */
export function finishMergePkg(shipmentId) { export function finishMergePkg(shipmentId) {
return request({ return request({
url: "/ecw/box-merge-pkg/finishMergePkg?shipmentId="+shipmentId, url: "/ecw/box-merge-pkg/finishMergePkg?shipmentId=" + shipmentId,
method: "get" method: "get"
}); })
} }
/***************************** 合包 end **********************************/ /***************************** 合包 end **********************************/
/***************************** 起运 start *******************************/ /***************************** 起运 start *******************************/
export function takeoffCreate(data) { export function takeoffCreate(data) {
if (data.id) { if (data.id) {
return request({ return request({
url: "/ecw/box-air-fly/update", url: "/ecw/box-air-fly/update",
method: "put", method: "put",
data, data
}); })
} }
return request({ return request({
url: "/ecw/box-air-fly/create", url: "/ecw/box-air-fly/create",
method: "post", method: "post",
data, data
}); })
} }
/***************************** 起运 end *******************************/ /***************************** 起运 end *******************************/
...@@ -297,9 +295,9 @@ export function takeoffCreate(data) { ...@@ -297,9 +295,9 @@ export function takeoffCreate(data) {
*/ */
export function shipmentOrderList(shipmentId) { export function shipmentOrderList(shipmentId) {
return request({ return request({
url: "/shipment/box/shipmentOrderList?shipmentId="+shipmentId, url: "/shipment/box/shipmentOrderList?shipmentId=" + shipmentId,
method: "get" method: "get"
}); })
} }
/** /**
...@@ -314,7 +312,7 @@ export function updateOrderArrival(data) { ...@@ -314,7 +312,7 @@ export function updateOrderArrival(data) {
url: `/ecw/box-arrival-air/updateOrderArrival`, url: `/ecw/box-arrival-air/updateOrderArrival`,
method: "post", method: "post",
data: data data: data
}); })
} }
/** /**
...@@ -329,7 +327,7 @@ export function createOrderArrival(data) { ...@@ -329,7 +327,7 @@ export function createOrderArrival(data) {
url: `/ecw/box-arrival-air/create`, url: `/ecw/box-arrival-air/create`,
method: "post", method: "post",
data: data data: data
}); })
} }
/** /**
...@@ -344,7 +342,7 @@ export function updateAllOrderArrival(data) { ...@@ -344,7 +342,7 @@ export function updateAllOrderArrival(data) {
url: `/ecw/box-arrival-air/updateAllOrderArrival`, url: `/ecw/box-arrival-air/updateAllOrderArrival`,
method: "post", method: "post",
data: data data: data
}); })
} }
/** /**
...@@ -359,7 +357,7 @@ export function updateOrderClearance(data) { ...@@ -359,7 +357,7 @@ export function updateOrderClearance(data) {
url: `/ecw/box-clearance/updateOrderClearance`, url: `/ecw/box-clearance/updateOrderClearance`,
method: "post", method: "post",
data: data data: data
}); })
} }
/** /**
...@@ -374,7 +372,7 @@ export function updateAllOrderClearance(data) { ...@@ -374,7 +372,7 @@ export function updateAllOrderClearance(data) {
url: `/ecw/box-clearance/updateAllOrderClearance`, url: `/ecw/box-clearance/updateAllOrderClearance`,
method: "post", method: "post",
data: data data: data
}); })
} }
/** /**
...@@ -389,7 +387,7 @@ export function getLineInfo(params) { ...@@ -389,7 +387,7 @@ export function getLineInfo(params) {
url: `/ecw/warehouse/getLineInfo`, url: `/ecw/warehouse/getLineInfo`,
method: "get", method: "get",
params params
}); })
} }
/** /**
...@@ -400,7 +398,7 @@ export function downloadLoadGoods(params) { ...@@ -400,7 +398,7 @@ export function downloadLoadGoods(params) {
url: "/ecw/box-preload-goods/downloadAirLoadGoodsList", url: "/ecw/box-preload-goods/downloadAirLoadGoodsList",
method: "get", method: "get",
timeout: 120000, timeout: 120000,
params, params
}) })
} }
...@@ -416,7 +414,7 @@ export function checkInfoSingleCreate(data) { ...@@ -416,7 +414,7 @@ export function checkInfoSingleCreate(data) {
url: `/ecw/box-order-check-info/singleCreate`, url: `/ecw/box-order-check-info/singleCreate`,
method: "post", method: "post",
data: data data: data
}); })
} }
/** /**
...@@ -431,7 +429,7 @@ export function checkInfoBatchCreate(data) { ...@@ -431,7 +429,7 @@ export function checkInfoBatchCreate(data) {
url: `/ecw/box-order-check-info/batchCreate`, url: `/ecw/box-order-check-info/batchCreate`,
method: "post", method: "post",
data: data data: data
}); })
} }
/** /**
...@@ -446,7 +444,7 @@ export function checkInfoSingleDelete(data) { ...@@ -446,7 +444,7 @@ export function checkInfoSingleDelete(data) {
url: `/ecw/box-order-check-info/singleDelete`, url: `/ecw/box-order-check-info/singleDelete`,
method: "post", method: "post",
data: data data: data
}); })
} }
/** /**
...@@ -461,7 +459,7 @@ export function checkInfoBatchDelete(data) { ...@@ -461,7 +459,7 @@ export function checkInfoBatchDelete(data) {
url: `/ecw/box-order-check-info/batchDelete`, url: `/ecw/box-order-check-info/batchDelete`,
method: "post", method: "post",
data: data data: data
}); })
} }
/** /**
...@@ -476,7 +474,7 @@ export function getOrderTagList(params) { ...@@ -476,7 +474,7 @@ export function getOrderTagList(params) {
url: `/ecw/box-order-check-info/orderTagList`, url: `/ecw/box-order-check-info/orderTagList`,
method: "get", method: "get",
params params
}); })
} }
/** /**
...@@ -491,7 +489,7 @@ export function searchLoadOrderByBoxNo(data) { ...@@ -491,7 +489,7 @@ export function searchLoadOrderByBoxNo(data) {
url: `/ecw/box-order-check-info/searchLoadOrderByBoxNo`, url: `/ecw/box-order-check-info/searchLoadOrderByBoxNo`,
method: "post", method: "post",
data: data data: data
}); })
} }
/** /**
...@@ -506,7 +504,7 @@ export function confirmAirCheckout(params) { ...@@ -506,7 +504,7 @@ export function confirmAirCheckout(params) {
url: `/ecw/box-air-checkout/confirmAirCheckout`, url: `/ecw/box-air-checkout/confirmAirCheckout`,
method: "get", method: "get",
params params
}); })
} }
/** /**
...@@ -520,8 +518,8 @@ export function singleAirCreate(data) { ...@@ -520,8 +518,8 @@ export function singleAirCreate(data) {
return request({ return request({
url: "/ecw/box-load-info/singleAirCreate", url: "/ecw/box-load-info/singleAirCreate",
method: "post", method: "post",
data, data
}); })
} }
/** /**
* 批量装柜 * 批量装柜
...@@ -534,6 +532,6 @@ export function batchAirCreate(data) { ...@@ -534,6 +532,6 @@ export function batchAirCreate(data) {
return request({ return request({
url: "/ecw/box-load-info/batchAirCreate", url: "/ecw/box-load-info/batchAirCreate",
method: "post", method: "post",
data, data
}); })
} }
This diff is collapsed.
...@@ -386,7 +386,7 @@ export default { ...@@ -386,7 +386,7 @@ export default {
console.log(r) console.log(r)
this.form.customerId = this.customerId this.form.customerId = this.customerId
this.form.number = r.data.number this.form.number = r.data.number
this.form.nubmerId = r.data.nubmerId this.form.numberId = r.data.numberId
this.form.numberVersion = r.data.numberVersion this.form.numberVersion = r.data.numberVersion
this.form.status = 0 this.form.status = 0
this.init() this.init()
...@@ -407,7 +407,7 @@ export default { ...@@ -407,7 +407,7 @@ export default {
followTime: row.nextTime, followTime: row.nextTime,
nextTime: "", nextTime: "",
number: r.data.number, number: r.data.number,
nubmerId: r.data.nubmerId, numberId: r.data.numberId,
numberVersion: r.data.numberVersion, numberVersion: r.data.numberVersion,
nextPlan: "", nextPlan: "",
status: 0 status: 0
......
...@@ -411,8 +411,9 @@ ...@@ -411,8 +411,9 @@
</div> </div>
<div class="form-section"> <div class="form-section">
<el-form-item :label="$t('竞争对手')" prop="competitor"> <el-form-item :label="$t('竞争对手')" prop="competitor">
<el-select clearable v-model="form.competitor" :placeholder="$t('请选择')" class="w-200"> <el-select clearable v-model="form.competitor" :placeholder="$t('请选择')" class="w-200" @change="changeCompetitor">
<el-option v-for="item in competitorList" :key="item.id" :label="item.name" :value="item.id" /> <el-option v-for="item in competitorList" :key="item.id" :label="item.name" :value="item.id" />
<el-option :label="$t('其他')" :value="0" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('重要程度')" prop="importance"> <el-form-item :label="$t('重要程度')" prop="importance">
...@@ -563,7 +564,7 @@ import { getCustomerContactsSelect } from "@/api/ecw/customerContacts" ...@@ -563,7 +564,7 @@ import { getCustomerContactsSelect } from "@/api/ecw/customerContacts"
import Decimal from "decimal.js" import Decimal from "decimal.js"
import getQuote from "@/views/ecw/customer/index.vue" import getQuote from "@/views/ecw/customer/index.vue"
import { getRegionList } from "@/api/ecw/order" import { getRegionList } from "@/api/ecw/order"
import { competitorListAll } from "@/api/ecw/customer" import { competitorListAll, addCompetitor } from "@/api/ecw/customer"
import { getCustomerContactsListByCustomer } from "@/api/ecw/customerContacts" import { getCustomerContactsListByCustomer } from "@/api/ecw/customerContacts"
import { parse } from "querystring" import { parse } from "querystring"
...@@ -1435,6 +1436,27 @@ export default { ...@@ -1435,6 +1436,27 @@ export default {
arr.push(tmp) arr.push(tmp)
}) })
return arr return arr
},
changeCompetitor(val) {
if (val == 0) {
this.$prompt("请输入主要竞争对手", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消"
}).then((data) => {
console.log(data)
addCompetitor({
name: data.value
}).then((r) => {
this.$message.success("添加成功!")
competitorListAll().then((res) => {
this.competitorList = res.data
this.$nextTick(() => {
this.form.competitor = r.data
})
})
})
})
}
} }
} }
} }
......
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