瀏覽代碼

修改bug

qukaidi 3 年之前
父節點
當前提交
6929a21e4a
共有 2 個文件被更改,包括 83 次插入61 次删除
  1. 24 20
      src/main.js
  2. 59 41
      src/views/Warehousing/outStock/AddOrUpdate.vue

+ 24 - 20
src/main.js

@@ -24,7 +24,7 @@ import Pagination from "@/components/Pagination";
 import RightToolbar from "@/components/RightToolbar"
 import * as echarts from "echarts";
 import '@/utils/dialog.js'
-import {toSuperFixed} from "./api/warehouseBusiness/restructure";
+import { toSuperFixed } from "./api/warehouseBusiness/restructure";
 
 // 解决浮点数的问题
 import _ from 'lodash';
@@ -59,6 +59,10 @@ Vue.prototype.msgError = function (msg) {
   this.$message({ showClose: true, message: msg, type: "error" });
 }
 
+Vue.prototype.msgError2 = function (msg) {
+  this.$message({ showClose: true, message: msg, type: "error", duration: 20 * 1000 });
+}
+
 Vue.prototype.msgInfo = function (msg) {
   this.$message.info(msg);
 }
@@ -167,7 +171,7 @@ Vue.directive("input-limit", {
       flag = true;
     });
     target.addEventListener("input", e => {
-      setTimeout(function() {
+      setTimeout(function () {
         if (flag) {
           if (binding.value == 0) {
             if (wins_0.test(e.target.value)) {
@@ -196,7 +200,7 @@ Vue.directive("input-limit", {
               if (!no_int) {
                 e.target.value = e.target.value.replace(wins_1, "").replace('.', '$#$').replace(/\./g, '').replace(
                   '$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').substring(0, e.target.value.indexOf(
-                  ".") + 2)
+                    ".") + 2)
               } else {
                 e.target.value = e.target.value.replace(wins_0, "")
               }
@@ -224,7 +228,7 @@ Vue.directive("input-limit", {
               if (!no_int) {
                 e.target.value = e.target.value.replace(wins_1, "").replace('.', '$#$').replace(/\./g, '').replace(
                   '$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').substring(0, e.target.value.indexOf(
-                  ".") + 3)
+                    ".") + 3)
               } else {
                 e.target.value = e.target.value.replace(wins_0, "")
               }
@@ -252,7 +256,7 @@ Vue.directive("input-limit", {
               if (!no_int) {
                 e.target.value = e.target.value.replace(wins_1, "").replace('.', '$#$').replace(/\./g, '').replace(
                   '$#$', '.').replace(/^(\-)*(\d+)\.(\d\d\d).*$/, '$1$2.$3').substring(0, e.target.value.indexOf(
-                  ".") + 4)
+                    ".") + 4)
               } else {
                 e.target.value = e.target.value.replace(wins_0, "")
               }
@@ -279,7 +283,7 @@ Vue.directive("input-limit", {
             if (wins_1.test(e.target.value) || lengths || points || remainder) {
               if (!no_int) {
                 e.target.value = e.target.value.replace(wins_1, "").replace('.', '$#$').replace(/\./g, '').replace(
-                    '$#$', '.').substring(0, e.target.value.indexOf(
+                  '$#$', '.').substring(0, e.target.value.indexOf(
                     ".") + 5)
               } else {
                 e.target.value = e.target.value.replace(wins_0, "")
@@ -294,23 +298,23 @@ Vue.directive("input-limit", {
 })
 Vue.directive('Alphabet', {
   inserted: function (el) {
-      const input = el.querySelector('.el-input__inner');
-      input.onkeyup = function (e) {
-        input.value = input.value.replace(/[^A-Za-z0-9]/g,'')
-      }
-      input.onblur = function (e) {
-        input.value = input.value.replace(/[^A-Za-z0-9]/g,'')
-      }
+    const input = el.querySelector('.el-input__inner');
+    input.onkeyup = function (e) {
+      input.value = input.value.replace(/[^A-Za-z0-9]/g, '')
+    }
+    input.onblur = function (e) {
+      input.value = input.value.replace(/[^A-Za-z0-9]/g, '')
     }
+  }
 });
 Vue.directive('Space', {
   inserted: function (el) {
-      const input = el.querySelector('.el-input__inner');
-      input.onkeyup = function (e) {
-        input.value = input.value.replace(/\s+/g,'')
-      }
-      input.onblur = function (e) {
-        input.value = input.value.replace(/\s+/g,'')
-      }
+    const input = el.querySelector('.el-input__inner');
+    input.onkeyup = function (e) {
+      input.value = input.value.replace(/\s+/g, '')
     }
+    input.onblur = function (e) {
+      input.value = input.value.replace(/\s+/g, '')
+    }
+  }
 });

+ 59 - 41
src/views/Warehousing/outStock/AddOrUpdate.vue

@@ -765,16 +765,16 @@
               </span>
               <span v-else-if="item.label == 'fInvamount'">
                 <el-input v-model="scope.row.fInvamount" :disabled="browseStatus || scope.row.fBillstatus == 6"
-                          placeholder="开票金额" show-word-limit disabled/>
+                  placeholder="开票金额" show-word-limit disabled />
               </span>
               <span v-else-if="item.label == 'fInvnos'">
                 <el-input v-model="scope.row.fInvnos" :disabled="browseStatus || scope.row.fBillstatus == 6"
-                          placeholder="发票号" show-word-limit disabled/>
+                  placeholder="发票号" show-word-limit disabled />
               </span>
               <span v-else-if="item.label == 'fInvoicingDate'">
                 <el-date-picker v-model="scope.row.fInvoicingDate"
-                                :disabled="browseStatus || scope.row.fBillstatus == 6" placeholder="开票时间" format="yyyy-MM-dd"
-                                value-format="yyyy-MM-dd" disabled/>
+                  :disabled="browseStatus || scope.row.fBillstatus == 6" placeholder="开票时间" format="yyyy-MM-dd"
+                  value-format="yyyy-MM-dd" disabled />
               </span>
               <span v-else-if="item.label == 'fQty'">
                 <el-input
@@ -786,7 +786,7 @@
                 <el-input
                   oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
                   v-model="scope.row.fUnitprice" placeholder="单价"
-                  :disabled="browseStatus  || scope.row.fBillstatus == 6"
+                  :disabled="browseStatus || scope.row.fBillstatus == 6"
                   @change="changeContractAmt(scope.row)" show-word-limit />
               </span>
               <span v-else-if="item.label == 'fAmount'">
@@ -2036,8 +2036,8 @@
       </div>
       <span lot="footer" class="dialog-footer">
         <el-button type="primary" size="mini" @click="
-          print_Cr = false;
-        addprint('crzyd');
+  print_Cr = false;
+addprint('crzyd');
         ">打印
         </el-button>
         <el-button @click="print_Cr = false" size="mini">取消 </el-button>
@@ -2164,8 +2164,8 @@
       </div>
       <span lot="footer" class="dialog-footer">
         <el-button type="primary" size="mini" @click="
-          print_zyd = false;
-        addprint('zyd');
+  print_zyd = false;
+addprint('zyd');
         ">打印
         </el-button>
         <el-button @click="print_zyd = false; detailList = zcList.concat()" size="mini">取消 </el-button>
@@ -2271,8 +2271,8 @@
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button type="primary" @click="
-          print_rkd = false;
-        addprint('rkd');
+  print_rkd = false;
+addprint('rkd');
         ">打印
         </el-button>
         <el-button @click="print_rkd = false">取消 </el-button>
@@ -2472,8 +2472,8 @@
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button type="primary" @click="
-          print_bzckd = false;
-        addprint('bzckd');
+  print_bzckd = false;
+addprint('bzckd');
         ">打印
         </el-button>
         <el-button @click="print_bzckd = false">取消 </el-button>
@@ -2563,8 +2563,8 @@
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button type="primary" @click="
-          print_xqckd = false;
-        addprint('xqckd');
+  print_xqckd = false;
+addprint('xqckd');
         ">打印
         </el-button>
         <el-button @click="print_xqckd = false">取消 </el-button>
@@ -2656,8 +2656,8 @@
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button type="primary" @click="
-          print_jyjsckd = false;
-        addprint('jyjsckd');
+  print_jyjsckd = false;
+addprint('jyjsckd');
         ">打印
         </el-button>
         <el-button @click="print_jyjsckd = false">取消 </el-button>
@@ -2750,8 +2750,8 @@
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button type="primary" @click="
-          addprint('lhd');
-        print_lhd = false;
+  addprint('lhd');
+print_lhd = false;
         ">打印
         </el-button>
         <el-button @click="print_lhd = false">取消 </el-button>
@@ -2824,8 +2824,8 @@
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button type="primary" @click="
-          addprint('lwqr');
-        print_lwqr = false;
+  addprint('lwqr');
+print_lwqr = false;
         ">打印
         </el-button>
         <el-button @click="print_lwqr = false">取消 </el-button>
@@ -2917,8 +2917,8 @@
 
       <span slot="footer" class="dialog-footer">
         <el-button type="primary" @click="
-          addprint('ccckd');
-        print_ccckd = false;
+  addprint('ccckd');
+print_ccckd = false;
         ">打印
         </el-button>
         <el-button @click="print_ccckd = false">取消 </el-button>
@@ -3011,8 +3011,8 @@
 
       <span slot="footer" class="dialog-footer">
         <el-button type="primary" @click="
-          addprint('kbccd');
-        print_kbccd = false;
+  addprint('kbccd');
+print_kbccd = false;
         ">打印
         </el-button>
         <el-button @click="print_kbccd = false">取消 </el-button>
@@ -3104,8 +3104,8 @@
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button type="primary" @click="
-          addprint('dcckd');
-        print_dcckd = false;
+  addprint('dcckd');
+print_dcckd = false;
         ">打印
         </el-button>
         <el-button @click="print_dcckd = false">取消 </el-button>
@@ -3197,8 +3197,8 @@
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button type="primary" @click="
-          addprint('dcckd_blank');
-        print_dcckd_blank = false;
+  addprint('dcckd_blank');
+print_dcckd_blank = false;
         ">打印
         </el-button>
         <el-button @click="print_dcckd_blank = false">取消 </el-button>
@@ -3300,8 +3300,8 @@
 
       <span slot="footer" class="dialog-footer">
         <el-button type="primary" @click="
-          addprint('zccdckd');
-        print_zccdckd = false;
+  addprint('zccdckd');
+print_zccdckd = false;
         ">打印
         </el-button>
         <el-button @click="print_zccdckd = false">取消 </el-button>
@@ -3392,8 +3392,8 @@
 
       <span slot="footer" class="dialog-footer">
         <el-button type="primary" @click="
-          addprint('kbzccd');
-        print_kbzccd = false;
+  addprint('kbzccd');
+print_kbzccd = false;
         ">打印
         </el-button>
         <el-button @click="print_kbzccd = false">取消 </el-button>
@@ -3482,8 +3482,8 @@
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button type="primary" @click="
-          addprint('fyqrd');
-        print_fyqr = false;
+  addprint('fyqrd');
+print_fyqr = false;
         ">打印
         </el-button>
         <el-button @click="print_fyqr = false">取消 </el-button>
@@ -3537,8 +3537,8 @@
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="zhgenlegData" :disabled="browseStatus">导 入</el-button>
         <el-button @click="
-          warehousingagreements = false;
-        Navigation = false;
+  warehousingagreements = false;
+Navigation = false;
         ">取 消
         </el-button>
       </div>
@@ -3620,8 +3620,8 @@
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button type="primary" @click="
-          addprint('Crfyqrd');
-        print_Crfyqr = false;
+  addprint('Crfyqrd');
+print_Crfyqr = false;
         ">打印
         </el-button>
         <el-button @click="print_Crfyqr = false">取消 </el-button>
@@ -3844,7 +3844,7 @@ import {
 } from '@/api/warehouseBusiness/warehouseInStock'
 import { listCharge } from '@/api/system/viewApproval'
 import { getDept } from '@/api/basicdata/dept'
-
+import { Message } from 'element-ui'
 export default {
   name: 'inStock',
   props: {
@@ -6977,8 +6977,26 @@ export default {
                 'tWarehousebillsitems',
                 JSON.stringify(this.detailList)
               )
+              console.log('是否打印')
               // new window.FormData().append("warehousebillsitems",JSON.stringify(this.dataList))
-              stockWarning(formData2).then((response) => {
+              stockWarning(formData2).then((res) => {
+                console.log(res)
+                if (res.msg != '操作成功') {
+                  console.log(res.msg)
+                  // this.$message({
+                  //   showClose: true,
+                  //   message: response.msg,
+                  //   type: 'error',
+                  //   duration: 20000
+                  // });
+                  this.msgError2(res.msg)
+                  // Message({
+                  //   showClose: true,
+                  //   message: response.msg,
+                  //   type: 'error',
+                  //   duration: 20 * 1000
+                  // })
+                }
                 addWarehousebills(formData).then((response) => {
                   if (response.data == false) {
                     this.$confirm(response.msg, '提示', {