<template>
|
<TableList
|
:condtionConfig="condtionConfig"
|
:columnConfig="columnConfig"
|
:formItemsConfig="formItemsConfig"
|
:defValuesConfig="defValuesConfig"
|
:formRulesConfig="formRulesConfig"
|
:condformdefConfig="condformdefConfig"
|
:operateBtns="operateBtns"
|
rowKeyName="serialNo"
|
dialogTitle="管控额度"
|
listApiName="quotaControlList"
|
saveApiName="initControlsQuotaAdjustFlow"
|
/>
|
</template>
|
|
<script>
|
import { mapState, mapGetters, mapActions } from "vuex";
|
import TableList from "../components/TableList.vue";
|
import {
|
QUOTACONTROLLISTCOND,
|
QUOTACONTROLLISTCONDDEF
|
} from "./config/condtion.config";
|
import { QUOTACONTROLLISTCOLUMN } from "./config/column.config";
|
import { getAllCityAreaList, queryProductList } from "@/http/api";
|
export default {
|
props: {},
|
data() {
|
return {
|
condtionConfig: [...QUOTACONTROLLISTCOND],
|
columnConfig: [...QUOTACONTROLLISTCOLUMN],
|
formItemsConfig: [],
|
defValuesConfig: {},
|
formRulesConfig: {},
|
condformdefConfig: { ...QUOTACONTROLLISTCONDDEF },
|
optionsArr: ["YesNo", "IsDelete"],
|
operateBtns: []
|
};
|
},
|
computed: {
|
// 获取state值
|
...mapState("rlc", {
|
optionsMap: state => state.OPTIONSMAP
|
}),
|
// 通过getters获取值
|
...mapGetters("rlc", ["getOptionsMap"])
|
},
|
watch: {
|
optionsMap: {
|
handler(options) {
|
const items = {
|
controlStatus: "ControlStatus",
|
quotaObjectType: "QuotaObjectType",
|
quotaControlType: "QuotaControlType",
|
productIdArray: "products",
|
cityArray: "citys"
|
};
|
this.condtionConfig = [...QUOTACONTROLLISTCOND].map(form => {
|
const newForm = { ...form };
|
if (newForm.type === "select" || newForm.type === "multipleSelect") {
|
newForm.options = options[items[newForm.name]];
|
}
|
return newForm;
|
});
|
},
|
deep: true
|
}
|
},
|
created() {
|
const selectCodes = [
|
"QuotaObjectType", //额度对象类型
|
"QuotaControlType", //额度类型
|
"ControlStatus", //额度状态
|
"ApproveStatus", //修改审核状态
|
"ApproveCode" //审批意见
|
];
|
this.getOptionsData(selectCodes);
|
this.getAllCityAreaList();
|
this.getProductList();
|
this.$forceUpdate();
|
},
|
mounted() {},
|
methods: {
|
...mapActions("rlc", [
|
// 将 `this.setOptionsMap()` 映射为 `this.$store.dispatch('setOptionsMap')`
|
"getOptionsData",
|
"getOhersOptions"
|
]),
|
operateHandleClick() {
|
this.$router.push({ name: "addImageDataConfig" });
|
},
|
async getAllCityAreaList() {
|
const cityRes = await getAllCityAreaList({ queryFlag: "02" });
|
if (cityRes && cityRes.code === "00") {
|
this.getOhersOptions({
|
citys: cityRes.result.map(({ itemname, itemno }) => {
|
return { label: itemname, value: itemno };
|
})
|
});
|
}
|
},
|
async getProductList() {
|
const cityRes = await queryProductList({ queryProductList: "0" });
|
if (cityRes && cityRes.code === "00") {
|
this.getOhersOptions({
|
products: cityRes.result.map(({ productName, productCode }) => {
|
return { label: productName, value: productCode };
|
})
|
});
|
}
|
}
|
},
|
components: { TableList }
|
};
|
</script>
|
|
<style lang="less" scoped></style>
|