Browse Source

修改bug

695593266@qq.com 6 days ago
parent
commit
b74d25cf5f

+ 10 - 1
src/views/factoryModel/station/components/edit.vue

@@ -16,7 +16,7 @@
         header="基本信息"
         body-style="padding: 22px 22px 0 22px;"
       >
-        <el-row>
+        <el-row class="station-base-grid">
           <el-col :span="8">
             <el-form-item label="工位编码:" prop="code">
               <el-input
@@ -1039,6 +1039,15 @@
     }
   }
 
+  .station-base-grid {
+    display: flex;
+    flex-wrap: wrap;
+
+    > .el-col {
+      float: none;
+    }
+  }
+
   :deep(
       .el-dialog:not(.ele-dialog-form)
         .el-dialog__body

+ 44 - 5
src/views/material/BOMmanage/components/routingDialog.vue

@@ -55,6 +55,24 @@
                 </el-select>
               </el-form-item>
             </el-col>
+            <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
+              <el-form-item label="所属工厂:">
+                <el-select
+                  v-model.trim="where.factoriesId"
+                  clearable
+                  placeholder="请选择"
+                  :style="{ width: '100%' }"
+                >
+                  <el-option
+                    v-for="item in options_factory"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
             <!-- <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
               <el-form-item label="状态:" label-width="70px">
                 <el-select
@@ -110,7 +128,7 @@
           </template>
 
           <template v-slot:routeType="{ row }">
-           {{ row.routeType == 2 ? '委外' :  row.routeType == 1 ? '生产' :   row.routeType == 3 ? '质检' : ''}} 
+           {{ row.routeType == 2 ? '委外' :  row.routeType == 1 ? '生产' :   row.routeType == 3 ? '质检' : ''}}
           </template>
         </ele-pro-table>
       </el-card>
@@ -135,6 +153,7 @@
     workingProcedureSave
   } from '@/api/material/BOM';
   import { pageList } from '@/api/technology/version/version.js';
+  import { getFactoryarea } from '@/api/factoryModel';
   import UserDetail from './user-detail.vue';
   import route from '@/api/technology/route';
   export default {
@@ -147,7 +166,13 @@
         visible: false,
         selection: [],
         versionList: [],
-        where: {},
+        where: {
+          code: '',
+          name: '',
+          produceVersionId: '',
+          factoriesId: ''
+        },
+        options_factory: [],
         // 表格列配置
         columns: [
           {
@@ -240,10 +265,16 @@
     },
     created() {
       this.getVersionList();
+      this.getFactoryarea();
     },
     methods: {
       reset() {
-        this.where = {};
+        this.where = {
+          code: '',
+          name: '',
+          produceVersionId: '',
+          factoriesId: ''
+        };
         this.search();
       },
       handleClose() {
@@ -264,7 +295,7 @@
           this.tableData['processRoute'] = { list: [] }
         }
         this.visible = true;
-       
+
       },
       selected() {
         let routingId = this.selection.map((it) => it.id);
@@ -285,7 +316,7 @@
                 newArr.push(data[i]);
               }
             }
-          
+
             workingProcedureUpdate({
               id: this.tableData.id,
               categoryId: this.treeData.categoryId,
@@ -336,6 +367,14 @@
 
         this.versionList = res.list;
       },
+      getFactoryarea() {
+        getFactoryarea({
+          type: 1,
+          size: 9999
+        }).then((res) => {
+          this.options_factory = res.list;
+        });
+      },
       search() {
         this.reload(this.where);
       },

+ 15 - 4
src/views/technology/production/components/user-edit.vue

@@ -6,12 +6,18 @@
     :append-to-body="true"
     :close-on-click-modal="false"
     custom-class="ele-dialog-form"
-    :title="isUpdate ? '修改工序' : '添加工序'"
+    :title="detail ? '工序详情' : isUpdate ? '修改工序' : '添加工序'"
     @update:visible="updateVisible"
     :maxable="true"
   >
     <header-title title="基本信息"></header-title>
-    <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+    <el-form
+      ref="form"
+      :model="form"
+      :rules="rules"
+      label-width="120px"
+      :disabled="detail"
+    >
       <el-row>
         <el-col :span="8">
           <el-form-item label="工序编码:">
@@ -578,7 +584,7 @@
 
     <template v-slot:footer>
       <el-button @click="updateVisible(false)">取消</el-button>
-      <el-button type="primary" :loading="loading" @click="save">
+      <el-button v-if="!detail" type="primary" :loading="loading" @click="save">
         保存
       </el-button>
     </template>
@@ -605,7 +611,8 @@
       // 修改回显的数据
       data: Object,
       controlList: Array,
-      typeList: Array
+      typeList: Array,
+      detail: Boolean
     },
     data() {
       const defaultForm = function () {
@@ -646,6 +653,7 @@
           isFinalCheckProduction: '',
           isFirstArticleDualInspection: '',
           needNCCode: '',
+          isRelease: 0,
           sort: null,
           intervalTime: {
             nextShortPreTime: '', // 时间单位转换后的下一个短周期的时间,格式为YYYY-MM-DDTHH'
@@ -763,6 +771,9 @@
         this.versionList = res.list;
       },
       chooseWorkCenter() {
+        if (this.detail) {
+          return;
+        }
         this.$refs.centerRefs.open(this.form);
       },
       determineChoose(row) {

+ 83 - 15
src/views/technology/production/index.vue

@@ -92,7 +92,15 @@
             {{ row.name }}
           </el-link>
           <span v-else> {{ row.name }}</span> -->
-          {{ row.name }}
+          <el-link type="primary" :underline="false" @click="openDetail(row)">
+            {{ row.name }}
+          </el-link>
+        </template>
+
+        <template v-slot:code="{ row }">
+          <el-link type="primary" :underline="false" @click="openDetail(row)">
+            {{ row.code }}
+          </el-link>
         </template>
         <!-- 状态列 -->
 
@@ -102,8 +110,13 @@
 
         <template v-slot:processLabel="{ row }">
           <el-tag v-if="row.processLabel == 1">自制</el-tag>
-          <el-tag v-if="row.processLabel == 2">委外</el-tag>
-          <el-tag v-if="row.processLabel == 3">请托</el-tag>
+          <el-tag v-if="row.processLabel == 2" type="success">委外</el-tag>
+          <el-tag v-if="row.processLabel == 3" type="warning">请托</el-tag>
+        </template>
+
+        <template v-slot:isRelease="{ row }">
+          <el-tag v-if="row.isRelease == 1" type="success">已发布</el-tag>
+          <el-tag v-else type="info">未发布</el-tag>
         </template>
 
         <!-- 操作列 -->
@@ -111,9 +124,10 @@
           <el-link
             type="primary"
             :underline="false"
-            icon="el-icon-edit"
             @click="openEdit(row)"
-            v-if="$hasPermission('main:producetask:update')"
+            v-if="
+              $hasPermission('main:producetask:update') && row.isRelease != 1
+            "
           >
             修改
           </el-link>
@@ -130,24 +144,39 @@
             class="ele-action"
             title="确定要删除当前工序吗?"
             @confirm="remove(row)"
-            v-if="$hasPermission('main:producetask:delete')"
+            v-if="
+              $hasPermission('main:producetask:delete') && row.isRelease != 1
+            "
           >
             <template v-slot:reference>
-              <el-link type="danger" :underline="false" icon="el-icon-delete">
-                删除
-              </el-link>
+              <el-link type="danger" :underline="false"> 删除 </el-link>
             </template>
           </el-popconfirm>
 
           <el-link
             type="primary"
             :underline="false"
-            icon="el-icon-setting"
             @click="openSettingMatterProcess(row)"
-            v-if="$hasPermission('main:produce_task:config_item')"
+            v-if="
+              $hasPermission('main:produce_task:config_item') &&
+              row.isRelease != 1
+            "
           >
             配置
           </el-link>
+
+          <el-popconfirm
+            class="ele-action"
+            title="确定要发布当前工序吗?"
+            @confirm="release(row)"
+            v-if="
+              $hasPermission('main:producetask:update') && row.isRelease != 1
+            "
+          >
+            <template v-slot:reference>
+              <el-link type="primary" :underline="false"> 发布 </el-link>
+            </template>
+          </el-popconfirm>
         </template>
       </ele-pro-table>
     </el-card>
@@ -160,6 +189,7 @@
       @done="reload"
       ref="userEdit"
       :typeList="typeList"
+      :detail="showDetail"
     />
 
     <!-- 配置工艺参数 -->
@@ -244,10 +274,12 @@
           {
             prop: 'sort',
             label: '排序',
-            align: 'center'
+            align: 'center',
+            minWidth: 40
           },
           {
             prop: 'code',
+            slot: 'code',
             label: '工序编码',
             // sortable: 'custom',
             showOverflowTooltip: true,
@@ -283,7 +315,15 @@
             slot: 'processLabel',
             label: '工序标签',
             showOverflowTooltip: true,
-            minWidth: 110
+            minWidth: 100
+          },
+          {
+            align: 'center',
+            prop: 'isRelease',
+            slot: 'isRelease',
+            label: '是否发布',
+            showOverflowTooltip: true,
+            minWidth: 100
           },
           {
             align: 'center',
@@ -291,7 +331,7 @@
             slot: 'version',
             label: '版本',
             showOverflowTooltip: true,
-            minWidth: 110
+            minWidth: 80
           },
           {
             align: 'center',
@@ -330,6 +370,7 @@
         current: null,
         // 是否显示编辑弹窗
         showEdit: false,
+        showDetail: false,
         // 是否显示参数弹窗
         showSetting: false,
         controlList: [],
@@ -501,6 +542,10 @@
           this.$message.error('请至少选择一条数据');
           return;
         }
+        if (this.selection.some((item) => item.isRelease == 1)) {
+          this.$message.warning('已发布的工序不能批量设置工作中心');
+          return;
+        }
         this.$refs.centerRefs.open(this.selection[0]);
       },
 
@@ -509,13 +554,32 @@
         this.$refs.table.reload({ page: 1, where: where });
       },
       /* 打开编辑弹窗 */
-      openEdit(row) {
+      openEdit(row, detail = false) {
         this.getControlList();
         this.current = row;
+        this.showDetail = detail;
         this.showEdit = true;
         this.$refs.userEdit.$refs.form &&
           this.$refs.userEdit.$refs.form.clearValidate();
       },
+      openDetail(row) {
+        this.openEdit(row, true);
+      },
+
+      async release(row) {
+        const loading = this.$loading({ lock: true });
+        try {
+          const detail = await producetask.getById(row.id);
+          await producetask.save({
+            ...detail,
+            isRelease: 1
+          });
+          this.$message.success('发布成功');
+          this.reload();
+        } finally {
+          loading.close();
+        }
+      },
 
       determineChoose(row) {
         if (row) {
@@ -612,6 +676,10 @@
           this.$message.error('请至少选择一条数据');
           return;
         }
+        if (this.selection.some((item) => item.isRelease == 1)) {
+          this.$message.warning('已发布的工序不能删除');
+          return;
+        }
         this.$confirm('确定要删除选中的工序吗?', '提示', {
           type: 'warning'
         })

+ 13 - 1
src/views/technology/route/components/production/index.vue

@@ -14,7 +14,11 @@
         row-key="id"
       >
         <!-- 状态列 -->
-
+        <template v-slot:processLabel="{ row }">
+          <el-tag v-if="row.processLabel == 1">自制</el-tag>
+          <el-tag v-if="row.processLabel == 2" type="success">委外</el-tag>
+          <el-tag v-if="row.processLabel == 3" type="warning">请托</el-tag>
+        </template>
         <!-- 操作列 -->
       </ele-pro-table>
     </el-card>
@@ -105,6 +109,14 @@
             showOverflowTooltip: true,
             minWidth: 110
           },
+          {
+            align: 'center',
+            prop: 'processLabel',
+            slot: 'processLabel',
+            label: '工序标签',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
           {
             prop: 'workCenterName',
             label: '所属工作中心',

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

@@ -36,6 +36,12 @@
           <el-input v-model="row.orderNum" placeholder="请输入排序"></el-input>
         </template>
 
+        <template v-slot:processLabel="{ row }">
+          <el-tag v-if="row.processLabel == 1">自制</el-tag>
+          <el-tag v-if="row.processLabel == 2" type="success">委外</el-tag>
+          <el-tag v-if="row.processLabel == 3" type="warning">请托</el-tag>
+        </template>
+
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
           <el-link
@@ -162,6 +168,14 @@
             showOverflowTooltip: true,
             minWidth: 110
           },
+          {
+            align: 'center',
+            prop: 'processLabel',
+            slot: 'processLabel',
+            label: '工序标签',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
           {
             prop: 'workCenterName',
             label: '所属工作中心',
@@ -228,7 +242,7 @@
           {
             value: 6,
             label: '质检工序'
-          },
+          }
           // {
           //   value: 7,
           //   label: '生产准备'

+ 2 - 1
src/views/technology/version/components/user-search.vue

@@ -1,7 +1,7 @@
 <!-- 搜索表单 -->
 <template>
   <el-form
-    label-width="80px"
+    label-width="120px"
     class="ele-form-search"
     @keyup.enter.native="search"
     @submit.native.prevent
@@ -70,6 +70,7 @@
         // categoryName: ''
       };
       return {
+        defaultWhere,
         // 表单数据
         where: { ...defaultWhere },
       };