Commit 4bc4910f by chenwq

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

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