snow 2 jaren geleden
bovenliggende
commit
dbfea23b08

File diff suppressed because it is too large
+ 0 - 0
dist/static/js/0.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.js


+ 1 - 3
src/App.vue

@@ -40,9 +40,7 @@ export default {
             await this.logout()
           }
         })
-        .catch(async(err) => {
-          await this.logout()
-        })
+        .catch((_err) => { this.logout() })
     },
     async logout() {
       if (this.$route.path !== '/login' && this.$route.path !== '/accept') {

+ 8 - 5
src/apis/components/search-account.js

@@ -1,7 +1,10 @@
-import http from "@/apis/axios";
-const api = "admin/";
+import http from '@/apis/axios'
+const api = 'admin/'
 export default {
   // 列表
-  list: (data, params) => http(api + "userlist", data, "post", params),
-};
-   
+  list: (data, params) => http(api + 'userCompanyBasicList', {
+    ...data,
+    level: '2'
+  }, 'post', params)
+}
+

+ 48 - 49
src/components/globalComponents/search-account/main.vue

@@ -20,28 +20,27 @@
       :key="item.id + index"
       :label="item.nickname"
       :value="item.id"
-    >
-    </el-option>
+    />
   </el-select>
 </template>
 
 <script>
-import asyncRequest from "@/apis/components/search-account";
-import resToken from "@/mixins/resToken";
-import { mapState } from "vuex";
+import asyncRequest from '@/apis/components/search-account'
+import resToken from '@/mixins/resToken'
+import { mapState } from 'vuex'
 
 export default {
-  name: "SearchAccount",
+  name: 'SearchAccount',
   mixins: [resToken],
   props: [
-    "size",
-    "value",
-    "placeholder",
-    "isDetail",
-    "disabled",
-    "names",
-    "itemid",
-    "filterCompany"
+    'size',
+    'value',
+    'placeholder',
+    'isDetail',
+    'disabled',
+    'names',
+    'itemid',
+    'filterCompany'
   ],
   /**
    * 属性集合
@@ -52,7 +51,7 @@ export default {
    * @param {Boolean}       disabled         : 是否禁用            必填
    * @param {String}        names            : 选中值label         展示详情必填
    * @param {String}        itemid           : 组织id              非必填
-   * @param {boolean}       filterCompany    : 是否按当前公司筛选  
+   * @param {boolean}       filterCompany    : 是否按当前公司筛选
    */
   /**
    * 事件集合
@@ -62,72 +61,72 @@ export default {
     return {
       options: [],
       selectLoading: false,
-      searchName: "",
-    };
+      searchName: ''
+    }
   },
-  computed:{
+  computed: {
     ...mapState({
-     currentCompany: (state) => state.user.currentCompany //当前选中的业务公司
+      currentCompany: (state) => state.user.currentCompany // 当前选中的业务公司
     })
   },
   watch: {
-    names: function (val, old) {
-      this.searchName = val;
+    names: function(val, old) {
+      this.searchName = val
       if (this.isDetail && this.searchName) {
-        this.remoteMethod(this.searchName);
+        this.remoteMethod(this.searchName)
       }
-    },
+    }
   },
   mounted() {
-    this.options = [];
-    this.selectLoading = false;
+    this.options = []
+    this.selectLoading = false
   },
   methods: {
     async selectChange(e) {
       if (e && e.length > 0) {
-        let index = this.options.findIndex((v) => v.id === e[0]);
+        const index = this.options.findIndex((v) => v.id === e[0])
         if (index !== -1) {
-          let model = {
+          const model = {
             id: this.options[index].id,
             code: this.options[index].id,
-            label: this.options[index].nickname,
-          };
-          this.$emit("searchChange", model);
+            label: this.options[index].nickname
+          }
+          this.$emit('searchChange', model)
         } else {
-          this.$emit("searchChange", {});
+          this.$emit('searchChange', {})
         }
       } else {
-        this.$emit("searchChange", {});
+        this.$emit('searchChange', {})
       }
     },
     async remoteMethod(query) {
-      this.selectLoading = true;
-      if (query !== "") {
-        this.options = [];
-        let formValue = {
+      this.selectLoading = true
+      if (query !== '') {
+        this.options = []
+        const formValue = {
           page: 1,
           size: 100,
           name: query,
-          itemid: this.itemid || "",
-          companyNo: this.filterCompany ? this.currentCompany : ""
-        };
+          itemid: this.itemid || '',
+          companyNo: this.filterCompany ? this.currentCompany : ''
+        }
 
-        let res = await asyncRequest.list(formValue);
+        const res = await asyncRequest.list(formValue)
         if (res && res.code === 0 && res.data) {
-          const { list } = res.data;
-          this.options = list;
+          const { list } = res.data
+          this.options = list
         } else if (res && res.code >= 100 && res.code <= 104) {
-          await this.logout();
+          await this.logout()
         } else {
-          this.$message.warning(res.message);
+          this.$message.warning(res.message)
         }
       } else {
-        this.options = [];
+        this.options = []
       }
-      this.selectLoading = false;
-    },
-  },
-};
+      this.selectLoading = false
+    }
+  }
+}
 </script>
 
 <style>

+ 2 - 1
src/layout/components/company-select-origin/index.vue

@@ -18,7 +18,7 @@
     <!-- 当selectAll为true 且为超管账号允许选择所有公司 -->
     <el-option v-if="selectAll && isSupertube" :label="allCompanyLabel" value="" />
 
-    <el-option
+    <el-options
       v-for="(company, index) in companylist"
       :key="index"
       class="custom-company"
@@ -145,6 +145,7 @@ export default {
       const api = this.isSupertube || this.isSupplier ? requsetSupertubeCompany : requsetUserBindingCompany
       const isSupplier = this.currentLevel === accountLevels.supplier
       const { page, size, name } = this.params
+
       const params = {
         ...(this.isSupertube ? { type: isSupplier ? '3' : '1' } : {}),
         [this.isSupertube ? 'name' : 'companyName']: name,

+ 29 - 34
src/layout/components/company-select/index.vue

@@ -16,7 +16,7 @@
     @change="setCurrentCompany"
   >
     <!-- 当selectAll为true 且为超管账号允许选择所有公司 -->
-    <el-option v-if="selectAll && isSupertube" :label="allCompanyLabel" value="" />
+    <el-option v-if="selectAll && isSupertube" class="custom-company" :label="allCompanyLabel" value="" />
 
     <el-option
       v-for="(company, index) in companylist"
@@ -38,8 +38,8 @@
 <script>
 import { requsetSupertubeCompany, requsetUserBindingCompany } from '@/apis/user'
 import { isBusinessCompany, isOnlyBusinessCompanyPath } from './utils'
-import { accountLevels } from '@/assets/js/statusList'
 import { userStoreActions } from '@/store/modules/user'
+import { accountLevels } from '@/assets/js/statusList'
 import { getUserCompany } from '@/utils/auth'
 import { convertCompanylist } from '@/utils'
 import { mapGetters, mapState } from 'vuex'
@@ -91,23 +91,21 @@ export default {
       isSupertube: state => state.user.isSupertube
     })
   },
-  data() {
-    return {
-      ScrollWrapper: null,
-      initialization: true,
-      companyChangeLoading: false,
-      key: 1,
-      state: {
-        loading: false,
-        noMore: false
-      },
-      params: {
-        name: '',
-        page: 2,
-        size: 10
-      }
+  data: () => ({
+    ScrollWrapper: null,
+    initialization: true,
+    companyChangeLoading: false,
+    key: 1,
+    state: {
+      loading: false,
+      noMore: false
+    },
+    params: {
+      name: '',
+      page: 2,
+      size: 10
     }
-  },
+  }),
   watch: {
     currentLevel: {
       handler() {
@@ -126,7 +124,7 @@ export default {
     }
   },
   async mounted() {
-    await this.initalData()
+    this.isSupertube && await this.initalData()
     this.ScrollWrapper = await this.getScrollWrapper()
     this.ScrollWrapper && this.bindEvent(this.ScrollWrapper)
   },
@@ -140,27 +138,26 @@ export default {
       return `${code}/${name}${type === '1' ? '(已升级为业务公司)' : ''}`
     },
     async initalData() {
-      if (!this.isSupertube) return
       // 区分是否超管用户请求不同接口
       this.state.loading = true
       const api = this.isSupertube || this.isSupplier ? requsetSupertubeCompany : requsetUserBindingCompany
       const isSupplier = this.currentLevel === accountLevels.supplier
       const { page, size, name } = this.params
+
       const params = {
         ...(this.isSupertube ? { type: isSupplier ? '3' : '1' } : {}),
         [this.isSupertube ? 'name' : 'companyName']: name,
         page,
         size
       }
-      const { code, data } = await api(params)
-      if (code === 0) {
-        if (data.list.length < 10) this.state.noMore = true
-        this.state.loading = false
-        this.params.page++
-        const _list = this.isSupertube ? data.list : convertCompanylist(data.list)
-        this.$store.commit('user/setCompanylist', [...this.companylist, ..._list])
-        return this.isSupertube ? data.list : convertCompanylist(data.list)
-      }
+
+      const { data } = await api(params)
+      if (data.list.length < 10) this.state.noMore = true
+      this.state.loading = false
+      this.params.page++
+      const _list = this.isSupertube ? data.list : convertCompanylist(data.list)
+      this.$store.commit('user/setCompanylist', [...this.companylist, ..._list])
+      return this.isSupertube ? data.list : convertCompanylist(data.list)
     },
 
     setCurrentCompany(currentCompany) {
@@ -168,7 +165,6 @@ export default {
       this.$emit('change', currentCompany)
       // 作为通用组件使用不设置全局选中公司
       if (!this.global) return null
-
       // 只能选择业务公司的页面
       const { path } = this.$route
       if (isOnlyBusinessCompanyPath(path) && !isBusinessCompany(currentCompany)) {
@@ -290,14 +286,13 @@ export default {
       const result = await this.initalData()
       if (result) this.$store.commit(userStoreActions.setCompanyList, result)
     },
-
-    bindEvent(ScrollWrapper) { this.isSupertube && ScrollWrapper.addEventListener('scroll', this.handleScroll) },
-    removeEvent(ScrollWrapper) { this.isSupertube && ScrollWrapper.removeEventListener('scroll', this.handleScroll) },
     selectAllCompany() {
       this.value = ''
       this.$nextTick(() => (this.key = this.key + 1))
       this.global && this.$store.commit(userStoreActions.setCurrentCompany, '')
-    }
+    },
+    bindEvent(ScrollWrapper) { this.isSupertube && ScrollWrapper.addEventListener('scroll', this.handleScroll) },
+    removeEvent(ScrollWrapper) { this.isSupertube && ScrollWrapper.removeEventListener('scroll', this.handleScroll) }
   }
 }
 </script>

+ 56 - 10
src/store/modules/user.js

@@ -49,7 +49,6 @@ import {
 } from '@/utils/auth'
 
 import supplierRouteRecord from "@/router/data"
-import { isBusinessCompany } from '@/layout/components/company-select/utils'
 
 
 
@@ -287,12 +286,10 @@ const actions = {
       if (pcode === 0) {
         commit("roleProcess", pdata ?? []);
       }
-
       if (pcode >= 100 && pcode <= 104) {
         resolve("noToken");
         return
       }
-
       //根据角色获取角色详情 获取关键字字段
       const {code: rcode, data: rdata, message: rmsg} = await reuqsetRoleInfo({ roleid: roleid })
 
@@ -334,13 +331,11 @@ const actions = {
           commit('setCurrentLevel', level)
           //获取公司列表(区分超管和普通账户api)
           const api = isSupertube ? requsetSupertubeCompany : requsetUserBindingCompany
-          
           //获取缓存里的业务公司 => 公司名称搜索 => 存在设置为默认公司
           const { data: companyData, code: companyCode } = await api({
-            ...(!isSupertube ? ({size:10000}) : {type: '1'}),
+            ...(!isSupertube ? ({size: 10000}) : {type: '1'}),
             ...({token: getToken()}),
           })
-
            //保存公司列表 普通用户和超管使用两个列表需要转换
            let _companylist = []
            if(companyCode === 0) {
@@ -469,7 +464,6 @@ function isHasRoute(routes){
   let isHas = false
   const chunks = location.hash.split('/')
   const currentPath = chunks[chunks.length - 1]
-
   const dfs = (routes) => {
     routes.forEach(route => {
       if(route.path === currentPath) isHas = true;
@@ -477,7 +471,60 @@ function isHasRoute(routes){
     })
   }
 
-  dfs(routes)
+  dfs([ 
+  {
+    path: "/person",
+    component: () => import("@/layout/index"),
+    redirect: "/person/my-message",
+    hidden: true,
+    alwaysShow: true,
+    meta: {
+      title: "个人中心",
+      icon: "user",
+    },
+    children: [
+      {
+        path: "my-message",
+        component: () => import("@/views/person-infor/my-message"),
+        name: "MyMessage",
+        alwaysShow: true,
+        meta: { title: "我的信息", noCache: true, breadcrumb: true },
+      },
+      {
+        path: "change-phone",
+        component: () => import("@/views/person-infor/change-phone"),
+        name: "ChangePhone",
+        alwaysShow: true,
+        meta: { title: "更换手机号", noCache: true, breadcrumb: true },
+      },
+      {
+        path: "change-password",
+        component: () => import("@/views/person-infor/change-password"),
+        name: "ChangePassword",
+        alwaysShow: true,
+        meta: { title: "修改密码", noCache: true, breadcrumb: true },
+      },
+      {
+        path:'/reload',
+        component:() => import('@/views/reload/index')
+      }
+    ],
+  },
+  //欢迎页
+  {
+    path: "/welcome",
+    component: () => import("@/layout/index"),
+    redirect: "/welcome/dashboard",
+    children: [
+      {
+        path: "dashboard",
+        component: () => import("@/views/dashboard/index"),
+        name: "Dashboard",
+        meta: { title: "首页", icon: "dashboard", affix: true },
+      },
+    ],
+  },...routes])
+
   return isHas
 }
 
@@ -540,9 +587,8 @@ async function getRoleMenuList(level = "") {
     });
   }
 
-  //fix:默认获取业务公司的路由,如果跳转的是供应商路由应该指向/welcome
   const isHas = isHasRoute(arrag)
-  if(!isHas) router.push('/welcome')
+  if(!isHas) router.push('/welcome/dashboard')
   
   return {
     mcode: code,

+ 7 - 5
src/utils/index.js

@@ -359,10 +359,12 @@ export function removeClass(ele, cls) {
 }
 
 export function convertCompanylist(list) {
-  return list.map(({ companyName, companyCode, is_main, roleid }) => ({
-    code: companyCode,
-    name: companyName,
+  const func = ({ companyName, companyCode, is_main, roleid }) => ({
+    roleid,
     is_main,
-    roleid
-  }))
+    code: companyCode,
+    name: companyName
+  })
+
+  return list.map(func)
 }

+ 4 - 12
src/views/login/index.vue

@@ -123,11 +123,12 @@
 </template>
 
 <script>
-import asyncRequest from '@/apis/service/user'
-import resToken from '@/mixins/resToken'
 import { isnumber, isAlphanumeric, validAlphabets, isMobile } from '@/utils/validate'
-import urlConfig from '@/apis/url-config'
+import asyncRequest from '@/apis/service/user'
 import Identify from '@/components/identify'
+import urlConfig from '@/apis/url-config'
+import resToken from '@/mixins/resToken'
+
 export default {
   name: 'Login',
   components: { Identify },
@@ -213,14 +214,6 @@ export default {
     }
   },
   mounted() {
-    // console.log(process.env.NODE_ENV);
-    // if (process.env.NODE_ENV === "development") {
-    //   this.loginForm = {
-    //     username: "17744520491",
-    //     password: "mlp123",
-    //   };
-    // }
-
     this.refreshCode()
     // this.getversion();
     if (this.loginForm.username === '') {
@@ -272,7 +265,6 @@ export default {
     refreshCode() {
       this.identifyCode = ''
       this.makeCode(this.identifyCodes, 4)
-      console.log('当前验证码:', this.identifyCode)
     },
     makeCode(data, len) {
       for (let i = 0; i < len; i++) {

+ 0 - 1
src/views/sellOut/sellAfterApply/components/purchase_exam.vue

@@ -262,7 +262,6 @@ export default {
           model.is_th = this.is_receive + '' === "0" ? "0" : model.is_th;
           model.return_tag = this.is_receive + '' === "0" ? "0" : model.return_tag;
           model.is_post = "0";
-          console.log(model);
           let res = await asyncRequest.status(model);
           this.loading = false;
           if (res && res.code === 0) {

+ 0 - 4
src/views/sellOut/sellAfterApply/index.vue

@@ -132,11 +132,9 @@
                       label="销售订单编号"
                       value="sellOrderNum"
                     ></el-option>
-
                     <el-option label="商品编号" value="goodsNum"></el-option>
                     <el-option label="商品名称" value="goodsName"></el-option>
                     <el-option label="申请人部门" value="company_name"></el-option>
-                    
                     <el-option label="申请人" value="applyer"></el-option>
                   </el-select>
                   <el-button
@@ -221,7 +219,6 @@
    <script>
 import mixinPage from "@/mixins/elPaginationHandle";
 import resToken from "@/mixins/resToken";
-
 import asyncRequest from "@/apis/service/sellOut/sellAfterApply";
 import { columns } from "./columns";
 import { mapGetters } from "vuex";
@@ -229,7 +226,6 @@ import { mapGetters } from "vuex";
 export default {
   name: "sellAfterApply",
   mixins: [mixinPage, resToken],
-
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {

+ 263 - 274
src/views/serviceParam/supplier/components/baseForm.vue

@@ -11,13 +11,12 @@
   >
     <el-row>
       <el-col :span="6">
-        <div class="supplierAdd-title" style="margin: 6px 0 0 10px">基础信息</div></el-col
-      >
+        <div class="supplierAdd-title" style="margin: 6px 0 0 10px">基础信息</div></el-col>
       <el-col :span="6">
         <el-form-item label="合作状态" prop="coop_state">
           <el-select
-            style="width: 100%"
             v-model="ruleForm.coop_state"
+            style="width: 100%"
             :disabled="type !== 'add' && type !== 'edit'"
             placeholder="合作状态"
           >
@@ -26,8 +25,7 @@
               :key="item.value"
               :label="item.label"
               :value="item.value"
-            >
-            </el-option>
+            />
           </el-select>
         </el-form-item>
       </el-col>
@@ -35,8 +33,8 @@
       <el-col :span="6">
         <el-form-item label="供应商来源" prop="source">
           <el-select
-            style="width: 100%"
             v-model="ruleForm.source"
+            style="width: 100%"
             :disabled="type !== 'add' && type !== 'edit'"
             placeholder="供应商来源"
           >
@@ -45,16 +43,15 @@
               :key="item.value"
               :label="item.label"
               :value="item.value"
-            >
-            </el-option>
+            />
           </el-select>
         </el-form-item>
       </el-col>
       <el-col :span="6">
         <el-form-item label="申请类型" prop="type">
           <el-select
-            style="width: 100%"
             v-model="ruleForm.type"
+            style="width: 100%"
             :disabled="type !== 'add' && type !== 'edit'"
             placeholder="申请类型"
           >
@@ -63,16 +60,15 @@
               :key="item.value"
               :label="item.label"
               :value="item.value"
-            >
-            </el-option>
+            />
           </el-select>
         </el-form-item>
       </el-col>
       <el-col :span="6">
         <el-form-item label="所属类别" prop="category">
           <el-select
-            style="width: 100%"
             v-model="ruleForm.category"
+            style="width: 100%"
             :disabled="type !== 'add' && type !== 'edit'"
             placeholder="所属类别"
           >
@@ -81,16 +77,15 @@
               :key="item.value"
               :label="item.label"
               :value="item.value"
-            >
-            </el-option>
+            />
           </el-select>
         </el-form-item>
       </el-col>
       <el-col :span="6">
         <el-form-item label="物流方式" prop="delivery_way">
           <el-select
-            style="width: 100%"
             v-model="ruleForm.delivery_way"
+            style="width: 100%"
             :disabled="type !== 'add' && type !== 'edit'"
             placeholder="物流方式"
           >
@@ -99,32 +94,29 @@
               :key="item.value"
               :label="item.label"
               :value="item.value"
-            >
-            </el-option>
-          </el-select> </el-form-item
-      ></el-col>
-      <el-col :span="6"
-        ><el-form-item label="供应商类型" prop="supplier_type">
-          <el-select
-            style="width: 100%"
-            v-model="ruleForm.supplier_type"
-            :disabled="type !== 'add' && type !== 'edit'"
-            placeholder="供应商类型"
-          >
-            <el-option
-              v-for="item in supplier_typeoptions"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            >
-            </el-option>
-          </el-select> </el-form-item
-      ></el-col>
+            />
+          </el-select> </el-form-item></el-col>
+      <el-col
+        :span="6"
+      ><el-form-item label="供应商类型" prop="supplier_type">
+        <el-select
+          v-model="ruleForm.supplier_type"
+          style="width: 100%"
+          :disabled="type !== 'add' && type !== 'edit'"
+          placeholder="供应商类型"
+        >
+          <el-option
+            v-for="item in supplier_typeoptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select> </el-form-item></el-col>
       <el-col :span="6">
         <el-form-item label="供应商级别" prop="level">
           <el-select
-            style="width: 100%"
             v-model="ruleForm.level"
+            style="width: 100%"
             :disabled="type !== 'add' && type !== 'edit'"
             placeholder="供应商级别"
           >
@@ -133,16 +125,15 @@
               :key="item.value"
               :label="item.label"
               :value="item.value"
-            >
-            </el-option>
+            />
           </el-select>
         </el-form-item>
       </el-col>
       <el-col :span="6">
         <el-form-item label="付款方式" prop="pay_type">
           <el-select
-            style="width: 100%"
             v-model="ruleForm.pay_type"
+            style="width: 100%"
             :disabled="type !== 'add' && type !== 'edit'"
             placeholder="付款方式"
           >
@@ -151,8 +142,7 @@
               :key="item.value"
               :label="item.label"
               :value="item.value"
-            >
-            </el-option>
+            />
           </el-select>
         </el-form-item>
         <el-form-item label="负责人" prop="personid">
@@ -176,23 +166,22 @@
         >
           <div v-if="ruleForm.supplier_img" class="img-find">
             <img
+              v-viewer
               :src="ruleForm.supplier_img"
               class="avatar hover fl"
-              v-viewer
               style="width: 50px; height: 50px"
-            />
+            >
             <el-link
-              class="fl"
               v-if="type !== 'view'"
+              class="fl"
               :underline="false"
-              @click="deleteimg()"
               type="warning"
               style="margin: 0 0 0 16px"
-              >删除</el-link
-            >
+              @click="deleteimg()"
+            >删除</el-link>
           </div>
-          <div class="btnupload" style="position: relative" v-else>
-            <i class="el-icon-plus avatar-uploader-icon"></i>
+          <div v-else class="btnupload" style="position: relative">
+            <i class="el-icon-plus avatar-uploader-icon" />
             <file-upload
               v-if="type !== 'view'"
               class="Upload"
@@ -202,7 +191,7 @@
               :uploadcondition="beforeAvatarUpload"
               @UploadErrorEvent="UploadErrorEventsupplier_img"
               @UploadSuccessEvent="UploadSuccessEventsupplier_img"
-            ></file-upload>
+            />
           </div>
         </el-form-item>
       </el-col>
@@ -214,33 +203,33 @@
                 v-if="ruleForm && ruleForm.prove_img && ruleForm.prove_img.length > 0"
               >
                 <li
-                  class="img-show-li"
-                  v-viewer
                   v-for="(img, iindex) in ruleForm.prove_img"
                   :key="img + iindex"
+                  v-viewer
+                  class="img-show-li"
                 >
                   <div class="img-show-li-div">
-                    <img :src="img" class="img-show" alt="" />
+                    <img :src="img" class="img-show" alt="">
                     <i
                       v-if="type === 'add' || type === 'edit'"
                       class="el-icon-close"
                       @click="closeImg(iindex)"
-                    ></i>
+                    />
                   </div>
                 </li>
               </template>
               <li
-                class="img-show-li"
                 v-if="
                   ruleForm &&
-                  ruleForm.prove_img &&
-                  ruleForm.prove_img.length < 10 &&
-                  type !== 'view'
+                    ruleForm.prove_img &&
+                    ruleForm.prove_img.length < 10 &&
+                    type !== 'view'
                 "
+                class="img-show-li"
               >
                 <div class="activity-upload">
                   <div class="btnupload" style="position: relative">
-                    <i class="el-icon-plus avatar-uploader-icon"></i>
+                    <i class="el-icon-plus avatar-uploader-icon" />
                     <file-upload
                       class="Upload"
                       :disabled="type !== 'add' && type !== 'edit'"
@@ -249,7 +238,7 @@
                       :uploadcondition="beforeAvatarUpload"
                       @UploadErrorEvent="UploadErrorEventgood_info_img"
                       @UploadSuccessEvent="UploadSuccessEventgood_info_img"
-                    ></file-upload>
+                    />
                   </div>
                 </div>
               </li>
@@ -322,11 +311,11 @@
         </el-form-item>
       </el-col>
       <el-col
-        :span="8"
         v-if="
           (ruleForm.supplier_img === '' && (type === 'add' || type == 'edit')) ||
-          type == 'view'
+            type == 'view'
         "
+        :span="8"
       >
         <el-form-item label="统一社会信用代码" prop="registercode" label-width="140px">
           <el-input
@@ -338,29 +327,29 @@
         </el-form-item>
       </el-col>
       <el-col
-        :span="8"
         v-if="
           (ruleForm.supplier_img === '' && (type === 'add' || type == 'edit')) ||
-          type == 'view'
+            type == 'view'
         "
+        :span="8"
       >
         <el-form-item label="公司类型" prop="nature">
           <search-company-type
             :value="ruleForm.nature"
             :disabled="type == 'view'"
             :size="'small'"
-            :isDetail="false"
+            :is-detail="false"
             :placeholder="'公司类型'"
             @searchChange="type_search_change"
           />
         </el-form-item>
       </el-col>
       <el-col
-        :span="8"
         v-if="
           (ruleForm.supplier_img === '' && (type === 'add' || type == 'edit')) ||
-          type == 'view'
+            type == 'view'
         "
+        :span="8"
       >
         <el-form-item label="法人代表" prop="legaler">
           <el-input
@@ -372,11 +361,11 @@
         </el-form-item>
       </el-col>
       <el-col
-        :span="8"
         v-if="
           (ruleForm.supplier_img === '' && (type === 'add' || type == 'edit')) ||
-          type == 'view'
+            type == 'view'
         "
+        :span="8"
       >
         <el-form-item label="成立日期" prop="registertime">
           <el-input
@@ -388,11 +377,11 @@
         </el-form-item>
       </el-col>
       <el-col
-        :span="24"
         v-if="
           (ruleForm.supplier_img === '' && (type === 'add' || type == 'edit')) ||
-          type == 'view'
+            type == 'view'
         "
+        :span="24"
       >
         <el-form-item label="详细地址" prop="addr">
           <el-input
@@ -405,11 +394,11 @@
       </el-col>
 
       <el-col
-        :span="24"
         v-if="
           (ruleForm.supplier_img === '' && (type === 'add' || type == 'edit')) ||
-          type == 'view'
+            type == 'view'
         "
+        :span="24"
       >
         <el-form-item label="运营范围" prop="scope">
           <el-input
@@ -425,9 +414,9 @@
       </el-col>
 
       <el-col
+        v-if="type === 'add' || type === 'edit'"
         :span="24"
         style="text-align: right"
-        v-if="type === 'add' || type === 'edit'"
       >
         <el-button type="primary" :size="'small'" @click="submitForm">保 存 </el-button>
       </el-col>
@@ -435,8 +424,8 @@
   </el-form>
 </template>
 <script>
-import asyncRequest from "@/apis/service/serviceParam/supplier";
-import resToken from "@/mixins/resToken";
+import asyncRequest from '@/apis/service/serviceParam/supplier'
+import resToken from '@/mixins/resToken'
 import {
   isLicense,
   isMobile,
@@ -444,194 +433,194 @@ import {
   isSpecialSymbol,
   hasSpace,
   isAddr,
-  validEmail,
-} from "@/utils/validate";
+  validEmail
+} from '@/utils/validate'
 export default {
-  name: "supplierAdd",
+  name: 'SupplierAdd',
   mixins: [resToken],
-  props: ["showModel", "id", "type", "sitem"],
+  props: ['showModel', 'id', 'type', 'sitem'],
   data() {
     const validateLicense = (rule, value, callback) => {
-      if (value !== "") {
+      if (value !== '') {
         if (!isLicense(value)) {
-          callback(new Error("统一社会信用代码不正确!"));
+          callback(new Error('统一社会信用代码不正确!'))
         } else {
-          callback();
+          callback()
         }
       } else {
-        callback(new Error("请输入统一社会信用代码!"));
+        callback(new Error('请输入统一社会信用代码!'))
       }
-    };
+    }
     const validatemobile = (rule, value, callback) => {
-      if (value === "") {
-        callback(new Error("手机号不能为空!"));
+      if (value === '') {
+        callback(new Error('手机号不能为空!'))
       } else {
         if (!isMobile(value)) {
-          callback(new Error("手机号格式不正确!"));
+          callback(new Error('手机号格式不正确!'))
         } else {
-          callback();
+          callback()
         }
       }
-    };
+    }
     const validatetelephone = (rule, value, callback) => {
-      if (value === "") {
-        callback();
+      if (value === '') {
+        callback()
       } else {
         if (isqz(value)) {
-          callback();
+          callback()
         } else {
-          callback(new Error("规则为区号[0+2~3位]-固定电话[7~8位]!"));
+          callback(new Error('规则为区号[0+2~3位]-固定电话[7~8位]!'))
         }
       }
-    };
+    }
     const validateAddr = (rule, value, callback) => {
-      if (value === "") {
-        callback(new Error("详细地址不能为空!"));
+      if (value === '') {
+        callback(new Error('详细地址不能为空!'))
       } else {
         if (hasSpace(value)) {
-          callback(new Error("不能出现/回车/换行符!"));
+          callback(new Error('不能出现/回车/换行符!'))
         } else if (isSpecialSymbol(value)) {
-          callback(new Error("不能使用英文特殊字符!"));
+          callback(new Error('不能使用英文特殊字符!'))
         } else if (isAddr(value)) {
-          callback();
+          callback()
         } else {
-          callback(new Error("详细地址填写不规范!"));
+          callback(new Error('详细地址填写不规范!'))
         }
       }
-    };
+    }
     const validateEmail = (rule, value, callback) => {
-      if (value === "") {
-        callback(new Error("邮箱不能为空!"));
+      if (value === '') {
+        callback(new Error('邮箱不能为空!'))
       } else {
         if (!validEmail(value)) {
-          callback(new Error("邮箱格式不正确!"));
+          callback(new Error('邮箱格式不正确!'))
         } else {
-          callback();
+          callback()
         }
       }
-    };
+    }
     return {
       loading: false,
-      hand_name: "",
+      hand_name: '',
       coop_stateoptions: [
-        { value: "0", label: "白名单" },
-        { value: "1", label: "黑名单" },
+        { value: '0', label: '白名单' },
+        { value: '1', label: '黑名单' }
       ],
       sourceoptions: [
-        { value: "0", label: "客户提供" },
-        { value: "1", label: "供应商" },
-        { value: "2", label: "公司开发" },
+        { value: '0', label: '客户提供' },
+        { value: '1', label: '供应商' },
+        { value: '2', label: '公司开发' }
       ],
       typeoptions: [
-        { value: "0", label: "正式供应商" },
-        { value: "1", label: "临时供应商" },
+        { value: '0', label: '正式供应商' },
+        { value: '1', label: '临时供应商' }
       ],
       categoryoptions: [
-        { value: "0", label: "单品类供应商" },
-        { value: "1", label: "多品类供应商" },
+        { value: '0', label: '单品类供应商' },
+        { value: '1', label: '多品类供应商' }
       ],
       delivery_wayoptions: [
-        { value: "0", label: "供应商发货" },
-        { value: "1", label: "公司自提" },
+        { value: '0', label: '供应商发货' },
+        { value: '1', label: '公司自提' }
       ],
       supplier_typeoptions: [
-        { value: "0", label: "生产厂家" },
-        { value: "1", label: "代理商" },
-        { value: "2", label: "经销商" },
-        { value: "3", label: "分销商" },
-        { value: "4", label: "电商平台" },
+        { value: '0', label: '生产厂家' },
+        { value: '1', label: '代理商' },
+        { value: '2', label: '经销商' },
+        { value: '3', label: '分销商' },
+        { value: '4', label: '电商平台' }
       ],
       leveloptions: [
-        { value: "2", label: "生产厂家" },
-        { value: "0", label: "一级代理商" },
-        { value: "1", label: "二级代理商" },
+        { value: '2', label: '生产厂家' },
+        { value: '0', label: '一级代理商' },
+        { value: '1', label: '二级代理商' }
       ],
       pay_typeoptions: [
-        { value: "0", label: "现结" },
-        { value: "1", label: "月清" },
-        { value: "2", label: "双月清" },
+        { value: '0', label: '现结' },
+        { value: '1', label: '月清' },
+        { value: '2', label: '双月清' }
       ],
       ocr_status: [
-        { id: "0", label: "未上传" },
-        { id: "1", label: "识别成功" },
-        { id: "2", label: "识别失败" },
+        { id: '0', label: '未上传' },
+        { id: '1', label: '识别成功' },
+        { id: '2', label: '识别失败' }
       ],
-      title: "添加供应商",
+      title: '添加供应商',
       showModelThis: this.showModel,
       pickerOptions: {
         disabledDate(time) {
-          return time.getTime() > Date.now();
-        },
+          return time.getTime() > Date.now()
+        }
       },
       ruleForm: {},
       rulesThis: this.rules,
       rules: {
-        coop_state: [{ required: true, message: "请选择合作状态", trigger: "change" }],
-        source: [{ required: true, message: "请选择供应商来源", trigger: "change" }],
+        coop_state: [{ required: true, message: '请选择合作状态', trigger: 'change' }],
+        source: [{ required: true, message: '请选择供应商来源', trigger: 'change' }],
 
-        type: [{ required: true, message: "请选择申请类型", trigger: "change" }],
-        category: [{ required: true, message: "请选择所属类别", trigger: "change" }],
-        delivery_way: [{ required: true, message: "请选择物流方式", trigger: "change" }],
+        type: [{ required: true, message: '请选择申请类型', trigger: 'change' }],
+        category: [{ required: true, message: '请选择所属类别', trigger: 'change' }],
+        delivery_way: [{ required: true, message: '请选择物流方式', trigger: 'change' }],
 
         supplier_type: [
-          { required: true, message: "请选择供应商类型", trigger: "change" },
+          { required: true, message: '请选择供应商类型', trigger: 'change' }
         ],
-        level: [{ required: true, message: "请选择供应商级别", trigger: "change" }],
-        pay_type: [{ required: true, message: "请选择付款方式", trigger: "change" }],
+        level: [{ required: true, message: '请选择供应商级别', trigger: 'change' }],
+        pay_type: [{ required: true, message: '请选择付款方式', trigger: 'change' }],
         prove_img: [
           {
             required: false,
-            type: "array",
-            message: "请上传资质证明",
-            trigger: "change",
-          },
+            type: 'array',
+            message: '请上传资质证明',
+            trigger: 'change'
+          }
         ],
         personid: [
           {
             required: true,
-            type: "array",
-            message: "请选择负责人",
-            trigger: "change",
-          },
+            type: 'array',
+            message: '请选择负责人',
+            trigger: 'change'
+          }
         ],
-        contactor: [{ required: true, message: "姓名不能为空", trigger: "blur" }],
-        mobile: [{ required: true, validator: validatemobile, trigger: "blur" }],
-        email: [{ required: true, validator: validateEmail, trigger: "blur" }],
-        telephone: [{ required: false, validator: validatetelephone, trigger: "blur" }],
-        position: [{ required: true, message: "职位不能为空", trigger: "blur" }],
-        registercode: [{ required: true, validator: validateLicense, trigger: "blur" }],
-        name: [{ required: true, message: "供应商名称不能为空", trigger: "blur" }],
-        nature: [{ required: true, message: "公司类型不能为空", trigger: "change" }],
-        addr: [{ required: true, validator: validateAddr, trigger: "blur" }],
-        legaler: [{ required: true, message: "法人代表不能为空", trigger: "blur" }],
+        contactor: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
+        mobile: [{ required: true, validator: validatemobile, trigger: 'blur' }],
+        email: [{ required: true, validator: validateEmail, trigger: 'blur' }],
+        telephone: [{ required: false, validator: validatetelephone, trigger: 'blur' }],
+        position: [{ required: true, message: '职位不能为空', trigger: 'blur' }],
+        registercode: [{ required: true, validator: validateLicense, trigger: 'blur' }],
+        name: [{ required: true, message: '供应商名称不能为空', trigger: 'blur' }],
+        nature: [{ required: true, message: '公司类型不能为空', trigger: 'change' }],
+        addr: [{ required: true, validator: validateAddr, trigger: 'blur' }],
+        legaler: [{ required: true, message: '法人代表不能为空', trigger: 'blur' }],
         registertime: [
-          { required: true, message: "成立时间不能为空", trigger: "change" },
+          { required: true, message: '成立时间不能为空', trigger: 'change' }
         ],
-        scope: [{ required: true, message: "营业执照不能为空", trigger: "blur" }],
-      },
-    };
+        scope: [{ required: true, message: '营业执照不能为空', trigger: 'blur' }]
+      }
+    }
   },
   mounted() {
-    this.initForm();
+    this.initForm()
   },
   methods: {
     async initForm() {
-      this.hand_name = "";
-      this.loading = true;
-      this.resetFormData();
-      this.rulesThis = this.rules;
-      await this.resetForm();
-      this.loading = false;
+      this.hand_name = ''
+      this.loading = true
+      this.resetFormData()
+      this.rulesThis = this.rules
+      await this.resetForm()
+      this.loading = false
     },
     async resetForm() {
       // 重置
       await this.$nextTick(() => {
         if (this.$refs.ruleForm) {
-          this.$refs.ruleForm.resetFields();
-          this.$refs.ruleForm.clearValidate();
-          this.resetFormData();
+          this.$refs.ruleForm.resetFields()
+          this.$refs.ruleForm.clearValidate()
+          this.resetFormData()
         }
-      });
+      })
     },
     resetFormData() {
       const {
@@ -659,168 +648,168 @@ export default {
         personid,
         person,
         telephone,
-        email,
-      } = this.sitem;
-      this.hand_name = person || "";
+        email
+      } = this.sitem
+      this.hand_name = person || ''
       this.ruleForm = {
-        id: id || "",
-        coop_state: coop_state || "",
-        source: source || "",
-        type: type || "",
-        category: category || "",
-        delivery_way: delivery_way || "",
-        supplier_type: supplier_type || "",
-        level: level || "",
-        pay_type: pay_type || "",
-        supplier_img: supplier_img || "",
-        prove_img: prove_img ? (prove_img || "").split(",") : [],
-        contactor: contactor || "",
-        mobile: mobile || "",
-        telephone: telephone || "",
-        position: position || "",
-        registercode: registercode || "",
-        name: name || "",
-        email: email || "",
-        nature: nature || "",
-        addr: addr || "",
-        legaler: legaler || "",
-        registertime: registertime || "",
-        scope: scope || "",
-        personid: personid ? [personid] : [],
-      };
+        id: id || '',
+        coop_state: coop_state || '',
+        source: source || '',
+        type: type || '',
+        category: category || '',
+        delivery_way: delivery_way || '',
+        supplier_type: supplier_type || '',
+        level: level || '',
+        pay_type: pay_type || '',
+        supplier_img: supplier_img || '',
+        prove_img: prove_img ? (prove_img || '').split(',') : [],
+        contactor: contactor || '',
+        mobile: mobile || '',
+        telephone: telephone || '',
+        position: position || '',
+        registercode: registercode || '',
+        name: name || '',
+        email: email || '',
+        nature: nature || '',
+        addr: addr || '',
+        legaler: legaler || '',
+        registertime: registertime || '',
+        scope: scope || '',
+        personid: personid ? [personid] : []
+      }
     },
     closeImg(index) {
-      this.ruleForm.prove_img.splice(index, 1);
-      this.$refs.ruleForm.validateField("prove_img");
+      this.ruleForm.prove_img.splice(index, 1)
+      this.$refs.ruleForm.validateField('prove_img')
     },
     async submitForm() {
-      await this.$refs.ruleForm.validate(async (valid) => {
+      await this.$refs.ruleForm.validate(async(valid) => {
         if (valid) {
           if (this.loading) {
-            return;
+            return
           }
-          this.loading = true;
-          let model = JSON.parse(JSON.stringify(this.ruleForm));
-          model.prove_img = model.prove_img.toString();
-          model.personid = model.personid.toString();
-          let res = {};
-          if (this.id === "add") {
-            delete model["id"];
-            res = await asyncRequest.add(model);
+          this.loading = true
+          const model = JSON.parse(JSON.stringify(this.ruleForm))
+          model.prove_img = model.prove_img.toString()
+          model.personid = model.personid.toString()
+          let res = {}
+          if (this.id === 'add') {
+            delete model['id']
+            res = await asyncRequest.add(model)
           } else {
-            res = await asyncRequest.update(model);
+            res = await asyncRequest.update(model)
           }
-          this.loading = false;
+          this.loading = false
           if (res && res.code === 0) {
-            const title = this.id === "add" ? "添加成功!" : "修改成功!";
+            const title = this.id === 'add' ? '添加成功!' : '修改成功!'
             this.$notify.success({
               title,
-              message: "",
-            });
-            this.showModelThis = false;
+              message: ''
+            })
+            this.showModelThis = false
             // 刷新
-            this.$emit("refresh", res.data);
+            this.$emit('refresh', res.data)
           } else if (res && res.code >= 100 && res.code <= 104) {
-            await this.logout();
+            await this.logout()
           } else {
-            this.$message.warning(res.message);
+            this.$message.warning(res.message)
           }
         } else {
-          console.log("error submit!!");
-          return false;
+          console.log('error submit!!')
+          return false
         }
-      });
+      })
     },
     deleteimg() {
-      this.ruleForm.supplier_img = "";
-      this.$refs.ruleForm.validateField("supplier_img");
+      this.ruleForm.supplier_img = ''
+      this.$refs.ruleForm.validateField('supplier_img')
     },
     handleHandoverName(e) {
       if (e && e.id) {
-        this.ruleForm.personid = [e.id];
+        this.ruleForm.personid = [e.id]
       } else {
-        this.ruleForm.personid = [];
+        this.ruleForm.personid = []
       }
-      this.$refs.ruleForm.validateField("personid");
+      this.$refs.ruleForm.validateField('personid')
     },
     type_search_change(e) {
-      const { id } = e;
-      this.ruleForm.nature = id ? id : "";
-      this.$refs.ruleForm.validateField("nature");
+      const { id } = e
+      this.ruleForm.nature = id || ''
+      this.$refs.ruleForm.validateField('nature')
     },
 
-    //图片上传成功
+    // 图片上传成功
     async UploadSuccessEventsupplier_img(data) {
-      await this.UploadSuccessEvent(1, data);
+      await this.UploadSuccessEvent(1, data)
     },
     // //图片上传成功
     // async UploadSuccessEventgood_img(data) {
     //   await this.UploadSuccessEvent(2, data);
     // },
-    //图片上传成功
+    // 图片上传成功
     async UploadSuccessEventgood_info_img(data) {
-      await this.UploadSuccessEvent(3, data);
+      await this.UploadSuccessEvent(3, data)
     },
-    //图片上传成功
+    // 图片上传成功
     async UploadSuccessEvent(type, data) {
-      const { url } = data;
-      if (url === "noToken") {
-        await this.logout();
+      const { url } = data
+      if (url === 'noToken') {
+        await this.logout()
       } else {
         if (type === 1) {
-          this.ruleForm.supplier_img = url;
-          this.$refs.ruleForm.validateField("supplier_img");
+          this.ruleForm.supplier_img = url
+          this.$refs.ruleForm.validateField('supplier_img')
         } else if (type === 2) {
-          this.ruleForm.good_img = url;
-          this.$refs.ruleForm.validateField("good_img");
+          this.ruleForm.good_img = url
+          this.$refs.ruleForm.validateField('good_img')
         } else {
-          this.ruleForm.prove_img.push(url);
-          this.$refs.ruleForm.validateField("prove_img");
+          this.ruleForm.prove_img.push(url)
+          this.$refs.ruleForm.validateField('prove_img')
         }
-        this.$message.success("图片上传成功!");
+        this.$message.success('图片上传成功!')
       }
     },
-    //图片上传失败
+    // 图片上传失败
     UploadErrorEventsupplier_img(res) {
-      this.imgUploadError(1, res);
+      this.imgUploadError(1, res)
     },
     // //图片上传失败
     // UploadErrorEventgood_img(res) {
     //   this.imgUploadError(2, res);
     // },
-    //图片上传失败
+    // 图片上传失败
     UploadErrorEventgood_info_img(res) {
-      this.imgUploadError(3, res);
+      this.imgUploadError(3, res)
     },
     imgUploadError(type, res) {
-      if (res !== "break") {
-        this.$message.error("图片上传失败!");
+      if (res !== 'break') {
+        this.$message.error('图片上传失败!')
         this.$refs.ruleForm.validateField(
-          type === 1 ? "supplier_img" : type === 2 ? "good_img" : "good_info_img"
-        );
+          type === 1 ? 'supplier_img' : type === 2 ? 'good_img' : 'good_info_img'
+        )
       }
     },
-    //判断图片规格
+    // 判断图片规格
     beforeAvatarUpload(file) {
-      let isJPG = false;
+      let isJPG = false
       if (
-        file.type === "image/jpg" ||
-        file.type === "image/png" ||
-        file.type === "image/jpeg"
+        file.type === 'image/jpg' ||
+        file.type === 'image/png' ||
+        file.type === 'image/jpeg'
       ) {
-        isJPG = true;
+        isJPG = true
       }
-      const isLt2M = file.size / 1024 / 1024 < 1;
+      const isLt2M = file.size / 1024 / 1024 < 1
       if (!isJPG) {
-        this.$message.error("图片格式不正确!");
+        this.$message.error('图片格式不正确!')
       }
       if (!isLt2M) {
-        this.$message.error("图片大小不能超过 1MB!");
+        this.$message.error('图片大小不能超过 1MB!')
       }
-      return isJPG && isLt2M;
-    },
-  },
-};
+      return isJPG && isLt2M
+    }
+  }
+}
 </script>
 
 <style lang="scss" scoped>

Some files were not shown because too many files changed in this diff