|
|
@@ -21,47 +21,86 @@
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="行业类别" prop="industryType">
|
|
|
- <dict-selection
|
|
|
+ <el-select
|
|
|
v-model="formData.industryType"
|
|
|
- dictName="行业类别"
|
|
|
placeholder="请选择行业类别"
|
|
|
- />
|
|
|
+ style="width: 100%"
|
|
|
+ @change="industryTypeChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in industryTypeList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="业务分类" prop="businessType">
|
|
|
- <dict-selection
|
|
|
+ <el-select
|
|
|
v-model="formData.businessType"
|
|
|
- dictName="业务类型"
|
|
|
placeholder="请选择业务分类"
|
|
|
- />
|
|
|
+ style="width: 100%"
|
|
|
+ @change="businessTypeChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in businessTypeList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="模块划分" prop="reportWorkType">
|
|
|
- <dict-selection
|
|
|
+ <el-select
|
|
|
v-model="formData.reportWorkType"
|
|
|
- dictName="记录规则报工类型"
|
|
|
placeholder="请选择模块划分"
|
|
|
- />
|
|
|
+ style="width: 100%"
|
|
|
+ @change="reportWorkTypeChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in reportWorkTypeList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="应用场景" prop="classify">
|
|
|
- <dict-selection
|
|
|
+ <el-select
|
|
|
v-model="formData.classify"
|
|
|
- dictName="记录规则类型"
|
|
|
placeholder="请选择应用场景"
|
|
|
- />
|
|
|
+ style="width: 100%"
|
|
|
+ @change="classifyChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in classifyList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="模板样式" prop="recordTemplateStyle">
|
|
|
- <dict-selection
|
|
|
+ <el-select
|
|
|
v-model="formData.recordTemplateStyle"
|
|
|
- dictName="记录表模板样式"
|
|
|
placeholder="请选择模板样式"
|
|
|
- />
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in recordTemplateStyleList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
@@ -575,6 +614,7 @@
|
|
|
import processModal from './processModal.vue';
|
|
|
import ProductModalCorrelation from './ProductModal.vue';
|
|
|
import { recordrulesexecutemethodPage } from '@/api/recordrulesexecutemethod/index';
|
|
|
+ import { businessTypeList } from '@/views/regulationManagement/components/util';
|
|
|
|
|
|
export default {
|
|
|
mixins: [dictMixins],
|
|
|
@@ -768,6 +808,125 @@
|
|
|
} else {
|
|
|
return this.formData.details;
|
|
|
}
|
|
|
+ },
|
|
|
+ // 根据typeList 计算行业类型列表
|
|
|
+ // {
|
|
|
+ // "id": "1991058936943173633",
|
|
|
+ // "createTime": "2025-11-19 16:20:17",
|
|
|
+ // "createUserId": "1881891196703911938",
|
|
|
+ // "industryType": 1,
|
|
|
+ // "industryName": "工程机械",
|
|
|
+ // "businessType": 1,
|
|
|
+ // "businessName": "生产",
|
|
|
+ // "reportWorkType": 1,
|
|
|
+ // "reportWorkName": "产前准备",
|
|
|
+ // "sceneType": 1,
|
|
|
+ // "sceneName": "清场清洁",
|
|
|
+ // "templateStyleType": 1,
|
|
|
+ // "templateStyleName": "通用模板",
|
|
|
+ // "tenantId": "1",
|
|
|
+ // "deptId": "1",
|
|
|
+ // "factoriesId": "1916747066214232065"
|
|
|
+ // }
|
|
|
+ industryTypeList() {
|
|
|
+ const seen = new Set();
|
|
|
+ const res = [];
|
|
|
+ for (const i of this.typeList || []) {
|
|
|
+ const key = String(i.industryType);
|
|
|
+ if (!seen.has(key)) {
|
|
|
+ seen.add(key);
|
|
|
+ res.push({
|
|
|
+ label: i.industryName,
|
|
|
+ value: key
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ },
|
|
|
+ // 根据typeList和formData.industryType计算业务分类列表
|
|
|
+ businessTypeList() {
|
|
|
+ const seen = new Set();
|
|
|
+ const res = [];
|
|
|
+ const list = this.typeList.filter(
|
|
|
+ (i) => i.industryType == this.formData.industryType
|
|
|
+ );
|
|
|
+ for (const i of list || []) {
|
|
|
+ const key = String(i.businessType);
|
|
|
+ if (!seen.has(key)) {
|
|
|
+ seen.add(key);
|
|
|
+ res.push({
|
|
|
+ label: i.businessName,
|
|
|
+ value: key
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ },
|
|
|
+ // 根据typeList和formData.industryType、formData.businessType计算模块划分列表
|
|
|
+ reportWorkTypeList() {
|
|
|
+ const seen = new Set();
|
|
|
+ const res = [];
|
|
|
+ const list = this.typeList.filter(
|
|
|
+ (i) =>
|
|
|
+ i.industryType == this.formData.industryType &&
|
|
|
+ i.businessType == this.formData.businessType
|
|
|
+ );
|
|
|
+ for (const i of list || []) {
|
|
|
+ const key = String(i.reportWorkType);
|
|
|
+ if (!seen.has(key)) {
|
|
|
+ seen.add(key);
|
|
|
+ res.push({
|
|
|
+ label: i.reportWorkName,
|
|
|
+ value: key
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ },
|
|
|
+ // 根据typeList和formData.industryType、formData.businessType、formData.reportWorkType计算应用场景列表
|
|
|
+ classifyList() {
|
|
|
+ const seen = new Set();
|
|
|
+ const res = [];
|
|
|
+ const list = this.typeList.filter(
|
|
|
+ (i) =>
|
|
|
+ i.industryType == this.formData.industryType &&
|
|
|
+ i.businessType == this.formData.businessType &&
|
|
|
+ i.reportWorkType == this.formData.reportWorkType
|
|
|
+ );
|
|
|
+ for (const i of list || []) {
|
|
|
+ const key = String(i.sceneType);
|
|
|
+ if (!seen.has(key)) {
|
|
|
+ seen.add(key);
|
|
|
+ res.push({
|
|
|
+ label: i.sceneName,
|
|
|
+ value: key
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ },
|
|
|
+ // 根据typeList和formData.industryType、formData.businessType、formData.reportWorkType、formData.classify计算模板样式列表
|
|
|
+ recordTemplateStyleList() {
|
|
|
+ const seen = new Set();
|
|
|
+ const res = [];
|
|
|
+ const list = this.typeList.filter(
|
|
|
+ (i) =>
|
|
|
+ i.industryType == this.formData.industryType &&
|
|
|
+ i.businessType == this.formData.businessType &&
|
|
|
+ i.reportWorkType == this.formData.reportWorkType &&
|
|
|
+ i.sceneType == this.formData.classify
|
|
|
+ );
|
|
|
+ for (const i of list || []) {
|
|
|
+ const key = String(i.templateStyleType);
|
|
|
+ if (!seen.has(key)) {
|
|
|
+ seen.add(key);
|
|
|
+ res.push({
|
|
|
+ label: i.templateStyleName,
|
|
|
+ value: key
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return res;
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
|
@@ -885,13 +1044,15 @@
|
|
|
{ label: '物料统计', value: '2' },
|
|
|
{ label: '工序统计', value: '3' }
|
|
|
],
|
|
|
- opSelectOptions: ['+', '-', '*', '/', '%', '(', ')']
|
|
|
+ opSelectOptions: ['+', '-', '*', '/', '%', '(', ')'],
|
|
|
+ typeList: []
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getByCodeData();
|
|
|
this.getProductCategory();
|
|
|
console.log('this.formData 2233', this.formData);
|
|
|
+ this.getTypeList();
|
|
|
},
|
|
|
methods: {
|
|
|
open(row, type, title) {
|
|
|
@@ -899,6 +1060,8 @@
|
|
|
this.type = type;
|
|
|
console.log('type', type, row);
|
|
|
|
|
|
+ this.getTypeList();
|
|
|
+
|
|
|
if (
|
|
|
type == 'edit' ||
|
|
|
type == 'detail' ||
|
|
|
@@ -1729,106 +1892,26 @@
|
|
|
size: 99999
|
|
|
});
|
|
|
|
|
|
- console.log('type list', list);
|
|
|
-
|
|
|
- const industryMap = new Map();
|
|
|
-
|
|
|
- list.forEach((item) => {
|
|
|
- // industry
|
|
|
- let industryNode = industryMap.get(item.industryType);
|
|
|
- if (!industryNode) {
|
|
|
- industryNode = {
|
|
|
- id: 'industry-' + item.industryType,
|
|
|
- type: 'industry',
|
|
|
- value: item.industryType,
|
|
|
- label: item.industryName,
|
|
|
- children: [],
|
|
|
- item,
|
|
|
- _businessMap: new Map()
|
|
|
- };
|
|
|
- industryMap.set(item.industryType, industryNode);
|
|
|
- }
|
|
|
-
|
|
|
- // business
|
|
|
- let businessNode = industryNode._businessMap.get(item.businessType);
|
|
|
- if (!businessNode) {
|
|
|
- businessNode = {
|
|
|
- id: `business-${item.industryType}-${item.businessType}`,
|
|
|
- type: 'business',
|
|
|
- value: item.businessType,
|
|
|
- label: item.businessName,
|
|
|
- children: [],
|
|
|
- item,
|
|
|
- _reportMap: new Map()
|
|
|
- };
|
|
|
- industryNode._businessMap.set(item.businessType, businessNode);
|
|
|
- industryNode.children.push(businessNode);
|
|
|
- }
|
|
|
-
|
|
|
- // reportWork
|
|
|
- let reportNode = businessNode._reportMap.get(item.reportWorkType);
|
|
|
- if (!reportNode) {
|
|
|
- reportNode = {
|
|
|
- id: `report-${item.industryType}-${item.businessType}-${item.reportWorkType}`,
|
|
|
- type: 'reportWork',
|
|
|
- value: item.reportWorkType,
|
|
|
- label: item.reportWorkName,
|
|
|
- children: [],
|
|
|
- item,
|
|
|
- _sceneMap: new Map()
|
|
|
- };
|
|
|
- businessNode._reportMap.set(item.reportWorkType, reportNode);
|
|
|
- businessNode.children.push(reportNode);
|
|
|
- }
|
|
|
-
|
|
|
- // scene
|
|
|
- let sceneNode = reportNode._sceneMap.get(item.sceneType);
|
|
|
- if (!sceneNode) {
|
|
|
- sceneNode = {
|
|
|
- id: `scene-${item.industryType}-${item.businessType}-${item.reportWorkType}-${item.sceneType}`,
|
|
|
- type: 'scene',
|
|
|
- value: item.sceneType,
|
|
|
- label: item.sceneName,
|
|
|
- children: [],
|
|
|
- item,
|
|
|
- _templateMap: new Map()
|
|
|
- };
|
|
|
- reportNode._sceneMap.set(item.sceneType, sceneNode);
|
|
|
- reportNode.children.push(sceneNode);
|
|
|
- }
|
|
|
-
|
|
|
- // template style
|
|
|
- let templateNode = sceneNode._templateMap.get(item.templateStyleType);
|
|
|
- if (!templateNode) {
|
|
|
- templateNode = {
|
|
|
- id: `template-${item.industryType}-${item.businessType}-${item.reportWorkType}-${item.sceneType}-${item.templateStyleType}`,
|
|
|
- type: 'templateStyle',
|
|
|
- value: item.templateStyleType,
|
|
|
- label: item.templateStyleName,
|
|
|
- item,
|
|
|
- children: []
|
|
|
- };
|
|
|
- sceneNode._templateMap.set(item.templateStyleType, templateNode);
|
|
|
- sceneNode.children.push(templateNode);
|
|
|
- }
|
|
|
-
|
|
|
- // 原始数据
|
|
|
- templateNode.item = item;
|
|
|
- });
|
|
|
-
|
|
|
- const clean = (node) => {
|
|
|
- delete node._businessMap;
|
|
|
- delete node._reportMap;
|
|
|
- delete node._sceneMap;
|
|
|
- delete node._templateMap;
|
|
|
- node.children && node.children.forEach(clean);
|
|
|
- };
|
|
|
-
|
|
|
- const tree = Array.from(industryMap.values());
|
|
|
- tree.forEach(clean);
|
|
|
-
|
|
|
- this.typeTree = tree; // 结果树
|
|
|
- console.log('typeTree', this.typeTree);
|
|
|
+ this.typeList = list;
|
|
|
+ console.log('this.typeList', this.typeList);
|
|
|
+ },
|
|
|
+ industryTypeChange() {
|
|
|
+ this.formData.businessType = '';
|
|
|
+ this.formData.reportWorkType = '';
|
|
|
+ this.formData.classify = '';
|
|
|
+ this.formData.recordTemplateStyle = '';
|
|
|
+ },
|
|
|
+ businessTypeChange() {
|
|
|
+ this.formData.reportWorkType = '';
|
|
|
+ this.formData.classify = '';
|
|
|
+ this.formData.recordTemplateStyle = '';
|
|
|
+ },
|
|
|
+ reportWorkTypeChange() {
|
|
|
+ this.formData.classify = '';
|
|
|
+ this.formData.recordTemplateStyle = '';
|
|
|
+ },
|
|
|
+ classifyChange() {
|
|
|
+ this.formData.recordTemplateStyle = '';
|
|
|
}
|
|
|
}
|
|
|
};
|