|
|
@@ -68,6 +68,7 @@
|
|
|
:datasource="datasource"
|
|
|
:cache-key="cacheKeyUrl"
|
|
|
row-key="id"
|
|
|
+ :initLoad="false"
|
|
|
>
|
|
|
<template v-slot:toolbar>
|
|
|
<el-button
|
|
|
@@ -188,7 +189,17 @@
|
|
|
@reloadTypeList="getTypeList"
|
|
|
/>
|
|
|
<historyModal ref="historyModalRef" />
|
|
|
- <editTypeModal ref="editTypeModalRef" @reload="getTypeList"></editTypeModal>
|
|
|
+ <editTypeModal
|
|
|
+ ref="editTypeModalRef"
|
|
|
+ @reload="getTypeList"
|
|
|
+ :businessType="
|
|
|
+ $route.path == '/releaseRules/productionReleaseRules'
|
|
|
+ ? 1
|
|
|
+ : '/releaseRules/qualityReleaseRules'
|
|
|
+ ? 2
|
|
|
+ : ''
|
|
|
+ "
|
|
|
+ ></editTypeModal>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -201,7 +212,7 @@
|
|
|
recordrulesPublish,
|
|
|
recordrulesRevokePublish,
|
|
|
recordrulesTypePage,
|
|
|
- recordrulesTypeDeletes,
|
|
|
+ recordrulesTypeDeletes
|
|
|
} from '@/api/recordrules/index';
|
|
|
import tabMixins from '@/mixins/tableColumnsMixin';
|
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
|
@@ -415,15 +426,20 @@
|
|
|
cacheKeyUrl: 'maindata-25922-recordrules-index',
|
|
|
typeTree: [],
|
|
|
treeNode: null,
|
|
|
- qmsReportWorkType: [5, 6, 7],
|
|
|
+ qmsReportWorkType: [5, 6, 7]
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.getTypeList();
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ $route() {
|
|
|
+ this.treeNode = null;
|
|
|
+ this.getTypeList();
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
addPermit(row, type, title) {
|
|
|
-
|
|
|
if (type == 'add') {
|
|
|
if (!this.treeNode) {
|
|
|
return this.$message.warning('请先选择类型节点!');
|
|
|
@@ -477,7 +493,9 @@
|
|
|
pageNum: page,
|
|
|
size: limit,
|
|
|
...where,
|
|
|
- ...typeWhere
|
|
|
+ ...typeWhere,
|
|
|
+ businessType:
|
|
|
+ this.$route.path == '/releaseRules/productionReleaseRules' ? 1 : 2
|
|
|
});
|
|
|
},
|
|
|
/* 刷新表格 */
|
|
|
@@ -519,7 +537,7 @@
|
|
|
return this.$message.warning('请先修改规则停用时间!');
|
|
|
}
|
|
|
|
|
|
- console.log('row~~~~~', row)
|
|
|
+ console.log('row~~~~~', row);
|
|
|
if (!this.qmsReportWorkType.includes(row.reportWorkType)) {
|
|
|
if (row.details.length == 0) {
|
|
|
return this.$message.warning('至少选择一条规则项');
|
|
|
@@ -527,9 +545,7 @@
|
|
|
|
|
|
if (row.reportWorkType == 4) {
|
|
|
// 生产统计过滤掉非成品统计的明细
|
|
|
- row.details = row.details.filter(
|
|
|
- (i) => i.statisticsType
|
|
|
- );
|
|
|
+ row.details = row.details.filter((i) => i.statisticsType);
|
|
|
}
|
|
|
|
|
|
// 判断参数类型是否选择
|
|
|
@@ -567,7 +583,9 @@
|
|
|
async getTypeList() {
|
|
|
const { list = [] } = await recordrulesTypePage({
|
|
|
pageNum: 1,
|
|
|
- size: 99999
|
|
|
+ size: 99999,
|
|
|
+ businessType:
|
|
|
+ this.$route.path == '/releaseRules/productionReleaseRules' ? 1 : 2
|
|
|
});
|
|
|
|
|
|
console.log('type list', list);
|
|
|
@@ -671,7 +689,7 @@
|
|
|
this.typeTree = tree; // 结果树
|
|
|
|
|
|
console.log('typeTree~~~~~', this.typeTree);
|
|
|
-
|
|
|
+
|
|
|
if (!this.treeNode) {
|
|
|
// 默认选中第一个节点
|
|
|
this.treeNode = this.typeTree.length > 0 ? this.typeTree[0] : null;
|
|
|
@@ -689,7 +707,10 @@
|
|
|
},
|
|
|
// 打开新增类型
|
|
|
openEditType(type = 'add', data = null) {
|
|
|
- this.$refs.editTypeModalRef.open(type, type == 'add' ? this.treeNode : data);
|
|
|
+ this.$refs.editTypeModalRef.open(
|
|
|
+ type,
|
|
|
+ type == 'add' ? this.treeNode : data
|
|
|
+ );
|
|
|
},
|
|
|
async deleteTypeNode(node) {
|
|
|
console.log('delete node', node);
|