Browse Source

预装箱单第三版本

fenghaifu 2 years ago
parent
commit
4df73dd553

BIN
dist.zip


+ 7 - 1
src/api/document/advance-packingList.js

@@ -22,4 +22,10 @@ const deleteAdPaList = params => deleteAction('/spapl/syPreAssembledPackingList/
 // 发运明细详情
 const queryShippingDetails = params =>getAction('/spapl/syPreAssembledPackingList/queryShippingDetails', params)
 
-export { getadPaList, deleteAdPaList, itemByMainId, editById, addAdvPac, shipList, queryShippingDetails }
+// 提交
+const submit = params => getAction('/spapl/syPreAssembledPackingList/submit', params)
+
+// 取消提交
+const cancelSubmit = params => getAction('/spapl/syPreAssembledPackingList/cancelSubmit', params)
+
+export { getadPaList, deleteAdPaList, itemByMainId, editById, addAdvPac, shipList, queryShippingDetails, submit, cancelSubmit }

+ 49 - 5
src/views/advance-packingList/adPaList-clothes.vue

@@ -204,7 +204,7 @@ import moment from 'moment'
 import addAdpackingDrawer from '@views/advance-packingList/addAdpackingDrawer.vue'
 import detailsAdpackingDrawer from '@views/advance-packingList/detailsAdpackingDrawer.vue'
 
-import { getadPaList, itemByMainId } from '@api/document/advance-packingList.js'
+import { getadPaList, itemByMainId, submit, cancelSubmit } from '@api/document/advance-packingList.js'
 
 export default {
   productName: 'AdPaListClothes', // 预装箱单-成衣
@@ -430,16 +430,34 @@ export default {
 
     //  编辑
     edit(record) {
-      console.log(record);
       itemByMainId({id:record.id}).then(res => {
         if (res.success) {
-          console.log(res.result);
           
           this.$refs.addAdpackingDrawer.visible = true;
           this.$refs.addAdpackingDrawer.addAdpacking = res.result; //接口参数
+          this.$refs.addAdpackingDrawer.loadSizeTables(res.result.syPreAssembledPackingListItemList[0].sizeTables);
+          var totalNetWeight = 0;
+          var totalGrossWeight = 0;
+          var totalVolume = 0;
+          var totalPrice = 0;
+          for (var i=0; i<res.result.syPreAssembledPackingListItemList.length;i++){
+            var row = res.result.syPreAssembledPackingListItemList[i];
+            var sizeTables = row.sizeTables;
+            for (var j=0; j<sizeTables.length;j++){
+              row['size-'+sizeTables[j].size] = sizeTables[j].proportion;
+            }
+            totalNetWeight += row.totalNetWeight*1;
+            totalGrossWeight += row.totalGrossWeight*1;
+            totalVolume += row.totalVolume*1;
+            totalPrice += row.totalPrice*1;
+          }
+          res.result.totalNetWeight = totalNetWeight;
+          res.result.totalGrossWeight = totalGrossWeight;
+          res.result.totalVolume = totalVolume;
+          res.result.totalPrice = totalPrice;
           
         }else{
-          this.$message.error("获取记录详情失败");
+          this.$message.error(res.message);
         }
       });
 
@@ -508,7 +526,33 @@ export default {
     // 操作 单条数据导出
     itemXls() {},
     //  提交
-    submit() {},
+    submit(record) {
+      var that = this;
+      this.$nextTick(() => {
+        submit({ id: record.id }).then(res => {
+          if (res.success) {
+            record.status=1;
+            that.$message.success('提交成功');
+          }else{
+            that.$message.error(res.message);
+          }
+        })
+      })
+    },
+    // 取消提交
+    cancelSubmit(record){
+      var that = this;
+      this.$nextTick(() => {
+        cancelSubmit({ id: record.id }).then(res => {
+          if (res.success) {
+            record.status=0;
+            that.$message.success('取消提交成功');
+          }else{
+            that.$message.error(res.message);
+          }
+        })
+      })
+    },
 
     // 选中行
     onSelectChange(keys, rows) {

+ 36 - 33
src/views/advance-packingList/addAdpackingDrawer.vue

@@ -156,7 +156,7 @@
           zIndex: 1
         }"
       >
-        <a-popconfirm title="确定放弃新增?" @confirm="handleCancel" okText="确定" cancelText="取消">
+        <a-popconfirm title="确定放弃编辑?" @confirm="handleCancel" okText="确定" cancelText="取消">
           <a-button :style="{ marginRight: '8px' }">取消</a-button>
         </a-popconfirm>
         <a-button type="primary" @click="myHandSave">
@@ -449,40 +449,10 @@ export default {
       
       queryShippingDetails({id:selectData.id}).then(res => {
           if (res.success) {
-            var newColums = this.columns.filter(item=>{
-              return item.isSize != true;
-            });
             // 放在前面,有小数位数设置
             this.setHeadData(val[0], res.result);
 
-            this.sizeFields = [];
-            var sizeTable = res.result.sizeTables;
-            if (sizeTable != null){
-              var i=0;
-              // 找到插入位置点
-              for (; i<newColums.length;i++){
-                if (newColums[i].insertAfter){
-                  break;
-                }
-              }
-              // 插入数据
-              for (var j=0;j<sizeTable.length;j++){
-                this.sizeFields.push('size-'+sizeTable[j].size);
-                var validExpress = getDotValidExpress(this.dotConfig.quantity);
-                var field = {
-                    title: sizeTable[j].size,
-                    key: 'size-'+sizeTable[j].size,
-                    type: JVXETypes.inputNumber ,
-                    width: 80,
-                    isSize:true,
-                    validateRules: [validExpress]
-                };
-                
-                newColums.splice(i+1+j,0,field);
-              }
-            }
-            
-            this.columns = newColums;            
+            this.loadSizeTables(res.result.sizeTables);          
             
             var changedData = this.changeData(val[0], res.result);
             this.addAdpacking.syPreAssembledPackingListItemList.push(changedData);
@@ -493,6 +463,39 @@ export default {
         })
     },
 
+    loadSizeTables(sizeTable){
+      var newColums = this.columns.filter(item=>{
+        return item.isSize != true;
+      });            
+
+      this.sizeFields = [];
+      if (sizeTable != null){
+        var i=0;
+        // 找到插入位置点
+        for (; i<newColums.length;i++){
+          if (newColums[i].insertAfter){
+            break;
+          }
+        }
+        // 插入数据
+        for (var j=0;j<sizeTable.length;j++){
+          this.sizeFields.push('size-'+sizeTable[j].size);
+          var validExpress = getDotValidExpress(this.dotConfig.quantity);
+          var field = {
+              title: sizeTable[j].size,
+              key: 'size-'+sizeTable[j].size,
+              type: JVXETypes.inputNumber ,
+              width: 80,
+              isSize:true,
+              validateRules: [validExpress]
+          };
+          
+          newColums.splice(i+1+j,0,field);
+        }
+      }
+      
+      this.columns = newColums;  
+    },
     // 参照发运明细
     referShipmentDetails() {
       // console.log('打开参照发运明细')
@@ -569,7 +572,7 @@ export default {
         for (var j=0; j<tableRow.sizeTables.length; j++){
           var sizeTable = tableRow.sizeTables[j];
           var field = 'size-'+sizeTable.size;
-          tableRow.sizeTables[j].quantity = tableRow[field];
+          tableRow.sizeTables[j].proportion = tableRow[field];
         }
         tableRow.sort = ++sort;
       }

+ 4 - 2
src/views/shipment-details/addShipDetDrawer.vue

@@ -108,7 +108,7 @@
               :columns="columns"
               :data-source="syShippingDetailsItemList"
               :pagination="false"
-              :scroll="{ x: 1500, y: 500 }"
+              :scroll="{ x: 1500, y: 400 }"
               size="small"
             >
               <!-- 款号 输入框 :rules="rules.itemNumber" -->
@@ -730,7 +730,9 @@ export default {
     // 参照订单数据弹框 ok-------------------------------------
     referOrderDataOk() {
       // console.log('参照订单数据弹框确定')
-      this.$refs.referOrderDataModal.referOrderDataModVis = false
+      this.$refs.referOrderDataModal.referOrderDataModVis = false;
+      this.$refs.referOrderDataModal.queryParam.orderNumber="";
+      this.$refs.referOrderDataModal.queryParam.account="";
     }
   }
 }

+ 41 - 31
src/views/shipment-details/referOrderDataModal.vue

@@ -21,7 +21,11 @@
 
             <a-col :md="6" :sm="8">
               <a-form-item label="账套">
-                <a-input placeholder="请输入账套" v-model="queryParam.account"></a-input>
+                <j-search-select-tag
+                  placeholder="请选择账套"
+                  v-model="queryParam.account"
+                  dict="view_account,account,account">
+                </j-search-select-tag>
                 <!-- <a-select placeholder="请选择账套" v-model="queryParam.account">
                   <a-select-option value="">请选择</a-select-option>
                   <a-select-option :value="0">香港森语(101)</a-select-option>
@@ -55,7 +59,7 @@
         :pagination="pagination"
         :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
         @change="handleTableChange"
-        :scroll="{ x: 1500 }"
+        :scroll="{ x: 1500, y:500 }"
       >
       </a-table>
     </a-spin>
@@ -66,6 +70,7 @@
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import JEllipsis from '@/components/jeecg/JEllipsis'
 import moment from 'moment'
+import { randomUUID } from '@/utils/util'
 
 import { queryOrderData, confimOrderData } from '@api/document/shipmentList'
 
@@ -93,7 +98,7 @@ export default {
         {
           title: '款号',
           dataIndex: 'itemNumber',
-          width: 60,
+          width: 100,
           fixed: 'left',
           className: 'replacecolor'
         },
@@ -139,7 +144,7 @@ export default {
         {
           title: '存货名称',
           dataIndex: 'inventoryName',
-          width: 180,
+          width: 250,
           className: 'replacecolor'
         },
         {
@@ -296,21 +301,21 @@ export default {
         {
           title: '订单备注',
           dataIndex: 'orderRemarks',
-          width: 180,
+          width: 280,
           customRender: t => ellipsis(t),
           className: 'replacecolor'
         },
         {
           title: '价格备注',
           dataIndex: 'priceRemarks',
-          width: 120,
+          width: 280,
           customRender: t => ellipsis(t),
           className: 'replacecolor'
         },
         {
           title: '订单变更说明',
           dataIndex: 'orderChangeDescription',
-          width: 220,
+          width: 280,
           customRender: t => ellipsis(t),
           className: 'replacecolor'
         },
@@ -355,9 +360,14 @@ export default {
   methods: {
     // 参照订单数据 查询
     getOrderList() {
+      var that = this;
       this.$nextTick(() => {
         queryOrderData(this.queryParam).then(res => {
           if (res.success) {
+            for (var i=0; i<res.result.records.length;i++){
+              res.result.records[i].id = randomUUID();
+            }
+            console.log(res.result.records);
             this.orderListData = res.result.records
             this.pagination = {
               total: res.result.total,
@@ -375,56 +385,56 @@ export default {
         this.$message.error('请勾选订单数据')
       } else {
         this.selectedRows.forEach(item => {
-          this.confimList.push(item.syOrderDataItemId)
+          this.confimList.push(item.syOrderDataItemId);
         })
-        console.log('勾选的id数组', this.confimList)
 
         confimOrderData(this.confimList).then(res => {
           if (res.success) {
-            console.log('结果 res', res.result)
-            this.propList = res.result
-            this.$emit('bao', this.propList)
-            console.log('结果this.propList', this.propList)
+            this.propList = res.result;
+            this.$emit('bao', this.propList);
           }
         })
 
-        this.referOrderDataModVis = false
-        this.selectedRowKeys = []
-        this.selectedRows = []
+        this.referOrderDataModVis = false;
+        this.selectedRowKeys = [];
+        this.selectedRows = [];
+        this.searchReset();
       }
     },
     handleTableChange(pagination, filters, sorter) {
-      this.queryParam.pageNo = pagination.current
-      this.getOrderList()
+      this.queryParam.pageNo = pagination.current;
+      this.getOrderList();
     },
 
     searchQuery() {
-      this.queryParam.pageNo = ''
-      this.getOrderList()
+      this.queryParam.pageNo = '';
+      this.getOrderList();
     },
 
     // 重置
     searchReset() {
-      this.queryParam.orderNumber = ''
-      this.queryParam.account = ''
-      this.getOrderList()
+      this.queryParam.orderNumber = '';
+      this.queryParam.account = '';
+      this.getOrderList();
     },
     // 选中行
     onSelectChange(keys, rows) {
-      this.selectedRowKeys = keys
-      this.selectedRows = rows
+      console.log(keys);
+      console.log(rows);
+      this.selectedRowKeys = keys;
+      this.selectedRows = rows;
     },
 
     close() {
       this.$emit('close')
-      this.referOrderDataModVis = false
-      this.selectedRowKeys = []
-      this.orderListData = []
-      this.getOrderList()
+      this.referOrderDataModVis = false;
+      this.selectedRowKeys = [];
+      this.orderListData = [];
+      this.searchReset();
     },
     handleCancel() {
-      this.close()
-    }
+      this.close();
+    },
   },
   computed: {
     // 选中项

+ 5 - 2
src/views/shipment-details/shipmentList.vue

@@ -88,7 +88,7 @@
       <a-table
         v-if="shipmentListData"
         bordered
-        rowKey="id"
+        rowKey="randomId"
         :columns="shipmentListColumns"
         :data-source="shipmentListData"
         :loading="loading"
@@ -232,6 +232,7 @@ import detailsShipDetDrawer from '@views/shipment-details/detailsShipDetDrawer.v
 import editShipDetDrawer from '@views/shipment-details/editShipDetDrawer.vue'
 import declareElementsModal from '@views/shipment-details/declareElementsModal.vue'
 import itemNumEleModal from '@views/shipment-details/itemNumEleModal.vue'
+import { randomUUID } from '@/utils/util'
 
 import {
   shipmentList,
@@ -511,7 +512,9 @@ export default {
         shipmentList(this.queryParam).then(res => {
           if (res.success) {
             this.shipmentListData = res.result.records
-            console.log('发运明细列表', this.shipmentListData)
+            for (var i=0; i<this.shipmentListData.length; i++){
+              this.shipmentListData.randomId = randomUUID();
+            }
             this.pagination = {
               total: res.result.total,
               current: res.result.current,