|
|
@@ -1915,31 +1915,22 @@ export default {
|
|
|
this.isViewMode = !isEdit; // 设置是否为查看模式
|
|
|
const storeId = row.storeId || this.ids
|
|
|
getStore(storeId).then(response => {
|
|
|
- this.form = response.data;
|
|
|
+ const data = response.data;
|
|
|
|
|
|
// 确保 brokerageType 是字符串类型
|
|
|
- if (this.form.brokerageType) {
|
|
|
- this.form.brokerageType = this.form.brokerageType.toString();
|
|
|
+ if (data.brokerageType) {
|
|
|
+ data.brokerageType = data.brokerageType.toString();
|
|
|
}
|
|
|
// 如果后端返回的数据中没有这个字段,则设置默认值
|
|
|
- if (this.form.drugScopeHasFrozen === undefined) {
|
|
|
- this.form.drugScopeHasFrozen = 0;
|
|
|
+ if (data.drugScopeHasFrozen === undefined) {
|
|
|
+ data.drugScopeHasFrozen = 0;
|
|
|
}
|
|
|
- this.switchValue = this.form.isBusinessLicensePermanent == 1;
|
|
|
- this.switchMedicalValue = this.form.isMedicalDevice1ExpiryPermanent == 1
|
|
|
- this.medicalDevice2ExpiryValue = this.form.isMedicalDevice2ExpiryPermanent == 1
|
|
|
- this.medicalLicenseExpiryValue = this.form.isMedicalLicenseExpiryPermanent == 1
|
|
|
- this.medicalLicenseExpiryValue1 = this.form.isEffectivePermanent1 == 1;
|
|
|
- this.foodLicenseExpiryValue = this.form.isFoodLicenseExpiryPermanent == 1;
|
|
|
- this.medicalLicenseExpiryValue2 = this.form.isEffectivePermanent2 == 1;
|
|
|
- this.medicalLicenseExpiryValue3 = this.form.isEffectivePermanent3 == 1
|
|
|
- this.open = true;
|
|
|
- this.title = this.isViewMode ? "店铺详情" : "修改店铺";
|
|
|
|
|
|
- let str = this.form.shippingType
|
|
|
- this.form.shippingType = str.split(",")
|
|
|
- this.form.cityIds = ((this.form.cityIds).split(",")).map(Number)
|
|
|
+ let str = data.shippingType
|
|
|
+ data.shippingType = str ? str.split(",") : []
|
|
|
+ data.cityIds = data.cityIds ? (data.cityIds.split(",")).map(Number) : []
|
|
|
|
|
|
+ // 预处理日期范围字段:将 Start/End 合并为范围数组(必须在赋值 this.form 之前处理,确保 Vue 响应式追踪正常)
|
|
|
const dateFields = [
|
|
|
'drugLicenseExpiry',
|
|
|
'medicalDevice1Expiry',
|
|
|
@@ -1952,34 +1943,38 @@ export default {
|
|
|
dateFields.forEach(field => {
|
|
|
const startField = field + 'Start';
|
|
|
const endField = field + 'End';
|
|
|
- if (this.form[startField] && this.form[endField]) {
|
|
|
- this.$set(this.form, field, [this.form[startField], this.form[endField]]);
|
|
|
+ if (data[startField] && data[endField]) {
|
|
|
+ data[field] = [data[startField], data[endField]];
|
|
|
}
|
|
|
});
|
|
|
|
|
|
-
|
|
|
// 入驻协议有效期
|
|
|
- if (this.form.settlementAgreementStart && this.form.settlementAgreementEnd) {
|
|
|
- this.$set(this.form, 'settlementAgreementExpiry', [
|
|
|
- this.form.settlementAgreementStart,
|
|
|
- this.form.settlementAgreementEnd
|
|
|
- ]);
|
|
|
+ if (data.settlementAgreementStart && data.settlementAgreementEnd) {
|
|
|
+ data.settlementAgreementExpiry = [data.settlementAgreementStart, data.settlementAgreementEnd];
|
|
|
}
|
|
|
|
|
|
// 质量保证协议有效期
|
|
|
- if (this.form.qualityAssuranceAgreementStart && this.form.qualityAssuranceAgreementEnd) {
|
|
|
- this.$set(this.form, 'qualityAssuranceAgreementExpiry', [
|
|
|
- this.form.qualityAssuranceAgreementStart,
|
|
|
- this.form.qualityAssuranceAgreementEnd
|
|
|
- ]);
|
|
|
+ if (data.qualityAssuranceAgreementStart && data.qualityAssuranceAgreementEnd) {
|
|
|
+ data.qualityAssuranceAgreementExpiry = [data.qualityAssuranceAgreementStart, data.qualityAssuranceAgreementEnd];
|
|
|
}
|
|
|
// 其它特殊资质有效期
|
|
|
- if (this.form.otherSpecialQualificationStart && this.form.otherSpecialQualificationEnd) {
|
|
|
- this.$set(this.form, 'otherSpecialQualificationExpiry', [
|
|
|
- this.form.otherSpecialQualificationStart,
|
|
|
- this.form.otherSpecialQualificationEnd
|
|
|
- ]);
|
|
|
+ if (data.otherSpecialQualificationStart && data.otherSpecialQualificationEnd) {
|
|
|
+ data.otherSpecialQualificationExpiry = [data.otherSpecialQualificationStart, data.otherSpecialQualificationEnd];
|
|
|
}
|
|
|
+
|
|
|
+ // 一次性赋值到 form,此时 data 已包含所有合并后的日期范围属性
|
|
|
+ this.form = data;
|
|
|
+
|
|
|
+ this.switchValue = this.form.isBusinessLicensePermanent == 1;
|
|
|
+ this.switchMedicalValue = this.form.isMedicalDevice1ExpiryPermanent == 1
|
|
|
+ this.medicalDevice2ExpiryValue = this.form.isMedicalDevice2ExpiryPermanent == 1
|
|
|
+ this.medicalLicenseExpiryValue = this.form.isMedicalLicenseExpiryPermanent == 1
|
|
|
+ this.medicalLicenseExpiryValue1 = this.form.isEffectivePermanent1 == 1;
|
|
|
+ this.foodLicenseExpiryValue = this.form.isFoodLicenseExpiryPermanent == 1;
|
|
|
+ this.medicalLicenseExpiryValue2 = this.form.isEffectivePermanent2 == 1;
|
|
|
+ this.medicalLicenseExpiryValue3 = this.form.isEffectivePermanent3 == 1
|
|
|
+ this.open = true;
|
|
|
+ this.title = this.isViewMode ? "店铺详情" : "修改店铺";
|
|
|
this.reportFileList = this.urlToFileList(this.form.reportUrl);
|
|
|
this.fileList = this.urlToFileList(this.form.filingUrl);
|
|
|
|