瀏覽代碼

营业执照可选长期

lmx 1 周之前
父節點
當前提交
ba74d15d48

+ 2 - 1
src/views/hisStore/components/storeDetails.vue

@@ -96,7 +96,8 @@
           </el-image>
         </el-descriptions-item>
         <el-descriptions-item label="营业执照有效期" >
-          <span v-if="item!=null">{{item.businessLicenseExpireStart}} - {{item.businessLicenseExpireEnd}}</span>
+          <span v-if="item!=null && item.isBusinessLicensePermanent == 1">长期有效</span>
+          <span v-else-if="item!=null">{{item.businessLicenseExpireStart}} - {{item.businessLicenseExpireEnd}}</span>
         </el-descriptions-item>
         <el-descriptions-item label="药品经营许可证" v-if="medicalMallConfig.isMedicalMall">
           <el-image

+ 25 - 4
src/views/hisStore/store/index.vue

@@ -301,7 +301,15 @@
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="营业执照失效日期" prop="businessLicenseExpire">
+            <el-form-item label="营业执照是否长期有效" prop="isBusinessLicensePermanent">
+              <el-switch
+                @change="switchChange()"
+                v-model="switchValue"
+                active-color="#13ce66"
+                inactive-color="#ff4949">
+              </el-switch>
+             </el-form-item>
+            <el-form-item label="营业执照失效日期" prop="businessLicenseExpire" v-if="!switchValue">
               <el-date-picker
                 v-model="form.businessLicenseExpire"
                 type="daterange"
@@ -663,6 +671,7 @@ export default {
   components: { storeDetails },
   data() {
     return {
+      switchValue:false,
       show: {
         title: "店铺详情",
         open: false,
@@ -927,6 +936,7 @@ export default {
     },
     // 表单重置
     reset() {
+      this.switchValue = false;
       this.form = {
         storeId: null,
         cityIds: null,
@@ -1015,6 +1025,9 @@ export default {
       const storeId = row.storeId || this.ids
       getStore(storeId).then(response => {
         this.form = response.data;
+        if(this.form.isBusinessLicensePermanent == 1){
+          this.switchValue = true;
+        }
         this.open = true;
         this.title = "修改店铺";
 
@@ -1142,7 +1155,11 @@ export default {
               return this.$message.warning("其它特殊资质,有效期开始日期或结束日期不能为空!");
             }
           }
-
+          if(!!this.switchValue){
+              formData.isBusinessLicensePermanent = 1;
+          }else{
+              formData.isBusinessLicensePermanent = 0;
+          }
           if (formData.storeId != null) {
             updateStore(formData).then(response => {
               this.msgSuccess("修改成功");
@@ -1203,7 +1220,11 @@ export default {
         this.exportLoading = false;
       }).catch(() => {
       });
-    }
+    },
+    //长期有效营业执照选择
+    switchChange(){
+      console.log(this.form.isBusinessLicensePermanent);
+    },
   }
 };
 </script>
@@ -1226,7 +1247,7 @@ export default {
   color: #8c939d;
   width: 150px;
   height: 150px;
-  line-height: 150px;
+  line-height: 150px !important;
   text-align: center;
 }
 

+ 46 - 1
src/views/hisStore/store/recommend.vue

@@ -286,10 +286,17 @@ export default {
     // 搜索店铺
     searchStore(query) {
       if (query !== '') {
+       var isNum =  this.isPureNumber(query);
+       console.log(isNum);
+      
         this.storeLoading = true;
+        let queryObj = { storeName: query };
+       if(isNum){
+          queryObj.queryStoreId = query;
+       }
         // 这里应该调用实际的API来搜索店铺
         // 示例代码,需要根据实际API调整
-        listStore({ storeName: query }).then(response => {
+        listStore(queryObj).then(response => {
           this.storeOptions = response.rows;
           this.storeLoading = false;
         }).catch(() => {
@@ -299,6 +306,44 @@ export default {
         this.storeOptions = [];
       }
     },
+    isPureNumber(value, options = {}) {
+      // 默认配置
+      const {
+        allowNegative = true,
+        allowDecimal = true,
+        allowEmpty = false
+      } = options;
+
+      // 处理空值情况
+      if (value === null || value === undefined) return false;
+      
+      // 转换为字符串并去除首尾空格
+      const str = String(value).trim();
+      
+      // 处理空字符串
+      if (str === '') return allowEmpty;
+
+      // 构建正则表达式
+      let regex = '^';
+      
+      // 可选的负号
+      if (allowNegative) {
+        regex += '[-+]?';
+      }
+      
+      // 数字部分
+      if (allowDecimal) {
+        // 允许整数或小数(包括 .123 或 123. 形式)
+        regex += '(\\d+(\\.\\d*)?|\\.\\d+)';
+      } else {
+        // 只允许整数
+        regex += '\\d+';
+      }
+      
+      regex += '$';
+
+      return new RegExp(regex).test(str);
+    },
     // 取消按钮
     cancel() {
       this.open = false;