zhongtianhaoyuan 3 rokov pred
rodič
commit
0b10c0d1b2

+ 4 - 0
src/common.js

@@ -0,0 +1,4 @@
+const Warehouse = {payname : ""}
+export default {
+    Warehouse
+}

+ 3 - 0
src/main.js

@@ -18,6 +18,9 @@ Vue.use(AMap);
 
 
 import $ from 'jquery'
+// import Warehouse from './common.js'
+import Warehouse from './common.js'
+Vue.prototype.WAREHOUSE = Warehouse
 // 初始化vue-amap
 AMap.initAMapApiLoader({
   // 高德key

+ 7 - 5
src/views/houseSelfCollect/inspectInfo.vue

@@ -607,6 +607,7 @@
                count = response
           })
           //  客户下拉校验
+          debugger
         getamount({
           compId: sessionStorage.getItem('ws-pf_compId'),
           customerName: this.inspect.customerName,
@@ -616,8 +617,8 @@
           .then((response) => {
             for (let i = 0; i < this.purchasePriceList.length; i++) {
               if (this.inspect.goodsName == this.purchasePriceList[i].goodsName) {
-                if (this.purchasePriceList[i].saleLimit - response < 50 || count > 0) {
-                    this.$alert('当前客户已累计销售我司' +this.inspect.goodsName + response +'吨,最高可售' +this.purchasePriceList[i].saleLimit +'吨。',
+                if (this.purchasePriceList[i].saleLimit - response/1000 < 50 || count > 0) {
+                    this.$alert('当前客户已累计销售我司' +this.inspect.goodsName + (response/1000).toFixed(2) +'吨,最高可售' +this.purchasePriceList[i].saleLimit +'吨。',
                           '提示',
                           {
                             confirmButtonText: '确定',
@@ -676,7 +677,8 @@
           .then((response) => {
                count = response
           })
-        //  客户下拉校验
+        //  货名下拉校验
+        debugger
         getamount({
           compId: sessionStorage.getItem('ws-pf_compId'),
           customerName: this.inspect.customerName,
@@ -686,8 +688,8 @@
           .then((response) => {
             for (let i = 0; i < this.purchasePriceList.length; i++) {
               if (this.inspect.goodsName == this.purchasePriceList[i].goodsName) {
-                if (this.purchasePriceList[i].saleLimit - response < 50 || count > 0) {
-                    this.$alert('当前客户已累计销售我司' +this.inspect.goodsName + response +'吨,最高可售' +this.purchasePriceList[i].saleLimit +'吨。',
+                if (this.purchasePriceList[i].saleLimit - response/1000 < 50 || count > 0) {
+                    this.$alert('当前客户已累计销售我司' +this.inspect.goodsName + (response/1000).toFixed(2) +'吨,最高可售' +this.purchasePriceList[i].saleLimit +'吨。',
                           '提示',
                           {
                             confirmButtonText: '确定',

+ 28 - 8
src/views/houseSelfCollect/paymentManagement.vue

@@ -13,7 +13,7 @@
       <template slot="right">
         <el-select
           v-model="warehouseNameKey"
-          placeholder="请选择"
+          placeholder="请选择仓库"
           @change="warehouseChange"
           style="margin:0 10px"
         >
@@ -246,6 +246,8 @@ import {
 import { posthandle } from '@/model/purchasingManagement/index'
 import paymentPrint from './component/paymentPrint.vue'
 import { getHp } from '@/utils/getHasPermission'
+// import Warehouse from './common.js'
+// import Warehouse from '@/main.js'
 export default {
   components: { paymentPrint },
   watch: {},
@@ -258,7 +260,6 @@ export default {
       deptCircularPage: {},
       deptBudgetTotal: 0,
       paymentForm: false,
-      taskTypeList: ['一号库'],
       searchType: '',
       searchTypeText: '',
       searchKeyWord: '',
@@ -281,7 +282,26 @@ export default {
   },
   activated() {
     this.userJurisdiction = getHp('acquisitionManagement.acquisitionPay.print')
-    selectWarehouseSelf({
+    // selectWarehouseSelf({
+    //   compId: sessionStorage.getItem('ws-pf_compId'),
+    // })
+    //   .toPromise()
+    //   .then((response) => {
+
+    //     this.warehouseList = response
+    //     this.warehouseNameKey = this.warehouseList[0].id
+    //     this.warehouseName = this.warehouseList[0].warehouseName
+    //     this.WAREHOUSE.payname = this.warehouseList[0].warehouseName
+    //     this.getList()
+    //   })
+    this.getWarehouse()
+    this.warehouseName = this.WAREHOUSE.payname
+    console.log(this.WAREHOUSE.payname)
+    this.getList()
+  },
+  methods: {
+    getWarehouse(){
+       selectWarehouseSelf({
       compId: sessionStorage.getItem('ws-pf_compId'),
     })
       .toPromise()
@@ -289,21 +309,19 @@ export default {
         this.warehouseList = response
         this.warehouseNameKey = this.warehouseList[0].id
         this.warehouseName = this.warehouseList[0].warehouseName
-        this.getList()
+        // this.getList()
       })
-  },
-  methods: {
+
+    },
     //上传付款截图
     handleAvatarSuccess(e) {
       this.imageUrl = e.url
     },
     printSmall() {
       window.open('../../../../../static/payprint.html?type=1&dataList=' +JSON.stringify(this.printData))
-        
     },
     printBig() {
       window.open('../../../../../static/payprint.html?type=2&dataList=' +JSON.stringify(this.printData),"结算凭证")
-        
     },
     getList() {
       getpayment({
@@ -318,6 +336,7 @@ export default {
         .then((response) => {
           this.paymentList = response
            this.deptBudgetTotal = response.total
+           this.WAREHOUSE.payname = this.warehouseName 
         })
     },
     del(row) {
@@ -565,6 +584,7 @@ export default {
       for (let i = 0; i < this.warehouseList.length; i++) {
         if (this.warehouseList[i].id == this.warehouseNameKey) {
           this.warehouseName = this.warehouseList[i].warehouseName
+          this.WAREHOUSE.payname = this.warehouseList[i].warehouseName
         }
       }
       this.getList()