Commit 3d57c311 by chenwq

fix: 修正膜类商品数量单位显示并优化调拨订单入库逻辑

- 将膜类商品的发货数量和入库数量单位从“卷”改为“米”,以符合业务实际计量方式
- 针对调拨订单(orderType == 1)优化入库流程:自动填充入库信息、隐藏操作按钮并显示只读数据
- 重构保存逻辑,根据订单类型区分处理采购订单和调拨订单的入库操作
- 调整界面显示条件,确保调拨订单不显示“添加入库记录”按钮
1 parent f7f5ccfc
...@@ -32,15 +32,16 @@ ...@@ -32,15 +32,16 @@
</div> </div>
<div> <div>
发货数量: 发货数量:
<span>{{ membraneTypeList.includes(item.goodsType) ? `${item.purchaseNumber}卷` : `${item.purchaseNumber}件`}}</span> <span>{{ membraneTypeList.includes(item.goodsType) ? `${item.purchaseNumber}米` : `${item.purchaseNumber}件`}}</span>
<span class="lookNumber" @click="lookNumber(item.deliveryCardList)" v-if="item.deliveryCardList && item.deliveryCardList.length > 0">查看卡号</span> <span class="lookNumber" @click="lookNumber(item.deliveryCardList)" v-if="item.deliveryCardList && item.deliveryCardList.length > 0">查看卡号</span>
</div> </div>
<div> <div>
可用库存数量: 可用库存数量:
<span>{{ item.stockNum }}{{ membraneTypeList.includes(item.goodsType) ? `米` : `件` }}</span> <span>{{ item.stockNum }}{{ membraneTypeList.includes(item.goodsType) ? `米` : `件` }}</span>
</div> </div>
<div class="add-btn" @click="addLineTable(index)" v-if="item.deliveryCardList === null || item.deliveryCardList.length == 0">添加入库记录</div> <div class="add-btn" @click="addLineTable(index)" v-if="(item.deliveryCardList === null || item.deliveryCardList.length == 0) && detailInfo.orderType != 1">添加入库记录</div>
</div> </div>
<div v-if="detailInfo.orderType != 1">
<el-form ref="addForm" :model="item" size="small" :rules="rules" v-if="item.deliveryCardList === null || item.deliveryCardList.length == 0"> <el-form ref="addForm" :model="item" size="small" :rules="rules" v-if="item.deliveryCardList === null || item.deliveryCardList.length == 0">
<GLTable :tableData="item.goodsWarehousingList" :noDataImg="url" :tableParams="tableParams" :hasPage="false"> <GLTable :tableData="item.goodsWarehousingList" :noDataImg="url" :tableParams="tableParams" :hasPage="false">
<template slot="increaseStockNum" slot-scope="scope"> <template slot="increaseStockNum" slot-scope="scope">
...@@ -81,6 +82,29 @@ ...@@ -81,6 +82,29 @@
</el-form> </el-form>
<div v-else class="message">已自动入库至商户的权益卡管理中,可前往“库存管理-权益卡管理”中查询</div> <div v-else class="message">已自动入库至商户的权益卡管理中,可前往“库存管理-权益卡管理”中查询</div>
</div> </div>
<GLTable v-else :tableData="item.goodsWarehousingList" :noDataImg="url" :tableParams="tableParams" :hasPage="false">
<template slot="increaseStockNum" slot-scope="scope">
<!-- <span>{{ membraneTypeList.includes(detailInfo.goodsType) ? `${scope.scope.increaseStockNum}米` : `${scope.scope.increaseStockNum}件` }}</span> -->
<span>{{ scope.scope.increaseStockNum || scope.scope.increaseStockNum == 0 ?
parseFloat(scope.scope.increaseStockNum).toFixed(2) +
(membraneTypeList.includes(detailInfo.goodsType) ? '米' : '件') : '-' }}</span>
</template>
<template slot="film" slot-scope="scope">
<div>
<el-button v-if="!scope.scope.filmRollList" type="text">--</el-button>
<div v-else>
<span class="film-txt">{{ scope.scope.filmRollList.join(',') }}</span>
</div>
</div>
</template>
<template slot="yqMerchantId" slot-scope="scope">
<span>{{ scope.scope.yqMerchantName || '-' }}</span>
</template>
<template slot="merchantId" slot-scope="scope">
<span>{{ scope.scope.merchantName || '-' }}</span>
</template>
</GLTable>
</div>
</template> </template>
<el-dialog width="750px" title="查看发货卡号" :visible.sync="innerVisible" append-to-body> <el-dialog width="750px" title="查看发货卡号" :visible.sync="innerVisible" append-to-body>
<GLTable class="look-card-wrap" :tableData="tableData" :noDataImg="url" :tableParams="innerParams" :hasPage="false"> <GLTable class="look-card-wrap" :tableData="tableData" :noDataImg="url" :tableParams="innerParams" :hasPage="false">
...@@ -88,7 +112,7 @@ ...@@ -88,7 +112,7 @@
</el-dialog> </el-dialog>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogShow = false">关闭</el-button> <el-button size="small" @click="dialogShow = false">关闭</el-button>
<el-button type="primary" size="small" @click="handleSave" :loading="loading">保存入库</el-button> <el-button type="primary" size="small" @click="beforeSave" :loading="loading">保存入库</el-button>
</span> </span>
</GLDialog> </GLDialog>
<filmDialog :visible.sync="filmVisible" :info="info" maxAddNumAttr="stockAddNum" @handleConfirm="handleFilmConfirm"> <filmDialog :visible.sync="filmVisible" :info="info" maxAddNumAttr="stockAddNum" @handleConfirm="handleFilmConfirm">
...@@ -148,7 +172,7 @@ export default { ...@@ -148,7 +172,7 @@ export default {
tableOption: true, tableOption: true,
tableColumns: [ tableColumns: [
{ {
label: '入库数量/卷', label: '入库数量',
prop: 'increaseStockNum', prop: 'increaseStockNum',
addHtml: 'increaseStockNum' addHtml: 'increaseStockNum'
}, },
...@@ -177,6 +201,7 @@ export default { ...@@ -177,6 +201,7 @@ export default {
{ validator: checkPrice, trigger: 'blur' } { validator: checkPrice, trigger: 'blur' }
] ]
}, },
// orderType 订单类型 0:采购订单; 1:调拨订单
detailInfo: {}, detailInfo: {},
innerVisible: false, innerVisible: false,
innerParams: { innerParams: {
...@@ -311,16 +336,21 @@ export default { ...@@ -311,16 +336,21 @@ export default {
upgradeGoodsId: data.upgradeGoodsId, upgradeGoodsId: data.upgradeGoodsId,
goodsWarehousingList: [ goodsWarehousingList: [
{ {
increaseStockNum: '', increaseStockNum: data.orderType == 1 ? data.stockNum : '',
yqMerchantId: '', yqMerchantId: data.orderType == 1 ? data.callInYqMerchantId : '',
yqMerchantName: '', yqMerchantName: data.orderType == 1 ? data.callInYqMerchantName : '',
merchantId: '', merchantId: data.orderType == 1 ? data.callInMerchantId : '',
merchantName: '' merchantName: data.orderType == 1 ? data.callInMerchantName : ''
} }
] ]
} }
] ]
this.detailInfo = data this.detailInfo = data
if (this.detailInfo.orderType == 1) {
this.tableParams.tableOption = false
this.detailInfo.deliveryDetailList[0].goodsWarehousingList[0].filmRollList = data.filmRollNo ? [data.filmRollNo] : null
}
console.log(this.detailInfo, 'this.detailInfo---')
this.getMerchantList() this.getMerchantList()
} }
}) })
...@@ -351,6 +381,52 @@ export default { ...@@ -351,6 +381,52 @@ export default {
}) })
}) })
}, },
addPurchaseOrderApi(params) {
this.loading = true
this.$apis.delivery.addPurchaseOrder(params).then(res => {
this.loading = false
if (res.code == 0) {
this.$message({
type: 'success',
message: '操作成功!',
customClass: 'message-Z-zinde'
})
this.dialogShow = false
this.$emit('handleSuccess')
} else {
this.$message({
type: 'error',
message: res.message,
customClass: 'message-Z-zinde'
})
}
})
},
beforeSave() {
if (this.loading) {
return
}
this.detailInfo.orderType == 1 ? this.handleTransferSave() : this.handleSave()
},
handleTransferSave() {
console.log(this.detailInfo)
let deliveryDetailList = this.detailInfo.deliveryDetailList
let params = {
deliveryDetailList: this.$common.utils.deepClone(deliveryDetailList)
}
// console.log(this.detailInfo, 'this.detailInfo---')
for (let i = 0; i < params.deliveryDetailList.length; i++) {
let item = params.deliveryDetailList[i]
item.id = this.detailInfo.id
item.purchaseOrderGoodsId = this.detailInfo.purchaseOrderGoodsId
item.allocateOrderGoodsId = this.detailInfo.allocateOrderGoodsId
params.id = this.detailInfo.orderDeliveryId
}
this.addPurchaseOrderApi(params)
},
handleSave() { handleSave() {
let num = 0 let num = 0
this.$refs['addForm'].forEach(async item => { this.$refs['addForm'].forEach(async item => {
...@@ -363,7 +439,7 @@ export default { ...@@ -363,7 +439,7 @@ export default {
if (num == this.$refs['addForm'].length) { if (num == this.$refs['addForm'].length) {
let deliveryDetailList = this.detailInfo.deliveryDetailList.filter(item => { let deliveryDetailList = this.detailInfo.deliveryDetailList.filter(item => {
if (item.deliveryCardList.length == 0) { if (item.deliveryCardList === null || item.deliveryCardList.length == 0) {
return item return item
} }
}) })
...@@ -404,25 +480,7 @@ export default { ...@@ -404,25 +480,7 @@ export default {
params.id = this.detailInfo.orderDeliveryId params.id = this.detailInfo.orderDeliveryId
} }
// console.log(params, 'params----') // console.log(params, 'params----')
this.loading = true this.addPurchaseOrderApi(params)
this.$apis.delivery.addPurchaseOrder(params).then(res => {
this.loading = false
if (res.code == 0) {
this.$message({
type: 'success',
message: '操作成功!',
customClass: 'message-Z-zinde'
})
this.dialogShow = false
this.$emit('handleSuccess')
} else {
this.$message({
type: 'error',
message: res.message,
customClass: 'message-Z-zinde'
})
}
})
} }
}) })
} }
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</div> </div>
<div> <div>
发货数量: 发货数量:
<span>{{ membraneTypeList.includes(detailInfo.goodsType) ? `${detailInfo.purchaseNumber}卷` : <span>{{ membraneTypeList.includes(detailInfo.goodsType) ? `${detailInfo.purchaseNumber}米` :
`${detailInfo.purchaseNumber}件` }}</span> `${detailInfo.purchaseNumber}件` }}</span>
<span class="lookNumber" @click="lookNumber(detailInfo.deliveryCardList)" v-if="detailInfo.deliveryCardList && detailInfo.deliveryCardList.length > 0">查看卡号</span> <span class="lookNumber" @click="lookNumber(detailInfo.deliveryCardList)" v-if="detailInfo.deliveryCardList && detailInfo.deliveryCardList.length > 0">查看卡号</span>
</div> </div>
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<span>{{ scope.scope.increaseStockNum || scope.scope.increaseStockNum == 0 ? <span>{{ scope.scope.increaseStockNum || scope.scope.increaseStockNum == 0 ?
(membraneTypeList.includes(scope.scope.goodsType) ? parseFloat(scope.scope.increaseStockNum / (membraneTypeList.includes(scope.scope.goodsType) ? parseFloat(scope.scope.increaseStockNum /
scope.scope.alternateUnits).toFixed(2) : parseFloat(scope.scope.increaseStockNum).toFixed(2)) + scope.scope.alternateUnits).toFixed(2) : parseFloat(scope.scope.increaseStockNum).toFixed(2)) +
(membraneTypeList.includes(scope.scope.goodsType) ? '卷' : '件') : '-' }}</span> (membraneTypeList.includes(scope.scope.goodsType) ? '米' : '件') : '-' }}</span>
</template> </template>
<template slot="film" slot-scope="scope"> <template slot="film" slot-scope="scope">
<div v-if="manageMode && membraneTypeList.includes(scope.scope.goodsType)"> <div v-if="manageMode && membraneTypeList.includes(scope.scope.goodsType)">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!