diff --git a/cclqms-vue/src/views/modules/common/Chooselist.vue b/cclqms-vue/src/views/modules/common/Chooselist.vue index bfa1473..ae9de43 100644 --- a/cclqms-vue/src/views/modules/common/Chooselist.vue +++ b/cclqms-vue/src/views/modules/common/Chooselist.vue @@ -82,7 +82,7 @@ export default { param3: '', param: '', conSql: '', - param4: this.$store.state.user.site, + param4: '', dataList: [], baseListData: { caption1: '', @@ -103,11 +103,12 @@ export default { methods: { // 获取 用户的配置 - init(tagNo,param,conSql) { + init(tagNo,param,conSql,siteValue) { this.tagNo = tagNo this.visible = true; this.param = param != null && param !== undefined ? String(param) : '' this.conSql = conSql?conSql: '' + this.param4 = siteValue != null && siteValue !== undefined ? String(siteValue).trim() : String(this.$store.state.user.site || '').trim() // 根据 tagNo 获取列表 getChooselist({"tagNo": tagNo}).then(({data}) => { this.columnList = [] @@ -185,7 +186,7 @@ export default { if (this.tagNo <1000 && this.tagNo !== 93){ console.log(this.tagNo) if (this.param4) { - sql = this.appendCondition(sql, "site=" + this.param4) + sql = this.appendCondition(sql, "site='" + this.escapeSqlLiteral(this.param4) + "'") } } if (this.conSql && this.conSql.trim() !== '') { @@ -321,6 +322,9 @@ export default { : (mainSql + " where " + condition) return orderSql ? (result + " " + orderSql) : result }, + escapeSqlLiteral(value) { + return String(value || '').replace(/'/g, "''") + }, getRowData(row) { this.visible = false this.$emit('getBaseData',row) @@ -331,7 +335,7 @@ export default { this.param2='' this.param3= '' this.param= '' - this.param4=this.$store.state.user.site + this.param4='' } } } diff --git a/cclqms-vue/src/views/modules/mrb/mrbRecord.vue b/cclqms-vue/src/views/modules/mrb/mrbRecord.vue index 8ab71bd..504c6c0 100644 --- a/cclqms-vue/src/views/modules/mrb/mrbRecord.vue +++ b/cclqms-vue/src/views/modules/mrb/mrbRecord.vue @@ -3229,6 +3229,7 @@ export default { this.$nextTick(() => { let strVal = '' let conSql = '' + const chooseSite = this.resolveFormSite() if (type === CHOOSE_TYPE_MATERIAL_PN) { strVal = this.formData.materialPn } else if (type === CHOOSE_TYPE_SUPPLIER_NO) { @@ -3252,7 +3253,7 @@ export default { strVal = this.tempCountersignItemRow && this.tempCountersignItemRow.executor conSql = this.getChooseListSiteSql('b.site') } - this.$refs.baseList.init(tagNo, strVal || '', conSql || '') + this.$refs.baseList.init(tagNo, strVal || '', conSql || '', chooseSite) }) }, getBaseData (val) {