From d71436544198b7b051115662fc9cf4b12ce0cda3 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 19 七月 2022 18:32:40 +0800
Subject: [PATCH] 1.修改bug

---
 src/views/zzmx/chda.vue |   96 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 95 insertions(+), 1 deletions(-)

diff --git a/src/views/zzmx/chda.vue b/src/views/zzmx/chda.vue
index 8a2f8b8..92c73c2 100644
--- a/src/views/zzmx/chda.vue
+++ b/src/views/zzmx/chda.vue
@@ -80,7 +80,25 @@
       <el-divider />
       <div style="margin-left: 10px;display: flex">
         <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
-        <el-button type="primary" icon="el-icon-office-building" @click="office">鍗曚綅</el-button>
+        <!--        <el-button type="primary" icon="el-icon-office-building" @click="office">鍗曚綅</el-button>-->
+        <el-button
+          type="primary"
+          icon="el-icon-refresh-right"
+          @click="syncSeaveSearchUnit"
+        >鍚屾璁¢噺鍗曚綅
+        </el-button>
+        <el-button
+          type="primary"
+          icon="el-icon-refresh-right"
+          @click="syncInventoryFileSelect"
+        >鍚屾瀛樿揣妗f
+        </el-button>
+        <el-button
+          type="primary"
+          icon="el-icon-refresh-right"
+          @click="syncStockTypeSelect"
+        >鍚屾瀛樿揣绫诲瀷
+        </el-button>
         <!--        <el-button type="primary" icon="el-icon-upload2" @click="upload">瀵煎叆</el-button>-->
       </div>
       <el-divider />
@@ -558,6 +576,7 @@
   UomSearch, UomSelect
 } from '@/api/zzmx'
 import $ from 'jquery'
+import { SeaveSearchErpOrder, SeaveSearchInventory, SeaveSearchInventoryClass, SeaveSearchUnit } from '@/api/ErpSyncMes'
 
 const SER_HZ = /^[\u4e00-\u9fa5]+$/
 export default {
@@ -682,6 +701,77 @@
     this.getHeight()
   },
   methods: {
+    // 鍚屾璁¢噺鍗曚綅
+    async syncSeaveSearchUnit() {
+      const loading = this.$loading({
+        lock: true,
+        text: '姝e湪鍚屾璁¢噺鍗曚綅锛岃绋嶇瓑...',
+        spinner: 'el-icon-loading',
+        customClass: 'osloading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      })
+      const res = await SeaveSearchUnit()
+      if (res.code === '200') {
+        setTimeout(() => {
+          // this.getInventoryFileSelect()
+          this.officeTableData = res.data
+          console.log(this.officeTableData, 9)
+          loading.close()
+          this.$message.success('鍚屾鎴愬姛锛�')
+        }, 2000)
+      } else {
+        setTimeout(() => {
+          loading.close()
+          this.$message.error('鍚屾澶辫触锛�')
+        }, 10000)
+      }
+    },
+    // 鍚屾瀛樿揣妗f
+    async  syncInventoryFileSelect() {
+      const loading = this.$loading({
+        lock: true,
+        text: '姝e湪鍚屾瀛樿揣妗f锛岃绋嶇瓑...',
+        spinner: 'el-icon-loading',
+        customClass: 'osloading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      })
+      const res = await SeaveSearchInventory()
+      if (res.code === '200') {
+        setTimeout(() => {
+          this.getInventoryFileSelect()
+          loading.close()
+          this.$message.success('鍚屾鎴愬姛锛�')
+        }, 2000)
+      } else {
+        setTimeout(() => {
+          loading.close()
+          this.$message.error('鍚屾澶辫触锛�')
+        }, 10000)
+      }
+    },
+    // 鍚屾瀛樿揣绫诲瀷
+    async syncStockTypeSelect() {
+      const loading = this.$loading({
+        lock: true,
+        text: '姝e湪鍚屾瀛樿揣绫诲瀷锛岃绋嶇瓑...',
+        spinner: 'el-icon-loading',
+        customClass: 'osloading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      })
+      const res = await SeaveSearchInventoryClass()
+      if (res.code === '200') {
+        setTimeout(() => {
+          this.getStockTypeSelect()
+          loading.close()
+          this.$message.success('鍚屾鎴愬姛锛�')
+        }, 2000)
+      } else {
+        setTimeout(() => {
+          loading.close()
+          this.$message.error('鍚屾澶辫触锛�')
+        }, 10000)
+      }
+    },
     async getInventoryFileSelect() {
       const res = await InventoryFileSelect(this.form)
       this.tableData = res.data
@@ -803,6 +893,10 @@
     },
     // 瀵硅瘽妗嗙‘璁�
     dialogVisibleConfirm() {
+      if (this.defaultroute_codeArr.length > 0 && this.defaultroute_code === '') {
+        return this.$message.info('榛樿宸ヨ壓璺嚎涓嶈兘涓虹┖锛�')
+      }
+
       this.$refs.dialogForm.validate(valid => {
         if (valid) {
           const data = {

--
Gitblit v1.9.3