From 5019ed6016b47221321bf395cd102dc4b51b4724 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期一, 05 二月 2024 09:40:43 +0800
Subject: [PATCH] Mr.Shi

---
 company/src/components/business/OperaCompanyDescWindow.vue |  255 ++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 192 insertions(+), 63 deletions(-)

diff --git a/company/src/components/business/OperaCompanyDescWindow.vue b/company/src/components/business/OperaCompanyDescWindow.vue
index 0ff79a8..c647036 100644
--- a/company/src/components/business/OperaCompanyDescWindow.vue
+++ b/company/src/components/business/OperaCompanyDescWindow.vue
@@ -1,7 +1,8 @@
 <template>
     <GlobalWindow
         :title="title"
-        width="60%"
+        width="100%"
+        :withFooter="false"
         :visible.sync="visible"
         :confirm-working="isWorking"
         @confirm="confirm"
@@ -9,59 +10,62 @@
         <div class="info">
             <div class="info_label">
                 <span>浼佷笟璇︽儏</span>
-                <el-button type="primary" @click="$refs.operaCompanyWindow.open('缂栬緫浼佷笟淇℃伅', row)">淇敼浼佷笟淇℃伅</el-button>
+                <div>
+                    <el-button type="primary" @click="$refs.modification.open('淇敼淇濋櫓鏂规', form)">鏇存敼淇濋櫓鏂规</el-button>
+                    <el-button type="primary" @click="$refs.operaCompanyWindow.open('缂栬緫浼佷笟淇℃伅', form)">淇敼浼佷笟淇℃伅</el-button>
+                </div>
             </div>
             <div class="info_list">
                 <div class="info_list_item">
                     <div class="info_list_item_label">浼佷笟鍚嶇О锛�</div>
-                    <div class="info_list_item_val">瀹夊窘鏍煎姏浜哄姏璧勬簮鏈夐檺鍏徃</div>
+                    <div class="info_list_item_val">{{form.name || '-'}}</div>
                 </div>
                 <div class="info_list_item">
                     <div class="info_list_item_label">缁熶竴淇$敤浠g爜锛�</div>
-                    <div class="info_list_item_val">913418210000000000</div>
+                    <div class="info_list_item_val">{{form.code || '-'}}</div>
                 </div>
                 <div class="info_list_item">
                     <div class="info_list_item_label">鍏徃璐﹀彿锛�</div>
-                    <div class="info_list_item_val">qq2131321</div>
+                    <div class="info_list_item_val">{{form.username || '-'}}</div>
                 </div>
                 <div class="info_list_item">
                     <div class="info_list_item_label">缁戝畾鎵嬫満鍙凤細</div>
                     <div class="info_list_item_val">
-                        13555556666
+                        {{form.phone || '-'}}
                         <el-button type="primary" size="mini" style="margin-left: 10px;" @click="visiblePhone = true">鏇存敼缁戝畾</el-button>
                     </div>
                 </div>
                 <div class="info_list_item">
                     <div class="info_list_item_label">璁よ瘉閭锛�</div>
-                    <div class="info_list_item_val">123456@11.com</div>
+                    <div class="info_list_item_val">{{form.email || '-'}}</div>
                 </div>
                 <div class="info_list_item">
                     <div class="info_list_item_label">绾崇◣浜鸿瘑鍒彿锛�</div>
-                    <div class="info_list_item_val">913418210000000000</div>
+                    <div class="info_list_item_val">{{form.taxCode || '-'}}</div>
                 </div>
                 <div class="info_list_item">
                     <div class="info_list_item_label">寮�鎴疯锛�</div>
-                    <div class="info_list_item_val">瀹夊窘鍐滄潙鍟嗕笟閾惰鑲′唤鏈夐檺鍏徃鍚堣偉鏀</div>
+                    <div class="info_list_item_val">{{form.taxBank || '-'}}</div>
                 </div>
                 <div class="info_list_item">
                     <div class="info_list_item_label">閾惰璐﹀彿锛�</div>
-                    <div class="info_list_item_val">20010355666666600000000</div>
+                    <div class="info_list_item_val">{{form.taxAccount || '-'}}</div>
                 </div>
                 <div class="info_list_item" style="width: 100%;">
                     <div class="info_list_item_label">鍦板潃銆佺數璇濓細</div>
-                    <div class="info_list_item_val">瀹夊窘鐪佸悎鑲ュ競缁忔祹鎶�鏈紑鍙戝尯鑾茶姳璺互涓溿�佺煶闂ㄨ矾浠ュ崡鑾茶姳璺�1锛�     0551-63450845</div>
+                    <div class="info_list_item_val">{{form.taxAddr || '-'}}</div>
                 </div>
                 <div class="info_list_item" style="width: 100%;">
                     <div class="info_list_item_label">鐢靛瓙鍙戠エ鎺ユ敹鍦板潃锛�</div>
-                    <div class="info_list_item_val">111122223333@qq.com</div>
+                    <div class="info_list_item_val">{{form.invoiceEmail || '-'}}</div>
                 </div>
                 <div class="info_list_item" style="width: 100%;">
                     <div class="info_list_item_label">鐢靛瓙鍙戠エ鎺ユ敹鍦板潃锛�</div>
-                    <div class="info_list_item_val">瀹夊窘鐪佸悎鑲ュ競缁忔祹鎶�鏈紑鍙戝尯鑾茶姳璺互涓溿�佺煶闂ㄨ矾浠ュ崡鑾茶姳璺�1锛�     鏉庣粡鐞�    13555556666</div>
+                    <div class="info_list_item_val">{{form.invoiceAddr || '-'}}</div>
                 </div>
             </div>
             <el-table
-                :data="tableData"
+                :data="form.solutionListName"
                 border
                 style="width: 100%; margin-bottom: 20px;">
                 <el-table-column
@@ -73,67 +77,76 @@
                     </template>
                 </el-table-column>
                 <el-table-column
+                    prop="solutionName"
                     align="center"
                     label="淇濋櫓鏂规">
-                    <template slot-scope="{row}">
-                        <el-select v-model="row.info" placeholder="璇烽�夋嫨">
-                            <el-option
-                                v-for="item in options"
-                                :key="item.value"
-                                :label="item.label"
-                                :value="item.value">
-                            </el-option>
-                        </el-select>
-                    </template>
                 </el-table-column>
                 <el-table-column
                     align="center"
                     label="鍔犲噺淇濆姛鑳�">
                     <template slot-scope="{row}">
-                        <el-checkbox-group v-model="row.type">
-                            <el-checkbox label="1">鍔犱繚</el-checkbox>
-                            <el-checkbox label="2">鍑忎繚</el-checkbox>
-                        </el-checkbox-group>
-                    </template>
-                </el-table-column>
-                <el-table-column
-                    label="鎿嶄綔"
-                    align="center"
-                    width="100">
-                    <template slot-scope="scope">
-                        <el-button type="text" size="small" style="color: red;">鍒犻櫎</el-button>
+                        <el-checkbox :true-label="1" :false-label="0" disabled v-model="row.canAdd">鍔犱繚</el-checkbox>
+                        <el-checkbox :true-label="1" :false-label="0" disabled v-model="row.canReduce">鍑忎繚</el-checkbox>
                     </template>
                 </el-table-column>
             </el-table>
-            <div class="info_list">
+            <div class="info_list" v-if="JSON.stringify(form) !== '{}'">
                 <div class="info_list_item">
                     <div class="info_list_item_label" style="width: 100px;">钀ヤ笟鎵х収锛�</div>
                     <div class="info_list_item_val">
-                        <div class="image">
-                            <img src="@/assets/images/404.png" alt="">
+                        <div class="image" v-if="form.businessImg.fileurlFull">
+                          <el-image
+                              v-if="form.businessImg.fileurlFull!=null"
+                              style="width: 90px; height: 90px"
+                              :src="form.businessImg.fileurlFull"
+                              :preview-src-list="[form.businessImg.fileurlFull]">
+                          </el-image>
                         </div>
                     </div>
                 </div>
                 <div class="info_list_item">
                     <div class="info_list_item_label" style="width: 100px;">娉曚汉韬唤璇侊細</div>
                     <div class="info_list_item_val">
-                        <div class="image">
-                            <img src="@/assets/images/404.png" alt="">
+                        <div class="image" v-if="form.idcardImgList[0].fileurlFull">
+                          <el-image
+                              append-to-body
+                              v-if="form.idcardImgList[0].fileurlFull"
+                              style="width: 90px; height: 90px"
+                              :src="form.idcardImgList[0].fileurlFull"
+                              :preview-src-list="[form.idcardImgList[0].fileurlFull]">
+                          </el-image>
+                        </div>
+                        <div class="image" v-if="form.idcardImgList[1].fileurlFull">
+                          <el-image
+                              append-to-body
+                              v-if="form.idcardImgList[1].fileurlFull"
+                              style="width: 90px; height: 90px"
+                              :src="form.idcardImgList[1].fileurlFull"
+                              :preview-src-list="[form.idcardImgList[1].fileurlFull]">
+                          </el-image>
                         </div>
                     </div>
                 </div>
                 <div class="info_list_item">
                     <div class="info_list_item_label" style="width: 100px;">浼佷笟绛剧珷锛�</div>
                     <div class="info_list_item_val">
-                        <div class="image">
-                            <img src="@/assets/images/404.png" alt="">
+                        <div class="image" v-if="form.signImg.fileurlFull">
+                          <el-image
+                              v-if="form.signImg.fileurlFull!=null"
+                              style="width: 90px; height: 90px"
+                              :src="form.signImg.fileurlFull"
+                              :preview-src-list="[form.signImg.fileurlFull]">
+                          </el-image>
                         </div>
                     </div>
                 </div>
             </div>
         </div>
         <!-- 鏂板缓/淇敼 -->
-        <OperaCompanyWindow ref="operaCompanyWindow" @success="handlePageChange"/>
+        <OperaCompanyWindow ref="operaCompanyWindow" @success="callback"/>
+        <!-- 淇敼淇濋櫓鏂规 -->
+        <modification ref="modification" @success="callback"/>
+        <!-- 淇敼鎵嬫満鍙� -->
         <el-dialog
             title="鏇存敼缁戝畾鎵嬫満鍙�"
             :visible.sync="visiblePhone"
@@ -146,20 +159,21 @@
                 <div class="form_item">
                     <div class="form_item_label">缁戝畾鎵嬫満鍙凤細</div>
                     <div class="form_item_val">
-                        <input type="text" placeholder="璇疯緭鍏�" />
+                        <el-input v-model="phone" placeholder="璇疯緭鍏�"></el-input>
                     </div>
                 </div>
                 <div class="form_item">
                     <div class="form_item_label">楠岃瘉鐮侊細</div>
                     <div class="form_item_val">
-                        <input type="text" placeholder="璇疯緭鍏�" />
-                        <el-button type="primary" style="margin-left: 20px;">鍙戦�侀獙璇佺爜</el-button>
+                        <el-input v-model="code" placeholder="璇疯緭鍏�"></el-input>
+                        <el-button type="primary" style="margin-left: 20px;" @click="send" v-if="num === 0">鍙戦�侀獙璇佺爜</el-button>
+                        <el-button type="primary" style="flex-shrink: 0; margin-left: 15px;" v-else>{{num}}s</el-button>
                     </div>
                 </div>
             </div>
             <span slot="footer" class="dialog-footer">
-                <el-button @click="visiblePhone = false">鍙� 娑�</el-button>
-                <el-button type="primary" @click="visiblePhone = false">鎻� 浜�</el-button>
+                <el-button @click="close">鍙� 娑�</el-button>
+                <el-button type="primary" @click="updatePhoneEvent">鎻� 浜�</el-button>
             </span>
         </el-dialog>
     </GlobalWindow>
@@ -169,30 +183,26 @@
     import BaseOpera from '@/components/base/BaseOpera'
     import GlobalWindow from '@/components/common/GlobalWindow'
     import OperaCompanyWindow from '@/components/business/OperaCompanyWindow'
+    import modification from '@/components/business/modification'
+    import { getById, updatePhone } from '@/api/business/company'
+    import { listForCompany } from '@/api/business/solutions'
+    import { sendSms } from '@/api/business/smsEmail'
     export default {
         name: 'OperaCompanyDescWindow',
         extends: BaseOpera,
-        components: { GlobalWindow, OperaCompanyWindow },
+        components: { GlobalWindow, OperaCompanyWindow, modification },
         data () {
             return {
                 ruleForm: {
                     phone: '',
                     code: ''
                 },
+                num: 0,
+                timer: null,
                 // 琛ㄥ崟鏁版嵁
-                form: {
-                    id: null,
-                    name: '',
-                    code: '',
-                    taxCode: '',
-                    taxAccount: '',
-                    taxBank: '',
-                    taxAddr: '',
-                    invoiceEmail: '',
-                    invoiceAddr: '',
-                    phone: '',
-                    email: ''
-                },
+                form: {},
+                phone: '',
+                code: '',
                 visiblePhone: false,
                 options: [],
                 tableData: []
@@ -203,6 +213,121 @@
                 api: '/business/company',
                 'field.id': 'id'
             })
+        },
+        methods: {
+            close() {
+                this.visiblePhone = false
+                this.phone = ''
+                this.code = ''
+                clearInterval(this.timer)
+                this.num = 0
+            },
+            updatePhoneEvent() {
+                if (!this.phone) {
+                    this.$message.warning('璇疯緭鍏ユ墜鏈哄彿')
+                    return
+                }
+                if (!this.code) {
+                    this.$message.warning('璇疯緭鍏ラ獙璇佺爜')
+                    return
+                }
+                updatePhone({
+                    id: this.form.id,
+                    captche: this.code,
+                    phone: this.phone
+                }).then(res => {
+                    this.form.phone = JSON.parse(JSON.stringify(this.phone))
+                    this.$message.success('鎿嶄綔鎴愬姛')
+                    this.visiblePhone = false
+                    this.phone = ''
+                    this.code = ''
+                    clearInterval(this.timer)
+                    this.num = 0
+                })
+            },
+            send() {
+                if (!this.phone) {
+                    this.$message.warning('璇疯緭鍏ユ墜鏈哄彿')
+                    return
+                }
+                sendSms({ phone: this.phone })
+                    .then(res => {
+                        this.num = 60
+                        this.setTime()
+                    })
+            },
+            setTime() {
+                this.timer = setInterval(() => {
+                    this.num -= 1
+                    if (this.num === 0) {
+                        clearInterval(this.timer)
+                        this.num = 0
+                    }
+                }, 1000)
+            },
+            open (title, target) {
+                const that = this;
+                this.title = title
+                this.phone = ''
+                this.code = ''
+                clearInterval(this.timer)
+                this.num = 0
+                getById(target.id)
+                    .then(res => {
+                        this.form = res
+                        this.form.type = 1
+
+                        this.form.file = {
+                            imgurl: '',
+                            imgurlfull: ''
+                        }
+                        this.form.file1 = {
+                            imgurl: '',
+                            imgurlfull: ''
+                        }
+                        this.form.file2 = {
+                            imgurl: '',
+                            imgurlfull: ''
+                        }
+                        this.form.file3 = {
+                            imgurl: '',
+                            imgurlfull: ''
+                        }
+
+                        this.form.file.imgurl = res.businessImg.fileurl
+                        this.form.file.imgurlfull = res.businessImg.fileurlFull
+                        this.form.file1.imgurl = res.idcardImgList[0].fileurl
+                        this.form.file1.imgurlfull = res.idcardImgList[0].fileurlFull
+                        this.form.file2.imgurl = res.idcardImgList[1].fileurl
+                        this.form.file2.imgurlfull = res.idcardImgList[1].fileurlFull
+                        this.form.file3.imgurl = res.signImg.fileurl
+                        this.form.file3.imgurlfull = res.signImg.fileurlFull
+
+                        listForCompany({ companyId: target.id })
+                            .then(resa => {
+                                that.form.solutionList = resa.map(item => {
+                                    return {
+                                        solutionBaseId: item.solutionBaseId,
+                                        canAdd: item.canAdd,
+                                        canReduce: item.canReduce
+                                    }
+                                })
+                                that.form.solutionListName = resa.map(item => {
+                                    return {
+                                        solutionName: item.solutionName,
+                                        canAdd: item.canAdd,
+                                        canReduce: item.canReduce
+                                    }
+                                })
+                                console.log(that.form)
+                                that.visible = true
+                            })
+                    })
+            },
+            callback() {
+                this.$emit('success')
+                this.visible = false
+            }
         }
     }
 </script>
@@ -283,6 +408,10 @@
                         align-items: center;
                         justify-content: center;
                         overflow: hidden;
+                        margin-right: 10px;
+                        &:last-child {
+                            margin: 0 !important;
+                        }
                         img {
                             width: 100%;
                         }

--
Gitblit v1.9.3