simple 5 years ago
parent
commit
4a83c78d1b

+ 10 - 10
src/page/purchase/components/balance/balanceAdd.vue

@@ -319,9 +319,9 @@ export default {
     uploadFilesSuccess(response, file, fileList) {
       this.uploading = false;
       this.form.filesList.push({
-        fileName: response.fileInfo.fName,
+        fileName: response.data.fileName,
         // fullName: response.fileInfo.fName,
-        filePath: response.fileInfo.resPath
+        filePath: response.data.filePath
         // fileDetailType: ""
       });
     },
@@ -375,7 +375,7 @@ export default {
           getProjectList(postData).then(res => {
             this.glxmList = res.items;
           });
-          let gys = this.gysList.filter(a => a.gpId == val);
+          let gys = this.gysList.filter(a => a.gpId == data.supplierId);
           if (gys.length) {
             this.form.gffzr = gys[0].gpcName;
             this.form.gyslxdh = gys[0].gpcPhone;
@@ -390,7 +390,7 @@ export default {
       let postData = {
         settlementId: this.settlementId,
         areaId: this.form.glqy,
-        areaName: this.glqyList.filter(a => a.value == this.form.glqy)[0].label,
+        areaName: this.glqyList.filter(a => a.areaId == this.form.glqy)[0].areaName,
         supplierId: this.form.gys,
         supplierPrincipal: this.form.gffzr,
         supplierTel: this.form.gyslxdh,
@@ -401,9 +401,8 @@ export default {
         adjustmentPrice: this.form.tzje,
         instruction: this.form.sm,
         attachmentList: this.form.filesList,
-        applicantId: this.form.sqr,
-        applicantName: this.sqrList.filter(a => a.value == this.form.sqr)[0]
-          .label,
+        applicantId: localStorage.user_id,
+        applicantName: localStorage.user_name,
         attachmentList: this.form.filesList,
         detailList: this.tableData
       };
@@ -433,9 +432,9 @@ export default {
       let postData = {
         areaId: this.form.glqy,
         projectId: this.form.glxm,
-        areaName: this.glqyList.filter(a => a.value == this.form.glqy)[0].label,
-        projectName: this.glxmList.filter(a => a.value == this.form.glxm)[0]
-          .label,
+        areaName: this.glqyList.filter(a => a.areaId == this.form.glqy)[0].areaName,
+        projectName: this.glxmList.filter(a => a.projectId == this.form.glxm)[0]
+          .projectName,
         supplierId: this.form.gys,
         supplierPrincipal: this.form.gffzr,
         supplierTel: this.form.gyslxdh,
@@ -466,6 +465,7 @@ export default {
     addMxShow() {
       this.contentShow = false;
       this.$refs.mxAdd.gysId = this.form.gys;
+      this.$refs.mxAdd.addForm.ssxm = this.form.ssxm;
       this.$refs.mxAdd.getTableData();
     },
     //列表方法

+ 1 - 0
src/page/purchase/components/balance/balanceMxAdd.vue

@@ -72,6 +72,7 @@ export default {
   data() {
     return {
       gysId: "",
+      xmId: "",
       //新增结算明细表单
       addForm: {
         ssxm: "", //项目名称

+ 24 - 14
src/page/purchase/components/order/orderAdd.vue

@@ -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() {

+ 23 - 6
src/page/purchase/components/order/orderMxAdd.vue

@@ -1,14 +1,14 @@
 <template>
   <div>
     <Card style="width:100%" :bordered="false" :dis-hover="true">
-      <p slot="title">添加申购计划物料</p>
+      <p slot="title">添加采购订单物料</p>
       <div slot="extra">
         <Button @click="$emit('return')">返回</Button>
       </div>
       <Row :gutter="10" style="margin-bottom: 10px">
         <Col span="4">
           <Select v-model="searchForm.ck" placeholder="仓库名">
-            <Option v-for="item in ckList" :value="item.value" :key="item.value">{{ item.label }}</Option>
+            <Option v-for="item in ckList" :value="item.twId" :key="item.twId">{{ item.twName }}</Option>
           </Select>
         </Col>
         <Col span="4">
@@ -54,7 +54,11 @@
 </template>
 
 <script>
-import { queryPurchasePoolList, tbiGoodsCategoryList } from "@/service/getData";
+import {
+  queryPurchasePoolList,
+  tbiGoodsCategoryList,
+  warehouseList
+} from "@/service/getData";
 export default {
   data() {
     return {
@@ -62,6 +66,7 @@ export default {
       approvalState: "",
       orderState: "",
       areaId: "",
+      projectId: "",
       type: "",
       //新增物料申请表单
       addForm: {
@@ -182,10 +187,10 @@ export default {
         pageSize: 10,
         firstClassId: this.searchForm.yjfl,
         secondClassId: this.searchForm.ejfl,
-        areaIds: this.areaId,
+        areaIds: this.areaId.split(',')[0],
         queryText1: this.searchForm.wlmc,
         queryText2: "",
-        projectIds: "",
+        projectIds: this.projectId.split(',')[0],
         storehouseId: this.searchForm.ck
       };
       queryPurchasePoolList(postData).then(res => {
@@ -197,7 +202,7 @@ export default {
     },
     pageChange(val) {
       this.pageNum = val;
-      this.getTableData()
+      this.getTableData();
     },
     tableOnSelect(selection, row) {
       this.tableSelect = selection;
@@ -205,6 +210,18 @@ export default {
     tableOnCancel(selection, row) {
       this.tableSelect = selection;
     },
+    //获取仓库
+    getCk() {
+      let postData = {
+        areaId: this.areaId.split(',')[0],
+        projectId: this.projectId.split(',')[0]
+      };
+      warehouseList(postData).then(res => {
+        if (res.status == 200) {
+          this.ckList = res.data;
+        }
+      });
+    },
     //一级分类切换
     yjflChange(val) {
       let arr = this.allFlList.filter(a => a.parentId == val);

+ 2 - 2
src/page/purchase/components/order/orderPrint.vue

@@ -28,7 +28,7 @@
           <Col :span="7" class="infor">供方负责人:{{ printData.gpcName }}</Col>
           <Col :span="7" class="infor">FAX:{{ printData.gpcFax }}</Col>
           <Col :span="10" class="infor">TEL:{{ printData.gpcPhone }}</Col>
-          <Col :span="7" class="infor">申购部门:{{ }}</Col>
+          <Col :span="7" class="infor">申购部门:{{ printData.archName }}</Col>
           <Col :span="7" class="infor">申购人:{{ printData.applicantName }}</Col>
           <Col :span="10" class="infor">TEL:{{ printData.purchaserTel}}</Col>
           <Col
@@ -71,7 +71,7 @@
               <td>{{ item.detailList[0].billedAmount }}</td>
               <td>{{ item.price }}</td>
               <td>{{ item.totalPrice }}</td>
-              <td>{{ item.remark }}</td>
+              <td>{{ item.printRemark }}</td>
             </tr>
             <tr>
               <td colspan="2">总金额:</td>

+ 2 - 1
src/page/purchase/components/plan/planMxAdd.vue

@@ -274,7 +274,8 @@ export default {
         gcId: this.searchForm.ejfl,
         sgNo: "",
         sgName: "",
-        projectId: this.projectId.split(',')[0]
+        // projectId: this.projectId.split(',')[0]
+        projectId: 10
         // queryText1: this.searchForm.wlmc
         // projectIds: this.projectId.split(',')[0]
       };