Commit 4bc4910f by chenwq

feat(交付管理): 添加膜卷号显示与校验功能

在交付详情和新增页面添加膜卷号显示列,并实现膜卷号的必填校验和数量匹配校验
1 parent 8e92bbcd
...@@ -25,32 +25,32 @@ ...@@ -25,32 +25,32 @@
<div> <div>
发货数量: 发货数量:
<span>{{ membraneTypeList.includes(item.goodsType) ? `${item.purchaseNumber}卷` : `${item.purchaseNumber}件` <span>{{ membraneTypeList.includes(item.goodsType) ? `${item.purchaseNumber}卷` : `${item.purchaseNumber}件`
}}</span> }}</span>
<span class="lookNumber" @click="lookNumber(item.deliveryCardList)" <span class="lookNumber" @click="lookNumber(item.deliveryCardList)"
v-if="item.deliveryCardList && item.deliveryCardList.length > 0">查看卡号</span> 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)" <div class="add-btn" @click="addLineTable(index)"
v-if="item.deliveryCardList === null || item.deliveryCardList.length == 0">添加入库记录</div> v-if="item.deliveryCardList === null || item.deliveryCardList.length == 0">添加入库记录</div>
</div> </div>
<el-form ref="addForm" :model="item" size="small" :rules="rules" <el-form ref="addForm" :model="item" size="small" :rules="rules"
v-if="item.deliveryCardList === null || item.deliveryCardList.length == 0"> v-if="item.deliveryCardList === null || item.deliveryCardList.length == 0">
<GLTable :tableData="item.goodsWarehousingList" :noDataImg="url" :tableParams="tableParams" <GLTable :tableData="item.goodsWarehousingList" :noDataImg="url" :tableParams="tableParams"
:hasPage="false"> :hasPage="false">
<template slot="increaseStockNum" slot-scope="scope"> <template slot="increaseStockNum" slot-scope="scope">
<el-form-item style="margin-bottom: 0px" <el-form-item style="margin-bottom: 0px"
:prop="'goodsWarehousingList.' + scope.index + '.increaseStockNum'" :rules="rules.increaseStockNum"> :prop="'goodsWarehousingList.' + scope.index + '.increaseStockNum'" :rules="rules.increaseStockNum">
<el-input v-model="scope.scope.increaseStockNum" placeholder="请输入" <el-input v-model="scope.scope.increaseStockNum" placeholder="请输入"
@blur="handleCalculate(scope.scope, 'increaseStockNum', index)"></el-input> @blur="handleCalculate(scope.scope, 'increaseStockNum', index)"></el-input>
</el-form-item> </el-form-item>
</template> </template>
<template slot="film" slot-scope="scope"> <template slot="film" slot-scope="scope">
<div v-if="manageMode && filmTypeList.includes(detailInfo.goodsType)"> <div v-if="manageMode && filmTypeList.includes(detailInfo.goodsType)">
<el-button v-if="!scope.scope.filmRollList" type="text" <el-button v-if="!scope.scope.filmRollList" type="text"
@click="handleSelectFilm(scope.scope, index, scope.index)">请选择</el-button> @click="handleSelectFilm(scope.scope, index, scope.index)">请选择</el-button>
<div v-else> <div v-else>
<span class="film-txt">...({{ scope.scope.filmRollList.length }})</span> <span class="film-txt">...({{ scope.scope.filmRollList.length }})</span>
<el-button type="text" @click="handleSelectFilm(scope.scope, index, scope.index)">重新选择</el-button> <el-button type="text" @click="handleSelectFilm(scope.scope, index, scope.index)">重新选择</el-button>
...@@ -61,22 +61,22 @@ ...@@ -61,22 +61,22 @@
<!-- 入库仓库 --> <!-- 入库仓库 -->
<template slot="yqMerchantId" slot-scope="scope"> <template slot="yqMerchantId" slot-scope="scope">
<el-form-item style="margin-bottom: 0px" :prop="'goodsWarehousingList.' + scope.index + '.yqMerchantId'" <el-form-item style="margin-bottom: 0px" :prop="'goodsWarehousingList.' + scope.index + '.yqMerchantId'"
:rules="rules.shopMerchantName"> :rules="rules.shopMerchantName">
<el-select style="width: 100%" v-model="scope.scope.yqMerchantId" placeholder="请选择" <el-select style="width: 100%" v-model="scope.scope.yqMerchantId" placeholder="请选择"
@change="handleSelect(scope.scope, scope.scope.yqMerchantId)"> @change="handleSelect(scope.scope, scope.scope.yqMerchantId)">
<el-option v-for="item in storeUsageList" :key="item.merchantNo" :label="item.merchantName" <el-option v-for="item in storeUsageList" :key="item.merchantNo" :label="item.merchantName"
:value="item.merchantNo"></el-option> :value="item.merchantNo"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</template> </template>
<!-- 入库门店 --> <!-- 入库门店 -->
<template slot="merchantId" slot-scope="scope"> <template slot="merchantId" slot-scope="scope">
<el-form-item style="margin-bottom: 0px" :prop="'goodsWarehousingList.' + scope.index + '.merchantId'" <el-form-item style="margin-bottom: 0px" :prop="'goodsWarehousingList.' + scope.index + '.merchantId'"
:rules="rules.merchantId"> :rules="rules.merchantId">
<el-select style="width: 100%" v-model="scope.scope.merchantId" placeholder="请选择" <el-select style="width: 100%" v-model="scope.scope.merchantId" placeholder="请选择"
@change="handleStoreSelect(scope.scope, scope.scope.merchantId)"> @change="handleStoreSelect(scope.scope, scope.scope.merchantId)">
<el-option v-for="item in refByYqShopList" :key="item.merchantId" :label="item.merchantName" <el-option v-for="item in refByYqShopList" :key="item.merchantId" :label="item.merchantName"
:value="item.merchantId"></el-option> :value="item.merchantId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</template> </template>
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
</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" <GLTable class="look-card-wrap" :tableData="tableData" :noDataImg="url" :tableParams="innerParams"
:hasPage="false"> :hasPage="false">
</GLTable> </GLTable>
</el-dialog> </el-dialog>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
...@@ -381,27 +381,29 @@ export default { ...@@ -381,27 +381,29 @@ export default {
for (let i = 0; i < params.deliveryDetailList.length; i++) { for (let i = 0; i < params.deliveryDetailList.length; i++) {
item = params.deliveryDetailList[i] item = params.deliveryDetailList[i]
item.id = this.detailInfo.id item.id = this.detailInfo.id
item.purchaseOrderGoodsId = this.detailInfo.purchaseOrderGoodsId item.purchaseOrderGoodsId = this.detailInfo.purchaseOrderGoodsId
for (let j = 0; j < item.goodsWarehousingList.length; j++) { for (let j = 0; j < item.goodsWarehousingList.length; j++) {
let subItem = item.goodsWarehousingList[j] let subItem = item.goodsWarehousingList[j]
if (this.manageMode) { if (this.manageMode) {
// 校验:膜卷号必填 if (this.membraneTypeList.includes(item.goodsType)) {
if (!subItem.filmRollList || (subItem.filmRollList && subItem.filmRollList.length == 0)) { // 校验:膜卷号必填
this.$message({ if (!subItem.filmRollList || (subItem.filmRollList && subItem.filmRollList.length == 0)) {
message: item.upgradeGoodsName + '请选择膜卷号', this.$message({
type: 'error', message: item.upgradeGoodsName + '请选择膜卷号',
customClass: 'message-Z-zinde' type: 'error',
}) customClass: 'message-Z-zinde'
return true })
} return true
// 校验:入库数量和膜卷号数量相等 }
if (subItem.filmRollList && subItem.filmRollList.length != Math.ceil(subItem.increaseStockNum)) { // 校验:入库数量和膜卷号数量相等
this.$message({ if (subItem.filmRollList && subItem.filmRollList.length != Math.ceil(subItem.increaseStockNum)) {
message: item.upgradeGoodsName + '的入库数量和膜卷号数量不相等', this.$message({
type: 'error', message: item.upgradeGoodsName + '的入库数量和膜卷号数量不相等',
customClass: 'message-Z-zinde' type: 'error',
}) customClass: 'message-Z-zinde'
return true })
return true
}
} }
} }
subItem.increaseStockNum = subItem.increaseStockNum * (item.stockNum / item.purchaseNumber) subItem.increaseStockNum = subItem.increaseStockNum * (item.stockNum / item.purchaseNumber)
......
...@@ -45,6 +45,15 @@ ...@@ -45,6 +45,15 @@
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">
<div v-if="manageMode && membraneTypeList.includes(scope.scope.goodsType)">
<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>
<div v-else>--</div>
</template>
</GLTable> </GLTable>
</el-form> </el-form>
<div v-else class="message"> <div v-else class="message">
...@@ -105,6 +114,11 @@ export default { ...@@ -105,6 +114,11 @@ export default {
addHtml: 'increaseStockNum' addHtml: 'increaseStockNum'
}, },
{ {
label: '膜卷号',
prop: 'filmRollList',
addHtml: 'film'
},
{
label: '入库仓库', label: '入库仓库',
prop: 'yqMerchantName' prop: 'yqMerchantName'
}, },
...@@ -124,15 +138,23 @@ export default { ...@@ -124,15 +138,23 @@ export default {
} }
] ]
}, },
manageMode: false,
tableData: [], tableData: [],
detailInfo: {} detailInfo: {}
} }
}, },
created() { }, created() {
this.getManageMode()
},
methods: { methods: {
handleDetailClose() { handleDetailClose() {
this.dialogShow = false this.dialogShow = false
}, },
getManageMode() {
this.$apis.purchaseShopping.getManageMode({}).then(res => {
this.manageMode = res
})
},
getDetail() { getDetail() {
this.$apis.delivery.getDeliveryDetail({ id: this.id }).then(res => { this.$apis.delivery.getDeliveryDetail({ id: this.id }).then(res => {
const { data } = res const { data } = res
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!