From cece17f846dca06261e4b56fb2b9789dec380670 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期五, 26 一月 2024 15:20:16 +0800
Subject: [PATCH] Mr.Shi

---
 platform/src/views/business/company.vue |  287 ++++++++++++++++++++++++++++-----------------------------
 1 files changed, 140 insertions(+), 147 deletions(-)

diff --git a/platform/src/views/business/company.vue b/platform/src/views/business/company.vue
index 8db04cd..51341f7 100644
--- a/platform/src/views/business/company.vue
+++ b/platform/src/views/business/company.vue
@@ -1,153 +1,146 @@
 <template>
-  <TableLayout :permissions="['business:company:query']">
-    <!-- 鎼滅储琛ㄥ崟 -->
-    <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline>
-      <el-form-item label="浼佷笟鍚嶇О" prop="name">
-        <el-input v-model="searchForm.name" placeholder="璇疯緭鍏ヤ紒涓氬悕绉�" @keypress.enter.native="search"></el-input>
-      </el-form-item>
-      <!-- <el-form-item label="浼佷笟绠�绉�" prop="shortName">
-        <el-input v-model="searchForm.shortName" placeholder="璇疯緭鍏ヤ紒涓氱畝绉�" @keypress.enter.native="search"></el-input>
-      </el-form-item> -->
-      <el-form-item label="鐧诲綍璐﹀彿" prop="managerUserName">
-        <el-input v-model="searchForm.managerUserName" placeholder="璇疯緭鍏ョ櫥褰曡处鍙�" @keypress.enter.native="search"></el-input>
-      </el-form-item>
-      <el-form-item label="鏈夋晥鏈�" prop="oepnValidDate">
-        <el-date-picker type="daterange" v-model="oepnValidDate" value-format="yyyy-MM-dd" start-placeholder="寮�濮嬫棩鏈�"
-          end-placeholder="缁撴潫鏃ユ湡" @change="selectOepnValidDate" />
-      </el-form-item>
-      <el-form-item label="鐘舵��" prop="status">
-        <el-select v-model="searchForm.status" clearable placeholder="璇烽�夋嫨" @change="search">
-          <el-option label="鍚敤" :value="0"></el-option>
-          <el-option label="绂佺敤" :value="1"></el-option>
-        </el-select>
-      </el-form-item>
-      <section>
-        <el-button type="primary" @click="search">鎼滅储</el-button>
-        <el-button @click="reset">閲嶇疆</el-button>
-      </section>
-    </el-form>
-    <!-- 琛ㄦ牸鍜屽垎椤� -->
-    <template v-slot:table-wrap>
-      <ul class="toolbar" v-permissions="['business:company:create']">
-        <li><el-button type="primary" @click="$refs.operaCompanyWindow.open('鏂板缓绯荤粺-浼佷笟淇℃伅琛�')"
-            v-permissions="['business:company:create']">鏂板缓</el-button></li>
-      </ul>
-      <el-table v-loading="isWorking.search" :data="tableData.list" border stripe
-        @selection-change="handleSelectionChange">
-        <!-- <el-table-column type="selection" width="55" align="center"></el-table-column> -->
-        <el-table-column prop="id" label="浼佷笟缂栧彿" fixed="left" min-width="80px" align="center"></el-table-column>
-        <el-table-column prop="name" label="浼佷笟鍚嶇О" min-width="100px" align="center"></el-table-column>
-        <el-table-column prop="managerUserName" label="鐧诲綍璐﹀彿" min-width="100px" align="center"></el-table-column>
-        <el-table-column prop="linkname" label="鑱旂郴浜�" min-width="100px" align="center"></el-table-column>
-        <el-table-column prop="linkephone" label="鑱旂郴浜虹數璇�" min-width="100px" align="center"></el-table-column>
-        <el-table-column prop="oepnValidDate" label="鏈夋晥鏈�" min-width="140px" align="center"></el-table-column>
-        <el-table-column prop="userNum" label="涓绘挱璐﹀彿闄愬埗" min-width="100px" align="center">
-          <template slot-scope="{row}">
-            {{ row.userNum || '涓嶉檺' }}
-          </template>
-        </el-table-column>
-        <el-table-column prop="anchorUserNum" label="涓绘挱鏁�" min-width="100px" align="center"></el-table-column>
-        <el-table-column prop="empUserNum" label="鍛樺伐鏁�" min-width="100px" align="center"></el-table-column>
-        <el-table-column prop="goodsNum" label="鍟嗗搧鏁�" min-width="100px" align="center"></el-table-column>
-        <el-table-column prop="salesmanRealName" label="閿�鍞汉鍛�" min-width="100px" align="center"></el-table-column>
-        <el-table-column prop="status" label="鐘舵��" min-width="100px" align="center">
-          <template slot-scope="{row}">
-            <!-- 0鍚敤 1绂佺敤 -->
-            <el-switch :disabled="!containPermissions(['business:company:update'])" v-model="row.status"
-              :inactive-value="1" :active-value="0" @change="changeStatus(row)">
-            </el-switch>
-          </template>
-
-        </el-table-column>
-        <el-table-column prop="createTime" label="鍒涘缓鏃堕棿" min-width="140px" align="center"></el-table-column>
-        <el-table-column v-if="containPermissions(['business:company:update', 'business:company:delete'])" label="鎿嶄綔"
-          min-width="160" align="center" fixed="right">
-          <template slot-scope="{row}">
-            <el-button type="text" @click="$refs.operaCompanyWindow.open('缂栬緫浼佷笟', row)"
-              v-permissions="['business:company:update']">缂栬緫</el-button>
-            <el-button type="text" @click="$refs.operaCompanyValidDateWindow.open('璋冩暣鏈夋晥鏈�', row)"
-              v-permissions="['business:company:update']">璋冩暣鏈夋晥鏈�</el-button>
-            <el-button type="text" @click="deleteById(row)" style="color: red;" v-permissions="['business:company:delete']">鍒犻櫎</el-button>
-          </template>
-        </el-table-column>
-      </el-table>
-      <pagination @size-change="handleSizeChange" @current-change="handlePageChange" :pagination="tableData.pagination">
-      </pagination>
-    </template>
-    <!-- 鏂板缓/淇敼 -->
-    <OperaCompanyWindow ref="operaCompanyWindow" @success="handlePageChange" />
-    <OperaCompanyValidDateWindow ref="operaCompanyValidDateWindow" @success="handlePageChange" />
-  </TableLayout>
+    <TableLayout :permissions="['business:company:query']">
+        <!-- 鎼滅储琛ㄥ崟 -->
+        <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline>
+            <el-form-item label="浼佷笟鍚嶇О" prop="name">
+                <el-input v-model="searchForm.name" placeholder="璇疯緭鍏ヤ紒涓氬悕绉�" @keypress.enter.native="search"></el-input>
+            </el-form-item>
+            <el-form-item label="鎵�灞炲晢鎴�" prop="name">
+                <el-input v-model="searchForm.name" placeholder="璇疯緭鍏ユ墍灞炲晢鎴�" @keypress.enter.native="search"></el-input>
+            </el-form-item>
+            <el-form-item label="鎵�灞炵悊璧斿憳" prop="username">
+                <el-input v-model="searchForm.username" placeholder="璇疯緭鍏ユ墍灞炵悊璧斿憳" @keypress.enter.native="search"></el-input>
+            </el-form-item>
+            <section>
+                <el-button type="primary" @click="search">鎼滅储</el-button>
+                <el-button @click="reset">閲嶇疆</el-button>
+            </section>
+        </el-form>
+        <!-- 琛ㄦ牸鍜屽垎椤� -->
+        <template v-slot:table-wrap>
+            <ul class="toolbar" v-permissions="['business:company:create']">
+                <li><el-button type="primary" @click="$refs.operaCompanyWindow.open('鏂板缓浼佷笟')" v-permissions="['business:company:create']">鏂板缓浼佷笟</el-button></li>
+            </ul>
+            <el-table
+                v-loading="isWorking.search"
+                :data="tableData.list"
+                stripe
+            >
+                <el-table-column prop="name" label="浼佷笟鍚嶇О" min-width="100px"></el-table-column>
+                <el-table-column prop="code" label="缁熶竴淇$敤浠g爜" min-width="100px"></el-table-column>
+                <el-table-column prop="createDate" label="娣诲姞鏃堕棿" min-width="100px"></el-table-column>
+                <el-table-column prop="phone" label="缁戝畾鎵嬫満鍙�" min-width="100px"></el-table-column>
+                <el-table-column label="鍚敤鐘舵��" min-width="100px">
+                    <template slot-scope="{row}">
+                        <el-switch
+                            @change="changeStatus($event, row)"
+                            v-model="row.status"
+                            active-color="#13ce66"
+                            inactive-color="#ff4949"
+                            :active-value="0"
+                            :inactive-value="1">
+                        </el-switch>
+                    </template>
+                </el-table-column>
+                <el-table-column
+                    v-if="containPermissions(['business:company:update', 'business:company:delete'])"
+                    label="鎿嶄綔"
+                    min-width="120"
+                    fixed="right"
+                >
+                    <template slot-scope="{row}">
+                        <el-button type="text" @click="$refs.OperaCompanyDescWindow.open('浼佷笟璇︽儏', row)"  v-permissions="['business:company:update']">鏌ョ湅璇︽儏</el-button>
+                        <el-button type="text" @click="edit(row)" v-permissions="['business:company:update']">淇敼</el-button>
+                        <el-button type="text" @click="$refs.operaCompanyWindow.open('缂栬緫浼佷笟淇℃伅琛�', row)" v-permissions="['business:company:update']">鐢靛瓙绛捐璇�</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+            <pagination
+                @size-change="handleSizeChange"
+                @current-change="handlePageChange"
+                :pagination="tableData.pagination"
+            >
+            </pagination>
+        </template>
+        <!-- 鏂板缓/淇敼 -->
+        <OperaCompanyWindow ref="operaCompanyWindow" @success="handlePageChange" />
+        <!-- 璇︽儏 -->
+        <OperaCompanyDescWindow ref="OperaCompanyDescWindow" @success="handlePageChange" />
+    </TableLayout>
 </template>
 
 <script>
-import BaseTable from '@/components/base/BaseTable'
-import TableLayout from '@/layouts/TableLayout'
-import Pagination from '@/components/common/Pagination'
-import OperaCompanyWindow from '@/components/business/OperaCompanyWindow'
-import OperaCompanyValidDateWindow from '@/components/business/OperaCompanyValidDateWindow'
-import { updateById } from '@/api/business/company'
-export default {
-  name: 'Company',
-  extends: BaseTable,
-  components: { TableLayout, Pagination, OperaCompanyWindow, OperaCompanyValidDateWindow },
-  data() {
-    return {
-      oepnValidDate: [],
-      // 鎼滅储
-      searchForm: {
-        oepnValidDateStart: '',
-        oepnValidDateEnd: '',
-        managerUserName: '',
-        updateTime: '',
-        name: '',
-        shortName: '',
-        remark: '',
-        managerId: '',
-        linkname: '',
-        linkephone: '',
-        creditCode: '',
-        userNum: '',
-        oepnValidDate: '',
-        oepnType: '',
-        salesmanId: '',
-        status: ''
-      }
+    import BaseTable from '@/components/base/BaseTable'
+    import TableLayout from '@/layouts/TableLayout'
+    import Pagination from '@/components/common/Pagination'
+    import OperaCompanyWindow from '@/components/business/OperaCompanyWindow'
+    import OperaCompanyDescWindow from '@/components/business/OperaCompanyDescWindow'
+    import { updateStatus, getById } from '@/api/business/company'
+    export default {
+        name: 'Company',
+        extends: BaseTable,
+        components: { TableLayout, Pagination, OperaCompanyWindow, OperaCompanyDescWindow },
+        data () {
+            return {
+                // 鎼滅储
+                searchForm: {
+                    name: '',
+                    username: ''
+                }
+            }
+        },
+        created () {
+            this.config({
+                module: '浼佷笟淇℃伅琛�',
+                api: '/business/company',
+                'field.id': 'id',
+                'field.main': 'id'
+            })
+            this.search()
+        },
+        methods: {
+            edit(row) {
+                getById(row.id)
+                    .then(res => {
+                        let form = res;
+                        form.type = 1
+                        form.file = {
+                            imgurl: '',
+                            imgurlfull: ''
+                        }
+                        form.file1 = {
+                            imgurl: '',
+                            imgurlfull: ''
+                        }
+                        form.file2 = {
+                            imgurl: '',
+                            imgurlfull: ''
+                        }
+                        form.file3 = {
+                            imgurl: '',
+                            imgurlfull: ''
+                        }
+                        form.file.imgurl = res.businessImg.fileurl
+                        form.file.imgurlfull = res.businessImg.fileurlFull
+                        form.file1.imgurl = res.idcardImgList[0].fileurl
+                        form.file1.imgurlfull = res.idcardImgList[0].fileurlFull
+                        form.file2.imgurl = res.idcardImgList[1].fileurl
+                        form.file2.imgurlfull = res.idcardImgList[1].fileurlFull
+                        form.file3.imgurl = res.signImg.fileurl
+                        form.file3.imgurlfull = res.signImg.fileurlFull
+                        this.$refs.operaCompanyWindow.open('缂栬緫浼佷笟', form)
+                    })
+            },
+            // 淇敼鐘舵��
+            changeStatus(status, row) {
+                updateStatus({ id: row.id, status })
+                    .then(res => {
+                        this.search()
+                    })
+                    .catch(err => {
+                        row.status = row.status === 0 ? 1 : 0
+                    })
+            }
+        }
     }
-  },
-  created() {
-    this.config({
-      module: '绯荤粺-浼佷笟淇℃伅琛�',
-      api: '/business/company',
-      'field.id': 'id',
-      'field.main': 'id'
-    })
-    this.search()
-  },
-  methods: {
-    selectOepnValidDate(v) {
-      [this.searchForm.oepnValidDateStart, this.searchForm.oepnValidDateEnd] = v
-    },
-    reset() {
-      // this.reset()
-      this.$refs.searchForm.resetFields()
-      this.searchForm.oepnValidDateStart = ''
-      this.searchForm.oepnValidDateEnd = ''
-      this.oepnValidDate = []
-      this.search()
-    },
-    changeStatus(row) {
-      updateById(row)
-        .then(() => {
-          this.$tip.apiSuccess('鏇存柊鎴愬姛')
-        })
-        .catch(err => {
-          this.$tip.apiFailed(err)
-        })
-        .finally(() => {
-          this.handlePageChange()
-        })
-    }
-  },
-}
 </script>

--
Gitblit v1.9.3