Andy 3 gadi atpakaļ
vecāks
revīzija
0aa083e396

+ 106 - 105
src/views/OrderMannage/BusinessOrderlist/edit.vue

@@ -2996,98 +2996,116 @@ export default {
       this.tableData.forEach((element) => {
         sum += element.price * 1;
         if (!element.is_metal) {
-          element.part&&
-          element.part.forEach((elem) => {
-            if (!elem.is_metal) {
-              // 统计部件
-              const temp = this.parts_title_count.filter(
-                (item) => item.title == elem.title
-              );
-              if (temp && temp.length > 0) {
-                this.parts_title_count.map((v) => {
-                  v.title == elem.title && v.num++;
-                });
-              } else {
-                this.parts_title_count.push({
-                  change_id: elem.change_id,
-                  title: elem.title,
-                  num: elem.num || 1,
-                  unit: elem.unit,
-                });
-              }
-              // 如果没有点开产品详情的话找不到 part_detail
-              if (!elem.part_detail) {
-                elem.part_detail = elem.sub_part;
-              }
-              // 部件中要统计所有线条数量
-              elem.part_detail &&
-                elem.part_detail.length > 0 &&
-                elem.part_detail.forEach((el) => {
-                  if (el.material_detail_title.indexOf("线条") != -1) {
-                    const temp = this.wood_title_count.filter(
-                      (item) => item.title == el.material_detail_title
-                    );
-                    if (temp && temp.length > 0) {
-                      // 匹配规格是否已存在
-                      const _temp = temp[0].measure_str.filter(
-                        (item) => item.id == el.material_detail_id
+          element.part &&
+            element.part.forEach((elem) => {
+              if (!elem.is_metal) {
+                // 统计部件
+                const temp = this.parts_title_count.filter(
+                  (item) => item.title == elem.title
+                );
+                if (temp && temp.length > 0) {
+                  this.parts_title_count.map((v) => {
+                    v.title == elem.title && v.num++;
+                  });
+                } else {
+                  this.parts_title_count.push({
+                    change_id: elem.change_id,
+                    title: elem.title,
+                    num: elem.num || 1,
+                    unit: elem.unit,
+                  });
+                }
+                // 如果没有点开产品详情的话找不到 part_detail
+                if (!elem.part_detail) {
+                  elem.part_detail = elem.sub_part;
+                }
+                // 部件中要统计所有线条数量
+                elem.part_detail &&
+                  elem.part_detail.length > 0 &&
+                  elem.part_detail.forEach((el) => {
+                    if (el.material_detail_title.indexOf("线条") != -1) {
+                      const temp = this.wood_title_count.filter(
+                        (item) => item.title == el.material_detail_title
                       );
-                      if (_temp && _temp.length > 0) {
-                        this.wood_title_count.map((v) => {
-                          v.title == el.material_detail_title &&
-                            v.measure_str.map((item) => {
-                              if (item.id == el.material_detail_id) {
-                                item.num =
-                                  item.num * 1 + el.material_detail_num * 1;
-                              }
+                      if (temp && temp.length > 0) {
+                        // 匹配规格是否已存在
+                        const _temp = temp[0].measure_str.filter(
+                          (item) => item.id == el.material_detail_id
+                        );
+                        if (_temp && _temp.length > 0) {
+                          this.wood_title_count.map((v) => {
+                            v.title == el.material_detail_title &&
+                              v.measure_str.map((item) => {
+                                if (item.id == el.material_detail_id) {
+                                  item.num =
+                                    item.num * 1 + el.material_detail_num * 1;
+                                }
+                              });
+                          });
+                        } else {
+                          // 不存在一样规格
+                          if (
+                            el.material_detail_list &&
+                            el.material_detail_list.length > 0
+                          ) {
+                            const __temp = el.material_detail_list.filter(
+                              (item) =>
+                                item.material_detail_id == el.material_detail_id
+                            );
+                            this.wood_title_count.map((v) => {
+                              v.title == el.material_detail_title &&
+                                ((v.unit = __temp[0].unit),
+                                v.measure_str.push({
+                                  num: el.material_detail_num,
+                                  id: __temp[0].material_detail_id,
+                                  measure: `${__temp[0].long || 0}*${__temp[0]
+                                    .wide || 0}*${__temp[0].high || 0}`,
+                                }));
                             });
-                        });
+                          } else {
+                            this.wood_title_count.map((v) => {
+                              v.title == el.material_detail_title &&
+                                ((v.unit = el.unit),
+                                v.measure_str.push({
+                                  num: el.material_detail_num,
+                                  id: el.material_detail_id,
+                                  measure: `${el.long || 0}*${el.wide ||
+                                    0}*${el.high || 0}`,
+                                }));
+                            });
+                          }
+                        }
                       } else {
-                        // 不存在一样规格
+                        // 不存在就新增
                         if (
                           el.material_detail_list &&
                           el.material_detail_list.length > 0
                         ) {
-                          const __temp = el.material_detail_list.filter(
+                          const _temp = el.material_detail_list.filter(
                             (item) =>
                               item.material_detail_id == el.material_detail_id
                           );
-                          this.wood_title_count.map((v) => {
-                            v.title == el.material_detail_title &&
-                              ((v.unit = __temp[0].unit),
-                              v.measure_str.push({
-                                num: el.material_detail_num,
-                                id: __temp[0].material_detail_id,
-                                measure: `${__temp[0].long || 0}*${__temp[0]
-                                  .wide || 0}*${__temp[0].high || 0}`,
-                              }));
-                          });
+                          if (_temp && _temp.length > 0) {
+                            if (!total_line_unit) {
+                              total_line_unit = _temp[0].unit;
+                            }
+                            this.wood_title_count.push({
+                              title: el.material_detail_title,
+                              unit: total_line_unit,
+                              measure_str: [
+                                {
+                                  num: el.material_detail_num,
+                                  id: _temp[0].material_detail_id,
+                                  measure: `${_temp[0].long || 0}*${_temp[0]
+                                    .wide || 0}*${_temp[0].high || 0}`,
+                                  unit: _temp[0].unit,
+                                },
+                              ],
+                            });
+                          }
                         } else {
-                          this.wood_title_count.map((v) => {
-                            v.title == el.material_detail_title &&
-                              ((v.unit = el.unit),
-                              v.measure_str.push({
-                                num: el.material_detail_num,
-                                id: el.material_detail_id,
-                                measure: `${el.long || 0}*${el.wide ||
-                                  0}*${el.high || 0}`,
-                              }));
-                          });
-                        }
-                      }
-                    } else {
-                      // 不存在就新增
-                      if (
-                        el.material_detail_list &&
-                        el.material_detail_list.length > 0
-                      ) {
-                        const _temp = el.material_detail_list.filter(
-                          (item) =>
-                            item.material_detail_id == el.material_detail_id
-                        );
-                        if (_temp && _temp.length > 0) {
                           if (!total_line_unit) {
-                            total_line_unit = _temp[0].unit;
+                            total_line_unit = el.unit;
                           }
                           this.wood_title_count.push({
                             title: el.material_detail_title,
@@ -3095,37 +3113,19 @@ export default {
                             measure_str: [
                               {
                                 num: el.material_detail_num,
-                                id: _temp[0].material_detail_id,
-                                measure: `${_temp[0].long || 0}*${_temp[0]
-                                  .wide || 0}*${_temp[0].high || 0}`,
-                                unit: _temp[0].unit,
+                                id: el.material_detail_id,
+                                measure: `${el.long || 0}*${el.wide ||
+                                  0}*${el.high || 0}`,
+                                unit: el.unit,
                               },
                             ],
                           });
                         }
-                      } else {
-                        if (!total_line_unit) {
-                          total_line_unit = el.unit;
-                        }
-                        this.wood_title_count.push({
-                          title: el.material_detail_title,
-                          unit: total_line_unit,
-                          measure_str: [
-                            {
-                              num: el.material_detail_num,
-                              id: el.material_detail_id,
-                              measure: `${el.long || 0}*${el.wide ||
-                                0}*${el.high || 0}`,
-                              unit: el.unit,
-                            },
-                          ],
-                        });
                       }
                     }
-                  }
-                });
-            }
-          });
+                  });
+              }
+            });
         }
       });
       // 数线条
@@ -4014,6 +4014,7 @@ export default {
     changeEditProcess(row, obj) {
       row.isEdit = true;
       row.procedure_properties[obj.id] = row[obj.id];
+      this.pre_process_obj[obj.id] = row[obj.id];
       row.process_obj.filter((v) => v.id == obj.id)[0].value = row[obj.id];
       row.part.map((item) => {
         if (!item.is_metal) {

+ 37 - 16
src/views/leadMatch/MatchList/matchPage.vue

@@ -8,7 +8,11 @@
         style="margin-right: 10px"
         >自动匹配</Button
       >
-      <Button @click="back" v-else type="primary" style="margin-right: 10px"
+      <Button
+        @click="handleMatchedSet({}, 0, 5)"
+        v-else
+        type="primary"
+        style="margin-right: 10px"
         >撤销匹配</Button
       >
       <Button @click="back" type="primary" ghost style="margin-right: 10px"
@@ -29,6 +33,7 @@
             <Select
               filterable
               multiple
+              clearable
               transfer
               filter-by-label
               v-model="info.image_number"
@@ -50,6 +55,7 @@
             <Select
               filterable
               multiple
+              clearable
               transfer
               filter-by-label
               v-model="info.product_name"
@@ -151,12 +157,13 @@
                               filterable
                               filter-by-label
                               transfer
+                              clearable
                               v-model="info.wool_size"
                               size="small"
                               style="width: 120px"
                             >
                               <Option
-                                v-for="(item, index) in wool_size"
+                                v-for="(item, index) in wool_size1"
                                 :key="index"
                                 :label="item"
                                 :value="item"
@@ -171,6 +178,7 @@
                               filterable
                               multiple
                               filter-by-label
+                              clearable
                               transfer
                               v-model="info.part_name"
                               :max-tag-count="2"
@@ -192,6 +200,7 @@
                             <Select
                               filterable
                               filter-by-label
+                              clearable
                               transfer
                               v-model="info.cut_size"
                               size="small"
@@ -234,7 +243,7 @@
                                   .list"
                                 :key="index"
                               >
-                                {{ match_info.key }}:{{ match_info.value }}
+                                {{ match_info.key }}={{ match_info.value }}
                               </span>
                               <span>{{ table_info.key.num }}组</span>
                             </Col>
@@ -333,6 +342,7 @@
                               filterable
                               multiple
                               filter-by-label
+                              clearable
                               transfer
                               v-model="info.region"
                               :max-tag-count="2"
@@ -355,6 +365,7 @@
                               filterable
                               multiple
                               filter-by-label
+                              clearable
                               transfer
                               v-model="info.number"
                               :max-tag-count="2"
@@ -376,13 +387,14 @@
                             <Select
                               filterable
                               filter-by-label
+                              clearable
                               transfer
                               v-model="info.wool_size"
                               size="small"
                               style="width: 120px"
                             >
                               <Option
-                                v-for="(item, index) in wool_size"
+                                v-for="(item, index) in wool_size2"
                                 :key="index"
                                 :label="item"
                                 :value="item"
@@ -428,6 +440,7 @@
                 <Select
                   filterable
                   multiple
+                  clearable
                   filter-by-label
                   transfer
                   v-model="matchedInfo.image_number"
@@ -451,6 +464,7 @@
                   filterable
                   multiple
                   filter-by-label
+                  clearable
                   transfer
                   v-model="matchedInfo.product_name"
                   :max-tag-count="2"
@@ -485,7 +499,7 @@
               <Col span="2">
                 <Checkbox
                   v-model="matched_info.isSelect"
-                  @on-change="handleMatchedSelectAll"
+                  @on-change="(e) => handleMatchedSelectAll(matched_info, e)"
                   >选择</Checkbox
                 >
               </Col>
@@ -535,6 +549,7 @@
                     filterable
                     multiple
                     transfer
+                    clearable
                     filter-by-label
                     v-model="matchedInfo.region"
                     :max-tag-count="2"
@@ -557,6 +572,7 @@
                     filterable
                     multiple
                     transfer
+                    clearable
                     filter-by-label
                     v-model="matchedInfo.number"
                     :max-tag-count="2"
@@ -579,6 +595,7 @@
                     filterable
                     multiple
                     transfer
+                    clearable
                     filter-by-label
                     v-model="matchedInfo.part_name"
                     :max-tag-count="2"
@@ -616,7 +633,7 @@
                       v-for="(matched_info, index) in matched_detail.special"
                       :key="index"
                     >
-                      {{ matched_info.key }}:{{ matched_info.value }}
+                      {{ matched_info.key }}={{ matched_info.value }}
                     </span>
                     <span>{{ matched_detail.num }}组</span>
                   </Col>
@@ -636,9 +653,9 @@
                   border
                   :ref="'matched' + index"
                   :max-height="500"
-                  @on-selection-change="handleMatchedSelectChange"
                   :data="matched_detail.detail"
                 >
+                  <!-- @on-selection-change="handleMatchedSelectChange" -->
                   <!-- <template slot="setSlot" slot-scope="{ row, index }">
                     <a @click="handleMatchedSet(row, index, 5)">撤销匹配 </a>
                   </template> -->
@@ -721,7 +738,8 @@ export default {
       number: [], //房号 未匹配
       part_name: [], //部件名称 未匹配
       regionList: [], //区域名称 未匹配
-      wool_size: [], //毛料尺寸 未匹配
+      wool_size1: [], //毛料尺寸 未匹配
+      wool_size2: [], //毛料尺寸 已匹配
       urlSelectList: [], //图号列表 未匹配
       productList: [], //产品列表 未匹配
       urlMatchedList: [], //图号列表 已匹配
@@ -982,7 +1000,8 @@ export default {
             this.number = res.data.search_word.number;
             this.part_name = res.data.search_word.part_name;
             this.regionList = res.data.search_word.region;
-            this.wool_size = res.data.search_word.wool_size;
+            this.wool_size1 = res.data.search_word.wool_size1;
+            this.wool_size2 = res.data.search_word.wool_size2;
           });
     },
     getMatchedDetailList(row) {
@@ -1035,7 +1054,7 @@ export default {
       this.handleHandingMatchNumChange();
     },
     handleIsAllowHandingMatch() {
-      if (this.unmatchedSelectedList.length <1 || !this.currentChooseNumber) {
+      if (this.unmatchedSelectedList.length < 1 || !this.currentChooseNumber) {
         return this.$Message.warning("请选择");
       }
       if (this.currentChooseNumber < this.unmatchedSelectedList.length) {
@@ -1080,12 +1099,17 @@ export default {
             this.handleSearchUnmatchedInfo();
             this.currentChooseId = "";
             this.currentChooseNumber = 0;
+            this.currentChooseNumberUsed = 0;
             this.currentChooseTitle = "";
             this.unmatchedSelectedList = [];
           }
         });
     },
-    handleMatchedSelectAll(bool) {
+    handleMatchedSelectAll(row, e) {
+      row.isSelect = e;
+      this.matchedSelectedList = this.matchedList.map((v) => {
+        return v.id;
+      });
       // for (let index = 0; index < this.matchedDetailList.length; index++) {
       // const element = this.matchedDetailList[index];
       // this.$refs["matched" + index][0].selectAll(bool);
@@ -1093,17 +1117,14 @@ export default {
       // }
     },
     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.matchedSelectedList = [row.id];
           }
           this.axios
             .post("/api/bst_cancer_matching", {
-              cut_order_product_id,
+              cut_order_product_id: this.matchedSelectedList,
             })
             .then((res) => {
               if (res.code == 200) {