瀏覽代碼

手工匹配订单

jbb 2 年之前
父節點
當前提交
948c9b7b54
共有 2 個文件被更改,包括 71 次插入45 次删除
  1. 31 14
      src/views/order/manualModal.vue
  2. 40 31
      src/views/order/subcontractOrderModal.vue

+ 31 - 14
src/views/order/manualModal.vue

@@ -54,9 +54,9 @@
                 :row-key="record => record.id"
                 :columns="manualColumns"
                 :data-source="manualData"
-                :loading="loading"
                 :scroll="{x: 1500,y:300 }"
-                :pagination="false"
+                :pagination="pagination"
+                 @change="handleTableChange"
               >
               <span slot="operationSlot" slot-scope="text, record,index">
                      <a @click="handleExportXls(record)" style="color:green;">关联委外</a>
@@ -90,7 +90,7 @@
           </a-button>
         </div>
       </a-modal>
-      <subcontract-order-modal ref="subcontractOrderModal"></subcontract-order-modal>
+      <subcontract-order-modal ref="subcontractOrderModal" @close="closeBack"></subcontract-order-modal>
     </div>
   </template>
   
@@ -188,7 +188,8 @@
           className: 'replacecolor',
           ellipsis: true
         },
-        ]
+        ],
+        pagination:''
       }
     },
     // 接收父组件 方法
@@ -201,12 +202,11 @@
         //获取数据
         getData(){
       var that = this;
-      // that.spinIsShow = true;
-      this.loading = true
+      this.confirmLoading = true
       this.$nextTick(() => {
+        this.queryParam.pageSize = 1
         salesOrder(this.queryParam).then(res => {
-          // that.spinIsShow = false;
-          this.loading = false
+          this.confirmLoading = false
           if (res.success) {
             that.manualData = res.result.records;
             that.pagination = {
@@ -224,30 +224,31 @@
         //查询 
         searchQuery(){
           if(this.queryParam.account == '' || !this.queryParam.account){
-            debugger
              this.$message.error('请选择账套')
           }else if(this.queryParam.orderNumber == '' || !this.queryParam.orderNumber){
-            debugger
             this.$message.error('请选择销售订单号')
           }else{
-            debugger
+
             this.getData()
           }
         },
         //重置
         searchReset(){
+          this.queryParam ={}
+          this.manualData =[]
         },
         //返回
         handleCancel(){
-
+           this.close()
         },
         //保存
         addSave(){
 
         },
         //关联委外
-        handleExportXls(){
+        handleExportXls(record){
            this.$refs.subcontractOrderModal.subcontractOrderModVis = true
+           this.$refs.subcontractOrderModal.fatherList = record
         },
         //删行
         handleDelete(record,index){
@@ -255,7 +256,23 @@
         },
         //关闭弹窗
         close(){
-
+          this.queryParam ={}
+          this.manualData =[]
+          this.manualModVis = false
+        },
+         // 分页变化时触发
+         handleTableChange(pagination, filters, sorter) {
+             this.queryParam.pageNo = pagination.current
+              this.getData()
+          },
+        //委外订单弹窗关闭后
+        closeBack(data,obj){
+           this.manualData.map(item=>{
+             if(item.irowNo == data.irowNo){
+               item.ccode = obj.ccode
+               item.ivouchRowNo = obj.ivouchRowNo
+             }
+           })
         }
     },
   

+ 40 - 31
src/views/order/subcontractOrderModal.vue

@@ -42,12 +42,13 @@
           <a-spin :spinning="confirmLoading">
               <a-table
                 bordered
-                :row-key="record => record.id"
+                :row-key="record => record.ivouchRowNo"
                 :columns="subcontractOrderColumns"
                 :data-source="subcontractOrderData"
-                :loading="loading"
+                :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
                 :scroll="{x: 1500,y:300 }"
-                :pagination="false"
+                :pagination="pagination"
+                @change="handleTableChange"
               >
               <span slot="operationSlot" slot-scope="text, record,index">
                      <a @click="handleExportXls(record)" style="color:green;">关联委外</a>
@@ -107,14 +108,14 @@
         {
           title: '委外订单号',
           width: 120,
-          dataIndex: 'CCode',
+          dataIndex: 'ccode',
           className: 'replacecolor',
           ellipsis: true
         },
         {
           title: '委外订单行号',
           width: 140,
-          dataIndex: 'IVouchRowNo',
+          dataIndex: 'ivouchRowNo',
           className: 'replacecolor',
           ellipsis: true
         },
@@ -146,15 +147,11 @@
           className: 'replacecolor',
           ellipsis: true
         },
-        {
-          title: '操作',
-          width: 120,
-          dataIndex: 'operation',
-          scopedSlots: { customRender: 'operationSlot' },
-          className: 'replacecolor',
-          ellipsis: true
-        },
-        ]
+        ],
+        selectedRowKeys:[],
+        selectedRows:[],
+        fatherList:'',
+        pagination:{}
       }
     },
     // 接收父组件 方法
@@ -167,16 +164,12 @@
       //获取数据
       getData(){
          var that = this;
-      // that.spinIsShow = true;
-      this.loading = true
+      this.confirmLoading = true
       this.$nextTick(() => {
         subcontractOrder(this.queryParam).then(res => {
-            debugger
-          // that.spinIsShow = false;
-          this.loading = false
+          this.confirmLoading = false
           if (res.success) {
-              debugger
-            that.manualData = res.result.records;
+            that.subcontractOrderData = res.result.records;
             that.pagination = {
               total: res.result.total,
               current: res.result.current,
@@ -192,32 +185,48 @@
         //查询 
         searchQuery(){
            if(this.queryParam.CCode == '' || !this.queryParam.CCode){
-            debugger
             this.$message.error('请选择委外订单号')
           }else{
-            debugger
             this.getData()
           }
         },
         //重置
         searchReset(){
+          this.subcontractOrderData = []
+          this.queryParam={}
         },
         //返回
         handleCancel(){
-
+          this.close
         },
         //保存
         addSave(){
-
-        },
-        //删行
-        handleDelete(record,index){
-         
+          if(this.selectedRowKeys.length == 0){
+            this.$message.error('请勾选数据')
+          }else if(this.selectedRowKeys.length >1){
+            this.$message.error('只可选择一行数据')
+          }else{
+            this.close()
+            this.$emit('close',this.fatherList,this.selectedRows[0])
+          }
         },
         //关闭弹窗
         close(){
-
-        }
+          this.subcontractOrderModVis = false
+          this.subcontractOrderData = []
+          this.queryParam={}
+        },
+        //选中行
+        onSelectChange(keys,rows){
+         this.selectedRowKeys = keys;
+         this.selectedRows = rows;
+         },
+          // 分页变化时触发
+         handleTableChange(pagination, filters, sorter) {
+             this.queryParam.pageNo = pagination.current
+             debugger
+              this.getData()
+          },  
     },
   
     computed: {}