From 99a010f21d278498bafd248217c584e101db2d8f Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期四, 01 九月 2022 17:27:17 +0800
Subject: [PATCH] 1.自动扫码回车功能接入

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

diff --git a/src/views/scgl/scdd.vue b/src/views/scgl/scdd.vue
index 653a70b..f8b4fdc 100644
--- a/src/views/scgl/scdd.vue
+++ b/src/views/scgl/scdd.vue
@@ -2,7 +2,7 @@
   <div>
     <div class="body" :style="{height:mainHeight+'px'}">
 
-      <div class="bodyTopButtonGroup">
+      <div class="bodyTopButtonGroup" style="justify-content: space-between">
         <el-button
           icon="el-icon-refresh-right"
           @click="syncERP"
@@ -56,14 +56,14 @@
             <el-form-item label="鍒涘缓浜哄憳" style=" display: flex;">
               <el-input v-model="form.creatuser" style="width: 200px" placeholder="璇疯緭鍏�" />
             </el-form-item>
-            <el-form-item label="棰勮寮�宸ユ椂闂�" label-width="100px" style=" display: flex;font-size: 14px">
+            <el-form-item label="棰勮寮�宸ユ椂闂�" label-width="100px" style=" display: flex;font-size: 14px;margin-top: 3px">
               <el-date-picker
                 v-model="form.paystartdate"
                 type="daterange"
                 range-separator="~"
                 class="timeMini"
                 size="mini"
-                style="width: 225px;display: flex"
+                style="width: 250px;display: flex;line-height: 34px;height: 34px;font-size: 14px!important;"
                 :clearable="false"
                 start-placeholder="寮�濮嬫棩鏈�"
                 end-placeholder="缁撴潫鏃ユ湡"
@@ -71,7 +71,7 @@
               <!--              :picker-options="expireTimeOption"-->
 
             </el-form-item>
-            <el-form-item label="棰勮瀹屽伐鏃堕棿" label-width="100px" style=" display: flex;font-size: 14px">
+            <el-form-item label="棰勮瀹屽伐鏃堕棿" label-width="100px" style=" display: flex;font-size: 14px;margin-top: 3px">
               <el-date-picker
                 v-model="form.payenddate"
                 type="daterange"
@@ -79,7 +79,7 @@
                 class="timeMini"
                 range-separator="~"
                 start-placeholder="寮�濮嬫棩鏈�"
-                style="width: 225px;display: flex"
+                style="width: 250px;display: flex;line-height: 34px ;height: 34px ;font-size: 14px !important;"
                 end-placeholder="缁撴潫鏃ユ湡"
                 size="mini"
               />
@@ -154,10 +154,10 @@
           >
             <template slot-scope="{row}">
               <el-radio
-                v-model="radioSelected"
-                :label="row.wo"
-                style="color: #fff;padding-left: 10px; margin-right: -25px;"
-                @change.native="getCurrentRow(row.wo)"
+                v-model="radioSelectedId"
+                :label="row.id"
+                style="color: transparent;padding-left: 10px;"
+                @change.native="getCurrentRow(row.id)"
               />
             </template>
           </el-table-column>
@@ -203,7 +203,12 @@
             label="浜у搧瑙勬牸"
             sortable="custom"
             min-width="110"
-          />
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.partspec">{{ row.partspec }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
           <el-table-column
             prop="qty"
             label="璁㈠崟鏁伴噺"
@@ -221,31 +226,56 @@
             label="鐢熶骇杞﹂棿"
             sortable="custom"
             width="150"
-          />
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.wkshp_name">{{ row.wkshp_name }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
           <el-table-column
             prop="planstartdate"
             label="棰勮寮�宸ユ椂闂�"
             sortable="custom"
-            width="160"
-          />
+            width="130"
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.planstartdate">{{ row.planstartdate.substring(0,11) }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
           <el-table-column
             prop="planenddate"
             label="棰勮瀹屽伐鏃堕棿"
             sortable="custom"
-            width="160"
-          />
+            width="130"
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.planenddate">{{ row.planenddate.substring(0,11) }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
           <el-table-column
             prop="createuser"
             label="鍒涘缓浜哄憳"
             sortable="custom"
             width="150"
-          />
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.createuser">{{ row.createuser }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
           <el-table-column
             prop="createdate"
             label="鍒涘缓鏃堕棿"
-            width="160"
+            width="130"
             sortable="custom"
-          />
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.createdate">{{ row.createdate.substring(0,11) }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
           <el-table-column
             label="鎿嶄綔"
             fixed="right"
@@ -253,7 +283,10 @@
           >
             <template slot-scope="{row}">
               <div class="operationClass">
-                <el-button type="text" @click="edit('edit',row)">涓嬭揪</el-button>
+                <el-tooltip class="item" effect="dark" content="涓嬭揪" placement="top">
+                  <!--                <el-button type="text" @click="edit('edit',row)">涓嬭揪</el-button>-->
+                  <i class="el-icon-bottom" style="color:#42b983;cursor: pointer;margin-left: 5px" @click="edit('edit',row)" />
+                </el-tooltip>
               </div>
             </template>
           </el-table-column>
@@ -261,12 +294,11 @@
       </div>
       <!--鍒嗛〉-->
       <pagination
-        v-show="total>0"
         :total="total"
         :page.sync="form.page"
         :limit.sync="form.rows"
         align="right"
-        layout="prev, pager, next,sizes"
+        layout="total,prev, pager, next,sizes"
         popper-class="select_bottom"
         @pagination="getErpOrderSearch"
       />
@@ -342,22 +374,11 @@
             style="width: 200px"
           />
         </el-form-item>
-
-        <!--        <el-form-item label="浜や粯鏃堕棿" prop="">-->
-        <!--          <el-date-picker-->
-        <!--            v-model="dialogForm.markqty"-->
-        <!--            type="date"-->
-        <!--            style="width: 200px"-->
-        <!--            placeholder="閫夋嫨鏃ユ湡"-->
-        <!--          />-->
-        <!--          <el-input v-model="dialogForm.OrgName" style="width: 200px" />-->
-        <!--        </el-form-item>-->
-
       </el-form>
       <span slot="footer" class="dialog-footer">
         <div class="footerButton">
           <el-button @click="dialogVisibleCancel">鍙� 娑�</el-button>
-          <el-button type="primary" @click="dialogVisibleConfirm">涓� 杈�</el-button>
+          <el-button type="primary" :disabled="sendButtonIsDisabled" @click="dialogVisibleConfirm">涓� 杈�</el-button>
         </div>
       </span>
     </el-dialog>
@@ -415,10 +436,11 @@
         { code: 'CLOSED', name: '宸插叧闂�' }
       ],
       total: 10,
-      radioSelected: '',
+      radioSelectedId: '',
       tableData: [],
       dialogVisible: false,
       dialogForm: {
+        erporderid: '',
         partname: '', // 浜у搧鍚嶇О
         partspec: '', // 浜у搧瑙勬牸
         // paystartdate: '', // 棰勮寮�宸ユ椂闂�
@@ -561,16 +583,16 @@
       this.getErpOrderSearch()
     },
     // 鍗曢�夋閫変腑鑾峰彇褰撳墠琛屼俊鎭�
-    getCurrentRow(wo) {
-      this.radioSelected = wo
+    getCurrentRow(id) {
+      this.radioSelectedId = id
     },
     // 璁㈠崟鍏抽棴
     async orderClose() {
-      if (this.radioSelected.length < 1) {
+      if (this.radioSelectedId.length < 1) {
         return this.$message.info('璇峰厛閫夋嫨璁㈠崟锛�')
       }
       this.tableData.forEach(item => {
-        if (item.wo === this.radioSelected) {
+        if (item.id === this.radioSelectedId) {
           if (item.status !== 'NEW') {
             return this.$message.info('姝よ鍗曢潪鏂拌鍗曪紝鏃犳硶鍏抽棴锛�')
           } else {
@@ -579,11 +601,10 @@
               cancelButtonText: '鍙栨秷',
               type: 'warning'
             }).then(() => {
-              ClosedErpOrder({ erpordercode: this.radioSelected }).then(res => {
+              ClosedErpOrder({ erpordercode: item.wo, erporderid: this.radioSelectedId }).then(res => {
                 if (res.code === '200') {
                   this.$message.success('璁㈠崟鍏抽棴鎴愬姛!')
                   this.getErpOrderSearch()
-                  // this.radioSelected = ''
                 }
               })
             }).catch(() => {
@@ -604,6 +625,7 @@
       this.dialogVisible = true
 
       this.$nextTick(() => {
+        this.dialogForm.erporderid = row.id
         this.dialogForm.erporderstus = row.status
         this.dialogForm.erpordercode = row.wo
         this.dialogForm.partcode = row.partcode
@@ -636,6 +658,8 @@
       this.dialogForm.markqty = ''
       this.dialogForm.ordernum = ''
       this.dialogForm.relse_qty = ''
+
+      this.sendButtonIsDisabled = false
       this.$refs.dialogForm.clearValidate()
     },
     // 瀵硅瘽妗嗗彇娑�
@@ -644,9 +668,15 @@
     },
     // 瀵硅瘽妗嗙‘璁�
     dialogVisibleConfirm() {
+      this.dialogForm.markqty = parseFloat(this.dialogForm.markqty)
+      this.dialogForm.erpqty = parseFloat(this.dialogForm.erpqty)
+      this.dialogForm.relse_qty = parseFloat(this.dialogForm.relse_qty)
+      this.dialogForm.ordernum = parseFloat(this.dialogForm.ordernum)
       if (this.dialogForm.markqty < 1 || this.dialogForm.markqty > this.dialogForm.erpqty - this.dialogForm.relse_qty) {
         return this.$message.info('涓嬪崟鏁伴噺瓒呭嚭鍙笅鍗曟暟鐨勮寖鍥达紒')
       }
+
+      console.log(this.dialogForm.ordernum < this.dialogForm.markqty)
       if (this.dialogForm.ordernum < 1 || this.dialogForm.ordernum > this.dialogForm.markqty) {
         return this.$message.info('涓嬪崟鍗曟暟瓒呭嚭鍙笅鍗曞崟鏁扮殑鑼冨洿锛�')
       }
@@ -654,6 +684,7 @@
       this.$refs.dialogForm.validate(valid => {
         if (valid) {
           const data = {
+            'erporderid': this.dialogForm.erporderid,
             // 'erporderstus': this.dialogForm.erporderstus,
             'erpordercode': this.dialogForm.erpordercode,
             'partcode': this.dialogForm.partcode,
@@ -664,7 +695,7 @@
             'ordernum': this.dialogForm.ordernum,
             'relse_qty': this.dialogForm.relse_qty
           }
-          console.log(data)
+          this.sendButtonIsDisabled = true
           MarkSaveErpOrder(data).then(res => {
             if (res.code === '200') {
               this.$message.success('涓嬭揪鎴愬姛锛�')
@@ -699,6 +730,15 @@
 <!--鍏叡椤甸潰鏍峰紡-->
 <style lang="scss" scoped>
 $main_color: #42b983;
+::v-deep  .el-range-input{
+  font-size: 14px !important;
+}
+::v-deep .el-range__icon{
+  line-height: 28px !important;
+}
+::v-deep .el-range-separator{
+  line-height: 28px !important;
+}
 ::v-deep .el-range-input{
   font-size: 14px ;
 }
@@ -794,6 +834,11 @@
   margin-bottom: 0;
 }
 
+.elTableDiv {
+  ::v-deep .el-radio__label {
+    display: none;
+  }
+}
 </style>
 <style>
 .el-table .custom-row {

--
Gitblit v1.9.3