ysy před 2 roky
rodič
revize
66f4b2d001

+ 249 - 295
src/views/technology/route/components/user-taskinstance.vue

@@ -1,31 +1,13 @@
 <!-- 用户编辑弹窗 -->
 <template>
-  <ele-modal
-    width="1060px"
-    :visible="visible"
-    :append-to-body="true"
-    :close-on-click-modal="true"
-    custom-class="ele-dialog-form"
-    :title="`给工序【${this.data?.code}${this.data?.name}】配置工序`"
-    @update:visible="updateVisible"
-  >
+  <ele-modal width="1060px" :visible="visible" :append-to-body="true" :close-on-click-modal="true"
+    custom-class="ele-dialog-form" :title="`给工序【${this.data?.code}${this.data?.name}】配置工序`"
+    @update:visible="updateVisible">
     <div class="ele-body">
-      <ele-pro-table
-        ref="table"
-        :needPage="false"
-        :columns="columns"
-        :datasource="datasource"
-        row-key="code"
-      >
+      <ele-pro-table ref="table" :needPage="false" :columns="columns" :datasource="datasource" row-key="code">
         <!-- 表头工具栏 -->
         <template v-slot:toolbar>
-          <el-button
-            size="small"
-            type="primary"
-            icon="el-icon-plus"
-            class="ele-btn-icon"
-            @click="showAddLog"
-          >
+          <el-button size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon" @click="showAddLog">
             添加参数
           </el-button>
         </template>
@@ -34,27 +16,14 @@
 
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
-          <el-link
-            type="primary"
-            :underline="false"
-            icon="el-icon-edit"
-            @click="openEdit(row)"
-          >
+          <el-link type="primary" :underline="false" icon="el-icon-edit" @click="openEdit(row)">
             修改
           </el-link>
-          <el-link
-            :type="row.id ? 'primary' : 'info'"
-            :underline="false"
-            icon="el-icon-setting"
-            @click="openSetting(row)"
-          >
+          <el-link :type="row.id ? 'primary' : 'info'" :underline="false" icon="el-icon-setting"
+            @click="openSetting(row)">
             配置工艺参数
           </el-link>
-          <el-popconfirm
-            class="ele-action"
-            title="删除数据操作立即生效!!!确定要删除当前工序吗?"
-            @confirm="remove(row)"
-          >
+          <el-popconfirm class="ele-action" title="删除数据操作立即生效!!!确定要删除当前工序吗?" @confirm="remove(row)">
             <template v-slot:reference>
               <el-link type="danger" :underline="false" icon="el-icon-delete">
                 删除
@@ -74,13 +43,8 @@
         保存并关闭
       </el-button>
     </template>
-    <ele-modal
-      width="1720px"
-      :visible="addDialog"
-      :append-to-body="true"
-      :close-on-click-modal="true"
-      @update:visible="closeAdd"
-    >
+    <ele-modal width="1720px" :visible="addDialog" :append-to-body="true" :close-on-click-modal="true"
+      @update:visible="closeAdd">
       <Production :data="tableData" ref="ProductionCom" />
       <template v-slot:footer>
         <el-button @click="closeAdd">取消</el-button>
@@ -90,276 +54,266 @@
       </template>
     </ele-modal>
     <!-- 编辑弹窗 -->
-    <user-edit
-      :visible.sync="showEdit"
-      :controlList="controlList"
-      :data="current"
-      @done="reload"
-      ref="userEdit"
-    />
+    <user-edit :visible.sync="showEdit" :controlList="controlList" :data="current" @done="reload" ref="userEdit" />
     <!-- 配置工艺参数 -->
-    <user-setting
-      :visible.sync="showSetting"
-      :data="current"
-      ref="userSetting"
-    />
+    <user-setting :visible.sync="showSetting" :data="current" ref="userSetting" />
   </ele-modal>
 </template>
 
 <script>
-  import route from '@/api/technology/route';
-  import Production from './production';
-  import UserEdit from './production/components/user-edit.vue';
-  import UserSetting from './production/components/user-setting.vue';
-  import control from '@/api/technology/control';
-  export default {
-    components: { Production, UserEdit, UserSetting },
-    props: {
-      // 弹窗是否打开
-      visible: Boolean,
-      // 修改回显的数据
-      data: Object
-    },
-    data() {
-      return {
-        timeType: [
-          { value: 1, label: '是' },
-          { value: 0, label: '否' }
-        ],
-        // 表格列配置
-        columns: [
-          {
-            prop: 'code',
-            label: '工序编码',
-            // sortable: 'custom',
-            showOverflowTooltip: true,
-            align: 'center',
+import route from '@/api/technology/route';
+import Production from './production';
+import UserEdit from './production/components/user-edit.vue';
+import UserSetting from './production/components/user-setting.vue';
+import control from '@/api/technology/control';
+export default {
+  components: { Production, UserEdit, UserSetting },
+  props: {
+    // 弹窗是否打开
+    visible: Boolean,
+    // 修改回显的数据
+    data: Object
+  },
+  data() {
+    return {
+      timeType: [
+        { value: 1, label: '是' },
+        { value: 0, label: '否' }
+      ],
+      // 表格列配置
+      columns: [
+        {
+          prop: 'code',
+          label: '工序编码',
+          // sortable: 'custom',
+          showOverflowTooltip: true,
+          align: 'center',
 
-            minWidth: 110
-          },
-          {
-            prop: 'name',
-            label: '工序名称',
-            showOverflowTooltip: true,
-            align: 'center',
-            minWidth: 110
-          },
-          {
-            align: 'center',
-            prop: 'controlName',
-            label: '工序控制码',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'workCenterName',
-            label: '所属工作中心',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
+          minWidth: 110
+        },
+        {
+          prop: 'name',
+          label: '工序名称',
+          showOverflowTooltip: true,
+          align: 'center',
+          minWidth: 110
+        },
+        {
+          align: 'center',
+          prop: 'controlName',
+          label: '工序控制码',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'workCenterName',
+          label: '所属工作中心',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
 
-          {
-            columnKey: 'action',
-            label: '操作',
-            width: 260,
-            align: 'center',
-            resizable: false,
-            slot: 'action',
-            showOverflowTooltip: true
-          }
-        ],
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 260,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          showOverflowTooltip: true
+        }
+      ],
+
+      loading: false,
+      addDialog: false,
+      showSetting: false,
+      showEdit: false,
+      current: {},
+      removeList: [],
+      tableData: [],
+      controlList: []
+    };
+  },
 
-        loading: false,
-        addDialog: false,
-        showSetting: false,
-        showEdit: false,
-        current: {},
-        removeList: [],
-        tableData: [],
-        controlList:[]
-      };
+  methods: {
+    addParamrter() {
+      // console.log(this.$refs.ProductionCom?.selection);
+      let arr = this.$refs.ProductionCom.selection;
+
+      let arrM = arr.map((item, index) => {
+        return { ...item.detail };
+      });
+      arrM.forEach((element) => {
+        if (element.id) {
+          this.$set(element, 'sourceTaskId', element.id);
+          delete element.id;
+        }
+      });
+
+      this.$refs.table.setData([...arrM, ...this.$refs.table.getData()]);
+      this.closeAdd();
+    },
+    showAddLog() {
+      this.tableData = this.$refs.table.getData();
+      this.addDialog = true;
+      // this.$nextTick(() => {
+      //   this.$refs.ProductionCom.reload();
+      // });
+    },
+    /* 打开编辑弹窗 */
+    openEdit(row) {
+      this.getControlList()
+      this.current = row;
+      this.showEdit = true;
+      this.$refs.userEdit.$refs.form &&
+        this.$refs.userEdit.$refs.form.clearValidate();
     },
 
-    methods: {
-      addParamrter() {
-        // console.log(this.$refs.ProductionCom?.selection);
-        let arr = this.$refs.ProductionCom.selection;
+    getControlList() {
+      const params = {
+        pageNum: 1, size: -1
+      }
+      control.list().then(res => {
+        this.controlList = res.list
+      })
+    },
+    /*配置工艺参数 */
+    openSetting(row) {
+      if (!row.id) {
+        this.$message.warning('新增的数据需要保存之后才能配置工艺参数');
+        return;
+      }
+      this.current = row;
+      this.showSetting = true;
+    },
 
-        let arrM = arr.map((item, index) => {
-          return { ...item.detail };
+    /*关闭选择参数*/
+    closeAdd() {
+      this.$refs.ProductionCom.$refs.table.setSelectedRows([]);
+      this.addDialog = false;
+    },
+    /* 刷新表格 */
+    reload() {
+      this.$refs.table.reload();
+    },
+    remove(row) {
+      if (row.id) {
+        route.taskinstanceDelete([row.id]).then(() => {
+          this.$message.success('删除成功');
+          this.reload();
         });
-        arrM.forEach((element) => {
-          if (element.id) {
-            this.$set(element, 'sourceTaskId', element.id);
-            delete element.id;
-          }
+      } else {
+        const data = this.$refs.table.getData() ?? [];
+        console.log(data);
+        this.$refs.table.setData(data.filter((d) => d.code !== row.code));
+      }
+    },
+    /* 表格数据源 */
+    async datasource({ page, limit, where }) {
+      if (this.data?.id) {
+        console.log(22222);
+        const res = await route.taskinstanceList({
+          routingId: this.data.id,
+          isDetail: true,
+          pageNum: 1,
+          size: -1
         });
-
-        this.$refs.table.setData([...arrM, ...this.$refs.table.getData()]);
-        this.closeAdd();
-      },
-      showAddLog() {
-        this.tableData = this.$refs.table.getData();
-        this.addDialog = true;
-        // this.$nextTick(() => {
-        //   this.$refs.ProductionCom.reload();
-        // });
-      },
-      /* 打开编辑弹窗 */
-      openEdit(row) {
-        this.getControlList()
-        this.current = row;
-        this.showEdit = true;
-        this.$refs.userEdit.$refs.form &&
-          this.$refs.userEdit.$refs.form.clearValidate();
-      },
-      
-      getControlList(){
-         const params = {
-           pageNum: 1, size: -1
-         }
-         control.list().then(res=>{
-            this.controlList = res.list
-         })
-      },
-      /*配置工艺参数 */
-      openSetting(row) {
-        if (!row.id) {
-          this.$message.warning('新增的数据需要保存之后才能配置工艺参数');
-          return;
+        let arr = res.list.map((it) => it.detail);
+        return {
+          list: arr,
+          count: res.count
+        };
+      }
+    },
+    /* 保存编辑 */
+    save(isClose) {
+      let arr = this.$refs.table.getData();
+      if (arr.length == 0) {
+        this.$message.warning('至少配置一条工序才能保存');
+        return;
+      }
+      let arr1 = arr.map((it, i) => {
+        if (it.orderNum) {
+          delete it.orderNum;
         }
-        this.current = row;
-        this.showSetting = true;
-      },
+        return {
+          ...it,
+          orderNum: i + 1
+        };
+      });
 
-      /*关闭选择参数*/
-      closeAdd() {
-        this.$refs.ProductionCom.$refs.table.setSelectedRows([]);
-        this.addDialog = false;
-      },
-      /* 刷新表格 */
-      reload() {
-        this.$refs.table.reload();
-      },
-      remove(row) {
-        if (row.id) {
-          route.taskinstanceDelete([row.id]).then(() => {
-            this.$message.success('删除成功');
-            this.reload();
-          });
-        } else {
-          const data = this.$refs.table.getData() ?? [];
-          console.log(data);
-          this.$refs.table.setData(data.filter((d) => d.code !== row.code));
-        }
-      },
-      /* 表格数据源 */
-      async datasource({ page, limit, where }) {
-        if (this.data?.id) {
-          console.log(22222);
-          const res = await route.taskinstanceList({
-            routingId: this.data.id,
-            isDetail: true,
-            pageNum: 1,
-            size: -1
-          });
-          let arr = res.list.map((it) => it.detail);
-          return {
-            list: arr,
-            count: res.count
-          };
-        }
-      },
-      /* 保存编辑 */
-      save(isClose) {
-        let arr = this.$refs.table.getData();
-        if (arr.length == 0) {
-          this.$message.warning('至少配置一条工序才能保存');
-          return;
-        }
-        let arr1 = arr.map((it, i) => {
-          if (it.orderNum) {
-            delete it.orderNum;
+      route
+        .taskinstanceSave({
+          routingId: this.data.id,
+          taskInstanceList: arr1
+        })
+        .then((res) => {
+          if (res) {
+            this.$message.success('保存成功!');
+            if (isClose) {
+              this.updateVisible(false);
+            } else {
+              this.reload();
+            }
           }
-          return {
-            ...it,
-            orderNum: i + 1
-          };
         });
+      // arr.forEach((it) => {
+      //   if (!it.taskId) {
+      //     this.$set(it, 'taskId', this.data.id);
+      //   }
+      // });
+      // producetask
+      //   .paramSave({
+      //     removeList: this.removeList,
+      //     saveList: arr
+      //   })
+      //   .then(() => {
+      //     this.$message.success('保存成功!');
+      //     this.updateVisible(false);
+      //   });
 
-        route
-          .taskinstanceSave({
-            routingId: this.data.id,
-            taskInstanceList: arr1
-          })
-          .then((res) => {
-            if (res) {
-              this.$message.success('保存成功!');
-              if (isClose) {
-                this.updateVisible(false);
-              } else {
-                this.reload();
-              }
-            }
-          });
-        // arr.forEach((it) => {
-        //   if (!it.taskId) {
-        //     this.$set(it, 'taskId', this.data.id);
-        //   }
-        // });
-        // producetask
-        //   .paramSave({
-        //     removeList: this.removeList,
-        //     saveList: arr
-        //   })
-        //   .then(() => {
-        //     this.$message.success('保存成功!');
-        //     this.updateVisible(false);
-        //   });
-
-        // this.$refs.form.validate((valid) => {
-        //   if (!valid) {
-        //     return false;
-        //   }
-        //   if (!this.isUpdate) {
-        //     delete this.form.id;
-        //   }
+      // this.$refs.form.validate((valid) => {
+      //   if (!valid) {
+      //     return false;
+      //   }
+      //   if (!this.isUpdate) {
+      //     delete this.form.id;
+      //   }
 
-        //   this.form.workBeat.beatTimes = this.totalTime;
+      //   this.form.workBeat.beatTimes = this.totalTime;
 
-        //   this.loading = true;
-        //   producetask
-        //     .save(this.form)
-        //     .then((msg) => {
-        //       this.form = {};
-        //       this.loading = false;
-        //       this.$message.success(msg);
-        //       this.updateVisible(false);
-        //       this.$emit('done');
-        //     })
-        //     .catch((e) => {
-        //       this.loading = false;
-        //       // this.$message.error(e.message);
-        //     });
-        // });
-      },
-      /* 更新visible */
-      updateVisible(value) {
-        this.removeList = [];
-        this.$refs.table.setData([]);
-        this.$emit('update:visible', value);
-      }
+      //   this.loading = true;
+      //   producetask
+      //     .save(this.form)
+      //     .then((msg) => {
+      //       this.form = {};
+      //       this.loading = false;
+      //       this.$message.success(msg);
+      //       this.updateVisible(false);
+      //       this.$emit('done');
+      //     })
+      //     .catch((e) => {
+      //       this.loading = false;
+      //       // this.$message.error(e.message);
+      //     });
+      // });
     },
+    /* 更新visible */
+    updateVisible(value) {
+      this.removeList = [];
+      this.$refs.table.setData([]);
+      this.$emit('update:visible', value);
+    }
+  },
 
-    watch: {
-      visible(visible) {
-        if (visible) {
-          this.$nextTick(() => {
-            this.reload();
-          });
-        }
+  watch: {
+    visible(visible) {
+      if (visible) {
+        this.$nextTick(() => {
+          this.reload();
+        });
       }
     }
-  };
+  }
+};
 </script>

+ 98 - 0
src/views/technology/version/components/route-search.vue

@@ -0,0 +1,98 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="120px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row>
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 4 }">
+        <el-form-item label="工艺路线组编码:">
+          <el-input clearable v-model="where.code" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 4 }">
+        <el-form-item label="工艺路线名称:">
+          <el-input clearable v-model="where.name" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+<!--      <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 4 }">
+        <el-form-item label="生产版本:">
+          <el-input
+            clearable
+            disabled
+            v-model="where.version"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col> -->
+      <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 4 }">
+        <el-form-item label="状态:" label-width="70px">
+          <el-select v-model="where.status" filterable placeholder="请选择">
+            <el-option
+              v-for="item in statusList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
+        <el-form-item label-width="20px">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+          >
+            查询
+          </el-button>
+          <el-button @click="reset">重置</el-button>
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  export default {
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        code: '',
+        name: '',
+        status: ''
+      };
+      return {
+        // 表单数据
+        where: { ...defaultWhere },
+        statusList: [
+          { label: '草稿', value: -1 },
+          { label: '失效', value: 0 },
+          { label: '生效', value: 1 }
+        ]
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      /* 搜索 */
+      search() {
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere }
+        this.search();
+      }
+    }
+  };
+</script>

+ 198 - 0
src/views/technology/version/components/routeModal.vue

@@ -0,0 +1,198 @@
+<template>
+    <el-dialog title="选择工艺路线" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false"
+        :close-on-press-escape="false" append-to-body width="80%">
+        <el-card shadow="never">
+            <routetSearch @search="reload" />
+
+
+            <!-- 表格 -->
+
+            <ele-pro-table ref="table" :columns="columns" :datasource="datasource" height="calc(100vh - 350px)"
+                :need-page="false" class="dict-table" @cell-click="cellClick">
+
+                <!-- 状态列 -->
+                <template v-slot:status="{ row }">
+                    {{ checkStatus(row) }}
+                </template>
+                <!-- 表头工具栏 -->
+                <template v-slot:action="{ row }">
+                    <el-radio class="radio" v-model="radio" :label="row.id"><i></i></el-radio>
+                </template>
+            </ele-pro-table>
+
+
+        </el-card>
+        <div class="btns">
+            <el-button type="primary" size="small" @click="selected">选择</el-button>
+            <el-button size="small" @click="handleClose">关闭</el-button>
+        </div>
+    </el-dialog>
+</template>
+  
+<script>
+import AssetTree from '@/components/AssetTree';
+import routetSearch from './route-search.vue'
+import route from '@/api/technology/route';
+export default {
+    components: { AssetTree, routetSearch },
+    data() {
+        return {
+            visible: false,
+            // 表格列配置
+            columns: [
+
+                {
+                    prop: 'code',
+                    label: '工艺路线组编码',
+                    showOverflowTooltip: true,
+                    align: 'center',
+
+                    minWidth: 110
+                },
+                {
+                    prop: 'name',
+                    label: '工艺路线名称',
+                    showOverflowTooltip: true,
+                    align: 'center',
+                    minWidth: 110
+                },
+                {
+                    align: 'center',
+                    prop: 'categoryCode',
+                    label: '产品编码',
+                    showOverflowTooltip: true,
+                    minWidth: 110
+                },
+                {
+                    prop: 'categoryName',
+                    label: '产品名称',
+                    align: 'center',
+                    showOverflowTooltip: true,
+                    minWidth: 110
+                },
+                {
+                    prop: 'version',
+                    label: '工艺路线版本',
+                    align: 'center',
+                    showOverflowTooltip: true,
+                    minWidth: 110
+                },
+                {
+                    prop: 'status',
+                    label: '状态',
+                    align: 'center',
+                    slot: 'status',
+                    showOverflowTooltip: true,
+                    minWidth: 110
+                },
+
+                {
+                    action: 'action',
+                    slot: 'action',
+                    align: 'center',
+                    label: '选择'
+                }
+
+
+            ],
+            categoryLevelId: '9',
+            radio: null,
+
+            statusList: [
+                { label: '草稿', value: -1 },
+                { label: '失效', value: 0 },
+                { label: '生效', value: 1 }
+            ],
+        }
+    },
+
+    watch: {
+
+    },
+    methods: {
+        /* 表格数据源 */
+        async datasource({ page, limit, where, order }) {
+            const res = await route.list({
+                ...where,
+                ...order,
+                pageNum: page,
+                size: limit
+            });
+            return res;
+        },
+
+
+        checkStatus(row) {
+            let obj = this.statusList.find((it) => it.value == row.status);
+            return obj.label;
+        },
+        /* 刷新表格 */
+        reload() {
+            this.$refs.table.reload();
+        },
+        open(item) {
+            if (item) {
+                this.current = {
+                    id: item.routingId,
+                    name: item.routingName,
+                    code: item.routingCode
+                }
+                this.radio = item.routingId
+            }
+            this.visible = true
+        },
+
+        // 单击获取id
+        cellClick(row) {
+            this.current = row
+            this.radio = row.id
+        },
+        handleClose() {
+            this.visible = false
+            this.current = null
+            this.radio = ''
+        },
+        selected() {
+            console.log(this.current)
+            if (!this.current) {
+                return this.$message.warning('请选择工艺路线')
+            }
+            this.$emit('changeRoute', this.current)
+            this.handleClose()
+        },
+    }
+}
+</script>
+  
+<style lang="scss" scoped>
+.tree_col {
+    border: 1px solid #eee;
+    padding: 10px 0;
+    box-sizing: border-box;
+    height: 500px;
+    overflow: auto;
+}
+
+.table_col {
+    padding-left: 10px;
+
+    ::v-deep .el-table th.el-table__cell {
+        background: #f2f2f2;
+    }
+}
+
+.pagination {
+    text-align: right;
+    padding: 10px 0;
+}
+
+.btns {
+    text-align: center;
+    padding: 10px 0;
+}
+
+.topsearch {
+    margin-bottom: 15px;
+}
+</style>
+  

+ 36 - 7
src/views/technology/version/components/user-edit.vue

@@ -44,13 +44,25 @@
 
       <el-row>
         <el-col :span="8">
-          <el-form-item label="工艺路线版本:" prop="version">
-            <el-input  v-model="form.version" />
+          <el-form-item label="工艺路线编码:" prop="routingCode">
+            <el-input v-model="form.routingCode" @click.native="chooseRoute" />
           </el-form-item>
         </el-col>
+   
+
         <el-col :span="8">
+          <el-form-item label="工艺路线名称:" prop="routingName">
+            <el-input placeholder="自动带入" disabled v-model="form.routingName" />
+          </el-form-item>
+        </el-col>
+
 
+        <el-col :span="8">
+          <el-form-item label="工艺路线版本:" prop="routingVersion">
+            <el-input placeholder="自动带入" disabled v-model="form.routingVersion" />
+          </el-form-item>
         </el-col>
+
       </el-row>
 
     </el-form>
@@ -63,17 +75,21 @@
 
     <!-- 选择产品弹窗 -->
     <ProductModal ref="productRefs" @changeProduct='determineChoose' />
+    <!-- 选择工艺路线 -->
+    <routeModal ref="routeRefs" @changeRoute='changeRoute'></routeModal>
   </ele-modal>
 </template>
 
 <script>
 import ProductModal from '@/views/technology/route/components/ProductModal.vue';
+import routeModal from './routeModal.vue'
 import route from '@/api/technology/route';
 import { addUsers, putUsers } from '@/api/system/user';
 
 export default {
   components: {
-    ProductModal
+    ProductModal,
+    routeModal
   },
   props: {
     // 弹窗是否打开
@@ -88,10 +104,11 @@ export default {
       factoryId: '',
 
       categoryId: '',
-      version: '',
       id: '',
       categoryCode: '',
-      categoryName: ''
+      categoryName: '',
+
+      routingId: ''
     };
     return {
       defaultForm,
@@ -121,8 +138,8 @@ export default {
           { required: true, message: '请选择产品名称', trigger: 'change' }
         ],
 
-        version: [
-          { required: true, message: '请输入工艺路线版本', trigger: 'blur' }
+        routingId: [
+          { required: true, message: '请输入工艺路线编码', trigger: 'blur' }
         ]
       },
       // 提交状态
@@ -149,6 +166,18 @@ export default {
       this.$set(this.form, 'categoryId', row.id)
       this.$set(this.form, 'categoryCode', row.code)
     },
+
+    changeRoute(row) {
+      this.$set(this.form, 'routingName', row.name)
+      this.$set(this.form, 'routingId', row.id)
+      this.$set(this.form, 'routingCode', row.code)
+      this.$set(this.form, 'routingVersion', row.version)
+      
+    },
+
+    chooseRoute() {
+      this.$refs.routeRefs.open(this.form)
+    },
     /* 保存编辑 */
     save() {
       this.$refs.form.validate((valid) => {