From b4edf6ce42debe4edcc85414d9f6c0d41f480587 Mon Sep 17 00:00:00 2001
From: cuilei <ray_tsu1@163.com>
Date: 星期五, 20 六月 2025 11:36:06 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/mdc/base/modules/EquipmentList/UserModal.vue |  228 +++++++++++++++++---------------------------------------
 1 files changed, 70 insertions(+), 158 deletions(-)

diff --git a/src/views/mdc/base/modules/EquipmentList/UserModal.vue b/src/views/mdc/base/modules/EquipmentList/UserModal.vue
index a460738..b42763e 100644
--- a/src/views/mdc/base/modules/EquipmentList/UserModal.vue
+++ b/src/views/mdc/base/modules/EquipmentList/UserModal.vue
@@ -2,33 +2,25 @@
   <a-modal
     :title="title"
     :maskClosable="true"
-    :width="drawerWidth"
+    :width="modalWidth"
     @cancel="visible=false"
     :visible="visible"
     :footer="null"
+    centered
     style="height: 100%;overflow: auto;padding-bottom: 53px;">
 
-    <template slot="title">
-      <div style="width: 100%;">
-        <span>{{ title }}</span>
-        <span style="display:inline-block;width:calc(100% - 51px);padding-right:10px;text-align: right">
-          <a-button @click="toggleScreen" icon="appstore" style="height:20px;width:20px;border:0px"></a-button>
-        </span>
-      </div>
-
-    </template>
-
     <a-spin :spinning="confirmLoading">
-      <a-form-model ref="form" :form="form" :model="model" :rules="validatorRules">
+      <a-form-model ref="form" :form="form" :model="model" :rules="validatorRules" :labelCol="labelCol"
+                    :wrapperCol="wrapperCol">
         <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-model-item label="缁熶竴缂栫爜" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId">
+            <a-form-model-item label="缁熶竴缂栫爜" prop="equipmentId">
               <a-input-search v-model="model.equipmentId" :disabled="disableSubmit" @search="deviceSearch" enter-button
                               placeholder='璇烽�夋嫨缁熶竴缂栫爜'/>
             </a-form-model-item>
           </a-col>
           <a-col :span="12">
-            <a-form-model-item label="璁惧鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol">
+            <a-form-model-item label="璁惧鍚嶇О">
               <a-input :disabled="disableSubmit" allow-clear placeholder="璇疯緭鍏ヨ澶囧悕绉�"
                        v-model="model.equipmentName"/>
             </a-form-model-item>
@@ -37,29 +29,28 @@
 
         <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-model-item v-if="isDepartType == 0" label="閮ㄩ棬鍒嗛厤" :labelCol="labelCol" :wrapperCol="wrapperCol"
+            <a-form-model-item v-if="isDepartType == 0" label="閮ㄩ棬鍒嗛厤"
                                v-show="!departDisabled">
               <j-select-equipment-depart :disabled="disableSubmit" v-model="model.selectedDeparts" :multi="false"
                                          @back="backDepartInfo" :backDepart="true"
                                          :treeOpera="true"></j-select-equipment-depart>
             </a-form-model-item>
 
-            <a-form-model-item v-if="isDepartType == -1" label="璁惧绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-select :disabled="disableSubmit" placeholder="璇烽�夋嫨璁惧绫诲瀷"
+            <a-form-model-item v-if="isDepartType == -1" label="璁惧绫诲瀷">
+              <a-select :disabled="disableSubmit" placeholder="璇烽�夋嫨璁惧绫诲瀷" allow-clear
                         :triggerChange="true"
                         v-model="model.equipmentType">
-                <a-select-option v-for='item in selectList' :key='item.id' :value='item.equipmentTypeName'>
+                <a-select-option v-for='item in equipmentTypeList' :key='item.id' :value='item.equipmentTypeName'>
                   {{item.equipmentTypeName}}
                 </a-select-option>
               </a-select>
             </a-form-model-item>
           </a-col>
           <a-col :span="12">
-            <a-form-model-item label="杞﹂棿鍒嗛厤" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!productionDisabled"
+            <a-form-model-item label="杞﹂棿鍒嗛厤" v-show="!productionDisabled"
                                ref="selectedProduction" prop="selectedProduction">
-              <!--<j-select-equipment-production  v-decorator="['selectedProduction',{rules:[{required:true,message:'璇烽�夋嫨杞﹂棿!'}]}]" :multi="false" @back="backProductionInfo" :backProduction="true" :treeProductOpera="true"></j-select-equipment-production>-->
               <j-select-equipment-production :disabled="disableSubmit" v-model="model.selectedProduction" :multi="false"
-                                             @back="backProductionInfo" :backProduction="true"
+                                             @back="backProductionInfo" :backProduction="true" :allowClear="false"
                                              :treeProductOpera="true"></j-select-equipment-production>
             </a-form-model-item>
 
@@ -67,15 +58,15 @@
         </a-row>
         <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-model-item v-if="isDepartType == -1" label="绯荤粺鐗堟湰鍙�" :labelCol="labelCol" :wrapperCol="wrapperCol">
+            <a-form-model-item v-if="isDepartType == -1" label="绯荤粺鐗堟湰鍙�">
               <a-input :disabled="disableSubmit" allow-clear placeholder="璇疯緭鍏ョ郴缁熺増鏈彿"
                        v-model="model.systemVersion"/>
             </a-form-model-item>
-            <a-form-model-item v-if="isDepartType == 0" label="璁惧绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol">
+            <a-form-model-item v-if="isDepartType == 0" label="璁惧绫诲瀷">
               <a-select :disabled="disableSubmit" placeholder="璇烽�夋嫨璁惧绫诲瀷"
                         :triggerChange="true"
                         v-model="model.equipmentType">
-                <a-select-option v-for='item in selectList' :key='item.id' :value='item.equipmentTypeName'>
+                <a-select-option v-for='item in equipmentTypeList' :key='item.id' :value='item.equipmentTypeName'>
                   {{item.equipmentTypeName}}
                 </a-select-option>
               </a-select>
@@ -83,7 +74,7 @@
 
           </a-col>
           <a-col :span="12">
-            <a-form-model-item label="璁惧鍔熺巼(kw)" :labelCol="labelCol" :wrapperCol="wrapperCol">
+            <a-form-model-item label="璁惧鍔熺巼(kw)">
               <a-input :disabled="disableSubmit" allow-clear placeholder="璇疯緭鍏ヨ澶囧姛鐜�"
                        v-model="model.devicePower"/>
             </a-form-model-item>
@@ -92,13 +83,13 @@
 
         <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-model-item label="鏈哄簥IP" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-input :disabled="true"  placeholder="璇疯緭鍏ユ満搴奍P"
+            <a-form-model-item label="鏈哄簥IP">
+              <a-input :disabled="true" placeholder="璇疯緭鍏ユ満搴奍P"
                        v-model="model.equipmentIp"/>
             </a-form-model-item>
           </a-col>
           <a-col :span="12">
-            <a-form-model-item label="鏈哄簥绔彛" :labelCol="labelCol" :wrapperCol="wrapperCol">
+            <a-form-model-item label="鏈哄簥绔彛">
               <a-input :disabled="true" placeholder="璇疯緭鍏ユ満搴婄鍙�"
                        v-model="model.dataPort"/>
             </a-form-model-item>
@@ -107,15 +98,15 @@
 
         <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-model-item label="椹卞姩绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol">
+            <a-form-model-item label="椹卞姩绫诲瀷">
               <j-dict-select-tag :disabled="true" placeholder="璇烽�夋嫨椹卞姩绫诲瀷"
                                  :triggerChange="true" dictCode="mdc_driveType"
-                                 v-model="model.driveType" allow-clear/>
+                                 v-model="model.driveType"/>
             </a-form-model-item>
           </a-col>
           <a-col :span="12">
-            <a-form-model-item label="璁惧鍨嬪彿" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-input :disabled="true"  allow-clear placeholder="璇疯緭鍏ヨ澶囧瀷鍙�"
+            <a-form-model-item label="璁惧鍨嬪彿">
+              <a-input :disabled="true" allow-clear placeholder="璇疯緭鍏ヨ澶囧瀷鍙�"
                        v-model="model.equipmentModel"/>
             </a-form-model-item>
           </a-col>
@@ -123,29 +114,44 @@
 
         <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-model-item label="绯荤粺绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <j-dict-select-tag placeholder="璇烽�夋嫨绯荤粺绫诲瀷" :triggerChange="true" dictCode="system_type" :disabled="disableSubmit"
-                                 v-model="model.systemType" allow-clear/>
+            <a-form-model-item label="绯荤粺绫诲瀷">
+              <j-dict-select-tag placeholder="璇烽�夋嫨绯荤粺绫诲瀷" :triggerChange="true" dictCode="system_type"
+                                 :disabled="disableSubmit" v-model="model.systemType"/>
             </a-form-model-item>
           </a-col>
           <a-col :span="12">
-            <a-form-model-item label="璁惧绾у埆" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <j-dict-select-tag placeholder="璇烽�夋嫨璁惧绾у埆" dictCode="device_level" v-model="model.deviceLevel" :disabled="disableSubmit" allow-clear/>
+            <a-form-model-item label="璁惧绾у埆">
+              <j-dict-select-tag placeholder="璇烽�夋嫨璁惧绾у埆" dictCode="device_level" v-model="model.deviceLevel"
+                                 :disabled="disableSubmit"/>
             </a-form-model-item>
           </a-col>
         </a-row>
 
         <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-model-item label="璁惧绉嶇被" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <j-dict-select-tag placeholder="璇烽�夋嫨璁惧绉嶇被" dictCode="device_category" v-model="model.deviceCategory" :disabled="disableSubmit"
-                                 allow-clear/>
+            <a-form-model-item label="璁惧绉嶇被">
+              <j-dict-select-tag placeholder="璇烽�夋嫨璁惧绉嶇被" dictCode="device_category" v-model="model.deviceCategory"
+                                 :disabled="disableSubmit"/>
             </a-form-model-item>
           </a-col>
           <a-col :span="12">
-            <a-form-model-item label="鎺掑簭" :labelCol="labelCol" :wrapperCol="wrapperCol">
+            <a-form-model-item label="鎺掑簭">
               <a-input :disabled="disableSubmit" :readOnly="disableSubmit" placeholder="璇疯緭鍏ユ帓搴�"
                        v-model="model.sortNo" style="width: 100%"/>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+
+        <a-row :gutter="24">
+          <a-col :span='12'>
+            <a-form-model-item label="閰嶉�佸皬缁�" prop="teamCode">
+              <j-dict-select-tag placeholder="璇烽�夋嫨閰嶉�佸皬缁�" dictCode="mdc_staff_team" v-model="model.teamCode"
+                                 :disabled="disableSubmit"/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span='12'>
+            <a-form-model-item label="璁惧鍥剧墖">
+              <j-image-upload v-model="model.equipmentImage" :disabled="disableSubmit"/>
             </a-form-model-item>
           </a-col>
         </a-row>
@@ -165,7 +171,7 @@
 
         <a-row :gutter="24">
           <a-col :span='12'>
-            <a-form-model-item v-if="isDepartType == 0" label="绯荤粺鐗堟湰鍙�" :labelCol="labelCol" :wrapperCol="wrapperCol">
+            <a-form-model-item v-if="isDepartType == 0" label="绯荤粺鐗堟湰鍙�">
               <a-input :disabled="disableSubmit" :readOnly="disableSubmit" allow-clear placeholder="璇疯緭鍏ョ郴缁熺増鏈彿"
                        v-model="model.systemVersion"/>
             </a-form-model-item>
@@ -197,15 +203,9 @@
 
 <script>
   import pick from 'lodash.pick'
-  import moment from 'moment'
-  import Vue from 'vue'
-  import { ACCESS_TOKEN } from '@/store/mutation-types'
   import { getAction } from '@/api/manage'
   import { addEquipment, editEquipment } from '@/api/api'
-  import { disabledAuthFilter } from '@/utils/authFilter'
-  import { duplicateCheck } from '@/api/api'
   import JSelectEquipmentProduction from '../../../../../components/jeecgbiz/JSelectEquipmentProduction'
-  import JSelectProduction from '../../../../../components/jeecgbiz/JSelectProduction'
   import DeviceListModel from './DeviceListModal'
   import JSelectEquipmentDepart from '../../../../../components/jeecgbiz/JSelectEquipmentDepart'
   import { mapActions } from 'vuex'
@@ -213,7 +213,6 @@
   export default {
     name: 'UserModal',
     components: {
-      JSelectProduction,
       JSelectEquipmentDepart,
       JSelectEquipmentProduction,
       DeviceListModel
@@ -223,36 +222,14 @@
         departDisabled: false, //鏄惁鏄垜鐨勯儴闂ㄨ皟鐢ㄨ椤甸潰
         productionDisabled: false, //鏄惁鏄垜鐨勮溅闂磋皟鐢ㄨ椤甸潰
         roleDisabled: false, //鏄惁鏄鑹茬淮鎶よ皟鐢ㄨ椤甸潰
-        modalWidth: 800,
-        drawerWidth: 700,
-        modalToggleFlag: true,
-        confirmDirty: false,
+        modalWidth: 900,
         userId: '', //淇濆瓨鐢ㄦ埛id
-        // disableSubmit:false,
         disableSubmit: true,
-        dateFormat: 'YYYY-MM-DD',
         form: this.$form.createForm(this),
-
         validatorRules: {
-          // equipmentId: [{required: false, message: '璇烽�夋嫨璁惧缂栧彿!'}, {validator: this.validatequipmentId}],
-          equipmentId:
-            [
-              {
-                required: true, message: '璇烽�夋嫨璁惧缂栧彿!'
-              }
-              // {
-              // validator: this.validatequipmentId
-              // }
-            ],
-          // trigger: 'blur' // 瑙﹀彂鏂瑰紡
-
-          selectedProduction:
-            [
-              {
-                required: true, message: '璇烽�夋嫨杞﹂棿'
-              }
-            ]
-
+          equipmentId: [{ required: true, message: '璇烽�夋嫨璁惧缂栧彿!', trigger: 'change' }],
+          selectedProduction: [{ required: true, message: '璇烽�夋嫨杞﹂棿' }],
+          teamCode: [{ required: true, message: '璇烽�夋嫨閰嶉�佸皬缁�' }]
         },
         departIdShow: false,
         title: '鎿嶄綔',
@@ -286,43 +263,27 @@
           xs: { span: 24 },
           sm: { span: 19 }
         },
-        uploadLoading: false,
         confirmLoading: false,
-        headers: {},
         systemType: false,
         systemValue: '3',
         url: {
-          fileUpload: window._CONFIG['domianURL'] + '/sys/common/upload',
           userWithDepart: '/mdc/mdcEquipment/equipmentDepartList', // 寮曞叆涓烘寚瀹氱敤鎴锋煡鐪嬮儴闂ㄤ俊鎭渶瑕佺殑url
           //寮曞叆涓烘寚瀹氱敤鎴锋煡鐪嬭溅闂翠俊鎭渶瑕佺殑url
           userProductionList: '/mdc/mdcEquipment/equipmentProductionList',
-          userId: '/sys/user/generateUserId', // 寮曞叆鐢熸垚娣诲姞鐢ㄦ埛鎯呭喌涓嬬殑url
           syncUserByUserName: '/act/process/extActProcess/doSyncUserByUserName',//鍚屾鐢ㄦ埛鍒板伐浣滄祦
-          queryTenantList: '/sys/tenant/queryList',
           check: '/sys/duplicate/check',
           queryEquipmentType: '/mdc/mdcEquipmentType/queryEquipmentType'
         },
-        tenantsOptions: [],
-        rolesOptions: [],
         nextDepartOptions: [],
         nextProductionOptions: [],
-        selectList: [],
+        equipmentTypeList: [],
         isDepartType: ''
       }
     },
     created() {
-      const token = Vue.ls.get(ACCESS_TOKEN)
-      this.headers = { 'X-Access-Token': token }
       this.queryGroup()
       this.queryTreeData()
       this.getAppPlatformName()
-      // this.initRoleList()
-      // this.initTenantList()
-    },
-    computed: {
-      uploadAction: function() {
-        return this.url.fileUpload
-      }
     },
     methods: {
       ...mapActions(['QueryDepartTree']),
@@ -331,13 +292,11 @@
           if (res.success) {
             this.isDepartType = res.result[0].value
           } else {
-            // this.$message.warn(res.message)
             this.$notification.warning({
               message: '娑堟伅',
               description: res.message
             })
           }
-        }).finally(() => {
         })
       },
       getAppPlatformName() {
@@ -350,12 +309,8 @@
       queryGroup() {
         getAction(this.url.queryEquipmentType).then(res => {
           if (res.success) {
-            this.selectList = res.result
-            // this.selectList = res.result.map((item, index, arr) => {
-            //   return { label: item.id, value: item.equipmentTypeName + '' }
-            // })
+            this.equipmentTypeList = res.result
           } else {
-            // this.$message.warning(res.message)
             this.$notification.warning({
               message: '娑堟伅',
               description: res.message
@@ -366,7 +321,6 @@
         })
       },
       getDeviceRows(val) {
-        console.log(val)
         if (val.equipmentid) {
           this.model.equipmentId = val.equipmentid
           this.model.equipmentName = val.equipmentname
@@ -405,46 +359,28 @@
         //鏍规嵁灞忓箷瀹藉害鑷�傚簲鎶藉眽瀹藉害
         this.resetScreenSize()
 
-        // that.userId = record.id;
-        // console.log(record)
         if (record.systemValue != null) {
           this.systemValue = record.systemValue
         } else {
           this.systemValue = '3'
         }
         that.model = Object.assign({}, record)
-        // that.model = Object.assign({},{selectedroles:'',selectedProduction:''}, record);
-        // this.model = Object.assign({}, record)
 
         this.$nextTick(() => {
           this.form.setFieldsValue(pick(that.model, 'selectedDeparts', 'selectedProduction', 'equipmentId', 'equipmentName', 'equipmentModel', 'equipmentType', 'equipmentIp', 'dataPort',
             'driveType', 'sortNo', 'remark', 'systemVersion', 'devicePower', 'controlSystem', 'saveTableName', 'systemValue'))
         })
         if (record.hasOwnProperty('id')) {
-          // that.getUserRoles(record.id);
           that.getUserDeparts(record.id)
         }
-        // console.log('that.model=',that.model)
-      },
-      isDisabledAuth(code) {
-        return disabledAuthFilter(code)
-      },
-      //绐楀彛鏈�澶у寲鍒囨崲
-      toggleScreen() {
-        if (this.modalToggleFlag) {
-          this.modalWidth = window.innerWidth
-        } else {
-          this.modalWidth = 800
-        }
-        this.modalToggleFlag = !this.modalToggleFlag
       },
       // 鏍规嵁灞忓箷鍙樺寲,璁剧疆鎶藉眽灏哄
       resetScreenSize() {
         let screenWidth = document.body.clientWidth
-        if (screenWidth < 500) {
-          this.drawerWidth = screenWidth
+        if (screenWidth < 900) {
+          this.modalWidth = screenWidth
         } else {
-          this.drawerWidth = 700
+          this.modalWidth = 900
         }
       },
       getUserDeparts(userid) {
@@ -465,10 +401,7 @@
             }
 
             that.model.selectedDeparts = selectDepartKeys.join(',')
-            // that.model.selectedProduction = selectDepartKeys.join(",")
-
             that.nextDepartOptions = departOptions
-            // console.log('that.nextDepartOptions=',that.nextDepartOptions)
           }
         })
 
@@ -490,13 +423,11 @@
             that.model.selectedProduction = selectProductKeys.join(',')
 
             that.nextProductionOptions = ProductionOptions
-            // console.log('that.nextProductionOptions=',that.nextProductionOptions)
           }
         })
         //杞﹂棿鐨剈rl
       },
       backDepartInfo(info) {
-        // console.log(info)
         this.model.departIds = this.model.selectedDeparts
         this.nextDepartOptions = info.map((item, index, arr) => {
           let c = { label: item.text, value: item.value + '' }
@@ -504,7 +435,6 @@
         })
       },
       backProductionInfo(info) {
-        // console.log(info)
         this.model.productionIds = this.model.selectedProduction
         this.nextProductionOptions = info.map((item, index, arr) => {
           let c = { label: item.text, value: item.value + '' }
@@ -525,33 +455,27 @@
         this.nextDepartOptions = []
         this.nextProductionOptions = []
         this.departIdShow = false
-        // this.$refs.form.resetFields();
       },
-      moment,
       handleSubmit() {
         const that = this
         // 瑙﹀彂琛ㄥ崟楠岃瘉
         this.$refs.form.validate(valid => {
           if (valid) {
             that.confirmLoading = true
-            //濡傛灉鏄笂绾ф嫨浼犲叆departIds,鍚﹀垯涓虹┖
-            // if(this.model.userIdentity!==2){
-            //   this.model.departIds="";
-            // }
-            if (this.systemValue==null){
-              this.$message.warning('璇烽�夋嫨绯荤粺绫诲瀷!');
-              return false;
+            if (this.systemValue == null) {
+              this.$message.warning('璇烽�夋嫨绯荤粺绫诲瀷!')
+              return false
             }
-            let obj;
-            if(!this.model.id){
-              this.model.id = this.userId;
-              this.model.systemValue=this.systemValue;
-              obj=addEquipment(this.model);
-            }else{
-              this.model.systemValue=this.systemValue;
-              obj=editEquipment(this.model,{
-                        id: this.model.id
-                      });
+            let obj
+            if (!this.model.id) {
+              this.model.id = this.userId
+              this.model.systemValue = this.systemValue
+              obj = addEquipment(this.model)
+            } else {
+              this.model.systemValue = this.systemValue
+              obj = editEquipment(this.model, {
+                id: this.model.id
+              })
             }
             obj.then((res) => {
               if (res.success) {
@@ -574,18 +498,6 @@
             return false
           }
         })
-      },
-
-      handleConfirmBlur(e) {
-        const value = e.target.value
-        this.confirmDirty = this.confirmDirty || !!value
-      },
-      identityChange(e) {
-        if (e.target.value === 1) {
-          this.departIdShow = false
-        } else {
-          this.departIdShow = true
-        }
       },
       /**
        * 缂栬緫鎴栨煡鐪嬭鎯呮暟鎹椂娓呴櫎鎶藉眽琛ㄥ崟楠岃瘉

--
Gitblit v1.9.3