From 7045ca2f6b6bcbc3987e388bf0b25281c250ccf5 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期五, 19 四月 2024 18:09:00 +0800
Subject: [PATCH] srm 新增编辑供应商,启用停用创建账号获取和保存企业/信用等级/供货范围 ,等大概7个接口的联调

---
 src/views/supplierManage/outsourceSupplier/index.vue |  129 +++++++++++++++++++++++++++++-------------
 1 files changed, 89 insertions(+), 40 deletions(-)

diff --git a/src/views/supplierManage/outsourceSupplier/index.vue b/src/views/supplierManage/outsourceSupplier/index.vue
index bb006b4..2e4abaf 100644
--- a/src/views/supplierManage/outsourceSupplier/index.vue
+++ b/src/views/supplierManage/outsourceSupplier/index.vue
@@ -1,23 +1,32 @@
 <template>
-  <d2-container>
-    <template slot="header">
-      <div class="top">
-        <SearchCommonView
+  <div class="outsource-supplier-manage">
+    <div class="filter">
+      <div class="filter-card">
+        <CommonSearch
           :add-title="'鏂板浼佷笟'"
           :total-object="totalObject"
           :other-options="otherOptions"
           :placeholder="'璇疯緭鍏ュ悕绉�'"
           @addCommonClick="addEnterpriseClick"
           @searchClick="getEnterpriseList"
+          @clearClick="getEnterpriseList"
         />
       </div>
-    </template>
+    </div>
     <div class="content">
-      <div class="content-top">
+      <div class="body-card">
+      <div class="list-view">
         <TableCommonView ref="tableListRef" :table-list="tableList" @selTableCol="selTableCol">
           <template slot="tableButton">
-            <el-table-column label="鎿嶄綔" width="160" fixed="right">
+            <el-table-column label="鎿嶄綔" width="150" fixed="right">
               <template slot-scope="scope">
+                <el-button
+                  v-if="scope.row.tel.length == 0"
+                  type="text"
+                  size="small"
+                  @click="createAccountClick(scope.row)"
+                  >鍒涘缓璐﹀彿</el-button
+                >
                 <el-button v-if="scope.row.status == 1" type="text" size="small" @click="statusModifyClick(scope.row)"
                   >鍋滅敤</el-button
                 >
@@ -32,10 +41,17 @@
         <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
       </div>
     </div>
+    </div>
     <!-- <div class="overSpread" v-show="isopen || isCreateShop"></div> -->
     <!-- 娣诲姞/缂栬緫澶囦欢 -->
     <AddEnterprise ref="add" :showList="showList" :titleName="titleName" :editRow="editRow" @shutdown="shutdown" />
-  </d2-container>
+    <!-- 鍒涘缓璐﹀彿 -->
+    <CreateAccount
+      ref="create"
+      :editRow="createRow"
+      @shutdown="shutCreateDown"
+    />
+  </div>
 </template>
 
 <script>
@@ -46,12 +62,14 @@
   editOutsideUser
 } from "@/api/supplierManage/outsourceSupplier"
 import AddEnterprise from "@/views/supplierManage/outsourceSupplier/components/addEnterprise"
+import CreateAccount from "@/views/supplierManage/outsourceSupplier/components/CreateAccount";
 import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
 export default {
   name: "outsourceManage",
   mixins: [pageMixin],
   components: {
-    AddEnterprise
+    AddEnterprise,
+    CreateAccount
   },
   beforeMount() {
     this.getData()
@@ -103,7 +121,8 @@
         "娣诲姞鏃堕棿",
         "鐘舵��"
       ],
-      showList: []
+      showList: [],
+      createRow: {},
     }
   },
   mounted() {
@@ -181,6 +200,7 @@
         {
           label: "缁勭粐鏈烘瀯浠g爜",
           prop: "organizationCode",
+          min:140,
           isShowColumn: showcol.includes("缁勭粐鏈烘瀯浠g爜"),
           default: false
         },
@@ -241,7 +261,7 @@
     },
     // 鎼滅储瑙﹀彂
     async getEnterpriseList(val) {
-      this.searchParam.keyword = val
+      this.searchParam.keyword = val?val:''
       this.pagerOptions.currPage = 1
       this.getData()
     },
@@ -255,7 +275,7 @@
     editClick(val) {
       let params = JSON.parse(JSON.stringify(val))
       this.titleName = "缂栬緫"
-      this.editRow = { ...params, password: "000000" }
+      this.editRow = { ...params, password: "000000",id:params.id?params.id:params.ID, }
       this.$refs.add.islook = true
     },
     // 鍚敤/鍋滅敤
@@ -271,15 +291,18 @@
         updateEnterprise(params)
           .then((reply) => {
             if (reply && reply.code == 200) {
-              this.editOutsideUser(row)
-              // this.getData();
-              // this.$message.success(row.status == 1 ? "鍋滅敤鎴愬姛" : "鍚敤鎴愬姛");
+              if(row.tel){
+                this.editOutsideUser(row)
+              }else{
+                this.getData()
+                this.$message.success(row.status == 1 ? "鍋滅敤鎴愬姛" : "鍚敤鎴愬姛")
+              }
+             
             } else {
               this.$message.error(row.status == 1 ? "鍋滅敤澶辫触" : "鍚敤澶辫触")
             }
           })
-          .catch(() => {})
-      })
+      }).catch(() => {})
     },
     // 鍚敤鍋滅敤澶栭儴鐢ㄦ埛
     editOutsideUser(row) {
@@ -301,42 +324,68 @@
     // 鑾峰彇鐘舵��
     getStatus(val) {
       return val == 0 ? "鏂板缓" : val == 1 ? "鍚敤" : val == 2 ? "鍋滅敤" : "--"
-    }
+    },
+    shutCreateDown() {
+      this.$refs.create.islook = false;
+      this.getData();
+    },
+    // 鍒涘缓璐﹀彿
+    createAccountClick(row) {
+      let params = JSON.parse(JSON.stringify(row))
+      this.createRow = { ...params,id:row.id?row.id:row.ID };
+      this.$refs.create.islook = true;
+    },
   }
 }
 </script>
 
 <style lang="scss" scoped>
-.top {
-  width: 100%;
-  height: 61px;
-  display: flex;
-  align-items: center;
-  .fon_weight {
-    font-size: 28px;
-    height: 32px;
-  }
-  .top_right_bottom {
-    font-size: 14px;
-    line-height: 20px;
-    color: #000;
-    opacity: 0.6;
-    margin-top: 9px;
-    font-family: "PingFangSC-Medium," sans-serif;
+.outsource-supplier-manage{
+  height: 100%;
+  overflow: hidden;
+  .filter {
+    height: 80px;
+    display: flex;
+    align-items: center;
+    padding: 12px 20px 0 20px;
+    &-card {
+      height: 80px;
+      display: flex;
+      align-items: center;
+      box-sizing: border-box;
+      padding: 10px 20px;
+      flex: 1;
+      border-radius: 12px;
+      background-color: #fff;
+    }
   }
 }
+
 .el-button {
   font-family: "PingFangSC";
 }
 .content {
-  width: 100%;
-  height: calc(100% - 30px);
-  background: #fff;
+  // width: 100%;
+  height: calc(100% - 92px);
   border-radius: 12px;
   box-sizing: border-box;
-  .content-top {
-    height: calc(100% - 60px);
-  }
+  padding: 10px 20px;
+  .body-card {
+      background-color: #fff;
+      border-radius: 12px;
+      height: 100%;
+      overflow: hidden;
+    }
+  .list-view {
+      height: calc(100% - 60px);
+      overflow: hidden;
+    }
+    .btn-pager {
+      display: flex;
+      .page {
+        margin-left: auto;
+      }
+    }
 }
 ::v-deep {
   .el-table {

--
Gitblit v1.8.0