|
@@ -56,7 +56,9 @@
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
<el-form-item label="客户负责人">
|
|
|
- <el-input disabled v-model="basicForm.customerPrincipal" size="small" style="width: 200px"></el-input>
|
|
|
+ <el-select disabled size="small" v-model="basicForm.customerPrincipal" style="width: 200px">
|
|
|
+ <el-option v-for="item in manOptions" :key="item.id" :label="item.name" :value="item.code"/>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
@@ -419,7 +421,7 @@
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column> -->
|
|
|
- <el-table-column show-overflow-tooltip label="末级供应库存组织" align="center" prop="superiorStockOrgName" width="200px"></el-table-column>
|
|
|
+ <el-table-column show-overflow-tooltip label="末级供应库存组织" align="center" prop="lastStockOrgName" width="200px"></el-table-column>
|
|
|
<el-table-column show-overflow-tooltip label="中心仓可用量" align="center" prop="centralWarehouseQty" width="200px"/>
|
|
|
<el-table-column show-overflow-tooltip label="调拨单号" align="center" prop="allotCode"></el-table-column>
|
|
|
<el-table-column show-overflow-tooltip label="收货地址" align="center" prop="deliveryAddressName" width="200px">
|
|
@@ -535,6 +537,7 @@ export default {
|
|
|
remark: '',
|
|
|
puDemandItemList: []
|
|
|
},
|
|
|
+ delDemandItemList: [],
|
|
|
options: [{
|
|
|
value: 'Y', label: '是',
|
|
|
}, {
|
|
@@ -554,6 +557,7 @@ export default {
|
|
|
// },
|
|
|
tableIndex: null,
|
|
|
orgOptions: [],
|
|
|
+ manOptions: [],
|
|
|
personOptions: [],
|
|
|
deptOptions: [],
|
|
|
customerOptions: [],
|
|
@@ -626,7 +630,9 @@ export default {
|
|
|
},
|
|
|
// 获取预留数量
|
|
|
getYLSL(scope) {
|
|
|
- scope.row.reservedQty = Math.ceil(scope.row.reservedProportion.replace('%', '') / 100 * scope.row.qty)
|
|
|
+ if (scope.row.reservedProportion) {
|
|
|
+ scope.row.reservedQty = Math.ceil(scope.row.reservedProportion.replace('%', '') / 100 * scope.row.qty)
|
|
|
+ }
|
|
|
// 如果选择预留比例,预留周期必填
|
|
|
if(scope.row.reservedQty && scope.row.reservedQty !== 0) {
|
|
|
this.isYl = true
|
|
@@ -665,10 +671,12 @@ export default {
|
|
|
this.$refs['basic'].validate((valid) => {
|
|
|
if(valid) {
|
|
|
if(this.sonPageStu == 'add') {
|
|
|
+ this.$modal.loading("操作中...");
|
|
|
this.handleData()
|
|
|
addDemand(this.basicForm).then(res => {
|
|
|
console.log(333)
|
|
|
if (res.code === 200) {
|
|
|
+ this.$modal.closeLoading();
|
|
|
this.$modal.msgSuccess("保存成功");
|
|
|
this.$emit('jugislist', true)
|
|
|
let queryParams = {
|
|
@@ -679,10 +687,18 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
} else if (this.sonPageStu == 'edit') {
|
|
|
+ this.$modal.loading("操作中...");
|
|
|
+ this.basicForm.puDemandItemList.push(...this.delDemandItemList)
|
|
|
editDemand(this.basicForm).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
+ this.$modal.closeLoading();
|
|
|
this.$modal.msgSuccess("编辑成功");
|
|
|
- this.back()
|
|
|
+ this.$emit('jugislist', true)
|
|
|
+ let queryParams = {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10
|
|
|
+ }
|
|
|
+ this.$emit('refresh', queryParams)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -818,12 +834,23 @@ export default {
|
|
|
this.BDZT = true
|
|
|
}
|
|
|
},
|
|
|
- delLine(index) {
|
|
|
+ delLine(index, row) {
|
|
|
console.log('删除行:', index)
|
|
|
+ console.log('改变行:', row)
|
|
|
// this.basicForm.puDemandItemList = this.basicForm.puDemandItemList.filter(item => {
|
|
|
// return item.id !== row.id
|
|
|
// })
|
|
|
- this.basicForm.puDemandItemList.splice(index,1)
|
|
|
+ row.delFlag = '2'
|
|
|
+ // this.basicForm.puDemandItemList.splice(index,1)
|
|
|
+ let delList = []
|
|
|
+ delList = this.basicForm.puDemandItemList.filter(item => {
|
|
|
+ return item.delFlag == '2'
|
|
|
+ })
|
|
|
+ this.basicForm.puDemandItemList = this.basicForm.puDemandItemList.filter(item => {
|
|
|
+ return item.delFlag == '0'
|
|
|
+ })
|
|
|
+ this.delDemandItemList.push(...delList)
|
|
|
+ console.log('删除的数组',this.delDemandItemList)
|
|
|
},
|
|
|
back() {
|
|
|
this.$emit('jugislist', true)
|
|
@@ -847,7 +874,8 @@ export default {
|
|
|
this.basicForm = reciveForm
|
|
|
if(this.basicForm.org) { this.reBackRefer('ORG_PARAM', this.basicForm.org) }
|
|
|
if(this.basicForm.customer) { this.reBackRefer('CUSTOMER_PARAM', this.basicForm.customer) }
|
|
|
- if(this.basicForm.demandPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.demandPersonal) }
|
|
|
+ if(this.basicForm.customerPrincipal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.customerPrincipal, '客户负责人') }
|
|
|
+ if(this.basicForm.demandPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.demandPersonal, '需求人员') }
|
|
|
if(this.basicForm.demandDept) { this.reBackRefer('DEPT_PARAM', this.basicForm.demandDept) }
|
|
|
// 详情时将收货仓库id赋值给stordocId
|
|
|
// 如果业务类型为补单需求,则明细内补单供应商编码可以编辑
|
|
@@ -873,7 +901,7 @@ export default {
|
|
|
this.dialog.config = val
|
|
|
},
|
|
|
// 回显参照框
|
|
|
- reBackRefer(type, id) {
|
|
|
+ reBackRefer(type, id, title) {
|
|
|
getRefer({type: type, id: id}).then(res => {
|
|
|
if(type == 'ORG_PARAM') {
|
|
|
this.orgOptions = res.rows
|
|
@@ -881,9 +909,12 @@ export default {
|
|
|
if (type == 'CUSTOMER_PARAM') {
|
|
|
this.customerOptions = res.rows
|
|
|
}
|
|
|
- if (type == 'CONTACTS_PARAM') {
|
|
|
+ if (type == 'CONTACTS_PARAM' && title == '需求人员') {
|
|
|
this.personOptions = res.rows
|
|
|
}
|
|
|
+ if (type == 'CONTACTS_PARAM' && title == '客户负责人') {
|
|
|
+ this.manOptions = res.rows
|
|
|
+ }
|
|
|
if (type == 'DEPT_PARAM') {
|
|
|
this.deptOptions = res.rows
|
|
|
}
|