From 7e0c515f1170d41a62dc73c1ea7c6cb4e40ce3c9 Mon Sep 17 00:00:00 2001
From: cuijian <cuijian@xalxzn.com>
Date: 星期六, 28 六月 2025 21:58:33 +0800
Subject: [PATCH] 供应商管理、线边库管理、产线人员绑定

---
 src/views/base/FactoryManager.vue |  159 ++++++++--------------------------------------------
 1 files changed, 26 insertions(+), 133 deletions(-)

diff --git a/src/views/base/FactoryManager.vue b/src/views/base/FactoryManager.vue
index d0048aa..c2f7347 100644
--- a/src/views/base/FactoryManager.vue
+++ b/src/views/base/FactoryManager.vue
@@ -7,11 +7,11 @@
         <a-row style="margin-left: 14px">
           <a-button @click="handleAdd(1)" type="primary">娣诲姞杞﹂棿</a-button>
           <a-button @click="handleAdd(2)" type="primary">娣诲姞涓嬬骇</a-button>
-          <a-button type="primary" icon="download" @click="handleExportXls('杞﹂棿淇℃伅')">瀵煎嚭</a-button>
+          <!-- <a-button type="primary" icon="download" @click="handleExportXls('杞﹂棿淇℃伅')">瀵煎嚭</a-button>
           <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader"
                     :action="importExcelUrl" @change="handleImportExcel">
             <a-button type="primary" icon="import">瀵煎叆</a-button>
-          </a-upload>
+          </a-upload> -->
           <a-button @click="handleDelete" v-if="selectedKeys.length>0">鍒犻櫎</a-button>
           <a-button title="鍒犻櫎澶氭潯鏁版嵁" @click="batchDel" v-if="checkedKeys.length>0">鎵归噺鍒犻櫎</a-button>
           <!--<a-button @click="refresh" type="default" icon="reload" :loading="loading">鍒锋柊</a-button>-->
@@ -27,38 +27,11 @@
           <a-input-search @search="onSearch" style="width:100%;margin-top: 10px" placeholder="璇疯緭鍏ヨ溅闂村悕绉�"/>
           <!-- 鏍�-->
           <a-col :md="10" :sm="24">
-            <!--<template>-->
-            <!--<a-dropdown :trigger="[this.dropTrigger]" @visibleChange="dropStatus">-->
-            <!--<span style="user-select: none">-->
-            <!--<a-tree-->
-            <!--checkable-->
-            <!--multiple-->
-            <!--@select="onSelect"-->
-            <!--@check="onCheck"-->
-            <!--@rightClick="rightHandle"-->
-            <!--:selectedKeys="selectedKeys"-->
-            <!--:checkedKeys="checkedKeys"-->
-            <!--:treeData="factoryTree"-->
-            <!--:checkStrictly="checkStrictly"-->
-            <!--:expandedKeys="iExpandedKeys"-->
-            <!--:autoExpandParent="autoExpandParent"-->
-            <!--@expand="onExpand"/>-->
-            <!--</span>-->
-            <!--&lt;!&ndash;鏂板鍙抽敭鐐瑰嚮浜嬩欢,鍜屽鍔犳坊鍔犲拰鍒犻櫎鍔熻兘&ndash;&gt;-->
-
-            <!--<a-menu slot="overlay">-->
-            <!--<a-menu-item @click="handleAdd(3)" key="1">娣诲姞</a-menu-item>-->
-            <!--<a-menu-item @click="handleDelete" key="2">鍒犻櫎</a-menu-item>-->
-            <!--<a-menu-item @click="closeDrop" key="3">鍙栨秷</a-menu-item>-->
-            <!--</a-menu>-->
-            <!--</a-dropdown>-->
-            <!--</template>-->
             <a-tree
               checkable
               multiple
               @select="onSelect"
               @check="onCheck"
-              @rightClick="rightHandle"
               :selectedKeys="selectedKeys"
               :checkedKeys="checkedKeys"
               :treeData="factoryTree"
@@ -128,9 +101,17 @@
           </a-card>
         </a-tab-pane>
 
-        <!-- <a-tab-pane tab="璁惧鍒楄〃" key="2" forceRender>
-          <factory-equipment ref="departAuth"></factory-equipment>
-        </a-tab-pane> -->
+        <a-tab-pane tab="浜哄憳鍒楄〃" key="2" forceRender>
+          <user-factory ref="userFactory"></user-factory>
+          <!-- <a-card v-if="factoryCategory == '3'">
+            <user-factory ref="userFactory"></user-factory>
+          </a-card>
+           <a-card v-else>
+            <a-empty>
+              <span slot="description"> 璇峰厛閫夋嫨涓�涓骇绾�! </span>
+            </a-empty>
+          </a-card> -->
+        </a-tab-pane>
       </a-tabs>
 
     </a-col>
@@ -138,7 +119,7 @@
   </a-row>
 </template>
 <script>
-  import FactoryEquipment from './modules/FactoryManager/FactoryEquipment'
+  import UserFactory from './modules/FactoryManager/UserFactory'
   import { queryFactoryTreeList, searchByKeywords, deleteByFactory } from '@/api/api'
   import { httpAction, deleteAction } from '@/api/manage'
   import { JeecgListMixin } from '@/mixins/JeecgListMixin'
@@ -148,7 +129,7 @@
     name: 'FactoryManager',
     mixins: [JeecgListMixin],
     components: {
-      FactoryEquipment,
+      UserFactory,
       FactoryModal
     },
     data() {
@@ -162,16 +143,10 @@
         treeData: [],
         visible: false,
         factoryTree: [],
-        rightClickSelectedKey: '',
-        rightClickSelectedOrgCode: '',
         hiding: true,
         model: {},
-        dropTrigger: '',
-        depart: {},
-        disableSubmit: false,
         checkedKeys: [],
         selectedKeys: [],
-        autoIncr: 1,
         currSelected: {},
         allTreeKeys: [],
         checkStrictly: true,
@@ -198,7 +173,8 @@
           importExcelUrl: '/base/factory/importExcel'
         },
         orgCategoryDisabled: false,
-        isIncludesNotLeaf: false
+        isIncludesNotLeaf: false,
+        factoryCategory:''
       }
     },
     computed: {
@@ -216,7 +192,6 @@
         that.factoryTree = []
         queryFactoryTreeList().then((res) => {
           if (res.success) {
-            //閮ㄩ棬鍏ㄩ�夊悗锛屽啀娣诲姞閮ㄩ棬锛岄�変腑鏁伴噺澧炲
             this.allTreeKeys = []
             for (let i = 0; i < res.result.length; i++) {
               let temp = res.result[i]
@@ -224,7 +199,6 @@
               that.factoryTree.push(temp)
               that.setThisExpandedKeys(temp)
               that.getAllKeys(temp)
-              // console.log(temp.id)
             }
             this.loading = false
           }
@@ -242,40 +216,14 @@
         this.loading = true
         this.loadTree()
       },
-      // 鍙抽敭鎿嶄綔鏂规硶
-      rightHandle({ event, node }) {
-        this.dropTrigger = 'contextmenu'
-        const record = node.dataRef
-        this.rightClickSelectedKey = record.id
-        this.rightClickSelected = record
-        this.rightClickSelectedOrgCode = record.orgCode
-      },
       onExpand(expandedKeys) {
-        console.log('onExpand', expandedKeys)
         this.iExpandedKeys = expandedKeys
         this.autoExpandParent = false
       },
-      backFlowList() {
-        this.$router.back(-1)
-      },
-      // 鍙抽敭鐐瑰嚮涓嬫媺妗嗘敼鍙樹簨浠�
-      dropStatus(visible) {
-        if (visible == false) {
-          this.dropTrigger = ''
-        }
-      },
-      // 鍙抽敭涓嬫媺鍏抽棴涓嬫媺妗�
-      closeDrop() {
-        this.dropTrigger = ''
-      },
-      addRootNode() {
-        this.$refs.nodeModal.add(this.currFlowId, '')
-      },
+     
       batchDel: function() {
-        console.log(this.checkedKeys)
         this.isIncludesNotLeaf = false
         this.includesNotLeaf(this.factoryTree)
-        console.log('isIncludesNotLeaf', this.isIncludesNotLeaf)
 
         // 涓簍rue鍒欒〃绀洪�変腑椤瑰寘鍚潪鍙跺瓙缁撶偣 false鍒欒〃绀洪�変腑椤瑰潎涓哄彾瀛愮粨鐐�
         if (!this.isIncludesNotLeaf) {
@@ -355,17 +303,7 @@
         }
 
       },
-      nodeModalOk() {
-        this.loadTree()
-      },
-      nodeModalClose() {
-      },
-      hide() {
-        console.log(111)
-        this.visible = false
-      },
       onCheck(checkedKeys, info) {
-        console.log('onCheck', checkedKeys, info)
         this.hiding = false
         //---- author:os_chengtgen -- date:20190827 --  for:鍒囨崲鐖跺瓙鍕鹃�夋ā寮� =======------
         if (this.checkStrictly) {
@@ -376,17 +314,20 @@
         //---- author:os_chengtgen -- date:20190827 --  for:鍒囨崲鐖跺瓙鍕鹃�夋ā寮� =======------
       },
       onSelect(selectedKeys, e) {
-        console.log('selected', selectedKeys, e)
         this.hiding = false
         this.deleteTrigger = 'leftClick'
         let record = e.node.dataRef
-        console.log('onSelect-record', record)
+        this.factoryCategory = record.factoryCategory
         this.currSelected = Object.assign({}, record)
         this.model = this.currSelected
         this.selectedKeys = [record.key]
         this.model.parentId = record.parentId
         this.setValuesToForm(record)
-        this.$refs.departAuth.show(record.id)
+        if(record.factoryCategory == '3'){
+          this.$refs.userFactory.show(record.id)
+        }else{
+          this.$refs.userFactory.factoryId = ''
+        }
       },
       // 瑙﹀彂onSelect浜嬩欢鏃�,涓洪儴闂ㄦ爲鍙充晶鐨刦orm琛ㄥ崟璧嬪��
       setValuesToForm(record) {
@@ -404,16 +345,7 @@
         this.checkedKeys = []
         this.currSelected = {}
         this.selectedKeys = []
-        this.$refs.departAuth.departId = ''
-      },
-      handleNodeTypeChange(val) {
-        this.currSelected.nodeType = val
-      },
-      notifyTriggerTypeChange(value) {
-        this.currSelected.notifyTriggerType = value
-      },
-      receiptTriggerTypeChange(value) {
-        this.currSelected.receiptTriggerType = value
+        this.$refs.userFactory.departId = ''
       },
       submitCurrForm() {
         this.$refs.form.validate(valid => {
@@ -450,22 +382,11 @@
         this.$refs.form.resetFields()
         this.model = {}
       },
-      nodeSettingFormSubmit() {
-        this.$refs.form.validate(valid => {
-          if (valid) {
-            console.log('Received values of form: ', this.model)
-          }
-        })
-      },
-      openSelect() {
-        this.$refs.sysDirectiveModal.show()
-      },
       handleAdd(num) {
         if (num == 1) {
           this.$refs.departModal.add()
           this.$refs.departModal.title = '鏂板'
         } else if (num == 2) {
-          console.log(this.currSelected)
           let key = this.currSelected.key
           if (!key) {
             // this.$message.warning('璇峰厛鐐瑰嚮閫変腑涓婄骇杞﹂棿锛�')
@@ -487,7 +408,7 @@
         if (this.currSelected.leaf) {
           this.$confirm({
             title: '纭鍒犻櫎',
-            content: `纭畾瑕佸垹闄� ${that.currSelected.productionName} 鍚�?`,
+            content: `纭畾瑕佸垹闄� ${that.currSelected.factoryName} 鍚�?`,
             onOk: function() {
               deleteByFactory({ id: that.currSelected.id }).then((resp) => {
                 if (resp.success) {
@@ -499,13 +420,8 @@
                     description: '鍒犻櫎鎴愬姛'
                   })
                   that.loadTree()
-                  //鍒犻櫎鍚庡悓姝ユ竻绌哄彸渚у熀鏈俊鎭唴瀹�
-                  // let orgCode=that.model.orgCode;
-                  // if(orgCode && orgCode === that.rightClickSelectedOrgCode){
                   that.onClearSelected()
-                  // }
                 } else {
-                  // that.$message.warning('鍒犻櫎澶辫触!')
                   that.$notification.warning({
                     message: '娑堟伅',
                     description: '鍒犻櫎澶辫触'
@@ -519,28 +435,6 @@
             message: '娑堟伅',
             description: '姝よ溅闂村凡鎸傝浇瀛愯妭鐐�'
           })
-        }
-        console.log('deletedRecord', deletedRecord)
-      },
-      selectDirectiveOk(record) {
-        console.log('閫変腑鎸囦护鏁版嵁', record)
-        this.nodeSettingForm.setFieldsValue({ directiveCode: record.directiveCode })
-        this.currSelected.sysCode = record.sysCode
-      },
-      getFlowGraphData(node) {
-        this.graphDatasource.nodes.push({
-          id: node.id,
-          text: node.flowNodeName
-        })
-        if (node.children.length > 0) {
-          for (let a = 0; a < node.children.length; a++) {
-            let temp = node.children[a]
-            this.graphDatasource.edges.push({
-              source: node.id,
-              target: temp.id
-            })
-            this.getFlowGraphData(temp)
-          }
         }
       },
       //---- author:os_chengtgen -- date:20190827 --  for:鍒囨崲鐖跺瓙鍕鹃�夋ā寮� =======------
@@ -566,7 +460,6 @@
         }
       },
       getAllKeys(node) {
-        // console.log('node',node);
         this.allTreeKeys.push(node.key)
         if (node.children && node.children.length > 0) {
           for (let a = 0; a < node.children.length; a++) {

--
Gitblit v1.9.3