|
|
@@ -17,6 +17,7 @@
|
|
|
class="el-form-box"
|
|
|
:model="form"
|
|
|
label-width="90px"
|
|
|
+ v-loading="loading"
|
|
|
>
|
|
|
<headerTitle title="基本信息"></headerTitle>
|
|
|
<el-row>
|
|
|
@@ -26,58 +27,77 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="业务类型" prop="type">
|
|
|
+ <el-form-item label="业务类型" prop="businessType">
|
|
|
<el-select
|
|
|
- @change="buissChange"
|
|
|
- v-model="form.type"
|
|
|
+ v-model="form.businessType"
|
|
|
placeholder="请选择"
|
|
|
style="width: 100%"
|
|
|
+ @change="businessTypeChange"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="item in businessTypeList"
|
|
|
- :key="item.value"
|
|
|
- :label="item.name"
|
|
|
- :value="item.value"
|
|
|
+ v-for="item in allEnable"
|
|
|
+ :key="item.businessType"
|
|
|
+ :label="item.businessName"
|
|
|
+ :value="item.businessType"
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="考核指标" prop="assessmentIndicators">
|
|
|
+ <el-form-item label="考核指标" prop="indicator">
|
|
|
<el-select
|
|
|
- @change="salesChange"
|
|
|
- v-model="form.assessmentIndicators"
|
|
|
+ v-model="form.indicator"
|
|
|
placeholder="请选择"
|
|
|
style="width: 100%"
|
|
|
+ @change="indicatorChange"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.value"
|
|
|
- :label="item.name"
|
|
|
- :value="item.value"
|
|
|
+ v-for="item in indicatorList"
|
|
|
+ :key="item.indicator"
|
|
|
+ :label="item.indicatorName"
|
|
|
+ :value="item.indicator"
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row style="margin-top: 20px">
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="编码" prop="code">
|
|
|
- <el-input v-model="form.code" disabled></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="form.code"
|
|
|
+ disabled
|
|
|
+ placeholder="系统自动生成"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="是否启用" prop="status">
|
|
|
+ <el-switch
|
|
|
+ v-model="form.enable"
|
|
|
+ :active-value="1"
|
|
|
+ :inactive-value="0"
|
|
|
+ active-text="启用"
|
|
|
+ inactive-text="停用"
|
|
|
+ ></el-switch>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="16">
|
|
|
- <el-form-item label="描述" prop="describes">
|
|
|
- <el-input v-model="form.describes" type="textarea"></el-input>
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-form-item label="描述" prop="remark">
|
|
|
+ <el-input v-model="form.remark" type="textarea"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
- <headerTitle title="考核指标限制条件"></headerTitle>
|
|
|
+ <headerTitle style="margin-top: 20px" title="考核指标限制条件">
|
|
|
+ </headerTitle>
|
|
|
<el-row>
|
|
|
<el-col
|
|
|
:span="24"
|
|
|
- v-for="(item, i) in tableList"
|
|
|
+ v-for="(item, i) in form.groups"
|
|
|
:key="i"
|
|
|
style="margin-top: 15px"
|
|
|
>
|
|
|
@@ -99,34 +119,33 @@
|
|
|
></span>
|
|
|
<i class="leftLine"></i>
|
|
|
<div class="rightLine">
|
|
|
- <i v-for="(val, index) in item" :key="index"></i>
|
|
|
+ <i v-for="(val, index) in item.conditions" :key="index"></i>
|
|
|
<i></i>
|
|
|
- <!-- <i></i> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="right">
|
|
|
<div
|
|
|
class="rightItem"
|
|
|
- v-for="(val, index) in item"
|
|
|
+ v-for="(val, index) in item.conditions"
|
|
|
:key="index"
|
|
|
:style="{ marginTop: index == 0 ? '' : '20px' }"
|
|
|
>
|
|
|
<el-select
|
|
|
- v-model="val.value"
|
|
|
+ v-model="val.columnComment"
|
|
|
placeholder="请选择"
|
|
|
style="width: 100%"
|
|
|
+ @change="itemConditionsChange(val)"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="item in valueOptions"
|
|
|
- :key="item.value"
|
|
|
- :label="item.name"
|
|
|
- :value="item.value"
|
|
|
- @click.native="valChange(item, val)"
|
|
|
+ v-for="item in conditionsList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.columnComment"
|
|
|
+ :value="item.columnComment"
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
<el-select
|
|
|
- v-model="val.operator"
|
|
|
+ v-model="val.compareOperator"
|
|
|
placeholder="请选择"
|
|
|
style="width: 100%; margin-left: 8px"
|
|
|
>
|
|
|
@@ -140,19 +159,42 @@
|
|
|
</el-select>
|
|
|
|
|
|
<el-select
|
|
|
- v-model="val.status"
|
|
|
+ v-if="val.conditionType != 3"
|
|
|
+ v-model="val.valuesIds"
|
|
|
multiple
|
|
|
placeholder="请选择"
|
|
|
style="width: 100%; margin-left: 8px"
|
|
|
+ :key="val.value + '_status'"
|
|
|
+ @change="valuesChange(val)"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="item in val.statusOptions"
|
|
|
- :key="item.value"
|
|
|
+ v-for="item in getStatusOptions(val)"
|
|
|
+ :key="item.id"
|
|
|
:label="item.name"
|
|
|
- :value="item.value"
|
|
|
+ :value="item.val"
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
+
|
|
|
+ <!-- 选择产品 -->
|
|
|
+ <div
|
|
|
+ v-else
|
|
|
+ class="select-product"
|
|
|
+ @click="openSelectProduct(val)"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ placeholder="请选择产品"
|
|
|
+ :value="
|
|
|
+ val.values[0]
|
|
|
+ ? val.values[0].valJson.map((i) => i.name).join(', ')
|
|
|
+ : ''
|
|
|
+ "
|
|
|
+ readonly
|
|
|
+ disabled
|
|
|
+ suffix-icon="el-icon-arrow-right"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+
|
|
|
<i
|
|
|
v-show="index == 0"
|
|
|
style="color: #fff; font-size: 16px; margin-left: 5px"
|
|
|
@@ -178,7 +220,7 @@
|
|
|
</div>
|
|
|
<el-divider>或</el-divider>
|
|
|
</el-col>
|
|
|
- <el-col :span="24">
|
|
|
+ <el-col v-if="form.groups && form.groups.length" :span="24">
|
|
|
<el-form-item
|
|
|
label-width="50px"
|
|
|
prop="branchName"
|
|
|
@@ -189,13 +231,26 @@
|
|
|
type="primary"
|
|
|
icon="el-icon-plus"
|
|
|
class="ele-btn-icon"
|
|
|
- @click="add()"
|
|
|
+ @click="addGroups"
|
|
|
>
|
|
|
继续添加筛选器
|
|
|
</el-button>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col v-else :span="24">
|
|
|
+ <!-- 提示 请先选择 业务类型 和 考核指标 -->
|
|
|
+ <div>
|
|
|
+ <el-empty
|
|
|
+ description="请选择业务类型和考核指标后添加筛选器"
|
|
|
+ ></el-empty>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
+
|
|
|
+ <SelectProduct
|
|
|
+ ref="SelectProductRef"
|
|
|
+ @chooseProcess="chooseProcess"
|
|
|
+ ></SelectProduct>
|
|
|
</el-form>
|
|
|
<div slot="footer">
|
|
|
<el-button type="primary" @click="handleSave(0)" v-click-once
|
|
|
@@ -205,214 +260,341 @@
|
|
|
</div>
|
|
|
</ele-modal>
|
|
|
</template>
|
|
|
+
|
|
|
<script>
|
|
|
import { mapGetters } from 'vuex';
|
|
|
import {
|
|
|
- targetDefinitionSave,
|
|
|
- getIndicatorRootNodeList
|
|
|
- } from '@/api/regulationManagement/index.js';
|
|
|
- import {
|
|
|
- salesRegulationOption,
|
|
|
- // assessmentIndicatorsOptions,
|
|
|
- businessTypeList
|
|
|
- } from './util.js';
|
|
|
+ getAllEnable,
|
|
|
+ saveIndicator,
|
|
|
+ getIndicatorById,
|
|
|
+ updateIndicator
|
|
|
+ } from '@/api/indicator/index.js';
|
|
|
+ import SelectProduct from '@/components/select/SelectProduct';
|
|
|
|
|
|
const defForm = {
|
|
|
+ id: null,
|
|
|
name: '',
|
|
|
- assessmentIndicators: '',
|
|
|
- assessmentCriteria: [], //条件
|
|
|
- status: '',
|
|
|
- type: '',
|
|
|
- describes: ''
|
|
|
+ indicator: '',
|
|
|
+ indicatorName: '',
|
|
|
+ businessType: '',
|
|
|
+ businessName: '',
|
|
|
+ remark: '',
|
|
|
+ // 条件
|
|
|
+ groups: [],
|
|
|
+ createUserName: '',
|
|
|
+ updateUserName: '',
|
|
|
+ enable: 1,
|
|
|
+ code: ''
|
|
|
};
|
|
|
- export default {
|
|
|
- components: {},
|
|
|
|
|
|
- computed: {
|
|
|
- ...mapGetters(['user'])
|
|
|
+ const conditionsItem = {
|
|
|
+ className: '',
|
|
|
+ columnComment: '',
|
|
|
+ columnName: '',
|
|
|
+ conditionType: null,
|
|
|
+ compareOperator: '',
|
|
|
+ createUserName: '',
|
|
|
+ groupId: 0,
|
|
|
+ indicatorId: null,
|
|
|
+ logicOperator: 'and',
|
|
|
+ sortNum: 0,
|
|
|
+ tableName: '',
|
|
|
+ fixedCondition: null,
|
|
|
+ updateUserName: '',
|
|
|
+ isSelectAll: 0,
|
|
|
+ values: [],
|
|
|
+ valuesIds: []
|
|
|
+ };
|
|
|
+
|
|
|
+ export default {
|
|
|
+ components: {
|
|
|
+ SelectProduct
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
addOrEditDialogFlag: false,
|
|
|
dialogType: '',
|
|
|
title: '',
|
|
|
- form: {
|
|
|
- ...defForm
|
|
|
- },
|
|
|
- tableList: [],
|
|
|
- valueOptions: [],
|
|
|
+ form: JSON.parse(JSON.stringify(defForm)),
|
|
|
operatorOptions: [
|
|
|
{
|
|
|
name: '属于',
|
|
|
- value: '1'
|
|
|
+ value: 1
|
|
|
},
|
|
|
{
|
|
|
name: '不属于',
|
|
|
- value: '2'
|
|
|
+ value: 2
|
|
|
}
|
|
|
],
|
|
|
- businessTypeList: [],
|
|
|
- // options: assessmentIndicatorsOptions,
|
|
|
- options: [],
|
|
|
rules: {
|
|
|
name: { required: true, message: '请输入', trigger: 'change' },
|
|
|
- assessmentIndicators: {
|
|
|
+ indicator: {
|
|
|
required: true,
|
|
|
message: '请选择',
|
|
|
trigger: 'change'
|
|
|
},
|
|
|
- type: { required: true, message: '请选择', trigger: 'change' }
|
|
|
- }
|
|
|
+ businessType: { required: true, message: '请选择', trigger: 'change' }
|
|
|
+ },
|
|
|
+ // 业务类型 考核指标 和条件
|
|
|
+ allEnable: [],
|
|
|
+ loading: false,
|
|
|
+ // 当前操作的条件
|
|
|
+ currentItem: null
|
|
|
};
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(['user']),
|
|
|
+ // 获取考核指标列表
|
|
|
+ indicatorList() {
|
|
|
+ const item = this.allEnable.find(
|
|
|
+ (el) => el.businessType === this.form.businessType
|
|
|
+ );
|
|
|
+ return item?.indicatorDefinitions || [];
|
|
|
+ },
|
|
|
+ // 获取考核指标条件值
|
|
|
+ conditionsList() {
|
|
|
+ const item = this.indicatorList.find(
|
|
|
+ (el) => el.indicator === this.form.indicator
|
|
|
+ );
|
|
|
+ return item?.indicatorConditionDefinitions || [];
|
|
|
+ }
|
|
|
+ },
|
|
|
created() {
|
|
|
- this.init();
|
|
|
+ this.getAllEnable();
|
|
|
},
|
|
|
methods: {
|
|
|
- async init() {
|
|
|
- getIndicatorRootNodeList().then((res) => {
|
|
|
- this.businessTypeList = res;
|
|
|
- });
|
|
|
- },
|
|
|
//初始化
|
|
|
- async open(row = {}, type, treeType) {
|
|
|
+ async open(row = {}, type) {
|
|
|
+ console.log('row, type', row, type);
|
|
|
this.addOrEditDialogFlag = true;
|
|
|
this.title = type == 'add' ? '新增' : '修改';
|
|
|
this.dialogType = type;
|
|
|
- if (type !== 'add') {
|
|
|
- row.assessmentIndicators = Number(row.assessmentIndicators);
|
|
|
- this.form = JSON.parse(JSON.stringify(row));
|
|
|
- // 转换value为number类型
|
|
|
- this.tableList = this.form.assessmentCriteria?.map((i) => {
|
|
|
- return i.map((j) => {
|
|
|
- return {
|
|
|
- ...j,
|
|
|
- value: Number(j.value)
|
|
|
- };
|
|
|
- });
|
|
|
- });
|
|
|
- this.buissChange(row.type, 'init');
|
|
|
- this.salesChange(row.assessmentIndicators, 'init');
|
|
|
+ if (type == 'add') {
|
|
|
+ // 新增
|
|
|
+ this.form.createUserName = this.user.info.name;
|
|
|
} else {
|
|
|
- this.add();
|
|
|
- if (treeType != -1) {
|
|
|
- this.form.type = treeType;
|
|
|
- this.buissChange(treeType);
|
|
|
- }
|
|
|
+ this.getDetails(row.id);
|
|
|
}
|
|
|
},
|
|
|
- addItem(item) {
|
|
|
- item.push({
|
|
|
- value: '',
|
|
|
- operator: '1',
|
|
|
- status: [],
|
|
|
- statusOptions: []
|
|
|
+ async getDetails(id) {
|
|
|
+ this.loading = true;
|
|
|
+ const res = await getIndicatorById(id);
|
|
|
+ // 处理 valuesIds 字段
|
|
|
+ res.groups.forEach((group) => {
|
|
|
+ group.conditions.forEach((condition) => {
|
|
|
+ condition.valuesIds = condition.values.map((v) => v.val);
|
|
|
+ });
|
|
|
});
|
|
|
+ this.$util.assignObject(this.form, res);
|
|
|
+
|
|
|
+ this.loading = false;
|
|
|
+ console.log('this.form', this.form);
|
|
|
},
|
|
|
delItem(item, i) {
|
|
|
- item.splice(i, 1);
|
|
|
+ item.conditions.splice(i, 1);
|
|
|
},
|
|
|
del(i) {
|
|
|
- this.tableList.splice(i, 1);
|
|
|
+ this.form.groups.splice(i, 1);
|
|
|
},
|
|
|
+ addGroups() {
|
|
|
+ if (this.form.businessType === '' || this.form.indicator === '') {
|
|
|
+ return this.$message.warning('请先选择业务类型和考核指标');
|
|
|
+ }
|
|
|
|
|
|
- add() {
|
|
|
- this.tableList.push([
|
|
|
- {
|
|
|
- value: '',
|
|
|
- operator: '1',
|
|
|
- status: [],
|
|
|
- statusOptions: []
|
|
|
- }
|
|
|
- ]);
|
|
|
- },
|
|
|
+ const maxSortNum = this.form.groups.reduce((max, group) => {
|
|
|
+ return group.sortNum > max ? group.sortNum : max;
|
|
|
+ }, 0);
|
|
|
|
|
|
- salesChange(val, type) {
|
|
|
- let data = this.options.find((el) => el.value == val);
|
|
|
- this.valueOptions = data.nodes;
|
|
|
- console.log('this.valueOptions', this.valueOptions);
|
|
|
- this.statusOptions = data.equles;
|
|
|
- if (type == 'init') {
|
|
|
- return;
|
|
|
- }
|
|
|
- this.form.indicatorName = data.name;
|
|
|
- this.tableList.forEach((item) => {
|
|
|
- item.forEach((_item) => {
|
|
|
- _item.status = [];
|
|
|
- _item.statusOptions = [];
|
|
|
- _item.value = '';
|
|
|
- });
|
|
|
+ this.form.groups.push({
|
|
|
+ conditions: [{ ...this.newConditionsItem() }],
|
|
|
+ createUserName: this.user.info.name,
|
|
|
+ indicatorId: null,
|
|
|
+ logicOperator: 'or',
|
|
|
+ sortNum: maxSortNum + 1,
|
|
|
+ updateUserName: ''
|
|
|
});
|
|
|
},
|
|
|
+ // 添加子条件
|
|
|
+ addItem(item) {
|
|
|
+ const conditionsItem = this.newConditionsItem();
|
|
|
+ conditionsItem.createUserName = this.user.info.name;
|
|
|
|
|
|
- buissChange(val, type) {
|
|
|
- let data = this.businessTypeList.find((el) => el.value == val);
|
|
|
- this.options = data.nodes || [];
|
|
|
- if (type == 'init') {
|
|
|
- return;
|
|
|
- }
|
|
|
- this.form.typeName = data.name;
|
|
|
- this.form.assessmentIndicators = '';
|
|
|
- this.valueOptions = [];
|
|
|
- this.statusOptions = [];
|
|
|
- this.tableList.forEach((item) => {
|
|
|
- item.forEach((_item) => {
|
|
|
- _item.status = [];
|
|
|
- _item.statusOptions = [];
|
|
|
- _item.value = '';
|
|
|
- });
|
|
|
+ const maxSortNum = item.conditions.reduce((max, condition) => {
|
|
|
+ return condition.sortNum > max ? condition.sortNum : max;
|
|
|
+ }, 0);
|
|
|
+
|
|
|
+ conditionsItem.sortNum = maxSortNum + 1;
|
|
|
+
|
|
|
+ item.conditions.push({
|
|
|
+ ...conditionsItem
|
|
|
});
|
|
|
},
|
|
|
- valChange(item, val) {
|
|
|
- // const { statusOption } = salesRegulationOption(
|
|
|
- // this.form.assessmentIndicators,
|
|
|
- // item.value
|
|
|
- // );
|
|
|
- val.statusOptions = item.equals;
|
|
|
- val.status = [];
|
|
|
- },
|
|
|
- //获取详情
|
|
|
- async getFeeApplyInfoInfo(id) {
|
|
|
- this.form = await getSettlementAccountInfoAPI(id);
|
|
|
+ newConditionsItem() {
|
|
|
+ return JSON.parse(JSON.stringify(conditionsItem));
|
|
|
},
|
|
|
handleSave(flag) {
|
|
|
+ console.log('this.form', this.form);
|
|
|
this.$refs.form.validate(async (valid) => {
|
|
|
if (!valid) return this.$message.warning('有必填项未填,请检查');
|
|
|
- let isTrue = true;
|
|
|
- this.tableList.forEach((item) => {
|
|
|
- item.forEach((val) => {
|
|
|
- if ((!val.value && val.value != 0) || val.status.length == 0) {
|
|
|
- isTrue = false;
|
|
|
+
|
|
|
+ // 判断groups是否有值
|
|
|
+ if (!this.form.groups || this.form.groups.length === 0) {
|
|
|
+ return this.$message.warning('请至少添加一个筛选器');
|
|
|
+ }
|
|
|
+ // 判断每个group的conditions是否有值
|
|
|
+ for (let i = 0; i < this.form.groups.length; i++) {
|
|
|
+ const group = this.form.groups[i];
|
|
|
+ if (!group.conditions || group.conditions.length === 0) {
|
|
|
+ return this.$message.warning('每个筛选器至少添加一个条件');
|
|
|
+ }
|
|
|
+ // 判断每个condition的值是否填写完整
|
|
|
+ for (let j = 0; j < group.conditions.length; j++) {
|
|
|
+ const condition = group.conditions[j];
|
|
|
+
|
|
|
+ if (
|
|
|
+ !condition.columnComment ||
|
|
|
+ !condition.compareOperator ||
|
|
|
+ !condition.values ||
|
|
|
+ condition.values.length === 0
|
|
|
+ ) {
|
|
|
+ return this.$message.warning('请填写完整每个条件的信息');
|
|
|
}
|
|
|
- });
|
|
|
- });
|
|
|
- if (!isTrue) {
|
|
|
- return this.$message.warning('请完善考核指标限制条件');
|
|
|
+ }
|
|
|
}
|
|
|
- this.form.assessmentCriteria = this.tableList;
|
|
|
- const id = await targetDefinitionSave(this.form);
|
|
|
- if (flag) {
|
|
|
- await this.handleSub(id);
|
|
|
+
|
|
|
+ if (this.dialogType === 'add') {
|
|
|
+ this.form.id = null;
|
|
|
+ this.form.createUserName = this.user.info.name;
|
|
|
+ await saveIndicator(this.form);
|
|
|
+ } else {
|
|
|
+ this.form.updateUserName = this.user.info.name;
|
|
|
+ await updateIndicator(this.form);
|
|
|
}
|
|
|
- this.$message.success('操作成功');
|
|
|
- this.done();
|
|
|
+
|
|
|
+ this.$message.success(
|
|
|
+ this.dialogType === 'add' ? '新增成功' : '修改成功'
|
|
|
+ );
|
|
|
+
|
|
|
+ this.$emit('reload');
|
|
|
+
|
|
|
this.cancel();
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
- //刷新主列表数据
|
|
|
- done() {
|
|
|
- this.$emit('reload');
|
|
|
- },
|
|
|
//关闭弹窗
|
|
|
cancel() {
|
|
|
this.form = {
|
|
|
- ...defForm
|
|
|
+ ...JSON.parse(JSON.stringify(defForm))
|
|
|
};
|
|
|
- this.options = [];
|
|
|
- this.tableList = [];
|
|
|
this.$refs['form'].resetFields();
|
|
|
this.addOrEditDialogFlag = false;
|
|
|
+ },
|
|
|
+ async getAllEnable() {
|
|
|
+ const data = await getAllEnable();
|
|
|
+ this.allEnable = data;
|
|
|
+ },
|
|
|
+ // 根据 业务类型-》 考核指标-》考核指标条件值 级联获取
|
|
|
+ getStatusOptions(val) {
|
|
|
+ const item = this.conditionsList.find(
|
|
|
+ (el) => el.columnComment == val.columnComment
|
|
|
+ );
|
|
|
+ return item?.values || [];
|
|
|
+ },
|
|
|
+ // 修改条件
|
|
|
+ itemConditionsChange(val) {
|
|
|
+ const item = this.conditionsList.find(
|
|
|
+ (el) => el.columnComment == val.columnComment
|
|
|
+ );
|
|
|
+ console.log('item', item);
|
|
|
+ if (item) {
|
|
|
+ val.columnName = item.columnName;
|
|
|
+ val.tableName = item.tableName;
|
|
|
+ val.className = item.className;
|
|
|
+ val.fixedCondition = item.fixedCondition;
|
|
|
+ val.conditionType = item.conditionType;
|
|
|
+ } else {
|
|
|
+ val.columnName = '';
|
|
|
+ val.tableName = '';
|
|
|
+ val.className = '';
|
|
|
+ val.fixedCondition = null;
|
|
|
+ val.conditionType = null;
|
|
|
+ }
|
|
|
+
|
|
|
+ val.valuesIds = [];
|
|
|
+ val.values = [];
|
|
|
+ val.isSelectAll = 0;
|
|
|
+ },
|
|
|
+ // 修改条件值
|
|
|
+ valuesChange(val) {
|
|
|
+ console.log('val', val.values);
|
|
|
+ const list = this.getStatusOptions(val);
|
|
|
+ val.values = list
|
|
|
+ .filter((el) => val.valuesIds.includes(el.val))
|
|
|
+ .map((el) => {
|
|
|
+ return {
|
|
|
+ conditionId: null,
|
|
|
+ createUserName: this.user.info.name,
|
|
|
+ groupId: null,
|
|
|
+ indicatorId: null,
|
|
|
+ sortNum: 0,
|
|
|
+ updateUserName: '',
|
|
|
+ val: el.val
|
|
|
+ };
|
|
|
+ });
|
|
|
+
|
|
|
+ if (val.values.length === list.length) {
|
|
|
+ val.isSelectAll = 1;
|
|
|
+ } else {
|
|
|
+ val.isSelectAll = 0;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 考核指标修改同步指标名称
|
|
|
+ indicatorChange() {
|
|
|
+ const item = this.indicatorList.find(
|
|
|
+ (el) => el.indicator == this.form.indicator
|
|
|
+ );
|
|
|
+ this.form.indicatorName = item?.indicatorName || '';
|
|
|
+ // 清空条件
|
|
|
+ this.form.groups = [];
|
|
|
+
|
|
|
+ // 添加一条默认条件
|
|
|
+ this.addGroups();
|
|
|
+ },
|
|
|
+ // 业务类型修改 同步考核指标名称 和 清空条件
|
|
|
+ businessTypeChange() {
|
|
|
+ const item = this.allEnable.find(
|
|
|
+ (el) => el.businessType == this.form.businessType
|
|
|
+ );
|
|
|
+ this.form.businessName = item?.businessName || '';
|
|
|
+ this.form.indicator = '';
|
|
|
+ this.form.indicatorName = '';
|
|
|
+ // 清空条件
|
|
|
+ this.form.groups = [];
|
|
|
+ },
|
|
|
+ // 去选择产品
|
|
|
+ openSelectProduct(item) {
|
|
|
+ this.currentItem = item;
|
|
|
+ this.$refs.SelectProductRef.open([], '选择产品', '9');
|
|
|
+ },
|
|
|
+ // 选择产品完成
|
|
|
+ chooseProcess(productList, current) {
|
|
|
+ console.log('productList', productList);
|
|
|
+ this.currentItem.values = [
|
|
|
+ {
|
|
|
+ conditionId: null,
|
|
|
+ createUserName: this.user.info.name,
|
|
|
+ groupId: null,
|
|
|
+ indicatorId: null,
|
|
|
+ sortNum: 0,
|
|
|
+ updateUserName: this.user.info.name,
|
|
|
+ valJson: productList.map((i) => {
|
|
|
+ return {
|
|
|
+ code: i.code,
|
|
|
+ name: i.name,
|
|
|
+ id: i.id
|
|
|
+ };
|
|
|
+ })
|
|
|
+ }
|
|
|
+ ];
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
@@ -463,5 +645,30 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .select-product {
|
|
|
+ margin-left: 8px;
|
|
|
+ width: 100%;
|
|
|
+ box-sizing: border-box;
|
|
|
+ position: relative;
|
|
|
+
|
|
|
+ &::after {
|
|
|
+ content: '';
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ z-index: 1;
|
|
|
+ opacity: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ :deep(.is-disabled) {
|
|
|
+ .el-input__inner {
|
|
|
+ background-color: #fff;
|
|
|
+ cursor: pointer;
|
|
|
+ color: var(--color-text-regular);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|
|
|
-@/api/regulationManagement/index.js
|