|
@@ -103,6 +103,13 @@
|
|
|
<fileUpload :fileList="fileList" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :xs="24" :sm="8" :lg="8">
|
|
|
+ <el-form-item label="仓库" prop="warehouse">
|
|
|
+ <el-select v-model="mainForm.warehouse" placeholder="请选择仓库" size="small" filterable clearable disabled style="width: 100%">
|
|
|
+ <el-option :label="item.name" :value="item.id" v-for="(item, index) in warehouseList" :key="index"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :xs="24" :sm="12" :lg="8">
|
|
@@ -257,7 +264,6 @@
|
|
|
<el-input v-model="scope.row.invoiceNum" size="small" type="number"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" label="仓库" prop="correspondName" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
<!-- <el-table-column align="center" label="总库存数量" prop="stockAdequate" min-width="100" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
{{stockFilter(scope.row, 1)}}
|
|
@@ -343,6 +349,7 @@ export default {
|
|
|
remark: '',
|
|
|
createMan: '',
|
|
|
createDate: '',
|
|
|
+ warehouse: '',
|
|
|
},
|
|
|
mainFormRules: {
|
|
|
// orderDate: [{ required: true, message: '请选择单据日期', trigger: 'change' }],
|
|
@@ -371,6 +378,7 @@ export default {
|
|
|
|
|
|
tableGoodsList: [],
|
|
|
tableSelection: [],
|
|
|
+ isFirst: false,
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -386,12 +394,31 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
|
|
|
+ watch: {
|
|
|
+ goodsList: {
|
|
|
+ handler(newValue, oldValue) {
|
|
|
+ if(this.goodsList && this.goodsList.length) {
|
|
|
+ if(this.isFirst) {
|
|
|
+ this.isFirst = false;
|
|
|
+ }else {
|
|
|
+ this.mainForm.warehouse = this.goodsList[0].correspondId;
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ this.mainForm.warehouse = '';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate: true,
|
|
|
+ deep: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
created() {
|
|
|
this.getDictList();
|
|
|
this.getWarehouseList();
|
|
|
this.getDealerList();
|
|
|
this.getCategoryList();
|
|
|
if(this.listItem) {
|
|
|
+ this.isFirst = true;
|
|
|
this.getDetail();
|
|
|
}else {
|
|
|
this.mainForm.jxsNum = JSON.parse(localStorage.getItem("supply_user")).customerNumber;
|
|
@@ -444,7 +471,7 @@ export default {
|
|
|
this.mainForm.createMan = data.createBy;
|
|
|
this.mainForm.createDate = data.createTime;
|
|
|
this.mainForm.remark = data.remark;
|
|
|
- this.screenForm.warehouse = data.correspondId;
|
|
|
+ this.mainForm.warehouse = data.correspondId;
|
|
|
this.fileList = data.fileUrl ? [{
|
|
|
url: data.fileUrl,
|
|
|
name: data.fileName,
|
|
@@ -703,10 +730,6 @@ export default {
|
|
|
this.$errorMsg('申请数量需为负数');
|
|
|
return;
|
|
|
}
|
|
|
- if(!this.goodsList[i].correspondId) {
|
|
|
- this.$errorMsg('请选择仓库');
|
|
|
- return;
|
|
|
- }
|
|
|
}
|
|
|
// if(!this.screenForm.warehouse) {
|
|
|
// return this.$errorMsg('请选择仓库');
|
|
@@ -723,6 +746,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+ let warehouseItem = this.warehouseList.find(o => o.id === this.mainForm.warehouse);
|
|
|
let params = {
|
|
|
remark: this.mainForm.remark,
|
|
|
enginOrderNo: this.mainForm.loginNum,
|
|
@@ -737,8 +761,8 @@ export default {
|
|
|
remark: this.mainForm.remark,
|
|
|
fileUrl: this.fileList && this.fileList.length > 0 ? this.fileList[0].url : '',
|
|
|
fileName: this.fileList && this.fileList.length > 0 ? this.fileList[0].name : '',
|
|
|
- correspondId: this.goodsList[0].correspondId,
|
|
|
- correspondName: this.goodsList[0].correspondName,
|
|
|
+ correspondId: this.mainForm.warehouse,
|
|
|
+ correspondName: warehouseItem.name,
|
|
|
salesOrderId: this.goodsList[0].id,
|
|
|
orders: goodsList,
|
|
|
examineStatus: status,
|