|
|
@@ -182,216 +182,218 @@
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
<div slot="footer">
|
|
|
- <el-button type="primary" @click="handleSave(0)" v-click-once>保存</el-button>
|
|
|
+ <el-button type="primary" @click="handleSave(0)" v-click-once
|
|
|
+ >保存</el-button
|
|
|
+ >
|
|
|
<el-button @click="cancel">返回</el-button>
|
|
|
</div>
|
|
|
</ele-modal>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { mapGetters } from 'vuex';
|
|
|
-import { targetDefinitionSave } from '@/api/targetManage/index.js';
|
|
|
-import {
|
|
|
- salesRegulationOption,
|
|
|
- assessmentIndicatorsOptions
|
|
|
-} from '@/views/targetManage/util.js';
|
|
|
+ import { mapGetters } from 'vuex';
|
|
|
+ import { targetDefinitionSave } from '@/api/targetManage/index.js';
|
|
|
+ import {
|
|
|
+ salesRegulationOption,
|
|
|
+ assessmentIndicatorsOptions
|
|
|
+ } from '@/views/targetManage/util.js';
|
|
|
|
|
|
-const defForm = {
|
|
|
- name: '',
|
|
|
- assessmentIndicators: '',
|
|
|
- assessmentCriteria: [], //条件
|
|
|
- status: '',
|
|
|
- type: '',
|
|
|
- describes: ''
|
|
|
-};
|
|
|
-export default {
|
|
|
- components: {},
|
|
|
+ const defForm = {
|
|
|
+ name: '',
|
|
|
+ assessmentIndicators: '',
|
|
|
+ assessmentCriteria: [], //条件
|
|
|
+ status: '',
|
|
|
+ type: '',
|
|
|
+ describes: ''
|
|
|
+ };
|
|
|
+ export default {
|
|
|
+ components: {},
|
|
|
|
|
|
- computed: {
|
|
|
- ...mapGetters(['user'])
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- addOrEditDialogFlag: false,
|
|
|
- dialogType: '',
|
|
|
- title: '',
|
|
|
- form: {
|
|
|
- ...defForm
|
|
|
- },
|
|
|
- tableList: [],
|
|
|
- valueOptions: [],
|
|
|
- operatorOptions: [
|
|
|
- {
|
|
|
- name: '属于',
|
|
|
- value: '1'
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(['user'])
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ addOrEditDialogFlag: false,
|
|
|
+ dialogType: '',
|
|
|
+ title: '',
|
|
|
+ form: {
|
|
|
+ ...defForm
|
|
|
},
|
|
|
- {
|
|
|
- name: '不属于',
|
|
|
- value: '2'
|
|
|
+ tableList: [],
|
|
|
+ valueOptions: [],
|
|
|
+ operatorOptions: [
|
|
|
+ {
|
|
|
+ name: '属于',
|
|
|
+ value: '1'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '不属于',
|
|
|
+ value: '2'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ options: assessmentIndicatorsOptions,
|
|
|
+ rules: {
|
|
|
+ name: { required: true, message: '请输入', trigger: 'change' },
|
|
|
+ assessmentIndicators: {
|
|
|
+ required: true,
|
|
|
+ message: '请选择',
|
|
|
+ trigger: 'change'
|
|
|
+ }
|
|
|
}
|
|
|
- ],
|
|
|
- options: assessmentIndicatorsOptions,
|
|
|
- rules: {
|
|
|
- name: { required: true, message: '请输入', trigger: 'change' },
|
|
|
- assessmentIndicators: {
|
|
|
- required: true,
|
|
|
- message: '请选择',
|
|
|
- trigger: 'change'
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
- },
|
|
|
- created() {},
|
|
|
- methods: {
|
|
|
- //初始化
|
|
|
- async open(row = {}, type) {
|
|
|
- this.addOrEditDialogFlag = true;
|
|
|
- this.title = type == 'add' ? '新增' : '修改';
|
|
|
- this.dialogType = type;
|
|
|
- if (type !== 'add') {
|
|
|
- this.form = JSON.parse(JSON.stringify(row));
|
|
|
- this.tableList = this.form.assessmentCriteria;
|
|
|
- const { valueOption } = salesRegulationOption(
|
|
|
- this.form.assessmentIndicators
|
|
|
- );
|
|
|
- this.valueOptions = valueOption;
|
|
|
- } else {
|
|
|
- this.add();
|
|
|
- }
|
|
|
- },
|
|
|
- addItem(item) {
|
|
|
- item.push({
|
|
|
- value: '',
|
|
|
- operator: '1',
|
|
|
- status: [],
|
|
|
- statusOptions: []
|
|
|
- });
|
|
|
- },
|
|
|
- delItem(item, i) {
|
|
|
- item.splice(i, 1);
|
|
|
- },
|
|
|
- del(i) {
|
|
|
- this.tableList.splice(i, 1);
|
|
|
+ };
|
|
|
},
|
|
|
-
|
|
|
- add() {
|
|
|
- this.tableList.push([
|
|
|
- {
|
|
|
+ created() {},
|
|
|
+ methods: {
|
|
|
+ //初始化
|
|
|
+ async open(row = {}, type) {
|
|
|
+ this.addOrEditDialogFlag = true;
|
|
|
+ this.title = type == 'add' ? '新增' : '修改';
|
|
|
+ this.dialogType = type;
|
|
|
+ if (type !== 'add') {
|
|
|
+ this.form = JSON.parse(JSON.stringify(row));
|
|
|
+ this.tableList = this.form.assessmentCriteria;
|
|
|
+ const { valueOption } = salesRegulationOption(
|
|
|
+ this.form.assessmentIndicators
|
|
|
+ );
|
|
|
+ this.valueOptions = valueOption;
|
|
|
+ } else {
|
|
|
+ this.add();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ addItem(item) {
|
|
|
+ item.push({
|
|
|
value: '',
|
|
|
operator: '1',
|
|
|
status: [],
|
|
|
statusOptions: []
|
|
|
- }
|
|
|
- ]);
|
|
|
- },
|
|
|
-
|
|
|
- salesChange(val) {
|
|
|
- const { valueOption, statusOption } = salesRegulationOption(val);
|
|
|
- this.valueOptions = valueOption;
|
|
|
- this.statusOptions = statusOption;
|
|
|
- this.tableList.forEach((item) => {
|
|
|
- item.forEach((_item) => {
|
|
|
- _item.status = [];
|
|
|
- _item.statusOptions = [];
|
|
|
- _item.value = '';
|
|
|
});
|
|
|
- });
|
|
|
- },
|
|
|
- valChange(item, val) {
|
|
|
- const { statusOption } = salesRegulationOption(
|
|
|
- this.form.assessmentIndicators,
|
|
|
- item.value
|
|
|
- );
|
|
|
- val.statusOptions = statusOption;
|
|
|
- val.status = [];
|
|
|
- },
|
|
|
- //获取详情
|
|
|
- async getFeeApplyInfoInfo(id) {
|
|
|
- this.form = await getSettlementAccountInfoAPI(id);
|
|
|
- },
|
|
|
- handleSave(flag) {
|
|
|
- this.$refs.form.validate(async (valid) => {
|
|
|
- if (!valid) return this.$message.warning('有必填项未填,请检查');
|
|
|
- let isTrue = true;
|
|
|
+ },
|
|
|
+ delItem(item, i) {
|
|
|
+ item.splice(i, 1);
|
|
|
+ },
|
|
|
+ del(i) {
|
|
|
+ this.tableList.splice(i, 1);
|
|
|
+ },
|
|
|
+
|
|
|
+ add() {
|
|
|
+ this.tableList.push([
|
|
|
+ {
|
|
|
+ value: '',
|
|
|
+ operator: '1',
|
|
|
+ status: [],
|
|
|
+ statusOptions: []
|
|
|
+ }
|
|
|
+ ]);
|
|
|
+ },
|
|
|
+
|
|
|
+ salesChange(val) {
|
|
|
+ const { valueOption, statusOption } = salesRegulationOption(val);
|
|
|
+ this.valueOptions = valueOption;
|
|
|
+ this.statusOptions = statusOption;
|
|
|
this.tableList.forEach((item) => {
|
|
|
- item.forEach((val) => {
|
|
|
- if (!val.value || val.status.length == 0) {
|
|
|
- isTrue = false;
|
|
|
- }
|
|
|
+ item.forEach((_item) => {
|
|
|
+ _item.status = [];
|
|
|
+ _item.statusOptions = [];
|
|
|
+ _item.value = '';
|
|
|
});
|
|
|
});
|
|
|
- if (!isTrue) {
|
|
|
- return this.$message.warning('请完善考核指标限制条件');
|
|
|
- }
|
|
|
- this.form.assessmentCriteria = this.tableList;
|
|
|
- const id = await targetDefinitionSave(this.form);
|
|
|
- if (flag) {
|
|
|
- await this.handleSub(id);
|
|
|
- }
|
|
|
- this.$message.success('操作成功');
|
|
|
- this.done();
|
|
|
- this.cancel();
|
|
|
- });
|
|
|
- },
|
|
|
+ },
|
|
|
+ valChange(item, val) {
|
|
|
+ const { statusOption } = salesRegulationOption(
|
|
|
+ this.form.assessmentIndicators,
|
|
|
+ item.value
|
|
|
+ );
|
|
|
+ val.statusOptions = statusOption;
|
|
|
+ val.status = [];
|
|
|
+ },
|
|
|
+ //获取详情
|
|
|
+ async getFeeApplyInfoInfo(id) {
|
|
|
+ this.form = await getSettlementAccountInfoAPI(id);
|
|
|
+ },
|
|
|
+ handleSave(flag) {
|
|
|
+ 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.status.length == 0) {
|
|
|
+ isTrue = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ if (!isTrue) {
|
|
|
+ return this.$message.warning('请完善考核指标限制条件');
|
|
|
+ }
|
|
|
+ this.form.assessmentCriteria = this.tableList;
|
|
|
+ const id = await targetDefinitionSave(this.form);
|
|
|
+ if (flag) {
|
|
|
+ await this.handleSub(id);
|
|
|
+ }
|
|
|
+ this.$message.success('操作成功');
|
|
|
+ this.done();
|
|
|
+ this.cancel();
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
- //刷新主列表数据
|
|
|
- done() {
|
|
|
- this.$emit('reload');
|
|
|
- },
|
|
|
- //关闭弹窗
|
|
|
- cancel() {
|
|
|
- this.form = {
|
|
|
- ...defForm
|
|
|
- };
|
|
|
- this.tableList = [];
|
|
|
- this.addOrEditDialogFlag = false;
|
|
|
+ //刷新主列表数据
|
|
|
+ done() {
|
|
|
+ this.$emit('reload');
|
|
|
+ },
|
|
|
+ //关闭弹窗
|
|
|
+ cancel() {
|
|
|
+ this.form = {
|
|
|
+ ...defForm
|
|
|
+ };
|
|
|
+ this.tableList = [];
|
|
|
+ this.addOrEditDialogFlag = false;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
-};
|
|
|
+ };
|
|
|
</script>
|
|
|
<style scoped lang="scss">
|
|
|
-.itemDiv {
|
|
|
- display: flex;
|
|
|
- .left {
|
|
|
+ .itemDiv {
|
|
|
display: flex;
|
|
|
- align-items: center;
|
|
|
- span {
|
|
|
- height: 100%;
|
|
|
+ .left {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
+ span {
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ .leftLine {
|
|
|
+ height: calc(100% - 30px);
|
|
|
+ width: 1px;
|
|
|
+ background: #dddddd;
|
|
|
+ margin-left: 10px;
|
|
|
+ }
|
|
|
+ .rightLine {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-between;
|
|
|
+ height: calc(100% - 30px);
|
|
|
+
|
|
|
+ i {
|
|
|
+ height: 1px;
|
|
|
+ width: 20px;
|
|
|
+ background: #dddddd;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- .leftLine {
|
|
|
- height: calc(100% - 30px);
|
|
|
- width: 1px;
|
|
|
- background: #dddddd;
|
|
|
- margin-left: 10px;
|
|
|
- }
|
|
|
- .rightLine {
|
|
|
+ .right {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
- justify-content: space-between;
|
|
|
- height: calc(100% - 30px);
|
|
|
-
|
|
|
+ width: calc(100% - 150px);
|
|
|
+ }
|
|
|
+ .rightItem {
|
|
|
+ height: 45px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
i {
|
|
|
- height: 1px;
|
|
|
- width: 20px;
|
|
|
- background: #dddddd;
|
|
|
+ font-size: 28px;
|
|
|
+ color: #ddd;
|
|
|
+ cursor: pointer;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- .right {
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- width: calc(100% - 150px);
|
|
|
- }
|
|
|
- .rightItem {
|
|
|
- height: 45px;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- i {
|
|
|
- font-size: 28px;
|
|
|
- color: #ddd;
|
|
|
- cursor: pointer;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
</style>
|