diff --git a/src/components/CompanySelect/index.vue b/src/components/CompanySelect/index.vue new file mode 100644 index 0000000..c7cb84a --- /dev/null +++ b/src/components/CompanySelect/index.vue @@ -0,0 +1,141 @@ + + + \ No newline at end of file diff --git a/src/components/InfoForm/index.vue b/src/components/InfoForm/index.vue index 49b06ef..b121fb3 100644 --- a/src/components/InfoForm/index.vue +++ b/src/components/InfoForm/index.vue @@ -28,7 +28,8 @@ - + - + @@ -448,24 +449,24 @@ export default { mounted() {}, created() {}, methods: { - initCompanyList() { - if(this.company_currentPage > this.companyOptions.length) return - this.company_currentPage += 10; - }, - filterMethod(val) { - this.name_loading = true; - request({ - url: `/Extend/basecomapnyinfo/GetNoPagingList`, - method: "GET", - params: { - companyName: val, - } - }).then(({data}) => { - this.companyOptions = data; - this.name_loading = false; + // initCompanyList() { + // if(this.company_currentPage > this.companyOptions.length) return + // this.company_currentPage += 10; + // }, + // filterMethod(val) { + // this.name_loading = true; + // request({ + // url: `/Extend/basecomapnyinfo/GetNoPagingList`, + // method: "GET", + // params: { + // companyName: val, + // } + // }).then(({data}) => { + // this.companyOptions = data; + // this.name_loading = false; - }) - }, + // }) + // }, handleAvatarSuccess(response, file, fileList) { if(response.code != 200) return; this.infoForm.systemIconModel = { @@ -481,16 +482,16 @@ export default { }); }, // 请求公司列表 - async initCompanyList() { - this.name_loading = true; - request({ - url: `/Extend/basecomapnyinfo/GetNoPagingList`, - method: "GET", - }).then(({data}) => { - this.companyOptions = data; - this.name_loading = false; - }) - }, + // async initCompanyList() { + // this.name_loading = true; + // request({ + // url: `/Extend/basecomapnyinfo/GetNoPagingList`, + // method: "GET", + // }).then(({data}) => { + // this.companyOptions = data; + // this.name_loading = false; + // }) + // }, async companyChange(val) { // 公司信息 let { data } = await getCompanyInfoById(val); @@ -543,7 +544,7 @@ export default { this.isFilings = false; this.reset(); this.infoForm_loading = true; - await this.initCompanyList(); + // await this.initCompanyList(); await this.initSystemTypeList(); // await this.initCommunicationOutOptions(); await this.initAreaTypeList(); diff --git a/src/components/index.js b/src/components/index.js index b1fce4a..cad303a 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -35,6 +35,7 @@ import RelationFormAttr from '@/components/Generator/components/RelationFormAttr import RelationFlow from '@/components/Generator/components/RelationFlow' import RelationFlowAttr from '@/components/Generator/components/RelationFlowAttr' import Calculate from '@/components/Generator/components/Calculate' +import CompanySelect from '@/components/CompanySelect' export default { install(Vue, options) { @@ -74,6 +75,6 @@ export default { Vue.component('Screenfull', Screenfull) Vue.component('ColumnSettings', ColumnSettings) Vue.component('FormDialog', FormDialog) - + Vue.component('CompanySelect', CompanySelect) } } \ No newline at end of file diff --git a/src/views/baseCaseHandling/Form.vue b/src/views/baseCaseHandling/Form.vue index e8a172a..67dd2b8 100644 --- a/src/views/baseCaseHandling/Form.vue +++ b/src/views/baseCaseHandling/Form.vue @@ -36,7 +36,8 @@ --> - + @@ -454,7 +455,7 @@ export default { this.getplatformTypeOptions(); this.initSystemTypeList(); this.initAreaTypeList(); - this.initCompanyList(); + // this.initCompanyList(); }, mounted() {}, methods: { @@ -464,31 +465,31 @@ export default { this.platformTypeOptions = list; }, // 请求公司列表 - async initCompanyList() { - request({ - url: `/Extend/basecomapnyinfo/GetNoPagingList`, - method: "GET", - }).then(({data}) => { - this.companyOptions = data; - }) - }, - moreCompanyList() { - if(this.company_currentPage > this.companyOptions.length) return; - this.company_currentPage += 10; - }, - async filterMethod(val) { - this.company_currentPage = 20; - this.name_loading = true - let companyRes = await request({ - url: `/Extend/basecomapnyinfo/GetNoPagingList`, - method: "GET", - params: { - companyName: val - } - }); - this.companyOptions = companyRes.data; - this.name_loading = false; - }, + // async initCompanyList() { + // request({ + // url: `/Extend/basecomapnyinfo/GetNoPagingList`, + // method: "GET", + // }).then(({data}) => { + // this.companyOptions = data; + // }) + // }, + // moreCompanyList() { + // if(this.company_currentPage > this.companyOptions.length) return; + // this.company_currentPage += 10; + // }, + // async filterMethod(val) { + // this.company_currentPage = 20; + // this.name_loading = true + // let companyRes = await request({ + // url: `/Extend/basecomapnyinfo/GetNoPagingList`, + // method: "GET", + // params: { + // companyName: val + // } + // }); + // this.companyOptions = companyRes.data; + // this.name_loading = false; + // }, // 获取系统列表 getSystemSelect(companyId) { this.system_loading = true; @@ -549,24 +550,38 @@ export default { let input = this.$refs.select.$children[0].$refs.input; input.blur(); }, - companyChange(val, type) { - let obj = this.companyOptions.find(v => val == v.id); - obj ? this.getSystemSelect(val) : (this.systemOption == []); - this.dataForm.systemName = ''; - this.dataForm.category = ''; - }, - // 运营主体改变 - selectCompanyBlur(e) { - let value = e.target.value; - if(!value) return; - this.dataForm.registeredEntity = e.target.value; - this.companyChange(value, 'blur'); - }, - visibleNameCompanyChange(val) { - if (val) return - let input = this.$refs.companySelect.$children[0].$refs.input; - input.blur(); + async companyChange(val, type) { + switch (type) { + case 'change': + this.getSystemSelect(val) + break; + case 'blur': + this.systemOption == []; + this.dataForm.systemName = ''; + this.dataForm.category = ''; + break; + default: + break; + } }, + // companyChange(val, type) { + // let obj = this.companyOptions.find(v => val == v.id); + // obj ? this.getSystemSelect(val) : (this.systemOption == []); + // this.dataForm.systemName = ''; + // this.dataForm.category = ''; + // }, + // // 运营主体改变 + // selectCompanyBlur(e) { + // let value = e.target.value; + // if(!value) return; + // this.dataForm.registeredEntity = e.target.value; + // this.companyChange(value, 'blur'); + // }, + // visibleNameCompanyChange(val) { + // if (val) return + // let input = this.$refs.companySelect.$children[0].$refs.input; + // input.blur(); + // }, goBack() { this.$emit("refresh"); }, @@ -602,6 +617,7 @@ export default { !res.data.closingReportFileModel && (res.data.closingReportFileModel = []); this.isEmpty(res.data.other) && (res.data.other = ''); !res.data.otherFileModel && (res.data.otherFileModel = []); + this.companyChange(res.data.registeredEntity, 'change'); this.dataForm = res.data; this.loading = false; }).catch(() => { diff --git a/src/views/baseInspectionReport/Form.vue b/src/views/baseInspectionReport/Form.vue index ee64dd7..486b4c0 100644 --- a/src/views/baseInspectionReport/Form.vue +++ b/src/views/baseInspectionReport/Form.vue @@ -34,7 +34,8 @@ - + @@ -398,11 +399,11 @@ export default { mounted() {}, methods: { async initAllList() { - let companyRes = await request({ - url: `/Extend/basecomapnyinfo/GetNoPagingList`, - method: "GET", - }); - this.companyOptions = companyRes.data; + // let companyRes = await request({ + // url: `/Extend/basecomapnyinfo/GetNoPagingList`, + // method: "GET", + // }); + // this.companyOptions = companyRes.data; let SourceRes = await request({ url: `/Extend/baseinspectionreport/GetReportSourceList`, method: "GET", @@ -417,23 +418,23 @@ export default { // this.name_loading = true // this.name_loading = false; }, - async initCompanyList() { - if(this.company_currentPage > this.companyOptions.length) return; - this.company_currentPage += 10; - }, - async filterMethod(val) { - this.company_currentPage = 20; - this.name_loading = true - let companyRes = await request({ - url: `/Extend/basecomapnyinfo/GetNoPagingList`, - method: "GET", - params: { - companyName: val - } - }); - this.companyOptions = companyRes.data; - this.name_loading = false; - }, + // async initCompanyList() { + // if(this.company_currentPage > this.companyOptions.length) return; + // this.company_currentPage += 10; + // }, + // async filterMethod(val) { + // this.company_currentPage = 20; + // this.name_loading = true + // let companyRes = await request({ + // url: `/Extend/basecomapnyinfo/GetNoPagingList`, + // method: "GET", + // params: { + // companyName: val + // } + // }); + // this.companyOptions = companyRes.data; + // this.name_loading = false; + // }, selectBlur(e) { let value = e.target.value; if(!value) return; @@ -461,34 +462,54 @@ export default { let input = this.$refs.select.$children[0].$refs.input; input.blur(); }, - - // 运营主体改变 - selectCompanyBlur(e) { - let value = e.target.value; - if(!value) return; - this.dataForm.company = e.target.value; - this.companyChange(value, 'blur'); - }, async companyChange(val, type) { - let obj = this.companyOptions.find(v => val == v.id); - obj && await request({ - url: `/Extend/basesysteminfo/GetNoPagingList`, - method: "GET", - params: { companyId: val } - }).then(({data}) => { - if(!data) return; - this.nameOptions = data; - }); - if(!type) return; - !obj && this.nameOptions == []; - this.dataForm.platformName = ''; - this.dataForm.platformType = ''; - }, - visibleNameCompanyChange(val) { - if (val) return - let input = this.$refs.companySelect.$children[0].$refs.input; - input.blur(); + switch (type) { + case 'change': + let { data } = await request({ + url: `/Extend/basesysteminfo/GetNoPagingList`, + method: "GET", + params: { companyId: val } + }); + if(!data) return; + this.nameOptions = data; + break; + case 'blur': + this.nameOptions == []; + this.dataForm.platformName = ''; + this.dataForm.platformType = ''; + break; + default: + break; + } }, + + // // 运营主体改变 + // selectCompanyBlur(e) { + // let value = e.target.value; + // if(!value) return; + // this.dataForm.company = e.target.value; + // this.companyChange(value, 'blur'); + // }, + // async companyChange(val, type) { + // let obj = this.companyOptions.find(v => val == v.id); + // obj && await request({ + // url: `/Extend/basesysteminfo/GetNoPagingList`, + // method: "GET", + // params: { companyId: val } + // }).then(({data}) => { + // if(!data) return; + // this.nameOptions = data; + // }); + // if(!type) return; + // !obj && this.nameOptions == []; + // this.dataForm.platformName = ''; + // this.dataForm.platformType = ''; + // }, + // visibleNameCompanyChange(val) { + // if (val) return + // let input = this.$refs.companySelect.$children[0].$refs.input; + // input.blur(); + // }, loadList() { this.name_loading = true; request({ @@ -528,6 +549,7 @@ export default { this.visible = true; this.isDetail = isDetail || false; this.form_loading = true; + this.btnLoading = false; await this.initAreaTypeList(); await this.initAllList(); this.$nextTick(async () => { @@ -535,7 +557,7 @@ export default { if (this.dataForm.id) { this.form_loading = true; let res = await getDetail(this.dataForm.id); - await this.companyChange(res.data.company, false); + await this.companyChange(res.data.company, 'change'); if(res.code != 200) return this.form_loading = false; if(!res.data) return; this.dataForm = res.data; @@ -551,6 +573,7 @@ export default { } this.dataForm.selfMediaPlatformType = res.data.selfMediaPlatformType || '--'; this.form_loading = false; + console.log(this.dataForm, 'this.dataForm'); } else { this.form_loading = false; } @@ -559,6 +582,7 @@ export default { dataFormSubmit() { this.$refs["elForm"].validate(async (valid) => { if (valid) { + console.log(this.dataForm, 'this.dataForm'); let obj = { ...this.dataForm, questionType: this.dataForm.questionType == '0' ? this.dataForm.otherQuestionType : this.dataForm.questionType, diff --git a/src/views/baseListHazardousSamples/index.vue b/src/views/baseListHazardousSamples/index.vue index a18c5e6..814de38 100644 --- a/src/views/baseListHazardousSamples/index.vue +++ b/src/views/baseListHazardousSamples/index.vue @@ -38,7 +38,8 @@ - + @@ -170,35 +171,35 @@ export default { computed: {}, created() { this.initData(); - this.getcompanyOptions(); + // this.getcompanyOptions(); }, methods: { - getcompanyOptions() { - this.name_loading = true; - request({ - url: `/Extend/basecomapnyinfo/GetNoPagingList`, - method: "GET", - }).then(({data}) => { - this.companyOptions = data; - this.name_loading = false; - }) - }, - moreCompanyList() { - if(this.company_currentPage > this.companyOptions.length) return - this.company_currentPage += 10; - }, - filterMethod(val) { - this.company_currentPage = 20; - this.name_loading = true; - request({ - url: `/Extend/basecomapnyinfo/GetNoPagingList`, - method: "GET", - params: { companyName: val } - }).then(({data}) => { - this.companyOptions = data; - this.name_loading = false; - }) - }, + // getcompanyOptions() { + // this.name_loading = true; + // request({ + // url: `/Extend/basecomapnyinfo/GetNoPagingList`, + // method: "GET", + // }).then(({data}) => { + // this.companyOptions = data; + // this.name_loading = false; + // }) + // }, + // moreCompanyList() { + // if(this.company_currentPage > this.companyOptions.length) return + // this.company_currentPage += 10; + // }, + // filterMethod(val) { + // this.company_currentPage = 20; + // this.name_loading = true; + // request({ + // url: `/Extend/basecomapnyinfo/GetNoPagingList`, + // method: "GET", + // params: { companyName: val } + // }).then(({data}) => { + // this.companyOptions = data; + // this.name_loading = false; + // }) + // }, initData() { this.listLoading = true; let _query = { @@ -216,7 +217,7 @@ export default { request({ url: `/extend/BaseListHazardousSamples`, method: "GET", - data: query, + params: query, }).then((res) => { this.list = res.data.list; this.total = res.data.pagination.total; diff --git a/src/views/basePrincipalResponsibility/index.vue b/src/views/basePrincipalResponsibility/index.vue index 0ebd11a..416961c 100644 --- a/src/views/basePrincipalResponsibility/index.vue +++ b/src/views/basePrincipalResponsibility/index.vue @@ -135,7 +135,7 @@ export default { request({ url: `/Extend/BasePrincipalResponsibility`, method: "GET", - data: query, + params: query, }).then((res) => { this.list = res.data.list; this.total = res.data.pagination.total; diff --git a/src/views/baseSystemInfo/InspectForm.vue b/src/views/baseSystemInfo/InspectForm.vue index 12c8ad9..6f56b3d 100644 --- a/src/views/baseSystemInfo/InspectForm.vue +++ b/src/views/baseSystemInfo/InspectForm.vue @@ -284,14 +284,14 @@ export default { this.platformTypeOptions = list; }, // 请求公司列表 - async initCompanyList() { - request({ - url: `/Extend/basecomapnyinfo/GetNoPagingList`, - method: "GET", - }).then(({data}) => { - this.companyOptions = data; - }) - }, + // async initCompanyList() { + // request({ + // url: `/Extend/basecomapnyinfo/GetNoPagingList`, + // method: "GET", + // }).then(({data}) => { + // this.companyOptions = data; + // }) + // }, // 获取系统列表 getSystemSelect(companyId) { this.system_loading = true;