From dc1879fd0713eed48b2c75af5f29a1085291d276 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 07 五月 2024 14:40:55 +0800
Subject: [PATCH] 1.文件替换

---
 src/views/materialManager/inventoryList.vue |   66 +++++++++++++++++++++++++++-----
 1 files changed, 55 insertions(+), 11 deletions(-)

diff --git a/src/views/materialManager/inventoryList.vue b/src/views/materialManager/inventoryList.vue
index 7d4a5d4..30808b4 100644
--- a/src/views/materialManager/inventoryList.vue
+++ b/src/views/materialManager/inventoryList.vue
@@ -61,8 +61,12 @@
         <div
           style=" width:calc(100% - 300px);"
         >
-          <div class="bodyTopButtonGroup">
+          <div class="bodyTopButtonGroup" style="justify-content: space-between">
             <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
+            <div style="display: flex">
+              <el-button v-waves type="success" icon="el-icon-download" @click="$router.push('./../systemSetting/dataImport?fileCode=8')">瀵煎叆</el-button>
+              <el-button v-waves icon="el-icon-refresh-right" @click="syncERP">鍚屾瀛樿揣妗f</el-button>
+            </div>
           </div>
 
           <div class="bodyTopFormGroup">
@@ -160,8 +164,9 @@
               <el-table-column
                 prop="partname"
                 label="瀛樿揣鍚嶇О"
-                width="110"
                 sortable="custom"
+                show-tooltip-when-overflow
+                min-width="200"
               />
               <el-table-column
                 prop="partspec"
@@ -199,7 +204,6 @@
                   <el-tag v-if="row.status==='1'" size="small" type="danger">鍋滅敤</el-tag>
                 </template>
               </el-table-column>
-
               <el-table-column
                 label="瀛樿揣灞炴��"
                 sortable="custom"
@@ -213,12 +217,12 @@
                   {{ row.isMadeRequest === '1' ? '濮斿' : '' }}
                 </template>
               </el-table-column>
-              <el-table-column
-                label="鏁版嵁鏉ユ簮"
-                prop="data_sources"
-                sortable="custom"
-                width="110"
-              />
+              <!--              <el-table-column-->
+              <!--                label="鏁版嵁鏉ユ簮"-->
+              <!--                prop="data_sources"-->
+              <!--                sortable="custom"-->
+              <!--                width="110"-->
+              <!--              />-->
               <el-table-column
                 label="鍒涘缓浜哄憳"
                 prop="lm_user"
@@ -571,7 +575,8 @@
   TMaterielData, TMaterielDelete
 } from '@/api/ProductModel'
 import arrayToTree from 'array-to-tree'
-import { UnitSerch } from '@/api/GeneralBasicData'
+import { UnitSerch, WareHouse } from '@/api/GeneralBasicData'
+import { SaveSearchMateriel_Info } from '@/api/ErpSyncMes'
 
 export default {
   name: 'RoleList',
@@ -697,13 +702,20 @@
 
       const { data: res2 } = await UnitSerch({ tunittype: 'S' })
       this.unitcodeSingleArr = res2
+
+      const { data: res3 } = await WareHouse()
+      this.idwarehouseArr = res3
     },
+
     async getTMaterielClassTree() {
       const res = await TMaterielClassTree()
       res.data.forEach(i => {
         i.idparent = i.idparent ? i.idparent : '-1'
       })
       this.treeLeftArr = res.data
+      this.treeLeftArr.forEach(e => {
+        e.name = e.code + ' ' + e.name
+      })
       this.treeLeft = arrayToTree(this.treeLeft.concat(res.data), {
         parentProperty: 'idparent',
         customID: 'code',
@@ -863,6 +875,9 @@
     dialogVisibleConfirm() {
       this.$refs.dialogForm.validate(valid => {
         if (valid) {
+          if (!(this.dialogForm.isPurchase || this.dialogForm.isSale || this.dialogForm.isMadeSelf || this.dialogForm.isMaterial || this.dialogForm.isMadeRequest)) {
+            return this.$message.info('瀛樿揣灞炴�т笉鑳戒负绌猴紒')
+          }
           this.dialogForm.isPurchase = this.dialogForm.isPurchase ? '1' : '0'
           this.dialogForm.isSale = this.dialogForm.isSale ? '1' : '0'
           this.dialogForm.isMadeSelf = this.dialogForm.isMadeSelf ? '1' : '0'
@@ -906,7 +921,7 @@
     treeEditClick(node, data, operation) {
       this.dialogClassForm.data_sources = data.data_sources
       this.dialogClassForm.inventoryclasscode = data.code
-      this.dialogClassForm.inventoryclassname = data.name
+      this.dialogClassForm.inventoryclassname = data.name.split(' ')[1]
       this.dialogClassForm.parentcode = data.idparent === '-1' ? '' : data.idparent
       this.dialogClassForm.OperType = 'Update'
       this.operation = operation
@@ -1008,6 +1023,35 @@
         this.dialogForm.idUnitBySale = mainUnitCode
         this.dialogForm.idunitbymanufacture = mainUnitCode
       }
+    },
+    // 鍚屾ERP
+    syncERP() {
+      const loading = this.$loading({
+        lock: true,
+        text: '姝e湪鍚屾ERP锛岃绋嶇瓑...',
+        spinner: 'el-icon-loading',
+        customClass: 'osloading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      })
+
+      SaveSearchMateriel_Info().then(res => {
+        if (res.code === '200') {
+          setTimeout(() => {
+            this.getTMaterielData(this.$refs.treeLeftRef.getCurrentNode())
+            this.getTMaterielClassTree()
+            loading.close()
+            this.$notify.success('鍚屾鎴愬姛锛�')
+          }, 2000)
+        }
+        // else if (res.code === '300') {
+        //   setTimeout(() => {
+        //     loading.close()
+        //     this.$message.error('鍚屾澶辫触锛�')
+        //   }, 10000)
+        // }
+      }).catch(e => {
+        loading.close()
+      })
     }
   }
 }

--
Gitblit v1.9.3