diff --git a/src/utils/request.js b/src/utils/request.js index fcf7420..6535e62 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -53,7 +53,7 @@ service.interceptors.request.use(config => { } // 处理 GET 请求 - if (config.method === 'get' && config.params) { + /* if (config.method === 'get' && config.params) { let params = tansParams(config.params).slice(0, -1) // 数据完整性校验 if (CONFIG.dataSettings.integrityCheck && checkIntegrity) { @@ -65,6 +65,14 @@ service.interceptors.request.use(config => { } config.url = `${config.url}?${params}` config.params = {} + } */ + + // get请求映射params参数 + if (config.method === 'get' && config.params) { + let url = config.url + '?' + tansParams(config.params); + url = url.slice(0, -1); + config.params = {}; + config.url = url; } if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) { diff --git a/src/views/base/agreement/components/form-protocol.vue b/src/views/base/agreement/components/form-protocol.vue index f8222b5..6094253 100644 --- a/src/views/base/agreement/components/form-protocol.vue +++ b/src/views/base/agreement/components/form-protocol.vue @@ -11,13 +11,20 @@ - --> + @@ -31,7 +38,7 @@ - --> + @@ -151,8 +165,14 @@ export default { this.getRanges() }, mounted() { + console.log(this.editParams) if (this.editParams) { Object.assign(this.protocolParams, this.editParams) + this.fileList = [] + this.fileList.push({ + name: this.protocolParams.url, + url: this.protocolParams.url + }) this.subSort = 2 } else { this.subSort = 1 @@ -207,22 +227,50 @@ export default { authorizingPhone: [ { required: true, - message: '请输入联系电话', + validator: this.validatePhone, + message: '请输入正确格式的手机号', trigger: 'blur', }, ], }, + phoneReg: /^(?:(?:\+|00)86)?1[3-9]\d{9}$/ } }, methods: { + /** 联系电话校验 */ + validatePhone(rule, value, callback) { + if(!this.phoneReg.test(value)) { + callback(new Error('请输入正确格式的手机号')) + } else { + callback() + } + }, + /** 级联选择器改变 */ + customerChange(e) { + console.log(e) + this.protocolParams.customer = e[e.length - 1] + }, + projChange(e) { + this.protocolParams.project = e[e.length - 1] + }, /** 查询各类下拉框 */ async getRanges() { // 往来单位 let unitRes = await queryleaseUnitApi() - this.unitSelRange = unitRes.data + this.unitSelRange = this.changeTree(unitRes.data) // 租赁工程 let projRes = await queryleaseProjApi() - this.projSelRange = projRes.data + this.projSelRange = this.changeTree(projRes.data) + }, + /** 改变树结构 */ + changeTree(leaf) { + leaf.map(item => { + item.value = item.id + if(item.children) { + this.changeTree(item.children) + } + }) + return leaf }, /** 树禁选父级 */ changeData(data) { // 存在子集就不让禁止,父级让禁止 @@ -236,24 +284,6 @@ export default { }) return data; }, - handleBeforeSelect(node, isSelected) { - if (node.children && node.children.length) { - // Prevent parent nodes from being selected - return !isSelected; - } - return true; - }, - /** 树优化 */ - leadersNormalizer(node) { - if (node.children && !node.children.length) { - delete node.children; - } - return { - id: node.id, - label: node.label, - children: node.children - }; - }, /** 上传图片/文件 */ uploadData(param) { console.log(param) @@ -289,19 +319,22 @@ export default { // 1. 表单校验通过后调后台 Api if(this.subSort === 1) { addProtocolApi(this.protocolParams).then(res => { - console.log(res) + this.$modal.msgSuccess('操作成功') + // 2. 成功之后通知父组件关闭弹框 + this.$emit('closeDialog', true) }).catch(err => { console.log(err) }) } else if(this.subSort === 2) { editProtocolApi(this.protocolParams).then(res => { - console.log(res) + this.$modal.msgSuccess('操作成功') + // 2. 成功之后通知父组件关闭弹框 + this.$emit('closeDialog', true) }).catch(err => { console.log(err) }) } - // 2. 成功之后通知父组件关闭弹框 - this.$emit('closeDialog', true) + } }) }, diff --git a/src/views/base/agreement/config.js b/src/views/base/agreement/config.js index 4023173..bf32bf4 100644 --- a/src/views/base/agreement/config.js +++ b/src/views/base/agreement/config.js @@ -7,10 +7,10 @@ export const formLabel = [ { f_label: '开始时间', f_model: 'startTime', f_type: 'date' }, { f_label: '结束时间', f_model: 'endTime', f_type: 'date' }, { f_label: '关键字', f_model: 'keyWord', f_type: 'ipt' }, - { f_label: '状态', f_model: 'isBalance', f_type: 'sel', f_selList: agreementStatus }, + // { f_label: '状态', f_model: 'isBalance', f_type: 'sel', f_selList: agreementStatus }, ] export const columnsList = [ - { t_props: 'signDate', t_label: '协议签订时间', }, + // { t_props: 'signDate', t_label: '协议签订时间', }, { t_props: 'code', t_label: '协议编号' }, { t_props: 'contractNumber', t_label: '合同编号' }, { t_props: 'unitName', t_label: '租赁单位', }, diff --git a/src/views/base/customer/components/form-contact-units.vue b/src/views/base/customer/components/form-contact-units.vue index a46887d..4070cf6 100644 --- a/src/views/base/customer/components/form-contact-units.vue +++ b/src/views/base/customer/components/form-contact-units.vue @@ -22,13 +22,20 @@ - --> + @@ -146,7 +153,22 @@ export default { }) // 获取所属分公司树 let companyRes = await queryCompanyTreeApi() - this.companyRange = companyRes.data + this.companyRange = this.changeTree(companyRes.data) + }, + /** 改变树结构 */ + changeTree(leaf) { + leaf.map(item => { + item.value = item.id + if(item.children) { + this.changeTree(item.children) + } + }) + return leaf + }, + /** 级联选择器改变 */ + handleCas(e) { + console.log(e) + this.contactUnitsParams.companyId = e[e.length - 1] }, /** 确认按钮 */ onSubmit() { @@ -156,15 +178,17 @@ export default { // 1. 表单校验通过后调后台 Api if(this.subSort === 1) { addContactUnitsApi(this.contactUnitsParams).then(res => { - console.log(res) + this.$modal.msgSuccess('操作成功') + // 2. 成功之后通知父组件关闭弹框 + this.$emit('closeDialog', true) }).catch(err => {}) } else if(this.subSort === 2) { editContactUnitsApi(this.contactUnitsParams).then(res => { - console.log(res) + this.$modal.msgSuccess('操作成功') + // 2. 成功之后通知父组件关闭弹框 + this.$emit('closeDialog', true) }).catch(err => {}) } - // 2. 成功之后通知父组件关闭弹框 - this.$emit('closeDialog', true) } }) }, diff --git a/src/views/base/customer/index.vue b/src/views/base/customer/index.vue index 2abc6d2..a3d2e74 100644 --- a/src/views/base/customer/index.vue +++ b/src/views/base/customer/index.vue @@ -18,9 +18,9 @@ 新建 - 人员配置 + >--> 导出 diff --git a/src/views/base/mixins/common.js b/src/views/base/mixins/common.js index cb42245..40dd412 100644 --- a/src/views/base/mixins/common.js +++ b/src/views/base/mixins/common.js @@ -17,11 +17,8 @@ export const commonMixin = { this.$modal.confirm('是否确定删除').then(() => { console.log('确定删除--', id) method(id).then(res => { - console.log(res) - if(res.code === 200) { - // this.$message.msgSuccess('操作成功!') - this.$refs.tableRef.getTableList() - } + this.$modal.msgSuccess('操作成功!') + this.$refs.tableRef.getTableList() }).catch(err => {}) }) }, diff --git a/src/views/base/project/components/form-project.vue b/src/views/base/project/components/form-project.vue index f9eb15a..8ac05da 100644 --- a/src/views/base/project/components/form-project.vue +++ b/src/views/base/project/components/form-project.vue @@ -24,13 +24,20 @@ - --> + @@ -86,54 +93,58 @@ - - + + + + + + + - - - - - + + + + + - - - {{ projectParams.proId === null || projectParams.proId === undefined || projectParams.proId === '' ? '未 关 联' : '已 关 联' }} - - - + + + + {{ projectParams.proId === null || projectParams.proId === undefined || projectParams.proId === '' ? '未 关 联' : '已 关 联' }} + + + - - 确认 { @@ -279,37 +292,55 @@ export default { } }) }, + /** 改变树结构 */ + changeTree(leaf) { + leaf.map(item => { + item.value = item.id + if(item.children) { + this.changeTree(item.children) + } + }) + return leaf + }, + /** 级联选择器改变 */ + handleCas(e) { + this.projectParams.impUnit = e[e.length - 1] + }, /** 确认按钮 */ onSubmit() { this.$refs.projectParamsRef.validate(valid => { if (valid) { + if(this.projectParams.telphone !== undefined && this.projectParams.telphone !== "" && this.projectParams.telphone !== null) { + if(!this.phoneReg.test(this.projectParams.telphone)) { + this.$modal.msgError('请填写正确的联系方式') + return false + } + } + if(this.projectParams.phone !== undefined && this.projectParams.phone !== "" && this.projectParams.phone !== null) { + if(!this.phoneReg.test(this.projectParams.phone)) { + this.$modal.msgError('请填写正确的手机号') + return false + } + } console.log('校验通过', this.projectParams, this.subSort) // 1. 表单校验通过后调后台 Api if(this.subSort === 1) { - addProjectApi(this.projectParams).then(res => { - console.log(res) - /* if(res.code === 200) { - this.$modal.msgSuccess('新增成功') - } else { - this.$modal.msgError(res.msg) - } */ - }).catch(err => { - console.log(err) - }) + addProjectApi(this.projectParams).then(res => { + this.$modal.msgSuccess('操作成功') + // 2. 成功之后通知父组件关闭弹框 + this.$emit('closeDialog', true) + }).catch(err => { + console.log(err) + }) } else if(this.subSort === 2) { - editProjectApi(this.projectParams).then(res => { - console.log(res) - /* if(res.code === 200) { - this.$modal.msgSuccess('修改成功') - } else { - this.$modal.msgError(res.message) - } */ - }).catch(err => { - console.log(err) - }) + editProjectApi(this.projectParams).then(res => { + this.$modal.msgSuccess('操作成功') + // 2. 成功之后通知父组件关闭弹框 + this.$emit('closeDialog', true) + }).catch(err => { + console.log(err) + }) } - // 2. 成功之后通知父组件关闭弹框 - this.$emit('closeDialog', true) } }) }, diff --git a/src/views/base/project/config.js b/src/views/base/project/config.js index db3e548..2d0afdd 100644 --- a/src/views/base/project/config.js +++ b/src/views/base/project/config.js @@ -4,7 +4,7 @@ export const formLabel = [ ] export const columnsList = [ { t_props: 'name', t_label: '工程项目名称', }, - { t_props: 'impUnit', t_label: '实施单位' }, + { t_props: 'impUnit', t_label: '实施单位', t_slot: 'impUnit' }, { t_props: 'projectTypeName', t_label: '工程类型' }, { t_props: 'proId', t_label: 'i8工程id', }, { t_props: 'isMatch', t_label: '是否匹配i8工程', t_slot: 'isMatch' }, diff --git a/src/views/base/project/index.vue b/src/views/base/project/index.vue index 74ceb36..3547311 100644 --- a/src/views/base/project/index.vue +++ b/src/views/base/project/index.vue @@ -37,6 +37,9 @@ + diff --git a/src/views/base/unitType/components/form-units-type.vue b/src/views/base/unitType/components/form-units-type.vue index 8aa19d1..a8e1937 100644 --- a/src/views/base/unitType/components/form-units-type.vue +++ b/src/views/base/unitType/components/form-units-type.vue @@ -86,19 +86,21 @@ export default { // 1. 表单校验通过后调后台 Api if(this.subSort === 1) { addUnitTypeApi(this.unitsTypeParams).then(res => { - console.log(res) + this.$modal.msgSuccess('操作成功') + // 2. 成功之后通知父组件关闭弹框 + this.$emit('closeDialog', true) }).catch(err => { console.log(err) }) } else if(this.subSort === 2) { editUnitTypeApi(this.unitsTypeParams).then(res => { - console.log(res) + this.$modal.msgSuccess('操作成功') + // 2. 成功之后通知父组件关闭弹框 + this.$emit('closeDialog', true) }).catch(err => { console.log(err) }) } - // 2. 成功之后通知父组件关闭弹框 - this.$emit('closeDialog', true) } }) }, diff --git a/src/views/base/unitType/config.js b/src/views/base/unitType/config.js index d0127b4..b82097d 100644 --- a/src/views/base/unitType/config.js +++ b/src/views/base/unitType/config.js @@ -1,6 +1,6 @@ export const formLabel = [ - { f_label: '单位名称', f_model: 'name', f_type: 'ipt' }, + { f_label: '类型名称', f_model: 'name', f_type: 'ipt' }, ] export const columnsList = [ { t_props: 'name', t_label: '单位类型', }, diff --git a/src/views/material/masupplier/components/form-masupplier.vue b/src/views/material/masupplier/components/form-masupplier.vue index 9a20c47..e70efc4 100644 --- a/src/views/material/masupplier/components/form-masupplier.vue +++ b/src/views/material/masupplier/components/form-masupplier.vue @@ -107,6 +107,11 @@ export default { console.log(this.editParams) if (this.editParams) { Object.assign(this.supplierParams, this.editParams) + this.fileList = [] + this.fileList.push({ + name: this.supplierParams.picUrl, + url: this.supplierParams.picUrl + }) this.subSort = 2 } else { this.subSort = 1 @@ -185,20 +190,22 @@ export default { // 1. 表单校验通过后调后台 Api if(this.subSort === 1) { addSupplierListApi(this.supplierParams).then(res => { - console.log(res) + this.$modal.msgSuccess('操作成功') + // 2. 成功之后通知父组件关闭弹框 + this.$emit('closeDialog', true) }).catch(err => { console.log(err) }) } else if(this.subSort === 2) { - console.log(this.supplierParams) updateSupplierListApi(this.supplierParams).then(res => { - console.log(res) + this.$modal.msgSuccess('操作成功') + // 2. 成功之后通知父组件关闭弹框 + this.$emit('closeDialog', true) }).catch(err => { console.log(err) }) } - // 2. 成功之后通知父组件关闭弹框 - this.$emit('closeDialog', true) + } }) }, diff --git a/src/views/material/mixins/common.js b/src/views/material/mixins/common.js index e55b410..8e19fb8 100644 --- a/src/views/material/mixins/common.js +++ b/src/views/material/mixins/common.js @@ -53,10 +53,18 @@ export const commonMixin = { }, /** 编辑 */ handleEditData(data) { + this.disableForm = false this.editParams = data this.dialogConfig.outerTitle = this.editDialogTitle this.dialogConfig.outerVisible = true }, + /** 查看 */ + handleSee(data) { + this.disableForm = true + this.editParams = data + this.dialogConfig.outerTitle = this.seeDialogTitle + this.dialogConfig.outerVisible = true + }, /** 导入数据 */ handleImportData() { console.log('导入--') diff --git a/src/views/material/storage/components/form-storage.vue b/src/views/material/storage/components/form-storage.vue index 3d6d511..3f22fc8 100644 --- a/src/views/material/storage/components/form-storage.vue +++ b/src/views/material/storage/components/form-storage.vue @@ -79,17 +79,17 @@ export default { // 1. 表单校验通过后调后台 Api if(this.subSort === 1) { addStorageListApi(this.storageParams).then(res => { - console.log(res) this.$modal.msgSuccess('新增成功') + // 2. 成功之后通知父组件关闭弹框 + this.$emit('closeDialog', true) }).catch(err => {}) } else if(this.subSort === 2) { updateStorageListApi(this.storageParams).then(res => { - console.log(res) this.$modal.msgSuccess('修改成功') + // 2. 成功之后通知父组件关闭弹框 + this.$emit('closeDialog', true) }).catch(err => {}) } - // 2. 成功之后通知父组件关闭弹框 - this.$emit('closeDialog', true) } }) }, diff --git a/src/views/material/storage/config.js b/src/views/material/storage/config.js index b71df34..a246915 100644 --- a/src/views/material/storage/config.js +++ b/src/views/material/storage/config.js @@ -4,8 +4,8 @@ export const formLabel = [ ] export const columnsList = [ { t_props: 'name', t_label: '仓库名称', }, - { t_props: 'typeId', t_label: '实物库' }, - { t_props: 'companyId', t_label: '地理位置' }, + /* { t_props: 'typeId', t_label: '实物库' }, + { t_props: 'companyId', t_label: '地理位置' }, */ { t_props: 'remark', t_label: '备注' }, ] export const dialogConfig = { diff --git a/src/views/material/storage/index.vue b/src/views/material/storage/index.vue index 7e9d38a..e6ba58e 100644 --- a/src/views/material/storage/index.vue +++ b/src/views/material/storage/index.vue @@ -12,20 +12,20 @@ 新建 - 配置 - --> + 导出 diff --git a/src/views/material/type/components/form-type.vue b/src/views/material/type/components/form-type.vue index 4544a63..9572487 100644 --- a/src/views/material/type/components/form-type.vue +++ b/src/views/material/type/components/form-type.vue @@ -240,6 +240,7 @@ :model="typeEditParamsLv4" :rules="typeEditParamsLv4Rules" v-if="subSort === 2 && editParams.level === '4'" + :disabled="ifDisabled" > @@ -330,9 +331,11 @@ --> - + - +
确认 @@ -411,6 +414,10 @@ export default { treeMethod: { type: Function, default: () => null + }, + ifDisabled: { + type: Boolean, + default: false } }, created() { @@ -457,15 +464,19 @@ export default { switch(this.sendData.level) { case 0: this.typeParamsLv0.code = res.data.code + this.typeParamsLv0.parentId = this.sendData.id break; case 1: this.typeParamsLv1.code = res.data.code + this.typeParamsLv1.parentId = this.sendData.id break; case 2: this.typeParamsLv2.code = res.data.code + this.typeParamsLv2.parentId = this.sendData.id break; case 3: this.typeParamsLv3.code = res.data.code + this.typeParamsLv3.parentId = this.sendData.id break; } }).catch(err => {}) @@ -540,6 +551,7 @@ export default { manageType: undefined, // 管理方式 // checkRate: undefined, // 抽检比例 unitId: undefined, // 计量单位 + unitName: undefined }, fileList: [], // 租赁单位下拉框 @@ -703,6 +715,8 @@ export default { this.typeParamsLv0.level = this.sendData.level submitAddForm(this.typeParamsLv0).then(res => { this.$modal.msgSuccess('新增成功') + this.$emit('closeDialog', true) + this.treeMethod() }).catch(err => {}) break; case 1: @@ -710,6 +724,8 @@ export default { this.typeParamsLv1.level = this.sendData.level submitAddForm(this.typeParamsLv1).then(res => { this.$modal.msgSuccess('新增成功') + this.$emit('closeDialog', true) + this.treeMethod() }).catch(err => {}) break; case 2: @@ -717,6 +733,8 @@ export default { this.typeParamsLv2.level = this.sendData.level submitAddForm(this.typeParamsLv2).then(res => { this.$modal.msgSuccess('新增成功') + this.$emit('closeDialog', true) + this.treeMethod() }).catch(err => {}) break; case 3: @@ -729,13 +747,11 @@ export default { this.typeParamsLv3.storageNum = Number(this.typeParamsLv3.storageNum) * this.storageDex submitAddForm(this.typeParamsLv3).then(res => { this.$modal.msgSuccess('新增成功') + this.$emit('closeDialog', true) + this.treeMethod() }).catch(err => {}) break; } - // 2. 成功之后通知父组件关闭弹框 - this.$emit('closeDialog', true) - // this.$emit('treeMethod') - this.treeMethod() /* this.$refs.typeEditParamsRef.validate((valid) => { if (valid) { console.log('校验通过', this.typeEditParams) @@ -767,6 +783,8 @@ export default { if(valid) { submitEditForm(this.typeEditParamsLv1).then(res => { this.$modal.msgSuccess('修改成功') + this.$emit('closeDialog', true) + this.treeMethod() }) } }) @@ -776,6 +794,8 @@ export default { if(valid) { submitEditForm(this.typeEditParamsLv2).then(res => { this.$modal.msgSuccess('修改成功') + this.$emit('closeDialog', true) + this.treeMethod() }) } }) @@ -785,6 +805,8 @@ export default { if(valid) { submitEditForm(this.typeEditParamsLv3).then(res => { this.$modal.msgSuccess('修改成功') + this.$emit('closeDialog', true) + this.treeMethod() }) } }) @@ -794,18 +816,18 @@ export default { this.typeEditParamsLv4.buyPrice = Number(this.typeEditParamsLv4.buyPrice) * this.priceDex this.typeEditParamsLv4.leasePrice = Number(this.typeEditParamsLv4.leasePrice) * this.priceDex this.typeEditParamsLv4.storageNum = Number(this.typeEditParamsLv4.storageNum) * this.storageDex + this.typeEditParamsLv4.unitId = this.typeEditParamsLv4.unitName this.$refs.typeEditParamsRefLv4.validate(valid => { if(valid) { submitEditForm(this.typeEditParamsLv4).then(res => { this.$modal.msgSuccess('修改成功') + this.$emit('closeDialog', true) + this.treeMethod() }) } }) break; } - // 2. 成功之后通知父组件关闭弹框 - this.$emit('closeDialog', true) - this.treeMethod() /* this.$refs.typeEditParamsRef.validate((valid) => { if (valid) { console.log('校验通过', this.typeEditParams) diff --git a/src/views/material/type/config.js b/src/views/material/type/config.js index 9e568d4..a36a0e6 100644 --- a/src/views/material/type/config.js +++ b/src/views/material/type/config.js @@ -1,9 +1,9 @@ export const formLabel = [ - { f_label: '类型名称', f_model: 'typeName', f_type: 'ipt' }, + { f_label: '关键词', f_model: 'keyWord', f_type: 'ipt' }, ] export const columnsList = [ { t_props: 'code', t_label: '类型编码', }, - { t_props: 'typeId', t_label: '仓库信息' }, + // { t_props: 'typeId', t_label: '仓库信息' }, { t_props: 'constructionType', t_label: '施工类型' }, { t_props: 'materialType', t_label: '物资类型', }, { t_props: 'materialName', t_label: '物资名称', }, diff --git a/src/views/material/type/index.vue b/src/views/material/type/index.vue index f381af7..bece4a3 100644 --- a/src/views/material/type/index.vue +++ b/src/views/material/type/index.vue @@ -54,6 +54,7 @@ type="info" size="mini" v-if="data.level === '4'" + @click="handleSee(data)" >查看 @@ -155,11 +157,14 @@ export default { formLabel, columnsList, dialogConfig, + // 禁用表单 + disableForm: false, // 新建时弹框标题 addDialogTitle: '新增物资类型', // 修改时弹框标题 editDialogTitle: '修改物资类型', - + // 查看时弹框标题 + seeDialogTitle: '查看物资类型', /** 树形组件数据 */ // 查询参数 queryParams: { diff --git a/src/views/material/userConfig/components/form-user-config.vue b/src/views/material/userConfig/components/form-user-config.vue index 387179f..26b76d0 100644 --- a/src/views/material/userConfig/components/form-user-config.vue +++ b/src/views/material/userConfig/components/form-user-config.vue @@ -9,23 +9,37 @@ :rules="userConfigParamsRules" > - --> + - --> + @@ -109,10 +123,45 @@ export default { async getRanges() { // 获取物资类型下拉 let typeRes = await queryMaTypeTreeListApi() - this.typeRange = typeRes.data + this.typeRange = this.changeTree(typeRes.data) // 获取人员下拉 let userRes = await getUserSelApi() - this.userConfigRange = userRes.data + // 调整选级 + userRes.data.forEach(lv1 => { + if(!lv1.children) { + lv1.disabled = true + } else { + lv1.children.forEach(lv2 => { + if(!lv2.children) { + lv2.disabled = true + } else { + lv2.children.forEach(lv3 => { + if(!lv3.children) { + lv3.disabled = true + } + }) + } + }) + } + }) + this.userConfigRange = this.changeTree(userRes.data) + }, + /** 级联选择器改变 */ + handleCasUser(e) { + this.userConfigParams.userId = e[e.length - 1] + }, + handleCasType(e) { + this.userConfigParams.typeId = e[e.length - 1] + }, + /** 改变树结构 */ + changeTree(leaf) { + leaf.map(item => { + item.value = item.id + if(item.children) { + this.changeTree(item.children) + } + }) + return leaf }, /** 树禁选父级 */ changeData(data) { // 存在子集就不让禁止,父级让禁止 @@ -134,17 +183,18 @@ export default { // 1. 表单校验通过后调后台 Api if(this.subSort === 1) { addUserConfigListApi(this.userConfigParams).then(res => { - console.log(res) this.$modal.msgSuccess('新增成功') + // 2. 成功之后通知父组件关闭弹框 + this.$emit('closeDialog', true) }).catch(err => {}) } else if(this.subSort === 2) { updateUserConfigListApi(this.userConfigParams).then(res => { - console.log(res) this.$modal.msgSuccess('修改成功') + // 2. 成功之后通知父组件关闭弹框 + this.$emit('closeDialog', true) }).catch(err => {}) } - // 2. 成功之后通知父组件关闭弹框 - this.$emit('closeDialog', true) + } }) }, diff --git a/src/views/material/userConfig/config.js b/src/views/material/userConfig/config.js index 1dde2de..d340576 100644 --- a/src/views/material/userConfig/config.js +++ b/src/views/material/userConfig/config.js @@ -1,6 +1,6 @@ export const formLabel = [ - { f_label: '关键字', f_model: 'houseId', f_type: 'ipt' }, + { f_label: '关键字', f_model: 'keyWord', f_type: 'ipt' }, ] export const columnsList = [ { t_props: 'userName', t_label: '人员名称', }, diff --git a/src/views/material/userConfig/index.vue b/src/views/material/userConfig/index.vue index 5c6ffa9..68015ad 100644 --- a/src/views/material/userConfig/index.vue +++ b/src/views/material/userConfig/index.vue @@ -12,7 +12,7 @@ 新建 - 导出