فهرست منبع

Merge branch 'master' of 121.41.102.225:Nidong/jiufang into hw

mushencc 3 سال پیش
والد
کامیت
3b1b2ce59d

+ 5 - 4
src/views/OrderMannage/BusinessOrderlist/edit.vue

@@ -3694,7 +3694,7 @@ export default {
       });
     },
     handleSet(row, index, type) {
-      // console.log("row :>> ", row);
+      console.log("row :>> ", row);
       let obj;
       // 1 新增 2 编辑 3 删除 4复制  5详情
       switch (type) {
@@ -3762,6 +3762,10 @@ export default {
         case 4:
           obj = this.deepClone(row);
           obj.position = "";
+          obj.measure.map((v)=>{
+            v.value = ''
+            obj[v.e_title]=''
+          })
           if (!row.is_metal) {
             this.route_id_at_copy = row.route_id;
           }
@@ -4956,7 +4960,6 @@ export default {
                 item.formula_temp = item.formula_temp.replace(/T/g, item.high);
                 item.formula_value = eval(item.formula_temp);
                 product.over_price += item.formula_value * 1 || 0;
-                product.over_price = product.over_price.toFixed(2);
               }
               if (
                 element.type == 2 &&
@@ -4969,7 +4972,6 @@ export default {
                 item.formula_temp = item.formula_temp.replace(/T/g, item.high);
                 item.formula_value = eval(item.formula_temp);
                 product.over_price += item.formula_value * 1 || 0;
-                product.over_price = product.over_price.toFixed(2);
               }
               if (
                 element.type == 3 &&
@@ -4982,7 +4984,6 @@ export default {
                 item.formula_temp = item.formula_temp.replace(/T/g, item.high);
                 item.formula_value = eval(item.formula_temp);
                 product.over_price += item.formula_value * 1 || 0;
-                product.over_price = product.over_price.toFixed(2);
               }
             });
         });

+ 38 - 29
src/views/ProductionOrderList/ProductionPlanlist/details.vue

@@ -107,7 +107,7 @@ export default {
           name: "Select",
           multiple: true,
           filterable: true,
-          value: '',
+          value: "",
           serverName: "part",
           placeholder: "请选择部件",
           option: [{ label: 1, value: 1 }],
@@ -140,7 +140,7 @@ export default {
           serverName: "url_number",
           placeholder: "请选择图号",
           option: [],
-        }
+        },
       ],
       tableColums: [
         { type: "selection", align: "center", fixed: "left", width: "100" },
@@ -153,7 +153,9 @@ export default {
             const { row } = params;
             return h(
               "span",
-              `${row.house}-${row.unit}-${row.layer}-${row.number_detail}`
+              `${row.house ? row.house + "-" : ""}${
+                row.unit ? row.unit + "-" : ""
+              }${row.layer ? row.layer + "-" : ""}${row.number_detail}`
             );
           },
         },
@@ -196,7 +198,12 @@ export default {
         //   key: "position",
         //   minWidth: 100,
         // },
-        { title: "产品名称", align: "center", key: "product_title", minWidth: 200 },
+        {
+          title: "产品名称",
+          align: "center",
+          key: "product_title",
+          minWidth: 200,
+        },
         { title: "部件", align: "center", key: "part_title", minWidth: 200 },
         {
           title: "部件是否贴标签",
@@ -306,11 +313,11 @@ export default {
           (v.value = v.title), (v.label = v.title);
         });
         res.data.url_number.map((v) => {
-          var j = {value:'',label:'',title:''};
+          var j = { value: "", label: "", title: "" };
           j.value = v.url_number;
           j.label = v.url_number;
           j.title = v.url_number;
-          this.arrList.push(j)
+          this.arrList.push(j);
         });
         this.list[4].option = res.data.part;
         this.list[5].option = res.data.produce;
@@ -323,31 +330,33 @@ export default {
       this.$router.go(-1);
     },
     getData(row) {
-      this.axios.get("/api/orders_procedure_list", { params: row }).then((res) => {
-        this.logList = res.data.detail;
-        this.tableData = res.data.list;
-        this.total = res.data.total;
+      this.axios
+        .get("/api/orders_procedure_list", { params: row })
+        .then((res) => {
+          this.logList = res.data.detail;
+          this.tableData = res.data.list;
+          this.total = res.data.total;
           res.data.house.map((v) => {
-          v.value = v.house;
-          v.label = v.house;
-        });
-        res.data.unit.map((v) => {
-          v.value = v.unit;
-          v.label = v.unit;
+            v.value = v.house;
+            v.label = v.house;
+          });
+          res.data.unit.map((v) => {
+            v.value = v.unit;
+            v.label = v.unit;
+          });
+          res.data.layer.map((v) => {
+            v.value = v.layer;
+            v.label = v.layer;
+          });
+          res.data.number_detail.map((v) => {
+            v.value = v.number;
+            v.label = v.number;
+          });
+          this.list[0].option = res.data.house;
+          this.list[1].option = res.data.unit;
+          this.list[2].option = res.data.layer;
+          this.list[3].option = res.data.number_detail;
         });
-        res.data.layer.map((v) => {
-          v.value = v.layer;
-          v.label = v.layer;
-        });
-        res.data.number_detail.map((v) => {
-          v.value = v.number;
-          v.label = v.number;
-        });
-         this.list[0].option = res.data.house;
-        this.list[1].option = res.data.unit;
-        this.list[2].option = res.data.layer;
-        this.list[3].option = res.data.number_detail;
-      });
     },
     postData() {},
     changePage(e) {

+ 125 - 29
src/views/ProductionOrderList/ProductionsOrder/Decorationlist.vue

@@ -582,9 +582,11 @@ export default {
             const { row } = params;
             return h(
               "span",
-              `${row.house ? row.house +'-': ""}${row.unit ? row.unit+'-' : ""}${
-                row.layer ? row.layer+'-' : ""
-              }${row.number_detail ? row.number_detail : ""}`
+              `${row.house ? row.house + "-" : ""}${
+                row.unit ? row.unit + "-" : ""
+              }${row.layer ? row.layer + "-" : ""}${
+                row.number_detail ? row.number_detail : ""
+              }`
             );
           },
         },
@@ -1323,21 +1325,16 @@ export default {
     test_run_print(url, data) {
       let sub_data = JSON.parse(data);
       sub_data.printparams = JSON.stringify(sub_data.printparams);
-      // let xhr = new XMLHttpRequest();
-      // xhr.open('post',url)
-      // xhr.setRequestHeader()
-      // xhr.send()
-      // console.log('xhr :>> ', xhr);
       $.ajax({
         type: "post",
         url,
         data: sub_data,
         dataType: "json",
         timeout: 5000,
-        headers: {
-          "Content-Length": 222,
-          "Content-Type": " application/x-www-form-urlencoded; charset=UTF-8",
-        },
+        // headers: {
+        // "Content-Length": 555,
+        // "Content-Type": " application/x-www-form-urlencoded; charset=UTF-8",
+        // },
         success: function(result) {
           if (result.retval == "0") {
             this.$Message.success("发送成功");
@@ -1349,14 +1346,13 @@ export default {
     },
     handlePrintChips(contents) {
       this.axios.get("/api/get_print_url").then((res) => {
-        console.log(res);
         let data = {};
-        // let url = "http://192.168.186.100:888/postek/print"; //request_url
-        let url = res.data.request_url; //request_url
+        // let url = "http://192.168.0.145:888/postek/print"; //request_url
+        let url = `http://${res.data.request_url}:888/postek/print`; //request_url
         data.reqParam = "1";
         let printparamsJsonArray = [];
         // let IP = "192.168.1.58";//print_url
-        // let IP = "192.168.186.199";//print_url
+        // let IP = "192.168.0.199"; //print_url
         let IP = res.data.print_url;
         let port = 9100;
         let IP_Port = IP + "," + port;
@@ -1366,57 +1362,157 @@ export default {
         printparamsJsonArray.push({ PTK_SetPrintSpeed: "4" });
         printparamsJsonArray.push({ PTK_SetDarkness: "10" });
         printparamsJsonArray.push({
-          PTK_SetLabelHeight: 236 + "," + 24 + ",0,false",
+          PTK_SetLabelHeight: 624 + "," + 24 + ",0,false",
         });
-        printparamsJsonArray.push({ PTK_SetLabelWidth: 873 });
+        printparamsJsonArray.push({ PTK_SetLabelWidth: 1080 });
         contents.map((content) => {
+          //贝斯特打印格式
+          //上
           const printContent_l1 = `项目:${content.client_name}`;
           printparamsJsonArray.push({
             PTK_DrawText_TrueType:
-              "100,40,45,0,微软雅黑,1,700,0,0,0," + printContent_l1,
+              "100,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1,
           });
           const printContent_l1_2 = `区域:${content.house}-${content.layer}${content.position}`;
           printparamsJsonArray.push({
             PTK_DrawText_TrueType:
-              "420,40,45,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
+              "600,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
           });
           const printContent_l2 = `房号:${content.number_detail}`;
           printparamsJsonArray.push({
             PTK_DrawText_TrueType:
-              "100,90,45,0,微软雅黑,1,700,0,0,0," + printContent_l2,
+              "100,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2,
           });
           const printContent_l2_2 = `产品:${content.product_title}`;
           printparamsJsonArray.push({
             PTK_DrawText_TrueType:
-              "420,90,45,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
+              "600,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
           });
           const printContent_l3 = `图号:${content.url_number}`;
           printparamsJsonArray.push({
             PTK_DrawText_TrueType:
-              "100,140,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
+              "100,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3,
           });
-          const printContent_l3_2 = `木皮:${content.color_title}`;
+          const printContent_l3_2 = `部件:${content.part_title}`;
           printparamsJsonArray.push({
             PTK_DrawText_TrueType:
-              "420,140,45,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
+              "600,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
           });
-
-          const printContent_l4 = `部件:${content.part_title}`;
+          const printContent_l4 = `木皮:${content.color_title}`;
           printparamsJsonArray.push({
             PTK_DrawText_TrueType:
-              "100,190,45,0,微软雅黑,1,700,0,0,0," + printContent_l4,
+              "100,320,60,0,微软雅黑,1,700,0,0,0," + printContent_l4,
           });
           const printContent_l4_2 = `尺寸:${content.measure}`;
           printparamsJsonArray.push({
             PTK_DrawText_TrueType:
-              "420,190,45,0,微软雅黑,1,700,0,0,0," + printContent_l4_2,
+              "100,250,60,0,微软雅黑,1,700,0,0,0," + printContent_l4_2,
+          });
+          //下
+          printparamsJsonArray.push({
+            PTK_DrawText_TrueType:
+              "100,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1,
+          });
+          printparamsJsonArray.push({
+            PTK_DrawText_TrueType:
+              "600,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
+          });
+          printparamsJsonArray.push({
+            PTK_DrawText_TrueType:
+              "100,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2,
+          });
+          printparamsJsonArray.push({
+            PTK_DrawText_TrueType:
+              "600,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
           });
           printparamsJsonArray.push({
+            PTK_DrawText_TrueType:
+              "100,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
+          });
+          printparamsJsonArray.push({
+            PTK_DrawText_TrueType:
+              "600,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
+          });
+          printparamsJsonArray.push({
+            PTK_DrawText_TrueType:
+              "100,570,45,0,微软雅黑,1,700,0,0,0," + printContent_l4,
+          });
+          printparamsJsonArray.push({
+            PTK_DrawText_TrueType:
+              "600,570,45,0,微软雅黑,1,700,0,0,0," + printContent_l4_2,
+          });
+          // 17,35 420
+          printparamsJsonArray.push({
             PTK_RWRFIDLabel:
               "1,0,0," + content.chip.length / 2 + ",1," + content.chip,
           });
           printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
         });
+        // contents.map((content) => {
+        //   //江山打印格式
+        //   //上
+        //   const printContent_l1 = `单号:${content.order_no}`;
+        //   printparamsJsonArray.push({
+        //     PTK_DrawText_TrueType:
+        //       "100,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1,
+        //   });
+        //   const printContent_l1_2 = `型号:${content.product_title}`;
+        //   printparamsJsonArray.push({
+        //     PTK_DrawText_TrueType:
+        //       "600,40,60,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
+        //   });
+        //   const printContent_l2 = `尺寸:${content.measure}`;
+        //   printparamsJsonArray.push({
+        //     PTK_DrawText_TrueType:
+        //       "100,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2,
+        //   });
+        //   const printContent_l2_2 = `工艺:${content.process_title}`;
+        //   printparamsJsonArray.push({
+        //     PTK_DrawText_TrueType:
+        //       "600,110,60,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
+        //   });
+        //   const printContent_l3 = `颜色:${content.color_title}`;
+        //   printparamsJsonArray.push({
+        //     PTK_DrawText_TrueType:
+        //       "100,250,60,0,微软雅黑,1,700,0,0,0," + printContent_l3,
+        //   });
+        //   const printContent_l3_2 = `部件:${content.part_title}`;
+        //   printparamsJsonArray.push({
+        //     PTK_DrawText_TrueType:
+        //       "100,180,60,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
+        //   });
+        //   //下
+        //   printparamsJsonArray.push({
+        //     PTK_DrawText_TrueType:
+        //       "100,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1,
+        //   });
+        //   printparamsJsonArray.push({
+        //     PTK_DrawText_TrueType:
+        //       "600,435,45,0,微软雅黑,1,700,0,0,0," + printContent_l1_2,
+        //   });
+        //   printparamsJsonArray.push({
+        //     PTK_DrawText_TrueType:
+        //       "100,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2,
+        //   });
+        //   printparamsJsonArray.push({
+        //     PTK_DrawText_TrueType:
+        //       "600,480,45,0,微软雅黑,1,700,0,0,0," + printContent_l2_2,
+        //   });
+        //   printparamsJsonArray.push({
+        //     PTK_DrawText_TrueType:
+        //       "100,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
+        //   });
+        //   printparamsJsonArray.push({
+        //     PTK_DrawText_TrueType:
+        //       "600,525,45,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
+        //   });
+        //   printparamsJsonArray.push({
+        //     PTK_RWRFIDLabel:
+        //       "1,0,0," + content.chip.length / 2 + ",1," + content.chip,
+        //   });
+        //   printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
+        // });
+
         printparamsJsonArray.push({ PTK_CloseConnect: "" });
         data.printparams = printparamsJsonArray;
         // data.printparams = JSON.stringify(printparamsJsonArray);

+ 32 - 12
src/views/leadMatch/MatchList/matchCheck.vue

@@ -193,7 +193,11 @@
             </span>
           </Col>
           <Col span="2">
-            <Button @click="back" size="small" type="primary">
+            <Button
+              @click="getMatchedDetailList(matched_info)"
+              size="small"
+              type="primary"
+            >
               搜索
             </Button>
           </Col>
@@ -214,8 +218,18 @@
                 </span>
                 <span>{{ matched_detail.num }}组</span>
               </Col>
+              <Col span="2" offset="12" style="padding:10px 0">
+                <Button
+                  @click="handleHiddenMatchedDetail(matched_detail)"
+                  size="small"
+                  type="text"
+                >
+                  {{ matched_detail.isHidden ? "展开" : "收缩" }}
+                </Button>
+              </Col>
             </Row>
             <Table
+              v-show="!matched_detail.isHidden"
               :columns="matchedSheetTableColumns"
               border
               :max-height="500"
@@ -308,9 +322,9 @@ export default {
       matchedSheetTableColumns: [
         { title: "序号", align: "center", type: "index", minWidth: 60 },
         { title: "区域名称", align: "center", key: "region", minWidth: 100 },
-        { title: "房号", align: "center", key: "number", minWidth: 60 },
+        { title: "房号", align: "center", key: "house_number", minWidth: 60 },
         { title: "部件名称", align: "center", key: "part_name", minWidth: 80 },
-        { title: "行号", align: "center", key: "line", minWidth: 60 },
+        { title: "行号", align: "center", key: "line", minWidth: 70 },
         { title: "木皮1", align: "center", key: "skin1", minWidth: 60 },
         {
           title: "原材料",
@@ -332,7 +346,7 @@ export default {
         {
           title: "零部件数量",
           align: "center",
-          key: "cut_number",
+          key: "num",
           minWidth: 90,
         },
         { title: "贴皮面积", align: "center", key: "stick", minWidth: 80 },
@@ -414,6 +428,14 @@ export default {
           this.matchedList = res.data.list;
         });
     },
+    handleHiddenMatchedDetail(row) {
+      if (row.isHidden) {
+        row.isHidden = !row.isHidden;
+      } else {
+        row.isHidden = true;
+      }
+      this.$forceUpdate();
+    },
     handleShowCurrencyMatched(row) {
       if (row.isCurrenct) {
         row.isCurrenct = !row.isCurrenct;
@@ -426,14 +448,12 @@ export default {
     getMatchedDetailList(row) {
       row.isCurrenct &&
         this.axios
-          .get("/api/bst_matching_on_detail", {
-            params: {
-              cut_order_product_id: row.id,
-              id: this.matchedInfo.id,
-              number: this.matchedInfo.number,
-              part_name: this.matchedInfo.part_name,
-              region: this.matchedInfo.region,
-            },
+          .post("/api/bst_matching_on_detail", {
+            cut_order_product_id: row.id,
+            id: this.matchedInfo.id,
+            number: this.matchedInfo.number,
+            part_name: this.matchedInfo.part_name,
+            region: this.matchedInfo.region,
           })
           .then((res) => {
             this.regionMatchedList = res.data.region;

+ 131 - 75
src/views/leadMatch/MatchList/matchPage.vue

@@ -8,16 +8,16 @@
         style="margin-right: 10px"
         >自动匹配</Button
       >
-      <!-- <Button @click="back" v-else type="primary" style="margin-right: 10px"
+      <Button @click="back" v-else type="primary" style="margin-right: 10px"
         >撤销匹配</Button
-      > -->
+      >
       <Button @click="back" type="primary" ghost style="margin-right: 10px"
         >返回</Button
       >
     </Toptitle>
     <div class="top-info">
       <Row align="middle">
-        <Col span="4">
+        <Col span="6">
           <span>项目编号:</span><span>{{ info.project_number }}</span>
         </Col>
         <Col span="4"
@@ -65,17 +65,17 @@
             </Select>
           </span>
         </Col>
-        <Col span="4" v-if="currencyTag == 1">
-          <Button @click="handleSearchUnmatchedInfo" type="primary"
-            >确认</Button
-          >
+        <Col span="2" v-if="currencyTag == 1">
+          <Button @click="handleSearchUnmatchedInfo" type="primary">
+            确认
+          </Button>
         </Col>
       </Row>
     </div>
     <div class="context-tabs">
       <Tabs type="card" @on-click="handleTabsClick" v-model="currencyTag">
         <Button
-          @click="showHandingMatchModal = true"
+          @click="handleIsAllowHandingMatch"
           type="primary"
           size="small"
           slot="extra"
@@ -95,6 +95,7 @@
                   <div
                     v-for="url_info in unmatchedObj.urlList"
                     :key="url_info.id"
+                    v-show="url_info.product_detail_num > 0"
                     style="padding-top:10px"
                   >
                     <Row type="flex" align="middle">
@@ -108,7 +109,7 @@
                       </Col>
                       <Col span="4">
                         <span>批量数:</span>
-                        <span>{{ url_info.house_num }}</span>
+                        <span>{{ url_info.number }}</span>
                       </Col>
                       <Col span="4" offset="4">
                         <span>
@@ -244,10 +245,9 @@
                                 @click="handleHiddenSheetDetail(table_info)"
                                 size="small"
                                 type="text"
-                                >{{
-                                  table_info.isHidden ? "展开" : "收缩"
-                                }}</Button
                               >
+                                {{ table_info.isHidden ? "展开" : "收缩" }}
+                              </Button>
                             </Col>
                           </Row>
                         </div>
@@ -274,6 +274,7 @@
                 <div class="context-unmatched-room">
                   <div
                     v-for="url_info in unmatchedObj.urlList"
+                    v-show="url_info.house_num > 0"
                     :key="url_info.id"
                     style="padding-top:10px"
                   >
@@ -316,7 +317,7 @@
                     <Row>
                       <Col span="4">
                         <span>批量数:</span>
-                        <span>{{ url_info.house_num }}</span>
+                        <span>{{ url_info.number }}</span>
                       </Col>
                     </Row>
                     <div
@@ -493,7 +494,16 @@
               <Col span="6">
                 <span>产品名称:{{ matched_info.product_name }}</span>
               </Col>
-              <Col span="2" offset="10">
+              <Col span="2" offset="8">
+                <Button
+                  @click="handleMatchedSet(matched_info, -1, 5)"
+                  type="primary"
+                  size="small"
+                  style="margin-right: 10px"
+                  >撤销匹配</Button
+                >
+              </Col>
+              <Col span="2">
                 总计
                 <span style="color:red">{{ matched_info.num }}</span>
                 条数据
@@ -609,8 +619,18 @@
                     </span>
                     <span>{{ matched_detail.num }}组</span>
                   </Col>
+                  <Col span="2" offset="12" style="padding:10px 0">
+                    <Button
+                      @click="handleHiddenMatchedDetail(matched_detail)"
+                      size="small"
+                      type="text"
+                    >
+                      {{ matched_detail.isHidden ? "展开" : "收缩" }}
+                    </Button>
+                  </Col>
                 </Row>
                 <Table
+                  v-show="!matched_detail.isHidden"
                   :columns="matchedSheetTableColumns"
                   border
                   :ref="'matched' + index"
@@ -618,9 +638,9 @@
                   @on-selection-change="handleMatchedSelectChange"
                   :data="matched_detail.detail"
                 >
-                  <template slot="setSlot" slot-scope="{ row, index }">
+                  <!-- <template slot="setSlot" slot-scope="{ row, index }">
                     <a @click="handleMatchedSet(row, index, 5)">撤销匹配 </a>
-                  </template>
+                  </template> -->
                 </Table>
               </div>
             </div>
@@ -628,13 +648,16 @@
         </TabPane>
       </Tabs>
     </div>
-    <Modal v-model="showHandingMatchModal" title="手动匹配确认">
+    <Modal width="80" v-model="showHandingMatchModal" title="手动匹配确认">
       <div>
         <Row style="padding:10px 0 ">
-          <Col span="8">部件名称:</Col>
-          <Col span="6">未匹配数量</Col>
-          <Col span="4" offset='6'>
-            <Button size="small" @click="showHandingMatchModal = false">
+          <Col span="8">部件名称:{{ currentChooseTitle }}</Col>
+          <Col span="6">未匹配数量:{{ currentChooseNumber }}</Col>
+          <Col span="4"
+            >余:{{ currentChooseNumber - currentChooseNumberUsed }}</Col
+          >
+          <Col span="4" offset="2">
+            <Button size="small" @click="handleHandingMatchAVG">
               平均分配
             </Button>
           </Col>
@@ -648,7 +671,10 @@
           :data="unmatchedSelectedList"
         >
           <template slot="numSlot" slot-scope="{ row, index }">
-            <Input v-model="row.num" />
+            <Input
+              @on-change="handleHandingMatchNumChange"
+              v-model="unmatchedSelectedList[index].num"
+            />
           </template>
         </Table>
       </div>
@@ -704,40 +730,17 @@ export default {
       partNameMatchedList: [], //部件列表 已匹配
       unmatchedObj: {
         urlList: [], //图号列表
-        part_list: [
-          { part_list: [{ title: 1 }], key: { list: [], num: null } },
-          { part_list: [{ title: 1 }], key: { list: [], num: null } },
-        ], //当前图号下表格列表
+        part_list: [], //当前图号下表格列表
       }, //码单信息
       unmatchedRoomList: {
         urlList: [], //图号列表
         house_list: [{ title: 1 }], //当前图号下表格列表
       }, //房间信息
       currentChooseId: "", //选中码单信息中的ID
-      matchedList: [
-        {
-          number: "123",
-          product_name: "321",
-          isSelect: false,
-          product_detail_num: 1,
-          detail: [
-            {
-              title: "333",
-            },
-          ],
-        },
-        {
-          number: "aaa",
-          product_name: "vvv",
-          isSelect: true,
-          product_detail_num: 2,
-          detail: [
-            {
-              title: "ddd",
-            },
-          ],
-        },
-      ],
+      currentChooseNumber: "", //选中码单信息中的ID
+      currentChooseTitle: "", //选中码单信息中的ID
+      currentChooseNumberUsed: "",
+      matchedList: [],
       matchedDetailList: [],
       unmatchedSheetTableColumns: [
         {
@@ -761,6 +764,8 @@ export default {
                 on: {
                   "on-change": () => {
                     self.currentChooseId = params.row.id;
+                    self.currentChooseNumber = params.row.unbind_number;
+                    self.currentChooseTitle = params.row.part_name;
                   },
                 },
               }),
@@ -769,7 +774,7 @@ export default {
         },
         { title: "序号", align: "center", type: "index", minWidth: 60 },
         { title: "部件名称", align: "center", key: "part_name", minWidth: 100 },
-        { title: "行号", align: "center", key: "line", minWidth: 60 },
+        { title: "行号", align: "center", key: "line", minWidth: 70 },
         { title: "木皮1", align: "center", key: "skin1", minWidth: 60 },
         {
           title: "原材料",
@@ -815,12 +820,12 @@ export default {
       ], //未匹配房间表头
       unmatchedRoomTableColumnsUsed: [],
       matchedSheetTableColumns: [
-        { title: "全选", align: "center", minWidth: 60, type: "selection" },
+        // { title: "全选", align: "center", minWidth: 60, type: "selection" },
         { title: "序号", align: "center", type: "index", minWidth: 60 },
         { title: "区域名称", align: "center", key: "region", minWidth: 100 },
         { title: "房号", align: "center", key: "house_number", minWidth: 60 },
         { title: "部件名称", align: "center", key: "part_name", minWidth: 80 },
-        { title: "行号", align: "center", key: "line", minWidth: 60 },
+        { title: "行号", align: "center", key: "line", minWidth: 70 },
         { title: "木皮1", align: "center", key: "skin1", minWidth: 60 },
         {
           title: "原材料",
@@ -842,19 +847,19 @@ export default {
         {
           title: "零部件数量",
           align: "center",
-          key: "cut_number",
+          key: "num",
           minWidth: 90,
         },
         { title: "贴皮面积", align: "center", key: "stick", minWidth: 80 },
         { title: "精裁面积", align: "center", key: "cut", minWidth: 80 },
         { title: "工艺要求", align: "center", key: "remark", minWidth: 80 },
-        {
-          title: "操作",
-          align: "center",
-          key: "title",
-          minWidth: 80,
-          slot: "setSlot",
-        },
+        // {
+        //   title: "操作",
+        //   align: "center",
+        //   key: "title",
+        //   minWidth: 80,
+        //   slot: "setSlot",
+        // },
       ], //匹配表头
       unmatchedRoomTableColumnsModal: [],
       unmatchedSelectedList: [],
@@ -874,6 +879,7 @@ export default {
     },
     handleSelectChange(selection) {
       this.unmatchedSelectedList = selection;
+      this.unmatchedSelectedList.map((v) => (v.num = ""));
     },
     handleMatchedSelectChange(selection) {
       this.matchedSelectedList = this.matchedSelectedList.concat(
@@ -884,6 +890,7 @@ export default {
     },
     handleTabsClick(name) {
       name == 2 && this.handleMatchedListInit();
+      name == 1 && this.handleSearchUnmatchedInfo();
     },
     handleMatchedListInit() {
       this.axios
@@ -919,7 +926,14 @@ export default {
         row.isHidden = true;
       }
       this.$forceUpdate();
-      console.log("row :>> ", row);
+    },
+    handleHiddenMatchedDetail(row) {
+      if (row.isHidden) {
+        row.isHidden = !row.isHidden;
+      } else {
+        row.isHidden = true;
+      }
+      this.$forceUpdate();
     },
     handleShowCurrencyMatched(row) {
       if (row.isCurrenct) {
@@ -960,7 +974,9 @@ export default {
                 slot: "numSlot",
               }
             );
-            this.unmatchedRoomTableColumnsModal = this.unmatchedRoomTableColumnsModal.splice(1)
+            this.unmatchedRoomTableColumnsModal = this.unmatchedRoomTableColumnsModal.splice(
+              1
+            );
             this.cut_size = res.data.search_word.cut_size;
             this.number = res.data.search_word.number;
             this.part_name = res.data.search_word.part_name;
@@ -1005,6 +1021,31 @@ export default {
         }
       });
     },
+    handleHandingMatchAVG() {
+      let num = parseInt(
+        this.currentChooseNumber / this.unmatchedSelectedList.length
+      );
+      this.unmatchedSelectedList.map((v) => {
+        v.num = num;
+      });
+      this.unmatchedSelectedList = JSON.parse(
+        JSON.stringify(this.unmatchedSelectedList)
+      );
+      this.handleHandingMatchNumChange();
+    },
+    handleIsAllowHandingMatch() {
+      if (this.currentChooseNumber < this.unmatchedSelectedList.length) {
+        return this.$Message.warning("未匹配数量不足,请重新选择");
+      }
+      this.showHandingMatchModal = true;
+    },
+    handleHandingMatchNumChange() {
+      let sum = 0;
+      this.unmatchedSelectedList.map((v) => {
+        sum += v.num * 1;
+      });
+      this.currentChooseNumberUsed = sum;
+    },
     handleAutoMatching() {
       this.axios
         .post("/api/matching_product_house", {
@@ -1020,35 +1061,50 @@ export default {
         });
     },
     handleHandingMatch() {
+      const house = this.unmatchedSelectedList.map((v) => {
+        return { cut_order_product_room_id: v.id, num: v.num };
+      });
       this.axios
         .post("/api/bst_hand_matching", {
           cut_order_product_detail_id: this.currentChooseId,
-          house: [],
+          house,
         })
         .then((res) => {
-          console.log(res);
+          if (res.code == 200) {
+            this.$Message.success(res.msg);
+            this.showHandingMatchModal = false;
+            this.handleSearchUnmatchedInfo();
+            this.currentChooseId = "";
+            this.currentChooseNumber = "";
+            this.currentChooseTitle = "";
+            this.unmatchedSelectedList = [];
+          }
         });
     },
     handleMatchedSelectAll(bool) {
-      for (let index = 0; index < this.matchedDetailList.length; index++) {
-        // const element = this.matchedDetailList[index];
-        this.$refs["matched" + index][0].selectAll(bool);
-        // console.log('this.$refs :>> ', this.$refs['matched'+index]);
-      }
+      // for (let index = 0; index < this.matchedDetailList.length; index++) {
+      // const element = this.matchedDetailList[index];
+      // this.$refs["matched" + index][0].selectAll(bool);
+      // console.log('this.$refs :>> ', this.$refs['matched'+index]);
+      // }
     },
     handleMatchedSet(row, index, type) {
+      let cut_order_product_id = [];
       switch (type) {
         case 5:
+          if (index == -1) {
+            cut_order_product_id = [row.id];
+          } else {
+            cut_order_product_id = [row.cut_order_product_id];
+          }
           this.axios
-            .get("/api/bst_cancer_matching", {
-              params: {
-                cut_order_product_id: row.cut_order_product_id,
-              },
+            .post("/api/bst_cancer_matching", {
+              cut_order_product_id,
             })
             .then((res) => {
               if (res.code == 200) {
                 this.$Message.success(res.msg);
-                console.log(res);
+                this.handleMatchedListInit();
               }
             });
           break;

+ 1 - 1
vue.config.js

@@ -1,6 +1,6 @@
 const axios_default_ip =
     process.env.NODE_ENV == 'dev' ?
-    'http://121.41.102.225:82' :
+    'http://121.37.173.82:82' :
     process.env.NODE_ENV == 'test-prd' ?
     'http://121.41.102.225:82' //测试服
     :