Andy 3 năm trước cách đây
mục cha
commit
057b5a054d

+ 67 - 64
src/components/product/add/index.vue

@@ -740,7 +740,7 @@ export default {
         {
           type_name: "产品1",
           num: 1,
-          position: "位置",
+          position: "",
           index: "0",
           extArray: [],
         },
@@ -945,6 +945,7 @@ export default {
             modalData.measure.forEach((element) => {
               element.value = "";
               element.measureCalc = element.e_title;
+              modalData[element.measureCalc] = "";
             });
             //工艺属性
             modalData.process = [];
@@ -1322,10 +1323,10 @@ export default {
       if (e.target.value) {
         let cur_measure = measure_detail.measureCalc;
         let cur_value = measure_detail.value;
+        product[cur_measure] = cur_value;
         product.over_price = 0;
         //当前测量字段 L W H  修改部件测量字段
         product.part.forEach((element) => {
-          console.log("element :>> ", element);
           if (!element.is_metal) {
             element.highCalc = element.highCalc + "";
             element.longCalc = element.longCalc + "";
@@ -1381,6 +1382,9 @@ export default {
               element.wide += "";
             }
             element.part_detail.forEach((elem) => {
+              elem.highCalc = elem.high + "";
+              elem.longCalc = elem.long + "";
+              elem.wideCalc = elem.wide + "";
               if (!elem.high) {
               } else if (elem.highCalc.indexOf(cur_measure) != -1) {
                 elem.high = elem.highCalc.replace(
@@ -1464,7 +1468,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 &&
@@ -1477,7 +1480,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 &&
@@ -1490,10 +1492,10 @@ 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);
               }
             });
         });
+        product.over_price = product.over_price.toFixed(2);
         //修改核算数量
         // 如果没有核算数量公式,核算数量取产品数量
         if (product.num_formula == "") {
@@ -1518,83 +1520,84 @@ export default {
             (product.ext_price * 1 || 0);
           product.price = product.price.toFixed(2);
         }
-        product = this.deepClone(product);
         this.$forceUpdate();
       }
     },
     handleProductMeasureBlur(e, product, measure_detail) {
       this.handleProductMeasureChange(e, product, measure_detail);
-      try {
-        measure_detail.value = eval(e.target.value);
-      } catch (error) {
-        console.log("error :>> ", error);
-      }
-      product.part.map((part) => {
-        part.part_detail &&
-          part.part_detail.length > 0 &&
-          part.part_detail.map((part_detail) => {
-            part_detail._longCalc = this.handleCalcPartDetailLong(
-              part_detail,
-              product
-            );
-            if (part_detail.material_detail_list.length > 1) {
-              try {
-                part_detail.longCalcFinal = eval(part_detail._longCalc);
-                part_detail.material_detail_id = this.handleFindNearest(
-                  part_detail.material_detail_list,
-                  part_detail.longCalcFinal
-                );
-              } catch (error) {
-                console.log("error :>> ", error);
+      if (e.target.value) {
+        try {
+          measure_detail.value = eval(e.target.value);
+        } catch (error) {
+          console.log("error :>> ", error);
+        }
+        let line = [];
+        product.part.map((part) => {
+          part.part_title.indexOf("线条") != -1 && (line = part.change);
+          part.part_detail &&
+            part.part_detail.length > 0 &&
+            part.part_detail.map((part_detail) => {
+              part_detail._longCalc = this.handleCalcPartDetailLong(
+                part_detail,
+                product
+              );
+              if (part_detail.material_detail_list.length > 1) {
+                try {
+                  part_detail.longCalcFinal = eval(part_detail._longCalc);
+                  part_detail.material_detail_id = this.handleFindNearest(
+                    part_detail.material_detail_list,
+                    part_detail.longCalcFinal
+                  );
+                } catch (error) {
+                  console.log("error :>> ", error);
+                }
               }
-            }
-          });
-      });
-      console.log('product.process :>> ', product.process);
-      const process_ids = product.process.map((v) => {
-        return v.value;
-      });
-      this.axios
-        .post("/api/process_part_for_product", {
-          product_id: product.product_id,
-          process_ids,
-        })
-        .then((res) => {
-          for (const key in res.data) {
-            const element = res.data[key];
-            // 找到部件
-            const part_arr = product.part.filter((v) => v.part_id == key);
-            if (part_arr.length > 0) {
+            });
+        });
+        const process_ids = product.process.map((v) => {
+          return v.value;
+        });
+        const part_ids = line.map((v) => {
+          return v.part_id;
+        });
+        this.axios
+          .post("/api/process_part_for_product", {
+            product_id: product.product_id,
+            process_ids,
+            part_ids,
+          })
+          .then((res) => {
+            for (const key in res.data) {
+              const element = res.data[key];
+              // 找到部件
+              let part_arr = {};
+              product.part.map((v) => {
+                if (v.part_id == key) {
+                  part_arr = v;
+                }
+              });
               for (const k in element) {
                 const elem = element[k];
                 // 找到零部件
-                const part_detail_arr = part_arr[part_arr.length - 1].filter(
-                  (v) => v.part_detail_id == k
-                );
                 elem.map((match_item) => {
-                  const matched_part_detail = part_detail_arr[
-                    part_detail_arr.length - 1
-                  ].material_detail_list.filter(
-                    (v) => v.material_detail_id == match_item.material_detail_id
-                  );
                   if (
                     match_item.max > product[match_item.e_title] &&
                     match_item.min <= product[match_item.e_title]
                   ) {
-                    part_detail_arr[
-                      part_detail_arr.length - 1
-                    ].material_detail_id =
-                      matched_part_detail[
-                        matched_part_detail.length - 1
-                      ].material_detail_id;
+                    part_arr.part_detail.map((v) => {
+                      if (v.part_detail_id == k) {
+                        v.material_detail_id = match_item.material_detail_id;
+                        v.material_detail_org_num = match_item.num;
+                        v.material_detail_num = match_item.num;
+                      }
+                    });
                   }
                 });
               }
             }
-          }
-          console.log(res);
-        });
-      this.$forceUpdate();
+            this.$forceUpdate();
+          });
+      }
     },
     handleMaterialChange(val, row) {
       if (val) {

+ 52 - 0
src/views/BasicSettings/PartSettings/detail.vue

@@ -76,6 +76,30 @@
                 :value="item.id"
               ></Option>
             </Select>
+            <!-- <el-select
+              multiple
+              collapse-tags
+              filterable
+              v-model="formData.process_ids"
+              @change="changeProvinceSelect"
+              style="width: 200px"
+              @remove-tag="removeProvinceTag"
+            >
+              <el-option
+                label="全选"
+                value="全选"
+                v-show="process_list.length > 1"
+                @click.native="selectProvinceAll"
+              ></el-option>
+              <el-option
+                v-for="item in process_list"
+                ref="options"
+                :key="item.id"
+                :label="item.title"
+                :value="item.id"
+              >
+              </el-option>
+            </el-select> -->
           </span>
         </Col>
         <Col span="8">
@@ -290,6 +314,34 @@ export default {
     back() {
       this.$router.go(-1);
     },
+    changeProvinceSelect(val) {
+      if (!val.includes("全选") && val.length === this.process_list.length) {
+        this.formData.process_ids.unshift("全选");
+      } else if (
+        val.includes("全选") &&
+        val.length - 1 < this.process_list.length
+      ) {
+        this.formData.process_ids = this.formData.process_ids.filter((item) => {
+          return item.process_ids !== "全选";
+        });
+      }
+    },
+    removeProvinceTag(val) {
+      if (val === "全选") {
+        this.formData.process_ids = [];
+      }
+    },
+    selectProvinceAll() {
+      if (this.formData.process_ids.length <= this.process_list.length) {
+        this.formData.process_ids = [];
+        this.process_list.map((item) => {
+          this.formData.process_ids.push(item.process_ids);
+        });
+        this.formData.process_ids.unshift("全选");
+      } else {
+        this.formData.process_ids = [];
+      }
+    },
     handleSet(row, index, type) {
       if (!this.formData.part_id) {
         return this.$Message.warning("请先选择部件");

+ 116 - 73
src/views/OrderMannage/BusinessOrderlist/edit.vue

@@ -527,7 +527,7 @@
           class="my-xtable-iview"
           :footer-method="footerMethod"
           align="center"
-          :edit-config="type == 3 ? {} : { trigger: 'dblclick', mode: 'row' }"
+          :edit-config="type == 3 ? {} : { trigger: 'click', mode: 'row' }"
           :data="tableData"
         >
           <vxe-column type="seq" min-width="45">
@@ -2369,6 +2369,7 @@ export default {
       support_remark: [],
       bpp_list: [],
       process_obj: [],
+      timeout: null,
     };
   },
   computed: {
@@ -2545,7 +2546,7 @@ export default {
       // sendData.custom_detail_id = sendData.custom_id
       // let sendList = JSON.parse(JSON.stringify(this.tableData));
       let sendList = this.tableData.filter((v) => !v.is_metal);
-      let _save_metal = this.tableData.filter((v) => v.is_metal);
+      let _save_metal = this.tableData.filter((v) => v.is_metal && v.id);
       _save_metal.map((v) => {
         v.type = 1;
       });
@@ -2633,16 +2634,29 @@ export default {
           this.tableData.forEach((element) => {
             //表格编辑用数据
             element.num_temp_save = element.num || 1;
-            element.ext.map((v, k) => {
-              if (v.type == 2) {
-                v.id = v.ext_id;
-                v.total_price = v.num * v.price;
-              } else {
-                v.material_id = v.ext_id;
-                v.single_price = v.price;
-                v.price = v.num * v.single_price;
-              }
-            });
+            if (element.length > 0) {
+              element.ext.map((v, k) => {
+                if (v.type == 2) {
+                  v.id = v.ext_id;
+                  v.total_price = v.num * v.price;
+                } else {
+                  v.material_id = v.ext_id;
+                  v.single_price = v.price;
+                  v.price = v.num * v.single_price;
+                }
+              });
+            } else {
+              element.ext.push({
+                num: 0,
+                price: 0,
+                total_price: 0,
+                type: 2,
+                remark: "",
+                title: "",
+                id: "",
+                is_metal: true,
+              });
+            }
             element.extArray = element.ext;
             element.type_name = element.title;
             for (const k in element.procedure_properties) {
@@ -2813,10 +2827,20 @@ export default {
     handleSubmit(name) {
       this.$refs[name].validate((valid) => {
         if (valid) {
-          this.postData();
+          this.debounce(500);
         }
       });
     },
+    debounce(delay) {
+      if (this.timeout) {
+        // clearTimeout(this.timeout);
+        this.timeout = null
+      } else {
+        this.timeout = setTimeout(() => {
+          this.postData();
+        }, delay);
+      }
+    },
     handleEditProductSubmit() {
       this.$Modal.confirm({
         content: "请确认线条名称是否正确!",
@@ -3897,7 +3921,18 @@ export default {
     },
     handleClearExtInfo(modalData, pre_id, cur_id) {
       if (cur_id != pre_id) {
-        modalData.extArray = [];
+        modalData.extArray = [
+          {
+            num: 0,
+            price: 0,
+            total_price: 0,
+            type: 2,
+            remark: "",
+            title: "",
+            id: "",
+            is_metal: true,
+          },
+        ];
       } else {
         let sum = 0;
         modalData.extArray.map((v) => {
@@ -3982,7 +4017,8 @@ export default {
         row.ext_id = e.value;
         this.handleExtChange(row, e, item);
       } else {
-        row.ext_id;
+        row.ext_id = "";
+        row.title = "";
       }
     },
     changeEditPart(row, part_type, part_detail, e) {
@@ -4601,7 +4637,7 @@ export default {
       this.$forceUpdate();
     },
     handleProductOver_priceChange(e, product) {
-      product.over_price = e.target.value;
+      product.over_price = e.target.value * 1;
       product.price =
         (product.unit_price * 1 || 0) * (product.num * 1 || 1) +
         (product.over_price * 1 || 0) +
@@ -4679,76 +4715,79 @@ export default {
     },
     handleProductMeasureBlur(e, product, measure_detail) {
       this.handleProductMeasureChange(e, product, measure_detail);
-      try {
-        measure_detail.value = eval(e.target.value);
-      } catch (error) {
-        console.log("error :>> ", error);
-      }
-      product.part.map((part) => {
-        part.part_detail &&
-          part.part_detail.length > 0 &&
-          part.part_detail.map((part_detail) => {
-            part_detail._longCalc = this.handleCalcPartDetailLong(
-              part_detail,
-              product
-            );
-            if (part_detail.material_detail_list.length > 1) {
-              try {
-                part_detail.longCalcFinal = eval(part_detail._longCalc);
-                part_detail.material_detail_id = this.handleFindNearest(
-                  part_detail.material_detail_list,
-                  part_detail.longCalcFinal
-                );
-              } catch (error) {
-                console.log("error :>> ", error);
+      if (e.target.value) {
+        try {
+          measure_detail.value = eval(e.target.value);
+        } catch (error) {
+          console.log("error :>> ", error);
+        }
+        let line = [];
+        product.part.map((part) => {
+          part.part_title.indexOf("线条") != -1 && (line = part.change);
+          part.part_detail &&
+            part.part_detail.length > 0 &&
+            part.part_detail.map((part_detail) => {
+              part_detail._longCalc = this.handleCalcPartDetailLong(
+                part_detail,
+                product
+              );
+              if (part_detail.material_detail_list.length > 1) {
+                try {
+                  part_detail.longCalcFinal = eval(part_detail._longCalc);
+                  part_detail.material_detail_id = this.handleFindNearest(
+                    part_detail.material_detail_list,
+                    part_detail.longCalcFinal
+                  );
+                } catch (error) {
+                  console.log("error :>> ", error);
+                }
               }
-            }
-          });
-      });
-      const process_ids = product.process_obj.map((v) => {
-        return v.value;
-      });
-      this.axios
-        .post("/api/process_part_for_product", {
-          product_id: product.product_id,
-          process_ids,
-        })
-        .then((res) => {
-          for (const key in res.data) {
-            const element = res.data[key];
-            // 找到部件
-            const part_arr = product.part.filter((v) => v.part_id == key);
-            if (part_arr.length > 0) {
+            });
+        });
+        const process_ids = product.process_obj.map((v) => {
+          return v.value;
+        });
+        const part_ids = line.map((v) => {
+          return v.part_id;
+        });
+        this.axios
+          .post("/api/process_part_for_product", {
+            product_id: product.product_id,
+            process_ids,
+            part_ids,
+          })
+          .then((res) => {
+            for (const key in res.data) {
+              const element = res.data[key];
+              // 找到部件
+              let part_arr = {};
+              product.part.map((v) => {
+                if (v.part_id == key) {
+                  part_arr = v;
+                }
+              });
               for (const k in element) {
                 const elem = element[k];
                 // 找到零部件
-                const part_detail_arr = part_arr[part_arr.length - 1].filter(
-                  (v) => v.part_detail_id == k
-                );
                 elem.map((match_item) => {
-                  const matched_part_detail = part_detail_arr[
-                    part_detail_arr.length - 1
-                  ].material_detail_list.filter(
-                    (v) => v.material_detail_id == match_item.material_detail_id
-                  );
                   if (
                     match_item.max > product[match_item.e_title] &&
                     match_item.min <= product[match_item.e_title]
                   ) {
-                    part_detail_arr[
-                      part_detail_arr.length - 1
-                    ].material_detail_id =
-                      matched_part_detail[
-                        matched_part_detail.length - 1
-                      ].material_detail_id;
+                    part_arr.part_detail.map((v) => {
+                      if (v.part_detail_id == k) {
+                        v.material_detail_id = match_item.material_detail_id;
+                        v.material_detail_org_num = match_item.num;
+                        v.material_detail_num = match_item.num;
+                      }
+                    });
                   }
                 });
               }
             }
-          }
-          console.log(res);
-        });
-      this.$forceUpdate();
+            this.$forceUpdate();
+          });
+      }
     },
     handleProductMeasureChange(e, product, measure_detail) {
       if (e.target.value) {
@@ -4899,6 +4938,7 @@ 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 &&
@@ -4911,6 +4951,7 @@ 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 &&
@@ -4923,9 +4964,11 @@ 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);
               }
             });
         });
+        product.over_price = product.over_price.toFixed(2);
         //修改核算数量
         // 如果没有核算数量公式,核算数量取产品数量
         if (product.num_formula == "") {

+ 82 - 118
src/views/ProductionOrderList/ProductionsOrder/Decorationlist.vue

@@ -351,7 +351,9 @@
           </div>
         </div>
         <div slot="footer">
-          <Button @click="show_add_detail = false" type="primary" ghost>取消</Button>
+          <Button @click="show_add_detail = false" type="primary" ghost
+            >取消</Button
+          >
           <Button @click="saveTableData()" type="primary">确定</Button>
         </div>
       </Modal>
@@ -1344,120 +1346,82 @@ export default {
       });
     },
     handlePrintChips(contents) {
-      let data = {};
-      // let url = "http://192.168.1.112:888/postek/print";
-      let url = "http://192.168.186.100:888/postek/print";
-      data.reqParam = "1";
-      let printparamsJsonArray = [];
-      // let IP = "192.168.1.58";
-      let IP = "192.168.186.199";
-      let port = 9100;
-      let IP_Port = IP + "," + port;
-      printparamsJsonArray.push({ PTK_Connect_Timer: IP_Port + ",1" });
-      printparamsJsonArray.push({ PTK_ClearBuffer: "" });
-      printparamsJsonArray.push({ PTK_SetDirection: "B" });
-      printparamsJsonArray.push({ PTK_SetPrintSpeed: "4" });
-      printparamsJsonArray.push({ PTK_SetDarkness: "10" });
-      printparamsJsonArray.push({
-        PTK_SetLabelHeight: 236 + "," + 24 + ",0,false",
-      });
-      printparamsJsonArray.push({ PTK_SetLabelWidth: 873 });
-      contents.map((content) => {
-        // const printContent_l1 = `单号:${content.order_no}        型号:${content.product_title} `;
-        // printparamsJsonArray.push({
-        //   PTK_DrawText_TrueType:
-        //     "100,20,45,0,微软雅黑,1,700,0,0,0," + printContent_l1,
-        // });
-        // const printContent_l2 = `尺寸:${content.measure}  颜色:${content.color_title} `;
-        // printparamsJsonArray.push({
-        //   PTK_DrawText_TrueType:
-        //     "100,100,45,0,微软雅黑,1,700,0,0,0," + printContent_l2,
-        // });
-        // const printContent_l3 = `工艺:${content.process_title}    部件:${content.part_title}`;
-        // printparamsJsonArray.push({
-        //   PTK_DrawText_TrueType:
-        //     "100,180,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
-        // });
-        const printContent_l1 = `项目:${content.client_name}`;
-        printparamsJsonArray.push({
-          PTK_DrawText_TrueType:
-            "100,40,45,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,
-        });
-        const printContent_l2 = `房号:${content.number_detail}`;
-        printparamsJsonArray.push({
-          PTK_DrawText_TrueType:
-            "100,90,45,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,
-        });
-        const printContent_l3 = `图号:${content.url_number}`;
+      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
+        data.reqParam = "1";
+        let printparamsJsonArray = [];
+        // let IP = "192.168.1.58";//print_url
+        // let IP = "192.168.186.199";//print_url
+        let IP = res.data.print_url;
+        let port = 9100;
+        let IP_Port = IP + "," + port;
+        printparamsJsonArray.push({ PTK_Connect_Timer: IP_Port + ",1" });
+        printparamsJsonArray.push({ PTK_ClearBuffer: "" });
+        printparamsJsonArray.push({ PTK_SetDirection: "B" });
+        printparamsJsonArray.push({ PTK_SetPrintSpeed: "4" });
+        printparamsJsonArray.push({ PTK_SetDarkness: "10" });
         printparamsJsonArray.push({
-          PTK_DrawText_TrueType:
-            "100,140,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
-        });
-        const printContent_l3_2 = `木皮:${content.color_title}`;
-        printparamsJsonArray.push({
-          PTK_DrawText_TrueType:
-            "420,140,45,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
+          PTK_SetLabelHeight: 236 + "," + 24 + ",0,false",
         });
+        printparamsJsonArray.push({ PTK_SetLabelWidth: 873 });
+        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,
+          });
+          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,
+          });
+          const printContent_l2 = `房号:${content.number_detail}`;
+          printparamsJsonArray.push({
+            PTK_DrawText_TrueType:
+              "100,90,45,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,
+          });
+          const printContent_l3 = `图号:${content.url_number}`;
+          printparamsJsonArray.push({
+            PTK_DrawText_TrueType:
+              "100,140,45,0,微软雅黑,1,700,0,0,0," + printContent_l3,
+          });
+          const printContent_l3_2 = `木皮:${content.color_title}`;
+          printparamsJsonArray.push({
+            PTK_DrawText_TrueType:
+              "420,140,45,0,微软雅黑,1,700,0,0,0," + printContent_l3_2,
+          });
 
-        const printContent_l4 = `部件:${content.part_title}`;
-        printparamsJsonArray.push({
-          PTK_DrawText_TrueType:
-            "100,190,45,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,
-        });
-        printparamsJsonArray.push({
-          PTK_RWRFIDLabel:
-            "1,0,0," + content.chip.length / 2 + ",1," + content.chip,
+          const printContent_l4 = `部件:${content.part_title}`;
+          printparamsJsonArray.push({
+            PTK_DrawText_TrueType:
+              "100,190,45,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,
+          });
+          printparamsJsonArray.push({
+            PTK_RWRFIDLabel:
+              "1,0,0," + content.chip.length / 2 + ",1," + content.chip,
+          });
+          printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
         });
-        printparamsJsonArray.push({ PTK_PrintLabel: "1,1" });
+        printparamsJsonArray.push({ PTK_CloseConnect: "" });
+        data.printparams = printparamsJsonArray;
+        // data.printparams = JSON.stringify(printparamsJsonArray);
+        this.test_content = JSON.stringify(data);
+        this.test_url = url;
+        this.test_modal = true;
       });
-      printparamsJsonArray.push({ PTK_CloseConnect: "" });
-      data.printparams = printparamsJsonArray;
-      // data.printparams = JSON.stringify(printparamsJsonArray);
-      this.test_content = JSON.stringify(data);
-      this.test_url = url;
-      this.test_modal = true;
-      // $.ajax({
-      //   type: "post",
-      //   url,
-      //   data,
-      //   dataType: "json",
-      //   timeout: 5000,
-      //   success: function(result) {
-      //     if (result.retval == "0") {
-      //       this.$Message.success("发送成功");
-      //     } else {
-      //       this.$Message.error("发送失败,返回结果:" + result.msg);
-      //     }
-      //   },
-      // });
-      // axios
-      //   .post(url, data)
-      //   .then((result) => {
-      //     console.log(result);
-      //     if (result.retval == "0") {
-      //       this.$Message.success("发送成功");
-      //     } else {
-      //       this.$Message.error("发送失败,返回结果:" + result.msg);
-      //     }
-      //   })
-      //   .catch((err) => {
-      //     this.$Message.error("请求失败,请重试" + err.msg);
-      //   });
     },
     handleConnectPrinter() {
       let data = {};
@@ -1727,18 +1691,18 @@ export default {
 }
 .modal_process_route {
   div {
-  display: flex;
-  justify-content: space-around;
-  align-items: center;
-  margin: 5px 0;
+    display: flex;
+    justify-content: space-around;
+    align-items: center;
+    margin: 5px 0;
   }
 }
 .modal_process_route-process {
   div {
-  display: flex;
-  justify-content: space-around;
-  align-items: center;
-  margin: 5px 0;
+    display: flex;
+    justify-content: space-around;
+    align-items: center;
+    margin: 5px 0;
   }
 }
 .tag-modal {

+ 193 - 17
src/views/leadMatch/MatchList/matchCheck.vue

@@ -1,13 +1,24 @@
 <template>
   <div>
     <Toptitle title="查看">
-      <Button @click="back" type="primary" style="margin-right: 10px"
+      <Button
+        @click="handleGoProduction"
+        type="primary"
+        style="margin-right: 10px"
         >下生产</Button
       >
       <Button @click="back" type="primary" ghost style="margin-right: 10px"
         >返回</Button
       >
     </Toptitle>
+    <Row style="padding: 10px;font-size: 18px;">
+      <Col span="6">
+        <span>项目编号:</span><span>{{ project_number }}</span>
+      </Col>
+      <Col span="6">
+        <span>项目名称:</span><span>{{ project_name }}</span>
+      </Col>
+    </Row>
     <div class="context-tabs">
       <Row type="flex" align="middle" style="padding:10px 0">
         <Col span="4">
@@ -55,7 +66,7 @@
           </span>
         </Col>
         <Col span="2">
-          <Button @click="back" size="small" type="primary">
+          <Button @click="initData" size="small" type="primary">
             搜索
           </Button>
         </Col>
@@ -67,15 +78,31 @@
       >
         <Row>
           <Col span="2">
-            <Checkbox v-model="matched_info.isSelect">全选</Checkbox>
-          </Col>
-          <Col span="2">
             <span>图号:{{ matched_info.image_number }}</span>
           </Col>
-          <Col span="2">
+          <Col span="6">
             <span>产品名称:{{ matched_info.product_name }}</span>
           </Col>
-          <Col span="2" offset="14">
+          <Col span="2">
+            <span>{{
+              matched_info.matching_status == 0
+                ? "未匹配"
+                : matched_info.matching_status == 1
+                ? "匹配中"
+                : "匹配完成"
+            }}</span>
+          </Col>
+          <Col span="2" offset="8">
+            <span>
+              <Button
+                @click="handleGoProduction(matched_info)"
+                type="primary"
+                size="small"
+                >下生产</Button
+              >
+            </span>
+          </Col>
+          <Col span="2">
             总计
             <span style="color:red">{{ matched_info.num }}</span>
             条数据
@@ -179,17 +206,19 @@
             <Row type="flex" align="middle">
               <Col span="10" style="padding:10px 0">
                 <span>匹配信息:</span>
-                <span>匹配信息:</span>
-                <span>匹配信息:</span>
-                <span>匹配信息:</span>
-                <span>匹配信息:</span>
+                <span
+                  v-for="(matched_info, index) in matched_detail.special"
+                  :key="index"
+                >
+                  {{ matched_info.key }}:{{ matched_info.value }}
+                </span>
+                <span>{{ matched_detail.num }}组</span>
               </Col>
             </Row>
             <Table
               :columns="matchedSheetTableColumns"
               border
               :max-height="500"
-              @on-selection-change="handleSelectChange"
               :data="matched_detail.detail"
             >
             </Table>
@@ -197,6 +226,53 @@
         </div>
       </div>
     </div>
+    <Modal v-model="processModal" title="下生产">
+      <div>
+        <div class="process_modal">
+          <span>生产人员:</span>
+          <Select v-model="process_man" style="width: 150px">
+            <Option
+              v-for="item in processManList"
+              :key="item.id"
+              :label="item.nickname"
+              :value="item.id"
+            ></Option>
+          </Select>
+        </div>
+        <div class="process_modal">
+          <span>选择时间:</span>
+          <DatePicker
+            type="date"
+            v-model="process_start_time"
+            placeholder="年/月/日"
+            style="width: 150px"
+          ></DatePicker>
+          至
+          <DatePicker
+            type="date"
+            v-model="process_end_time"
+            placeholder="年/月/日"
+            style="width: 150px"
+          ></DatePicker>
+        </div>
+      </div>
+      <div slot="footer">
+        <Button
+          @click="processModal = false"
+          type="primary"
+          ghost
+          style="margin-right: 10px"
+          >取消</Button
+        >
+        <Button
+          @click="handleProcess"
+          type="primary"
+          style="margin-right: 10px"
+          :disabled="process_control"
+          >确定</Button
+        >
+      </div>
+    </Modal>
   </div>
 </template>
 
@@ -212,7 +288,10 @@ export default {
   data() {
     // 这里存放数据
     return {
+      project_number: this.$route.query.project_number,
+      project_name: this.$route.query.project_name,
       matchedInfo: {
+        id: this.$route.query.id,
         image_number: "",
         product_name: "",
         region: [],
@@ -224,9 +303,9 @@ export default {
       regionMatchedList: [],
       numberMatchedList: [],
       partNameMatchedList: [],
+      matchedDetailList: [],
       matchedList: [],
       matchedSheetTableColumns: [
-        { 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: "number", minWidth: 60 },
@@ -260,18 +339,109 @@ export default {
         { title: "精裁面积", align: "center", key: "cut", minWidth: 80 },
         { title: "工艺要求", align: "center", key: "remark", minWidth: 80 },
       ], //匹配表头
+      processModal: false,
+      process_man: "",
+      processManList: [],
+      process_start_time: "",
+      process_end_time: "",
+      process_control: false,
+      cut_order_product_ids: [],
     };
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
-  created() {},
+  created() {
+    this.axios("/api/user").then(
+      (res) => (this.processManList = res.data.data)
+    );
+  },
   // 生命周期 - 挂载完成(可以访问DOM元素)
-  mounted() {},
+  mounted() {
+    this.initData();
+  },
   methods: {
     back() {
       this.$router.go(-1);
     },
-    handleShowCurrencyMatched() {},
-    handleSelectChange(selection) {},
+    handleGoProduction(row) {
+      if (row) {
+        this.cut_order_product_ids = [row.id];
+      } else {
+        this.cut_order_product_ids = this.matchedList.map((v) => {
+          return v.id;
+        });
+      }
+      this.processModal = true;
+    },
+    handleProcess() {
+      this.process_control = true;
+      this.axios({
+        method: "post",
+        url: "/api/bst_pull",
+        data: {
+          cut_order_product_ids: this.cut_order_product_ids,
+          process_man: this.process_man,
+          process_start_time: this.func.replaceDateNoHMS(
+            this.process_start_time
+          ),
+          process_end_time: this.func.replaceDateNoHMS(this.process_end_time),
+        },
+      }).then((res) => {
+        if (res.code == 200) {
+          this.$Message.success(res.msg);
+          this.processModal = false;
+        }
+        setTimeout(() => {
+          this.process_control = false;
+        }, 500);
+      });
+    },
+    initData() {
+      this.axios
+        .get("/api/bst_matching_on_list", {
+          params: {
+            id: this.matchedInfo.id,
+            image_number: this.matchedInfo.image_number,
+            product_name: this.matchedInfo.product_name,
+          },
+        })
+        .then((res) => {
+          console.log(res);
+          res.data.list.map((v) => {
+            v.isCurrenct = false;
+          });
+          this.urlMatchedList = res.data.image_number;
+          this.productMatchedList = res.data.product_name;
+          this.matchedList = res.data.list;
+        });
+    },
+    handleShowCurrencyMatched(row) {
+      if (row.isCurrenct) {
+        row.isCurrenct = !row.isCurrenct;
+      } else {
+        this.matchedList.map((v) => (v.isCurrenct = false));
+        row.isCurrenct = true;
+      }
+      this.getMatchedDetailList(row);
+    },
+    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,
+            },
+          })
+          .then((res) => {
+            this.regionMatchedList = res.data.region;
+            this.numberMatchedList = res.data.number;
+            this.partNameMatchedList = res.data.part_name;
+            this.matchedDetailList = res.data.list;
+          });
+    },
   },
   // 监听属性 类似于data概念
   computed: {},
@@ -305,4 +475,10 @@ export default {
   background-color: #e9ecef;
   border-radius: 5px;
 }
+.process_modal {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  padding: 10px;
+}
 </style>

+ 2 - 2
src/views/leadMatch/MatchList/matchList.vue

@@ -185,7 +185,7 @@ export default {
             query: {
               type,
               id: row.id,
-              project_no: row.project_no,
+              project_number: row.project_number,
               project_name: row.project_name,
             },
           });
@@ -196,7 +196,7 @@ export default {
             query: {
               type,
               id: row.id,
-              project_no: row.project_no,
+              project_number: row.project_number,
               project_name: row.project_name,
             },
           });

+ 66 - 26
src/views/leadMatch/MatchList/matchPage.vue

@@ -8,9 +8,9 @@
         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
       >
@@ -18,10 +18,10 @@
     <div class="top-info">
       <Row align="middle">
         <Col span="4">
-          <span>项目编号:</span><span>{{ info.project_no }}</span>
+          <span>项目编号:</span><span>{{ info.project_number }}</span>
         </Col>
         <Col span="4"
-          ><span>项目名称:</span><span>{{ info.project_title }}</span>
+          ><span>项目名称:</span><span>{{ info.project_name }}</span>
         </Col>
         <Col span="6" v-if="currencyTag == 1">
           <span>图号:</span>
@@ -74,7 +74,7 @@
     </div>
     <div class="context-tabs">
       <Tabs type="card" @on-click="handleTabsClick" v-model="currencyTag">
-        <Button
+        <!-- <Button
           @click="back"
           type="primary"
           size="small"
@@ -82,7 +82,7 @@
           v-show="currencyTag == 1"
         >
           匹配
-        </Button>
+        </Button> -->
         <TabPane label="本次未匹配" name="1">
           <Row>
             <Col
@@ -229,9 +229,10 @@
                               >
                                 {{ match_info.key }}:{{ match_info.value }}
                               </span>
+                              <span>{{ table_info.key.num }}组</span>
                             </Col>
                             <Col span="3" offset="11">
-                              总计{{ table_info.key.num }}条数据
+                              总计{{ table_info.part_list.length }}条数据
                             </Col>
                           </Row>
                         </div>
@@ -452,15 +453,19 @@
           >
             <Row>
               <Col span="2">
-                <Checkbox v-model="matched_info.isSelect">全选</Checkbox>
+                <Checkbox
+                  v-model="matched_info.isSelect"
+                  @on-change="handleMatchedSelectAll"
+                  >全选</Checkbox
+                >
               </Col>
               <Col span="2">
                 <span>图号:{{ matched_info.image_number }}</span>
               </Col>
-              <Col span="2">
+              <Col span="6">
                 <span>产品名称:{{ matched_info.product_name }}</span>
               </Col>
-              <Col span="2" offset="14">
+              <Col span="2" offset="10">
                 总计
                 <span style="color:red">{{ matched_info.num }}</span>
                 条数据
@@ -564,17 +569,21 @@
                 <Row type="flex" align="middle">
                   <Col span="10" style="padding:10px 0">
                     <span>匹配信息:</span>
-                    <span>匹配信息:</span>
-                    <span>匹配信息:</span>
-                    <span>匹配信息:</span>
-                    <span>匹配信息:</span>
+                    <span
+                      v-for="(matched_info, index) in matched_detail.special"
+                      :key="index"
+                    >
+                      {{ matched_info.key }}:{{ matched_info.value }}
+                    </span>
+                    <span>{{ matched_detail.num }}组</span>
                   </Col>
                 </Row>
                 <Table
                   :columns="matchedSheetTableColumns"
                   border
+                  :ref="'matched' + index"
                   :max-height="500"
-                  @on-selection-change="handleSelectChange"
+                  @on-selection-change="handleMatchedSelectChange"
                   :data="matched_detail.detail"
                 >
                   <template slot="setSlot" slot-scope="{ row, index }">
@@ -605,8 +614,8 @@ export default {
       currencyTag: "1", //当前分页
       info: {
         id: this.$route.query.id,
-        project_no: this.$route.query.project_no,
-        project_title: this.$route.query.project_title,
+        project_number: this.$route.query.project_number,
+        project_name: this.$route.query.project_name,
         cut_size: "",
         number: "",
         part_name: "",
@@ -616,6 +625,7 @@ export default {
         product_name: [],
       },
       matchedInfo: {
+        id: this.$route.query.id,
         image_number: [],
         product_name: [],
       },
@@ -710,14 +720,14 @@ export default {
         { title: "全选", align: "center", minWidth: 60, type: "selection" },
         { title: "序号", align: "center", type: "index", minWidth: 60 },
         { title: "区域", align: "center", key: "region", minWidth: 60 },
-        { title: "房号", align: "center", key: "number", minWidth: 60 },
+        { title: "房号", align: "center", key: "house_number", minWidth: 60 },
       ], //未匹配房间表头
       unmatchedRoomTableColumnsUsed: [],
       matchedSheetTableColumns: [
         { 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: "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: "木皮1", align: "center", key: "skin1", minWidth: 60 },
@@ -756,12 +766,15 @@ export default {
         },
       ], //匹配表头
       unmatchedSelectedList: [],
+      matchedSelectedList: [],
     };
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
   created() {},
   // 生命周期 - 挂载完成(可以访问DOM元素)
-  mounted() {},
+  mounted() {
+    this.handleSearchUnmatchedInfo();
+  },
   methods: {
     back() {
       this.$router.go(-1);
@@ -772,9 +785,14 @@ export default {
           return v.product_title;
         })
       );
-      //  = Array.from(
-      //         new Set([...res.data.support_remark, ...this.support_remark])
-      //       );
+    },
+    handleMatchedSelectChange(selection) {
+      this.matchedSelectedList = this.matchedSelectedList.concat(
+        selection.map((v) => {
+          return v.cut_order_product_id;
+        })
+      );
+      console.log("this.matchedSelectedList :>> ", this.matchedSelectedList);
     },
     handleTabsClick(name) {
       name == 2 &&
@@ -793,7 +811,6 @@ export default {
           });
     },
     handleShowCurrencySheet(row) {
-      console.log("row :>> ", row);
       if (row.isCurrenct) {
         row.isCurrenct = !row.isCurrenct;
       } else {
@@ -803,7 +820,6 @@ export default {
       this.getSheetDetailList(row);
     },
     handleShowCurrencyMatched(row) {
-      console.log("row :>> ", row);
       if (row.isCurrenct) {
         row.isCurrenct = !row.isCurrenct;
       } else {
@@ -893,7 +909,31 @@ export default {
           }
         });
     },
-    handleMatchedSet(row, index, type) {},
+    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]);
+      }
+    },
+    handleMatchedSet(row, index, type) {
+      switch (type) {
+        case 5:
+          this.axios
+            .get("/api/bst_cancer_matching", {
+              params: {
+                cut_order_product_id: row.cut_order_product_id,
+              },
+            })
+            .then((res) => {
+              if (res.code == 200) {
+                this.$Message.success(res.msg);
+                console.log(res);
+              }
+            });
+          break;
+      }
+    },
   },
   // 监听属性 类似于data概念
   computed: {},

+ 1 - 1
vue.config.js

@@ -2,7 +2,7 @@ const axios_default_ip =
     process.env.NODE_ENV == 'dev' ?
     'http://121.41.102.225:82' :
     process.env.NODE_ENV == 'test-prd' ?
-    'http://121.41.102.225:82' //测试服
+    'http://124.71.176.88:882' //测试服
     :
     process.env.NODE_ENV == 'prd_other' ?
     'http://121.37.173.82:82' //贝斯特