Ver código fonte

Merge branch 'master' of http://121.41.102.225:3000/mushen/DWY_mobile

mushencc 1 ano atrás
pai
commit
b6d7c87106
2 arquivos alterados com 169 adições e 47 exclusões
  1. 167 39
      src/views/page/Dispatch/detail.vue
  2. 2 8
      src/views/page/Finish/detail.vue

+ 167 - 39
src/views/page/Dispatch/detail.vue

@@ -43,10 +43,10 @@ color: #ABDFFF;">展开</div>
 <!--          </div>-->
           <div class="secd_flex" style="margin-top: .8rem">
             <div class="secd_title">
-              <span>销售单号:</span><span> {{ item.bus_no }}</span>
+              <span>发货单号:</span><span> {{ data.data.exe_delivery_note_b.no }}</span>
             </div>
-            <span class="secd_title_d">{{ item.product_title }}</span>
-            <div class="secd_g"><span>规格型号:</span><span>{{ item.product_size }}</span></div>
+            <span class="secd_title_d">{{ item.material_name }}</span>
+            <div class="secd_g"><span>规格型号:</span><span>{{ item.specs }}</span></div>
             <div class="secd_flex_w">
               <div class="secd_flex_s">
                 <span>已扫到数量:</span>
@@ -54,7 +54,7 @@ color: #ABDFFF;">展开</div>
               </div>
               <div class="secd_flex_s">
                 <span>未发货数量:</span>
-                <span>{{ item.this_delivery_qty - item.out_qty }}件</span>
+                <span>{{ item.this_delivery_qty  }}件</span>
               </div>
             </div>
           </div>
@@ -145,6 +145,8 @@ color: #ABDFFF;">展开</div>
   </div> -->
 </template>
 <script>
+import emitter from 'view-design/src/mixins/emitter'
+
 export default {
   data() {
     return {
@@ -158,9 +160,10 @@ export default {
       total_num: 0,
       scan_num: 0,
       saveData: 0,
+      detail: {},
       transport_total: 0,
       scan_data: [],
-      is_box_data: []
+      new_table_data: []
     }
   },
   mounted() {
@@ -171,7 +174,7 @@ export default {
     this.tableData = []
     const id = this.$route.query.id
     const data = {
-      url: `http://121.36.142.167:7774/jbl/api/module-data/send_goods_out/send_goods_out/474061443708694528/${id}`
+      url: `http://121.36.142.167:7774/jbl/api/module-data/delivery_note/delivery_note/478838363726815232/${id}`
       // post: {"direction":"DESC","property":"id","fromClientType":"pc","number":0,"sorts":[],"rules":[{"field":"dispatch_orders.dispatch_no","option":"LIKE_ANYWHERE","values":[v]},{"field":"product_no","option":"LIKE_ANYWHERE","values":["BC030101000001"]}],"size":15,"specialConditions":[],"workflowSearchBean":{},"dynamicFormCode":"dispatch_orders","dynamicFormTable":null,"ignoreField":true,"developmentSystemId":null,"debugFlag":true},
     }
     this.initData(data)
@@ -180,16 +183,25 @@ export default {
     // 原始数据获取
     initData(row) {
       this.axios.post('/api/testdwyget', { ...row }).then(res => {
-        this.tableData.push(...res.data.data.send_goods_out_product);
-        res.data.data.send_goods_out_product.forEach((element, index) => {
-          this.data = res.data
+        // this.tableData.push(...res.data.data.exe_delivery_note_dtl_b);
+        this.data = res.data
+        this.detail = res.data.data.exe_delivery_note_b
+        res.data.data.exe_delivery_note_dtl_b.forEach((element, index) => {
+          element.out_qty = 0
+          element.product_code = element.material_code
+
           this.total_num = this.total_num + element.this_delivery_qty
-          this.transport_total = this.transport_total + element.out_qty
-          this.key_tableData[this.deelUniqueProductKey(element)] = element;
-          if (element.box_orders_show) {
-            this.is_box_data.push(this.deelUniqueKey(element));
-          }
+          // this.transport_total = this.transport_total + element.out_qty
+          let product_key = this.deelUniqueProductKey(element)
+          if(Object.keys(this.key_tableData).indexOf(product_key) !== -1) this.key_tableData[product_key].this_delivery_qty += element.this_delivery_qty
+          else this.key_tableData[product_key] = element
+          // if (element.box_orders_show) {
+          //   this.is_box_data.push(this.deelUniqueKey(element));
+          // }
         })
+        for (let key in this.key_tableData) {
+          this.tableData.push(this.key_tableData[key])
+        }
         // let ji = ['\"425A3030303235\"']
         // console.log(JSON.stringify(ji))
         let text = []
@@ -233,7 +245,9 @@ export default {
               "color_two": element.color_two,
               "process_title": element.process_title,
               "process_title_two": element.process_title_two,
-              "box_id": element.box_orders.id
+              "box_orders": element.box_orders.id,
+              "box_id": element.box_orders.id,
+              'box_detail': element
             }
             this.scan_data.push(object)
           })
@@ -251,39 +265,153 @@ export default {
     },
     // 将原始数据处理拼接成提交的数据
     deelTableData() {
-      let new_table_data = [];
-      let is_scan_key = {};
-      console.log(this.scan_data);
+      // let new_table_data = [];
+      // let is_scan_key = {};
       this.scan_data.forEach((element, index) => {
-        if (this.is_box_data.indexOf(element.box_no) === -1 && Object.keys(this.key_tableData).indexOf(this.deelUniqueProductKey(element)) !== -1 && (this.key_tableData[this.deelUniqueProductKey(element)].this_delivery_qty - element.box_num) >= 0) {
-          let table_data_detail = JSON.parse(JSON.stringify(this.key_tableData[this.deelUniqueProductKey(element)]))
-          table_data_detail.box_orders = element.box_id;
-          table_data_detail.box_orders_show = element.box_no;
-          table_data_detail.this_delivery_qty = element.box_num;
-          table_data_detail.out_qty += element.box_num;
-        this.key_tableData[this.deelUniqueProductKey(element)].this_delivery_qty -= element.box_num*1;
-          is_scan_key[this.deelUniqueProductKey(element)]=1;
+        if (Object.keys(this.key_tableData).indexOf(this.deelUniqueProductKey(element)) !== -1 && (this.key_tableData[this.deelUniqueProductKey(element)].this_delivery_qty - element.box_num) >= 0) {
+           let table_data_detail = JSON.parse(JSON.stringify(this.key_tableData[this.deelUniqueProductKey(element)]))
+          table_data_detail.box_orders = element.box_id
+          table_data_detail.box_orders_show = element.box_no
+          table_data_detail.box_detail = element.box_detail
+          table_data_detail.this_delivery_qty = element.box_num
+          table_data_detail.out_qty = element.box_num
+          this.key_tableData[this.deelUniqueProductKey(element)].this_delivery_qty -= element.box_num*1
+          this.key_tableData[this.deelUniqueProductKey(element)].out_qty += element.box_num*1
+          // is_scan_key[this.deelUniqueProductKey(element)]=1;
           // table_data_detail.this_delivery_qty =  this.key_tableData[this.deelUniqueProductKey(element)].this_delivery_qty;
           table_data_detail.id = null;
 
-          new_table_data.push(table_data_detail)
+          this.new_table_data.push(table_data_detail)
         }
       })
-      this.tableData.forEach((element, index) => {
-        // if (element.this_delivery_qty > 0 && element.out_qty === 0) {
-        //   new_table_data.push(element)
-        // }
-        if(!is_scan_key[this.deelUniqueProductKey(element)]){
-          new_table_data.push(element)
-        }
-      })
-      this.tableData = new_table_data;
+      // this.tableData.forEach((element, index) => {
+      //   // if (element.this_delivery_qty > 0 && element.out_qty === 0) {
+      //   //   new_table_data.push(element)
+      //   // }
+      // })
+      // this.tableData = new_table_data;
     },
     handelGoSure () {
       this.tableData.forEach((element, index) => {
         element.item_num = (index + 1)
       })
-      this.data.data.send_goods_out_product = this.tableData
+      const date = new Date()
+      const now_time = date.toISOString()
+      this.data = {
+        // auditInfo: null,
+        bizId: -1,
+        bizTypeEk: 'LOWCODE',
+        // businessType: null,
+        // createdBy: "473698106823094272",
+        createdDate: now_time,
+        dynamicFormId: '474057887278641152',
+        // extDataId: null,
+        // id: "491138208411951104",
+        // lastModifiedBy: "473698106823094272",
+        // lastModifiedDate: now_time,
+        // requestId: null,
+        showModelId: '474061442555260928',
+        version: 1,
+        // versionNo: null,
+        data: {
+          send_goods_out: {},
+          send_goods_out_product: []
+        }
+      }
+      this.data.data.send_goods_out = {
+        send_goods_out_no: null,
+        in_out_type: 'CK007',
+        box_title: 'WH05001',
+        out_time: now_time,
+        out_depart: '481280388644478976',
+        out_employee_id: 'RX0001',
+        expect_date_delivery: this.detail.expect_date_delivery,
+        expect_date_arrival: this.detail.expect_date_arrival,
+        delivery_method_dk: this.detail.delivery_method_dk,
+        express_company: null,
+        express_no: null,
+        carrier: null, //司机姓名
+        carrier_phone: null, //司机电话
+        plate_no: '3',
+        id_number: this.detail.id_number,
+        area_selection: this.detail.area_selection,
+        detailed_address: this.detail.detailed_address,
+        contact: this.detail.contact,
+        contact_way: this.detail.contact_way,
+        status: 'NOT_APPROVED',
+        oa_id: null,
+        oa_time: null,
+        remark: null,
+        order_no: this.detail.order_no,
+        site: null,
+        in_out_type_show: '成品发货出库',
+        box_title_show: '成品仓',
+        out_depart_show: '仓储部',
+        out_employee_id_show: '郭银',
+        delivery_method_dk_show: this.detail.delivery_method_dk_show,
+        area_selection_show: this.detail.area_selection_show,
+
+        // attachment: null,
+        // dynamic_form_value_id: this.detail.dynamic_form_value_id,
+        // expect_date_arrival_lt: this.detail.expect_date_arrival_lt,
+        // expect_date_delivery_lt: this.detail.expect_date_delivery_lt,
+        // id: "491138208583917568"
+        // main_table_id: null,
+        // oa_id_show: null,
+        // oa_time_lt: null,
+        // out_time_lt: now_time,
+        // request_id: null,
+        // send_goods_out_no: "FCK2023091700099",
+        // site_show: this.detail.site_show,
+        // status_show: '待审核'
+      }
+      this.new_table_data.forEach((element,index) =>{
+          // console.log(element)
+          let box_detail = {
+            item_num: (index + 1),
+            product_code: element.box_detail.product_code,
+            product_title: element.box_detail.product_title,
+            product_size: element.box_detail.product_size,
+            product_unit: element.box_detail.product_unit,
+            product_unit_title: element.box_detail.product_unit_title,
+            process_code: element.box_detail.process_code,
+            color_code: element.box_detail.color_code,
+            process_code_two: element.box_detail.process_code_two,
+            color_code_two: element.box_detail.color_code_two,
+            process_title: element.box_detail.process_title,
+            color: element.box_detail.color,
+            process_title_two: element.box_detail.process_title_two,
+            color_two: element.box_detail.color_two,
+            bus_no: this.detail.no,
+            bus_id: element.bus_id,
+            bus_item_id: element.bus_item_id,
+            bus_item_no: element.item_no,
+            order_no: element.box_detail.order_no,
+            out_qty: element.out_qty,
+            this_delivery_qty: element.out_qty,
+            order_item_id: element.order_item_id,
+            unit_price: element.unit_price,
+            site: null,
+            customer_name: element.box_detail.customer_name,
+            customer_no: element.box_detail.customer_no,
+            dealer_name: element.box_detail.dealer_name,
+            dealer_no: element.box_detail.dealer_no,
+            box_orders: element.box_detail.box_orders.id,
+            box_orders_show: element.box_detail.box_orders.defective_order_no
+            // site_show: element.box_detail.site_show
+            // dynamic_form_value_id: element.box_detail.dynamic_form_value_id,
+            // id: "491138208592306176"
+            // lineId: "29E776DE",
+            // mainKey: "29E776DE",
+            // main_table_id: "491138208583917568",
+            // request_id: null,
+          }
+        this.data.data.send_goods_out_product.push(box_detail)
+      })
+      // console.log(this.data)
+      // return false
+      // this.data.data.send_goods_out = this.tableData
+      // this.data.data.send_goods_out_product = this.tableData
       let data = {
         url: 'http://121.36.142.167:7774/jbl/api/module-data/send_goods_out/send_goods_out',
         post: this.data
@@ -590,7 +718,7 @@ export default {
   align-items: center;
 }
 
-/deep/ .btn-group>.btn,
+::v-deep .btn-group>.btn,
 .btn-group-vertical>.btn {
   background: #ffffff;
   color: #2c3e50;
@@ -622,7 +750,7 @@ export default {
   left: 3%;
 }
 
-/deep/td {
+::v-deeptd {
   text-align: center;
   vertical-align: middle;
 }

+ 2 - 8
src/views/page/Finish/detail.vue

@@ -238,8 +238,6 @@ export default {
     opacity: 0.5;
   }
 }
-
-
 .check_box_c {
   width: 1.19rem;
   height: 100%;
@@ -273,7 +271,6 @@ export default {
 .com_top {
   margin-top: 1.72rem !important;
 }
-
 .completion_con {
   height: 5.19rem;
   background-image: url('../../../assets/home/completion.png');
@@ -306,9 +303,6 @@ export default {
       width: 2.59rem;
       height: 0.88rem;
     }
-
-
-
   }
 
   .pack_up_d {
@@ -451,7 +445,7 @@ export default {
   align-items: center;
 }
 
-/deep/ .btn-group>.btn,
+::v-deep .btn-group>.btn,
 .btn-group-vertical>.btn {
   background: #ffffff;
   color: #2c3e50;
@@ -483,7 +477,7 @@ export default {
   left: 3%;
 }
 
-/deep/td {
+::v-deep td {
   text-align: center;
   vertical-align: middle;
 }