|
|
|
@ -63,7 +63,7 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="模板名称" prop="templateName">
|
|
|
|
|
<el-input class="w100" v-model="form.templateName" :disabled="isDisable" placeholder="请输入检测报告模板名称" />
|
|
|
|
|
<el-input class="w100" v-model="form.templateName" :disabled="isDisable" placeholder="请输入检测报告模板名称" maxlength="64" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
@ -71,33 +71,34 @@
|
|
|
|
|
<div class="flex-jend">
|
|
|
|
|
<el-select v-model="tempId" placeholder="请先选择商户" class="w160 mr-10">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="(item,index) in tempList"
|
|
|
|
|
:key="index"
|
|
|
|
|
:label="item.templateName"
|
|
|
|
|
:value="index"></el-option>
|
|
|
|
|
v-for="(item,index) in tempList"
|
|
|
|
|
:key="index"
|
|
|
|
|
:label="item.templateName"
|
|
|
|
|
:value="item.id"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-button :disabled="tempId!==undefined?false:true" @click="form.inspectionItems = tempList[tempId].inspectionItems">导入模板</el-button>
|
|
|
|
|
<el-button :disabled="tempId!==undefined?false:true" @click="importTemplate">导入模板</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<el-table class="mt20" :data="form.inspectionItems" style="width: 100%">
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="inspectionItem"
|
|
|
|
|
label="检测项目">
|
|
|
|
|
<template v-slot="{ row }">
|
|
|
|
|
<el-input class="w100" placeholder="请输入" v-model="row.inspectionItem"></el-input>
|
|
|
|
|
<el-input class="w100" placeholder="请输入" v-model="row.inspectionItem" maxlength="64" ></el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="inspectionUnit"
|
|
|
|
|
label="单位">
|
|
|
|
|
<template v-slot="{ row }">
|
|
|
|
|
<el-input class="w100" placeholder="请输入" v-model="row.inspectionUnit"></el-input>
|
|
|
|
|
<el-input class="w100" placeholder="请输入" v-model="row.inspectionUnit" maxlength="64" ></el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="inspectionRequire"
|
|
|
|
|
label="技术要求">
|
|
|
|
|
<template v-slot="{ row }">
|
|
|
|
|
<el-input class="w100" placeholder="请输入" v-model="row.inspectionRequire"></el-input>
|
|
|
|
|
<el-input class="w100" placeholder="请输入" v-model="row.inspectionRequire" maxlength="255" ></el-input>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
@ -228,6 +229,8 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
/** 表单重置 */
|
|
|
|
|
reset() {
|
|
|
|
|
this.tempId = undefined;
|
|
|
|
|
this.tempList = [];
|
|
|
|
|
this.form = {
|
|
|
|
|
id: undefined,
|
|
|
|
|
templateName: undefined,
|
|
|
|
@ -264,6 +267,7 @@ export default {
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "修改检测报告模板";
|
|
|
|
|
this.isDisable = true;
|
|
|
|
|
this.getTemplateList(this.form.belongBusinessId);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
@ -312,28 +316,33 @@ export default {
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
},
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
handleExport() {
|
|
|
|
|
// 处理查询参数
|
|
|
|
|
let params = {...this.queryParams};
|
|
|
|
|
params.pageNo = undefined;
|
|
|
|
|
params.pageSize = undefined;
|
|
|
|
|
this.$modal.confirm('是否确认导出所有检测报告模板数据项?').then(() => {
|
|
|
|
|
this.exportLoading = true;
|
|
|
|
|
return exportInspectionTemplateExcel(params);
|
|
|
|
|
}).then(response => {
|
|
|
|
|
this.$download.excel(response, '检测报告模板.xls');
|
|
|
|
|
this.exportLoading = false;
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
},
|
|
|
|
|
changeBusiness(e){
|
|
|
|
|
this.$nextTick(async () => {
|
|
|
|
|
let label = this.$refs.businessName.selected.label;
|
|
|
|
|
this.form.belongBusinessName = label;
|
|
|
|
|
let res = await getByBusinessId({businessId:e});
|
|
|
|
|
if(res.data) this.tempList = res.data;
|
|
|
|
|
this.getTemplateList(e);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
getTemplateList(businessId) {
|
|
|
|
|
getByBusinessId({ businessId }).then(({ data }) => {
|
|
|
|
|
this.tempList = data;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
importTemplate() {
|
|
|
|
|
if (this.tempId === undefined) {
|
|
|
|
|
this.$message.error("请先选择模板");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const template = this.tempList.find(item => item.id == this.tempId);
|
|
|
|
|
if (template) {
|
|
|
|
|
this.form.inspectionItems = template.inspectionItems.map(item => {
|
|
|
|
|
return {
|
|
|
|
|
...item,
|
|
|
|
|
id: undefined,
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|