diff --git a/src/components/TableModel/index.vue b/src/components/TableModel/index.vue index 5552f89..4a703b0 100644 --- a/src/components/TableModel/index.vue +++ b/src/components/TableModel/index.vue @@ -45,6 +45,7 @@ :options="item.f_selList" :props="item.optionProps" :show-all-levels="false" + clearable @change="handleCasAdd($event, item.f_model, cascaderFunc, extraTableProp)" style="width: 240px" /> @@ -64,6 +65,16 @@ value-format="yyyy-MM-dd" type="date" /> + { if (valid) { @@ -393,28 +410,30 @@ export default { func, prop ) { - this.queryParams[val] = e[e.length - 1] - let setObj = {} - // 合并 - if(prop) { - Object.assign(setObj, prop) + if(e.length !== 0) { + this.queryParams[val] = e[e.length - 1] + let setObj = {} + // 合并 + if(prop) { + Object.assign(setObj, prop) + } + // 设置id自增 + this.$set(setObj, 'id', this.idCount) + this.idCount++ + // 获取单位 + func({ + id: e[e.length - 1] + }).then(res => { + this.$set(setObj, 'name', res.data.parentName) + this.$set(setObj, 'unitName', res.data.unitName) + this.$set(setObj, 'typeName', res.data.name) + }).catch(err => {}) + for(let key in this.queryParams) { + this.$set(setObj, key, this.queryParams[key]) + } + this.tableList.unshift(setObj) + console.log(this.tableList) } - // 设置id自增 - /* this.$set(setObj, 'id', this.idCount) - this.idCount++ */ - // 获取单位 - func({ - id: e[e.length - 1] - }).then(res => { - this.$set(setObj, 'name', res.data.parentName) - this.$set(setObj, 'unitName', res.data.unitName) - this.$set(setObj, 'typeName', res.data.name) - }).catch(err => {}) - for(let key in this.queryParams) { - this.$set(setObj, key, this.queryParams[key]) - } - this.tableList.unshift(setObj) - console.log(this.tableList) }, /** 动态设置操作列的列宽 */ getOperatorWidth() { diff --git a/src/utils/request.js b/src/utils/request.js index 6535e62..0bdebd7 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -182,7 +182,7 @@ export function download(url, params, filename, config) { transformRequest: [(params) => { return tansParams(params) }], - headers: { 'Content-Type': 'application/x-www-form-urlencoded', encryptResponse: false}, + headers: { 'Content-Type': 'application/x-www-form-urlencoded', encryptResponse: false }, responseType: 'blob', ...config }).then(async(data) => { diff --git a/src/views/base/project/config.js b/src/views/base/project/config.js index 2d0afdd..90bb2fa 100644 --- a/src/views/base/project/config.js +++ b/src/views/base/project/config.js @@ -1,6 +1,6 @@ export const formLabel = [ - { f_label: '工程名称', f_model: 'name', f_type: 'ipt' }, + { f_label: '工程名称', f_model: 'keyWord', f_type: 'ipt' }, ] export const columnsList = [ { t_props: 'name', t_label: '工程项目名称', }, diff --git a/src/views/base/project/index.vue b/src/views/base/project/index.vue index 3547311..33e2ad6 100644 --- a/src/views/base/project/index.vue +++ b/src/views/base/project/index.vue @@ -13,8 +13,14 @@ 新建 - 导出导出