Browse Source

店铺、商品审核页面展示、商品证书长期按钮

yjwang 6 days ago
parent
commit
4e913703ec

+ 7 - 0
src/api/hisStore/storeProduct.js

@@ -139,3 +139,10 @@ export function qualifications() {
   })
 }
 
+// 查询商品详细
+export function getAuthInfo(productId) {
+  return request({
+    url: '/store/store/storeProduct/auditLog/' + productId,
+    method: 'get'
+  })
+}

+ 180 - 31
src/views/hisStore/storeProduct/index.vue

@@ -402,7 +402,7 @@
           </el-tag>
         </template>
       </el-table-column>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200px">
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -415,10 +415,9 @@
           <el-button
             size="mini"
             type="text"
-            icon="el-icon-edit"
+            icon="el-icon-postcard"
             @click="showOperLog(scope.row)"
-            v-hasPermi="['store:storeProduct:list']"
-            v-if="scope.row.isAudit===1"
+            v-hasPermi="['his:storeProduct:auditLog']"
           >审核记录
           </el-button>
           <el-button
@@ -429,14 +428,14 @@
             v-hasPermi="['store:storeProduct:remove']"
           >删除
           </el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDrugExport(scope.row)"
-            v-if="scope.row.cateId==224"
-          >导出
-          </el-button>
+<!--          <el-button-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-download"-->
+<!--            @click="handleDrugExport(scope.row)"-->
+<!--            v-if="scope.row.cateId==224"-->
+<!--          >导出-->
+<!--          </el-button>-->
         </template>
       </el-table-column>
     </el-table>
@@ -977,21 +976,41 @@
         <el-form-item v-if="form.isShow === '1'" label="生产企业营业执照" prop="business">
           <Material v-model="businessArr" type="image" :num="1" :width="150" :height="150"/>
         </el-form-item>
-        <el-form-item v-if="form.isShow === '1' && businessArr.length > 0" prop="businessExpire">
-          <el-date-picker
-            v-model="form.businessExpire"
-            type="daterange"
-            value-format="yyyy-MM-dd"
-            range-separator="至"
-            start-placeholder="开始日期"
-            end-placeholder="结束日期">
-          </el-date-picker>
+
+        <el-form-item v-if="form.isShow === '1' && businessArr.length > 0" label="生产企业营业执照是否长期有效" prop="isBusinessPermanent">
+          <el-switch
+            @change="switchChange()"
+            v-model="businessValue"
+            active-color="#13ce66"
+            inactive-color="#ff4949">
+          </el-switch>
         </el-form-item>
 
+          <el-form-item v-if="form.isShow === '1' && businessArr.length > 0 && !businessValue" prop="businessExpire">
+            <el-date-picker
+              v-model="form.businessExpire"
+              type="daterange"
+              value-format="yyyy-MM-dd"
+              range-separator="至"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期">
+            </el-date-picker>
+          </el-form-item>
+
         <el-form-item v-if="form.isShow === '1'" label="生产企业的生产许可证/备案凭证" prop="license">
           <Material v-model="licenseArr" type="image" :num="1" :width="150" :height="150"/>
         </el-form-item>
-        <el-form-item v-if="form.isShow === '1' && licenseArr.length > 0" prop="licenseExpire">
+
+        <el-form-item v-if="form.isShow === '1' && licenseArr.length > 0" label="生产企业的生产许可证/备案凭证是否长期有效" prop="isLicensePermanent">
+          <el-switch
+            @change="switchChange()"
+            v-model="licenseValue"
+            active-color="#13ce66"
+            inactive-color="#ff4949">
+          </el-switch>
+        </el-form-item>
+
+        <el-form-item v-if="form.isShow === '1' && licenseArr.length > 0 && !licenseValue" prop="licenseExpire">
           <el-date-picker
             v-model="form.licenseExpire"
             type="daterange"
@@ -1005,7 +1024,17 @@
         <el-form-item v-if="form.isShow === '1'" label="商品注册证/备案凭证" prop="certificate">
           <Material v-model="certificateArr" type="image" :num="1" :width="150" :height="150"/>
         </el-form-item>
-        <el-form-item v-if="form.isShow === '1' && certificateArr.length > 0" prop="certificateExpire">
+
+        <el-form-item v-if="form.isShow === '1' && licenseArr.length > 0" label="商品注册证/备案凭证是否长期有效" prop="isCertificatePermanent">
+          <el-switch
+            @change="switchChange()"
+            v-model="certificateValue"
+            active-color="#13ce66"
+            inactive-color="#ff4949">
+          </el-switch>
+        </el-form-item>
+
+        <el-form-item v-if="form.isShow === '1' && certificateArr.length > 0 && !certificateValue" prop="certificateExpire">
           <el-date-picker
             v-model="form.certificateExpire"
             type="daterange"
@@ -1033,7 +1062,17 @@
         <el-form-item v-if="form.isShow === '1'" label="GMP/GSP认证证书" prop="gmpAuth">
           <Material v-model="gmpAuthArr" type="image" :num="1" :width="150" :height="150"/>
         </el-form-item>
-        <el-form-item v-if="form.isShow === '1' && gmpAuthArr.length > 0" prop="gmpAuthExpire">
+
+        <el-form-item v-if="form.isShow === '1' && businessArr.length > 0" label="GMP/GSP认证证书是否长期有效" prop="isGmpAuthPermanent">
+          <el-switch
+            @change="switchChange()"
+            v-model="gmpAuthValue"
+            active-color="#13ce66"
+            inactive-color="#ff4949">
+          </el-switch>
+        </el-form-item>
+
+        <el-form-item v-if="form.isShow === '1' && gmpAuthArr.length > 0 && !gmpAuthValue" prop="gmpAuthExpire">
           <el-date-picker
             v-model="form.gmpAuthExpire"
             type="daterange"
@@ -1103,6 +1142,37 @@
       </span>
     </el-dialog>
 
+    <el-dialog
+      :title=titleValue
+      :visible.sync="authVisible"
+      width="50%"
+      :before-close="handleClose"
+      center>
+        <el-table :data="auditLogs" border>
+          <el-table-column label="描述" align="center" prop="des" :show-overflow-tooltip="true" />
+          <el-table-column label="操作人员" align="center" prop="operName" width="100" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']" />
+          <el-table-column label="操作日期" align="center" prop="operTime" sortable="custom" :sort-orders="['descending', 'ascending']" width="180">
+            <template slot-scope="scope">
+              <span>{{ parseTime(scope.row.operTime) }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="审核理由" align="center" prop="reason" ></el-table-column>
+          <el-table-column label="图片" align="center" prop="attachImage" width="100" >
+            <template slot-scope="scope">
+              <el-image
+                style="width: 100px"
+                :src="scope.row.attachImage"
+                :preview-src-list="[scope.row.attachImage]"
+                v-if="scope.row.attachImage">
+              </el-image>
+              <span v-else >无图片</span >
+            </template>
+          </el-table-column>
+        </el-table>
+      <span slot="footer" class="dialog-footer">
+    <el-button type="primary" @click="authVisible = false">关 闭</el-button>
+  </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -1117,7 +1187,7 @@ import {
   importTemplate,
   batchModify,
   sync580,
-  updateIsShow, exportDrugProduct
+  updateIsShow, exportDrugProduct,getAuthInfo
 } from "@/api/hisStore/storeProduct";
 import {getAllStoreProductCategory} from "@/api/hisStore/storeProductCategory";
 import {getAllStoreProductRule} from "@/api/hisStore/storeProductRule";
@@ -1165,11 +1235,11 @@ export default {
     });
     this.getDicts("store_product_type").then((response) => {
       this.productTypeOptions = response.data;
-      if (!this.medicalMallConfig.isMedicalMall &&
-        this.productTypeOptions.length === 4) {
-        //删除后两项
-        this.productTypeOptions.splice(2, 2);
-      }
+      // if (!this.medicalMallConfig.isMedicalMall &&
+      //   this.productTypeOptions.length === 4) {
+      //   //删除后两项
+      //   this.productTypeOptions.splice(2, 2);
+      // }
     });
     this.getDicts("store_product_is_show").then((response) => {
       this.isShowOptions = response.data;
@@ -1269,6 +1339,12 @@ export default {
   },
   data() {
     return {
+      auditLogs:[],
+      titleValue:null,
+      gmpAuthValue:false,
+      certificateValue:false,
+      licenseValue:false,
+      businessValue:false,
       displayDemo: false,
       cateIdToNameMap: {},
       businessArr: [],
@@ -1281,6 +1357,7 @@ export default {
       medicalMallConfig: {},
       promptList: [],
       dialogVisible: false,
+      authVisible:false,
       companyId: null,
       storeId: null,
       isAudit: null,
@@ -1423,6 +1500,10 @@ export default {
         gmpAuth:null,
         gmpAuthExpire:null,
         businessLink:null,
+        isGmpAuthPermanent:null,
+        isCertificatePermanent:null,
+        isLicensePermanent:null,
+        isBusinessPermanent:null,
       },
       // 表单校验
       rules: {
@@ -2002,6 +2083,7 @@ export default {
       const productId = row.productId || this.ids
       getStoreProduct(productId).then(response => {
         this.form = response.data;
+        console.log("都要xxxxxxxxxxxxxxxxxxx->>>>>",response.data)
         this.form.isShow = response.data.isShow.toString();
         this.form.isHot = response.data.isHot.toString();
         this.form.isGood = response.data.isGood.toString();
@@ -2038,6 +2120,31 @@ export default {
         if (this.form.qualificationCertificate != null) {
           this.qualificationArr = this.form.qualificationCertificate.split(",");
         }
+
+        if(this.form.isBusinessPermanent == 1){
+          this.businessValue = true
+        }else {
+          this.businessValue = false
+        }
+
+        if(this.form.isLicensePermanent == 1){
+          this.licenseValue = true
+        }else {
+          this.licenseValue = false
+        }
+
+        if(this.form.isCertificatePermanent == 1){
+          this.certificateValue = true
+        }else {
+          this.certificateValue = false
+        }
+
+        if(this.form.isGmpAuthPermanent == 1){
+          this.gmpAuthValue = true
+        }else {
+          this.gmpAuthValue = false
+        }
+
         const expireFieldMap = [
           { expireKey: 'businessExpire', startKey: 'businessStart', endKey: 'businessEnd' },
           { expireKey: 'licenseExpire', startKey: 'licenseStart', endKey: 'licenseEnd' },
@@ -2154,13 +2261,38 @@ export default {
             this.form.qualificationCertificateStart = this.form.qualificationExpire[0];
             this.form.qualificationCertificateEnd = this.form.qualificationExpire[1];
           }
+
+          if(!!this.businessValue){
+            this.form.isBusinessPermanent=1;
+          }else {
+            this.form.isBusinessPermanent=0;
+          }
+
+          if(!!this.licenseValue){
+            this.form.isLicensePermanent=1;
+          }else {
+            this.form.isLicensePermanent=0;
+          }
+
+          if(!!this.certificateValue){
+            this.form.isCertificatePermanent=1;
+          }else {
+            this.form.isCertificatePermanent=0;
+          }
+
+          if(!!this.gmpAuthValue){
+            this.form.isGmpAuthPermanent=1;
+          }else {
+            this.form.isGmpAuthPermanent=0;
+          }
+
           // // 组装companyIds
           // if (this.form.companyIds != null && this.form.companyIds != undefined) {
           //   this.form.companyIds = this.form.companyIds.join(',');
           // }
           addOrEdit(this.form).then(response => {
             if (response.code === 200) {
-              this.msgSuccess("修改成功");
+              this.msgSuccess("操作成功!");
               this.open = false;
               this.getList();
             }
@@ -2239,6 +2371,23 @@ export default {
     },
     handleReviewAudit(){
       console.log("aaaaaaaaaaaaaaa->",this.form.reviewAudit);
+    },
+    switchChange(){
+      console.log(this.form.isBusinessLicensePermanent);
+    },
+    showOperLog(row){
+      getAuthInfo(row.productId).then(response => {
+        this.auditLogs = response.auditLog;
+        this.titleValue ="商品:" +"《" +row.productName+"》"+ "审核记录";
+        this.authVisible = true;
+      })
+    },
+    handleClose(done) {
+      this.$confirm('确认关闭?')
+        .then(_ => {
+          done();
+        })
+        .catch(_ => {});
     }
   }
 };

+ 94 - 19
src/views/hisStore/storeProductAudit/index.vue

@@ -668,7 +668,17 @@
         <el-form-item v-if="form.isShow === '1'" label="生产企业营业执照" prop="business">
           <Material v-model="businessArr" type="image" :num="1" :width="150" :height="150"/>
         </el-form-item>
-        <el-form-item v-if="form.isShow === '1' && businessArr.length > 0" prop="businessExpire">
+
+        <el-form-item v-if="form.isShow === '1' && businessArr.length > 0" label="生产企业营业执照是否长期有效" prop="isBusinessPermanent">
+          <el-switch
+            @change="switchChange()"
+            v-model="businessValue"
+            active-color="#13ce66"
+            inactive-color="#ff4949">
+          </el-switch>
+        </el-form-item>
+
+        <el-form-item v-if="form.isShow === '1' && businessArr.length > 0 && !businessValue" prop="businessExpire">
           <el-date-picker
             v-model="form.businessExpire"
             type="daterange"
@@ -682,7 +692,17 @@
         <el-form-item v-if="form.isShow === '1'" label="生产企业的生产许可证/备案凭证" prop="license">
           <Material v-model="licenseArr" type="image" :num="1" :width="150" :height="150"/>
         </el-form-item>
-        <el-form-item v-if="form.isShow === '1' && licenseArr.length > 0" prop="licenseExpire">
+
+        <el-form-item v-if="form.isShow === '1' && licenseArr.length > 0" label="生产企业的生产许可证/备案凭证是否长期有效" prop="isLicensePermanent">
+          <el-switch
+            @change="switchChange()"
+            v-model="licenseValue"
+            active-color="#13ce66"
+            inactive-color="#ff4949">
+          </el-switch>
+        </el-form-item>
+
+        <el-form-item v-if="form.isShow === '1' && licenseArr.length > 0 && !licenseValue" prop="licenseExpire">
           <el-date-picker
             v-model="form.licenseExpire"
             type="daterange"
@@ -696,7 +716,17 @@
         <el-form-item v-if="form.isShow === '1'" label="商品注册证/备案凭证" prop="certificate">
           <Material v-model="certificateArr" type="image" :num="1" :width="150" :height="150"/>
         </el-form-item>
-        <el-form-item v-if="form.isShow === '1' && certificateArr.length > 0" prop="certificateExpire">
+
+        <el-form-item v-if="form.isShow === '1' && licenseArr.length > 0" label="商品注册证/备案凭证是否长期有效" prop="isCertificatePermanent">
+          <el-switch
+            @change="switchChange()"
+            v-model="certificateValue"
+            active-color="#13ce66"
+            inactive-color="#ff4949">
+          </el-switch>
+        </el-form-item>
+
+        <el-form-item v-if="form.isShow === '1' && certificateArr.length > 0 && !certificateValue" prop="certificateExpire">
           <el-date-picker
             v-model="form.certificateExpire"
             type="daterange"
@@ -707,24 +737,34 @@
           </el-date-picker>
         </el-form-item>
 
-<!--        <el-form-item v-if="form.isShow === '1' && displayDemo" label="Ⅰ类Ⅱ类备案凭证" prop="voucher">-->
-<!--          <Material v-model="voucherArr" type="image" :num="1" :width="150" :height="150"/>-->
-<!--        </el-form-item>-->
-<!--        <el-form-item v-if="form.isShow === '1' && voucherArr.length > 0 && displayDemo" prop="voucherExpire">-->
-<!--          <el-date-picker-->
-<!--            v-model="form.voucherExpire"-->
-<!--            type="daterange"-->
-<!--            value-format="yyyy-MM-dd"-->
-<!--            range-separator="至"-->
-<!--            start-placeholder="开始日期"-->
-<!--            end-placeholder="结束日期">-->
-<!--          </el-date-picker>-->
-<!--        </el-form-item>-->
+        <!--        <el-form-item v-if="form.isShow === '1' && displayDemo" label="Ⅰ类Ⅱ类备案凭证" prop="voucher">-->
+        <!--          <Material v-model="voucherArr" type="image" :num="1" :width="150" :height="150"/>-->
+        <!--        </el-form-item>-->
+        <!--        <el-form-item v-if="form.isShow === '1' && voucherArr.length > 0 && displayDemo" prop="voucherExpire">-->
+        <!--          <el-date-picker-->
+        <!--            v-model="form.voucherExpire"-->
+        <!--            type="daterange"-->
+        <!--            value-format="yyyy-MM-dd"-->
+        <!--            range-separator="至"-->
+        <!--            start-placeholder="开始日期"-->
+        <!--            end-placeholder="结束日期">-->
+        <!--          </el-date-picker>-->
+        <!--        </el-form-item>-->
 
         <el-form-item v-if="form.isShow === '1'" label="GMP/GSP认证证书" prop="gmpAuth">
           <Material v-model="gmpAuthArr" type="image" :num="1" :width="150" :height="150"/>
         </el-form-item>
-        <el-form-item v-if="form.isShow === '1' && gmpAuthArr.length > 0" prop="gmpAuthExpire">
+
+        <el-form-item v-if="form.isShow === '1' && businessArr.length > 0" label="GMP/GSP认证证书是否长期有效" prop="isGmpAuthPermanent">
+          <el-switch
+            @change="switchChange()"
+            v-model="gmpAuthValue"
+            active-color="#13ce66"
+            inactive-color="#ff4949">
+          </el-switch>
+        </el-form-item>
+
+        <el-form-item v-if="form.isShow === '1' && gmpAuthArr.length > 0 && !gmpAuthValue" prop="gmpAuthExpire">
           <el-date-picker
             v-model="form.gmpAuthExpire"
             type="daterange"
@@ -866,6 +906,10 @@ export default {
   },
   data() {
     return {
+      gmpAuthValue:false,
+      certificateValue:false,
+      licenseValue:false,
+      businessValue:false,
       businessArr: [],
       licenseArr: [],
       certificateArr: [],
@@ -1426,7 +1470,7 @@ export default {
     },
     handleUpdate(row) {
       if (this.ids.length > 1) {
-        this.title = "批量修改商品";
+        this.title = "审核商品";
         this.open1 = true;
         return;
       }
@@ -1471,6 +1515,31 @@ export default {
         if (this.form.qualificationCertificate != null) {
           this.qualificationArr = this.form.qualificationCertificate.split(",");
         }
+
+        if(this.form.isBusinessPermanent == 1){
+          this.businessValue = true
+        }else {
+          this.businessValue = false
+        }
+
+        if(this.form.isLicensePermanent == 1){
+          this.licenseValue = true
+        }else {
+          this.licenseValue = false
+        }
+
+        if(this.form.isCertificatePermanent == 1){
+          this.certificateValue = true
+        }else {
+          this.certificateValue = false
+        }
+
+        if(this.form.isGmpAuthPermanent == 1){
+          this.gmpAuthValue = true
+        }else {
+          this.gmpAuthValue = false
+        }
+
         const expireFieldMap = [
           { expireKey: 'businessExpire', startKey: 'businessStart', endKey: 'businessEnd' },
           { expireKey: 'licenseExpire', startKey: 'licenseStart', endKey: 'licenseEnd' },
@@ -1635,7 +1704,13 @@ export default {
           this.buildCateMap(node.children);
         }
       });
-    }
+    },
+    handleReviewAudit(){
+      console.log("aaaaaaaaaaaaaaa->",this.form.reviewAudit);
+    },
+    switchChange(){
+      console.log(this.form.isBusinessLicensePermanent);
+    },
   }
 };
 </script>