Commit a70a22c0 authored by 邓春圆's avatar 邓春圆

Merge remote-tracking branch 'origin/release' into release

parents 08ba7d4f 0abd6edf
...@@ -79,8 +79,10 @@ export default { ...@@ -79,8 +79,10 @@ export default {
if(index < 0){ if(index < 0){
getProduct(this.value).then(res => { getProduct(this.value).then(res => {
this.list.unshift(res.data) this.list.unshift(res.data)
this.$nextTick(() => {
this.index = 0 this.index = 0
}) })
})
}else this.index = index }else this.index = index
}, },
onFocus(){ onFocus(){
......
...@@ -94,10 +94,14 @@ export default { ...@@ -94,10 +94,14 @@ export default {
} }
}, },
created() { created() {
this.updateMessage() // 未避免频繁内存溢出,减少请求记录感染,开发的时候不轮询消息
if(process.env.NODE_ENV != 'development'){
setInterval(() => { setInterval(() => {
this.updateMessage() this.updateMessage()
}, 10000) }, 10000)
}
this.updateMessage()
}, },
components: { components: {
Breadcrumb, Breadcrumb,
......
...@@ -16,7 +16,7 @@ const service = axios.create({ ...@@ -16,7 +16,7 @@ const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分 // axios中请求配置有baseURL选项,表示请求URL公共部分
baseURL: (localStorage.VUE_APP_BASE_API || process.env.VUE_APP_BASE_API) + '/admin-api/', // 此处的 /admin-api/ 地址,原因是后端的基础路径为 /admin-api/ baseURL: (localStorage.VUE_APP_BASE_API || process.env.VUE_APP_BASE_API) + '/admin-api/', // 此处的 /admin-api/ 地址,原因是后端的基础路径为 /admin-api/
// 超时 // 超时
timeout: 10000 timeout: 1000 * 30
}) })
// request拦截器 // request拦截器
service.interceptors.request.use(config => { service.interceptors.request.use(config => {
......
...@@ -282,7 +282,7 @@ export default { ...@@ -282,7 +282,7 @@ export default {
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
}, },
// 退场拆单,跟出货装柜拆单一样 // 退场拆单,跟出货装柜拆单一样
customs_exit_part_split: { exit_split: {
component: "BoxSplitDetail", component: "BoxSplitDetail",
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
}, },
......
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
<el-button type="text" @click="showWarehouse(scope.row)">{{scope.row.num}}</el-button> <el-button type="text" @click="showWarehouse(scope.row)">{{scope.row.num}}</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="`${$t('数量')}($t('个')`" align="center"> <el-table-column :label="$t('数量(个)')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row.quantity}}</span> <span>{{scope.row.quantity}}</span>
</template> </template>
...@@ -214,12 +214,12 @@ ...@@ -214,12 +214,12 @@
<el-form ref="shopForm" :model="shopForm" :rules="shopRules" label-width="150px" inline> <el-form ref="shopForm" :model="shopForm" :rules="shopRules" label-width="150px" inline>
<el-form-item :label="$t('中文品名')+':'" prop="orderItemId"> <el-form-item :label="$t('中文品名')+':'" prop="orderItemId">
<el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择中文品名')"> <el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择中文品名')">
<el-option v-for="item in orderItems" :label="item.prodTitleZh" :value="item.orderItemId" :key="item.id" :disabled="itemDisabled(item)"></el-option> <el-option v-for="item in orderItems" :label="item.prodTitleZh" :value="item.orderItemId" :key="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('英文品名')+':'" prop="orderItemId"> <el-form-item :label="$t('英文品名')+':'" prop="orderItemId">
<el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择英文品名')"> <el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择英文品名')">
<el-option v-for="item in orderItems" :label="item.prodTitleEn" :value="item.orderItemId" :key="item.id" :disabled="itemDisabled(item)"></el-option> <el-option v-for="item in orderItems" :label="item.prodTitleEn" :value="item.orderItemId" :key="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -281,7 +281,11 @@ ...@@ -281,7 +281,11 @@
<el-table-column :label="$t('快递单号')" prop="expressNo"></el-table-column> <el-table-column :label="$t('快递单号')" prop="expressNo"></el-table-column>
<el-table-column :label="$t('储位')" prop="orderLocationBackVOList"> <el-table-column :label="$t('储位')" prop="orderLocationBackVOList">
<template v-slot="{ row, column, $index }"> <template v-slot="{ row, column, $index }">
{{row.orderLocationList}} <warehouse-area-select
v-model="row.orderLocationBackVOList"
readonly
:warehouse-id="currentWarehouseId"
></warehouse-area-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('操作')"> <el-table-column :label="$t('操作')">
...@@ -483,6 +487,10 @@ export default { ...@@ -483,6 +487,10 @@ export default {
getOrderWarehouseIn(this.queryParams.orderId).then(res => { getOrderWarehouseIn(this.queryParams.orderId).then(res => {
this.warehouseInList = res.data this.warehouseInList = res.data
}) })
this.$nextTick(() => {
window.$vm = this
})
}, },
watch: { watch: {
//监听table这个对象 //监听table这个对象
...@@ -503,6 +511,16 @@ export default { ...@@ -503,6 +511,16 @@ export default {
}); });
}, },
}, },
// 切换放入品名
'shopForm.orderItemId'(){
// 默认取以前放入的品名
this.shopForm.specsRecordVOList = []
let specsRecordVOList = this.splitData.orderSplitItemBackVOList.find(item => item.orderItemId == this.shopForm.orderItemId)?.specsRecordVOList || []
specsRecordVOList.forEach(item => {
const [boxGauge1, boxGauge2, boxGauge3] = item.boxGauge.split('*')
this.shopForm.specsRecordVOList.push({...item, boxGauge1, boxGauge2, boxGauge3})
})
}
}, },
computed: { computed: {
isAudit() { isAudit() {
...@@ -599,14 +617,6 @@ export default { ...@@ -599,14 +617,6 @@ export default {
getWarehouseInspecsRecordVOList(){ getWarehouseInspecsRecordVOList(){
return warehouseInId => { return warehouseInId => {
let specsRecordVOList = [] let specsRecordVOList = []
// 这里是拆单已放入的
this.splitData.orderSplitItemBackVOList.forEach(splitItem => {
splitItem.specsRecordVOList.forEach(specs => {
if(specs.warehouseInId === warehouseInId){
specsRecordVOList.push(specs)
}
})
})
// 这里是正在操作放入,但是还没确定提交的 // 这里是正在操作放入,但是还没确定提交的
this.shopForm.specsRecordVOList.forEach(item => { this.shopForm.specsRecordVOList.forEach(item => {
if(item.warehouseInId == warehouseInId)specsRecordVOList.push(item) if(item.warehouseInId == warehouseInId)specsRecordVOList.push(item)
...@@ -627,7 +637,14 @@ export default { ...@@ -627,7 +637,14 @@ export default {
// 获取入仓记录的剩余数据 // 获取入仓记录的剩余数据
getWarehouseLeftData(){ getWarehouseLeftData(){
return (warehouseRecord, field) => { return (warehouseRecord, field) => {
let total = new Decimal(warehouseRecord[ field == 'num' ? 'cartonsNum' : field ] || 0) let warehouseField = field
if(field === 'num'){
warehouseField = 'cartonsNum'
}
if(field === 'quantity'){
warehouseField = 'quantityAll'
}
let total = new Decimal(warehouseRecord[ warehouseField ] || 0)
this.getWarehouseInspecsRecordVOList(warehouseRecord.id).forEach(item => { this.getWarehouseInspecsRecordVOList(warehouseRecord.id).forEach(item => {
total = total.minus(new Decimal(item[field] || 0)) total = total.minus(new Decimal(item[field] || 0))
}) })
...@@ -641,9 +658,9 @@ export default { ...@@ -641,9 +658,9 @@ export default {
// 剩余可拆箱数 // 剩余可拆箱数
leftSplitNum(){ leftSplitNum(){
let num = this.maxNum - this.putin.num let num = this.maxNum - this.putin.num
this.splitData.orderSplitItemBackVOList.forEach(item =>{ /*this.splitData.orderSplitItemBackVOList.forEach(item =>{
num -= item.num num -= item.num
}) })*/
return num return num
} }
}, },
...@@ -685,13 +702,13 @@ export default { ...@@ -685,13 +702,13 @@ export default {
this.mainOrder = data.find(item => item.isMaster) this.mainOrder = data.find(item => item.isMaster)
}); });
}, },
itemDisabled(data) { /*itemDisabled(data) {
const { orderSplitItemBackVOList = [] } = this.splitData; const { orderSplitItemBackVOList = [] } = this.splitData;
const isExist = orderSplitItemBackVOList.find( const isExist = orderSplitItemBackVOList.find(
(item) => item.orderItemId === data.orderItemId (item) => item.orderItemId === data.orderItemId
); );
return isExist ? true : false; return isExist ? true : false;
}, },*/
/* 查询拆单项 */ /* 查询拆单项 */
querySplitGoods() { querySplitGoods() {
getSplitList({ getSplitList({
...@@ -910,7 +927,7 @@ export default { ...@@ -910,7 +927,7 @@ export default {
if(!locationArr || !locationArr.length) return '' if(!locationArr || !locationArr.length) return ''
let arr = [] let arr = []
locationArr.forEach(item => { locationArr.forEach(item => {
arr.push(`${item.areaName}${item.locationName || ''}`) arr.push(`${item.areaName || ''}${item.locationName || ''}`)
}) })
return Array.from(new Set(arr)).join(",") return Array.from(new Set(arr)).join(",")
}, },
...@@ -935,6 +952,7 @@ export default { ...@@ -935,6 +952,7 @@ export default {
const rate = this.putin.num / orderItem.warehouseInInfoVO.cartonsNum const rate = this.putin.num / orderItem.warehouseInInfoVO.cartonsNum
this.$set(this.shopForm, 'chargeVolume', (orderItem.chargeVolume*rate).toFixed(2)) this.$set(this.shopForm, 'chargeVolume', (orderItem.chargeVolume*rate).toFixed(2))
this.$set(this.shopForm, 'chargeWeight', (orderItem.chargeWeight*rate).toFixed(2)) this.$set(this.shopForm, 'chargeWeight', (orderItem.chargeWeight*rate).toFixed(2))
this.$set(this.shopForm, 'worth', (orderItem.worth*rate).toFixed(2))
}, },
// 清空放入记录 // 清空放入记录
clearAll(){ clearAll(){
......
...@@ -563,14 +563,24 @@ export default { ...@@ -563,14 +563,24 @@ export default {
const { columns, data } = param; const { columns, data } = param;
const sums = []; const sums = [];
columns.forEach((column, index) => { columns.forEach((column, index) => {
if (column.property === "brandType") { if (column.property === "feeType") {
sums[index] = this.$t("合计"); sums[index] = this.$t("合计");
return; return;
} }
if (column.property === "num") { if (column.property === "warehouseInInfoVO.cartonsNum") {
sums[index] = new Decimal( var num = 0
this.calcSum(column.property, data) let values = data?.map((item) => Number(item.warehouseInInfoVO.cartonsNum)) ?? [];
).toNumber(); if (!values.every((value) => isNaN(value))) {
num = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
}
sums[index] = num
} }
if (column.property === "volumeWeight") { if (column.property === "volumeWeight") {
let volume = this.calcSum("volume", data); let volume = this.calcSum("volume", data);
......
...@@ -320,7 +320,7 @@ ...@@ -320,7 +320,7 @@
style="margin-bottom: 0" style="margin-bottom: 0"
:prop="`receiptAccountList.${scope.$index}.platformAccountId`" :prop="`receiptAccountList.${scope.$index}.platformAccountId`"
> >
<el-select <!-- <el-select
v-model="scope.row.platformAccountId" v-model="scope.row.platformAccountId"
:placeholder="$t('请选择收款账户')" :placeholder="$t('请选择收款账户')"
@change="(platformAccountId)=>changePlatformAccountId(platformAccountId,scope.$index)" @change="(platformAccountId)=>changePlatformAccountId(platformAccountId,scope.$index)"
...@@ -331,6 +331,21 @@ ...@@ -331,6 +331,21 @@
:label="item.baAccountName + '(' + item.baAccountNum + ')'" :label="item.baAccountName + '(' + item.baAccountNum + ')'"
:value="item.id" :value="item.id"
/> />
</el-select> -->
<el-select
filterable
clear
v-model="scope.row.platformAccountId"
:placeholder="$t('请选择收款账户')"
@change="(platformAccountId)=>changePlatformAccountId(platformAccountId,scope.$index)"
v-el-select-loadmore="loadmore"
:loading="codeLoading">
<el-option
v-for="(item, i) in bankData"
:key="'opt-code' + i"
:label="item.baAccountName + '(' + item.baAccountNum + ')'"
:value="item.id"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</template> </template>
...@@ -743,7 +758,14 @@ export default { ...@@ -743,7 +758,14 @@ export default {
warehouseList:[], warehouseList:[],
selectedUsers:[], selectedUsers:[],
dialogVisible:false, dialogVisible:false,
isUpdate:false isUpdate:false,
codeLoading: false,
codePage: {
pageNo: 1,
pageSize: 100
},
pages:1
}; };
}, },
activated(){ activated(){
...@@ -759,6 +781,22 @@ export default { ...@@ -759,6 +781,22 @@ export default {
this.removeData() this.removeData()
} }
}, },
directives: {
'el-select-loadmore': {
bind (el, binding) {
const SELECTWRAP_DOM = el.querySelector(
'.el-select-dropdown .el-select-dropdown__wrap'
)
SELECTWRAP_DOM.addEventListener('scroll', function () {
const condition =
this.scrollHeight - this.scrollTop <= this.clientHeight
if (condition) {
binding.value()
}
})
}
}
},
async created() { async created() {
getUserProfile().then(res => { getUserProfile().then(res => {
this.discountForm.author = res.data.username this.discountForm.author = res.data.username
...@@ -802,9 +840,7 @@ export default { ...@@ -802,9 +840,7 @@ export default {
listSimpleUsers().then((res) => (that.creatorData = res.data)); listSimpleUsers().then((res) => (that.creatorData = res.data));
getChannelList().then((res) => (that.channelList = res.data)); getChannelList().then((res) => (that.channelList = res.data));
getTradeCityList().then((res) => (that.tradeCityList = res.data)); getTradeCityList().then((res) => (that.tradeCityList = res.data));
getBankAccountPage(that.params).then( this.getCodeList()
(res) => (that.bankData = res.data.list)
);
listSimpleDepts().then((res) => { listSimpleDepts().then((res) => {
res.data.forEach((item) => { res.data.forEach((item) => {
if (item.parentId == 0) { if (item.parentId == 0) {
...@@ -856,6 +892,29 @@ export default { ...@@ -856,6 +892,29 @@ export default {
} }
}, },
methods: { methods: {
// 懒加载
loadmore () {
this.codePage.pageNo++
// 大于页码不请求了
console.log(111)
if (this.codePage.pageNo > this.pages) {
return
}
this.getCodeList()
},
getCodeList (flag) {
if (flag) {
this.bankData = []
this.codeLoading = true
}
setTimeout(() => {
getBankAccountPage(this.codePage).then(res => {
this.codeLoading = false
this.bankData = this.bankData.concat(res.data.list)
this.pages = (res.data.total/this.codePage.pageSize)+1
})
}, 200)
},
getReceivableData(){ getReceivableData(){
getReceiptInfoByIds({ id: this.id }).then(res => { getReceiptInfoByIds({ id: this.id }).then(res => {
if(res.data.rateValidateDate) res.data.rateValidateDate = dayjs(res.data.rateValidateDate).format('YYYY-MM-DD HH:mm:ss') if(res.data.rateValidateDate) res.data.rateValidateDate = dayjs(res.data.rateValidateDate).format('YYYY-MM-DD HH:mm:ss')
......
...@@ -66,9 +66,12 @@ ...@@ -66,9 +66,12 @@
<el-table-column :label="$t('数量')"> <el-table-column :label="$t('数量')">
<template slot-scope="{row}">{{row.quantity}}</template> <template slot-scope="{row}">{{row.quantity}}</template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('货值')">
<template slot-scope="{row}">{{row.worth}}{{$t('')}}</template>
</el-table-column>
</el-table> </el-table>
</template> </template>
<warehouse-record v-if="currentWarehouseRecord" :list="currentWarehouseRecord" append-to-body></warehouse-record> <warehouse-record v-if="currentWarehouseRecord" :list="currentWarehouseRecord" append-to-body @close="currentWarehouseRecord=null"></warehouse-record>
</div> </div>
</template> </template>
<script> <script>
......
...@@ -66,12 +66,15 @@ ...@@ -66,12 +66,15 @@
<el-table-column :label="$t('数量')"> <el-table-column :label="$t('数量')">
<template slot-scope="{row}">{{row.quantity}}</template> <template slot-scope="{row}">{{row.quantity}}</template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('货值')">
<template slot-scope="{row}">{{row.worth}}{{$t('')}}</template>
</el-table-column>
<el-table-column :label="$t('备注')"> <el-table-column :label="$t('备注')">
<template slot-scope="{row}">{{row.remark}}</template> <template slot-scope="{row}">{{row.remark}}</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</template> </template>
<warehouse-record v-if="currentWarehouseRecord" :list="currentWarehouseRecord" append-to-body></warehouse-record> <warehouse-record v-if="currentWarehouseRecord" :list="currentWarehouseRecord" append-to-body @close="currentWarehouseRecord=null"></warehouse-record>
</div> </div>
</template> </template>
<script> <script>
...@@ -89,7 +92,7 @@ export default { ...@@ -89,7 +92,7 @@ export default {
detail: null, detail: null,
order: null, order: null,
channel: null, channel: null,
orderSplitBackVOList: [], // orderSplitBackVOList: [],
// 查看入仓记录的条目 // 查看入仓记录的条目
currentWarehouseRecord: null currentWarehouseRecord: null
} }
...@@ -99,7 +102,7 @@ export default { ...@@ -99,7 +102,7 @@ export default {
this.getData() this.getData()
}, },
detail(){ detail(){
this.getSplit() // this.getSplit()
this.getOrder() this.getOrder()
}, },
order(){ order(){
...@@ -108,6 +111,11 @@ export default { ...@@ -108,6 +111,11 @@ export default {
} }
} }
}, },
computed:{
orderSplitBackVOList(){
return this.detail ? this.detail.orderSplitBackVOList : []
}
},
created(){ created(){
if(this.id){ if(this.id){
this.getData() this.getData()
...@@ -119,12 +127,12 @@ export default { ...@@ -119,12 +127,12 @@ export default {
this.detail = JSON.parse(res.data.details) this.detail = JSON.parse(res.data.details)
}) })
}, },
getSplit(){ /*getSplit(){
getSplitList({orderId: this.detail.orderId, lang: this.$i18n.locale.toLowerCase().indexOf('zh') > -1 ? 0 : 1 }).then(res => { getSplitList({orderId: this.detail.orderId, lang: this.$i18n.locale.toLowerCase().indexOf('zh') > -1 ? 0 : 1 }).then(res => {
console.log('getSplitList', res) console.log('getSplitList', res)
this.orderSplitBackVOList = res.data.orderSplitBackVOList this.orderSplitBackVOList = res.data.orderSplitBackVOList
}) })
}, },*/
getOrder(){ getOrder(){
getOrder(this.detail.orderId).then(res => { getOrder(this.detail.orderId).then(res => {
this.order = res.data this.order = res.data
......
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
<el-form-item label-width="0" <el-form-item label-width="0"
:prop="`list.${$index}.volume`" :prop="`list.${$index}.volume`"
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}"> :rules="{required: true, message: $t('不能为空'), trigger: 'blur'}">
<el-input-number controls-position="right" :min="0" :max="warehouseRecord.volume" class="w-100 tight" v-model="row.volume"/> <el-input-number controls-position="right" :min="0.01" :max="warehouseRecord.volume" class="w-100 tight" v-model="row.volume"/>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
<el-form-item label-width="0" <el-form-item label-width="0"
:prop="`list.${$index}.weight`" :prop="`list.${$index}.weight`"
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}"> :rules="{required: true, message: $t('不能为空'), trigger: 'blur'}">
<el-input-number controls-position="right" :min="0" :max="warehouseRecord.weight" class="w-75 tight" v-model="row.weight"/> <el-input-number controls-position="right" :min="0.01" :max="warehouseRecord.weight" class="w-75 tight" v-model="row.weight"/>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -230,7 +230,7 @@ export default { ...@@ -230,7 +230,7 @@ export default {
// 数量是否必须 // 数量是否必须
quantityshow: Boolean, quantityshow: Boolean,
// 最大可拆箱数,装柜拆单用 // 最大可拆箱数,装柜拆单用
maxNum: Number maxNum: Number,
}, },
data(){ data(){
return { return {
...@@ -242,7 +242,7 @@ export default { ...@@ -242,7 +242,7 @@ export default {
} }
}, },
computed:{ computed:{
// 计算总拆出数据 // 计算当前添加的多条入仓记录总拆出数据
splitTotal(){ splitTotal(){
return field => { return field => {
let total = new Decimal(0) let total = new Decimal(0)
...@@ -252,6 +252,18 @@ export default { ...@@ -252,6 +252,18 @@ export default {
return total.toNumber() return total.toNumber()
} }
}, },
// 计算此入仓记录全部拆出的数量,包含其他拆单订单的
totalSplitSum(){
return field => {
let total = new Decimal(0)
if(this.warehouseRecord.specsRecordVOList && this.warehouseRecord.specsRecordVOList.length){
this.warehouseRecord.specsRecordVOList.forEach(item => {
total = total.plus(new Decimal(item[field] || 0))
})
}
return total.plus(new Decimal(this.splitTotal('num'))).toNumber()
}
},
// 剩余数据 // 剩余数据
leftData(){ leftData(){
return (field, containNew = false) => { return (field, containNew = false) => {
...@@ -289,20 +301,34 @@ export default { ...@@ -289,20 +301,34 @@ export default {
methods:{ methods:{
// 添加一行 // 添加一行
addRow(){ addRow(){
let { specificationType, boxGauge1, boxGauge2, boxGauge3, volume, weight, expressNo } = this.warehouseRecord let { specificationType, boxGauge1, boxGauge2, boxGauge3, expressNo, unit } = this.warehouseRecord
let num = Math.min(this.leftData('num', true), this.maxSplitNum) let num = Math.min(this.leftData('num', true), this.maxSplitNum)
let orderLocationList = this.warehouseRecord.orderLocationBackVOList
if(this.form.list.length){
orderLocationList = this.form.list[this.form.list.length - 1].orderLocationList
}
// 根据入仓记录添加一行 // 根据入仓记录添加一行
let row = { let row = {
warehouseInId: this.warehouseRecord.id, warehouseInId: this.warehouseRecord.id,
specificationType, boxGauge1, boxGauge2, boxGauge3, expressNo, specificationType, boxGauge1, boxGauge2, boxGauge3, expressNo,unit,
volume: 0,// this.leftData('volume', true), volume: 0,
weight: 0, //this.leftData('weight', true), weight: 0,
num: num, num: num,
quantity: 0, //this.leftData('quantity', true), quantity: 0,
orderLocationList: this.warehouseRecord.orderLocationBackVOList orderLocationList
} }
// 如果拆完了则剩下的全部放入,否则按照比例计算
this.$nextTick(() =>{
if(this.leftData('num', true) <= 0 ) {
row.volume = this.leftData('volume', true)
row.weight = this.leftData('weight', true)
row.quantity = this.leftData('quantity', true)
}else{
// 按照比例计算重量体积和数量 // 按照比例计算重量体积和数量
this.calc(row) this.calc(row)
}
})
this.form.list.push(row) this.form.list.push(row)
}, },
// 删除一行,可选参数index表上行号,参数不是数字则删除最后一行 // 删除一行,可选参数index表上行号,参数不是数字则删除最后一行
...@@ -365,7 +391,7 @@ export default { ...@@ -365,7 +391,7 @@ export default {
return this.$message.error("全拆拆出体积必须等于原入仓体积") return this.$message.error("全拆拆出体积必须等于原入仓体积")
} }
if(this.splitTotal('weight') !== this.warehouseRecord.weight){ if(this.splitTotal('weight') !== this.warehouseRecord.weight){
return this.$message.error("全拆拆出体积必须等于原入仓体积") return this.$message.error("全拆拆出重量必须等于原入仓体积")
} }
} }
this.$emit('submit', this.form.list) this.$emit('submit', this.form.list)
......
...@@ -31,14 +31,19 @@ ...@@ -31,14 +31,19 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('体积') + '(m³)'" prop="volume" /> <el-table-column :label="$t('体积') + '(m³)'" prop="volume" />
<el-table-column :label="$t('重量') + '(kg)'" prop="weight" /> <el-table-column :label="$t('重量') + '(kg)'" prop="weight" />
<el-table-column :label="$t('数量(个)')" prop="quantityAll" /> <el-table-column :label="$t('数量(个)')" prop="quantity" />
<!--<el-table-column :label="$t('入仓快递单号')" prop="expressNo" />--> <!--<el-table-column :label="$t('入仓快递单号')" prop="expressNo" />-->
<!--<el-table-column :label="$t('首次入仓时间')" prop="inTime" > <!--<el-table-column :label="$t('首次入仓时间')" prop="inTime" >
<template slot-scope="{row}">{{row.inTime|parseTime}}</template> <template slot-scope="{row}">{{row.inTime|parseTime}}</template>
</el-table-column>--> </el-table-column>-->
<el-table-column :label="$t('储位')" prop="orderLocationBackVOList" > <el-table-column :label="$t('储位')" prop="orderLocationBackVOList" >
<template slot-scope="{row}"> <template slot-scope="{row}">
{{getLocationName(row.orderLocationBackVOList)}} <!--{{getLocationName(row.orderLocationList)}}-->
<warehouse-area-select
v-model="row.orderLocationList"
readonly
:warehouse-id="warehouseId"
></warehouse-area-select>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -46,13 +51,17 @@ ...@@ -46,13 +51,17 @@
</template> </template>
<script> <script>
import WarehouseAreaSelect from "@/components/WarehouseAreaSelect/index.vue";
export default { export default {
name: "WarehouseRecord", name: "WarehouseRecord",
components: {WarehouseAreaSelect},
props:{ props:{
list:{ list:{
type: Array, type: Array,
default: [] default: []
}, },
warehouseId: Number,
appendToBody: Boolean appendToBody: Boolean
}, },
data(){ data(){
......
...@@ -108,6 +108,7 @@ ...@@ -108,6 +108,7 @@
<span style="margin-left: 10px;">{{$t('箱数')}}:{{!scope.row.warehouseInInfoVO?0:scope.row.warehouseInInfoVO.cartonsNum}}</span> <span style="margin-left: 10px;">{{$t('箱数')}}:{{!scope.row.warehouseInInfoVO?0:scope.row.warehouseInInfoVO.cartonsNum}}</span>
<span style="margin-left: 10px;">{{$t('体积')}}:{{!scope.row.warehouseInInfoVO?0:scope.row.warehouseInInfoVO.volume}}m³</span> <span style="margin-left: 10px;">{{$t('体积')}}:{{!scope.row.warehouseInInfoVO?0:scope.row.warehouseInInfoVO.volume}}m³</span>
<span style="margin-left: 10px;">{{$t('重量')}}:{{!scope.row.warehouseInInfoVO?0:scope.row.warehouseInInfoVO.weight}}kg</span> <span style="margin-left: 10px;">{{$t('重量')}}:{{!scope.row.warehouseInInfoVO?0:scope.row.warehouseInInfoVO.weight}}kg</span>
<span style="margin-left: 10px;">{{$t('数量(个)')}}:{{!scope.row.warehouseInInfoVO?0:scope.row.warehouseInInfoVO.quantityAll}}</span>
</el-row> </el-row>
<el-row v-if="!scope.row.warehouseInInfoVO"> <el-row v-if="!scope.row.warehouseInInfoVO">
<span>{{$t('暂时没有入仓信息')}}</span> <span>{{$t('暂时没有入仓信息')}}</span>
...@@ -163,9 +164,7 @@ ...@@ -163,9 +164,7 @@
<el-table-column :label="$t('入仓体积')" align="center" > <el-table-column :label="$t('入仓体积')" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.volume" @change="updateField(scope.row, 'volume')" size="mini" disabled> {{scope.row.volume}}
<span slot="append"></span>
</el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('收费体积')" align="center" > <el-table-column :label="$t('收费体积')" align="center" >
...@@ -177,9 +176,7 @@ ...@@ -177,9 +176,7 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('入仓重量')" align="center"> <el-table-column :label="$t('入仓重量')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.weight" @change="updateField(scope.row, 'weight')" size="mini" disabled> {{scope.row.weight}}kg
<span slot="append">kg</span>
</el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('收费重量')" align="center"> <el-table-column :label="$t('收费重量')" align="center">
...@@ -196,11 +193,14 @@ ...@@ -196,11 +193,14 @@
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('箱数')" align="center"> <el-table-column :label="$t('箱数')" align="center" prop="num">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="showWarehouse(scope.row)">{{scope.row.num}}</el-button> <el-button type="text" @click="currentWarehouseRecord=scope.row.specsRecordVOList">
{{ scope.row.num }}
</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('数量(个)')" align="center" prop="quantity"></el-table-column>
<el-table-column :label="$t('操作')" align="center"> <el-table-column :label="$t('操作')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-delete" @click="removeShop(scope.row.id)">{{$t('移出')}}</el-button> <el-button size="mini" type="text" icon="el-icon-delete" @click="removeShop(scope.row.id)">{{$t('移出')}}</el-button>
...@@ -445,7 +445,11 @@ ...@@ -445,7 +445,11 @@
</span> </span>
</el-dialog> </el-dialog>
<warehouse-record v-if="currentWarehouseRecord" :list="currentWarehouseRecord" @close="currentWarehouseRecord=null"></warehouse-record> <warehouse-record
v-if="currentWarehouseRecord"
:list="currentWarehouseRecord"
:warehouseId="currentWarehouseId"
@close="currentWarehouseRecord=null"></warehouse-record>
<put-in <put-in
v-if="currentPutIn" v-if="currentPutIn"
:warehouse-record="currentPutIn" :warehouse-record="currentPutIn"
...@@ -533,7 +537,7 @@ export default { ...@@ -533,7 +537,7 @@ export default {
page:1, page:1,
rows:20 rows:20
}, },
splitItemIndex:0, // splitItemIndex:0,
quantitySum:0, quantitySum:0,
// 当前查看的入仓记录 // 当前查看的入仓记录
currentWarehouseRecord: null, currentWarehouseRecord: null,
...@@ -593,7 +597,16 @@ export default { ...@@ -593,7 +597,16 @@ export default {
}, },
// 切换品名需要重置已放入的记录 // 切换品名需要重置已放入的记录
'shopForm.orderItemId'(){ 'shopForm.orderItemId'(){
// 默认取以前放入的品名
let split = this.splitData.find(item => item.id == this.splitData[this.splitIndex].id)
this.shopForm.specsRecordVOList = [] this.shopForm.specsRecordVOList = []
if(split) {
let specsRecordVOList = split.orderSplitItemBackVOList.find(item => item.orderItemId == this.shopForm.orderItemId)?.specsRecordVOList || []
specsRecordVOList.forEach(item => {
const [boxGauge1, boxGauge2, boxGauge3] = item.boxGauge.split('*')
this.shopForm.specsRecordVOList.push({...item, boxGauge1, boxGauge2, boxGauge3})
})
}
} }
}, },
computed:{ computed:{
...@@ -610,8 +623,8 @@ export default { ...@@ -610,8 +623,8 @@ export default {
}, },
// 主单数据,也就是拆分剩余的数据,可用来限制拆单放入的最大值 // 主单数据,也就是拆分剩余的数据,可用来限制拆单放入的最大值
mainOrderItem(){ mainOrderItem(){
if(!this.orderItem.orderItemId || !this.splitData.length || !this.splitData[0].orderSplitItemBackVOList) return {} if(!this.shopForm.orderItemId) return {}
return this.splitData[0].orderSplitItemBackVOList.find(item => item.orderItemId == this.orderItem.orderItemId) || {} return this.orderData.orderItemVOList.find(item => item.orderItemId === this.shopForm.orderItemId)
}, },
// 剩余可拆数据,父订单的入仓数据 - 全部拆单的品名数据 // 剩余可拆数据,父订单的入仓数据 - 全部拆单的品名数据
leftData(){ leftData(){
...@@ -630,6 +643,11 @@ export default { ...@@ -630,6 +643,11 @@ export default {
this.splitData.forEach(split => { this.splitData.forEach(split => {
split.orderSplitItemBackVOList.forEach(splitItem => { split.orderSplitItemBackVOList.forEach(splitItem => {
// 正在拆的要排除,不然会重复计算
if(splitItem.orderItemId == this.shopForm.orderItemId && split.id == this.splitData[this.splitIndex].id){
return
}
// 每个品名的入仓记录挨个累减其他数据 // 每个品名的入仓记录挨个累减其他数据
if(splitItem.orderItemId == this.shopForm.orderItemId){ if(splitItem.orderItemId == this.shopForm.orderItemId){
// 每个品名都要累减收费数据 // 每个品名都要累减收费数据
...@@ -714,9 +732,13 @@ export default { ...@@ -714,9 +732,13 @@ export default {
return warehouseInId => { return warehouseInId => {
let specsRecordVOList = [] let specsRecordVOList = []
// 这里是全部已放入的 // 这里是全部已放入的
this.splitData.forEach(split => { this.splitData.forEach((split, splitIndex) => {
split.orderSplitItemBackVOList.forEach(splitItem => { split.orderSplitItemBackVOList.forEach(splitItem => {
splitItem.specsRecordVOList.forEach(specs => { // 当前正在拆的品名不包含,因为后面shopForm.specsRecordVOList会包含
if(splitIndex == this.splitIndex && splitItem.orderItemId == this.shopForm.orderItemId){
return
}
splitItem.specsRecordVOList && splitItem.specsRecordVOList.forEach(specs => {
if(specs.warehouseInId === warehouseInId){ if(specs.warehouseInId === warehouseInId){
specsRecordVOList.push(specs) specsRecordVOList.push(specs)
} }
...@@ -865,7 +887,7 @@ export default { ...@@ -865,7 +887,7 @@ export default {
}) })
}, },
addShop(index){ addShop(index){
this.splitItemIndex = index this.splitIndex = index
this.shopOpen = true this.shopOpen = true
// 重置表单数据 // 重置表单数据
this.shopForm = {specsRecordVOList:[]} this.shopForm = {specsRecordVOList:[]}
...@@ -968,15 +990,32 @@ export default { ...@@ -968,15 +990,32 @@ export default {
var params = { var params = {
num:this.putin.num, num:this.putin.num,
orderItemId:this.shopForm.orderItemId, orderItemId:this.shopForm.orderItemId,
orderSplitId:this.splitData[this.splitItemIndex].id, orderSplitId:this.splitData[this.splitIndex].id,
remark:this.shopForm.remark, remark:this.shopForm.remark,
volume: this.putin.volume, volume: this.putin.volume,
chargeVolume: this.putin.chargeVolume, chargeVolume: this.shopForm.chargeVolume,
weight: this.putin.weight, weight: this.putin.weight,
chargeWeight: this.putin.chargeWeight, chargeWeight: this.shopForm.chargeWeight,
worth: this.shopForm.worth || 0, worth: this.shopForm.worth || 0,
specsRecordVOList:this.shopForm.specsRecordVOList specsRecordVOList:this.shopForm.specsRecordVOList
} }
// 体积重量不能为0
const fields = {
'volume': this.$t('体积'),
'weight': this.$t('重量'),
'chargeVolume': this.$t('收费体积'),
'chargeWeight': this.$t('收费重量'),
}
let errFields = []
Object.keys(fields).forEach(field => {
if(params[field] < 0.01){
errFields.push(fields[field])
}
})
if(errFields.length){
return this.$message.error(this.$t("{field}最少为0.01", {field: errFields.join(",")}))
}
/*if(this.quantityshow){ /*if(this.quantityshow){
params.quantity = this.shopForm.quantity params.quantity = this.shopForm.quantity
}*/ }*/
......
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