diff --git a/src/views/emis/emisNotCalcAging/index.vue b/src/views/emis/emisNotCalcAging/index.vue index 7d02c08e..308cf9b6 100644 --- a/src/views/emis/emisNotCalcAging/index.vue +++ b/src/views/emis/emisNotCalcAging/index.vue @@ -164,13 +164,12 @@ - + @@ -318,6 +317,19 @@ export default { this.getCountryList(); }, methods: { + hideOther() { + // 数组的indexOf方法,会返回当前值在数组中的下标,没有则为-1 + if (this.form.country.indexOf("全部国家") == "-1") { + this.countryIdsOptions.map((res) => { + res.disabled = false; + }); + } else { + this.countryIdsOptions.map((res) => { + res.disabled = true; + }); + this.form.country = ["全部国家"]; + } + }, handleStatusChange(row) { let text = row.status === "0" ? "启用" : "停用"; this.$modal.confirm('确认要"' + text + '不计算时效吗?').then(function() { @@ -359,6 +371,7 @@ export default { this.countryIdsOptions = []; var cTree={"id":"","label":"国家列表","children":[]}; cTree.children.push({"id":40,"label":"中国"}); + this.countryIdsOptions.push({"value":0,"label":"全部国家"}) this.countryIdsOptions.push({"value":40,"label":"中国"}) //var lastContinentId = -1; response.rows.forEach(item =>{ @@ -449,6 +462,8 @@ export default { this.reset(); const id = row.id || this.ids getEmisNotCalcAging(id).then(response => { + var arr = response.data.country.split(","); + response.data.country = arr; this.form = response.data; this.open = true; this.title = "修改"; @@ -470,6 +485,14 @@ export default { submitForm() { this.$refs["form"].validate(valid => { if (valid) { + var country = ""; + this.form.country.map((res) => { + country+=res+","; + }); + if (country.charAt(country.length - 1) === ",") { + country = country.slice(0, -1); + } + this.form.country = country; if (this.form.id != null) { updateEmisNotCalcAging(this.form).then(response => { this.$modal.msgSuccess("修改成功");