Ver código fonte

Merge branch 'master' of http://47.100.3.209:3000/gdc/yiliangyiyun-pc

zhongtianhaoyuan 3 anos atrás
pai
commit
a51202db75

+ 2 - 0
src/api/V2/houseSelfCollect/index.js

@@ -85,4 +85,6 @@ export const API_GET_INSPECT_GETJURISDICTION = '/paymentManagement/selectTaskId'
 //财务开票
 export const API_POST_INVOICING = '/paymentManagement/api/readXmlManagement'
 export const API_POST_EXPORT = '/paymentManagement/export'
+// 车牌号
+export const API_GET_SHIPPINGINFOFORMATION = '/shippingInformation/selectShippingInformation'
 

+ 1 - 1
src/components/mapdrag/indexMap.vue

@@ -160,7 +160,7 @@
         AMapLoader.load({
           "key": "211dd6f989e719022aaf47ddb0659c47", // 申请好的Web端开发者Key,首次调用 load 时必填
           "version": "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
-          "plugins": ['plugin=AMap.Scale', 'AMap.ToolBar','AMap.AutoComplete', 'AMap.PlaceSearch', 'AMap.Geocoder', 'AMap.DistrictSearch'],
+          "plugins": ['plugin=AMap.Scale', 'AMap.ToolBar','AMap.AutoComplete', 'AMap.PlaceSearch', 'AMap.Geocoder', 'AMap.DistrictSearch','AMap.Geolocation', 'Geolocation'],
           "Loca": { // 是否加载 Loca, 缺省不加载
             "version": '2.0.0' // Loca 版本,缺省 1.3.2
           },

+ 1 - 1
src/components/mapdrag/mapdrag.vue

@@ -184,7 +184,7 @@
         AMapLoader.load({
           "key": "211dd6f989e719022aaf47ddb0659c47", // 申请好的Web端开发者Key,首次调用 load 时必填
           "version": "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
-          "plugins": ['plugin=AMap.Scale', 'AMap.ToolBar','AMap.AutoComplete', 'AMap.PlaceSearch', 'AMap.Geocoder', 'AMap.DistrictSearch'],
+          "plugins": ['plugin=AMap.Scale', 'AMap.ToolBar','AMap.AutoComplete', 'AMap.PlaceSearch', 'AMap.Geocoder', 'AMap.DistrictSearch','AMap.Geolocation', 'Geolocation'],
           "Loca": { // 是否加载 Loca, 缺省不加载
             "version": '2.0.0' // Loca 版本,缺省 1.3.2
           },

+ 15 - 8
src/components/mapdrag/warehouseReceiptMap.vue

@@ -60,6 +60,7 @@
       listData: function(val1, val2) {
         this.listData = val1
         var that = this
+        
         this.map = new AMap.Map('mapContainer', {
           resizeEnable: true,
           zoom: 5,
@@ -72,14 +73,21 @@
     },
     async created() {
       // AMapLoader.reset();
-      // 已载入高德地图API,则直接初始化地图
       if (window.AMap && window.AMapUI) {
-        this.initMap()
         // 未载入高德地图API,则先载入API再初始化
       } else {
-        await remoteLoad(`http://webapi.amap.com/maps?v=1.3&key=${MapKey}&plugin=AMap.AutoComplete`)
-        await remoteLoad('http://webapi.amap.com/ui/1.0/main.js')
-        this.initMap()
+        // await remoteLoad(`http://webapi.amap.com/maps?v=1.3&key=${MapKey}&plugin=AMap.AutoComplete`)
+        // await remoteLoad('http://webapi.amap.com/ui/1.0/main.js')
+        //  AMapLoader.reset();
+        AMapLoader.load({
+          "key": "211dd6f989e719022aaf47ddb0659c47", // 申请好的Web端开发者Key,首次调用 load 时必填
+          "version": "2.0", // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
+          "plugins": ['plugin=AMap.Scale', 'AMap.ToolBar','AMap.AutoComplete', 'AMap.PlaceSearch', 'AMap.Geocoder', 'AMap.DistrictSearch','AMap.Geolocation', 'Geolocation'],
+          "Loca": { // 是否加载 Loca, 缺省不加载
+            "version": '2.0.0' // Loca 版本,缺省 1.3.2
+          },
+        }).then((AMap) => {
+        })
       }
     },
     mounted() {},
@@ -95,7 +103,6 @@
       loadmap(val) {
         let that = this
         //构造markersList
-        this.makeMarkersList()
         AMap.plugin(['AMap.DistrictSearch', 'AMap.Polygon'], function() {
           var geolocation = new AMap.Geolocation({
             // 是否使用高精度定位,默认:true
@@ -106,7 +113,7 @@
             buttonPosition: 'RB'
           })
           geolocation.getCurrentPosition()
-          AMap.event.addListener(geolocation, 'complete', e => {
+          geolocation.on( 'complete', e => {
             console.log(e) // 定位成功之后做的事 // 定位成功之后再定位处添加一个marker
             var infoWindow = new AMap.InfoWindow({
               offset: new AMap.Pixel(0, -30)
@@ -166,7 +173,7 @@
               // });
             }
           })
-          AMap.event.addListener(geolocation, 'error', e => {
+           geolocation.on( 'error', e => {
             console.log(e) // 定位失败
           })
         })

+ 5 - 2
src/model/houseSelfCollect/index.js

@@ -44,7 +44,8 @@ import {
   API_GET_INSPECT_GETDRYGRAINPRICE,
   API_GET_INSPECT_GETJURISDICTION,
   API_POST_INVOICING,
-  API_POST_EXPORT
+  API_POST_EXPORT,
+  API_GET_SHIPPINGINFOFORMATION
 } from '@/api/V2/houseSelfCollect'
 //客户管理列表
 export const getCustomerManage = appRx.get(API_GET_CUSTOMER_MANAGE, errorCatcher, errorHandle, filter)
@@ -133,4 +134,6 @@ export const getJurisdiction  = appRx.get(API_GET_INSPECT_GETJURISDICTION, error
 //财务开票post
 export const invoicing  = appRx.post(API_POST_INVOICING, errorCatcher, errorHandle, filter)
 
-export const export1 = appRx.post(API_POST_EXPORT)
+export const export1 = appRx.post(API_POST_EXPORT)
+// 车牌号
+export const getshippinginfo  = appRx.get(API_GET_SHIPPINGINFOFORMATION, errorCatcher, errorHandle, filter)

+ 61 - 9
src/views/houseSelfCollect/inspectInfo.vue

@@ -27,19 +27,24 @@
                 <ws-option v-for="item in getbinNumberList" :key="item.value" :label="item.value" :value="item.value" />
               </ws-select>
             </ws-form-item>
-            <ws-form-item label="客户" span="1" prop="customerName">
-              <el-select v-model="inspect.customerName" clearable filterable  placeholder="请选择" class="typeselect" @change="customerChange"
-                :disabled="disabled1">
-                <el-option v-for="item in customerList" :key="item.valueKey" :label="item.value" :value="item.value" />
-              </el-select>
-            </ws-form-item>
+            
             <ws-form-item label="囤位号" span="1" prop="storageTagNo">
               <ws-input v-model="inspect.storageTagNo" placeholder="请输入囤位号" maxlength="15" size="small"
                 :disabled="disabled" />
             </ws-form-item>
             <ws-form-item label="车牌号" span="1" prop="carNumber">
-              <ws-input v-model="inspect.carNumber" placeholder="请输入车牌号" maxlength="10" size="small"
-                :disabled="disabled" />
+              <el-select v-model="inspect.carNumber" clearable filterable  placeholder="请选择" class="typeselect" @change="shipperNameChange"
+                :disabled="disabled1">
+                <el-option v-for="(item,index) in carNumberList" :key="index" :label="item.carNo" :value="index" />
+              </el-select>
+              <!-- <ws-input v-model="inspect.carNumber" placeholder="请输入车牌号" maxlength="10" size="small"
+                :disabled="disabled" /> -->
+            </ws-form-item>
+            <ws-form-item label="客户" span="1" prop="customerName">
+              <el-select v-model="inspect.customerName" clearable filterable  placeholder="请选择" class="typeselect" @change="customerChange"
+                :disabled="disabled1">
+                <el-option v-for="item in customerList" :key="item.valueKey" :label="item.value" :value="item.value" />
+              </el-select>
             </ws-form-item>
             <ws-form-item label="箱号-1" span="1" prop="boxNo">
             <ws-input :disabled="disabled" v-model="inspect.boxNo" placeholder="请输入箱号" maxlength="20"
@@ -168,7 +173,8 @@
     getinspectEdit,
     getamount,
     getCount,
-    getDryGrainPrice
+    getDryGrainPrice,
+    getshippinginfo
   } from '@/model/houseSelfCollect/index'
    import {
     packList
@@ -194,6 +200,7 @@
           paramType:1,
           type:'潮粮'
         },
+        carNumberList:[],
         disabled: false,
         disabled1: false,
         disabled2: false,
@@ -755,6 +762,47 @@
         })
 
       },
+      shipperNameChange(e){
+        this.$set(this.inspect,'customerName',this.carNumberList[e].shipperName)
+        this.$set(this.inspect,'carNumber',this.carNumberList[e].carNo)
+        this.$set(this.inspect,'customerPhone',this.carNumberList[e].shipperPhone)
+        for (let i = 0; i < this.customerList1.length; i++) {
+          if(this.customerList1[i].customerName==this.inspect.customerName){
+            this.inspect.customerNumberCard=this.customerList1[i].customerNumberCard
+          }
+        }
+        if(this.inspect.goodsName && this.inspect.customerName){
+          // //查看当前用户对应货名有未结算状态的送货
+        let count = 0
+        getCount({
+          compId: localStorage.getItem('ws-pf_compId'),
+          customerName: this.inspect.customerName,
+          goodsName: this.inspect.goodsName,
+          customerNumberCard:this.inspect.customerNumberCard
+        })  .toPromise()
+          .then((response) => {
+               count = response
+          })
+          //  客户下拉校验
+        getamount({
+          compId: localStorage.getItem('ws-pf_compId'),
+          customerName: this.inspect.customerName,
+          goodsName: this.inspect.goodsName,
+          customerNumberCard:this.inspect.customerNumberCard
+        })
+          .toPromise()
+          .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/1000 < 50 || count > 0)&&this.tipFlag) {
+                  this.tipFlag = false
+                  this.$message('当前客户已累计销售我司' +this.inspect.goodsName + (response/1000).toFixed(2) +'吨,最高可售' +this.purchasePriceList[i].saleLimit +'吨。');
+                }
+              }
+            }
+          })
+        }
+      },
       customerChange(e) {
         let customers = e.split('(')
         this.inspect.customerName = customers[0]
@@ -937,6 +985,10 @@
               })
             }
           })
+          getshippinginfo({compId: localStorage.getItem('ws-pf_compId'),warehouseName:this.warehouseName}).toPromise()
+          .then((response) => {
+            this.carNumberList=response
+          })
         // 仓位
         getbinNumber({
             id: this.cangid