Просмотр исходного кода

新增页面匹配裂变---cjh

17767204043 3 лет назад
Родитель
Сommit
3ef3ff41f7

+ 27 - 0
src/routerMap/index.js

@@ -2108,6 +2108,33 @@ const routerMap = [
       require(["@/views/Agreement/edit"], resolve),
   },
   {
+    path: "/cms/Agreement/match/list",
+    name: "MatchList", //合同-->匹配-->匹配列表
+    meta: {
+      index: 3,
+    },
+    component: (resolve) =>
+      require(["@/views/Agreement/match/list"], resolve),
+  },
+  {
+    path: "/cms/Agreement/match/matching",
+    name: "Matching", //合同-->匹配-->匹配操作
+    meta: {
+      index: 3,
+    },
+    component: (resolve) =>
+      require(["@/views/Agreement/match/matching"], resolve),
+  },
+  {
+    path: "/cms/Agreement/match/check",
+    name: "MatchCheck", //合同-->匹配-->查看
+    meta: {
+      index: 3,
+    },
+    component: (resolve) =>
+      require(["@/views/Agreement/match/check"], resolve),
+  },
+  {
     path: "/cms/SealApprove/list",
     name: "SealApproveList", //印章审批列表
     meta: {

+ 698 - 0
src/views/Agreement/match/check.vue

@@ -0,0 +1,698 @@
+<template>
+  <div>
+    <Toptitle title="查看">
+      <Button
+        @click="handleMatchedSelectAll()"
+        type="primary"
+        :ghost="!isMatchedSelectAll"
+        style="margin-right: 10px"
+        >{{ isMatchedSelectAll ? "取消选中" : "全部选中" }}</Button
+      >
+      <Button
+        @click="handleGoProduction(1)"
+        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="4">
+        <span>金螳螂ID:</span><span>{{ project_number }}</span>
+      </Col>
+      <Col span="4">
+        <span>项目编号:</span><span>{{ project_name }}</span>
+      </Col>
+      <Col span="4">
+        <span>项目名称:</span><span>{{ project_name }}</span>
+      </Col>
+      <Col span="4">
+        <span>项目简介:</span><span>{{ project_name }}</span>
+      </Col>
+    </Row>
+    <div class="context-tabs">
+      <div
+        v-for="matched_info in matchedList"
+        :key="matched_info.number"
+        class="matched-block"
+      >
+        <Row type="flex" justify="space-between" align="top">
+          <Col
+            style="
+              display: flex;
+              justify-content: space-around;
+              align-items: center;
+            "
+          >
+            <div v-if="matched_info.matching_status == 2">
+              <Checkbox
+                v-show="matched_info.produce_status != 0"
+                v-model="matched_info.isSelect"
+                @on-change="(e) => handleMatchedSelect(matched_info, e)"
+                >选择</Checkbox
+              >
+              <Checkbox
+                v-show="matched_info.produce_status == 0"
+                v-model="matched_info.del_isSelect"
+                @on-change="(e) => MatchedSelect(matched_info, e)"
+                class="del_check"
+                >选择</Checkbox
+              >
+            </div>
+            <span>制单日期:{{ matched_info.image_number }}</span>
+            <!-- <div style="margin-left:100px">
+                <span>{{
+              matched_info.matching_status == 0
+                ? "未匹配"
+                : matched_info.matching_status == 1
+                ? "匹配中"
+                : "匹配完成"
+            }}</span>
+            </div> -->
+          </Col>
+          <!-- <Col span="3">
+            <span>产品名称:{{ matched_info.product_name }}</span>
+          </Col>
+          <Col span="3">
+            <span>区域:{{ matched_info.region }}</span>
+          </Col> -->
+          <!-- <Col span="2">
+            <span>{{
+              matched_info.matching_status == 0
+                ? "未匹配"
+                : matched_info.matching_status == 1
+                ? "匹配中"
+                : "匹配完成"
+            }}</span>
+          </Col> -->
+          <Col style="display: flex; justify-content: space-between" span="6">
+            <span v-if="matched_info.matching_status == 2">
+              <Button
+                @click="handleGoProduction(2, matched_info)"
+                type="primary"
+                size="small"
+                :disabled="matched_info.produce_status != 0"
+                >下生产通知</Button
+              >
+            </span>
+
+            <div>
+              总计
+              <span style="color: red">{{ matched_info.num }}</span>
+              条数据
+            </div>
+            <div>
+              <Button
+                @click="handleShowCurrencyMatched(matched_info)"
+                size="small"
+                type="text"
+                >{{ matched_info.isCurrenct ? "收缩" : "展开" }}</Button
+              >
+              <Icon
+                size="20"
+                :type="
+                  matched_info.isCurrenct
+                    ? 'md-arrow-dropdown'
+                    : 'md-arrow-dropright'
+                "
+                style="vertical-align: middle"
+              />
+            </div>
+          </Col>
+        </Row>
+        <Row
+          style="margin-top: 20px; padding-bottom: 20px"
+          v-if="matched_info.isCurrenct"
+        >
+          <Col span="4">
+            <span>区域:</span>
+            <span>
+              <Select
+                filterable
+                multiple
+                transfer
+                clearable
+                filter-by-label
+                v-model="matchedInfo.region"
+                :max-tag-count="2"
+                size="small"
+                style="width: 150px"
+              >
+                <Option
+                  v-for="(item, index) in regionMatchedList"
+                  :key="index"
+                  :label="item"
+                  :value="item"
+                >
+                </Option>
+              </Select>
+            </span>
+          </Col>
+          <Col span="4">
+            <span>图号:</span>
+            <span>
+              <Select
+                filterable
+                multiple
+                transfer
+                clearable
+                filter-by-label
+                v-model="matchedInfo.number"
+                :max-tag-count="2"
+                size="small"
+                style="width: 150px"
+              >
+                <Option
+                  v-for="(item, index) in numberMatchedList"
+                  :key="index"
+                  :label="item"
+                  :value="item"
+                >
+                </Option>
+              </Select>
+            </span>
+          </Col>
+          <Col span="4">
+            <span>产品名称:</span>
+            <span>
+              <Select
+                filterable
+                multiple
+                transfer
+                clearable
+                filter-by-label
+                v-model="matchedInfo.part_name"
+                :max-tag-count="2"
+                size="small"
+                style="width: 150px"
+              >
+                <Option
+                  v-for="(item, index) in partNameMatchedList"
+                  :key="index"
+                  :label="item"
+                  :value="item"
+                ></Option>
+              </Select>
+            </span>
+          </Col>
+          <Col span="2">
+            <Button
+              @click="getMatchedDetailList(matched_info)"
+              size="small"
+              type="primary"
+            >
+              搜索
+            </Button>
+          </Col>
+        </Row>
+        <div v-if="matched_info.isCurrenct">
+          <div
+            v-for="(matched_detail, index) in matchedDetailList"
+            :key="index"
+          >
+            <Table
+              ref="selection"
+              @on-selection-change="ifCheckAll"
+              v-show="!matched_detail.isHidden"
+              :columns="matchedSheetTableColumns"
+              border
+              :max-height="500"
+              on-selection-change
+              :data="matched_detail.detail"
+              style="width: 100%"
+            >
+              <template slot="setSlot" slot-scope="{ row, index }">
+                <a @click="handleSet(row, index, 1)" style="margin: 0 5px"
+                  >下生产</a
+                >
+              </template>
+            </Table>
+          </div>
+        </div>
+      </div>
+    </div>
+    <Modal v-model="processModal" title="下生产">
+      <div>
+        <div class="process_modal">
+          <span>生产人员:</span>
+          <Select
+            v-model="process_man"
+            filterable
+            filter-by-label
+            clearable
+            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"
+            :options="options"
+            v-model="process_start_time"
+            placeholder="年/月/日"
+            style="width: 150px"
+          ></DatePicker>
+          至
+          <DatePicker
+            type="date"
+            :options="options"
+            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>
+    <Modal
+      v-model="showDel"
+      title=""
+      @on-ok="important_del"
+      :closable="false"
+      style="text-align: center"
+      :width="30"
+    >
+      <div style="margin-top: 30px">
+        <span style="margin-right: 10px">用户姓名:</span
+        ><Input v-model="delData.user_name" style="width: 70%"></Input>
+      </div>
+      <div style="margin-top: 30px">
+        <span style="margin: 0 10px 0 23px">密码:</span
+        ><Input v-model="delData.password" style="width: 70%"></Input>
+      </div>
+    </Modal>
+  </div>
+</template>
+
+<script>
+// 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+// 例如:import 《组件名称》 from '《组件路径》';
+import Vue from 'vue'
+export default {
+  name: "",
+  components: {},
+  props: {},
+  // import引入的组件需要注入到对象中才能使用
+  data() {
+    // 这里存放数据
+    return {
+      delData: {
+        user_name: "",
+        password: "",
+      },
+      options: {},
+      project_number: this.$route.query.project_number,
+      project_name: this.$route.query.project_name,
+      isMatchedSelectAll: false,
+      matchedInfo: {
+        id: this.$route.query.id,
+        image_number: "",
+        product_name: "",
+        region: [],
+        number: [],
+        part_name: [],
+      },
+      urlMatchedList: [],
+      productMatchedList: [],
+      regionMatchedList: [],
+      numberMatchedList: [],
+      partNameMatchedList: [],
+      matchedDetailList: [],
+      matchedList: [],
+      matchedSheetTableColumns: [
+        {
+          type: "selection",
+          width: 60,
+          align: "center",
+        },
+        {
+          title: "序号",
+          align: "center",
+          type: "index",
+          resizable: true,
+          width: 100,
+        },
+        {
+          title: "区域",
+          align: "center",
+          key: "compose_name",
+          resizable: true,
+          width: 100,
+        },
+        {
+          title: "图号",
+          align: "center",
+          key: "region",
+          resizable: true,
+          width: 160,
+        },
+        {
+          title: "产品名称",
+          align: "center",
+          key: "house_number",
+          resizable: true,
+          width: 160,
+        },
+        {
+          title: "数量",
+          align: "center",
+          key: "part_name",
+          resizable: true,
+          width: 180,
+        },
+        {
+          title: "金额",
+          align: "center",
+          key: "line",
+          resizable: true,
+          width: 170,
+        },
+        { title: "操作", align: "center", slot: "setSlot", width: 100 },
+      ], //匹配表头
+      processModal: false,
+      process_man: "",
+      processManList: [],
+      process_start_time: "",
+      process_end_time: "",
+      process_control: false,
+      cut_order_product_ids: [],
+      matchedSelectedList: [],
+      delList: [],
+      showDel: false,
+    };
+  },
+  // 生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+    this.axios("/api/user").then(
+      (res) => (this.processManList = res.data.data)
+    );
+  },
+  // 生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {
+    this.initData();
+  },
+  methods: {
+    
+    ifCheckAll(s){//   判断table中是否全选
+      console.log(s,"这是table中的数据");
+    },
+    important_del() {
+      this.axios
+        .post("/api/delete_cut_order_product", {
+          id: [...this.delList],
+          ...this.delData,
+        })
+        .then((res) => {
+          if (res.code == 200) {
+            this.$Message.success(res.msg);
+            this.delList = [];
+            this.isMatchedSelectAll = false;
+            this.initData();
+          }
+        });
+    },
+    handelDel() {
+      if (this.delList.length == 0) {
+        return this.$Message.warning("请选择要删除的数据");
+      }
+      this.confirmDelete({
+        content: "强制删除么?",
+        then: () => {
+          this.showDel = true;
+        },
+      });
+    },
+    handleMatchedSelectAll() {
+      this.isMatchedSelectAll = !this.isMatchedSelectAll;
+      this.matchedSelectedList = [];
+      // this.matchedList.map((v) => {
+      //     v.isCurrenct = true
+      //     if (v.produce_status == 0) {
+      //         v.isSelect = this.isMatchedSelectAll;
+      //         if (v.isSelect) {
+      //             this.matchedSelectedList.push(v.id)
+
+      //         }
+      //     }
+      // });
+      this.matchedList.forEach((e) => {
+        if (this.isMatchedSelectAll) {
+          e.del_isSelect = true;
+          e.isSelect = true;
+          if (this.$refs.selection) {
+            this.$refs.selection[0].selectAll(e.del_isSelect);
+          }
+        } else {
+          e.del_isSelect = false;
+          e.isSelect = false;
+          if (this.$refs.selection) {
+            this.$refs.selection[0].selectAll(e.del_isSelect);
+          }
+        }
+      });
+    },
+    handleMatchedSelect(row, e) {
+      row.isSelect = e;
+      let flag = true;
+      this.matchedSelectedList = [];
+      
+      this.matchedList.map((v) => {
+        if (v.produce_status == 0) {
+          if (v.isSelect) {
+            this.matchedSelectedList.push(v.id);
+          } else {
+            flag = false;
+          }
+        }
+      });
+      this.isMatchedSelectAll = flag;
+      if (this.$refs.selection) {
+        this.$refs.selection[0].selectAll(e);
+      }
+      this.cut_order_product_ids = this.matchedSelectedList;
+    },
+    MatchedSelect(row, e) {
+      row.del_isSelect = e;
+      if (this.$refs.selection) {
+        this.$refs.selection[0].selectAll(row.del_isSelect);
+      }
+      this.delList = [];
+      this.matchedList.forEach((v) => {
+        if (v.del_isSelect) {
+          this.delList.push(v.id);
+        }
+      });
+    },
+    back() {
+      this.$router.go(-1);
+    },
+    handleGoProduction(type, row) {
+      if (this.matchedSelectedList.length == 0 && type == 1) {
+        return this.$Message.warning("请选择");
+      }
+
+      if (type === 2) {
+        this.cut_order_product_ids = [row.id];
+      } else {
+        this.cut_order_product_ids = this.matchedSelectedList;
+      }
+      this.axios
+        .post("/api/bst_get_plan_time", {
+          type: -1,
+          id: this.cut_order_product_ids,
+          order_no: this.$route.query.project_number,
+        })
+        .then((res) => {
+          if (res.code == 200) {
+            this.processModal = true;
+            let time = [];
+            res.data.forEach((v) => {
+              time.push(v * 1000);
+            });
+            this.options = {
+              disabledDate(date) {
+                return (
+                  date && (date.valueOf() < time[0] || date.valueOf() > time[1])
+                );
+              },
+            };
+          }
+        });
+    },
+    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;
+          this.matchedSelectedList = [];
+          this.initData();
+        }
+        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) => {
+          this.matchedList = [];
+          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;
+          res.data.list.forEach((v, index) => {
+            if (v.matching_status == 2) {
+              this.matchedList.push(v);
+            }
+          });
+        });
+    },
+    handleHiddenMatchedDetail(row) {
+      if (row.isHidden) {
+        row.isHidden = !row.isHidden;
+      } else {
+        row.isHidden = true;
+      }
+      this.$forceUpdate();
+    },
+    handleShowCurrencyMatched(row) {
+      if (row.isCurrenct) {
+        row.isCurrenct = !row.isCurrenct;
+      } else {
+        this.matchedList.map((v) => (v.isCurrenct = false));
+    //     this.matchedList.forEach(e=>{
+    //       debugger
+    //       if(e.id == row.id){
+    //           this.$set(e,"test",true)
+    //       }else if(e.test){
+    //           delete(e.test)
+    //       }else{
+    //           return
+    //       }
+    //   })
+    //   console.log(this.matchedList,"测试");
+        row.isCurrenct = true;
+      }
+      this.getMatchedDetailList(row);
+    },
+    getMatchedDetailList(row) {
+      row.isCurrenct &&
+        this.axios
+          .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;
+            this.numberMatchedList = res.data.number;
+            this.partNameMatchedList = res.data.part_name;
+            this.matchedDetailList = res.data.list;
+            this.$nextTick(function () {
+              if (row.del_isSelect == true || row.isSelect == true) {
+                this.$refs.selection[0].selectAll(true);
+              }
+            });
+          });
+    },
+  },
+  // 监听属性 类似于data概念
+  computed: {},
+  // 监控data中的数据变化
+  watch: {},
+  beforeCreate() {}, // 生命周期 - 创建之前
+  beforeMount() {}, // 生命周期 - 挂载之前
+  beforeUpdate() {}, // 生命周期 - 更新之前
+  updated() {}, // 生命周期 - 更新之后
+  beforeDestroy() {}, // 生命周期 - 销毁之前
+  destroyed() {}, // 生命周期 - 销毁完成
+  activated() {}, // 如果页面有keep-alive缓存功能,这个函数会触发
+};
+</script>
+
+<style lang="scss" scoped>
+span {
+  font-size: 14px;
+}
+
+.context-tabs {
+  position: relative;
+  max-height: 650px;
+  overflow: hidden;
+  overflow-y: auto;
+  padding: 15px;
+  margin: 10px;
+  margin-bottom: 30px;
+  border-radius: 5px;
+  box-shadow: 1px 1px 5px 1px #999;
+}
+
+.matched-block {
+  padding: 15px;
+  margin-bottom: 30px;
+  background-color: #e9ecef;
+  border-radius: 5px;
+}
+
+.process_modal {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  padding: 10px;
+}
+
+/deep/.del_check .ivu-checkbox .ivu-checkbox-inner {
+  border-radius: 50%;
+}
+/deep/ .ivu-table table {
+  width: 100% !important;
+}
+</style>

+ 214 - 0
src/views/Agreement/match/list.vue

@@ -0,0 +1,214 @@
+<template>
+  <div>
+     <Toptitle title="匹配列表">
+      <slot name="titleButton"> </slot>
+    </Toptitle>
+    <div class="match_list">
+    <Row style="padding:10px 0">
+      <Col span="5">
+        <span>金螳螂ID:</span>
+        <span>
+          <Input clearable v-model="SearchInfo.project_number" style="width:140px"  />
+        </span>
+      </Col>
+      <Col span="5">
+        <span>项目编号:</span>
+        <span>
+          <Input clearable v-model="SearchInfo.project_name" style="width:140px"  />
+        </span>
+      </Col>
+      <Col span="5">
+        <span>项目名称:</span>
+        <span>
+          <Input clearable v-model="SearchInfo.project_short_title" style="width:140px"  />
+        </span>
+      </Col>
+      <Col span="5">
+        <span>项目简称:</span>
+        <span>
+          <Input clearable v-model="SearchInfo.project_short_title" style="width:140px"  />
+        </span>
+      </Col>
+      <Col span="2" offset="2">
+        <Button @click="initData" type="primary" style="margin-right: 10px" size='small'
+          >搜索</Button
+        >
+      </Col>
+    </Row>
+      <Table :columns="tableColumns" border :max-height="500" :data="tableData">
+        <template slot="setSlot" slot-scope="{ row, index }">
+          <a @click="handleSet(row, index, 1)" style="margin: 0 5px">匹配</a>
+          <a @click="handleSet(row, index, 2)">查看</a>
+        </template>
+      </Table>
+      <div class="total">总计<span>{{total}}</span>条数据</div>
+      </div>
+      <div class="content_body_page">
+        <Page
+          :page-size-opts="[10, 20, 30, 40, 100]"
+          @on-page-size-change="changeSize"
+          @on-change="changePage"
+          :current="page_index"
+          show-total
+          show-elevator
+          :total="total"
+          show-sizer
+          :page-size="page_size"
+        />
+      </div>
+    </div>
+</template>
+
+<script>
+// 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+// 例如:import 《组件名称》 from '《组件路径》';
+
+export default {
+  name: "matchList",
+  components: {},
+  props: {},
+  // import引入的组件需要注入到对象中才能使用
+  data() {
+    // 这里存放数据
+    return {
+      SearchInfo: {
+        project_short_title: "",
+        project_name: "",
+        project_number: "",
+        matching_status: "",
+      },
+      tableColumns: [
+        {
+          title: "金螳螂ID",
+          align: "center",
+          key: "project_number",
+         resizable: true,
+                        width: 350
+        },
+        {
+          title: "项目编号",
+          align: "center",
+          key: "project_name",
+          resizable: true,
+                        width: 350
+        },
+        {
+          title: "项目名称",
+          align: "center",
+          key: "abbreviation",
+          resizable: true,
+                        width: 350
+        },
+       {
+          title: "项目简介",
+          align: "center",
+          key: "abbreviation",
+          resizable: true,
+                        width: 350
+        },
+        { title: "操作", align: "center", minWidth: 150, slot: "setSlot" },
+      ],
+      tableData: [],
+      page_index: 1,
+      page_size: 10,
+      total: null,
+    };
+  },
+  // 生命周期 - 创建完成(可以访问当前this实例)
+  created() {},
+  // 生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {
+    this.initData();
+  },
+  methods: {
+    initData() {
+      this.axios({
+        method: "get",
+        url: "/api/bst_matching_list",
+        params: {...this.SearchInfo,page_index:this.page_index,page_size:this.page_size},
+      }).then((res) => {
+        if (res.code == 200) {
+          this.tableData = res.data.data;
+          this.total = res.data.total;
+        }
+      });
+    },
+    handleSet(row, index, type) {
+        debugger
+      switch (type) {
+        case 1:
+          this.$router.push({
+            path: "/cms/Agreement/match/matching",
+            query: {
+              type,
+              id: row.id,
+              project_number: row.project_number,
+              project_name: row.project_name,
+            },
+          });
+          break;
+        case 2:
+          this.$router.push({
+            path: "/cms/Agreement/match/check",
+            query: {
+              type,
+              id: row.id,
+              project_number: row.project_number,
+              project_name: row.project_name,
+            },
+          });
+          break;
+      }
+    },
+    changeSize(e) {
+      this.page_size = e;
+      this.initData();
+    },
+    changePage(e) {
+      this.page_index = e;
+      this.initData();
+    },
+  },
+  // 监听属性 类似于data概念
+  computed: {},
+  // 监控data中的数据变化
+  watch: {},
+  beforeCreate() {}, // 生命周期 - 创建之前
+  beforeMount() {}, // 生命周期 - 挂载之前
+  beforeUpdate() {}, // 生命周期 - 更新之前
+  updated() {}, // 生命周期 - 更新之后
+  beforeDestroy() {}, // 生命周期 - 销毁之前
+  destroyed() {}, // 生命周期 - 销毁完成
+  activated() {}, // 如果页面有keep-alive缓存功能,这个函数会触发
+};
+</script>
+
+<style lang="scss" scoped>
+span{
+    font-size: 15px;
+}
+.total{
+    margin-top:10px;
+}
+.total>span{
+    color: #d9001b;
+    font-size: 14px;
+}
+.content_body_page {
+  display: flex;
+  justify-content: center;
+  padding-top: 20px;
+}
+.match_list{
+  height:80%;
+  overflow: hidden;
+}
+/deep/ .ivu-col{
+display: flex;
+margin: 5px;
+align-items: center;
+}
+/deep/ .ivu-col-span-6{
+  flex: auto;
+}
+</style>

+ 1228 - 0
src/views/Agreement/match/matching.vue

@@ -0,0 +1,1228 @@
+<template>
+  <div>
+    <Toptitle title="匹配">
+      <Button
+        v-show="currencyTag != 1"
+        @click="handleMatchedSelectAll(isMatchedSelectAll)"
+        type="primary"
+        :ghost="!isMatchedSelectAll"
+        style="margin-right: 10px"
+        >{{ isMatchedSelectAll ? "取消选中" : "全部选中" }}</Button
+      >
+      <Button
+        @click="handleMatchedSet({}, 0, 5)"
+        v-show="currencyTag != 1"
+        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" type="flex" justify="start">
+        <Col style="margin-right: 20px">
+          <span>金螳螂ID:</span><span>{{ info.project_number }}</span>
+        </Col>
+
+        <Col style="margin-right: 20px">
+          <span>项目编号:</span><span>{{ info.project_number }}</span>
+        </Col>
+        <Col style="margin-right: 20px">
+          <span>项目名称:</span><span>{{ info.project_name }}</span>
+        </Col>
+        <Col style="margin-right: 20px">
+          <span>项目简介:</span><span>{{ info.project_number }}</span>
+        </Col>
+      </Row>
+    </div>
+    <div class="context-tabs">
+      <Tabs type="card" @on-click="handleTabsClick" v-model="currencyTag">
+        <Button
+          @click="handleIsAllowHandingMatch"
+          type="primary"
+          size="small"
+          slot="extra"
+          v-show="currencyTag == 1"
+          style="margin-right: 20px"
+        >
+          匹配
+        </Button>
+        <Button @click="confirm" type="primary" size="small" slot="extra">
+          确定
+        </Button>
+        <TabPane label="未匹配" name="1">
+          <Row>
+            <Col
+              span="12"
+              style="
+                border-top: 1px solid #adb5bd;
+                border-right: 1px solid #adb5bd;
+                padding: 10px;
+              "
+            >
+              <div class="sheet-block">
+                <h1>合同信息</h1>
+                <div class="context-unmatched-sheet">
+                  <Row
+                    type="flex"
+                    align="middle"
+                    style="padding-top: 20px; justify-content: space-around"
+                  >
+                    <Col span="">
+                      <span>区域:</span>
+                      <span>
+                        <Select
+                          filterable
+                          filter-by-label
+                          transfer
+                          clearable
+                          v-model="info.wool_size1"
+                          size="small"
+                          style="width: 120px"
+                        >
+                          <Option
+                            v-for="(item, index) in wool_size1"
+                            :key="index"
+                            :label="item"
+                            :value="item"
+                          ></Option>
+                        </Select>
+                      </span>
+                    </Col>
+                    <Col span="7">
+                      <span>产品名称:</span>
+                      <span>
+                        <Select
+                          filterable
+                          multiple
+                          filter-by-label
+                          clearable
+                          transfer
+                          v-model="info.part_name"
+                          :max-tag-count="2"
+                          size="small"
+                          style="width: 120px"
+                        >
+                          <Option
+                            v-for="(item, index) in part_name"
+                            :key="index"
+                            :label="item"
+                            :value="item"
+                          ></Option>
+                        </Select>
+                      </span>
+                    </Col>
+
+                    <Col span="4">
+                      <Button
+                        @click="getSheetDetailList(url_info, 1)"
+                        size="small"
+                        type="primary"
+                        style="margin-left: -30px"
+                      >
+                        搜索
+                      </Button>
+                    </Col>
+                  </Row>
+                  <div style="padding-top: 20px">
+                    <Table
+                      :columns="contractColumns"
+                      border
+                      :max-height="500"
+                      :data="testData"
+                    ></Table>
+                    <div class="table_bottom">总共<span>12</span>条数据</div>
+                  </div>
+                </div>
+              </div>
+            </Col>
+            <Col span="12">
+              <div
+                class="room-block"
+                style="border-top: 1px solid #adb5bd; padding: 10px"
+              >
+                <h1>深化信息</h1>
+                <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"
+                  >
+                    <Row
+                      type="flex"
+                      align="middle"
+                      style="justify-content: space-between"
+                    >
+                      <Col span="12">
+                        <span>制单日期:</span
+                        ><span>{{ url_info.image_number }}</span>
+                      </Col>
+                      <!-- <Col span="8">
+                        <span>产品名称:</span
+                        ><span>{{ url_info.product_name }}</span>
+                      </Col> -->
+                      <Col
+                        span="6"
+                        style="
+                          align-items: center;
+                          display: flex;
+                          justify-content: right;
+                        "
+                      >
+                        <span>
+                          总计
+                          <span style="color: red">{{
+                            url_info.house_num
+                          }}</span>
+                          条数据
+                        </span>
+
+                        <Button
+                          @click="handleShowCurrencySheet(url_info, 2)"
+                          style="
+                            padding: 0px;
+                            margin-left: 15px;
+                            font-size: 16px;
+                          "
+                          size="small"
+                          type="text"
+                          >{{ url_info.isCurrenct ? "收缩" : "展开" }}</Button
+                        >
+                        <Icon
+                          size="20"
+                          :type="
+                            url_info.isCurrenct
+                              ? 'md-arrow-dropdown'
+                              : 'md-arrow-dropright'
+                          "
+                          style="vertical-align: middle"
+                        />
+                      </Col>
+                    </Row>
+                    <!-- <Row>
+                      <Col span="4">
+                        <span>批量数:</span>
+                        <span>{{ url_info.number }}</span>
+                      </Col>
+                    </Row> -->
+                    <div
+                      v-if="url_info.isCurrenct"
+                      class="context-unmatched-room-search"
+                    >
+                      <Row
+                        type="flex"
+                        align="middle"
+                        style="justify-content: center"
+                      >
+                        <Col span="6" style="padding: 10px 0">
+                          <span>区域名称:</span>
+                          <span>
+                            <Select
+                              filterable
+                              multiple
+                              filter-by-label
+                              clearable
+                              transfer
+                              v-model="info.region"
+                              :max-tag-count="2"
+                              size="small"
+                              style="width: 100px"
+                            >
+                              <Option
+                                v-for="(item, index) in regionList"
+                                :key="index"
+                                :label="item"
+                                :value="item"
+                              ></Option>
+                            </Select>
+                          </span>
+                        </Col>
+                        <Col span="6" style="padding: 10px 0">
+                          <span>房号:</span>
+                          <span>
+                            <Select
+                              filterable
+                              multiple
+                              filter-by-label
+                              clearable
+                              transfer
+                              v-model="info.number"
+                              :max-tag-count="2"
+                              size="small"
+                              style="width: 100px"
+                            >
+                              <Option
+                                v-for="(item, index) in number"
+                                :key="index"
+                                :label="item"
+                                :value="item"
+                              ></Option>
+                            </Select>
+                          </span>
+                        </Col>
+                        <Col span="6" style="padding: 10px 0">
+                          <span>特殊尺寸:</span>
+                          <span>
+                            <Select
+                              filterable
+                              filter-by-label
+                              clearable
+                              transfer
+                              v-model="info.wool_size2"
+                              size="small"
+                              style="width: 100px"
+                            >
+                              <Option
+                                v-for="(item, index) in wool_size2"
+                                :key="index"
+                                :label="item"
+                                :value="item"
+                              ></Option>
+                            </Select>
+                          </span>
+                        </Col>
+                        <Col span="2" style="padding: 10px 0">
+                          <Button
+                            @click="getSheetDetailList(url_info, 2)"
+                            size="small"
+                            type="primary"
+                            >搜索</Button
+                          >
+                        </Col>
+                      </Row>
+                    </div>
+                    <div
+                      v-if="url_info.isCurrenct"
+                      class="context-unmatched-room-table"
+                    >
+                      <div>
+                        <Table
+                          :columns="unmatchedRoomTableColumns"
+                          border
+                          :max-height="500"
+                          @on-selection-change="handleSelectChange"
+                          :data="unmatchedRoomList.house_list"
+                        >
+                          <template slot="unit" slot-scope="{ index }">
+                            <Input
+                              v-model="unmatchedRoomList.house_list[index].unit"
+                              clearable
+                            />
+                          </template>
+                        </Table>
+                      </div>
+                    </div>
+                  </div>
+                </div>
+              </div>
+            </Col>
+          </Row>
+        </TabPane>
+        <TabPane label="已匹配" name="2">
+          <div class="context-tabs">
+            <div
+              v-for="matched_info in matchedList"
+              :key="matched_info.number"
+              class="matched-block"
+            >
+              <Row type="flex" justify="space-between" align="top">
+                <Col
+                  style="
+                    display: flex;
+                    justify-content: space-around;
+                    align-items: center;
+                  "
+                >
+                  <div>
+                    <Checkbox
+                      v-model="matched_info.del_isSelect"
+                      @on-change="(e) => MatchedSelect(matched_info, e)"
+                      class="del_check"
+                      >选择</Checkbox
+                    >
+                  </div>
+                  <span>制单日期:{{ matched_info.image_number }}</span>
+                  <!-- <div style="margin-left:100px">
+                <span>{{
+              matched_info.matching_status == 0
+                ? "未匹配"
+                : matched_info.matching_status == 1
+                ? "匹配中"
+                : "匹配完成"
+            }}</span>
+            </div> -->
+                </Col>
+                <!-- <Col span="3">
+            <span>产品名称:{{ matched_info.product_name }}</span>
+          </Col>
+          <Col span="3">
+            <span>区域:{{ matched_info.region }}</span>
+          </Col> -->
+                <!-- <Col span="2">
+            <span>{{
+              matched_info.matching_status == 0
+                ? "未匹配"
+                : matched_info.matching_status == 1
+                ? "匹配中"
+                : "匹配完成"
+            }}</span>
+          </Col> -->
+                <Col
+                  style="display: flex; justify-content: space-between"
+                  span="6"
+                >
+                  <span v-if="matched_info.matching_status == 2">
+                    <Button
+                      @click="handleGoProduction(2, matched_info)"
+                      type="primary"
+                      size="small"
+                      :disabled="matched_info.produce_status != 0"
+                      >下生产通知</Button
+                    >
+                  </span>
+
+                  <div>
+                    总计
+                    <span style="color: red">{{ matched_info.num }}</span>
+                    条数据
+                  </div>
+                  <div>
+                    <Button
+                      @click="handleShowCurrencyMatched(matched_info)"
+                      size="small"
+                      type="text"
+                      >{{ matched_info.isCurrenct ? "收缩" : "展开" }}</Button
+                    >
+                    <Icon
+                      size="20"
+                      :type="
+                        matched_info.isCurrenct
+                          ? 'md-arrow-dropdown'
+                          : 'md-arrow-dropright'
+                      "
+                      style="vertical-align: middle"
+                    />
+                  </div>
+                </Col>
+              </Row>
+              <Row
+                style="margin-top: 20px; padding-bottom: 20px"
+                v-if="matched_info.isCurrenct"
+              >
+                <Col span="4">
+                  <span>区域:</span>
+                  <span>
+                    <Select
+                      filterable
+                      multiple
+                      transfer
+                      clearable
+                      filter-by-label
+                      v-model="matchedInfo.region"
+                      :max-tag-count="2"
+                      size="small"
+                      style="width: 150px"
+                    >
+                      <Option
+                        v-for="(item, index) in regionMatchedList"
+                        :key="index"
+                        :label="item"
+                        :value="item"
+                      >
+                      </Option>
+                    </Select>
+                  </span>
+                </Col>
+                <Col span="4">
+                  <span>图号:</span>
+                  <span>
+                    <Select
+                      filterable
+                      multiple
+                      transfer
+                      clearable
+                      filter-by-label
+                      v-model="matchedInfo.number"
+                      :max-tag-count="2"
+                      size="small"
+                      style="width: 150px"
+                    >
+                      <Option
+                        v-for="(item, index) in numberMatchedList"
+                        :key="index"
+                        :label="item"
+                        :value="item"
+                      >
+                      </Option>
+                    </Select>
+                  </span>
+                </Col>
+                <Col span="4">
+                  <span>产品名称:</span>
+                  <span>
+                    <Select
+                      filterable
+                      multiple
+                      transfer
+                      clearable
+                      filter-by-label
+                      v-model="matchedInfo.part_name"
+                      :max-tag-count="2"
+                      size="small"
+                      style="width: 150px"
+                    >
+                      <Option
+                        v-for="(item, index) in partNameMatchedList"
+                        :key="index"
+                        :label="item"
+                        :value="item"
+                      ></Option>
+                    </Select>
+                  </span>
+                </Col>
+                <Col span="2">
+                  <Button
+                    @click="getMatchedDetailList(matched_info)"
+                    size="small"
+                    type="primary"
+                  >
+                    搜索
+                  </Button>
+                </Col>
+              </Row>
+              <div v-if="matched_info.isCurrenct">
+                <div
+                  v-for="(matched_detail, index) in matchedDetailList"
+                  :key="index"
+                >
+                  <Table
+                    ref="selection"
+                    @on-selection-change="ifCheckAll"
+                    v-show="!matched_detail.isHidden"
+                    :columns="matchedSheetTableColumns"
+                    border
+                    :max-height="500"
+                    on-selection-change
+                    :data="matched_detail.detail"
+                    style="width: 100%"
+                  >
+                    <template slot="setSlot" slot-scope="{ row, index }">
+                      <a @click="handleSet(row, index, 1)" style="margin: 0 5px"
+                        >下生产</a
+                      >
+                    </template>
+                  </Table>
+                </div>
+              </div>
+            </div>
+          </div>
+        </TabPane>
+      </Tabs>
+    </div>
+    <Modal width="80" v-model="showHandingMatchModal" title="手动匹配确认">
+      <div>
+        <Row style="padding: 10px 0">
+          <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>
+        </Row>
+      </div>
+      <div>
+        <Table
+          :columns="unmatchedRoomTableColumnsModal"
+          border
+          :max-height="500"
+          :data="unmatchedSelectedList"
+        >
+          <template slot="numSlot" slot-scope="{ index }">
+            <Input
+              @on-change="handleHandingMatchNumChange"
+              v-model="unmatchedSelectedList[index].num"
+            />
+          </template>
+        </Table>
+      </div>
+      <div slot="footer">
+        <Button @click="showHandingMatchModal = false">取消</Button>
+        <Button type="primary" @click="handleHandingMatch">确定</Button>
+      </div>
+    </Modal>
+  </div>
+</template>
+
+<script>
+// 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+// 例如:import 《组件名称》 from '《组件路径》';
+
+export default {
+  name: "",
+  components: {},
+  props: {},
+  // import引入的组件需要注入到对象中才能使用
+  data() {
+    // 这里存放数据
+    return {
+      currencyTag: "1", //当前分页
+      info: {
+        id: this.$route.query.id,
+        project_number: this.$route.query.project_number,
+        project_name: this.$route.query.project_name,
+        cut_size: "",
+        number: "",
+        part_name: "",
+        region: "",
+        wool_size1: "",
+        wool_size2: "",
+        image_number: [],
+        product_name: [],
+      },
+
+      matchedInfo: {
+        id: this.$route.query.id,
+        image_number: [],
+        product_name: [],
+      },
+      cut_size: [], //精裁尺寸 未匹配
+      number: [], //房号 未匹配
+      part_name: [], //部件名称 未匹配
+      regionList: [], //区域名称 未匹配
+      wool_size1: [], //毛料尺寸 未匹配
+      wool_size2: [], //毛料尺寸 已匹配
+      urlSelectList: [], //图号列表 未匹配
+      productList: [], //产品列表 未匹配
+      urlMatchedList: [], //图号列表 已匹配
+      productMatchedList: [], //产品列表 已匹配
+      regionMatchedList: [], //区域列表 已匹配
+      numberMatchedList: [], //房号列表 已匹配
+      partNameMatchedList: [], //部件列表 已匹配
+      unmatchedObj: {
+        urlList: [], //图号列表
+        part_list: [], //当前图号下表格列表
+      }, //码单信息
+      unmatchedRoomList: {
+        urlList: [], //图号列表
+        house_list: [{ title: 1 }], //当前图号下表格列表
+      }, //房间信息
+      currentChooseId: "", //选中码单信息中的ID
+      currentChooseNumber: 0, //选中码单信息中的ID
+      currentChooseTitle: "", //选中码单信息中的ID
+      currentChooseNumberUsed: "",
+      matchedList: [],
+      matchedDetailList: [],
+      unmatchedSheetTableColumns: [
+        {
+          title: "选择",
+          align: "center",
+          minWidth: 60,
+          render: (h, params) => {
+            let id = params.row.id;
+            let flag = false;
+            if (this.currentChooseId == id) {
+              flag = true;
+            } else {
+              flag = false;
+            }
+            let self = this;
+            return h("div", [
+              h("Radio", {
+                props: {
+                  value: flag,
+                },
+                on: {
+                  "on-change": () => {
+                    self.currentChooseId = params.row.id;
+                    self.currentChooseNumber = params.row.unbind_number;
+                    self.currentChooseTitle = params.row.part_name;
+                  },
+                },
+              }),
+            ]);
+          },
+        },
+        { title: "序号", align: "center", type: "index", minWidth: 60 },
+        {
+          title: "组合名称",
+          align: "center",
+          key: "compose_name",
+          minWidth: 100,
+        },
+        { title: "部件名称", align: "center", key: "part_name", minWidth: 100 },
+        { title: "行号", align: "center", key: "line", minWidth: 70 },
+        { title: "木皮1", align: "center", key: "skin1", minWidth: 60 },
+        {
+          title: "原材料",
+          align: "center",
+          minWidth: 80,
+          render: (h, params) => {
+            return h(
+              "span",
+              {},
+              params.row.board1 +
+                (params.row.board2 ? ";" + params.row.board2 : "")
+            );
+          },
+        },
+        { title: "木皮2", align: "center", key: "skin2", minWidth: 60 },
+        { title: "毛料尺寸", align: "center", key: "wool_size", minWidth: 80 },
+        {
+          title: "原料数量",
+          align: "center",
+          key: "wool_number",
+          minWidth: 80,
+        },
+        { title: "精裁尺寸", align: "center", key: "cut_size", minWidth: 80 },
+        {
+          title: "零部件数量",
+          align: "center",
+          key: "cut_number",
+          minWidth: 90,
+        },
+        {
+          title: "未匹配数量",
+          align: "center",
+          key: "unbind_number",
+          minWidth: 90,
+        },
+        { title: "贴皮面积", align: "center", key: "stick", minWidth: 80 },
+        { title: "精裁面积", align: "center", key: "cut", minWidth: 80 },
+        { title: "工艺要求", align: "center", key: "remark", minWidth: 80 },
+      ], //未匹配码单表头
+      unmatchedRoomTableColumns: [
+        { 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: "house",
+          minWidth: 60,
+        },
+        {
+          title: "单元",
+          align: "center",
+          key: "unit",
+          minWidth: 60,
+          slot: "unit",
+        },
+        { title: "楼层", align: "center", key: "layer", minWidth: 60 },
+        { title: "房号", align: "center", key: "number", minWidth: 60 },
+      ], //未匹配房间表头
+      unmatchedRoomTableColumnsUsed: [],
+      contractColumns: [
+        { title: "全选", align: "center", width: 60, type: "selection" },
+        { title: "序号", align: "center", key: "index" },
+        { title: "区域", align: "center", key: "middle" },
+        { title: "产品名称", align: "center", key: "product_name" },
+        { title: "数量", align: "center", key: "number" },
+        { title: "金额", align: "center", key: "price" },
+      ],
+      testData: [
+        {
+          index: "1",
+          middle: "A区",
+          product_name: "抽屉1",
+          number: "1",
+          price: "123",
+        },
+        {
+          index: "1",
+          middle: "A区",
+          product_name: "抽屉1",
+          number: "1",
+          price: "123",
+        },
+        {
+          index: "1",
+          middle: "A区",
+          product_name: "抽屉1",
+          number: "1",
+          price: "123",
+        },
+      ],
+      matchedSheetTableColumns: [], //匹配表头
+      unmatchedRoomTableColumnsModal: [],
+      unmatchedSelectedList: [],
+      matchedSelectedList: [],
+      showHandingMatchModal: false,
+      isMatchedSelectAll: false,
+      matchedReopenTag: "",
+      matchedReopenList: [],
+      isClickMatch: true,
+    };
+  },
+  // 生命周期 - 创建完成(可以访问当前this实例)
+  created() {},
+  // 生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {
+    this.handleSearchUnmatchedInfo();
+  },
+  methods: {
+    MatchedSelect(row, e) {
+      row.del_isSelect = e;
+      if (this.$refs.selection) {
+        this.$refs.selection[0].selectAll(row.del_isSelect);
+      }
+      this.delList = [];
+      this.matchedList.forEach((v) => {
+        if (v.del_isSelect) {
+          this.delList.push(v.id);
+        }
+      });
+    },
+    ifCheckAll(s) {
+      //   判断table中是否全选
+      console.log(s, "这是table中的数据");
+    },
+    back() {
+      this.$router.go(-1);
+    },
+    handleSelectChange(selection) {
+      this.unmatchedSelectedList = selection;
+      this.unmatchedSelectedList.map((v) => (v.num = ""));
+    },
+    handleMatchedSelectChange(selection) {
+      this.matchedSelectedList = this.matchedSelectedList.concat(
+        selection.map((v) => {
+          return v.cut_order_product_id;
+        })
+      );
+    },
+    handleTabsClick(name) {
+      name == 2 && this.handleMatchedListInit();
+      name == 1 && this.handleSearchUnmatchedInfo();
+    },
+    handleMatchedListInit() {
+      this.axios
+        .get("/api/bst_matching_on_product_list", {
+          params: {
+            id: this.info.id,
+            image_number: this.matchedInfo.image_number,
+            product_name: this.matchedInfo.product_name,
+          },
+        })
+        .then((res) => {
+          res.data.list.map((v) => {
+            v.isCurrenct = false;
+          });
+          this.matchedList = res.data.list;
+          this.urlMatchedList = res.data.image_number;
+          this.productMatchedList = res.data.product_name;
+        });
+    },
+    handleShowCurrencySheet(row, type) {
+      if (row.isCurrenct) {
+        row.isCurrenct = !row.isCurrenct;
+      } else {
+        this.unmatchedObj.urlList.map((v) => (v.isCurrenct = false));
+        row.isCurrenct = true;
+        this.matchedReopenTag = row.id;
+      }
+      this.getSheetDetailList(row, type);
+    },
+    handleHiddenSheetDetail(row) {
+      if (row.isHidden) {
+        row.isHidden = !row.isHidden;
+      } else {
+        row.isHidden = true;
+      }
+      this.matchedReopenList = [];
+      this.unmatchedObj.part_list.map((v) => {
+        if (v.isHidden) {
+          this.matchedReopenList.push(
+            v.key.list
+              .map((w) => {
+                return w.value;
+              })
+              .join("*")
+          );
+        }
+      });
+      console.log(`this.matchedReopenList`, this.matchedReopenList);
+      this.$forceUpdate();
+    },
+    handleHiddenMatchedDetail(row) {
+      if (row.isHidden) {
+        row.isHidden = !row.isHidden;
+      } else {
+        row.isHidden = true;
+      }
+      this.$forceUpdate();
+    },
+    handleShowCurrencyMatched(row) {
+      if (row.isCurrenct) {
+        row.isCurrenct = !row.isCurrenct;
+      } else {
+        this.matchedList.map((v) => (v.isCurrenct = false));
+        row.isCurrenct = true;
+      }
+      this.getMatchedDetailList(row);
+    },
+    getSheetDetailList(row, type) {
+      switch (type) {
+        case 1:
+          row.isCurrenct &&
+            this.axios
+              .post("/api/bst_matching_un_product_detail", {
+                cut_order_product_id: row.id,
+                id: this.info.id,
+                cut_size: this.info.cut_size,
+                number: this.info.number,
+                part_name: this.info.part_name,
+                region: this.info.region,
+                wool_size1: this.info.wool_size1,
+                key: this.matchedReopenList,
+              })
+              .then((res) => {
+                console.log(`123`, 123);
+                this.unmatchedObj.part_list = [];
+                this.unmatchedObj.part_list = res.data.part_list;
+                this.unmatchedObj.part_list = res.data.part_list;
+                this.unmatchedObj.part_list.forEach((v) => {
+                  v.isHidden = true;
+                });
+                console.log(res.data.house_list);
+                this.unmatchedRoomList.house_list = [];
+                this.unmatchedRoomList.house_list = res.data.house_list;
+                this.unmatchedRoomList.house_list.forEach((v, index) => {
+                  this.unmatchedObj.part_list[index].key.list.forEach(
+                    (item) => {
+                      v[item.key] = item.value;
+                    }
+                  );
+                });
+
+                this.unmatchedRoomTableColumnsUsed =
+                  this.unmatchedRoomTableColumns.concat(
+                    res.data.head_word.map((v) => {
+                      return {
+                        title: v,
+                        align: "center",
+                        key: v,
+                        minWidth: 60,
+                      };
+                    })
+                  );
+                this.unmatchedRoomTableColumnsModal =
+                  this.unmatchedRoomTableColumnsUsed.concat({
+                    title: "匹配数量",
+                    align: "center",
+                    minWidth: 60,
+                    slot: "numSlot",
+                  });
+                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;
+                this.regionList = res.data.search_word.region;
+                this.wool_size1 = res.data.search_word.wool_size1;
+                this.wool_size2 = res.data.search_word.wool_size2;
+                this.unmatchedObj.part_list.map((v) => {
+                  if (v.state == 1) {
+                    v.isHidden = true;
+                  }
+                });
+                this.$forceUpdate();
+              });
+          break;
+        case 2:
+          row.isCurrenct &&
+            this.axios
+              .post("/api/bst_matching_un_product_detail", {
+                cut_order_product_id: row.id,
+                id: this.info.id,
+                cut_size: this.info.cut_size,
+                number: this.info.number,
+                part_name: this.info.part_name,
+                region: this.info.region,
+                wool_size2: this.info.wool_size2,
+                key: this.matchedReopenList,
+              })
+              .then((res) => {
+                this.unmatchedRoomList.house_list = res.data.house_list;
+                this.unmatchedRoomTableColumnsUsed =
+                  this.unmatchedRoomTableColumns.concat(
+                    res.data.head_word.map((v) => {
+                      return {
+                        title: v,
+                        align: "center",
+                        key: v,
+                        minWidth: 60,
+                      };
+                    })
+                  );
+                this.unmatchedRoomTableColumnsModal =
+                  this.unmatchedRoomTableColumnsUsed.concat({
+                    title: "匹配数量",
+                    align: "center",
+                    minWidth: 60,
+                    slot: "numSlot",
+                  });
+                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;
+                this.regionList = res.data.search_word.region;
+                this.wool_size1 = res.data.search_word.wool_size1;
+                this.wool_size2 = res.data.search_word.wool_size2;
+                this.unmatchedObj.part_list.map((v) => {
+                  if (v.state == 1) {
+                    v.isHidden = true;
+                  }
+                });
+                this.$forceUpdate();
+              });
+          break;
+      }
+    },
+    getMatchedDetailList(row) {
+      row.isCurrenct &&
+        this.axios
+          .get("/api/bst_matching_on_product_detail", {
+            params: {
+              cut_order_product_id: row.id || 14,
+              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;
+          });
+    },
+    handleSearchUnmatchedInfo() {
+      this.axios({
+        method: "get",
+        url: "/api/bst_matching_un_product_list",
+        params: {
+          id: this.info.id,
+          image_number: this.info.image_number,
+          product_name: this.info.product_name,
+        },
+      }).then((res) => {
+        if (res.code == 200) {
+          let data = [];
+          res.data.list.map((v) => (v.isCurrenct = false));
+          res.data.list.forEach((element) => {
+            if (element.number != 0) {
+              data.push(element);
+            }
+          });
+          this.unmatchedObj.urlList = data;
+          this.urlSelectList = res.data.image_number;
+          this.productList = res.data.product_name;
+          this.unmatchedSelectedList = [];
+          this.unmatchedObj.urlList.map((v) => {
+            if (v.id == this.matchedReopenTag) {
+              v.isCurrenct = true;
+              if (this.isClickMatch) {
+                this.getSheetDetailList(v, 1);
+              }
+            }
+          });
+          this.$forceUpdate();
+        }
+      });
+    },
+    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();
+    },
+    confirm() {
+      console.log("确定");
+    },
+    handleIsAllowHandingMatch() {
+      if (this.unmatchedSelectedList.length < 1 || !this.currentChooseNumber) {
+        return this.$Message.warning("请选择");
+      }
+      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;
+    },
+    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,
+        })
+        .then((res) => {
+          if (res.code == 200) {
+            this.$Message.success(res.msg);
+            this.showHandingMatchModal = false;
+            this.currentChooseId = "";
+            this.currentChooseNumber = 0;
+            this.currentChooseNumberUsed = 0;
+            this.currentChooseTitle = "";
+            this.unmatchedSelectedList = [];
+            this.isClickMatch = true;
+            this.handleSearchUnmatchedInfo();
+          }
+        });
+    },
+    handleMatchedSelectAll() {
+      this.isMatchedSelectAll = !this.isMatchedSelectAll;
+      this.matchedList.map((v) => {
+        if (v.produce_status == 0) {
+          v.isSelect = this.isMatchedSelectAll;
+          this.matchedSelectedList.push(v.id);
+        }
+      });
+    },
+    handleMatchedSelect(row, e) {
+      row.isSelect = e;
+      let flag = true;
+      this.matchedSelectedList = [];
+      this.matchedList.map((v) => {
+        if (v.produce_status == 0) {
+          if (v.isSelect) {
+            this.matchedSelectedList.push(v.id);
+          } else {
+            flag = false;
+          }
+        }
+      });
+      this.isMatchedSelectAll = flag;
+    },
+    handleMatchedSet(row, index, type) {
+      if (this.matchedSelectedList.length == 0) {
+        return this.$Message.warning("请选择");
+      }
+      switch (type) {
+        case 5:
+          if (index == -1) {
+            this.matchedSelectedList = [row.id];
+          } else {
+            this.matchedSelectedList = [];
+            this.matchedList.map((v) => {
+              v.isSelect && this.matchedSelectedList.push(v.id);
+            });
+          }
+          this.axios
+            .post("/api/bst_cancer_matching", {
+              cut_order_product_id: this.matchedSelectedList,
+            })
+            .then((res) => {
+              if (res.code == 200) {
+                this.$Message.success(res.msg);
+                this.handleMatchedListInit();
+                this.isMatchedSelectAll = false;
+              }
+            });
+          break;
+      }
+    },
+  },
+  // 监听属性 类似于data概念
+  computed: {},
+  // 监控data中的数据变化
+  watch: {},
+  beforeCreate() {}, // 生命周期 - 创建之前
+  beforeMount() {}, // 生命周期 - 挂载之前
+  beforeUpdate() {}, // 生命周期 - 更新之前
+  updated() {}, // 生命周期 - 更新之后
+  beforeDestroy() {}, // 生命周期 - 销毁之前
+  destroyed() {}, // 生命周期 - 销毁完成
+  activated() {}, // 如果页面有keep-alive缓存功能,这个函数会触发
+};
+</script>
+
+<style lang="scss" scoped>
+.context-tabs {
+  position: relative;
+  max-height: 650px;
+  overflow: hidden;
+  overflow-y: auto;
+  padding: 15px;
+  margin: 10px;
+  margin-bottom: 30px;
+  border-radius: 5px;
+  box-shadow: 1px 1px 5px 1px #999;
+}
+
+span {
+  font-size: 14px;
+}
+.table_bottom {
+  padding-top: 10px;
+  > span {
+    color: #d9001b;
+  }
+}
+.top-info {
+  padding: 10px;
+  font-size: 18px;
+}
+.context-tabs {
+  position: relative;
+  max-height: 80%;
+  overflow: hidden;
+  overflow-y: auto;
+  padding: 15px;
+  margin: 10px;
+  margin-bottom: 30px;
+  border-radius: 5px;
+  box-shadow: 1px 1px 5px 1px #999;
+  // 未匹配样式
+  .context-unmatched-sheet-table,
+  .context-unmatched-room-table {
+  }
+  .context-unmatched-sheet-search,
+  .context-unmatched-room-search {
+    padding: 10px 0;
+  }
+  // 匹配样式
+  .matched-block {
+    padding: 15px;
+    margin-bottom: 30px;
+    background-color: #e9ecef;
+    border-radius: 5px;
+  }
+}
+/deep/.ivu-tabs-nav-scroll {
+  display: flex;
+  justify-content: center;
+}
+/deep/.ivu-table-cell {
+  padding: 0;
+}
+.sheet-block,
+.room-block {
+  max-height: 100%;
+  overflow: hidden;
+  overflow-y: auto;
+}
+</style>