<template>
|
<div>
|
<TableList
|
ref="imageTablelist"
|
:condtionConfig="condtionConfig"
|
:columnConfig="columnConfig"
|
:formItemsConfig="formItemsConfig"
|
:defValuesConfig="defValuesConfig"
|
:formRulesConfig="formRulesConfig"
|
:condformdefConfig="condformdefConfig"
|
:operateBtns="operateBtns"
|
:buttonsArr="[]"
|
:userDefined="true"
|
rowKeyName="dirno"
|
:isParentOperate="true"
|
@handleClickRowBtn="handleClickRowBtn"
|
listApiName="qryCustomerList"
|
/>
|
</div>
|
</template>
|
|
<script>
|
import { mapState, mapGetters, mapActions } from "vuex";
|
import TableList from "@/views/components/TableList.vue";
|
import {
|
IMAGEDATACONFIGCOND,
|
IMAGEDATACONFIGDEF
|
} from "./config/condtion.config";
|
import { clientsManageList } from "./config/column.config";
|
import { IMAGEDATACONFIGDEFVALUE } from "./config/defValues.config";
|
import { IMAGEDATACONFIGRULES } from "./config/rules.config";
|
import { IMAGEDATACONFIGFORM } from "./config/formItem.config";
|
import { qryDropDownOption, qryEntInfoDetail } from "@/http/api";
|
export default {
|
props: {},
|
provide() {
|
return {
|
getconfigInfo: this.getconfigInfo,
|
getconfigForm: this.getconfigForm
|
};
|
},
|
data() {
|
return {
|
condtionConfig: [...IMAGEDATACONFIGCOND],
|
columnConfig: [...clientsManageList],
|
formItemsConfig: [...IMAGEDATACONFIGFORM],
|
defValuesConfig: { ...IMAGEDATACONFIGDEFVALUE },
|
formRulesConfig: { ...IMAGEDATACONFIGRULES },
|
condformdefConfig: { ...IMAGEDATACONFIGDEF },
|
optionsData: [],
|
optionsArr: "CustomerType",
|
operateBtns: [
|
{ label: "详情", type: "DETAIL", value: true },
|
{ label: "修改", type: "EDIT", value: true }
|
]
|
};
|
},
|
computed: {
|
// 获取state值
|
...mapState("rlc", {
|
optionsMap: state => state.OPTIONSMAP
|
}),
|
// 通过getters获取值
|
...mapGetters("rlc", ["getOptionsMap"])
|
},
|
watch: {
|
optionsMap: {
|
handler(options) {
|
this.optionsData = options;
|
this.getconfigInfo(options);
|
},
|
deep: true
|
}
|
},
|
async created() {
|
await this.getDictionaryList("customerType", "CustomerType");
|
},
|
methods: {
|
async getDictionaryList(name, conditionName) {
|
const params = { conditionName };
|
const re = await qryDropDownOption(params);
|
if (re.code && re.code === "00") {
|
this.setFormInfo(name, { options: re.result });
|
}
|
},
|
// 更新表单数据
|
setFormInfo(nameKey, newInfo) {
|
const { condtionConfig } = this;
|
const index = condtionConfig.findIndex(({ name }) => name === nameKey);
|
this.$set(this.condtionConfig, index, {
|
...condtionConfig[index],
|
...newInfo
|
});
|
},
|
getconfigInfo(options = this.optionsData) {
|
const items = {
|
customerType: "CustomerType",
|
businesstype: "ProductCode",
|
imagetype: "ImageType",
|
flowSelect: "flowModelList",
|
phaseno: "phaseno"
|
};
|
this.condtionConfig = [...IMAGEDATACONFIGCOND].map(form => {
|
const newForm = { ...form };
|
if (newForm.type === "select") {
|
newForm.options = options[items[newForm.name]];
|
}
|
return newForm;
|
});
|
},
|
getconfigForm() {},
|
async handleClickRowBtn(type, item) {
|
const { customerId, customerTypeCode } = item;
|
// 编辑详情
|
if (type === "EDIT") {
|
this.$router.push({
|
name: "clientsModify",
|
query: { operation: "01", customerId, customerTypeCode }
|
});
|
}
|
// 处理详情
|
if (type === "DETAIL") {
|
// const { result } = await qryEntInfoDetail({ customerId });
|
this.$router.push({
|
name: "clientsDetail",
|
query: { operation: "02", customerId, customerTypeCode }
|
});
|
}
|
}
|
},
|
components: { TableList }
|
};
|
</script>
|
|
<style scoped>
|
</style>
|