From 68eaf315b64145e487d10e66183d542ee7f94d10 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 05 七月 2022 17:35:33 +0800
Subject: [PATCH] 1.生产管理完成部分功能2.自定义页面打印、二维码图形、水印显示实现了一个demo

---
 src/views/scgl/scdd.vue |   87 ++++++++++++++++++++-----------------------
 1 files changed, 41 insertions(+), 46 deletions(-)

diff --git a/src/views/scgl/scdd.vue b/src/views/scgl/scdd.vue
index a063c82..0a366ff 100644
--- a/src/views/scgl/scdd.vue
+++ b/src/views/scgl/scdd.vue
@@ -31,15 +31,6 @@
 
             <el-form-item label="浜у搧缂栫爜" style=" display: flex;">
               <el-input v-model="form.partcode" style="width: 200px" placeholder="璇疯緭鍏�" />
-
-              <!--              <el-select v-model="form.partcode" :popper-append-to-body="false" style="width: 200px" placeholder="璇烽�夋嫨">-->
-              <!--                <el-option-->
-              <!--                  v-for="item in partArr"-->
-              <!--                  :key="item.code"-->
-              <!--                  :label="item.name"-->
-              <!--                  :value="item.code"-->
-              <!--                />-->
-              <!--              </el-select>-->
             </el-form-item>
             <el-form-item label="浜у搧鍚嶇О" style=" display: flex;">
               <el-input v-model="form.partname" style="width: 200px" placeholder="璇疯緭鍏�" />
@@ -51,6 +42,7 @@
               <el-date-picker
                 v-model="form.paydate"
                 type="date"
+                value-format="yyyy-MM-dd HH:mm:ss"
                 style="width: 200px"
                 placeholder="閫夋嫨鏃ユ湡"
               />
@@ -62,6 +54,7 @@
               <el-date-picker
                 v-model="form.createdate"
                 type="date"
+                value-format="yyyy-MM-dd HH:mm:ss"
                 style="width: 200px"
                 placeholder="閫夋嫨鏃ユ湡"
               />
@@ -78,7 +71,7 @@
         <el-button
           type="primary"
           icon="el-icon-refresh-right"
-          @click="reset"
+          @click="reset('update')"
         >鍚屾ERP
         </el-button>
         <el-button
@@ -212,8 +205,9 @@
     <el-dialog
       :title="operation==='add'?'鏂板':'涓嬭揪'"
       :visible.sync="dialogVisible"
-      width="50%"
+      width="60%"
       top="15vh"
+      :close-on-click-modal="false"
       @closed="handleClose"
       @close="handleClose"
     >
@@ -300,10 +294,8 @@
 
 <script>
 import Pagination from '@/components/Pagination'
-import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
-import { getCookie } from '@/utils/auth'
 import { ClosedErpOrder, ErpOrderSearch, MarkSaveErpOrder } from '@/api/scgl'
-import { PartSelect } from '@/api/zzmx'
+import { handleDatatime } from '@/utils/global'
 
 const SER_HZ = /^[\u4e00-\u9fa5]+$/
 export default {
@@ -340,7 +332,6 @@
         page: 1, // 绗嚑椤�
         rows: 20 // 姣忛〉澶氬皯鏉�
       },
-      // partArr: [],
       erporderstusArr: [
         { code: 'NEW', name: '鏂拌鍗�' },
         { code: 'CREATING', name: '鍒涘缓涓�' },
@@ -348,7 +339,6 @@
         { code: 'CLOSED', name: '宸插叧闂�' }
       ],
       total: 10,
-      // radioSelected: {},
       radioSelected: '',
       tableData: [],
       dialogVisible: false,
@@ -403,13 +393,6 @@
       this.tableData = res.data
       this.total = res.count
     },
-    // syncGetErpOrderSearch() {
-    //   this.getErpOrderSearch()
-    // },
-    // async getPartSelect() {
-    //   const { data: res } = await PartSelect()
-    //   this.partArr = res
-    // },
     // 鎺掑簭鏀瑰彉鏃�
     sortChange({ column, prop, order }) {
       if (order === 'descending') {
@@ -428,7 +411,7 @@
       this.getErpOrderSearch()
     },
     // 閲嶇疆
-    reset() {
+    reset(val) {
       this.form.erporderstus = ''
       this.form.erpordercode = ''
       this.form.partcode = ''
@@ -438,6 +421,9 @@
       this.form.creatuser = ''
       this.form.createdate = ''
       this.getErpOrderSearch()
+      if (val.length > 0) {
+        this.$message.success('ERP宸插悓姝ワ紒')
+      }
     },
     // 鍗曢�夋閫変腑鑾峰彇褰撳墠琛屼俊鎭�
     getCurrentRow(wo) {
@@ -445,29 +431,31 @@
     },
     // 璁㈠崟鍏抽棴
     async  orderClose() {
-      console.log(this.radioSelected, 1)
-
-      this.$confirm('鏄惁纭鍏抽棴璁㈠崟?', '鎻愮ず', {
-        confirmButtonText: '纭畾',
-        cancelButtonText: '鍙栨秷',
-        type: 'warning'
-      }).then(() => {
-        this.tableData.forEach((item, index) => {
-          if (this.radioSelected === item.wo) {
-            if (item.status !== 'NEW') {
-              return this.$message.info('姝よ鍗曢潪鏂拌鍗曪紝鏃犳硶鍏抽棴锛�')
-            }
+      if (this.radioSelected.length < 1) {
+        return this.$message.info('璇峰厛閫夋嫨璁㈠崟锛�')
+      }
+      this.tableData.find(item => {
+        if (item.wo === this.radioSelected) {
+          if (item.status !== 'NEW') {
+            return this.$message.info('姝よ鍗曢潪鏂拌鍗曪紝鏃犳硶鍏抽棴锛�')
+          } else {
+            this.$confirm('鏄惁纭鍏抽棴璁㈠崟?', '鎻愮ず', {
+              confirmButtonText: '纭畾',
+              cancelButtonText: '鍙栨秷',
+              type: 'warning'
+            }).then(() => {
+              ClosedErpOrder({ erpordercode: this.radioSelected }).then(res => {
+                if (res.code === '200') {
+                  this.$message.success('璁㈠崟鍏抽棴鎴愬姛!')
+                  this.getErpOrderSearch()
+                  // this.radioSelected = ''
+                }
+              })
+            }).catch(() => {
+              this.$message.info('宸插彇娑堝叧闂紒')
+            })
           }
-        })
-
-        ClosedErpOrder({ erpordercode: this.radioSelected }).then(res => {
-          if (res.code === '200') {
-            this.$message.success('鍒犻櫎鎴愬姛!')
-            this.getErpOrderSearch()
-          }
-        })
-      }).catch(() => {
-        this.$message.info('宸插彇娑堝垹闄�')
+        }
       })
     },
     // 鏂板鎸夐挳
@@ -521,6 +509,13 @@
     },
     // 瀵硅瘽妗嗙‘璁�
     dialogVisibleConfirm() {
+      if (this.dialogForm.markqty < 1 || this.dialogForm.markqty > this.dialogForm.erpqty - this.dialogForm.relse_qty) {
+        return this.$message.info('涓嬪崟鏁伴噺瓒呭嚭鍙笅鍗曟暟鐨勮寖鍥达紒')
+      }
+      if (this.dialogForm.ordernum < 1 || this.dialogForm.ordernum > this.dialogForm.markqty) {
+        return this.$message.info('涓嬪崟鍗曟暟瓒呭嚭鍙笅鍗曞崟鏁扮殑鑼冨洿锛�')
+      }
+
       this.$refs.dialogForm.validate(valid => {
         if (valid) {
           const data = {

--
Gitblit v1.9.3