ysy 2 gadi atpakaļ
vecāks
revīzija
5de6218f10

+ 11 - 1
src/api/material/list.js

@@ -84,8 +84,18 @@ export async function getBomRoutingList(categoryId) {
 // 产品工序与模具关联
 export async function categoryTaskPallet(data) {
   const res = await request.post(`/main/category/categoryTaskPallet`, data);
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+// 获取产品工序与模具关联
+export async function getCategoryTaskPallet(categoryId) {
+  const res = await request.get(`/main/category/getCategoryTaskPallet/${categoryId}`);
   if (res.data.code == 0) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
-}
+}

+ 3 - 3
src/views/factoryModel/station/components/edit.vue

@@ -45,7 +45,7 @@
           </el-col>
           <el-col :span="8">
             <el-form-item label="所属产线:" prop="productionLineId">
-              <el-select v-model="form.productionLineId" placeholder="请选择" style="width: 100%"
+              <el-select v-model="form.productionLineId"  placeholder="请选择" style="width: 100%"
                 @change="change_productionLineId">
                 <el-option v-for="item in options.productionLineId" :key="item.id" :label="item.name" :value="item.id">
                 </el-option>
@@ -54,7 +54,7 @@
           </el-col>
           <el-col :span="8">
             <el-form-item label="负责人部门:" prop="extInfo.principalDep">
-              <ele-tree-select clearable :data="options_groupId" v-model="form.extInfo.principalDep" valueKey="id"
+              <ele-tree-select clearable :data="options_groupId" filterable  v-model="form.extInfo.principalDep" valueKey="id"
                 labelKey="name" placeholder="请选择" @change="change_principalDep" default-expand-all />
             </el-form-item>
           </el-col>
@@ -68,7 +68,7 @@
           </el-col>
           <el-col :span="8">
             <el-form-item label="所属工作中心:" prop="extInfo.workCenterId">
-              <el-select v-model="form.extInfo.workCenterId" placeholder="请选择" style="width: 100%">
+              <el-select v-model="form.extInfo.workCenterId" filterable placeholder="请选择" style="width: 100%">
                 <el-option v-for="item in options.workCenterList" :key="item.id" :label="item.name" :value="item.id">
                 </el-option>
               </el-select>

+ 41 - 10
src/views/material/product/components/mouldDialog.vue

@@ -45,7 +45,7 @@
             <header-title title="工序">
             </header-title>
 
-            <ele-pro-table ref="table" :needPage="false" :columns="columns" :datasource="datasource" row-key="id">
+            <ele-pro-table ref="table" :needPage="false" :columns="columns" :datasource="datasource" row-key="produceTaskId">
 
                 <!-- 表头工具栏 -->
                 <template v-slot:toolbar>
@@ -111,7 +111,7 @@
 
 import processModal from '@/views/technology/productParam/components/processModal.vue'
 import ProductModal from '@/views/technology/productParam/components/ProductModal.vue'
-import { categoryTaskPallet } from '@/api/material/list'
+import { categoryTaskPallet, getCategoryTaskPallet } from '@/api/material/list'
 export default {
     components: {
         processModal,
@@ -248,10 +248,26 @@ export default {
         },
 
         openEdit() {
-            this.$refs.processRefs.open(this.$refs.table.getData())
+            let _arr = this.$refs.table.getData()
+            _arr.map((m) => {
+                m.id = m.produceTaskId
+                delete m.produceTaskId
+              return {
+                ...m,
+              } 
+            })
+            this.$refs.processRefs.open(_arr)
         },
 
         chooseProcess(data) {
+            data.map((m) => {
+                m['produceTaskId'] = m.id
+                delete m.id
+              return {
+                ...m,
+                
+              }
+            })
             this.$refs.table.setData([...data, ...this.$refs.table.getData()]);
         },
 
@@ -262,8 +278,8 @@ export default {
             let _arr = this.$refs.table.getData()
             _arr.splice(index, 1)
             this.$refs.table.setData(_arr)
-            if (row?.id) {
-                this.removeList.push(row.id)
+            if (row?.produceTaskId) {
+                this.removeList.push(row.produceTaskId)
             }
         },
 
@@ -296,6 +312,12 @@ export default {
 
         },
 
+      async  getCategoryTaskDetail() {
+         const res =   await getCategoryTaskPallet(this.categoryId)
+         this.$refs.table.setData(res);
+ 
+        },
+
 
         save() {
             let _arr = this.$refs.table.getData()
@@ -303,9 +325,16 @@ export default {
                 categoryId: this.categoryId,
                 taskList: _arr
             }
-            categoryTaskPallet(param).then((res) => {
-                console.log(res)
-            })
+            categoryTaskPallet(param).then((msg) => {
+            this.loading = false;
+            this.$message.success(msg);
+            this.visible = false;
+            this.$emit('done');
+          })
+          .catch((e) => {
+            this.loading = false;
+            this.$message.error(e.message);
+          });
         },
 
 
@@ -315,15 +344,17 @@ export default {
     watch: {
         async visible(visible) {
             if (visible) {
-
+              
                 if (this.data) {
-
                     this.categoryId = this.data.id
                     this.$util.assignObject(this.form, {
                         ...this.data
                     });
                 } else {
                 }
+
+                this.getCategoryTaskDetail()
+
             } else {
                 this.$refs.form.clearValidate();
                 this.form = { ...this.defaultForm };

+ 1 - 1
src/views/technology/productParam/components/ProductModal.vue

@@ -10,7 +10,7 @@
         </div>
         <!-- 表格 -->
         <template v-slot:content>
-          <ele-pro-table ref="table" :columns="columns" :datasource="datasource" height="calc(100vh - 350px)"
+          <ele-pro-table ref="table" :columns="columns" :datasource="datasource" row-key="id" height="calc(100vh - 350px)"
             class="dict-table" @cell-click="cellClick">
             <!-- 表头工具栏 -->
             <template v-slot:action="{ row }">

+ 147 - 156
src/views/technology/route/components/production/index.vue

@@ -4,188 +4,179 @@
       <!-- 搜索表单 -->
       <user-search @search="reload" />
       <!-- 数据表格 -->
-      <ele-pro-table
-        ref="table"
-        :columns="columns"
-        :datasource="datasource"
-        :selection.sync="selection"
-        row-key="id"
-      >
+
+      <ele-pro-table ref="table" :columns="columns" :datasource="datasource" :selection.sync="selection" row-key="id">
         <!-- 状态列 -->
 
         <!-- 操作列 -->
       </ele-pro-table>
     </el-card>
     <!-- 编辑弹窗 -->
-    <user-edit
-      :visible.sync="showEdit"
-      :data="current"
-      @done="reload"
-      ref="userEdit"
-    />
+    <user-edit :visible.sync="showEdit" :data="current" @done="reload" ref="userEdit" />
     <!-- 配置工艺参数 -->
-    <user-setting
-      :visible.sync="showSetting"
-      :data="current"
-      ref="userSetting"
-    />
+    <user-setting :visible.sync="showSetting" :data="current" ref="userSetting" />
   </div>
 </template>
 
 <script>
-  import UserSearch from './components/user-search.vue';
-  import UserEdit from './components/user-edit.vue';
-  import UserSetting from './components/user-setting.vue';
+import UserSearch from './components/user-search.vue';
+import UserEdit from './components/user-edit.vue';
+import UserSetting from './components/user-setting.vue';
 
-  import producetask from '@/api/technology/production';
+import producetask from '@/api/technology/production';
 
-  export default {
-    name: 'technologyProduction',
-    components: {
-      UserSearch,
-      UserEdit,
-      UserSetting
-    },
-    data() {
-      return {
-        // 表格列配置
-        columns: [
-          {
-            columnKey: 'selection',
-            type: 'selection',
-            width: 45,
-            align: 'center',
-            selectable: (row, index) => {
-              return !this.data.some((it) => it.code == row.code);
-              // return row.id < 3; // 这里是让 id < 3 的禁用,根据自己业务修改
-            },
-            reserveSelection: true,
-            fixed: 'left'
+export default {
+  name: 'technologyProduction',
+  components: {
+    UserSearch,
+    UserEdit,
+    UserSetting
+  },
+  props: {
+    tableData: {
+      type: Array
+    }
+  },
+  data() {
+    return {
+      // 表格列配置
+      columns: [
+        {
+          columnKey: 'selection',
+          type: 'selection',
+          width: 45,
+          align: 'center',
+          selectable: (row, index) => {
+            return !this.tableData.some((it) => it.sourceTaskId == row.id);
           },
 
-          {
-            prop: 'code',
-            label: '工序编码',
-            // sortable: 'custom',
-            showOverflowTooltip: true,
-            align: 'center',
+          reserveSelection: true,
+          fixed: 'left'
+        },
 
-            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
-          }
-        ],
-        // 表格选中数据
-        selection: [],
-        // 当前编辑数据
-        current: null,
-        // 是否显示编辑弹窗
-        showEdit: false,
-        // 是否显示参数弹窗
-        showSetting: false
-      };
+
+
+        {
+          prop: 'id',
+          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
+        }
+      ],
+      // 表格选中数据
+      selection: [],
+      // 当前编辑数据
+      current: null,
+      // 是否显示编辑弹窗
+      showEdit: false,
+      // 是否显示参数弹窗
+      showSetting: false
+    };
+  },
+
+  methods: {
+    /*配置工艺参数 */
+    openSetting(row) {
+      this.current = row;
+      this.showSetting = true;
     },
-    props: {
-      data: Array
+    /* 表格数据源 */
+    async datasource({ page, limit, where, order }) {
+      const res = await producetask.list({
+        ...where,
+        ...order,
+        pageNum: page,
+        isDetail: true,
+        size: limit
+      });
+      return res;
     },
-    methods: {
-      /*配置工艺参数 */
-      openSetting(row) {
-        this.current = row;
-        this.showSetting = true;
-      },
-      /* 表格数据源 */
-      async datasource({ page, limit, where, order }) {
-        const res = await producetask.list({
-          ...where,
-          ...order,
-          pageNum: page,
-          isDetail: true,
-          size: limit
-        });
-        return res;
-      },
 
-      /* 刷新表格 */
-      reload(where) {
-        this.$refs.table.reload({ page: 1, where: where });
-      },
-      /* 打开编辑弹窗 */
-      openEdit(row) {
-        this.current = row;
-        this.showEdit = true;
-        this.$refs.userEdit.$refs.form &&
-          this.$refs.userEdit.$refs.form.clearValidate();
-      },
+    /* 刷新表格 */
+    reload(where) {
+      this.$refs.table.reload({ page: 1, where: where });
+    },
+    /* 打开编辑弹窗 */
+    openEdit(row) {
+      this.current = row;
+      this.showEdit = true;
+      this.$refs.userEdit.$refs.form &&
+        this.$refs.userEdit.$refs.form.clearValidate();
+    },
 
-      /* 删除 */
-      remove(row) {
-        const loading = this.$loading({ lock: true });
+    /* 删除 */
+    remove(row) {
+      const loading = this.$loading({ lock: true });
 
-        producetask
-          .delete([row.id])
-          .then((msg) => {
-            loading.close();
-            this.$message.success('删除' + msg);
-            this.reload();
-          })
-          .catch((e) => {
-            loading.close();
-            // this.$message.error(e.message);
-          });
-      },
-      /* 批量删除 */
-      removeBatch() {
-        if (!this.selection.length) {
-          this.$message.error('请至少选择一条数据');
-          return;
-        }
-        this.$confirm('确定要删除选中的工序吗?', '提示', {
-          type: 'warning'
+      producetask
+        .delete([row.id])
+        .then((msg) => {
+          loading.close();
+          this.$message.success('删除' + msg);
+          this.reload();
         })
-          .then(() => {
-            const loading = this.$loading({ lock: true });
-            producetask
-              .delete(this.selection.map((d) => d.id))
-              .then((msg) => {
-                loading.close();
-                this.$message.success('删除' + msg);
-                this.reload();
-              })
-              .catch((e) => {
-                loading.close();
-                // this.$message.error(e.message);
-              });
-          })
-          .catch(() => {});
+        .catch((e) => {
+          loading.close();
+          // this.$message.error(e.message);
+        });
+    },
+    /* 批量删除 */
+    removeBatch() {
+      if (!this.selection.length) {
+        this.$message.error('请至少选择一条数据');
+        return;
       }
+      this.$confirm('确定要删除选中的工序吗?', '提示', {
+        type: 'warning'
+      })
+        .then(() => {
+          const loading = this.$loading({ lock: true });
+          producetask
+            .delete(this.selection.map((d) => d.id))
+            .then((msg) => {
+              loading.close();
+              this.$message.success('删除' + msg);
+              this.reload();
+            })
+            .catch((e) => {
+              loading.close();
+              // this.$message.error(e.message);
+            });
+        })
+        .catch(() => { });
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  :deep(.el-checkbox__input.is-disabled) {
-    .el-checkbox__inner {
-      background-color: rgba(142, 128, 128, 0.584) !important;
-    }
+:deep(.el-checkbox__input.is-disabled) {
+  .el-checkbox__inner {
+    background-color: rgba(142, 128, 128, 0.584) !important;
   }
+}
 </style>

+ 3 - 1
src/views/technology/route/components/user-taskinstance.vue

@@ -55,7 +55,7 @@
 
     <ele-modal width="1720px" :visible="addDialog" :append-to-body="true" :close-on-click-modal="true"
       @update:visible="closeAdd">
-      <Production :data="tableData" ref="ProductionCom" />
+      <Production :tableData="tableData" ref="ProductionCom" />
       <template v-slot:footer>
         <el-button @click="closeAdd">取消</el-button>
         <el-button type="primary" :loading="loading" @click="addParamrter">
@@ -93,6 +93,7 @@ export default {
       // 表格列配置
       columns: [
 
+
         {
           prop: 'orderNum',
           label: '排序',
@@ -177,6 +178,7 @@ export default {
     },
     showAddLog() {
       this.tableData = this.$refs.table.getData();
+      
       this.addDialog = true;
 
     },