|
@@ -124,13 +124,18 @@
|
|
|
</Col>
|
|
|
<Col span="4" class-name="tables">供应商</Col>
|
|
|
<Col span="12" class-name="tables">
|
|
|
- <Select v-model="form.gys" @on-change="gysChange" filterable style="width: 95%" v-if="orderType == 'add'">
|
|
|
+ <Select
|
|
|
+ v-model="form.gys"
|
|
|
+ @on-change="gysChange"
|
|
|
+ filterable
|
|
|
+ style="width: 95%"
|
|
|
+ v-if="orderType == 'add'"
|
|
|
+ >
|
|
|
<Option
|
|
|
v-for="item in gysList"
|
|
|
:disabled="form.spzt == '2' || form.spzt == '3'"
|
|
|
:value="item.gpId"
|
|
|
:key="item.gpId"
|
|
|
-
|
|
|
>{{ item.gpName }}</Option>
|
|
|
</Select>
|
|
|
<span v-else>{{ form.gysmc }}</span>
|
|
@@ -533,7 +538,7 @@ export default {
|
|
|
//所属区域切换
|
|
|
ssqyChange() {
|
|
|
let postData = {
|
|
|
- areaId: this.form.glqy.split(',')[0],
|
|
|
+ areaId: this.form.glqy.split(",")[0],
|
|
|
userId: localStorage.user_id
|
|
|
};
|
|
|
getProjectList(postData).then(res => {
|
|
@@ -558,13 +563,13 @@ export default {
|
|
|
this.form.glqy = data.areaId + "," + data.areaName;
|
|
|
this.form.glxm = data.projectId + "," + data.projectName;
|
|
|
this.form.djlx = data.type;
|
|
|
- this.form.cgr = data.purchaserId + "," + data.purchaserName;
|
|
|
+ this.form.cgr = data.purchaserName;
|
|
|
this.form.cgrlxfs = data.purchaserTel;
|
|
|
this.form.xdrq = data.orderTime;
|
|
|
this.form.jhsj = [data.deliveryStartTime, data.deliveryEndTime];
|
|
|
this.form.shr = data.receivedName;
|
|
|
this.form.shrlxfs = data.receivedTel;
|
|
|
- this.form.gys = data.gpName;
|
|
|
+ this.form.gys = data.gpId;
|
|
|
this.form.gffzr = data.gpcName;
|
|
|
this.form.gyslxdh = data.gpcPhone;
|
|
|
this.form.spzt = data.approvalState;
|
|
@@ -615,13 +620,14 @@ export default {
|
|
|
},
|
|
|
//编辑采购订单
|
|
|
editCgdd() {
|
|
|
+ let gpName = this.gysList.filter(a => a.gpId == this.form.gys);
|
|
|
let postData = {
|
|
|
areaId: this.form.glqy.split(",")[0],
|
|
|
areaName: this.form.glqy.split(",")[1],
|
|
|
projectId: this.form.glxm.split(",")[0],
|
|
|
projectName: this.form.glxm.split(",")[1],
|
|
|
- purchaserId: this.form.cgr.split(",")[0],
|
|
|
- purchaserName: this.form.cgr.split(",")[1],
|
|
|
+ purchaserId: localStorage.user_id,
|
|
|
+ purchaserName: localStorage.user_name,
|
|
|
purchaserTel: this.form.cgrlxfs,
|
|
|
receivedName: this.form.shr,
|
|
|
receivedTel: this.form.shrlxfs,
|
|
@@ -632,8 +638,8 @@ export default {
|
|
|
type: this.form.djlx,
|
|
|
instruction: this.form.sm,
|
|
|
attachmentList: this.form.filesList,
|
|
|
- gpId: "1000574", //供应商ID
|
|
|
- gpNmae: "", //供应商Name
|
|
|
+ gpId: this.form.gys, //供应商ID
|
|
|
+ gpNmae: gpName.length ? gpName[0].gpName : "", //供应商Name
|
|
|
orderId: this.orderId,
|
|
|
deleteId: this.deleteIds.join(","),
|
|
|
attachmentList: this.form.filesList,
|
|
@@ -643,7 +649,7 @@ export default {
|
|
|
this.tableLoading = true;
|
|
|
editPurchaseOrder(postData).then(res => {
|
|
|
this.spinShow = false;
|
|
|
- this.tableLoading = true;
|
|
|
+ this.tableLoading = false;
|
|
|
if (res.status == 200) {
|
|
|
this.$Message.success("编辑采购订单成功!");
|
|
|
this.getCgddXq(this.orderId);
|
|
@@ -658,13 +664,14 @@ export default {
|
|
|
this.editCgdd();
|
|
|
return false;
|
|
|
}
|
|
|
+ let gpName = this.gysList.filter(a => a.gpId == this.form.gys);
|
|
|
let postData = {
|
|
|
areaId: this.form.glqy.split(",")[0],
|
|
|
areaName: this.form.glqy.split(",")[1],
|
|
|
projectId: this.form.glxm.split(",")[0],
|
|
|
projectName: this.form.glxm.split(",")[1],
|
|
|
- purchaserId: this.form.cgr.split(",")[0],
|
|
|
- purchaserName: this.form.cgr.split(",")[1],
|
|
|
+ purchaserId: localStorage.user_id,
|
|
|
+ purchaserName: localStorage.user_name,
|
|
|
purchaserTel: this.form.cgrlxfs,
|
|
|
receivedName: this.form.shr,
|
|
|
receivedTel: this.form.shrlxfs,
|
|
@@ -676,7 +683,7 @@ export default {
|
|
|
instruction: this.form.sm,
|
|
|
attachmentList: this.form.filesList,
|
|
|
gpId: this.form.gys, //供应商ID
|
|
|
- gpNmae: "" //供应商Name
|
|
|
+ gpNmae: gpName.length ? gpName[0].gpName : "" //供应商Name
|
|
|
};
|
|
|
this.spinShow = true;
|
|
|
addPurchaseOrder(postData).then(res => {
|
|
@@ -695,10 +702,13 @@ export default {
|
|
|
//新增明细
|
|
|
mxAddShow() {
|
|
|
this.contentShow = false;
|
|
|
- this.$refs.mxAdd.getTableData();
|
|
|
this.$refs.mxAdd.orderId = this.orderId;
|
|
|
this.$refs.mxAdd.approvalState = this.form.spzt;
|
|
|
this.$refs.mxAdd.orderState = this.form.ddzt;
|
|
|
+ this.$refs.mxAdd.areaId = this.form.glqy;
|
|
|
+ this.$refs.mxAdd.projectId = this.form.glxm;
|
|
|
+ this.$refs.mxAdd.getTableData();
|
|
|
+ this.$refs.mxAdd.getCk();
|
|
|
},
|
|
|
//列表方法
|
|
|
getTableData() {
|