lucw hace 8 meses
padre
commit
b634212c3c

+ 13 - 3
src/views/rulesManagement/releaseRules/components/permitAdd.vue

@@ -298,10 +298,20 @@
       </ele-pro-table>
     </el-form>
     <template v-slot:footer>
-      <el-button :loading="btnLoading" type="primary" @click="saveAndPublish">
+      <el-button
+        v-if="type != 'detail'"
+        :loading="btnLoading"
+        type="primary"
+        @click="saveAndPublish"
+      >
         保存并发布
       </el-button>
-      <el-button :loading="btnLoading" type="primary" @click="confirm">
+      <el-button
+        v-if="type != 'detail'"
+        :loading="btnLoading"
+        type="primary"
+        @click="confirm"
+      >
         保存
       </el-button>
       <el-button :loading="btnLoading" @click="handleClose">取消</el-button>
@@ -523,7 +533,7 @@
         this.type = type;
         console.log('type', type, row);
 
-        if (type == 'edit') {
+        if (type == 'edit' || type == 'detail') {
           this.$util.assignObject(this.formData, row);
 
           this.formData.startDate = new Date(row.startDate);

+ 11 - 1
src/views/rulesManagement/releaseRules/index.vue

@@ -83,6 +83,15 @@
             </template>
           </el-popconfirm>
         </template>
+
+        <template v-slot:code="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            @click="addPermit(row, 'detail', '记录规则详情')"
+            >{{ row.code }}</el-link
+          >
+        </template>
       </ele-pro-table>
     </el-card>
     <permitAdd ref="permitAddRef" @reload="reload" />
@@ -122,7 +131,8 @@
             label: '记录规则编码',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 110
+            minWidth: 110,
+            slot: 'code'
           },
           {
             prop: 'name',

+ 33 - 44
src/views/technology/production/components/user-setting-matter-add.vue

@@ -59,7 +59,7 @@
 
       <el-form-item v-if="formData.itemType == '3'" label="关联任务">
         <!-- 下拉选择 -->
-        <el-select
+        <!-- <el-select
           placeholder="请选择关联任务"
           filterable
           clearable
@@ -72,7 +72,12 @@
             :label="task.name"
             :value="task.id"
           />
-        </el-select>
+        </el-select> -->
+        <el-input
+          v-model="formData.itemTaskName"
+          placeholder="请输入任务名称"
+          size="small"
+        ></el-input>
       </el-form-item>
 
       <el-form-item
@@ -160,30 +165,34 @@
       selectReleaseRules
     },
     data() {
+      const formBaseData = {
+        id: null,
+        // 设备id
+        deviceId: null,
+        //设备名称
+        deviceName: '',
+        // 记录规则执行方式,参考字典项:record_rules_execute_method
+        executeMethod: '1',
+        // 记录规则事项类型,参考字典项:record_rules_item_type
+        itemType: '1',
+        // 工序ID
+        produceTaskId: null,
+        // 记录规则报工类型,参考字典项:record_rules_report_work_type
+        reportWorkType: null,
+        // 规则id,包括事项规则id,记录规则id,根据事项类型区分
+        rulesId: null,
+        // 	规则名称
+        rulesName: '',
+        // 任务id
+        taskId: null,
+        itemTaskName: ''
+      };
+
       return {
         visible: false,
         type: 'add', // add新增 edit编辑
-        formData: {
-          id: null,
-          // 设备id
-          deviceId: null,
-          //设备名称
-          deviceName: '',
-          // 记录规则执行方式,参考字典项:record_rules_execute_method
-          executeMethod: '1',
-          // 记录规则事项类型,参考字典项:record_rules_item_type
-          itemType: '1',
-          // 工序ID
-          produceTaskId: null,
-          // 记录规则报工类型,参考字典项:record_rules_report_work_type
-          reportWorkType: null,
-          // 规则id,包括事项规则id,记录规则id,根据事项类型区分
-          rulesId: null,
-          // 	规则名称
-          rulesName: '',
-          // 任务id
-          taskId: null
-        },
+        formBaseData,
+        formData: JSON.parse(JSON.stringify(formBaseData)),
         // 表单验证规则
         rules: {
           // 验证类型、执行方式、设备、关联事项规则
@@ -279,27 +288,7 @@
       // 关闭清空formData
       handleClose() {
         this.visible = false;
-        this.formData = {
-          id: null,
-          // 设备id
-          deviceId: null,
-          //设备名称
-          deviceName: '',
-          // 记录规则执行方式,参考字典项:record_rules_execute_method
-          executeMethod: '1',
-          // 记录规则事项类型,参考字典项:record_rules_item_type
-          itemType: '1',
-          // 工序ID
-          produceTaskId: null,
-          // 记录规则报工类型,参考字典项:record_rules_report_work_type
-          reportWorkType: null,
-          // 规则id,包括事项规则id,记录规则id,根据事项类型区分
-          rulesId: null,
-          // 	规则名称
-          rulesName: '',
-          // 任务id
-          taskId: null
-        };
+        this.formData = JSON.parse(JSON.stringify(this.formBaseData));
         this.$nextTick(() => {
           this.$refs.formRef.clearValidate();
         });

+ 6 - 0
src/views/technology/production/index.vue

@@ -452,6 +452,12 @@
 
       /* 删除 */
       remove(row) {
+        // 规则正在执行中,无法删除
+        // if () {
+        //   this.$message.error('规则正在执行中,无法删除');
+        //   return;
+        // }
+
         const loading = this.$loading({ lock: true });
 
         producetask