root 1 éve
szülő
commit
5b70b58651
2 módosított fájl, 104 hozzáadás és 75 törlés
  1. 38 34
      src/views/page/Package/detail.vue
  2. 66 41
      src/views/page/Package/detailed.vue

+ 38 - 34
src/views/page/Package/detail.vue

@@ -16,38 +16,38 @@
         <div style="margin-right: 1rem; color: #66a9f0">王小伟</div>
       </div>
       <div class="header_middle">
-        <b-dropdown size="sm" text="Large" class="m-2" :disabled="is_use">
-          <b-dropdown-item-button>Action</b-dropdown-item-button>
-          <b-dropdown-item-button>Another action</b-dropdown-item-button>
-          <b-dropdown-item-button>Something else here</b-dropdown-item-button>
+        <b-dropdown size="sm" text="产品数" class="m-2" :disabled="is_use">
+          <!--<b-dropdown-item-button>Action</b-dropdown-item-button>-->
+          <!--<b-dropdown-item-button>Another action</b-dropdown-item-button>-->
+          <!--<b-dropdown-item-button>Something else here</b-dropdown-item-button>-->
         </b-dropdown>
-        <b-dropdown size="sm" text="Large" class="m-2" :disabled="is_use">
-          <b-dropdown-item-button>Action</b-dropdown-item-button>
-          <b-dropdown-item-button>Another action</b-dropdown-item-button>
-          <b-dropdown-item-button>Something else here</b-dropdown-item-button>
+        <b-dropdown size="sm" text="已包数" class="m-2" :disabled="is_use">
+          <!--<b-dropdown-item-button>Action</b-dropdown-item-button>-->
+          <!--<b-dropdown-item-button>Another action</b-dropdown-item-button>-->
+          <!--<b-dropdown-item-button>Something else here</b-dropdown-item-button>-->
         </b-dropdown>
-        <b-dropdown size="sm" text="Large" class="m-2" :disabled="is_use">
-          <b-dropdown-item-button>Action</b-dropdown-item-button>
-          <b-dropdown-item-button>Another action</b-dropdown-item-button>
-          <b-dropdown-item-button>Something else here</b-dropdown-item-button>
+        <b-dropdown size="sm" text="未包数" class="m-2" :disabled="is_use">
+          <!--<b-dropdown-item-button>Action</b-dropdown-item-button>-->
+          <!--<b-dropdown-item-button>Another action</b-dropdown-item-button>-->
+          <!--<b-dropdown-item-button>Something else here</b-dropdown-item-button>-->
         </b-dropdown>
       </div>
       <div class="header_middle1 ot">
-        <div class="ft">58 &nbsp;</div>
-        <div class="ft">12 &nbsp;</div>
-        <div class="ft">12 &nbsp;</div>
+        <div class="ft">{{this.product_total}} &nbsp;</div>
+        <div class="ft">{{this.box_num}} &nbsp;</div>
+        <div class="ft">{{this.product_total-this.box_num}} &nbsp;</div>
       </div>
       <div class="header_footer">
-        <div style="margin-left: 1rem">已完成56/10</div>
-        <div style="margin-right: 1.4rem">已完成10%</div>
+        <!--<div style="margin-left: 1rem">已完成56/10</div>-->
+        <!--<div style="margin-right: 1.4rem">已完成10%</div>-->
       </div>
     </div>
     <div class="bdy">
       <table>
         <tr style="height: 2rem">
-          <th style="width: 3rem">派工单号</th>
           <th style="width: 4rem">产品名称</th>
           <th style="width: 3rem">规格型号</th>
+          <th style="width: 3rem">花色</th>
           <th style="width: 3rem">已包装数量</th>
           <th style="width: 3rem">未包装数量</th>
         </tr>
@@ -57,13 +57,14 @@
             @click="handleChoose(item, index)"
             :class="item.is_choose ? 'choose_item' : ''"
         >
-          <td>
-            {{ item.no }}
-          </td>
+
           <td>{{ item.material_code_show }}</td>
           <td>{{item.specs }}</td>
-          <td>{{ item.box_num }}</td>
-          <td>{{ item.not_box_num }}</td>
+          <td>
+            {{ item.decor_code_show }}
+          </td>
+          <td>{{ item.box_num_total }}</td>
+          <td>{{ item.qty-item.box_num_total }}</td>
         </tr>
       </table>
     </div>
@@ -93,7 +94,9 @@ export default {
     return {
       tableData: [],
       is_show: true,
-      is_use: false
+      is_use: false,
+      product_total: 0,
+      box_num: 0,
     }
   },
   mounted () {
@@ -101,15 +104,14 @@ export default {
     //   data.target = JSON.parse(localStorage.getItem('fyy_target'))
     // }
     this.tableData = []
-    const fyyTarget = ('SO202308070002,SO202308070001').split(',')
-    fyyTarget.forEach(v => {
-      const data = {
-        url: 'http://121.36.142.167:7774/jbl/api/module-data/sale_order/page',
-        post: {"direction":"DESC","property":"id","fromClientType":"pc","number":0,"sorts":[],"rules":[{"field":"exe_sale_order_b.no","option":"LIKE_ANYWHERE","values":[v]}],"size":15,"specialConditions":[],"workflowSearchBean":{},"dynamicFormCode":"sale_order","dynamicFormTable":null,"ignoreField":true,"developmentSystemId":null,"debugFlag":true},
-        header: ['Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOLFJPTEVfSU5URVJGQUNFIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0Njc0MTE0fQ.L3Di3K_cpF0rWSgvzbcLufLm8bkCxd3Y-xudfKzSm4F-qdpDr0hYWWQP5K5BYTNuZnu4tWpGmSW2KRHU0pjt-A', 'Content-Sign:a2898699a4433b413d8473e4b59d64b8', 'Content-Type:application/json']
-      }
-      this.initData(data)
-    })
+    // const fyyTarget = ('SO202308070001').split(',')
+
+    const data = {
+      url: 'http://121.36.142.167:7774/jbl/api/module-data/sale_order/page',
+      post: {"direction":"DESC","property":"id","fromClientType":"pc","number":0,"sorts":[],"rules":[{"field":"exe_sale_order_b.no","option":"LIKE_ANYWHERE","values":["SO202308070001"]}],"size":15,"specialConditions":[],"workflowSearchBean":{},"dynamicFormCode":"sale_order","dynamicFormTable":null,"ignoreField":true,"developmentSystemId":null,"debugFlag":true},
+      header: ['Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiYXV0aCI6IlJPTEVfSU5ORVJfVVNFUixST0xFX0FETUlOLFJPTEVfSU5URVJGQUNFIiwidG9rZW5JZCI6IjM1IiwiZXhwIjoxNjk0Njc0MTE0fQ.L3Di3K_cpF0rWSgvzbcLufLm8bkCxd3Y-xudfKzSm4F-qdpDr0hYWWQP5K5BYTNuZnu4tWpGmSW2KRHU0pjt-A', 'Content-Type:application/json']
+    }
+    this.initData(data)
   },
   methods: {
     initData (row) {
@@ -117,7 +119,9 @@ export default {
         res.data.content.forEach(v => {
           v.is_choose = false
           v.no = v.exe_sale_order_b.no
-          v.box_num = v.box_num || 0
+          v.un_box_num = v.qty-v.box_num_total
+          this.product_total += v.qty
+          this.box_num += v.box_num_total
         })
         this.tableData.push(...res.data.content)
       })

+ 66 - 41
src/views/page/Package/detailed.vue

@@ -2,8 +2,8 @@
   <div>
     <div class="content">
       <div v-for="(item, index) in list" :key="index" class="item">
-        <div class="add" @click="handleAdd(item, index)">+</div>
-        <div class="delete" @click="handleDelete(index)">x</div>
+        <!--<div class="add" @click="handleAdd(item, index)">+</div>-->
+        <!--<div class="delete" @click="handleDelete(index)">x</div>-->
         <div class="unit" style="display: flex">
           <label style="width: 50%">销售订单号:</label>
           <div style="width: 50%;word-break: break-all">{{ item.no}}</div>
@@ -23,7 +23,7 @@
             type="number"
             placeholder="  请输入"
             style="width: 60%; padding: 0 0 0 0.2rem"
-            v-model="item.box_num"
+            v-model="item.un_box_num"
           />
         </div>
         <div class="unit">
@@ -190,47 +190,72 @@ export default {
     handleReturn () {
       this.$router.go(-1)
     },
-    handleDelete (index) {
-      if (this.list.length === 1) {
-        return false
-      } else {
-        this.list.splice(index, 1)
-      }
-    },
-    handleAdd (item, index) {
-      if (!item.quantity) {
-        return false
-      } else {
-        const copy = JSON.parse(JSON.stringify(item))
-        copy.quantity = Math.floor(item.quantity / 2) + item.quantity % 2
-        item.quantity = Math.floor(item.quantity / 2)
-        this.list.splice(index, 1, item)
-        this.list.splice(index + 1, 0, copy)
-      }
-    },
     handleSure () {
-      const data = []
-      this.list.forEach(v => {
-        const obj = {}
-        obj.id = v.id
-        obj.team_id = v.team_id
-        obj.finished_id = v.employee_id
-        obj.num = v.num ? v.num : ''
-        obj.quantity = v.quantity
-        data.push(obj)
+
+      let box_orders_products = [];
+      let team_id = '';
+      let team_name = '';
+      let employee_ids = '';
+      let employee_names = '';
+      this.list.forEach((v,index) => {
+
+        let box_orders_product = {
+          "item_num": (index+1),
+          "product_no": v.material_code,
+          "product_title": v.material_code_show,
+          "color_code": v.craft_type_code_show,
+          "process_code_two": v.craft_type_two_code,
+          "color_code_two": v.decor_two_code,
+          "process_title": v.craft_type_code_show,
+          "color": v.decor_code_show,
+          "process_title_two": v.craft_type_two_show,
+          "color_two":  v.decor_two_code_show,
+          "product_size": v.specs,
+          "product_unit": v.unit_code,
+          "product_unit_title": v.unit_code_show,
+          "order_no": v.exe_sale_order_b.no,
+          "order_item_id": v.id,
+          "order_item_no": v.item_no,
+          "customer_no": v.exe_sale_order_b.customer_code,
+          "customer_name": v.exe_sale_order_b.customer_code_show,
+          "dealer_no": v.exe_sale_order_b.jingxiaoshang,
+          "dealer_name": v.exe_sale_order_b.jingxiaoshang_show,
+          "box_num": v.un_box_num
+        }
+        team_id = v.team_id;
+
+        box_orders_products.push(box_orders_product);
       })
-      if (!this.state) {
-        return false
-      } else {
-        this.state = false
-        this.axios.post('/api/mobileFinishedOrderAdd', { ...data }).then(res => {
-          if (res.code === 200) {
-            this.state = true
-            this.$Message.success(res.msg)
-            this.handleReturn()
-          }
-        })
+      const box_orders = {
+        "defective_order_no": null,
+        "box_time": new Date(),
+        "team_id": "BZ00016",
+        "employee_id": "RX0001",
+        "query_order_on": null,
+        "site": null,
+        "created_by": null,
+        "created_date": null,
+        "last_modified_by": null,
+        "last_modified_date": null,
+        "employee_id_show": "郭银",
+        "team_id_show": "包装一组"
+
       }
+      // return false;
+      let data = {
+        "bizTypeEk": "LOWCODE",
+        "bizId": -1,
+        "dynamicFormId": "474107044420857856",
+        "showModelId": "474108545251880960",
+        data: {
+          "box_orders" : box_orders,
+          "box_orders_label_product" : [],
+          "box_orders_product" : box_orders_products,
+          "production_orders_dtl" : box_orders_products,
+        }
+      }
+      console.log(JSON.stringify(data));return false;
+
     }
   }
 }