<template>
|
<div class="apply-info">
|
<div class="dialog-form">
|
<p class="dialog-form-title">产品额度详情</p>
|
<CommForm
|
:inline="true"
|
:list="formList"
|
@updateValue="updateValue"
|
ref="editMarkForm"
|
:column="2"
|
:key="key"
|
formType="text"
|
></CommForm>
|
<div class="dialog-form-buttons">
|
<p>
|
<el-button class="comm-button" @click="$emit('close')">关闭</el-button>
|
</p>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import CommForm from "@/components/CommForm";
|
|
import quotaControlProductList from "@/controller/quotaControlProductList";
|
|
export default {
|
components: {
|
CommForm
|
},
|
props: {
|
tempRecord: {
|
type: Object,
|
default: () => {}
|
},
|
isShow: {
|
type: Boolean,
|
default: false
|
}
|
},
|
created() {
|
this.init();
|
},
|
data() {
|
return {
|
key: 0,
|
model: null,
|
formList: []
|
};
|
},
|
methods: {
|
init() {
|
const { tempRecord } = this;
|
const { quotaControlType } = tempRecord;
|
this.model = quotaControlProductList({ search:'detail' });
|
this.getFormList();
|
},
|
getFormList() {
|
const { model, tempRecord, detail } = this;
|
// const { controlSerialNo, serialNo } = tempRecord;
|
// const info = await model.request({ controlSerialNo, serialNo });
|
this.formList = model.getFormList(tempRecord);
|
},
|
// 更新表单数据
|
updateValue(index, info) {
|
const { formList } = this;
|
if (isNaN(index)) {
|
// index is name
|
index = formList.findIndex(({ name }) => name === index);
|
}
|
if (!isNaN(index) && index > -1) {
|
const preInfo = formList[index];
|
this.$set(formList, index, { ...preInfo, ...info });
|
}
|
}
|
},
|
watch: {
|
isShow() {
|
const { isShow, key } = this;
|
this.key = key + 1;
|
if (isShow) {
|
this.init();
|
}
|
}
|
}
|
};
|
</script>
|
|
<style lang="postcss" scoped>
|
.dialog-form {
|
& .dialog-form-buttons {
|
display: flex;
|
justify-content: center;
|
padding: 50px 0 10px 0;
|
& p {
|
margin: 0 40px 0 0;
|
}
|
& p:last-child {
|
margin-right: 0;
|
}
|
}
|
}
|
</style>
|