Эх сурвалжийг харах

Merge branch 'purchaseDev' into 'dev'

Purchase dev

See merge request new-business/drp-web!170
黄梓星 2 жил өмнө
parent
commit
e2f298e5c2

+ 8 - 0
src/api/purchase/deliveryAddress.js

@@ -37,4 +37,12 @@ export function delAddress(ids) {
     url: `/pu/delivery/address/delete/${ids}`,
     url: `/pu/delivery/address/delete/${ids}`,
     method: 'DELETE',
     method: 'DELETE',
   })
   })
+}
+// 收货地址档案同步NC
+export function toNc(data) {
+  return request({
+    url: `/pu/delivery/address/toNc`,
+    method: 'post',
+    data: data
+  })
 }
 }

+ 1 - 1
src/views/purchase/DemandSummary/index.vue

@@ -171,7 +171,7 @@
             <el-row :gutter="10">
             <el-row :gutter="10">
               <el-col :span="1.5">
               <el-col :span="1.5">
                 <el-form-item label="物料编码">
                 <el-form-item label="物料编码">
-                  <el-input clearable size="mini" v-model="queryParams.names" @focus="chooseMaterial" style="width: 200px">
+                  <el-input clearable size="mini" v-model="queryParams.names" @clear="queryParams.materialCode = ''" @focus="chooseMaterial" style="width: 200px">
                     <el-button size="mini" slot="append" icon="el-icon-more" @click="chooseMaterial"></el-button>
                     <el-button size="mini" slot="append" icon="el-icon-more" @click="chooseMaterial"></el-button>
                   </el-input>
                   </el-input>
                   <el-input v-show="false" v-model="queryParams.materialCode"></el-input>
                   <el-input v-show="false" v-model="queryParams.materialCode"></el-input>

+ 2 - 0
src/views/purchase/PurchaseDemandList/add.vue

@@ -815,8 +815,10 @@ export default {
       }
       }
     },
     },
     submit() {
     submit() {
+      this.$modal.loading("提交中...");
       submitDemand(this.basicForm).then(res => {
       submitDemand(this.basicForm).then(res => {
         if (res.code === 200) {
         if (res.code === 200) {
+          this.$modal.closeLoading();
           this.$modal.msgSuccess("提交成功");
           this.$modal.msgSuccess("提交成功");
           this.back()
           this.back()
         }
         }

+ 21 - 4
src/views/purchase/deliveryAddress/index.vue

@@ -164,7 +164,7 @@
 
 
           <el-button type="primary" size="mini">启用</el-button>
           <el-button type="primary" size="mini">启用</el-button>
           <el-button type="primary" size="mini">停用</el-button>
           <el-button type="primary" size="mini">停用</el-button>
-          <el-button type="primary" size="mini">同步NC</el-button>
+          <el-button type="primary" size="mini" @click="toNC">同步NC</el-button>
           <el-button type="primary" size="mini">删除</el-button>
           <el-button type="primary" size="mini">删除</el-button>
         </div>
         </div>
         <el-table 
         <el-table 
@@ -236,7 +236,7 @@
 <script>
 <script>
 import Add from './add.vue'
 import Add from './add.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
-import {getAddressList, delAddress} from '@/api/purchase/deliveryAddress.js'
+import {getAddressList, delAddress, toNc } from '@/api/purchase/deliveryAddress.js'
 import Refers from '@/components/Refers/refers.vue'
 import Refers from '@/components/Refers/refers.vue'
 import TreeRefers from '@/components/Refers/treeRefer.vue'
 import TreeRefers from '@/components/Refers/treeRefer.vue'
 export default {
 export default {
@@ -296,7 +296,8 @@ export default {
       tableList: [],
       tableList: [],
       total: 0,
       total: 0,
       rowDetail: {},
       rowDetail: {},
-      disable: false
+      disable: false,
+      allSelection:[]
     }
     }
   },
   },
   created() {
   created() {
@@ -336,7 +337,23 @@ export default {
       }
       }
       this.getList(this.queryParams)
       this.getList(this.queryParams)
     },
     },
-    handleSelectionChange() {},
+    toNC() {
+      if (this.allSelection.length == 0 || this.allSelection.length > 1) {
+        this.$modal.msgWarning("同步NC只能进行单条操作!");
+      } else {
+        console.log('参数', this.allSelection)
+        toNc(this.allSelection[0]).then(res => {
+          if (res.code === 200) {
+            this.$modal.msgSuccess("操作成功!");
+            this.getList(this.queryParams)
+          }
+        })
+      }
+    },
+    handleSelectionChange(selection) {
+      console.log('选中', selection)
+      this.allSelection = selection
+    },
     handleCommand(command) {
     handleCommand(command) {
       alert(command)
       alert(command)
     },
     },

+ 7 - 1
src/views/purchase/transferOrder/add.vue

@@ -796,15 +796,21 @@ export default {
 
 
     },
     },
     toNC() {
     toNC() {
-      againToNC(this.row).then(res => {})
+      againToNC(this.row).then(res => {
+        this.getDetails(this.row)
+      }).catch(err => {
+        this.getDetails(this.row)
+      })
     },
     },
     submit() {
     submit() {
+      this.$modal.loading("提交中...");
       this.basicForm.stAllotMaterialList = this.materialInfo
       this.basicForm.stAllotMaterialList = this.materialInfo
       this.basicForm.stAllotReceiveDeliverList = this.receiveInfo
       this.basicForm.stAllotReceiveDeliverList = this.receiveInfo
       this.basicForm.stAllotReceiveExecuteList = this.priceList
       this.basicForm.stAllotReceiveExecuteList = this.priceList
       this.basicForm.stAllotReceiveExpenseList = this.resultList
       this.basicForm.stAllotReceiveExpenseList = this.resultList
       submitOrder(this.basicForm).then(res => {
       submitOrder(this.basicForm).then(res => {
         if (res.code === 200) {
         if (res.code === 200) {
+          this.$modal.closeLoading();
           this.$modal.msgSuccess("提交成功");
           this.$modal.msgSuccess("提交成功");
           this.back()
           this.back()
         }
         }