Commit 6abddc188de881ecfc2ec7386f0c2da0c81ccfed

Authored by fengtao
1 parent cf1a1977

fix:DEFECT-569 修复 选择了所在城市点击更新基本信息失败

... ... @@ -141,7 +141,7 @@
141 141 console.log(newFieldValue.qrCode);
142 142 console.log(newFieldValue.codeTown);
143 143 // 表单校验
144   - const values = await validate([
  144 + let validateArray = [
145 145 'name',
146 146 'abbreviation',
147 147 'officialWebsite',
... ... @@ -152,9 +152,26 @@
152 152 'contacts',
153 153 'tel',
154 154 'id',
155   - newFieldValue.qrCode == undefined ? 'prov' : '',
156   - newFieldValue.codeTown == undefined ? 'qrcode' : '',
157   - ]);
  155 + ];
  156 + if (newFieldValue.qrCode == undefined) {
  157 + validateArray.push('qrcode');
  158 + } else {
  159 + const findExistIndex = validateArray.findIndex((o) => o == 'qrcode');
  160 + if (findExistIndex !== -1) {
  161 + validateArray.splice(findExistIndex, 1);
  162 + }
  163 + }
  164 + if (newFieldValue.codeTown == undefined) {
  165 + validateArray.push('prov');
  166 + console.log(validateArray);
  167 + } else {
  168 + const findExistIndex1 = validateArray.findIndex((o) => o == 'prov');
  169 + if (findExistIndex1 !== -1) {
  170 + validateArray.splice(findExistIndex1, 1);
  171 + }
  172 + clearValidate('prov');
  173 + }
  174 + const values = await validate(validateArray);
158 175 if (!values) return;
159 176 compState.value.loading = true;
160 177 await updateEnterPriseDetail(newFieldValue);
... ...