scorpioyq há 2 anos atrás
pai
commit
f105127074
3 ficheiros alterados com 403 adições e 373 exclusões
  1. 91 87
      src/page/login.vue
  2. 303 285
      src/views/home/component/dash.vue
  3. 9 1
      src/views/user/manage.vue

+ 91 - 87
src/page/login.vue

@@ -4,8 +4,8 @@
       <div class="flex flex-center flex-child-average">
         <div class="flex left">
           <img
-            src="https://wutong-1302848345.cos.ap-chengdu.myqcloud.com/wtzx/3938373d1b0c44c899f94cba263ff4a8.jpg"
-            style="
+              src="https://wutong-1302848345.cos.ap-chengdu.myqcloud.com/wtzx/3938373d1b0c44c899f94cba263ff4a8.jpg"
+              style="
               height: 560px;
               object-fit: contain;
               border-bottom-left-radius: 10px;
@@ -17,80 +17,80 @@
         <div class="right flex flex-col flex-child-average">
           <div class="flex flex-col flex-justify-between" style="height: 560px">
             <div
-              class="flex flex-justify-end"
-              style="margin-right: 3px; margin-top: 3px"
+                class="flex flex-justify-end"
+                style="margin-right: 3px; margin-top: 3px"
             >
               <div v-if="!dev">
                 <img
-                  v-if="qrCodeLogin"
-                  src="../assets/img/com.png"
-                  style="width: 80px"
-                  @click="qrCodeLogin = !qrCodeLogin"
+                    v-if="qrCodeLogin"
+                    src="../assets/img/com.png"
+                    style="width: 80px"
+                    @click="qrCodeLogin = !qrCodeLogin"
                 />
                 <img
-                  v-else
-                  src="../assets/img/code.png"
-                  style="width: 80px"
-                  @click="qrCodeLogin = !qrCodeLogin"
+                    v-else
+                    src="../assets/img/code.png"
+                    style="width: 80px"
+                    @click="qrCodeLogin = !qrCodeLogin"
                 />
               </div>
             </div>
 
             <div
-              v-if="qrCodeLogin"
-              class="flex flex-center flex-col"
-              style="height: 500px; margin-top: -20px"
+                v-if="qrCodeLogin"
+                class="flex flex-center flex-col"
+                style="height: 500px; margin-top: -20px"
             >
               <span class="font-24 black bold">欢迎来到梧桐树云服务👏</span>
               <div
-                class="flex flex-col flex-center"
-                style="height: 360px; width: 360px; margin-top: -20px"
+                  class="flex flex-col flex-center"
+                  style="height: 360px; width: 360px; margin-top: -20px"
               >
                 <vue-qr
-                  :currentLevel="3"
-                  :logoCornerRadius="4"
-                  :logoScale="0.25"
-                  :logoSrc="logoSrc"
-                  :text="qrCodeText"
-                  size="260"
+                    :currentLevel="3"
+                    :logoCornerRadius="4"
+                    :logoScale="0.25"
+                    :logoSrc="logoSrc"
+                    :text="qrCodeText"
+                    size="260"
                 />
               </div>
               <span
-                class="mt-10 bold main-color font-16"
-                style="margin-top: -20px"
-                >打开微信扫描二维码登录梧桐树云服务</span
+                  class="mt-10 bold main-color font-16"
+                  style="margin-top: -20px"
+              >打开微信扫描二维码登录梧桐树云服务</span
               >
             </div>
             <div v-else class="flex flex-col flex-center" style="height: 500px">
               <span class="font-24 black bold">欢迎来到梧桐树云服务👏</span>
               <div
-                class="flex flex-col flex-center mt-5"
-                style="width: 450px; height: 400px"
+                  class="flex flex-col flex-center mt-5"
+                  style="width: 450px; height: 400px"
               >
                 <el-form ref="loginForm" :model="form" :rules="rules">
                   <el-form-item prop="name">
                     <el-input
-                      v-model="form.name"
-                      placeholder="用户帐号"
-                      prefix-icon="Avatar"
-                      size="large"
+                        v-model="form.name"
+                        placeholder="用户帐号"
+                        prefix-icon="Avatar"
+                        size="large"
                     />
                   </el-form-item>
                   <el-form-item prop="pass">
                     <el-input
-                      v-model="form.pass"
-                      :type="flag ? 'text' : 'password'"
-                      placeholder="密码"
-                      prefix-icon="WalletFilled"
-                      size="large"
+                        v-model="form.pass"
+                        :type="flag ? 'text' : 'password'"
+                        placeholder="密码"
+                        prefix-icon="WalletFilled"
+                        size="large"
                     >
                       <template v-slot:suffix>
                         <div class="pointer" @click="flag = !flag">
                           <el-icon v-if="!flag">
-                            <Hide />
+                            <Hide/>
                           </el-icon>
                           <el-icon v-else>
-                            <View />
+                            <View/>
                           </el-icon>
                         </div>
                       </template>
@@ -98,74 +98,77 @@
                   </el-form-item>
                   <el-form-item prop="code">
                     <el-input
-                      v-model="form.code"
-                      class="append"
-                      placeholder="验证码"
-                      prefix-icon="Refresh"
-                      size="large"
-                      @keyup.enter="submint"
+                        v-model="form.code"
+                        class="append"
+                        placeholder="验证码"
+                        prefix-icon="Refresh"
+                        size="large"
+                        @keyup.enter="submint"
                     >
                       <template v-slot:append>
                         <img
-                          :src="code"
-                          class="pic"
-                          @click="init"
-                          style="
+                            :src="code"
+                            class="pic"
+                            @click="init"
+                            style="
                             height: 40px;
                             background-color: red;
                             background-blend-mode: lighten;
                           "
-                          alt="code"
+                            alt="code"
                         />
                       </template>
                     </el-input>
                   </el-form-item>
                   <el-form-item>
                     <div
-                      class="flex flex-align-center flex-justify-between full-width"
+                        class="flex flex-align-center flex-justify-between full-width"
                     >
                       <div v-if="dev" class="flex flex-center full-width">
                         <el-button type="primary" plain @click="loginTest(1)"
-                          >测试管理员001</el-button
+                        >测试管理员001
+                        </el-button
                         >
                         <el-button type="primary" plain @click="loginTest(2)"
-                          >测试用户001</el-button
+                        >测试用户001
+                        </el-button
                         >
                       </div>
                     </div>
                   </el-form-item>
                 </el-form>
                 <el-button
-                  size="large"
-                  style="width: 78%"
-                  type="primary"
-                  @click="submint"
-                  >登录</el-button
+                    size="large"
+                    style="width: 78%"
+                    type="primary"
+                    @click="submint"
+                >登录
+                </el-button
                 >
                 <div class="flex flex-col mt-10 flex-center">
                   <span class="grey-6">由梧桐研究院提供技术支持</span>
                   <span class="grey-6 mt-5">使用问题请咨询:15587166921</span>
                   <el-button
-                    color="#558FF1"
-                    @click="
+                      color="#558FF1"
+                      @click="
                       download(
                         'https://wutong-1302848345.cos.ap-chengdu.myqcloud.com/wtzx/a53cc056c3914ae9884992dafe7a9679.pdf'
                       )
                     "
-                    style="width: 160px"
-                    plain
-                    class="mt-10 blockss"
+                      style="width: 160px"
+                      plain
+                      class="mt-10 blockss"
                   >
                     点击下载用户指南
                   </el-button>
                   <span class="grey-6 mt-5 font-12 mt-20"
-                    >为了获得最佳体验,您可以<span
+                  >为了获得最佳体验,您可以<span
                       class="blue pointer"
                       @click="
                         download('https://www.google.cn/intl/zh-CN/chrome/')
                       "
-                      >点击此处</span
-                    >获取Chrome 浏览器</span
+                  >点击此处</span
+                  >获取Chrome 浏览器</span
                   >
                 </div>
               </div>
@@ -175,7 +178,7 @@
       </div>
     </div>
     <div class="footer">
-      <foolter />
+      <foolter/>
     </div>
   </div>
 </template>
@@ -190,15 +193,15 @@ layout: 'empty',
 
 <script>
 import md5 from 'js-md5'
-import { useStore } from '@/store/user.js'
-import { removeToken, setToken } from '../utils/auth.js'
+import {useStore} from '@/store/user.js'
+import {removeToken, setToken} from '../utils/auth.js'
 import permissionStore from '@/store/permission.js'
 import VueQr from 'vue-qr/src/packages/vue-qr.vue'
 import foolter from '@/layout/foolter.vue'
 
 export default {
   name: 'login',
-  components: { VueQr, foolter },
+  components: {VueQr, foolter},
   watch: {
     qrCodeLogin: {
       handler(val) {
@@ -213,27 +216,27 @@ export default {
   setup() {
     const user = useStore()
     const permission = permissionStore()
-    return { user, permission }
+    return {user, permission}
   },
   data() {
     return {
       flag: false,
       form: {
-        name: '',
-        pass: ''
+        name: 'adminzj',
+        pass: '123456'
       },
       rules: {
         name: [
-          { required: true, message: '请输入用户帐号', trigger: 'blur' }
+          {required: true, message: '请输入用户帐号', trigger: 'blur'}
           // { min: 11, max: 11, message: '请输入11位手机号', trigger: 'blur' }
         ],
         pass: [
-          { required: true, message: '请输入密码', trigger: 'blur' },
-          { min: 3, max: 16, message: '长度在 3 到 16 个字符', trigger: 'blur' }
+          {required: true, message: '请输入密码', trigger: 'blur'},
+          {min: 3, max: 16, message: '长度在 3 到 16 个字符', trigger: 'blur'}
         ],
         code: [
-          { required: true, message: '请输入验证码', trigger: 'blur' },
-          { min: 5, max: 5, message: '验证码不正确', trigger: 'blur' }
+          {required: true, message: '请输入验证码', trigger: 'blur'},
+          {min: 5, max: 5, message: '验证码不正确', trigger: 'blur'}
         ]
       },
       code: '',
@@ -259,16 +262,16 @@ export default {
   methods: {
     init() {
       this.dev =
-        window.location.href.indexOf('localhost') > -1 ||
-        window.location.href.indexOf('https://test.wutongshucloud.com/') > -1 ||
-        window.location.href.indexOf('192.168.31') > -1
+          window.location.href.indexOf('localhost') > -1 ||
+          window.location.href.indexOf('https://test.wutongshucloud.com/') > -1 ||
+          window.location.href.indexOf('192.168.31') > -1
       sessionStorage.setItem('dev', this.dev)
 
       this.$api.login.captcha().then(res => {
         this.code = res.image
         this.header = res.key
       })
-      const menu = { active: 0, subActive: 0 }
+      const menu = {active: 0, subActive: 0}
       localStorage.setItem('index', JSON.stringify(menu))
       localStorage.removeItem('data-type')
     },
@@ -295,7 +298,7 @@ export default {
               this.init()
             } else {
               setToken(res.access_token)
-              this.user.setUserInfo({ name: res.real_name })
+              this.user.setUserInfo({name: res.real_name})
               this.getInfo()
             }
           })
@@ -306,8 +309,8 @@ export default {
     },
     download(url) {
       window.open(
-        url,
-        '_blank' // <- This is what makes it open in a new window.
+          url,
+          '_blank' // <- This is what makes it open in a new window.
       )
     },
     loginAdmin() {
@@ -355,12 +358,12 @@ export default {
         if (res.code === 200) {
           this.sessionId = res.data
           this.qrCodeText =
-            'https://prod.wutongshucloud.com/login?id=' + this.sessionId
+              'https://prod.wutongshucloud.com/login?id=' + this.sessionId
         }
       })
     },
     codeLogin() {
-      this.$api.login.qrCodeLogin({ sessionId: this.sessionId }).then(res => {
+      this.$api.login.qrCodeLogin({sessionId: this.sessionId}).then(res => {
         if (res.code === 200) {
           const tmp = res.data
           if (Object.prototype.hasOwnProperty.call(tmp, 'phone')) {
@@ -405,6 +408,7 @@ export default {
   background-image: url('https://wutong-1302848345.cos.ap-chengdu.myqcloud.com/wtzx/7667edec62f44063a50c66e8654eaa87.png');
   background-size: cover;
   background-repeat: no-repeat;
+
   .footer {
     position: fixed;
     bottom: 10px;

+ 303 - 285
src/views/home/component/dash.vue

@@ -3,165 +3,165 @@
     <div class="flex flex-col padding white-bg">
       <div class="flex flex-align-center tip">
         <el-icon class="ml-20" color="#BC002D">
-          <WarningFilled />
+          <WarningFilled/>
         </el-icon>
         <span class="ml-5"
-          >项目总投资额<span class="main-color bold">{{
+        >项目总投资额<span class="main-color bold">{{
             num ? Number.parseFloat(num).toLocaleString() : '0'
           }}</span
-          >万元</span
+        >万元</span
         >
       </div>
       <div
-        class="flex ml-20 hide-scrollbar full-width flex-wrap"
-        v-show="numList && numList.length > 0"
+          class="flex ml-20 hide-scrollbar full-width flex-wrap"
+          v-show="numList && numList.length > 0"
       >
         <div
-          v-for="(item, index) in numList"
-          :key="item.id"
-          :class="active === index ? 'total-s' : 'total'"
-          class="flex flex-center flex-justify-between mt-20 bold font-16 pointer"
-          @click="switchTab(item, index)"
+            v-for="(item, index) in numList"
+            :key="item.id"
+            :class="active === index ? 'total-s' : 'total'"
+            class="flex flex-center flex-justify-between mt-20 bold font-16 pointer"
+            @click="switchTab(item, index)"
         >
           <span class="sp">{{ item.name }}</span>
           <span class="sp1"
-            >{{ item.number }}<span class="grey font-13">个</span></span
+          >{{ item.number }}<span class="grey font-13">个</span></span
           >
         </div>
       </div>
       <div class="flex flex-center flex-justify-start">
         <base-button
-          class="ml-20 mt-20"
-          icon="Plus"
-          title="新增"
-          v-if="
+            class="ml-20 mt-20"
+            icon="Plus"
+            title="新增"
+            v-if="
             dataType === 'project' &&
             permissions.vaildPermission('project_new_create')
           "
-          @click="showAdd = true"
+            @click="showAdd = true"
         />
         <base-button
-          class="ml-20 mt-20"
-          icon="el-icon-upload"
-          title="数据导入"
-          v-if="dataType === 'project'"
-          @click="diaType = 0"
+            class="ml-20 mt-20"
+            icon="el-icon-upload"
+            title="数据导入"
+            v-if="dataType === 'project'"
+            @click="diaType = 0"
         />
         <base-button
-          class="ml-20 mt-20"
-          icon="el-icon-download"
-          title="数据导出"
-          @click="diaType = 1"
+            class="ml-20 mt-20"
+            icon="el-icon-download"
+            title="数据导出"
+            @click="diaType = 1"
         />
         <base-button
-          class="ml-20 mt-20"
-          type="0"
-          icon="el-icon-download"
-          title="汇总数据导出"
-          @click="diaType = 2"
+            class="ml-20 mt-20"
+            type="0"
+            icon="el-icon-download"
+            title="汇总数据导出"
+            @click="diaType = 2"
         />
         <base-button
-          class="ml-20 mt-20"
-          type="0"
-          icon="el-icon-coordinate"
-          title="项目结转"
-          @click="projectCarry"
+            class="ml-20 mt-20"
+            type="0"
+            icon="el-icon-coordinate"
+            title="项目结转"
+            @click="projectCarry"
         />
         <el-tooltip
-          content="申报的项目必须为已入全国投资项目在线审批监管平台并且已经上报的项目"
+            content="申报的项目必须为已入全国投资项目在线审批监管平台并且已经上报的项目"
         >
           <base-button
-            class="ml-20 mt-20"
-            type="0"
-            icon="el-icon-folder-checked"
-            title="入库申报"
-            v-if="dataType === 'asset'"
-            @click="projectStore"
+              class="ml-20 mt-20"
+              type="0"
+              icon="el-icon-folder-checked"
+              title="入库申报"
+              v-if="dataType === 'asset'"
+              @click="projectStore"
           />
         </el-tooltip>
       </div>
     </div>
     <avue-crud
-      ref="crud"
-      v-model="form"
-      v-model:page="page"
-      :before-open="beforeOpen"
-      :permission="permissions"
-      :data="data"
-      :option="option"
-      :table-loading="loading"
-      class="curd"
-      @row-del="rowDel"
-      @tree-load="treeLoad"
-      @current-change="currentChange"
-      @size-change="sizeChange"
-      @refresh-change="refreshChange"
-      @selection-change="selectionChange"
-      @on-load="onLoad"
+        ref="crud"
+        v-model="form"
+        v-model:page="page"
+        :before-open="beforeOpen"
+        :permission="permissions"
+        :data="data"
+        :option="option"
+        :table-loading="loading"
+        class="curd"
+        @row-del="rowDel"
+        @tree-load="treeLoad"
+        @current-change="currentChange"
+        @size-change="sizeChange"
+        @refresh-change="refreshChange"
+        @selection-change="selectionChange"
+        @on-load="onLoad"
     >
       <template #menu="{ row }">
         <el-button
-          v-if="
+            v-if="
             dataType === 'asset' && row.project_stage !== 7 && row.can_update
           "
-          icon="Upload"
-          type="primary"
-          text
-          @click="report(row)"
+            icon="Upload"
+            type="primary"
+            text
+            @click="report(row)"
         >
           {{ row.is_report === 1 ? '项目已上报' : '项目上报' }}
         </el-button>
         <el-button
-          v-if="
+            v-if="
             (row.report_type === 0 ||
               row.report_type === 1 ||
               row.report_type === 4) &&
             row.can_update
           "
-          text
-          type="primary"
-          icon="el-icon-upload"
-          @click="projectReport(row)"
-          >上报审核
+            text
+            type="primary"
+            icon="el-icon-upload"
+            @click="projectReport(row)"
+        >上报审核
         </el-button>
         <el-button
-          text
-          v-if="
+            text
+            v-if="
             permissions.vaildPermission('projectApprovalBtn') &&
             row.report_type === 2
           "
-          type="primary"
-          icon="el-icon-bell"
-          @click="rowClick(row, 1)"
-          >审核
+            type="primary"
+            icon="el-icon-bell"
+            @click="rowClick(row, 1)"
+        >审核
         </el-button>
         <el-button
-          v-if="
+            v-if="
             row.hasOwnProperty('report_type') &&
             row.report_type === 3 &&
             row.can_update
           "
-          text
-          type="primary"
-          icon="el-icon-upload"
-          @click="projectReportFormal(row)"
-          >上报固定资产
+            text
+            type="primary"
+            icon="el-icon-upload"
+            @click="projectReportFormal(row)"
+        >上报固定资产
         </el-button>
         <el-button
-          text
-          type="primary"
-          icon="el-icon-folder-remove"
-          @click="projectCancel(row)"
-          v-if="row.project_stage !== 7 && row.can_update"
-          >退库
+            text
+            type="primary"
+            icon="el-icon-folder-remove"
+            @click="projectCancel(row)"
+            v-if="row.project_stage !== 7 && row.can_update"
+        >退库
         </el-button>
         <el-button
-          text
-          type="primary"
-          icon="el-icon-delete"
-          @click="rowDel(row)"
-          v-if="row.can_update"
-          >删除
+            text
+            type="primary"
+            icon="el-icon-delete"
+            @click="rowDel(row)"
+            v-if="row.can_update"
+        >删除
         </el-button>
       </template>
       <template #plan_storage_time-header="{ column }">
@@ -169,7 +169,7 @@
           <div class="mr-5">{{ (column || {}).label }}</div>
           <el-tooltip content="红色为计划入库时间,蓝色为实际入库时间">
             <el-icon>
-              <InfoFilled />
+              <InfoFilled/>
             </el-icon>
           </el-tooltip>
         </div>
@@ -177,8 +177,8 @@
       <template #plan_storage_time="{ row }">
         <div class="flex flex-center">
           <div
-            class="mr-5 red"
-            v-if="row.plan_storage_time !== undefined && row.is_storage === 0"
+              class="mr-5 red"
+              v-if="row.plan_storage_time !== undefined && row.is_storage === 0"
           >
             {{ row.plan_storage_time.substring(0, 10) }}
           </div>
@@ -193,7 +193,7 @@
           <div class="mr-5">{{ (column || {}).label }}</div>
           <el-tooltip content="红色为计划开工时间,蓝色为实际开工时间">
             <el-icon>
-              <InfoFilled />
+              <InfoFilled/>
             </el-icon>
           </el-tooltip>
         </div>
@@ -201,8 +201,8 @@
       <template #plan_commencement_time="{ row }">
         <div class="flex flex-center">
           <div
-            class="mr-5 red"
-            v-if="
+              class="mr-5 red"
+              v-if="
               row.plan_commencement_time !== undefined &&
               (row.is_start === undefined || row.is_start === 0)
             "
@@ -219,7 +219,7 @@
           <div>{{ row['$project_stage'] }}</div>
           <el-tooltip :content="row.exit_msg" v-if="row.project_stage === 7">
             <el-icon @click="showReceipt(row.exit_msg)">
-              <InfoFilled />
+              <InfoFilled/>
             </el-icon>
           </el-tooltip>
         </div>
@@ -229,11 +229,11 @@
           <el-tag>{{ row.report_type_name }}</el-tag>
           <el-tooltip :content="row.receipt_msg">
             <el-icon
-              v-if="row.report_type === 4"
-              class="ml-10"
-              @click="showReceipt(row.receipt_msg)"
+                v-if="row.report_type === 4"
+                class="ml-10"
+                @click="showReceipt(row.receipt_msg)"
             >
-              <WarningFilled />
+              <WarningFilled/>
             </el-icon>
           </el-tooltip>
         </div>
@@ -241,117 +241,117 @@
     </avue-crud>
     <!--    新增-->
     <el-dialog
-      v-model="showAdd"
-      append-to-body
-      center
-      title="新增项目"
-      width="35%"
+        v-model="showAdd"
+        append-to-body
+        center
+        title="新增项目"
+        width="35%"
     >
       <div v-loading="addLoading">
         <el-form
-          ref="form"
-          :model="projectForm"
-          class="lab mt-20"
-          label-width="100px"
-          :rules="rules"
+            ref="form"
+            :model="projectForm"
+            class="lab mt-20"
+            label-width="100px"
+            :rules="rules"
         >
           <div class="flex flex-center flex-col mr-20">
             <el-form-item class="full-width" label="项目名称" prop="name">
               <el-input
-                v-model="projectForm.name"
-                clearable
-                placeholder="输入项目名称"
+                  v-model="projectForm.name"
+                  clearable
+                  placeholder="输入项目名称"
               />
             </el-form-item>
             <el-form-item
-              class="full-width"
-              label="项目总投"
-              prop="totalAmount"
+                class="full-width"
+                label="项目总投"
+                prop="totalAmount"
             >
               <el-input
-                v-model="projectForm.totalAmount"
-                type="number"
-                clearable
-                placeholder="输入项目总投(万元)"
+                  v-model="projectForm.totalAmount"
+                  type="number"
+                  clearable
+                  placeholder="输入项目总投(万元)"
               >
                 <template #append>(万元)</template>
               </el-input>
             </el-form-item>
             <el-form-item class="full-width" label="项目标签" prop="tags">
               <el-select
-                v-model="projectForm.tags"
-                clearable
-                placeholder="选择项目标签"
-                style="width: 100%"
+                  v-model="projectForm.tags"
+                  clearable
+                  placeholder="选择项目标签"
+                  style="width: 100%"
               >
                 <el-option
-                  v-for="item in tagsList"
-                  :key="item.dictKey"
-                  :label="item.dictValue"
-                  :value="item.dictKey"
+                    v-for="item in tagsList"
+                    :key="item.dictKey"
+                    :label="item.dictValue"
+                    :value="item.dictKey"
                 />
               </el-select>
             </el-form-item>
             <el-form-item class="full-width" label="行业分类" prop="tags">
               <el-select
-                v-model="projectForm.dictKey"
-                clearable
-                placeholder="选择行业分类"
-                style="width: 100%"
+                  v-model="projectForm.dictKey"
+                  clearable
+                  placeholder="选择行业分类"
+                  style="width: 100%"
               >
                 <el-option
-                  v-for="item in industryList"
-                  :key="item.dictKey"
-                  :label="item.dictValue"
-                  :value="item.dictKey"
+                    v-for="item in industryList"
+                    :key="item.dictKey"
+                    :label="item.dictValue"
+                    :value="item.dictKey"
                 />
               </el-select>
             </el-form-item>
             <el-form-item class="full-width" label="建设内容">
               <el-input
-                v-model="projectForm.introduction"
-                :rows="6"
-                clearable
-                placeholder="输入项目建设内容"
-                type="textarea"
+                  v-model="projectForm.introduction"
+                  :rows="6"
+                  clearable
+                  placeholder="输入项目建设内容"
+                  type="textarea"
               />
             </el-form-item>
             <div class="flex flex-center mt-10">
               <base-button
-                class="mr-20"
-                icon="Close"
-                title="取消"
-                type="0"
-                @click="showAdd = false"
+                  class="mr-20"
+                  icon="Close"
+                  title="取消"
+                  type="0"
+                  @click="showAdd = false"
               />
-              <base-button icon="Check" title="保存" @click="projectSave" />
+              <base-button icon="Check" title="保存" @click="projectSave"/>
             </div>
           </div>
         </el-form>
       </div>
     </el-dialog>
     <form-dialog
-      :dialogType="diaType"
-      @close="formDialogClose"
-      @export="exportExcel"
-      :ids="selectList.map(ele => ele.id)"
-      :year="owerQuery.projectYear"
+        :dialogType="diaType"
+        @close="formDialogClose"
+        @export="exportExcel"
+        :ids="selectList.map(ele => ele.id)"
+        :year="owerQuery.projectYear"
     />
     <summary-dialog
-      :dialogType="diaType"
-      @close="diaType = -1"
-      :select-num="selectList.length === 0 ? page.total : selectList.length"
-      @export="exportExcelTotal"
+        :dialogType="diaType"
+        @close="diaType = -1"
+        :select-num="selectList.length === 0 ? page.total : selectList.length"
+        @export="exportExcelTotal"
     />
     <el-dialog v-model="reportShow" width="500px" title="请选择上报时间">
       <div v-if="currentReport">
         <el-date-picker
-          v-model="currentReport.report_time"
-          format="YYYY-MM-DD"
-          class="mb-20"
-          placeholder="选择上报时间"
-          style="width: 100%"
-          value-format="YYYY-MM-DD"
+            v-model="currentReport.report_time"
+            format="YYYY-MM-DD"
+            class="mb-20"
+            placeholder="选择上报时间"
+            style="width: 100%"
+            value-format="YYYY-MM-DD"
         />
       </div>
       <div class="flex flex-center full-width flex-justify-end">
@@ -370,15 +370,15 @@
           </el-radio-group>
         </div>
         <el-input
-          class="mt-20"
-          type="textarea"
-          :rows="5"
-          v-model="approvalMsg"
-          placeholder="请填写审批意见"
+            class="mt-20"
+            type="textarea"
+            :rows="5"
+            v-model="approvalMsg"
+            placeholder="请填写审批意见"
         />
         <div class="full-width flex flex-justify-end mt-20">
           <el-button plain type="primary" @click="showApproval = false"
-            >取消
+          >取消
           </el-button>
           <el-button type="primary" @click="projectApproval">确定</el-button>
         </div>
@@ -391,19 +391,19 @@
 import BaseButton from '../../../components/base-button.vue'
 import permissionStore from '@/store/permission.js'
 import formDialog from '@/views/home/component/form_dialog.vue'
-import { getLazyList } from '@/api/project/index.js'
+import {getLazyList} from '@/api/project/index.js'
 import summaryDialog from '@/views/home/component/summary_dialog.vue'
-import { useStore } from '@/store/user.js'
+import {useStore} from '@/store/user.js'
 import confing from '@/config/website'
-import { ElMessageBox } from 'element-plus'
+import {ElMessageBox} from 'element-plus'
 
 export default {
   name: 'dash',
-  components: { BaseButton, formDialog, summaryDialog },
+  components: {BaseButton, formDialog, summaryDialog},
   setup() {
     const permissions = permissionStore()
     const user = useStore()
-    return { permissions, user }
+    return {permissions, user}
   },
   data() {
     return {
@@ -459,7 +459,7 @@ export default {
             slot: true,
             width: 140,
             dicUrl:
-              '/api/blade-system/dict-biz/dictionary?code=project-situation',
+                '/api/blade-system/dict-biz/dictionary?code=project-situation',
             props: {
               label: 'dictValue',
               value: 'dictKey'
@@ -472,7 +472,9 @@ export default {
             type: 'number',
             precision: 2,
             formatter: (val, value, label) => {
-              return val.total_amount.toLocaleString()
+              if (val && val.length > 0) {
+                return val.total_amount.toLocaleString()
+              }
             }
           },
           {
@@ -485,7 +487,7 @@ export default {
             prop: 'dict_key',
             width: 120,
             dicUrl:
-              '/api/blade-system/dict-biz/dictionary?code=industry-classification',
+                '/api/blade-system/dict-biz/dictionary?code=industry-classification',
             props: {
               label: 'dictValue',
               value: 'dictKey'
@@ -575,7 +577,7 @@ export default {
         dictKey: ''
       },
       rules: {
-        name: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
+        name: [{required: true, message: '请输入项目名称', trigger: 'blur'}],
         projectType: [
           {
             required: true,
@@ -589,7 +591,12 @@ export default {
             message: '请选择项目标签',
             trigger: 'change'
           }
-        ]
+        ],
+        dictKey: {
+          required: true,
+          message: '请选择项目行业分类',
+          trigger: 'change'
+        }
       },
       diaType: -1,
       parentId: 0,
@@ -604,7 +611,7 @@ export default {
   created() {
     this.dev = sessionStorage.getItem('dev') === 'true'
     const indexLabel = this.option.column.findIndex(
-      sub => sub.prop === 'unit_name'
+        sub => sub.prop === 'unit_name'
     )
     this.dataType = localStorage.getItem('data-type')
     if (this.user.info.viewStage === 1) {
@@ -632,7 +639,7 @@ export default {
     switchTab(item, index) {
       this.active = index
       this.num = this.numList[index].totalAmount
-      this.projectStageQuery = { projectStage: item.dictKey }
+      this.projectStageQuery = {projectStage: item.dictKey}
       this.onLoad(Object.assign(this.owerQuery, this.projectStageQuery))
     },
     onLoad(query = {}) {
@@ -640,32 +647,32 @@ export default {
       if (!Object.hasOwn(this.owerQuery, 'projectYear')) {
         this.owerQuery.projectYear = new Date().getFullYear()
       }
-      const data = { ...this.owerQuery, parentId: this.parentId }
+      const data = {...this.owerQuery, parentId: this.parentId}
       this.queryData = data
       this.$api.project
-        .projectList(this.page.currentPage, this.page.pageSize, this.queryData)
-        .then(res => {
-          this.loading = false
-          if (res.code === 200) {
-            this.data = res.data.records.map(e => {
-              e.projectStage = e.projectStage + ''
-              e.selected = true
-              const xian = e.name.indexOf('县')
-              e.name = this.dev ? e.name.substring(xian + 1) : e.name
-              const status = confing.reportTypes.find(
-                ele => ele.value === e.report_type
-              )
-              if (status) {
-                e.report_type_name = status.label
-              }
-              return e
-            })
-            this.page.total = res.data.total
-          }
-        })
-        .finally(() => {
-          this.loading = false
-        })
+          .projectList(this.page.currentPage, this.page.pageSize, this.queryData)
+          .then(res => {
+            this.loading = false
+            if (res.code === 200) {
+              this.data = res.data.records.map(e => {
+                e.projectStage = e.projectStage + ''
+                e.selected = true
+                const xian = e.name.indexOf('县')
+                e.name = this.dev ? e.name.substring(xian + 1) : e.name
+                const status = confing.reportTypes.find(
+                    ele => ele.value === e.report_type
+                )
+                if (status) {
+                  e.report_type_name = status.label
+                }
+                return e
+              })
+              this.page.total = res.data.total
+            }
+          })
+          .finally(() => {
+            this.loading = false
+          })
     },
     selectionChange(list) {
       this.selectList = list
@@ -684,7 +691,7 @@ export default {
       } else if (type === 'view') {
         const routeData = this.$router.resolve({
           path: '/home/pro_detail',
-          query: { id: this.form.id, projectStage: this.form.project_stage }
+          query: {id: this.form.id, projectStage: this.form.project_stage}
         })
         window.open(routeData.href, '_blank')
       }
@@ -704,10 +711,10 @@ export default {
       getLazyList(tree.id).then(res => {
         this.loading = false
         resolve(
-          res.data.data.childrenList.map(e => {
-            e.project_stage = e.project_stage.toString()
-            return e
-          })
+            res.data.data.childrenList.map(e => {
+              e.project_stage = e.project_stage.toString()
+              return e
+            })
         )
       })
     },
@@ -717,7 +724,7 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        this.$api.project.projectRemove({ ids: row.id }).then(res => {
+        this.$api.project.projectRemove({ids: row.id}).then(res => {
           if (res.code === 200) {
             this.$message.success(res.msg)
             this.getNumList()
@@ -738,22 +745,22 @@ export default {
     },
     getTypeList() {
       this.$api.project
-        .typeList({ type: 1, size: 999, current: 1 })
-        .then(res => {
-          this.typeList = res.data.records
-        })
-      this.$api.common.dicList({ code: 'project-tags' }).then(res => {
+          .typeList({type: 1, size: 999, current: 1})
+          .then(res => {
+            this.typeList = res.data.records
+          })
+      this.$api.common.dicList({code: 'project-tags'}).then(res => {
         if (res.code === 200) {
           this.tagsList = res.data
         }
       })
       this.$api.common
-        .dicList({ code: 'industry-classification' })
-        .then(res => {
-          if (res.code === 200) {
-            this.industryList = res.data
-          }
-        })
+          .dicList({code: 'industry-classification'})
+          .then(res => {
+            if (res.code === 200) {
+              this.industryList = res.data
+            }
+          })
     },
     report(res) {
       if (res.is_report === 1) {
@@ -770,7 +777,7 @@ export default {
     projectReport(res) {
       this.$confirm('确认上报至管理员进行审核?').then(ele => {
         if (ele === 'confirm') {
-          this.$api.project.upReportType({ id: res.id }).then(res => {
+          this.$api.project.upReportType({id: res.id}).then(res => {
             if (res.code === 200) {
               this.$message.success(res.msg)
               this.refreshChange()
@@ -798,21 +805,21 @@ export default {
       }
       this.showApproval = false
       this.$api.project
-        .approvalProject({
-          id: this.form.id,
-          reportType: this.approvalStatus,
-          receiptMsg: this.approvalMsg
-        })
-        .then(res => {
-          if (res.code === 200) {
-            this.$message.success(res.msg)
-            this.approvalStatus = 3
-            this.approvalMsg = ''
-            this.refreshChange()
-          } else {
-            this.$message.error(res.msg)
-          }
-        })
+          .approvalProject({
+            id: this.form.id,
+            reportType: this.approvalStatus,
+            receiptMsg: this.approvalMsg
+          })
+          .then(res => {
+            if (res.code === 200) {
+              this.$message.success(res.msg)
+              this.approvalStatus = 3
+              this.approvalMsg = ''
+              this.refreshChange()
+            } else {
+              this.$message.error(res.msg)
+            }
+          })
     },
     /**
      * 管理员已经审核通过的项目,上报到固定资产
@@ -821,7 +828,7 @@ export default {
     projectReportFormal(item) {
       this.$confirm('确定上报到固定资产?').then(res => {
         if (res === 'confirm') {
-          this.$api.project.reportToAssets({ ids: item.id }).then(res => {
+          this.$api.project.reportToAssets({ids: item.id}).then(res => {
             if (res.code === 200) {
               this.$message.success(res.msg)
               this.refreshChange()
@@ -841,15 +848,15 @@ export default {
         return
       }
       this.$api.project
-        .projectCarry({ ids: this.selectList.map(ele => ele.id).join(',') })
-        .then(res => {
-          if (res.code === 200) {
-            this.$message.success(res.msg)
-            this.refreshChange()
-          } else {
-            this.$message.error(res.msg)
-          }
-        })
+          .projectCarry({ids: this.selectList.map(ele => ele.id).join(',')})
+          .then(res => {
+            if (res.code === 200) {
+              this.$message.success(res.msg)
+              this.refreshChange()
+            } else {
+              this.$message.error(res.msg)
+            }
+          })
     },
     /**
      * 项目入库预审
@@ -870,43 +877,43 @@ export default {
         }
       })
       ElMessageBox.confirm('确定将已经勾选的项目提交入库预审?', '', {}).then(
-        res => {
-          if (res === 'confirm') {
-            this.$api.project
-              .projectStore({
-                ids: this.selectList.map(ele => ele.id).join(',')
-              })
-              .then(res => {
-                if (res.code === 200) {
-                  this.$message.success(res.msg)
-                } else {
-                  this.$message.error(res.msg)
-                }
-              })
+          res => {
+            if (res === 'confirm') {
+              this.$api.project
+                  .projectStore({
+                    ids: this.selectList.map(ele => ele.id).join(',')
+                  })
+                  .then(res => {
+                    if (res.code === 200) {
+                      this.$message.success(res.msg)
+                    } else {
+                      this.$message.error(res.msg)
+                    }
+                  })
+            }
           }
-        }
       )
     },
     /**
      * 项目退库
      */
     projectCancel(res) {
-      ElMessageBox.prompt('请输入退库原因', '提示', {}).then(({ value }) => {
+      ElMessageBox.prompt('请输入退库原因', '提示', {}).then(({value}) => {
         console.log(value)
         if (value === null || value.length === 0) {
           this.$message.error('请输入退库原因')
           return
         }
         this.$api.project
-          .projectCancel({ id: res.id, exitMsg: value })
-          .then(res => {
-            if (res.code === 200) {
-              this.$message.success(res.msg)
-              this.refreshChange()
-            } else {
-              this.$message.error(res.msg)
-            }
-          })
+            .projectCancel({id: res.id, exitMsg: value})
+            .then(res => {
+              if (res.code === 200) {
+                this.$message.success(res.msg)
+                this.refreshChange()
+              } else {
+                this.$message.error(res.msg)
+              }
+            })
       })
     },
     track(res) {
@@ -930,6 +937,16 @@ export default {
         this.$message.error('正在处理,请稍后...')
         return
       }
+      if (this.projectForm.name === '') {
+        this.$message.error('请填写项目名称!')
+        return;
+      } else if (this.projectForm.tags === '') {
+        this.$message.error('请选择项目标签!')
+        return;
+      } else if (this.projectForm.dictKey === '') {
+        this.$message.error('请选择项目行业分类!')
+        return;
+      }
       this.$refs.form.validate(valid => {
         if (valid) {
           this.disable = true
@@ -945,7 +962,8 @@ export default {
                 totalAmount: '',
                 projectType: '1589613582090166274',
                 tags: '',
-                introduction: ''
+                introduction: '',
+                dictKey: ''
               }
               this.onLoad()
             } else {
@@ -964,15 +982,15 @@ export default {
     },
     exportExcel(res, year) {
       const data = Object.assign(
-        { ...this.queryData },
-        {
-          columnName: res,
-          projectIds: this.selectList.map(ele => ele.id).join(','),
-          previewType: 1,
-          projectYear: year
-        }
+          {...this.queryData},
+          {
+            columnName: res,
+            projectIds: this.selectList.map(ele => ele.id).join(','),
+            previewType: 1,
+            projectYear: year
+          }
       )
-      this.$router.push({ query: data, path: '/home/excel' })
+      this.$router.push({query: data, path: '/home/excel'})
     },
     showReceipt(msg) {
       this.$confirm(msg, {
@@ -988,7 +1006,7 @@ export default {
         projectIds: this.selectList.map(ele => ele.id).join(','),
         previewType: 2
       }
-      this.$router.push({ query: dataIds, path: '/home/excel' })
+      this.$router.push({query: dataIds, path: '/home/excel'})
     }
   }
 }

+ 9 - 1
src/views/user/manage.vue

@@ -279,6 +279,10 @@ export default {
           })
     },
     beforeOpen(done, type) {
+      if (this.form.clientId.indexOf('project_web') === -1) {
+        this.$message.error('该账号已经停用,无需进行编辑!')
+        return
+      }
       if (type === 'edit') {
         this.userInfoForm.name = this.form.name
         this.userInfoForm.realName = this.form.realName
@@ -357,7 +361,11 @@ export default {
       let data = this.userInfoForm
       data.deptIds = data.deptIds.join(',')
       this.$api.role.roleSave(data).then(res => {
-        console.log(res)
+        if (res.code === 200) {
+          this.showEdit = false
+          this.$message.success(msg)
+          this.onLoad()
+        }
       })
     }
   }