Sfoglia il codice sorgente

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into dev

yusheng 9 mesi fa
parent
commit
a97f9ec9d3

+ 11 - 0
src/components/Dict/DictSelection.vue

@@ -51,6 +51,11 @@
       ChinEng: {
         Boolean,
         default: false
+      },
+      // 数据筛选
+      listFormatte: {
+        type: Function,
+        default: null
       }
     },
     data() {
@@ -59,6 +64,12 @@
     computed: {
       ...mapGetters(['dict', 'getDict']),
       dictList() {
+        if (this.listFormatte) {
+          return this.listFormatte(
+            this.dict[dictEnum[this.dictName]] || [],
+            this.valueName
+          );
+        }
         return this.dict[dictEnum[this.dictName]] || [];
       },
       selectVal: {

+ 22 - 10
src/components/selectMatterRules/matter-search.vue

@@ -11,19 +11,14 @@
         <el-form-item label="规则名称:">
           <el-input clearable v-model.trim="where.name" placeholder="请输入" />
         </el-form-item>
-        <el-form-item label="规则状态:">
+        <!-- <el-form-item label="规则状态:">
           <DictSelection
             dictName="规则状态"
             clearable
             v-model.trim="where.status"
           >
           </DictSelection>
-        </el-form-item>
-      </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="规则编码:">
-          <el-input clearable v-model.trim="where.code" placeholder="请输入" />
-        </el-form-item>
+        </el-form-item> -->
         <el-form-item label="创建时间:">
           <el-date-picker
             style="width: 100%"
@@ -38,12 +33,18 @@
           </el-date-picker>
         </el-form-item>
       </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="规则编码:">
+          <el-input clearable v-model.trim="where.code" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="规则类型:">
           <DictSelection
             dictName="规则类型"
             clearable
             v-model.trim="where.type"
+            :listFormatte="listFormatte"
           >
           </DictSelection>
         </el-form-item>
@@ -52,13 +53,13 @@
         </el-form-item> -->
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="创建人:">
+        <!-- <el-form-item label="创建人:">
           <el-input
             clearable
             v-model.trim="where.userName"
             placeholder="请输入"
           />
-        </el-form-item>
+        </el-form-item> -->
         <div class="ele-form-actions">
           <el-button
             type="primary"
@@ -84,6 +85,14 @@
 
 <script>
   export default {
+    props: {
+      filterType: {
+        type: Array,
+        default: () => {
+          return [];
+        }
+      }
+    },
     data() {
       // 默认表单数据
       const defaultWhere = {
@@ -91,7 +100,7 @@
         code: '',
         userName: '',
         type: '',
-        status: '',
+        status: 1,
         startTime: '',
         endTime: ''
       };
@@ -110,6 +119,9 @@
     },
     created() {},
     methods: {
+      listFormatte(list, valueName) {
+        return list.filter((i) => ['1', '2', '5'].includes(i[valueName]));
+      },
       /* 搜索 */
       search() {
         const [startTime = '', endTime = ''] = this.time || [];

+ 16 - 45
src/components/selectMatterRules/select-matter-rules.vue

@@ -10,7 +10,7 @@
     width="90%"
   >
     <el-card shadow="never" v-loading="loading">
-      <matter-search @search="reload"> </matter-search>
+      <matter-search @search="reload" :filterType="filterType"> </matter-search>
       <!-- 数据表格 -->
       <ele-pro-table
         ref="table"
@@ -27,39 +27,6 @@
             {{ row.code }}
           </el-link>
         </template>
-        <!-- 操作列 -->
-        <template v-slot:action="{ row }">
-          <el-link
-            type="primary"
-            :underline="false"
-            icon="el-icon-finished"
-            @click="openEdit('clone', row)"
-            v-if="$hasPermission('main:ruleinfo:saveOrEdit')"
-          >
-            克隆
-          </el-link>
-          <el-link
-            type="primary"
-            :underline="false"
-            icon="el-icon-edit"
-            @click="openEdit('edit', row)"
-            v-if="$hasPermission('main:ruleinfo:saveOrEdit')"
-          >
-            修改
-          </el-link>
-          <el-popconfirm
-            class="ele-action"
-            title="确定要删除此条数据吗?"
-            @confirm="remove(row)"
-            v-if="$hasPermission('main:ruleinfo:delete')"
-          >
-            <template v-slot:reference>
-              <el-link type="danger" :underline="false" icon="el-icon-delete">
-                删除
-              </el-link>
-            </template>
-          </el-popconfirm>
-        </template>
       </ele-pro-table>
     </el-card>
     <template v-slot:footer>
@@ -79,6 +46,14 @@
   export default {
     mixins: [dictMixins, tabMixins],
     emits: ['chooseRules'],
+    props: {
+      filterType: {
+        type: Array,
+        default: () => {
+          return [];
+        }
+      }
+    },
     components: {
       MatterSearch
     },
@@ -163,15 +138,6 @@
             formatter: (_row, _column, cellValue) => {
               return this.$util.toDateString(cellValue);
             }
-          },
-          {
-            columnKey: 'action',
-            label: '操作',
-            width: 230,
-            align: 'center',
-            resizable: false,
-            slot: 'action',
-            showOverflowTooltip: true
           }
         ],
         // 加载状态
@@ -201,11 +167,16 @@
       },
       /* 表格数据源 */
       datasource({ page, limit, where }) {
-        return getList({ pageNum: page, size: limit, ...where });
+        return getList({
+          pageNum: page,
+          size: limit,
+          ...where,
+          types: this.filterType
+        });
       },
       /* 刷新表格 */
       reload(where) {
-        this.$refs.table.reload({ page: 1, where });
+        this.$refs.table.reload({ page: 1, where, types: this.filterType });
       },
 
       remove(row) {

+ 22 - 21
src/components/selectReleaseRules/search.vue

@@ -36,28 +36,29 @@
             type: 'select',
             placeholder: '记录表分类',
             planList: this.typeList
-          },
-          {
-            label: '状态:',
-            value: 'publishStatus',
-            type: 'select',
-            placeholder: '状态',
-            // 0-草稿,1-已发布,2-已撤销
-            planList: [
-              {
-                label: '草稿',
-                value: '0'
-              },
-              {
-                label: '已发布',
-                value: '1'
-              },
-              {
-                label: '已撤销',
-                value: '2'
-              }
-            ]
           }
+          //,
+          // {
+          //   label: '状态:',
+          //   value: 'publishStatus',
+          //   type: 'select',
+          //   placeholder: '状态',
+          //   // 0-草稿,1-已发布,2-已撤销
+          //   planList: [
+          //     {
+          //       label: '草稿',
+          //       value: '0'
+          //     },
+          //     {
+          //       label: '已发布',
+          //       value: '1'
+          //     },
+          //     {
+          //       label: '已撤销',
+          //       value: '2'
+          //     }
+          //   ]
+          // }
         ];
       }
     },

+ 16 - 2
src/components/selectReleaseRules/select-release-rules.vue

@@ -189,11 +189,25 @@
       },
       /* 表格数据源 */
       datasource({ page, limit, where }) {
-        return recordrulesPage({ pageNum: page, size: limit, ...where });
+        return recordrulesPage({
+          pageNum: page,
+          size: limit,
+          // 已发布
+          publishStatus: 1,
+          // 启用
+          enable: 1,
+          ...where
+        });
       },
       /* 刷新表格 */
       reload(where) {
-        this.$refs.tableRef?.reload({ page: 1, where });
+        this.$refs.tableRef?.reload({
+          page: 1, // 已发布
+          publishStatus: 1,
+          // 启用
+          enable: 1,
+          where
+        });
       },
       confirmSelection() {
         this.$emit('chooseRules', this.selection);

+ 8 - 2
src/views/material/BOMmanage/components/workingProcedure.vue

@@ -1651,12 +1651,18 @@
         this.resourceBomId = resourceBomId;
         this.attributeData = attributeData;
 
-        if (this.attributeData) {
-          this.form.baseCount = this.attributeData.baseCount;
+        if (rowData.baseCount) {
+          this.form.baseCount = rowData.baseCount;
         } else {
           this.form.baseCount = 1;
         }
 
+        // if (this.attributeData) {
+        //   this.form.baseCount = this.attributeData.baseCount;
+        // } else {
+        //   this.form.baseCount = 1;
+        // }
+
         if (!this.isView) {
           this.columns = this.defaultColumns.concat({
             columnKey: 'action',

+ 4 - 3
src/views/rulesManagement/components/programRulesDialog.vue

@@ -572,9 +572,10 @@ export default {
                 categoryId: item.categoryId,
                 deviceInfo: item.equipmentList.map((item) => {
                   return {
-                    substanceId: this.dialogTitle.includes('新增')
-                      ? item.position[0]?.substanceId
-                      : item.id,
+                    // substanceId: this.dialogTitle.includes('新增')
+                    //   ? item.position[0]?.substanceId
+                    //   : item.id,
+                    substanceId: item.id,
                     // 前端回显字段
                     id: item.id,
                     codeNumber: item.codeNumber,

+ 2 - 2
src/views/rulesManagement/releaseRules/components/permitAdd.vue

@@ -512,8 +512,8 @@
 
           this.formData.fromId = row.id;
           this.formData.id = null;
-          this.formData.startDate = new Date(row.stopDate);
-          this.formData.stopDate = new Date('2099-12-31 00:00:00');
+          this.formData.startDate = new Date(row.startDate);
+          this.formData.stopDate = new Date(row.stopDate);
 
           this.recordrulesDetailPage(row);
           this.recordrulesCyclePage(row);

+ 53 - 35
src/views/technology/production/components/user-setting-matter-add.vue

@@ -8,14 +8,14 @@
     @update:visible="updateVisible"
     :maxable="true"
     :before-close="handleClose"
+    width="800px"
   >
     <el-form
       :model="formData"
       v-loading="dialogLoading"
       ref="formRef"
-      label-width="180px"
+      label-width="120px"
       :rules="rules"
-      style="width: 800px; margin: 0 auto"
     >
       <el-form-item label="类型" required prop="itemType">
         <DictSelection
@@ -43,16 +43,18 @@
         required
         prop="deviceName"
       >
-        <el-input
-          v-model="formData.deviceName"
-          placeholder="请选择设备"
-          size="small"
-          :readonly="true"
-        >
-          <template #append>
-            <el-button size="small" @click="selectDeviceId">选择设备</el-button>
-          </template>
-        </el-input>
+        <div class="mask-box" @click="selectDeviceId">
+          <el-input
+            v-model="formData.deviceName"
+            placeholder="请选择设备"
+            size="small"
+            :readonly="true"
+          >
+            <template #append>
+              <el-button size="small">选择设备</el-button>
+            </template>
+          </el-input>
+        </div>
       </el-form-item>
 
       <el-form-item v-if="formData.itemType == '3'" label="关联任务">
@@ -79,18 +81,18 @@
         required
         prop="rulesName"
       >
-        <el-input
-          v-model="formData.rulesName"
-          placeholder="请选择记录规则名称"
-          size="small"
-          :readonly="true"
-        >
-          <template #append>
-            <el-button size="small" @click="selectReleaseId"
-              >选择规则</el-button
-            >
-          </template>
-        </el-input>
+        <div class="mask-box" @click="selectReleaseId">
+          <el-input
+            v-model="formData.rulesName"
+            placeholder="请选择记录规则名称"
+            size="small"
+            :readonly="true"
+          >
+            <template #append>
+              <el-button size="small">选择规则</el-button>
+            </template>
+          </el-input>
+        </div>
       </el-form-item>
 
       <el-form-item
@@ -99,16 +101,18 @@
         required
         prop="rulesId"
       >
-        <el-input
-          v-model="formData.rulesName"
-          placeholder="请选择设备有关计划规则,如保养规则,巡点检规则等"
-          size="small"
-          :readonly="true"
-        >
-          <template #append>
-            <el-button size="small" @click="selectRulesId">选择规则</el-button>
-          </template>
-        </el-input>
+        <div class="mask-box" @click="selectRulesId">
+          <el-input
+            v-model="formData.rulesName"
+            placeholder="请选择设备有关计划规则,如保养规则,巡点检规则等"
+            size="small"
+            :readonly="true"
+          >
+            <template #append>
+              <el-button size="small">选择规则</el-button>
+            </template>
+          </el-input>
+        </div>
       </el-form-item>
     </el-form>
 
@@ -127,6 +131,7 @@
     <selectMatterRules
       ref="selectMatterRulesRef"
       @chooseRules="chooseRules"
+      :filterType="[1, 2, 5]"
     ></selectMatterRules>
 
     <selectReleaseRules
@@ -317,4 +322,17 @@
   };
 </script>
 
-<style scoped></style>
+<style scoped lang="scss">
+  .mask-box {
+    &::after {
+      content: '';
+      width: 100%;
+      height: 100%;
+      position: absolute;
+      top: 0;
+      left: 0;
+      background: rgba(0, 0, 0, 0);
+      cursor: pointer;
+    }
+  }
+</style>

+ 34 - 12
src/views/technology/production/components/user-setting-matter.vue

@@ -169,7 +169,9 @@
       // 查询事项数据
       async getMatterList() {
         const { list } = await produceTaskRecordRules({
-          produceTaskId: this.currentRow.id
+          produceTaskId: this.currentRow.id,
+          pageNum: 1,
+          size: 9999
           // reportWorkType: this.reportWorkType
         });
         console.log('list', list);
@@ -212,6 +214,7 @@
           produceTaskId: this.currentRow.id,
           reportWorkType: this.reportWorkType
         });
+        this.handleSort();
       },
       editMatter(matter) {
         console.log('matter', matter);
@@ -248,6 +251,34 @@
             return item;
           });
         }
+        this.handleSort();
+      },
+      // 事项排序 根据matterList的顺序
+      handleSort() {
+        this.matterList = this.matterList.map((item, index) => {
+          item.sortNum = index;
+          return item;
+        });
+        this.addPOs = this.addPOs.map((item) => {
+          const matter = this.matterList.find((m) => m.id === item.id);
+          if (matter) {
+            return {
+              ...item,
+              sortNum: matter.sortNum
+            };
+          }
+          return item;
+        });
+        this.updatePOs = this.updatePOs.map((item) => {
+          const matter = this.matterList.find((m) => m.id === item.id);
+          if (matter) {
+            return {
+              ...item,
+              sortNum: matter.sortNum
+            };
+          }
+          return item;
+        });
       },
       // 确定保存事项
       async saveMatterList() {
@@ -255,20 +286,11 @@
         try {
           this.butLoading = true;
 
-          const addPos = this.addPOs.map((item) => {
-            item.sortNum = this.matterList.findIndex((i) => i.id === item.id);
-            return item;
-          });
-          const updatePos = this.updatePOs.map((item) => {
-            item.sortNum = this.matterList.findIndex((i) => i.id === item.id);
-            return item;
-          });
-
           await produceTaskRecordRulesBatchSave({
-            addPOs: addPos,
+            addPOs: this.addPOs,
             deletedIds: this.deletedIds,
             produceTaskId: this.currentRow.id,
-            updatePOs: updatePos
+            updatePOs: this.updatePOs
           });
           this.$message.success('保存成功');
           this.handleClose();