zhujindu 10 months ago
parent
commit
0cbc9cbe0a

+ 18 - 0
src/api/sfa/identify.js

@@ -0,0 +1,18 @@
+import request from '@/utils/request';
+
+// 查询媒体核查列表
+export function list(data) {
+  return request({
+    url: '/sfa/identify/list',
+    method: 'post',
+    data: data,
+  });
+}
+// 图片识别日志导出接口
+export function exportImg(data) {
+  return request({
+    url: '/sfa/identify/export',
+    method: 'post',
+    data: data,
+  });
+}

+ 60 - 0
src/api/sfa/whitelist.js

@@ -0,0 +1,60 @@
+import request from '@/utils/request'
+
+// 查询图片识别白名单列表
+export function listWhitelist(query) {
+  return request({
+    url: '/sfa/whitelist/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询图片识别白名单详细
+export function getWhitelist(photoWhitelistId) {
+  return request({
+    url: '/sfa/whitelist/' + photoWhitelistId,
+    method: 'get'
+  })
+}
+
+// 新增图片识别白名单
+export function addWhitelist(data) {
+  return request({
+    url: '/sfa/whitelist/add',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改图片识别白名单
+export function updateWhitelist(data) {
+  return request({
+    url: '/sfa/whitelist',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除图片识别白名单
+export function delWhitelist(query) {
+  return request({
+    url: '/sfa/whitelist/delete',
+    method: 'get',
+    params: query
+  })
+}
+/** 下载模板操作 */
+export function importTemplate() {
+  return request({
+    url: '/guide/taskuser/importTrackTemplate',
+    method: 'get',
+  });
+}
+// 图片识别白名单导入接口
+export function importPhotoWhitelist(data) {
+  return request({
+    url: '/sfa/whitelist/importPhotoWhitelist',
+    method: 'post',
+    params: data
+  })
+}

+ 17 - 1
src/views/sfa/collectionItem/index.vue

@@ -148,6 +148,12 @@
           <span>{{ isPictureFormat(scope.row, scope.column) }}</span>
         </template>
       </el-table-column>
+      <el-table-column label="允许相册选择图片" align="center" prop="pictureSource" width="98">
+        <template slot-scope="scope">
+          <span v-if="scope.row.pictureSource == '1'">是</span>
+          <span v-else>否</span>
+        </template>
+      </el-table-column>
       <!--      <el-table-column label="备注" align="center" prop="remark" />-->
       <el-table-column
         label="操作"
@@ -188,7 +194,7 @@
 
     <!-- 添加或修改采集项对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="60%" append-to-body>
-      <el-form class="collectionForm" ref="form" :model="form" :rules="rules" label-width="110px">
+      <el-form class="collectionForm" ref="form" :model="form" :rules="rules" label-width="125px">
         <el-row>
           <el-col :span="12" v-if="form.collectionId != null">
             <el-form-item label="采集项编号" prop="collectionCode">
@@ -293,6 +299,14 @@
               </el-radio-group>
             </el-form-item>
           </el-col>
+          <el-col :span="12">
+            <el-form-item label="允许相册选择图片" prop="pictureSource" style="height: 37px">
+              <el-radio-group size="mini" v-model="form.pictureSource">
+                <el-radio label="1">是</el-radio>
+                <el-radio label="0">否</el-radio>
+              </el-radio-group>
+            </el-form-item>
+          </el-col>
         </el-row>
         <el-form-item label="联系电话" prop="contactPhone" style="height: 37px">
           <el-input
@@ -1119,6 +1133,7 @@ export default {
         collectionOptionList: [
           { collectionOption: '', closeProject: '0', closeProcess: '0', frequencyReset: '0' },
         ],
+        pictureSource: '0',
       },
       // 表单校验
       rules: {
@@ -1436,6 +1451,7 @@ export default {
         isPicture: '1',
         isValid: '1',
         isMustPicture: '1',
+        pictureSource: '0',
         closeProject: '0',
         showHistory: '0',
         collectionOptionList: [

+ 527 - 0
src/views/sfa/identify/index.vue

@@ -0,0 +1,527 @@
+<template>
+  <div class="app-container identify">
+    <el-form
+      class="mediaQueryForm"
+      :model="queryParams"
+      ref="queryForm"
+      size="mini"
+      :inline="true"
+      label-width="90px"
+      v-show="showSearch"
+      :rules="rules">
+      <el-row>
+        <el-col :span="8">
+          <el-form-item class="treeselectForm treeselectForm2" label="组织架构" prop="deptIds">
+            <tree
+              @treeselectFn="treeselectFn"
+              :treeval="queryParams.deptIds"
+              :ismultiple="true"
+              style="width: 193px"></tree>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="识别时间" prop="datetimerange">
+            <el-date-picker
+              style="width: 203px"
+              v-model="queryParams.datetimerange"
+              type="datetimerange"
+              range-separator="至"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+              value-format="yyyy-MM-dd HH:mm:ss"
+              :clearable="false"
+              @change="datetimeRangeChange">
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="门店编码" prop="storeCode">
+            <el-input
+              v-model="queryParams.storeCode"
+              placeholder="请输入门店编码"
+              clearable
+              style="width: 203px"
+              @input="onInput()" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="销售员" prop="userId">
+            <user
+              :userId="queryParams.userId"
+              :orgIds="deptIds"
+              @userIdFn="userIdFn"
+              style="width: 203px"></user>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="门店类型" prop="storeCategorys">
+            <el-select
+              v-model="queryParams.storeCategorys"
+              clearable
+              multiple
+              collapse-tags
+              placeholder="请选择门店类型"
+              style="width: 203px">
+              <el-option
+                v-for="item in storeTypeOptions"
+                :key="item.dictValue"
+                :label="item.dictLabel"
+                :value="item.dictValue">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="是否合格" prop="qualifiedState">
+            <el-select
+              v-model="queryParams.qualifiedState"
+              clearable
+              placeholder="请选择照片是否合格"
+              style="width: 203px">
+              <el-option label="合格" :value="1"> </el-option>
+              <el-option label="不合格" :value="0"> </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8" v-if="isUnqualifiedReason">
+          <el-form-item label="不合格原因" prop="unqualifiedReason">
+            <el-select
+              v-model="queryParams.unqualifiedReason"
+              clearable
+              placeholder="请选择不合格原因"
+              style="width: 203px">
+              <el-option
+                v-for="item in unqualifiedReasonOptions"
+                :key="item.dictValue"
+                :label="item.dictLabel"
+                :value="item.dictValue">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="是否作弊" prop="cheatState">
+            <el-select
+              v-model="queryParams.cheatState"
+              clearable
+              placeholder="请选择照片是否作弊"
+              style="width: 203px">
+              <el-option label="作弊" :value="1"> </el-option>
+              <el-option label="未作弊" :value="0"> </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8" v-if="isCheatType">
+          <el-form-item label="作弊类型" prop="cheatType">
+            <el-select
+              v-model="queryParams.cheatType"
+              clearable
+              placeholder="请选择作弊类型"
+              style="width: 203px">
+              <el-option
+                v-for="item in cheatTypeOptions"
+                :key="item.dictValue"
+                :label="item.dictLabel"
+                :value="item.dictValue">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="照片类型" prop="photoSource">
+            <el-select
+              v-model="queryParams.photoSource"
+              clearable
+              placeholder="请选择照片类型"
+              style="width: 203px">
+              <el-option label="建店照" :value="1"> </el-option>
+              <el-option label="拜访照" :value="2"> </el-option>
+              <el-option label="拜访调色机" :value="3"> </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="是否选用" prop="isUse">
+            <el-select
+              v-model="queryParams.isUse"
+              clearable
+              placeholder="请选择是否选用"
+              style="width: 203px">
+              <el-option label="未使用" :value="0"> </el-option>
+              <el-option label="使用" :value="1"> </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="是否019店" prop="is019">
+            <el-select
+              v-model="queryParams.is019"
+              clearable
+              placeholder="请选择是否为019店"
+              style="width: 203px">
+              <el-option label="是" value="1"> </el-option>
+              <el-option label="否" value="0"> </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item>
+            <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
+            <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">
+          导出
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+    <div v-loading="loading" element-loading-text="查询中...">
+      <el-row :gutter="10" v-show="imgList.length > 0">
+        <el-col :span="4" v-for="(item, index) in imgList" :key="index">
+          <el-card class="imgCard" :body-style="{ padding: '0px' }">
+            <el-image
+              style="width: 100%; height: 200px"
+              :src="item.fileUrl"
+              :preview-src-list="previewsrcList">
+            </el-image>
+            <div style="padding: 14px">
+              <div class="info">
+                <el-tooltip :content="item.nickName" placement="top-start">
+                  <div><span>拜访人:</span>{{ item.nickName }}</div>
+                </el-tooltip>
+              </div>
+              <div class="info">
+                <el-tooltip :content="photoSourceFormater(item)" placement="top-start">
+                  <div><span>识别目的:</span>{{ photoSourceFormater(item) }}</div>
+                </el-tooltip>
+              </div>
+              <div class="info">
+                <el-tooltip :content="qualifiedStateFormater(item)" placement="top-start">
+                  <div>
+                    <span>识别结果:</span>
+                    {{ item.isPass }}
+                  </div>
+                </el-tooltip>
+              </div>
+              <div class="info">
+                <el-tooltip :content="item.responseConsumeTime + ''" placement="top-start">
+                  <div><span>识别耗时:</span>{{ item.responseConsumeTime }}s</div>
+                </el-tooltip>
+              </div>
+              <div class="info">
+                <el-tooltip :content="item.identifyNum + ''" placement="top-start">
+                  <div><span>识别次数:</span>{{ item.identifyNum }}次</div>
+                </el-tooltip>
+              </div>
+              <div class="info">
+                <el-tooltip :content="item.failReason" placement="top-start">
+                  <div><span>失败原因:</span>{{ item.failReason }}</div>
+                </el-tooltip>
+              </div>
+              <div class="info">
+                <el-tooltip :content="isUseFormater(item)" placement="top-start">
+                  <div><span>是否选用:</span>{{ isUseFormater(item) }}</div>
+                </el-tooltip>
+              </div>
+              <div class="info">
+                <el-tooltip :content="item.requestTime" placement="top-start">
+                  <div><span>识别时间:</span>{{ item.requestTime }}</div>
+                </el-tooltip>
+              </div>
+            </div>
+          </el-card>
+        </el-col>
+      </el-row>
+      <div v-show="imgList.length <= 0">
+        <el-empty :image-size="200"></el-empty>
+      </div>
+      <pagination
+        v-show="total > 0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList" />
+    </div>
+  </div>
+</template>
+
+<script>
+import { list, exportImg } from '@/api/sfa/identify';
+import tree from '@/views/components/sfa/treeselectParent';
+import user from '@/views/components/sfa/user';
+export default {
+  name: 'Media',
+  components: { tree, user },
+  data() {
+    return {
+      // 查询参数
+      queryParams: {
+        storeCode: '', //	string	门店编码
+        storeCategorys: [], //	string	门店类型
+        userId: '', //	int	业务员id
+        photoSource: '', //	int	图片识别类型:1:建店店招 2:拜访店招 3:拜访调色机
+        qualifiedState: '', //	string	是否合格(0:不合格,1:合格)
+        unqualifiedReason: '', //	string	不合格原因:对应tj_ungualified_reason字典
+        cheatState: '', //	string	是否作弊(0:不合格,1:合格)
+        cheatType: '', //	string	不合格原因:对应tj_cheat_type字典
+        requestTime: '', //	string	识别开始时间,yyyy-MM-dd HH:mm:ss格式
+        responseTime: '', //	string	识别结束时间,yyyy-MM-dd HH:mm:ss格式
+        isUse: '', //	string	是否选用:0-未使用 1-使用
+        is019: '',
+        isPass: '',
+        pageNum: 1,
+        pageSize: 30,
+        datetimerange: [],
+        deptIds: null,
+      },
+      total: 0,
+      deptIds: [],
+      mediaType: '',
+      imgList: [],
+      previewsrcList: [],
+      storeTypeOptions: [],
+      showSearch: true,
+      rules: {
+        datetimerange: [{ required: true, message: '请选择起止时间', trigger: 'change' }],
+      },
+      loading: false,
+      isUnqualifiedReason: false,
+      isCheatType: false,
+      unqualifiedReasonOptions: [],
+      cheatTypeOptions: [],
+    };
+  },
+  watch: {
+    'queryParams.qualifiedState': {
+      handler(val) {
+        if (val === 0) {
+          this.isUnqualifiedReason = true;
+        } else {
+          this.isUnqualifiedReason = false;
+          this.queryParams.unqualifiedReason = null;
+        }
+      },
+      immediate: true,
+    },
+    'queryParams.cheatState': {
+      handler(val) {
+        if (val === 1) {
+          this.isCheatType = true;
+        } else {
+          this.isCheatType = false;
+          this.queryParams.cheatType = null;
+        }
+      },
+      immediate: true,
+    },
+  },
+  created() {
+    // 是否
+    this.getDicts('is_not').then((response) => {
+      this.isNotOptions = response.data;
+    });
+    // 门店类型
+    if (this.$store.state.user.type == '2') {
+      this.getDicts('ysl_store_type').then((response) => {
+        this.storeTypeOptions = response.data;
+      });
+    } else {
+      this.getDicts('sfa_store_type').then((response) => {
+        this.storeTypeOptions = response.data;
+      });
+    }
+    // 图片识别不合格原因
+    this.getDicts('tj_ungualified_reason').then((response) => {
+      this.unqualifiedReasonOptions = response.data;
+    });
+    // 图片作弊类型
+    this.getDicts('tj_cheat_type').then((response) => {
+      this.cheatTypeOptions = response.data;
+    });
+    this.queryParams.datetimerange[0] = this.dateInit() + ' ' + '00:00:00';
+    this.queryParams.datetimerange[1] = this.dateInit() + ' ' + '23:59:59';
+    this.getList();
+  },
+  methods: {
+    dateInit() {
+      let date = new Date();
+      let year = date.getFullYear();
+      let month = date.getMonth() + 1;
+      let day = date.getDate();
+      if (month < 10) {
+        month = '0' + month;
+      }
+      if (day < 10) {
+        day = '0' + day;
+      }
+      let nowDate = year + '-' + month + '-' + day;
+      return nowDate;
+    },
+    onInput() {
+      this.$forceUpdate();
+    },
+    /** 查询产品信息列表 */
+    getList() {
+      this.loading = true;
+      this.previewsrcList = [];
+      let {
+        storeCode,
+        storeCategorys,
+        userId,
+        photoSource,
+        qualifiedState,
+        unqualifiedReason,
+        cheatState,
+        cheatType,
+        isUse,
+        is019,
+        isPass,
+        pageNum,
+        pageSize,
+        deptIds,
+      } = this.queryParams;
+      let queryParams = {
+        storeCode,
+        storeCategorys,
+        userId,
+        photoSource,
+        qualifiedState,
+        unqualifiedReason,
+        cheatState,
+        cheatType,
+        isPass,
+        isUse,
+        is019,
+        pageNum,
+        pageSize,
+        deptIds,
+      };
+      //   queryParams.deptIds = this.deptIds.join(',');
+      queryParams.unqualifiedReason =
+        this.queryParams.unqualifiedReason == null ? '' : this.queryParams.unqualifiedReason;
+      queryParams.userId = this.queryParams.userId == null ? '' : this.queryParams.userId;
+      queryParams.requestTime = this.queryParams.datetimerange[0];
+      queryParams.responseTime = this.queryParams.datetimerange[1];
+      list(queryParams).then((response) => {
+        this.loading = false;
+        this.imgList = response.rows;
+        this.total = response.total;
+        this.imgList.forEach((item, index) => {
+          item.fileUrl = item.fileUrl;
+          this.previewsrcList.push(item.fileUrl);
+        });
+      });
+    },
+    treeselectFn(val) {
+      this.queryParams.deptIds = val;
+    },
+    userIdFn(val) {
+      this.queryParams.userId = val;
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.$refs['queryForm'].validate((valid) => {
+        if (valid) {
+          this.getList();
+        }
+      });
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm('queryForm');
+      this.queryParams.deptIds = [];
+      this.handleQuery();
+    },
+    datetimeRangeChange(val) {},
+    handleExport() {
+      let queryParams = this.queryParams;
+      queryParams.unqualifiedReason =
+        this.queryParams.unqualifiedReason == null ? '' : this.queryParams.unqualifiedReason;
+      queryParams.userId = this.queryParams.userId == null ? '' : this.queryParams.userId;
+      queryParams.requestTime = this.queryParams.datetimerange[0];
+      queryParams.responseTime = this.queryParams.datetimerange[1];
+      this.download(
+        'sfa/identify/export',
+        {
+          ...queryParams,
+        },
+        `图片识别日志-${new Date().getTime()}.xlsx`
+      );
+    },
+    // 识别目的字段转换字符串
+    photoSourceFormater(obj) {
+      let str = '';
+      switch (obj.photoSource) {
+        case 1:
+          str = '建店店招';
+          break;
+        case 2:
+          str = '拜访店招';
+          break;
+        default:
+          str = '拜访调色机';
+          break;
+      }
+      return str;
+    },
+    // 是否合格字段转换字符串
+    qualifiedStateFormater(obj) {
+      let str = '';
+      switch (obj.qualifiedState) {
+        case '1':
+          str = '合格';
+          break;
+        default:
+          str = '不合格';
+          break;
+      }
+      return str;
+    },
+    // 是否选用字段转换字符串
+    isUseFormater(obj) {
+      let str = '';
+      switch (obj.isUse) {
+        case '1':
+          str = '使用';
+          break;
+        default:
+          str = '未使用';
+          break;
+      }
+      return str;
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.imgCard {
+  margin-top: 10px;
+  .info {
+    font-size: 14px;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    line-height: 30px;
+    span {
+      font-weight: bold;
+    }
+  }
+}
+</style>
+<style lang="scss">
+.mediaQueryForm .el-form-item {
+  height: 29px;
+}
+.identify {
+  .imageFile {
+    width: 100px !important;
+    height: 100px !important;
+  }
+}
+</style>

+ 305 - 214
src/views/sfa/media/index.vue

@@ -1,16 +1,24 @@
 <template>
   <div class="app-container">
-    <el-form class="mediaQueryForm" :model="queryParams" ref="queryForm" size="mini" :inline="true" label-width="90px" v-show="showSearch" :rules="rules">
+    <el-form
+      class="mediaQueryForm"
+      :model="queryParams"
+      ref="queryForm"
+      size="mini"
+      :inline="true"
+      label-width="90px"
+      v-show="showSearch"
+      :rules="rules">
       <el-row>
         <el-col :span="8">
           <el-form-item class="treeselectForm treeselectForm2" label="组织架构" prop="deptIds">
-            <tree @treeselectFn="treeselectFn" :treeval="deptIds" style="width: 203px;"></tree>
+            <tree @treeselectFn="treeselectFn" :treeval="deptIds" style="width: 203px"></tree>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="起止时间" prop="datetimerange">
             <el-date-picker
-              style="width: 203px;"
+              style="width: 203px"
               v-model="queryParams.datetimerange"
               type="daterange"
               range-separator="至"
@@ -23,7 +31,11 @@
         </el-col>
         <el-col :span="8">
           <el-form-item label="媒体类型" prop="objectType">
-            <el-select v-model="queryParams.objectType" clearable placeholder="请选择品牌" style="width: 203px;">
+            <el-select
+              v-model="queryParams.objectType"
+              clearable
+              placeholder="请选择品牌"
+              style="width: 203px">
               <el-option
                 v-for="item in mediaTypeOptions"
                 :key="item.dictValue"
@@ -39,9 +51,8 @@
               v-model="queryParams.storeCode"
               placeholder="请输入门店编码"
               clearable
-              style="width: 203px;"
-              @input="onInput()"
-            />
+              style="width: 203px"
+              @input="onInput()" />
           </el-form-item>
         </el-col>
         <el-col :span="8">
@@ -50,30 +61,36 @@
               v-model="queryParams.storeName"
               placeholder="请输入门店名称"
               clearable
-              style="width: 203px;"
-              @input="onInput()"
-            />
+              style="width: 203px"
+              @input="onInput()" />
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="销售员" prop="userId">
-            <user :userId="queryParams.userId" :orgIds="deptIds" @userIdFn="userIdFn" style="width: 203px;"></user>
+            <user
+              :userId="queryParams.userId"
+              :orgIds="deptIds"
+              @userIdFn="userIdFn"
+              style="width: 203px"></user>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="经销商名称" prop="chainName">
             <el-input
-              style="width: 203px;"
+              style="width: 203px"
               v-model="queryParams.chainName"
               placeholder="请输入经销商名称"
               clearable
-              @input="onInput()"
-            />
+              @input="onInput()" />
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="门店类型" prop="storeCategory">
-            <el-select v-model="queryParams.storeCategory" clearable placeholder="请选择门店类型" style="width: 203px;">
+            <el-select
+              v-model="queryParams.storeCategory"
+              clearable
+              placeholder="请选择门店类型"
+              style="width: 203px">
               <el-option
                 v-for="item in storeTypeOptions"
                 :key="item.dictValue"
@@ -83,6 +100,45 @@
             </el-select>
           </el-form-item>
         </el-col>
+        <el-col :span="8">
+          <el-form-item label="是否合格" prop="qualifiedState">
+            <el-select
+              v-model="queryParams.qualifiedState"
+              clearable
+              placeholder="请选择照片是否合格"
+              style="width: 203px">
+              <el-option label="合格" :value="1"> </el-option>
+              <el-option label="不合格" :value="0"> </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8" v-if="isUnqualifiedReason">
+          <el-form-item label="不合格原因" prop="unqualifiedReason">
+            <el-select
+              v-model="queryParams.unqualifiedReason"
+              clearable
+              placeholder="请选择不合格原因"
+              style="width: 203px">
+              <el-option
+                v-for="item in unqualifiedReasonOptions"
+                :key="item.dictValue"
+                :label="item.dictLabel"
+                :value="item.dictValue">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="照片类型" prop="photoType">
+            <el-select
+              v-model="queryParams.photoType"
+              placeholder="请选择照片类型"
+              style="width: 203px">
+              <el-option label="拜访照" :value="2"> </el-option>
+              <el-option label="标准店招" :value="1"> </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
         <el-col :span="8">
           <el-form-item>
             <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
@@ -93,96 +149,81 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
-        <el-col :span="1.5">
-          <el-button
-            type="warning"
-            plain
-            icon="el-icon-download"
-            size="mini"
-            @click="handleExport"
-          >导出</el-button>
-        </el-col>
+      <el-col :span="1.5">
+        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
+          >导出</el-button
+        >
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
-   <div  v-loading="loading" element-loading-text="查询中..."  >
-    <el-row :gutter="10" v-show="imgList.length>0" >
-      <el-col :span="4" v-for="(item,index) in imgList" :key="index">
-        <el-card class="imgCard" :body-style="{ padding: '0px' }">
-          <el-image
-            style="width: 100%;height:200px;"
-            :src="item.fileUrl"
-            :preview-src-list="previewsrcList">
-          </el-image>
-          <div style="padding: 14px;">
-            <div class="info">
-              <el-tooltip :content="mediaTypeFormater(item)" placement="top-start">
-                <templete>
-                  <span>媒体类型:</span>{{mediaTypeFormater(item)}}
-                </templete>
-              </el-tooltip>
-            </div>
-            <div class="info">
-              <el-tooltip :content="item.storeName" placement="top-start">
-                <templete>
-                  <span>门店名称:</span>
-                  {{item.storeName}}
-                </templete>
-              </el-tooltip>
+    <div v-loading="loading" element-loading-text="查询中...">
+      <el-row :gutter="10" v-show="imgList.length > 0">
+        <el-col :span="4" v-for="(item, index) in imgList" :key="index">
+          <el-card class="imgCard" :body-style="{ padding: '0px' }">
+            <el-image
+              style="width: 100%; height: 200px"
+              :src="item.fileUrl"
+              :preview-src-list="previewsrcList">
+            </el-image>
+            <div style="padding: 14px">
+              <div class="info">
+                <el-tooltip :content="mediaTypeFormater(item)" placement="top-start">
+                  <div class="items"><span>媒体类型:</span>{{ mediaTypeFormater(item) }}</div>
+                </el-tooltip>
+              </div>
+              <div class="info">
+                <el-tooltip :content="item.storeName" placement="top-start">
+                  <div class="items">
+                    <span>门店名称:</span>
+                    {{ item.storeName }}
+                  </div>
+                </el-tooltip>
+              </div>
+              <div class="info">
+                <el-tooltip :content="item.userName" placement="top-start">
+                  <div class="items"><span>销售员:</span>{{ item.userName }}</div>
+                </el-tooltip>
+              </div>
+              <div class="info">
+                <el-tooltip :content="item.shootTime" placement="top-start">
+                  <div class="items"><span>拍摄日期:</span>{{ item.shootTime }}</div>
+                </el-tooltip>
+              </div>
+              <div class="info">
+                <el-tooltip :content="item.deptName" placement="top-start">
+                  <div class="items"><span>组织架构:</span>{{ item.deptName }}</div>
+                </el-tooltip>
+              </div>
+              <div class="info">
+                <el-tooltip :content="item.chainName" placement="top-start">
+                  <div class="items"><span>经销商名称:</span>{{ item.chainName }}</div>
+                </el-tooltip>
+              </div>
+              <!--            <div class="info"><span>描述:</span>{{item.remark}}</div>-->
             </div>
-            <div class="info">
-              <el-tooltip :content="item.userName" placement="top-start">
-                <templete>
-                  <span>销售员:</span>{{item.userName}}
-                </templete>
-              </el-tooltip>
-            </div>
-            <div class="info">
-              <el-tooltip :content="item.shootTime" placement="top-start">
-                <templete>
-                  <span>拍摄日期:</span>{{item.shootTime}}
-                </templete>
-              </el-tooltip>
-            </div>
-            <div class="info">
-              <el-tooltip :content="item.deptName" placement="top-start">
-                <templete>
-                  <span>组织架构:</span>{{item.deptName}}
-                </templete>
-              </el-tooltip>
-            </div>
-            <div class="info">
-              <el-tooltip :content="item.chainName" placement="top-start">
-                <templete>
-                  <span>经销商名称:</span>{{item.chainName}}
-                </templete>
-              </el-tooltip>
-            </div>
-<!--            <div class="info"><span>描述:</span>{{item.remark}}</div>-->
-          </div>
-        </el-card>
-      </el-col>
-    </el-row>
-    <div v-show="imgList.length<=0">
-      <el-empty :image-size="200"></el-empty>
+          </el-card>
+        </el-col>
+      </el-row>
+      <div v-show="imgList.length <= 0">
+        <el-empty :image-size="200"></el-empty>
+      </div>
+      <pagination
+        v-show="total > 0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList" />
     </div>
-    <pagination
-      v-show="total>0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
-    />
-   </div>
   </div>
 </template>
 
 <script>
-import { listMedia,packImg } from "@/api/sfa/media";
-import tree from "@/views/components/sfa/treeselectParent";
-import user from "@/views/components/sfa/user";
+import { listMedia, packImg } from '@/api/sfa/media';
+import tree from '@/views/components/sfa/treeselectParent';
+import user from '@/views/components/sfa/user';
 export default {
-  name: "Media",
-  components: { tree,user },
+  name: 'Media',
+  components: { tree, user },
   data() {
     return {
       // 查询参数
@@ -192,153 +233,203 @@ export default {
         brandCode: null,
         spec: null,
         level1: null,
-        storeCode:"",
+        storeCode: '',
         isValid: null,
-          deptIds:[],
-          userId:null,
-          datetimerange:[],
-          pageNum: 1,
-          pageSize: 30,
+        deptIds: [],
+        userId: null,
+        datetimerange: [],
+        pageNum: 1,
+        pageSize: 30,
+        qualifiedState: null, //是否合格: 0:不合格,1:合格
+        photoType: 2, //照片类型:1:建店照 2:拜访照
+        unqualifiedReason: null,
+      },
+      total: 0,
+      deptIds: [],
+      mediaTypeOptions: [],
+      mediaType: '',
+      imgList: [],
+      previewsrcList: [],
+      storeTypeOptions: [],
+      showSearch: true,
+      rules: {
+        datetimerange: [{ required: true, message: '请选择起止时间', trigger: 'change' }],
+        photoType: [{ required: true, message: '请选择照片类型', trigger: 'change' }],
       },
-        total: 0,
-        deptIds:[],
-        mediaTypeOptions:[],
-        mediaType:'',
-        imgList:[],
-        previewsrcList: [],
-        storeTypeOptions:[],
-        showSearch: true,
-        rules:{
-            datetimerange: [ { required: true, message: '请选择起止时间', trigger: 'change' }],
-        },
-      loading:false
+      loading: false,
+      isUnqualifiedReason: false,
+      unqualifiedReasonOptions: [],
     };
   },
+  watch: {
+    'queryParams.qualifiedState': {
+      handler(val) {
+        if (val === 0) {
+          this.isUnqualifiedReason = true;
+        } else {
+          this.isUnqualifiedReason = false;
+          this.queryParams.unqualifiedReason = null;
+        }
+      },
+      immediate: true,
+    },
+  },
   created() {
-      // 是否
-      this.getDicts("is_not").then(response => {
-          this.isNotOptions = response.data;
-      });
-      // 层次一
-      this.getDicts("sfa_level1").then(response => {
-          this.level1Options = response.data;
+    // 是否
+    this.getDicts('is_not').then((response) => {
+      this.isNotOptions = response.data;
+    });
+    // 层次一
+    this.getDicts('sfa_level1').then((response) => {
+      this.level1Options = response.data;
+    });
+    // 品牌
+    this.getDicts('sfa_product_brand').then((response) => {
+      this.brandIdOptions = response.data;
+    });
+    // 媒体类型
+    this.getDicts('sfa_task_photo_type').then((response) => {
+      this.mediaTypeOptions = response.data;
+    });
+    // 门店类型
+    if (this.$store.state.user.type == '2') {
+      this.getDicts('ysl_store_type').then((response) => {
+        this.storeTypeOptions = response.data;
       });
-      // 品牌
-      this.getDicts("sfa_product_brand").then(response => {
-          this.brandIdOptions = response.data;
+    } else {
+      this.getDicts('sfa_store_type').then((response) => {
+        this.storeTypeOptions = response.data;
       });
-      // 媒体类型
-      this.getDicts("sfa_task_photo_type").then(response => {
-          this.mediaTypeOptions = response.data;
-      });
-      // 门店类型
-      if(this.$store.state.user.type == '2'){
-          this.getDicts("ysl_store_type").then(response => {
-              this.storeTypeOptions = response.data;
-          });
-      }else{
-          this.getDicts("sfa_store_type").then(response => {
-              this.storeTypeOptions = response.data;
-          });
-      }
-      this.queryParams.datetimerange[0] = this.dateInit();
-      this.queryParams.datetimerange[1] = this.dateInit();
+    }
+    // 图片识别不合格原因
+    this.getDicts('tj_ungualified_reason').then((response) => {
+      this.unqualifiedReasonOptions = response.data;
+    });
+    this.queryParams.datetimerange[0] = this.dateInit();
+    this.queryParams.datetimerange[1] = this.dateInit();
     this.getList();
   },
   methods: {
-      dateInit(){
-          let date = new Date();
-          let year = date .getFullYear();
-          let month = date.getMonth() + 1;
-          let day = date.getDate();
-          if (month < 10) {
-              month = "0" + month;
-          }
-          if (day < 10) {
-              day = "0" + day;
-          }
-          let nowDate = year + "-" + month + "-" + day;
-          return nowDate;
-      },
-      onInput(){
-          this.$forceUpdate();
-      },
+    dateInit() {
+      let date = new Date();
+      let year = date.getFullYear();
+      let month = date.getMonth() + 1;
+      let day = date.getDate();
+      if (month < 10) {
+        month = '0' + month;
+      }
+      if (day < 10) {
+        day = '0' + day;
+      }
+      let nowDate = year + '-' + month + '-' + day;
+      return nowDate;
+    },
+    onInput() {
+      this.$forceUpdate();
+    },
     /** 查询产品信息列表 */
     getList() {
-        this.loading=true
-        this.previewsrcList = [];
-        let { objectType,storeCode,storeName, userId,chainName,storeCategory,pageSize,pageNum} = this.queryParams;
-        let queryParams = { objectType,storeCode,storeName, userId,chainName,storeCategory,pageSize,pageNum};
-        queryParams.deptIds= this.deptIds.join(",");
-        queryParams.startTime = this.queryParams.datetimerange[0];
-        queryParams.stopTime = this.queryParams.datetimerange[1];
-        listMedia(queryParams).then(response => {
-          this.loading=false
-          this.imgList =  response.rows;
-          this.total = response.total;
-          this.imgList.forEach((item,index)=>{
-            item.fileUrl = item.fileUrl;
-            this.previewsrcList.push(item.fileUrl);
-          })
+      this.loading = true;
+      this.previewsrcList = [];
+      let {
+        objectType,
+        storeCode,
+        storeName,
+        userId,
+        chainName,
+        storeCategory,
+        pageSize,
+        pageNum,
+        qualifiedState,
+        photoType,
+        unqualifiedReason,
+      } = this.queryParams;
+      let queryParams = {
+        objectType,
+        storeCode,
+        storeName,
+        userId,
+        chainName,
+        storeCategory,
+        pageSize,
+        pageNum,
+        qualifiedState,
+        photoType,
+        unqualifiedReason,
+      };
+      queryParams.deptIds = this.deptIds.join(',');
+      queryParams.startTime = this.queryParams.datetimerange[0];
+      queryParams.stopTime = this.queryParams.datetimerange[1];
+      listMedia(queryParams).then((response) => {
+        this.loading = false;
+        this.imgList = response.rows;
+        this.total = response.total;
+        this.imgList.forEach((item, index) => {
+          item.fileUrl = item.fileUrl;
+          this.previewsrcList.push(item.fileUrl);
+        });
       });
     },
-      treeselectFn(val){
-          this.deptIds = val;
-      },
-      userIdFn(val){
-          this.queryParams.userId = val;
-      },
+    treeselectFn(val) {
+      this.deptIds = val;
+    },
+    userIdFn(val) {
+      this.queryParams.userId = val;
+    },
     /** 搜索按钮操作 */
     handleQuery() {
-        this.$refs['queryForm'].validate((valid) => {
-            if (valid) {
-                this.getList();
-            }
-        })
-
+      this.$refs['queryForm'].validate((valid) => {
+        if (valid) {
+          this.getList();
+        }
+      });
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm("queryForm");
+      this.resetForm('queryForm');
       this.handleQuery();
     },
-    datetimeRangeChange(val){
-
+    datetimeRangeChange(val) {},
+    mediaTypeFormater(row) {
+      return this.selectDictLabel(this.mediaTypeOptions, row.objectType);
     },
-    mediaTypeFormater(row){
-        return this.selectDictLabel(this.mediaTypeOptions, row.objectType);
+    handleExport() {
+      let queryParams = this.queryParams;
+      queryParams.deptIds = this.deptIds.join(',');
+      queryParams.startTime = this.queryParams.datetimerange[0];
+      queryParams.stopTime = this.queryParams.datetimerange[1];
+      packImg(queryParams).then((response) => {
+        if (response.code == 200) {
+          this.$modal.msgSuccess(response.msg);
+        }
+      });
     },
-    handleExport(){
-        let queryParams = this.queryParams;
-        queryParams.deptIds= this.deptIds.join(",");
-        queryParams.startTime = this.queryParams.datetimerange[0];
-        queryParams.stopTime = this.queryParams.datetimerange[1];
-        packImg(queryParams).then(response => {
-            if(response.code ==200){
-                this.$modal.msgSuccess(response.msg);
-            }
-        })
-    }
-  }
+  },
 };
 </script>
 <style lang="scss" scoped>
-  .imgCard{
-    margin-top: 10px;
-    .info{
+.imgCard {
+  margin-top: 10px;
+  .info {
+    /* font-size: 14px;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis; */
+    line-height: 30px;
+    span {
+      font-weight: bold;
+    }
+    .items {
       font-size: 14px;
-      white-space:nowrap;
-      overflow:hidden;
-      text-overflow:ellipsis;
-      line-height: 30px;
-      span{
-        font-weight: bold;
-      }
+      overflow: hidden;
+      white-space: nowrap;
+      text-overflow: ellipsis;
     }
   }
+}
 </style>
 <style lang="scss">
-  .mediaQueryForm .el-form-item{
-    height: 29px;
-  }
+.mediaQueryForm .el-form-item {
+  height: 29px;
+}
 </style>

File diff suppressed because it is too large
+ 1660 - 1655
src/views/sfa/report/reportDetail.vue


+ 42 - 16
src/views/sfa/store/index.vue

@@ -563,7 +563,9 @@
       <!--      <el-table-column label="未知保留" align="center" prop="attribute5" />-->
       <el-table-column label="经销商" align="center" prop="chainInfo" width="210px">
         <template slot-scope="scope">
-          <el-tooltip placement="top" :popper-class="scope.row.sfaStoreType.type == 'fxd' ? 'width600':''"	>
+          <el-tooltip
+            placement="top"
+            :popper-class="scope.row.sfaStoreType.type == 'fxd' ? 'width600' : ''">
             <div slot="content">
               <el-table
                 v-if="scope.row.sfaStoreType && scope.row.sfaStoreType.type == 'fxd'"
@@ -959,15 +961,15 @@
                 @input="onInput()" />
             </el-form-item>
           </el-col>
-<!--          <el-col :span="8" v-show="title == '门店详情' && form.storeCategory != 'C917'">-->
-<!--            <el-form-item label="经销商编号" prop="chainCode">-->
-<!--              <el-input-->
-<!--                v-model="form.chainCode"-->
-<!--                placeholder="请输入经销商编号"-->
-<!--                disabled-->
-<!--                style="width: 193px" />-->
-<!--            </el-form-item>-->
-<!--          </el-col>-->
+          <!--          <el-col :span="8" v-show="title == '门店详情' && form.storeCategory != 'C917'">-->
+          <!--            <el-form-item label="经销商编号" prop="chainCode">-->
+          <!--              <el-input-->
+          <!--                v-model="form.chainCode"-->
+          <!--                placeholder="请输入经销商编号"-->
+          <!--                disabled-->
+          <!--                style="width: 193px" />-->
+          <!--            </el-form-item>-->
+          <!--          </el-col>-->
 
           <el-col :span="8">
             <el-form-item v-if="form.ifJzStoreType != 1" label="面积(㎡)" prop="area">
@@ -1398,6 +1400,30 @@
               </div>
             </el-image>
           </el-col>
+          <!-- 标准店招(最新) -->
+          <el-col :span="8" :offset="1" v-if="form.standardStorePhoto">
+            <div class="imgTitle">标准店招(最新)</div>
+            <el-image
+              style="width: 100%; height: 200px"
+              :src="form.standardStorePhoto"
+              :preview-src-list="[form.standardStorePhoto]">
+              <div slot="error" class="image-slot">
+                <i class="el-icon-picture" style="font-size: 170px; color: #eff2f6"></i>
+              </div>
+            </el-image>
+          </el-col>
+          <!-- 最近一次拜访店照 -->
+          <el-col :span="8" :offset="1" v-if="form.newStoreSignPhoto">
+            <div class="imgTitle">最近拜访店招(截止当天0点)</div>
+            <el-image
+              style="width: 100%; height: 200px"
+              :src="form.newStoreSignPhoto"
+              :preview-src-list="[form.newStoreSignPhoto]">
+              <div slot="error" class="image-slot">
+                <i class="el-icon-picture" style="font-size: 170px; color: #eff2f6"></i>
+              </div>
+            </el-image>
+          </el-col>
         </el-row>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -1752,7 +1778,7 @@ export default {
         }
       });
       this.form.chainCode = '';
-      this.$set(this,'cascader',{});
+      this.$set(this, 'cascader', {});
     },
     getListChainsByCategory(storeId = null) {
       listChainsByCategory({ deptId: this.form.orgId }).then((response) => {
@@ -1861,13 +1887,13 @@ export default {
     treeselectFnSingle(val) {
       if (val.deptId != undefined && val.deptId != '' && val.deptId != null) {
         this.form.orgId = val.deptId;
-        this.$set(this,'cascader',{});
+        this.$set(this, 'cascader', {});
         this.getChainList2();
         this.form.chainCode = '';
         this.form.chainName = '';
         this.form.sfaStoreChainsContactList = [];
         this.getOrderProductListByDeptId();
-        this.getListChainsByCategory()
+        this.getListChainsByCategory();
       }
     },
     userIdFocus() {
@@ -2095,7 +2121,7 @@ export default {
     handleUpdate(row) {
       this.loading = true;
       this.form.chainCode = '';
-      this.$set(this,'cascader',{});
+      this.$set(this, 'cascader', {});
       this.reset();
       this.form = {};
       this.title = '修改门店';
@@ -2199,7 +2225,7 @@ export default {
     },
     handleDetail(row) {
       this.form.chainCode = '';
-      this.$set(this,'cascader',{});
+      this.$set(this, 'cascader', {});
       this.reset();
       this.form = {};
       if (this.$store.state.user.type == '2') {
@@ -2675,7 +2701,7 @@ export default {
   border-radius: 50%;
   display: inline-block;
 }
-.width600{
+.width600 {
   width: 600px !important;
   max-width: 600px !important;
 }

+ 19 - 1
src/views/sfa/task/index.vue

@@ -237,6 +237,18 @@
               </el-select>
             </el-form-item>
           </el-col>
+          <el-col :span="6">
+            <el-form-item label="图片识别类型" prop="photoIdentifyType">
+              <el-select v-model="editForm.photoIdentifyType" clearable placeholder="图片识别类型" style="width: 178px;" @change="onInput()">
+                <el-option
+                  v-for="item in photoIdentifyTypeOptions"
+                  :key="item.dictValue"
+                  :label="item.dictLabel"
+                  :value="item.dictValue">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
           <el-col :span="6" v-if="editForm.taskType==2||editForm.taskType==3">
             <el-form-item label="是否必填" prop="isMust" style="height: 29px;" >
               <el-radio-group v-model="editForm.isMust">
@@ -913,7 +925,8 @@
                     isMust:'1',
                     unManage:"1",
                     collectionItemList: [],
-                    signDictypeList:[]
+                    signDictypeList:[],
+                    photoIdentifyType:"",
                 },
                 addCJXForm:{
                     pageNum: 1,
@@ -956,6 +969,7 @@
                   },
                 ],
                 photoTypeOptions:[],
+                photoIdentifyTypeOptions:[],
                 previewForm:[],
                 brandIdOptions:[],
                 level1Options:[],
@@ -984,6 +998,10 @@
             this.getDicts("sfa_task_photo_type").then(response => {
                 this.photoTypeOptions = response.data;
             });
+            // 图像识别类型
+            this.getDicts("photo_identify_type").then(response => {
+                this.photoIdentifyTypeOptions = response.data;
+            });
             // 层次一
             this.getDicts("sfa_level1").then(response => {
                 this.level1Options = response.data;

+ 402 - 0
src/views/sfa/whitelist/index.vue

@@ -0,0 +1,402 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
+      <el-form-item label="门店编码" prop="storeCode">
+        <el-input
+          v-model="queryParams.storeCode"
+          placeholder="请输入门店编码"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="门店名称" prop="storeName">
+        <el-input
+          v-model="queryParams.storeName"
+          placeholder="请输入门店名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="图片识别类型" prop="identifyType">
+        <el-select
+          v-model="queryParams.identifyType"
+          clearable
+          placeholder="请选择图片识别类型"
+          style="width: 203px">
+          <el-option
+            v-for="item in identifyTypeOptions"
+            :key="item.dictValue"
+            :label="item.dictLabel"
+            :value="item.dictValue">
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['sfa:whitelist:add']"
+        >新增</el-button>
+      </el-col>
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="success"-->
+<!--          plain-->
+<!--          icon="el-icon-edit"-->
+<!--          size="mini"-->
+<!--          :disabled="single"-->
+<!--          @click="handleUpdate"-->
+<!--          v-hasPermi="['sfa:whitelist:edit']"-->
+<!--        >修改</el-button>-->
+<!--      </el-col>-->
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="danger"-->
+<!--          plain-->
+<!--          icon="el-icon-delete"-->
+<!--          size="mini"-->
+<!--          :disabled="multiple"-->
+<!--          @click="handleDelete"-->
+<!--          v-hasPermi="['sfa:whitelist:remove']"-->
+<!--        >删除</el-button>-->
+<!--      </el-col>-->
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['sfa:whitelist:export']"
+        >导出</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport"
+        >导入</el-button
+        >
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="whitelistList">
+<!--      <el-table-column type="selection" width="55" align="center" />-->
+      <el-table-column label="公司" align="center" prop="gsName" show-overflow-tooltip />
+      <el-table-column label="大区" align="center" prop="dqName" show-overflow-tooltip />
+      <el-table-column label="销售部" align="center" prop="deptName" show-overflow-tooltip />
+      <el-table-column label="门店编码" align="center" prop="storeCode" />
+      <el-table-column label="门店名称" align="center" prop="storeName" show-overflow-tooltip />
+<!--      <el-table-column label="门店类型" align="center" prop="storeCategory" />-->
+      <el-table-column label="图片识别类型" align="center" prop="identifyTypeStr" />
+      <el-table-column label="添加时间" align="center" prop="createTime" width="170" />
+      <el-table-column label="添加人" align="center" prop="createBy" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+<!--          <el-button-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-edit"-->
+<!--            @click="handleUpdate(scope.row)"-->
+<!--            v-hasPermi="['sfa:whitelist:edit']"-->
+<!--          >修改</el-button>-->
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['sfa:whitelist:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改图片识别白名单对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+        <el-form-item label="门店编码" prop="storeCode">
+          <el-input v-model="form.storeCode" placeholder="请输入门店编码" />
+        </el-form-item>
+        <el-form-item label="图片识别类型" prop="identifyType">
+          <el-select v-model="form.identifyType" placeholder="请选择" style="width: 100%;">
+            <el-option
+              v-for="item in identifyTypeOptions"
+              :key="item.dictValue"
+              :label="item.dictLabel"
+              :value="item.dictValue">
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+    <el-dialog
+      class="upload"
+      :title="upload.title"
+      :visible.sync="upload.open"
+      width="400px"
+      append-to-body>
+      <div style="margin-bottom: 14px">
+        <el-link type="primary" style="font-size: 14px" @click="importTemplate">下载模板</el-link>
+      </div>
+
+      <el-upload
+        ref="upload"
+        :limit="1"
+        accept=".xlsx, .xls"
+        :headers="upload.headers"
+        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :disabled="upload.isUploading"
+        :on-progress="handleFileUploadProgress"
+        :on-success="handleFileSuccess"
+        :auto-upload="false"
+        drag>
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">
+          将文件拖到此处,或
+          <em>点击上传</em>
+        </div>
+
+        <div class="el-upload__tip" style="color: red" slot="tip">
+          提示:仅允许导入“xls”或“xlsx”格式文件!
+        </div>
+      </el-upload>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFileForm" :disabled="upload.isUploading"
+        >确 定</el-button
+        >
+        <el-button @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listWhitelist, getWhitelist, delWhitelist, addWhitelist, updateWhitelist,importPhotoWhitelist } from "@/api/sfa/whitelist";
+import { getToken } from '@/utils/auth';
+export default {
+  name: "Whitelist",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 图片识别白名单表格数据
+      whitelistList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        storeCode: null,
+        identifyType: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      },
+      identifyTypeOptions:[],
+      upload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: '',
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: 'Bearer ' + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + '/common/upload',
+        loadProgress: 10,
+      },
+    };
+  },
+  created() {
+    this.getDicts('photo_identify_type').then((response) => {
+      this.identifyTypeOptions = response.data;
+    });
+    this.getList();
+  },
+  methods: {
+    /** 查询图片识别白名单列表 */
+    getList() {
+      this.loading = true;
+      listWhitelist(this.queryParams).then(response => {
+        this.whitelistList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        photoWhitelistId: null,
+        storeCode: null,
+        identifyType: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null,
+        delFlag: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.queryParams = {};
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.photoWhitelistId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加图片识别白名单";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const photoWhitelistId = row.photoWhitelistId || this.ids
+      getWhitelist(photoWhitelistId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改图片识别白名单";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.photoWhitelistId != null) {
+            updateWhitelist(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addWhitelist(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const photoWhitelistIds = row.photoWhitelistId || this.ids;
+      this.$modal.confirm('是否确认删除所选中的数据项?').then(function() {
+        return delWhitelist({photoWhitelistId:photoWhitelistIds});
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('sfa/whitelist/export', {
+        ...this.queryParams
+      }, `whitelist_${new Date().getTime()}.xlsx`)
+    },
+    handleImport() {
+      this.upload.title = '白名单门店导入';
+      this.upload.open = true;
+    },
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+      this.upladLoading = this.$loading({
+        lock: true,
+        text: '拼命上传中',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)',
+      });
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      let that = this;
+      if(response.code==200){
+        let data = {
+          url:  response.fileName
+        }
+        importPhotoWhitelist(data).then(res => {
+          this.upload.open = false;
+          this.upload.isUploading = false;
+          this.upladLoading.close();
+          this.$refs.upload.clearFiles();
+          this.$alert(res.data.error, "导入结果", { dangerouslyUseHTMLString: true });
+          this.getList();
+        })
+      }else{
+        this.upload.open = false;
+        this.upload.isUploading = false;
+        this.upladLoading.close();
+        this.$refs.upload.clearFiles();
+        this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
+        this.getList();
+      }
+    },
+    /** 下载模板操作 */
+    importTemplate() {
+      let url = process.env.VUE_APP_Target + '/profile/upload/template/图片识别白名单导入模版.xlsx'
+      window.open(url, '_blank')
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+    },
+  }
+};
+</script>