From 4d051089b33582019716598e7d700f20cdca16d2 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期四, 12 十月 2023 11:13:55 +0800
Subject: [PATCH] 	modified:   src/views/plan/customerorder/index.vue 	modified:   src/views/plan/customerorder/sample-customerorder-form.vue

---
 src/views/plan/customerorder/index.vue |  187 +++++++++++++++++++++++++---------------------
 1 files changed, 101 insertions(+), 86 deletions(-)

diff --git a/src/views/plan/customerorder/index.vue b/src/views/plan/customerorder/index.vue
index 1810399..24f2a0b 100644
--- a/src/views/plan/customerorder/index.vue
+++ b/src/views/plan/customerorder/index.vue
@@ -12,7 +12,7 @@
         ref="customerOrderTable"
       >
         <template #toolbar>
-          <el-dropdown
+          <!-- <el-dropdown
             v-if="permissions.customerorder_state_change"
             @command="handleCommand"
           >
@@ -23,11 +23,11 @@
               <el-dropdown-item
                 :command="item.command"
                 v-for="item in stateTagArr"
-                :disabled="item.disabled"
-                >{{ item.label }}</el-dropdown-item
-              >
+                :disabled="item.disabled">
+                {{ item.label }}
+              </el-dropdown-item>
             </el-dropdown-menu>
-          </el-dropdown>
+          </el-dropdown> -->
           <el-dropdown
             v-if="permissions.customerorder_doc_relate"
             @command="documentHandle"
@@ -64,19 +64,19 @@
               >
             </el-dropdown-menu>
           </el-dropdown>
-          <el-button
+          <!-- <el-button
             v-if="permissions.customerorder_push_otc"
             style="margin-left:10px;"
             type="primary"
             @click="pushOtc"
             >鎺ㄩ�丒RP</el-button
-          >
-          <el-button
+          > -->
+          <!-- <el-button
             style="margin-left:10px;"
             type="primary"
             @click="importOutPutBatch"
             >瀵煎叆浜у嚭鎵规</el-button
-          >
+          > -->
           <el-button
             style="margin-left:10px;"
             type="primary"
@@ -240,18 +240,18 @@
       </el-dialog>
     </basic-container>
 
-    <el-dialog title="閫夋嫨鍚屾鏃ユ湡" :visible.sync="syncDateVisible" width="30%">
+    <el-dialog title="閫夋嫨鍚屾鏃ユ湡" :visible.sync="syncDateVisible" width="20%">
       <div style="display: flex;justify-content: center">
-        <el-date-picker
-          v-model="syncDate"
-          type="daterange"
-          value-format="yyyy-MM-dd"
-          range-separator="鑷�"
-          start-placeholder="寮�濮嬫棩鏈�"
-          end-placeholder="缁撴潫鏃ユ湡"
-          :picker-options="pickerOptions"
-        >
-        </el-date-picker>
+        <el-form :model="dataForm" :inline="true" :rules="dataRule" ref="dataForm" class="l-mes">
+          <el-form-item label="鏃ユ湡">
+            <el-date-picker
+              v-model="dataForm.selectTime"
+              type="datetime"
+              placeholder="閫夋嫨鏃ユ湡鏃堕棿"
+              value-format="yyyy-MM-dd HH:mm:ss">
+            </el-date-picker>
+          </el-form-item>
+        </el-form>
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button @click="syncDateVisible = false">鍙� 娑�</el-button>
@@ -273,6 +273,7 @@
 import MpsRequirements from './mps-requirements'
 import SalesPartBatchDialog from './sales-part-batch.vue'
 import CustomerorderReturnDialog from './customerorder-return.vue'
+import { otcCustomerOrderSync } from '@/api/plan/customerorder'
 import {
   delCustomerOrder,
   fetchListCustomerOrder,
@@ -300,6 +301,10 @@
 export default {
   data() {
     return {
+      dataForm: {
+        selectTime: null
+      },
+      dataRule: {},
       pickerOptions: {
         onPick: ({ maxDate, minDate }) => {
           if (minDate && this.pickerMinDate) {
@@ -1006,24 +1011,24 @@
         ],
         toolbar: [],
         operator: [
-          {
-            text: '璁㈠崟璇存槑',
-            type: 'text',
-            size: 'small',
-            fun: this.openCustomerOrder
-          },
-          {
-            text: '鏌ョ湅搴撳瓨',
-            type: 'text',
-            size: 'small',
-            fun: this.stockHandle
-          },
-          {
-            text: '绠辩爜淇℃伅瀵煎嚭',
-            type: 'text',
-            size: 'small',
-            fun: this.packageExportHandle
-          },
+          // {
+          //   text: '璁㈠崟璇存槑',
+          //   type: 'text',
+          //   size: 'small',
+          //   fun: this.openCustomerOrder
+          // },
+          // {
+          //   text: '鏌ョ湅搴撳瓨',
+          //   type: 'text',
+          //   size: 'small',
+          //   fun: this.stockHandle
+          // },
+          // {
+          //   text: '绠辩爜淇℃伅瀵煎嚭',
+          //   type: 'text',
+          //   size: 'small',
+          //   fun: this.packageExportHandle
+          // },
           {
             text: '浣滃簾',
             type: 'text',
@@ -1222,25 +1227,25 @@
         permitArr: []
       })
     }
-    if (this.permissions.customerorder_ifs_line) {
-      this.table.toolbar.push({
-        text: '鑾峰彇ERP琛屽彿',
-        type: 'primary',
-        fun: this.pullIfsLineNo,
-        disabled: false,
-        permitArr: [],
-        loading: false
-      })
-    }
+    // if (this.permissions.customerorder_ifs_line) {
+    //   this.table.toolbar.push({
+    //     text: '鑾峰彇ERP琛屽彿',
+    //     type: 'primary',
+    //     fun: this.pullIfsLineNo,
+    //     disabled: false,
+    //     permitArr: [],
+    //     loading: false
+    //   })
+    // }
     if (this.permissions.customerorder_submit_oa) {
-      this.table.toolbar.push({
-        text: '鎻愪氦瀹℃牳',
-        type: 'primary',
-        fun: this.auditCustomerOrder,
-        disabled: false,
-        permitArr: [],
-        loading: false
-      })
+      // this.table.toolbar.push({
+      //   text: '鎻愪氦瀹℃牳',
+      //   type: 'primary',
+      //   fun: this.auditCustomerOrder,
+      //   disabled: false,
+      //   permitArr: [],
+      //   loading: false
+      // })
     }
     if (this.permissions.customerorder_set_salesparts) {
       this.table.toolbar.push({
@@ -1269,7 +1274,7 @@
           prop: 'coState',
           searchInfoType: 'select',
           // propVal: '01partUnCheck'
-          propVal: '02technologyUnCheck'
+          // propVal: '02technologyUnCheck'
         })
       )
       this.$refs.customerOrderTable.setQueryParam(queryParam)
@@ -1288,18 +1293,19 @@
     },
     // 鍒涘缓涓荤敓浜ц鍒�
     masterPlanHandle() {
+      console.log(this.multipleSelection);
       if (this.multipleSelection && this.multipleSelection.length > 0) {
         if (this.judgeCoState(this.multipleSelection)) {
           // 鍒ゆ柇涓�涓嬪墿浣欐暟閲忔槸鍚﹀ぇ浜�0
           for (let i = 0, len = this.multipleSelection.length; i < len; i++) {
-            if (
-              this.multipleSelection[i].buyQtyDue -
-                this.multipleSelection[i].requireNumber <=
-              0
-            ) {
-              this.$message.error('璇烽�夊簱瀛樻暟閲忓ぇ浜庡凡涓嬪彂鏁伴噺鐨勯攢鍞鍗�')
-              return
-            }
+            // if (
+            //   this.multipleSelection[i].buyQtyDue -
+            //     this.multipleSelection[i].requireNumber <=
+            //   0
+            // ) {
+            //   this.$message.error('璇烽�夊簱瀛樻暟閲忓ぇ浜庡凡涓嬪彂鏁伴噺鐨勯攢鍞鍗�')
+            //   return
+            // }
             if (
               !(
                 this.multipleSelection[i].isAudit != null &&
@@ -1942,28 +1948,37 @@
       this.syncDateVisible = false
       this.table.toolbar.find((e) => e.text === '鑾峰彇閿�鍞鍗�').loading = true
 
-      syncOrder({
-        startTime: this.syncDate[0],
-        endTime: this.syncDate[1]
-      })
-        .then((res) => {
-          this.table.toolbar.find(
-            (e) => e.text === '鑾峰彇閿�鍞鍗�'
-          ).loading = false
-          const resData = res.data
-          if (resData.code === 0) {
-            this.$message.success(resData.data)
-            this.getData()
-          } else {
-            this.$message.error('鍚屾澶辫触')
-          }
+      if (this.dataForm.selectTime != null && this.dataForm.selectTime != '') {
+        otcCustomerOrderSync({
+          selectTime: this.dataForm.selectTime,
+          pathCode: '1'
         })
-        .catch((e) => {
-          this.table.toolbar.find(
-            (e) => e.text === '鑾峰彇閿�鍞鍗�'
-          ).loading = false
-          this.$forceUpdate()
-        })
+          .then((response) => {
+            this.table.toolbar.find(
+              (e) => e.text === '鑾峰彇閿�鍞鍗�'
+            ).loading = false
+            const resData = response.data
+            if (resData.code === 0) {
+              this.$message.success('鎷夊彇閿�鍞鍗曟垚鍔燂紱' + resData.msg)
+              this.dataForm.selectTime = null
+              this.$emit('refreshDataList')
+              this.getData()
+            } else {
+              this.$message.success('鎷夊彇閿�鍞鍗曞け璐�')
+            }
+          })
+          .catch((e) => {
+            this.table.toolbar.find(
+              (e) => e.text === '鑾峰彇閿�鍞鍗�'
+            ).loading = false
+            this.$forceUpdate()
+          })
+      } else {
+        this.table.toolbar.find(
+          (e) => e.text === '鑾峰彇閿�鍞鍗�'
+        ).loading = false
+        this.$message.error('璇峰厛閫夋嫨鏃ユ湡')
+      }
     }
   }
 }

--
Gitblit v1.9.3