feat(qc/inspection): 新增检验任务方案选择的公司和默认选中参数
1. 给SchemeSelect组件新增company和scheme两个props 2. 组件内新增模板单位查询参数并关联传入的company值 3. 组件挂载/重置时自动匹配并选中传入的默认方案 4. 同步更新表单内的归属公司和任务类型字段初始化
This commit is contained in:
@@ -180,6 +180,14 @@ export default {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
company: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
scheme: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -194,11 +202,16 @@ export default {
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 999,
|
||||
templateName: undefined
|
||||
templateName: undefined,
|
||||
templateUnit: undefined
|
||||
},
|
||||
selectedCoils: [],
|
||||
form: {
|
||||
taskCode: undefined
|
||||
taskCode: undefined,
|
||||
taskType: undefined,
|
||||
belongCompany: undefined,
|
||||
enterCoilNos: undefined,
|
||||
supplierCoilNos: undefined
|
||||
},
|
||||
schemeAddOpen: false,
|
||||
schemeAddLoading: false,
|
||||
@@ -239,12 +252,16 @@ export default {
|
||||
this.selectedTemplate = null;
|
||||
this.checkItemList = [];
|
||||
this.form.taskCode = undefined;
|
||||
this.form.belongCompany = undefined;
|
||||
this.form.taskType = undefined;
|
||||
this.selectedCoils = [];
|
||||
this.selectedEnterCoilNos = [];
|
||||
this.tempEnterCoilNo = '';
|
||||
this.selectedSupplierCoilNos = [];
|
||||
this.tempSupplierCoilNo = '';
|
||||
this.enterCoilNoError = false;
|
||||
this.queryParams.templateName = undefined;
|
||||
this.queryParams.templateUnit = this.company || undefined;
|
||||
this.getList();
|
||||
}
|
||||
}
|
||||
@@ -256,6 +273,12 @@ export default {
|
||||
this.templateList = response.rows || [];
|
||||
this.total = response.total || 0;
|
||||
this.loading = false;
|
||||
if (this.scheme && this.templateList.length > 0) {
|
||||
const match = this.templateList.find(t => t.templateName === this.scheme);
|
||||
if (match) {
|
||||
this.handleSchemeClick(match);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
handleQuery() {
|
||||
|
||||
@@ -406,7 +406,7 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<SchemeSelect :visible.sync="schemeVisible" @confirm="handleSchemeConfirm" />
|
||||
<SchemeSelect :visible.sync="schemeVisible" @confirm="handleSchemeConfirm" :company="selectedCompany" :scheme="selectedScheme" />
|
||||
|
||||
<el-dialog :title="attachmentTitle" :visible.sync="attachmentOpen" width="500px" append-to-body>
|
||||
<file-upload v-model="attachmentFiles" :limit="10" />
|
||||
|
||||
Reference in New Issue
Block a user