diff --git a/src/api/customerManagement/companyManagement.js b/src/api/customerManagement/companyManagement.js index 158d279..ac8f3b2 100644 --- a/src/api/customerManagement/companyManagement.js +++ b/src/api/customerManagement/companyManagement.js @@ -23,11 +23,15 @@ const liekQuery = (query) => { const save = (params) => { return request.postJson("/oil-user/oilCompanyInfo/save", params); }; - +// 用户详情 +const getInfo = (id) => { + return request.get(`/oil-user/oilCompanyInfo/get/${id}`); +}; export default { getByPage, getCompanyAccountRecord, update, liekQuery, save, + getInfo, }; diff --git a/src/views/customerManagement/companyManagement/components/add.vue b/src/views/customerManagement/companyManagement/components/add.vue index 5794d29..d474136 100644 --- a/src/views/customerManagement/companyManagement/components/add.vue +++ b/src/views/customerManagement/companyManagement/components/add.vue @@ -48,7 +48,7 @@ v-for="(item, index) in companyNatureTypeEnum" :key="index" :label="item.label" - :value="item.value" + :value="+item.value" /> @@ -56,7 +56,7 @@ - + @@ -110,9 +110,11 @@ export default { serveTarget: commonServe.getRefineryCompanyList, autocompleteKey: "name", labelKey: "name", - valueKey: "id", - placeholder: "企业名称", + valueKey: "parentId", + placeholder: "上级公司", querykey: "parentId", + echoId: "", + echoName: "", }, configAutocompleteLeader: { serveTarget: serve.liekQuery, @@ -120,6 +122,8 @@ export default { valueKey: "id", placeholder: "企业负责人", querykey: "businessLeader", + echoId: "", + echoName: "", }, form: {}, rules: { @@ -163,12 +167,40 @@ export default { //回显 this.form = JSON.parse(JSON.stringify(this.controlWindows.addInfo)); } + // 上级公司 + let configUpdata = id + ? { + echoId: this.form.parentId, + echoName: this.form.name, + } + : { + echoId: "", + echoName: "", + }; + // 企业负责人 + let configUpdataLeader = id + ? { + echoId: this.form.businessLeader, + echoName: this.form.businessLeader, + } + : { + echoId: "", + echoName: "", + }; + Object.assign(this.configAutocomplete, configUpdata); + Object.assign(this.configAutocompleteLeader, configUpdataLeader); }, submit() { this.$refs["form"].validate((valid) => { if (valid) { - this.judgeInterface(this.form).then((res) => { + let params = { + enableMark: 1, + auditMark: 0, + createSource: "REFINERY_OMS_WEB", + ...this.form, + }; + this.judgeInterface(params).then((res) => { if (res.code === 20000) { this.$message.success(res.msg); this.closeWindow(); diff --git a/src/views/customerManagement/companyManagement/index.vue b/src/views/customerManagement/companyManagement/index.vue index a6e80dc..6616360 100644 --- a/src/views/customerManagement/companyManagement/index.vue +++ b/src/views/customerManagement/companyManagement/index.vue @@ -122,7 +122,6 @@ :data="tableData" fit style="width: 100%" - @sort-change="sortHandler" @selection-change="handleSelectionChange" > @@ -275,63 +274,29 @@ width="180px" align="center" > -