|
@@ -162,6 +162,7 @@
|
|
|
fit
|
|
|
max-height="300"
|
|
|
@selection-change="handleSelectionChange"
|
|
|
+ :key="refreshData"
|
|
|
>
|
|
|
<el-table-column show-overflow-tooltip type="selection"/>
|
|
|
<el-table-column show-overflow-tooltip label="序号" type="index" align="center"/>
|
|
@@ -201,7 +202,7 @@
|
|
|
<el-table-column show-overflow-tooltip label="预留比例" align="center" prop="reservedProportion" width="150px">
|
|
|
<template slot-scope="scope">
|
|
|
<el-form-item class="hang">
|
|
|
- <el-select clearable :disabled="sonDisable" size="small" v-model="scope.row.reservedProportion">
|
|
|
+ <el-select clearable :disabled="sonDisable" size="small" v-model="scope.row.reservedProportion" @change="getYLSL(scope.$index,scope.row.reservedProportion)">
|
|
|
<el-option v-for=" dict in dict.type.sys_reserve_ratio" :key="dict.value" :label="dict.label" :value="dict.value">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
@@ -263,7 +264,7 @@
|
|
|
<el-table-column show-overflow-tooltip label="实际(业务)需求量" align="center" prop="qty" width="120px">
|
|
|
<template slot-scope="scope">
|
|
|
<el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'qty'" :rules="{ required: true, message: '请填写实际(业务)需求量', trigger: 'blur' }">
|
|
|
- <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.qty"/>
|
|
|
+ <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.qty" @blur="getYL(scope.$index, scope.row.qty)"/>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -370,7 +371,7 @@
|
|
|
<!-- <el-table-column show-overflow-tooltip label="末级供应调拨待入量" align="center" prop="lastStockQty" width="150px"/> -->
|
|
|
<!-- <el-table-column show-overflow-tooltip label="上级供应中心现存量" align="center" prop="superiorCenterQty" width="200px"/> -->
|
|
|
<!-- <el-table-column show-overflow-tooltip label="上级库存被调拨占用量" align="center" prop="superiorAllotQty" width="200px"/> -->
|
|
|
- <!-- <el-table-column show-overflow-tooltip label="可用量" align="center" prop="availableQty"/> -->
|
|
|
+ <el-table-column show-overflow-tooltip label="可用量" align="center" prop="availableQty"/>
|
|
|
<el-table-column show-overflow-tooltip label="调拨状态" align="center" prop="statusAllot" width="100px">
|
|
|
<template slot-scope="scope">
|
|
|
<el-form-item class="hang">
|
|
@@ -429,7 +430,7 @@
|
|
|
<el-table-column show-overflow-tooltip label="详细地址" align="center" prop="address" width="200px"/>
|
|
|
<el-table-column show-overflow-tooltip label="价格类型" align="center" prop="priceType" width="150px">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-form-item class="hang">
|
|
|
+ <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'priceType'" :rules="{ required: true, message: '请选择价格类型', trigger: 'blur' }">
|
|
|
<el-select clearable :disabled="sonDisable" size="small" v-model="scope.row.priceType">
|
|
|
<el-option v-for=" dict in dict.type.sys_price_type" :key="dict.value" :label="dict.label" :value="dict.value">
|
|
|
</el-option>
|
|
@@ -549,7 +550,9 @@ export default {
|
|
|
personOptions: [],
|
|
|
deptOptions: [],
|
|
|
customerOptions: [],
|
|
|
- isBDXQ: false
|
|
|
+ isBDXQ: false,
|
|
|
+ // 刷新表格数据
|
|
|
+ refreshData: 0
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -598,6 +601,27 @@ export default {
|
|
|
return '总供应可满足'
|
|
|
}
|
|
|
},
|
|
|
+ // 获取预留数量
|
|
|
+ getYLSL(index,val) {
|
|
|
+ if (val) {
|
|
|
+ let newVal = val.replace('%', '')
|
|
|
+ newVal = newVal/100
|
|
|
+ this.basicForm.puDemandItemList[index].reservedQty = newVal * this.basicForm.puDemandItemList[index].qty
|
|
|
+ } else {
|
|
|
+ this.basicForm.puDemandItemList[index].reservedQty = null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 实际业务需求量获取
|
|
|
+ getYL(index, val) {
|
|
|
+ if (this.basicForm.puDemandItemList[index].qty && this.basicForm.puDemandItemList[index].reservedProportion) {
|
|
|
+ let newVal = this.basicForm.puDemandItemList[index].reservedProportion.replace('%', '')
|
|
|
+ newVal = newVal/100
|
|
|
+ // this.$set(this.basicForm.puDemandItemList[index].reservedQty, this.basicForm.puDemandItemList[index].qty * newVal)
|
|
|
+ this.basicForm.puDemandItemList[index].reservedQty = this.basicForm.puDemandItemList[index].qty * newVal
|
|
|
+ } else {
|
|
|
+ this.basicForm.puDemandItemList[index].reservedQty = null
|
|
|
+ }
|
|
|
+ },
|
|
|
copy() {
|
|
|
this.$modal.msgSuccess("复制成功");
|
|
|
this.sonPageStu = 'add'
|
|
@@ -605,12 +629,14 @@ export default {
|
|
|
this.getDetails(this.row)
|
|
|
this.basicForm.id = ''
|
|
|
this.basicForm.code = ''
|
|
|
+ this.basicForm.createBy = ''
|
|
|
},
|
|
|
handleData() {
|
|
|
console.log('222')
|
|
|
- // 复制新增把id,编码置为空,子表去掉id
|
|
|
+ // 复制新增把id,编码,创建人置为空,子表去掉id
|
|
|
this.basicForm.id = ''
|
|
|
this.basicForm.code = ''
|
|
|
+ this.basicForm.createBy = ''
|
|
|
if (this.basicForm.puDemandItemList.length !== 0) {
|
|
|
this.basicForm.puDemandItemList.forEach(item => {
|
|
|
if (item.id) {
|
|
@@ -746,7 +772,7 @@ export default {
|
|
|
contactsPhone: null,
|
|
|
address: null,
|
|
|
source: null,
|
|
|
- priceType: null,
|
|
|
+ priceType: 'order',
|
|
|
puManagerApprover: null,
|
|
|
puManagerApproverName: null,
|
|
|
processTime: null,
|
|
@@ -931,7 +957,7 @@ export default {
|
|
|
this.basicForm.puDemandItemList[this.tableIndex].contacts = null
|
|
|
this.basicForm.puDemandItemList[this.tableIndex].contactsPhone = null
|
|
|
this.basicForm.puDemandItemList[this.tableIndex].address = null
|
|
|
- this.basicForm.puDemandItemList[this.tableIndex].priceType = null
|
|
|
+ this.basicForm.puDemandItemList[this.tableIndex].priceType = 'order'
|
|
|
this.basicForm.puDemandItemList[this.tableIndex].lastWarehouseName = null
|
|
|
this.basicForm.puDemandItemList[this.tableIndex].lastWarehouse = null
|
|
|
this.basicForm.puDemandItemList[this.tableIndex].lastAllocation = null
|