ソースを参照

Merge branch 'dev' of http://git.zthymaoyi.com:3000/gdc/yiliangyiyun-pc into dev

gjy 3 年 前
コミット
ebc0f759f3

+ 15 - 0
src/api/V2/contract/index.js

@@ -79,3 +79,18 @@ export const API_POST_PAYMONEY = '/collectionWarehousingRecord/api/payMoney'
 
 // 代收合同记录开票
 export const API_POST_INVOICING = '/collectionWarehousingRecord/api/openInvoiceList'
+
+// 代储合同代储费列表
+export const API_GET_STORAGEFEERECORDLIST = '/storageFeeRecord/selectInfo'
+
+// 生成代储费记录
+export const API_POST_ADDSTORAGEFEERECORD = '/storageFeeRecord/api/addStorageFeeRecord'
+
+// 修改代储费
+export const API_POST_EDITSTORAGEFEERECORD = '/storageFeeRecord/editInfo'
+
+// 代储收费
+export const API_POST_STORAGEFEERECORDCHARGE = '/storageFeeRecordCharge/api/addCharge'
+
+// 代储收费记录
+export const API_GET_FEERECORD = '/storageFeeRecordCharge/feeRecord'

+ 0 - 2
src/components/mapdrag/mapdrag.vue

@@ -114,8 +114,6 @@
       <el-button @click="anewselect" v-if='!isShowaddress'>重新选择</el-button>
       <el-button @click="submit" v-if='isShowaddress'>确定</el-button>
     </div>
-
-
   </div>
 </template>
 

+ 511 - 0
src/components/mapdrag/warehouseMap.vue

@@ -0,0 +1,511 @@
+<style lang='scss' scoped>
+  .mapContent {
+    position: relative;
+    margin-top: 50px;
+
+    .center-add {
+      position: absolute;
+      top: 0;
+      bottom: 0;
+      left: 0;
+      right: 0;
+      margin: auto;
+      z-index: 999;
+      width: 30px;
+      height: 30px;
+    }
+  }
+
+  #mapContainer {
+    width: 100%;
+    height: 330px;
+  }
+
+  #tip {
+    position: absolute;
+    top: -45px;
+    display: flex;
+  }
+
+  #tip .el-input {
+    // width: 179px;
+    margin-right: 0px;
+  }
+
+  #tip .el-select {
+    margin-right: 10px;
+  }
+
+  #tip .el-select {
+    width: 179px;
+  }
+
+  #tip .el-textarea {
+    width: 179px;
+
+    /deep/ .el-textarea__inner {
+      height: 40px;
+      resize: none;
+    }
+  }
+
+  .el-button--primary {
+    background-color: #5878e8;
+    border-color: #5878e8;
+  }
+
+  .el-button--default {
+    color: #5878e8;
+    border-color: #5473e8;
+  }
+
+  .address {
+    display: flex;
+    align-items: center;
+    margin-right: 20px;
+
+    // position:absolute;
+    // top: -35px;
+    .address-input {
+      display: inline-block;
+      width: 480px;
+    }
+  }
+</style>
+
+<template>
+  <div class="mapContent">
+    <img class='center-add' src="../../../public/img/zuobiao.gif" alt="" />
+    <div id="mapContainer"></div>
+    <div id="tip" v-show="showFlag === false ? false : true">
+      <!-- <el-select v-model="province" @change="selectP" placeholder="省">
+        <el-option
+          v-for="item in provinces"
+          :key="item.adcode"
+          :label="item.name"
+          :value="item.adcode"
+        >
+        </el-option>
+      </el-select>
+      <el-select v-model="city" @change="selectC" placeholder="市">
+        <el-option
+          v-for="item in citys"
+          :key="item.adcode"
+          :label="item.name"
+          :value="item.name"
+        >
+        </el-option>
+      </el-select>
+      <el-select v-model="district" @change="selectD" placeholder="区">
+        <el-option
+          v-for="item in districts"
+          :key="item.adcode"
+          :label="item.name"
+          :value="item.adcode"
+        >
+        </el-option>
+      </el-select> -->
+      <div class="address">
+        <el-input type="text" id="searchValue" placeholder="请输入关键字:" v-model="address" clearable class="address-input">
+        </el-input>
+      </div>
+      <el-button>经纬度:{{center}}</el-button>
+      <el-button @click="positions" type="primary" v-if='!isShowaddress'>确定定位</el-button>
+      <el-button @click="anewselect" v-if='!isShowaddress'>重新选择</el-button>
+      <el-button @click="submit" v-if='isShowaddress && !warehousePositioning'>确定</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+  import {
+    regionData,
+    CodeToText,
+    TextToCode
+  } from 'element-china-area-data'
+  import image from '../../../public/img/ic_locationmarker.jpg'
+  import AMapLoader from '@amap/amap-jsapi-loader';
+  export default {
+    data() {
+      return {
+        map: null,
+        provinces: [],
+        province: '',
+        districts: [],
+        district: '',
+        citys: [],
+        city: '',
+        polygons: [],
+        selectedOptions1: [],
+        areacode: '',
+        address: '',
+        objPoint: [],
+        markers: [],
+        zoomEnable: true,
+        dragEnable: true,
+        status: true,
+        center: '',
+      }
+    },
+    props: ['flagVisible', 'position', 'selectedOptions', 'isShowaddress', 'type','warehousePositioning'],
+    computed: {
+      showFlag() {
+        return this.flagVisible
+      },
+    },
+    watch: {
+      selectedOptions: {
+        handler(newValue, oldValue) {
+          this.province = CodeToText[newValue[0]]
+          this.selectP(this.province)
+          this.city = CodeToText[newValue[1]]
+          this.selectC(CodeToText[newValue[1]])
+          this.district = newValue[2]
+          this.selectD(this.district)
+        },
+        deep: true
+      }
+    },
+    async created() {
+      
+    },
+    mounted() {
+      
+      // AMapLoader.reset();
+      // 已载入高德地图API,则直接初始化地图
+      if (window.AMap && window.AMapUI) {
+        // 未载入高德地图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')
+        //  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) => {
+      setTimeout(() => {
+        var that = this
+        this.map = new AMap.Map('mapContainer', {
+          resizeEnable: true,
+          zoom: 10,
+          zoomEnable: this.zoomEnable,
+          dragEnable: this.dragEnable,
+        })
+        this.map.on('click', function(e) {
+          if (this.status) {
+            var marker = new AMap.Marker({
+              position: new AMap.LngLat(e.lnglat.getLng(), e.lnglat
+                .getLat()), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
+            })
+            that.map.remove(that.markers)
+            that.$emit('marker', e)
+            that.markers.push(marker)
+            // 将创建的点标记添加到已有的地图实例:
+            that.map.add(marker)
+          }
+        })
+        if(this.warehousePositioning.lat && this.warehousePositioning.lng){
+            this.map.setCenter([this.warehousePositioning.lat,this.warehousePositioning.lng])
+        }
+        this.marker = new AMap.Marker({
+          icon: new AMap.Icon({
+            size: new AMap.Size(0, 0),
+            image: image,
+          }),
+          map: that.map,
+        })
+        AMap.plugin(
+          ['AMap.AutoComplete', 'AMap.PlaceSearch', 'AMap.Geocoder', 'AMap.DistrictSearch'],
+          function() {
+            var autocomplete = new AMap.AutoComplete({
+              input: 'searchValue',
+            })
+            var placeSearch = new AMap.PlaceSearch({
+              city: that.acode,
+              citylimit: true,
+              pageSize: 1,
+              pageIndex: 1,
+              map: that.map,
+            })
+            var districtSearch = new AMap.DistrictSearch({
+              subdistrict: 1,
+              level: 'city',
+              showbiz: false,
+            });
+            autocomplete.on( 'select', function(e) {
+              that.marker.setMap(that.map)
+              if (e.poi.location) {
+                placeSearch.search() // 关键字查询查询
+                that.marker.setPosition(e.poi.location)
+                geocoder.getAddress(e.poi.location, function(status, result) {
+                  console.log(e.poi.location, "klokolkjolk")
+                  if (status === 'complete') {
+                    var obj = {}
+                    that.province = result.regeocode.addressComponent.province
+                    that.city = result.regeocode.addressComponent.city
+                    that.district = result.regeocode.addressComponent.district
+                    obj.formattedAddress = result.regeocode.formattedAddress
+                    obj.areacode = result.regeocode.addressComponent.adcode
+                    that.address = result.regeocode.formattedAddress
+                    obj.lat = e.poi.location.lat
+                    obj.lng = e.poi.location.lng
+                    that.$emit('searchAddress', obj)
+                  } else {
+                    that.$emit('searchAddress', '')
+                  }
+                  that.map.setFitView()
+                })
+              } else {
+                districtSearch.search(e.poi.name, (status, result1) => {
+                  if (status == 'complete') {
+                    that.marker.setPosition(result1.districtList[0].center)
+                    geocoder.getAddress(result1.districtList[0].center, function(status, result) {
+                      if (status === 'complete') {
+                        var obj = {}
+
+                        that.province = result.regeocode.addressComponent.province
+                        that.city = result.regeocode.addressComponent.city
+                        that.district = result.regeocode.addressComponent.district
+                        obj.formattedAddress = result.regeocode.formattedAddress
+                        obj.areacode = result.regeocode.addressComponent.adcode
+                        that.address = result.regeocode.formattedAddress
+                        obj.lat = result1.districtList[0].center.lat
+                        obj.lng = result1.districtList[0].center.lng
+                        that.$emit('searchAddress', obj)
+                      } else {
+                        that.$emit('searchAddress', '')
+                      }
+                      that.map.setFitView()
+                    })
+
+
+                  }
+                })
+              }
+            })
+            // 经纬度
+            var geocoder = new AMap.Geocoder({
+              radius: 1000,
+            })
+            that.map.on('moveend', function(e) {
+              //地图变动之后需要重新赋值省市区,未完成
+              that.center = that.map.getCenter(); //获取当前地图中心位置
+              console.log(that.center)
+              that.center.lat = Number(that.center.lat.toFixed(3))
+              that.center.lng = Number(that.center.lng.toFixed(3))
+              for (var i = 0, l = that.polygons.length; i < l; i++) {
+                that.polygons[i].setMap(null)
+              }
+              that.marker.setMap(that.map)
+              that.marker.setPosition(that.center)
+              geocoder.getAddress(that.center, function(status, result) {
+                if (status === 'complete') {
+                  var obj = {}
+                  that.province = result.regeocode.addressComponent.province
+                  that.city = result.regeocode.addressComponent.city
+                  that.district = result.regeocode.addressComponent.district
+                  obj.formattedAddress = result.regeocode.formattedAddress
+                  obj.areacode = result.regeocode.addressComponent.adcode
+                  that.address = result.regeocode.formattedAddress
+                  obj.lat = that.center.lat
+                  obj.lng = that.center.lng
+                  that.$emit('pickedAddress', obj)
+                } else {
+                  that.$emit('pickedAddress', '')
+                }
+              })
+            });
+            that.map.on('zoomend', function() {
+              //地图变动之后需要重新赋值省市区,未完成
+              // this.zoom = map.getZoom(); //获取当前地图级别
+              that.center = that.map.getCenter(); //获取当前地图中心位置
+              console.log(that.center)
+              that.center.lat = Number(that.center.lat.toFixed(3))
+              that.center.lng = Number(that.center.lng.toFixed(3))
+              for (var i = 0, l = that.polygons.length; i < l; i++) {
+                that.polygons[i].setMap(null)
+              }
+              that.marker.setMap(that.map)
+              that.marker.setPosition(that.center)
+              geocoder.getAddress(that.center, function(status, result) {
+                if (status === 'complete') {
+                  var obj = {}
+                  that.province = result.regeocode.addressComponent.province
+                  that.city = result.regeocode.addressComponent.city
+                  that.district = result.regeocode.addressComponent.district
+                  obj.formattedAddress = result.regeocode.formattedAddress
+                  obj.areacode = result.regeocode.addressComponent.adcode
+                  that.address = result.regeocode.formattedAddress
+                  obj.lat = that.center.lat
+                  obj.lng = that.center.lng
+                  that.$emit('pickedAddress', obj)
+                } else {
+                  that.$emit('pickedAddress', '')
+                }
+              })
+            });
+            // 根据坐标点定位,获取地址的详细信息
+            if (that.position) {
+              that.marker.setMap(that.map)
+              that.marker.setPosition(that.position)
+              geocoder.getAddress(that.position, function(status, result) {
+                if (status === 'complete') {
+                  var obj = {}
+                  obj.formattedAddress = result.regeocode.formattedAddress
+                  obj.areacode = result.regeocode.addressComponent.adcode
+                  that.address = result.regeocode.formattedAddress
+                  that.$emit('positionAddress', obj)
+                  that.province = result.regeocode.addressComponent.province
+                  that.city = result.regeocode.addressComponent.city
+                  that.district = result.regeocode.addressComponent.district
+                }
+              })
+              that.map.setFitView()
+            } else {
+              return false
+            }
+          }
+        )
+      }, 500)
+      this.loadmap()
+        // this.loadmap()
+        }).catch(e => {
+          console.log(e);
+        })
+      }
+    },
+    methods: {
+       clearVal () {
+       this.address = ''
+       this.center=''
+        var status = {
+          zoomEnable: true,
+          dragEnable: true,
+        }
+        this.map.setStatus(status)
+        this.loadmap()
+    },
+      positions() {
+        this.status = false
+        var status = {
+          zoomEnable: false,
+          dragEnable: false,
+        }
+        this.map.setStatus(status)
+        this.loadmap()
+        let _data = []
+        _data.push(this.province)
+        _data.push(this.city)
+        _data.push(this.district)
+        _data.push(this.address)
+        _data.push(this.type)
+        this.$emit('addressListen', _data)
+      },
+      anewselect() {
+        this.status = true
+        var status = {
+          zoomEnable: true,
+          dragEnable: true,
+        }
+
+        this.map.setStatus(status)
+        this.loadmap()
+      },
+      loadmap(val) {
+        let params = val
+        var that = this // 插件
+        for (var j = 0, k = that.polygons.length; j < k; j++) {
+          that.polygons[j].setMap(null)
+        }
+        AMap.plugin(['AMap.DistrictSearch', 'AMap.Polygon'], function() {
+          // 标注
+          var opts = {
+            subdistrict: 1,
+            extensions: 'all',
+            showbiz: false,
+          }
+          var district = new AMap.DistrictSearch(opts) // 注意:需要使用插件同步下发功能才能这样直接使用
+          function getData(data) {
+            console.log(data)
+            that.$emit('selectedAddress', data)
+            // 清除地图上的所有覆盖物
+            that.areacode = data.citycode
+            var bounds = data.boundaries
+            if (data.level === 'country') {
+              that.provinces = data.districtList
+              that.citys = []
+              that.districts = []
+            } else if (data.level === 'province') {
+              that.map.remove(that.marker)
+              that.citys = data.districtList
+              that.districts = []
+              that.address = ''
+            } else if (data.level === 'city') {
+              that.districts = data.districtList
+            }
+            if (data.level === 'country' && bounds) {
+              return false
+            } else {
+              for (var i = 0, l = bounds.length; i < l; i++) {
+                var polygon = new AMap.Polygon({
+                  map: that.map,
+                  strokeWeight: 1,
+                  strokeColor: '#CC66CC',
+                  fillColor: '#CCF3FF',
+                  fillOpacity: 0.5,
+                  path: bounds[i],
+                })
+                that.polygons.push(polygon)
+              }
+              that.map.setFitView()
+            }
+          }
+          let sear = val ? params : '中国'
+          district.search(sear, function(status, result) {
+            if (status === 'complete') {
+              getData(result.districtList[0])
+            }
+          })
+        })
+      },
+      selectP(val) {
+        this.province = CodeToText[val]
+        if (this.status) {
+          this.$emit('provinceChange', val)
+          this.loadmap(val)
+          this.city = ''
+          this.district = ''
+        }
+      },
+      selectC(val) {
+        console.log(val)
+        if (this.status) {
+          this.loadmap(val)
+          this.district = ''
+        }
+      },
+      selectD(val) {
+        this.district = CodeToText[val]
+        if (this.status) {
+          this.loadmap(val)
+        }
+      },
+      submit() {
+        let _data = []
+        _data.push(this.province)
+        _data.push(this.city)
+        _data.push(this.district)
+        _data.push(this.address)
+        _data.push(this.type)
+        _data.push(this.center)
+        this.$emit('addressListen', _data)
+        this.$parent.blurMap()
+        console.log("submit")
+      }
+    },
+  }
+</script>

+ 21 - 1
src/model/contarct/index.js

@@ -35,7 +35,12 @@ import {
     API_POST_COLLECTMONEY,
     API_POST_PAYMONEY,
     API_POST_INVOICING,
-    API_POST_EXPORT2
+    API_POST_EXPORT2,
+    API_GET_STORAGEFEERECORDLIST,
+    API_POST_ADDSTORAGEFEERECORD,
+    API_POST_EDITSTORAGEFEERECORD,
+    API_POST_STORAGEFEERECORDCHARGE,
+    API_GET_FEERECORD
 } from '@/api/V2/contract'
 // 列表
 export const getList = appRx.get(API_GET_CONTRACT_TENANT, errorCatcher, errorHandle, filter)
@@ -116,3 +121,18 @@ export const payMoney = appRx.post(API_POST_PAYMONEY, errorCatcher, errorHandle,
 
  // 代收合同记开票
 export const invoicing = appRx.post(API_POST_INVOICING, errorCatcher, errorHandle, filter)
+
+// 代储合同代储费列表
+export const storageFeeRecordList = appRx.get(API_GET_STORAGEFEERECORDLIST, errorCatcher, errorHandle, filter)
+
+// 生成代储费记录
+export const addStorageFeeRecord = appRx.post(API_POST_ADDSTORAGEFEERECORD, errorCatcher, errorHandle, filter)
+
+// 修改代储费
+export const editStorageRecordInfo = appRx.post(API_POST_EDITSTORAGEFEERECORD, errorCatcher, errorHandle, filter)
+
+// 代储收费
+export const storageFeeRecordCharge = appRx.post(API_POST_STORAGEFEERECORDCHARGE, errorCatcher, errorHandle, filter)
+
+// 代储收费
+export const feeRecord = appRx.get(API_GET_FEERECORD, errorCatcher, errorHandle, filter)

+ 1 - 1
src/views/contractManagement/component/routers/route.js

@@ -464,7 +464,7 @@ const contractManagementRouter = {
         shortcutEntrance: 'contractManagement',
         module: 'contractManagement.dsContract.dsContractInfo.list',
         permissicon: [],
-        keepAlive: true
+        keepAlive: false
         // module: 'procurement.sparepart.applDetail'
       },
       hidden: true

+ 9 - 4
src/views/contractManagement/storageContract.vue

@@ -43,11 +43,11 @@
       <el-table-column prop="seller" label="卖方"> </el-table-column>
       <el-table-column prop="weight" label="重量(吨)"> </el-table-column>
       <el-table-column prop="completedQuantity" label="已完成(吨)">
-        <template slot-scope="scope">
+    <!--    <template slot-scope="scope">
           <span style="color: #5473e8; font-weight: 600">{{
             scope.row.completedQuantity
           }}</span>
-        </template>
+        </template> -->
       </el-table-column>
       <el-table-column prop="grainMoney" label="粮款(元)"> </el-table-column>
       <el-table-column prop="storageFeeNew" label="代储费(元)"> </el-table-column>
@@ -449,7 +449,7 @@
           }
         }
       },
-      fujian(row) {
+      fujian(row) {debugger
         this.id = row.id
         this.accessoryTFs = true
         this.appendixIdss = row.addressUrl
@@ -560,7 +560,7 @@
           })
       },
       //记录
-      handleRecord(row) {
+      handleRecord(row) {debugger
         this.$router.push({
           name: 'storageContractRecord',
           query: {
@@ -570,6 +570,11 @@
             completedQuantity: row.completedQuantity,
             total: row.total,
             received: row.received,
+            storageFee:row.storageFee,
+            storageFeeStartdate:row.storageFeeStartdate,
+            storageFeeEnddate:row.storageFeeEnddate,
+            storageFeeWeight:row.storageFeeWeight,
+            contractId:row.id
           },
         })
       },

+ 313 - 350
src/views/contractManagement/storageContractRecord.vue

@@ -5,27 +5,28 @@
       <div class="right">
         <el-date-picker class="date-select" size="small" style="margin: 0 10px 0 0" value-format="yyyy-MM-dd"
           v-model="value2" @change="datechange" type="daterange" align="right" unlink-panels range-separator="至"
-          start-placeholder="结算时间起" end-placeholder="结算时间止">
+          start-placeholder="结算时间起" end-placeholder="结算时间止" :picker-options="pickerOptions">
         </el-date-picker>
-        <el-button type='primary' @click='addRecord'>生成代储记录</el-button>
+        <!--  -->
+        <el-button type='primary' @click='addRecord' v-if="isSHowAddRecordBtn">生成代储记录</el-button>
         <el-button type="primary" @click="exportlist"
-          v-hasPermission="`contractManagement.dsContract.dsContractInfo.export`">导出
+          v-hasPermission="`contractManagement.dsContract.dsContractInfo.export`" v-if="isSHowExportBtn">导出
         </el-button>
         <el-button type="primary" @click="collectMoney"
-          v-hasPermission="`contractManagement.dsContract.dsContractInfo.shou`">收费
+          v-hasPermission="`contractManagement.dsContract.dsContractInfo.shou`" v-if="isSHowExportBtn">收费
         </el-button>
-        <el-button type='primary' @click='collectMoneyRecord'>收费记录</el-button>
+        <el-button type='primary' @click='collectMoneyRecord' v-if="isSHowExportBtn">收费记录</el-button>
       </div>
     </div>
     <div class="content-top">
-      <div class="content-top-item">合同编号:{{topThreeData.contractNo}}</div>
-      <div class="content-top-item">买方:{{topThreeData.buyer}}</div>
-      <div class="content-top-item">合同量:{{topThreeData.weight}}</div>
-      <div class="content-top-item">已完成量:{{topThreeData.completed}}</div>
-      <div class="content-top-item">应收代储费:{{topThreeData.agencyCharge}}</div>
-      <div class="content-top-item">已收代储费:{{topThreeData.agencyCharge}}</div>
+      <div class="content-top-item">合同编号:{{routeData.contractNo}}</div>
+      <div class="content-top-item">买方:{{routeData.buyer}}</div>
+      <div class="content-top-item">合同量:{{routeData.weight}}</div>
+      <div class="content-top-item">已完成量:{{routeData.completedQuantity}}</div>
+      <div class="content-top-item">应收代储费:{{routeData.total}}</div>
+      <div class="content-top-item">已收代储费:{{routeData.received}}</div>
     </div>
-    <div v-if="isShowRecord">
+    <div v-show="isShowRecord">
       <el-table :data="recordList" ref="table" style="width: 100%; margin-top: 20px" border height="calc(100% - 190px)">
         <el-table-column type="index" label="序号">
           <template scope="scope">
@@ -34,12 +35,12 @@
           </template>
         </el-table-column>
         <el-table-column class="table_td" prop="goodsName" label="货名"></el-table-column>
-        <el-table-column class="table_td" prop="inDate" label="入库日期" width="150"></el-table-column>
-        <el-table-column class="table_td" prop="netWeight" label="当日入库量(吨)"></el-table-column>
-        <el-table-column class="table_td" prop="netWeight" label="当日出库量(吨)"></el-table-column>
-        <el-table-column class="table_td" prop="netWeight" label="当日计费储量(吨)"></el-table-column>
-        <el-table-column class="table_td" prop="unitHave" label="代储费(元/吨天)"></el-table-column>
-        <el-table-column class="table_td" prop="amountIngPayable" label="应付(元)"></el-table-column>
+        <el-table-column class="table_td" prop="storageFeeDate" label="日期" width="150"></el-table-column>
+        <el-table-column class="table_td" prop="storageVolume" label="当日入库量(吨)"></el-table-column>
+        <el-table-column class="table_td" prop="deliveryVolume" label="当日出库量(吨)"></el-table-column>
+        <el-table-column class="table_td" prop="dailyBillingReserves" label="当日计费储量(吨)"></el-table-column>
+        <el-table-column class="table_td" prop="storageFee" label="代储费(元/吨天)"></el-table-column>
+        <el-table-column class="table_td" prop="receivable" label="应收(元)"></el-table-column>
         <el-table-column class="table_td" prop="collectionEdPayable" label="操作" width="300">
           <template scope="scope">
             <el-button @click="storageFeeLook(scope.row)">代储费</el-button>
@@ -55,20 +56,21 @@
       </el-pagination>
     </div>
     <!-- 修改代储费 -->
-    <el-dialog :visible.sync="editStorageFee" :append-to-body="true" title="修改代储费" class="sk-dialog"  width="400px!important">
+    <el-dialog :visible.sync="editStorageFee" :append-to-body="true" title="修改代储费" class="sk-dialog"
+      width="400px!important">
       <div class="sf-dialog">
         <div class="row">
           <div class="left">代储费(元/吨·天)</div>
           <div class="right">
-            <el-input type="number" @mousewheel.native.prevent v-model="collectionments.money"
-              placeholder="请输入代储费" maxlength="100" size="small" />
+            <el-input type="number" @mousewheel.native.prevent v-model="editRecordObj.storageFee" placeholder="请输入代储费"
+              maxlength="100" size="small" />
           </div>
         </div>
         <div class="row">
           <div class="left">起用日期</div>
           <div class="right">
-           <el-input type="number" @mousewheel.native.prevent v-model="collectionments.money" placeholder=""
-             maxlength="100" size="small" disabled />
+            <el-input type="text" @mousewheel.native.prevent v-model="recordObj.storageFeeStartdate" placeholder=""
+              maxlength="100" size="small" disabled />
           </div>
         </div>
         <div class="row row-last">
@@ -78,20 +80,21 @@
       </div>
     </el-dialog>
     <!-- 入库 -->
-    <el-dialog :visible.sync="editWarehousing" :append-to-body="true" title="修改入库量" class="sk-dialog"  width="400px!important">
+    <el-dialog :visible.sync="editWarehousing" :append-to-body="true" title="修改入库量" class="sk-dialog"
+      width="400px!important">
       <div class="sf-dialog">
         <div class="row">
           <div class="left">当日入库量(吨)</div>
           <div class="right">
-            <el-input type="number" @mousewheel.native.prevent v-model="collectionments.money"
+            <el-input type="number" @mousewheel.native.prevent v-model="editWarehousingObj.storageVolume"
               placeholder="请输入入库量" maxlength="100" size="small" />
           </div>
         </div>
         <div class="row">
           <div class="left">入库日期</div>
           <div class="right">
-           <el-input type="number" @mousewheel.native.prevent v-model="collectionments.money" placeholder=""
-             maxlength="100" size="small" disabled />
+            <el-input type="text" @mousewheel.native.prevent v-model="rowData.storageFeeDate" placeholder=""
+              maxlength="100" size="small" disabled />
           </div>
         </div>
         <div class="row row-last">
@@ -107,28 +110,28 @@
         <div class="row">
           <div class="left">代储费(元/吨·天)</div>
           <div class="right">
-            <el-input type="number" @mousewheel.native.prevent v-model="collectionments.money" placeholder=""
+            <el-input type="number" @mousewheel.native.prevent v-model="recordObj.storageFee" placeholder=""
               maxlength="100" size="small" disabled />
           </div>
         </div>
         <div class="row">
           <div class="left">起算日期</div>
           <div class="right">
-            <el-input type="number" @mousewheel.native.prevent v-model="collectionments.money" placeholder=""
+            <el-input type="text" @mousewheel.native.prevent v-model="recordObj.storageFeeStartdate" placeholder=""
               maxlength="100" size="small" disabled />
           </div>
         </div>
         <div class="row">
-          <div class="left">起算日期</div>
+          <div class="left">预计截止日期</div>
           <div class="right">
-            <el-input type="number" @mousewheel.native.prevent v-model="collectionments.money" placeholder=""
+            <el-input type="text" @mousewheel.native.prevent v-model="recordObj.storageFeeEnddate" placeholder=""
               maxlength="100" size="small" disabled />
           </div>
         </div>
         <div class="row">
           <div class="left">起算重量(吨)</div>
           <div class="right">
-            <el-input type="number" @mousewheel.native.prevent v-model="collectionments.money" placeholder=""
+            <el-input type="number" @mousewheel.native.prevent v-model="recordObj.storageFeeWeight" placeholder=""
               maxlength="100" size="small" disabled />
           </div>
         </div>
@@ -144,15 +147,14 @@
         <div class="row">
           <div class="left">金额(元)</div>
           <div class="right">
-            <el-input type="number" @mousewheel.native.prevent v-model="collectionments.money"
+            <el-input type="number" @mousewheel.native.prevent v-model="chargeObj.amountMoney"
               placeholder="请输入本次收款金额(元)" maxlength="100" size="small" />
           </div>
         </div>
         <div class="row">
           <div class="left">收款日期</div>
           <div class="right">
-            <el-date-picker v-model="collectionments.collectionDate" type="date" placeholder="选择日期"></el-date-picker>
-            </el-form-item>
+            <el-date-picker v-model="chargeObj.collectionDate" type="date" placeholder="选择日期"></el-date-picker>
           </div>
         </div>
         <div class="row">
@@ -173,22 +175,23 @@
     </el-dialog>
     <!-- 收费记录 -->
     <el-dialog :visible.sync="dialogVisible" title="收费记录" class="sfjl-dialog">
-      <el-table :data="recordList" ref="table" style="width: 100%; margin-top: 20px" border height="calc(100% - 190px)">
+      <el-table :data="sfRecordList" ref="table" style="width: 100%; margin-top: 20px" border
+        height="calc(100% - 190px)">
         <el-table-column type="index" label="序号">
           <template scope="scope">
             <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
             <span v-else>{{ scope.$index + 1 }}</span>
           </template>
         </el-table-column>
-        <el-table-column class="table_td" prop="goodsName" label="金额(元)"></el-table-column>
-        <el-table-column class="table_td" prop="inDate" label="收费日期"></el-table-column>
-        <el-table-column class="table_td" prop="inDate" label="操作日期"></el-table-column>
-        <el-table-column class="table_td" prop="unitHave" label="操作人"></el-table-column>
-        <el-table-column class="table_td" prop="addressUrl" label="附件">
+        <el-table-column class="table_td" prop="amountMoney" label="金额(元)"></el-table-column>
+        <el-table-column class="table_td" prop="collectionDate" label="收费日期"></el-table-column>
+        <el-table-column class="table_td" prop="updateDate" label="操作日期"></el-table-column>
+        <el-table-column class="table_td" prop="operator" label="操作人"></el-table-column>
+        <el-table-column class="table_td" prop="collectionScreenshot" label="附件">
           <template slot-scope="scope">
             <img width="18" height="20" style="vertical-align: text-top; position: relative; top: -1px"
               src="../../../public/img/fujian.png" @click="fujian(scope.row)" alt="" />
-            <span v-if="scope.row.addressUrlArray != null">
+            <span v-if="scope.row.addressUrlArray != null">00
               {{scope.row.addressUrlArray.length == 0? "":scope.row.addressUrlArray.length}}
             </span>
           </template>
@@ -197,62 +200,95 @@
 
       <WinseaContentModal v-model="accessoryTFs" :title="$t('system.noticeCircular.information')"
         @on-cancel="handleClose">
-        <ws-upload ref="upload" :size-limit="2" @onChange="onChange" :comp-id="compId" :appendix-ids="appendixIdss"
-          accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar" />
+        <div class="image-list">
+          <el-image v-for="(item,index) in fjImageList" style="width: 100px; height: 100px" :src="item" fit="fill"
+            :preview-src-list="fjImageList"></el-image>
+        </div>
       </WinseaContentModal>
       <div class="close-sfju-dialog">
-        <el-button  type='primary' @click='dialogVisible=false'>关闭</el-button>
+        <el-button type='primary' @click='dialogVisible=false'>关闭</el-button>
       </div>
 
     </el-dialog>
   </div>
 </template>
 <script>
+  // import {
+  //   dayjs,
+  //   EventBus
+  // } from 'base-core-lib'
+  // import {
+  //   downloadFile
+  // } from '@/utils/batchDown'
+  // import JSZip from 'jszip'
+  // import FileSaver from 'file-saver'
   import {
-    dayjs,
-    EventBus
-  } from 'base-core-lib'
-  import {
-    downloadFile
-  } from '@/utils/batchDown'
-  import JSZip from 'jszip'
-  import FileSaver from 'file-saver'
-  import {
-    selectCollectionWarehousingRecordPage,
-    insertCollectionWarehousingRecord,
-    selectIdentityByCard,
-    editCollectionWarehousingRecord,
-    deleteCollectionWarehousingRecord,
-    exportCollectionWarehousingRecord,
-    payMoney,
-    collectMoneyApi,
-    invoicing
+    // selectCollectionWarehousingRecordPage,
+    // insertCollectionWarehousingRecord,
+    // selectIdentityByCard,
+    // editCollectionWarehousingRecord,
+    // deleteCollectionWarehousingRecord,
+    // exportCollectionWarehousingRecord,
+    // payMoney,
+    // collectMoneyApi,
+    // invoicing
+    storageFeeRecordList,
+    addStorageFeeRecord,
+    editStorageRecordInfo,
+    storageFeeRecordCharge,
+    feeRecord
   } from '@/model/contarct/index'
-  import {
-    selectWarehouseSelf,
-    getCustomerManage,
-    getCustomerLook,
-  } from '@/model/houseSelfCollect/index'
-  import {
-    posthandle,
-    postqueryhandle
-  } from '@/model/purchasingManagement/index'
-  import paymentPrint from './component/paymentPrint.vue'
-  import {
-    getHp
-  } from '@/utils/getHasPermission'
+  // import {
+  //   selectWarehouseSelf,
+  //   getCustomerManage,
+  //   getCustomerLook,
+  // } from '@/model/houseSelfCollect/index'
+  // import {
+  //   posthandle,
+  //   postqueryhandle
+  // } from '@/model/purchasingManagement/index'
+  // import paymentPrint from './component/paymentPrint.vue'
+  // import {
+  //   getHp
+  // } from '@/utils/getHasPermission'
   import download from '../../components/WsDownload/download'
   import WsUpload from '@/components/WsUpload'
   export default {
     components: {
-      paymentPrint,
       WsUpload
     },
     watch: {},
     data() {
       return {
-        editWarehousing:false,
-        editStorageFee:false,
+        fjImageList:[],
+        sfRecordList: [],
+        rowData: {},
+        //公司id,合同id,金额,收费截图,收费日期,操作人
+        chargeObj: {
+          compId: '',
+          contractId: '',
+          amountMoney: '',
+          collectionScreenshot: '',
+          collectionDate: "",
+          operator: '',
+        },
+        editWarehousingObj: {
+          id: '',
+          storageVolume: '',
+        },
+        editRecordObj: {
+          id: '',
+          storageFee: '',
+          flag: 1
+        },
+        pickerOptions: {},
+        isSHowExportBtn: false,
+        isSHowAddRecordBtn: false,
+        recordObj: {
+          storageFeeStartdate: ''
+        },
+        editWarehousing: false,
+        editStorageFee: false,
         addRecoredDialog: false,
         compId: localStorage.getItem('ws-pf_compId'),
         id: '',
@@ -261,20 +297,9 @@
         isShowRecord: false,
         isShowPrintType: false,
         collectForm: false,
-        topThreeData: {},
+        routeData: {},
         // viewLock: false,
-
         formLabelWidth: '300px',
-        deleteshow: false,
-        customerlist: {
-          payeeAddressUrls: [],
-        },
-        customerList: {
-          customerName: '',
-          customerNumberCard: '',
-          bankCard: '',
-          bankDeposit: '',
-        },
         selectCustomerList: [],
         // selectPrintList: [],
         identity: [],
@@ -288,25 +313,15 @@
         searchType: '',
         searchTypeText: '',
         searchKeyWord: '',
-        // warehouseList: [],
-        // warehouseNameKey: '',
-        // warehouseName: '',
+
         isShowPrint: false,
         printData: {},
         warehouse: [],
         disabled: false,
-        // dialogImageUrl: '',
         dialogVisible: false,
         value1: '', //付款日期
         modification: [],
         userJurisdiction: true,
-        payments: {
-          amountNotPayable: 0,
-          paymentDate: '',
-        },
-        collectionments: {
-          collectionmentDate: '',
-        },
         showPayImgs: false,
         isShowAdopt: false,
         //上传截图路径
@@ -314,37 +329,48 @@
         payImg: [],
         rowData: {},
         value2: [],
-        date: {
-          year: dayjs().format('YYYY'),
-          month: dayjs().format('MM'),
-        },
       }
     },
-    activated() {
-      this.topThreeData = {
+    destroyed: function() {
+      debugger
+      this.editWarehousing = false
+      this.editStorageFee = false
+      this.addRecoredDialog = false
+      this.isShowRecord = false
+    },
+    mounted() {
+      debugger
+      let that = this
+      this.routeData = {
         contractNo: this.$route.query.contractNo,
         compId: this.$route.query.compId,
         buyer: this.$route.query.buyer,
-        goodsName: this.$route.query.goodsName,
         weight: this.$route.query.weight,
-        completed: this.$route.query.completed,
-        agencyCharge: this.$route.query.agencyCharge
+        completedQuantity: this.$route.query.completedQuantity,
+        total: this.$route.query.total,
+        received: this.$route.query.received,
+        storageFee: this.$route.query.storageFee,
+        storageFeeStartdate: this.$route.query.storageFeeStartdate,
+        storageFeeEnddate: this.$route.query.storageFeeEnddate,
+        storageFeeWeight: this.$route.query.storageFeeWeight,
+      }
+      this.recordObj = {
+        storageFee: this.$route.query.storageFee,
+        storageFeeStartdate: this.$route.query.storageFeeStartdate,
+        storageFeeEnddate: this.$route.query.storageFeeEnddate,
+        storageFeeWeight: this.$route.query.storageFeeWeight,
+      }
+      this.value2 = [this.$route.query.storageFeeStartdate, this.$route.query.storageFeeEnddate]
+      this.pickerOptions = {
+        disabledDate(time) {
+          return (time.getTime() < (new Date(that.recordObj.storageFeeStartdate).getTime() - 86400000)) || (time
+            .getTime() >
+            new Date(that.recordObj.storageFeeEnddate).getTime())
+        }
       }
-
-      this.userJurisdiction = getHp('acquisitionManagement.acquisitionPay.print')
-      this.getPassYearFormatDate()
-      // this.getWarehouse()
       this.getList()
     },
-    updated() {
-      this.$nextTick(() => {
-        this.$refs['table'].doLayout()
-      })
-    },
     methods: {
-
-
-
       handleChange(file, fileList) {
         this.excelData = []
         this.jjSelectPrintList = []
@@ -369,40 +395,41 @@
         }
 
       },
-
-
       handleClose() {
         // this.dialogViewSpareMoney = false
       },
       onChange() {
-        this.$refs.upload
-          .handleSaveBill()
-          .then(async (response) => {
-            this.deptBudgetList.addressUrl = response
-            this.deptBudgetList.id = this.id
-            this.deptBudgetList.flag = 1
-            editInfo(this.deptBudgetList)
-              .toPromise()
-              .then((response) => {
-                this.accessoryTFs = false
-                this.$message.success('上传成功')
-                this.getList()
-              })
-          })
-          .catch((res) => {
-            EventBus.$emit('error', (JSON.parse(res) || {}).message)
-            this.$refs.upload.clearFiles()
-          })
+        // this.$refs.upload
+        //   .handleSaveBill()
+        //   .then(async (response) => {
+        //     this.deptBudgetList.addressUrl = response
+        //     this.deptBudgetList.id = this.id
+        //     this.deptBudgetList.flag = 1
+        //     editInfo(this.deptBudgetList)
+        //       .toPromise()
+        //       .then((response) => {
+        //         this.accessoryTFs = false
+        //         this.$message.success('上传成功')
+        //         this.getList()
+        //       })
+        //   })
+        //   .catch((res) => {
+        //     EventBus.$emit('error', (JSON.parse(res) || {}).message)
+        //     this.$refs.upload.clearFiles()
+        //   })
       },
       // 收费记录附件
       fujian(row) {
+        debugger
         this.id = row.id
         this.accessoryTFs = true
-        this.appendixIdss = row.addressUrl
+        this.appendixIdss = row.collectionScreenshot
         console.log(this.appendixIdss)
       },
       // 代储费
       storageFeeLook(row) {
+        this.editRecordObj.id = row.id;
+        this.editRecordObj.storageFee = row.storageFee
         this.editStorageFee = true
 
         // this.customerInfo = true
@@ -411,60 +438,95 @@
       },
       // 入库
       warehousingLook(row) {
+        this.rowData = row
+        this.editWarehousingObj = {
+          id: row.id,
+          storageVolume: row.storageVolume,
+        }
         this.editWarehousing = true
+
         // this.getCustomerNumberCard(row)
       },
       // 修改代储费
-      editStorageFeeSubmit(){
-
+      editStorageFeeSubmit() {
+        editStorageRecordInfo(this.editRecordObj)
+          .toPromise()
+          .then((response) => {
+            this.$message.success('修改成功!')
+            this.editStorageFee = false
+            this.getList()
+          })
       },
       // 修改入库量
-      editWarehousingSubmit(){
-
+      editWarehousingSubmit() {
+        editStorageRecordInfo(this.editWarehousingObj)
+          .toPromise()
+          .then((response) => {
+            this.$message.success('修改成功!')
+            this.editWarehousing = false
+            this.getList()
+          })
       },
       // 收费记录
       collectMoneyRecord() {
+        feeRecord({
+            contractId: this.$route.query.contractId
+          })
+          .toPromise()
+          .then((response) => {
+            debugger
+            this.sfRecordList = response
+            for (let i = 0; i < response.length; i++) {
+              response[i].addressUrlArray = response[i].collectionScreenshot.split(',')
+              this.fjImageList = response[i].collectionScreenshot.split(',')
+            }
+            // this.$message.success('修改成功!')
+            // this.editWarehousing = false
+            // this.getList()
+          })
+
         this.dialogVisible = true
       },
       // 终止,取消终止
       stop(row) {
-        this.$confirm(
-            '确定取消终止,继续收费?',
-            '提示', {
-              confirmButtonText: '确定',
-              cancelButtonText: '取消',
-              type: 'warning',
-            }
-          )
-          .then(() => {
-            // deleteCollectionWarehousingRecord({
-            //     id: row.id,
-            //   })
-            //   .toPromise()
-            //   .then((response) => {
-            //     this.$message.success('删除成功')
-            //     this.getList()
-            //   })
-          })
-          .catch(() => {
-            return false
-          })
-        this.$confirm(
-            '已达到预计终止日期,如需继续收费请前往合同修改终止日期?',
-            '提示', {
-              confirmButtonText: '确定',
-              cancelButtonText: '取消',
-              type: 'warning',
-            }
-          )
-          .then(() => {
+        // this.$confirm(
+        //     '确定取消终止,继续收费?',
+        //     '提示', {
+        //       confirmButtonText: '确定',
+        //       cancelButtonText: '取消',
+        //       type: 'warning',
+        //     }
+        //   )
+        //   .then(() => {
+        //     // deleteCollectionWarehousingRecord({
+        //     //     id: row.id,
+        //     //   })
+        //     //   .toPromise()
+        //     //   .then((response) => {
+        //     //     this.$message.success('删除成功')
+        //     //     this.getList()
+        //     //   })
+        //   })
+        //   .catch(() => {
+        //     return false
+        //   })
+        // this.$confirm(
+        //     '已达到预计终止日期,如需继续收费请前往合同修改终止日期?',
+        //     '提示', {
+        //       confirmButtonText: '确定',
+        //       cancelButtonText: '取消',
+        //       type: 'warning',
+        //     }
+        //   )
+        //   .then(() => {
 
-          })
-          .catch(() => {
-            return false
-          })
+        //   })
+        //   .catch(() => {
+        //     return false
+        //   })
+        debugger
         this.$confirm(
-            '20XX-xx-xx之后将不在计费,是否确定终止?',
+            row.storageFeeDate+'之后将不在计费,是否确定终止?',
             '提示', {
               confirmButtonText: '确定',
               cancelButtonText: '取消',
@@ -484,49 +546,16 @@
         this.addRecoredDialog = true
       },
 
-      previewPayOrder(val) {
-        this.paymentReceipt = val.paymentScreenshot
-        this.isPreviewPayOrder = true
-        console.log(val.paymentScreenshot)
+      // previewPayOrder(val) {
+      //   this.paymentReceipt = val.paymentScreenshot
+      //   this.isPreviewPayOrder = true
+      //   console.log(val.paymentScreenshot)
 
-      },
+      // },
       // paymentReceiptClose() {},
       datechange() {
         this.getList()
       },
-      getPassYearFormatDate() {
-        var nowDate = new Date()
-        nowDate.setTime(nowDate.getTime() - 24 * 60 * 60 * 1000 * 30)
-        var seperator1 = '-'
-        var year = nowDate.getFullYear()
-        var month = nowDate.getMonth() + 1
-        var strDate = nowDate.getDate()
-        if (month >= 1 && month <= 9) {
-          month = '0' + month
-        }
-        if (strDate >= 0 && strDate <= 9) {
-          strDate = '0' + strDate
-        }
-        var formatDate = year + seperator1 + month + seperator1 + strDate
-        this.getNowFormatDate(formatDate)
-      },
-      /* 获取现在时间,并接受过去时间的值 */
-      getNowFormatDate(formatDate) {
-        var date = new Date()
-        date.setTime(date.getTime() + 24 * 60 * 60 * 1000)
-        var seperator1 = '-'
-        var year = date.getFullYear()
-        var month = date.getMonth() + 1
-        var strDate = date.getDate()
-        if (month >= 1 && month <= 9) {
-          month = '0' + month
-        }
-        if (strDate >= 0 && strDate <= 9) {
-          strDate = '0' + strDate
-        }
-        var nowData = year + seperator1 + month + seperator1 + strDate
-        this.value2 = [formatDate, nowData] // 默认赋值一年时间
-      },
       async exportlist() {
         if (this.modification.length == 0) {
           this.$message.warning('请选择要导出的条目!')
@@ -601,70 +630,7 @@
           xmlhttp.send()
         })
       },
-      invoicingClick(type) {
-        let _data = {}
-        if (type == 1) {
-          _data.flag = 1
-        } else {
-          _data.flag = 2
-        }
-        _data.collectionWarehousingRecordList = this.modification
-        if (this.modification.length == 0) {
-          this.$message.warning('请选择一条要开票的条目')
-        } else {
-          for (let i = 0; i < this.modification.length; i++) {
-            if (
-              this.modification[i].status != '全部付款'
-            ) {
-              this.$message.error('请选择全部付款条目!')
-              return
-            }
-          }
 
-          this.$confirm(
-              '确定修改所选条目的发票状态?',
-              '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning',
-              }
-            )
-            .then(() => {
-              //开票
-              invoicing(_data)
-                .toPromise()
-                .then((response) => {
-                  if (response.length > 0) {
-                    var arr = []
-                    for (let i = 0; i < response.length; i++) {
-                      if (type == 1) {
-                        arr.push({
-                          fileUrl: response[i],
-                          renameFileName: '自采发票' + i + '.xml',
-                        })
-                      } else {
-                        arr.push({
-                          fileUrl: response[i],
-                          renameFileName: '销售发票' + i + '.xml',
-                        })
-                      }
-
-                    }
-                    if (type == 1) {
-                      this.filesToRar(arr, '自采开票XML文件')
-                    } else {
-                      this.filesToRar(arr, '销售开票XML文件')
-                    }
-                    this.getList()
-                  }
-                })
-                .catch(() => {})
-            })
-            .catch(() => {
-              return false
-            })
-        }
-      },
       // customerclose(e) {
       //   //  row.textcss = false
       //   this.customerInfo = false
@@ -762,51 +728,46 @@
       handleAvatarSuccess(e) {
         this.imageUrl = e.url
       },
-      printBig() {
-        let _list2 = []
-        localStorage.setItem('collectionContractCustomerList_printList', JSON.stringify(this.selectCustomerList))
-        window.open('../../../../../static/collectionContractRecordPrint.html?printTypeList=' + this.ruleForm.type)
-      },
       getList() {
-        this.payments = {
-          amountNotPayable: 0,
-          paymentDate: '',
-        }
-        var searchParam = ''
-        if (this.searchType != -1) {
-          searchParam = this.searchType
-        }
-        var startDate = ''
-        var endDate = ''
-        if (this.value2) {
-          startDate = this.value2[0] ? this.value2[0] : ''
-          endDate = this.value2[1] ? this.value2[1] : ''
-        }
         // 查询列表
-        selectCollectionWarehousingRecordPage({
+        storageFeeRecordList({
+            compId: localStorage.getItem('ws-pf_compId'),
+            contractNo: this.$route.query.contractNo,
             currentPage: this.currentPage,
             pageSize: this.pageSize,
-            startDate: startDate,
-            endDate: endDate,
-            searchKeyWord: this.searchKeyWord,
-            searchType: searchParam,
-            compId: localStorage.getItem('ws-pf_compId'),
-            contractNo: this.$route.query.contractNo
           })
           .toPromise()
           .then((response) => {
             this.recordList = response.records
-            // this.deptBudgetTotal = response.total
+            if (response.records.length > 0) {
+              this.isSHowExportBtn = true
+              this.isShowRecord = true
+            } else {
+              this.isSHowAddRecordBtn = true
+            }
           })
-        // getJurisdiction({
-        //   managementType: 1,
-        //   warehouseName: this.warehouseName,
-        //   compId: localStorage.getItem('ws-pf_compId')
-        // })
-        //   .toPromise()
-        //   .then(response => {
-        //     this.isShowAdopt = response
-        //   })
+      },
+      dateFormat(fmt, date) {
+        let ret
+        const opt = {
+          'Y+': date.getFullYear().toString(), // 年
+          'm+': (date.getMonth() + 1).toString(), // 月
+          'd+': date.getDate().toString(), // 日
+          'H+': date.getHours().toString(), // 时
+          // "M+": date.getMinutes().toString(),         // 分
+          // "S+": date.getSeconds().toString()          // 秒
+          // 有其他格式化字符需求可以继续添加,必须转化成字符串
+        }
+        for (let k in opt) {
+          ret = new RegExp('(' + k + ')').exec(fmt)
+          if (ret) {
+            fmt = fmt.replace(
+              ret[1],
+              ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
+            )
+          }
+        }
+        return fmt
       },
 
       screen(num) {
@@ -823,19 +784,14 @@
       },
       // 收款
       collectMoney() {
-        // if (this.modification.length == 0) {
-        //   this.$message.warning('请选择一条要收款的条目')
-        // } else {
-        //   let sum = 0
-        //   for (let i = 0; i < this.modification.length; i++) {
-        //     sum += this.modification[i].amountNotCollectable
-        //   }
-        //   this.collectionments.money = sum.toFixed(2)
-        //   this.collectForm = true
-        // }
+        this.chargeObj = {
+          compId: localStorage.getItem('ws-pf_compId'),
+          contractId: this.$route.query.contractId,
+          operator: localStorage.getItem('ws-pf_staffName')
+        }
         this.collectForm = true
       },
-      addRecoredSubmit(){
+      addRecoredSubmit() {
         this.$confirm(
             '提交后起算日期和起算重量不可修改,是否确定提交?',
             '提示', {
@@ -844,15 +800,26 @@
               type: 'warning',
             }
           )
-          .then(() => {debugger
-              this.addRecoredDialog =false
-              this.isShowRecord = true
+          .then(() => {
+            // // 添加记录
+            addStorageFeeRecord({
+                contractNo: this.$route.query.contractNo,
+              })
+              .toPromise()
+              .then((response) => {
+                this.getList()
+              })
+
+            this.addRecoredDialog = false
+            this.isShowRecord = true
           })
           .catch(() => {
             return false
           })
       },
       collectSubmit() {
+        console.log(this.chargeObj)
+        this.chargeObj.collectionDate = this.dateFormat('YYYY-mm-dd', this.chargeObj.collectionDate)
         if (!this.imageUrl) {
           this.$message({
             message: '请上传收费截图',
@@ -860,26 +827,21 @@
           })
           return
         }
+        this.chargeObj.collectionScreenshot = this.imageUrl;
+
         this.$confirm(`确定提交收费信息?`, {
           cancelButtonText: '取消',
           confirmButtonText: '确定',
           type: 'warning',
         }).then(() => {
-          // collectMoneyApi({
-          //     collectionWarehousingRecordList: this.modification,
-          //     money: this.collectionments.money,
-          //     collectionDate: this.collectionments.collectionDate,
-          //     collectionScreenshot: this.imageUrl,
-          //   })
-          //   .toPromise()
-          //   .then((response) => {
-          //     this.$message.success('收款成功')
-          //     this.collectmoney = ''
-          //     this.collectionDate = ''
-          //     this.collectionScreenshot = ''
-          //     this.collectForm = false
-          //     this.getList()
-          //   })
+          storageFeeRecordCharge(this.chargeObj)
+            .toPromise()
+            .then((response) => {
+              this.$message.success('收费成功!')
+              this.chargeObj = {}
+              this.collectForm = false
+              this.getList()
+            })
         })
       },
       // 付款
@@ -1429,7 +1391,8 @@
       justify-content: space-around;
     }
   }
-  .close-sfju-dialog{
+
+  .close-sfju-dialog {
     width: 100%;
     margin: 10px;
     display: flex;

+ 34 - 27
src/views/warehousenew/warehouseManagementList.vue

@@ -18,7 +18,7 @@
           </el-form-item>
           <!--仓库名称-->
           <el-form-item label-width="120px" label="仓库名" span="1" prop="warehouseName">
-            <el-select v-model="warehouseInfo.warehouseName" placeholder="请选择仓库名" filterable clearable remote  @change="selectstaff" :filter-method="warehouseQuery">
+            <el-select v-model="warehouseInfo.warehouseName" placeholder="请选择仓库名" filterable clearable @change="selectstaff" :filter-method="warehouseQuery">
               <el-option v-for="item in warehouseXiaLa" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName" />
             </el-select>
           </el-form-item>
@@ -66,20 +66,19 @@
     <div class="position">
       <div class="title"><span style="font-size:18px;font-weight: 600;margin-left:20px">当期储量</span></div>
       <ws-button type="primary" @click="handleAdd()" v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.add`" style="margin-left:20px">添加</ws-button>
-      <!-- <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.view` " @click="handleLook()">查看</ws-button> -->
       <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.edit` " @click="handleEdit()">编辑</ws-button>
       <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.delete`" @click="handleDelete()">删除</ws-button>
       <ws-button  v-hasPermission=" `warehouseManagement.warehouse.warehouseInfo.view`" @click="record()">记录</ws-button>
       <ws-button  v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.view`" @click="loss()">盘库</ws-button>
-      <ws-button  v-if="warehouseInfo.clearStatusFlag == 1" @click="clearance()">清库</ws-button>
-      <ws-button  v-if="warehouseInfo.clearStatusFlag == 3" disabled> 已清库</ws-button>
+      <ws-button  v-if="warehouseInfo.clearStatusFlag == 1 && warehouseType == '2'" @click="clearance()">清库</ws-button>
+      <ws-button  v-if="warehouseInfo.clearStatusFlag == 3 && warehouseType == '2'" disabled> 已清库</ws-button>
       <!-- createType 1手动创建 2 自动创建 -->
       <ws-button v-if='warehouseInfo.createType==1' v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.delete`" @click="indialog = true">入库量</ws-button>
       <ws-button v-if='list.length>0' @click="handlTask()">任务</ws-button>
       <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.add`" @click="outData(1)">导出</ws-button>
       <ws-button @click="outData(2)">打印</ws-button>
       <ws-button @click="transformation()">折转</ws-button>
-      <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.delete`" @click="handleall()">全部仓库</ws-button>
+      <ws-button v-hasPermission=" `warehouseManagement.warehouse.warehouseInfo.view`" @click="handleall()">全部仓库</ws-button>
         <el-table ref='table' show-summary :summary-method="getSummaries" class="wenzi" :data="warehouseList" style="width: 100%; margin-top: 20px" height="calc(100% - 45px)" v-if="warehouseType == '1'">
         <el-table-column prop="warehouseName" label="仓库名">
         </el-table-column>
@@ -171,7 +170,7 @@
           <div :class="btnCss2" @click="mapChange(2)">定位</div>
         </div>
         <div class="map-item" v-if="mapshow">
-          <map-drag @marker="marker" ref="childMap" :isShowaddress='false' v-on:addressListen='getAddress' v-on:pickedAddress='searchAddress' ></map-drag>
+          <map-drag @marker="marker" ref="childMap" :isShowaddress='true' v-on:addressListen='getAddress' v-on:pickedAddress='searchAddress' :warehousePositioning="warehousePositioning"></map-drag>
         </div>
         <div v-if="!mapshow && warehouseType == '1'" class="monitor">
             <div class="video1">
@@ -218,7 +217,7 @@
             <!--仓库名称-->
             <el-form-item label="仓库名称" span="1" prop="warehouseName">
               <el-select v-model="parameter.warehouseName" placeholder="请选择仓库名称" filterable clearable>
-                <el-option v-for="item in warehouseXiaLa" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName"/>
+                <el-option v-for="item in warehouseXiaLa" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName" />
               </el-select>
             </el-form-item>
             <el-form-item label="增量比例(%)" v-if="headerText == '打印记录'">
@@ -251,7 +250,7 @@
     deletewarehouse,
     postInWeight,
   } from '@/model/warehouse/index'
-  import mapDrag from '@/components/mapdrag/mapdrag'
+  import mapDrag from '@/components/mapdrag/warehouseMap'
   import {
     downloadFile
   } from '@/utils/batchDown'
@@ -315,6 +314,7 @@
           year: dayjs().format('YYYY'),
           month: dayjs().format('MM'),
         },
+        warehousePositioning:{},
       }
     },
     activated() {
@@ -646,11 +646,6 @@
           this.btnCss1 = "btn"
            this.btnCss2 = "btn1"
           this. maptitle = "定位"
-          
-          let e= {}
-           e.lat = "122.095"
-           e.lng  = "40.185"
-           this.searchAddress(e)
         }
       },
       getAddress(data) {
@@ -681,28 +676,27 @@
               this.btnCss2 ="btn1"
               this.mapshow = true
             }else{
-              this.maptitle = "库点监控"
+               this.maptitle = "库点监控"
                this.btnCss1 ="btn1"
-              this.btnCss2 ="btn"
-                this.mapshow = false
+               this.btnCss2 ="btn"
+               this.mapshow = false
             }
             break
           }
         }
         this.warehouseXiaLa = this.warehouseXiaLaCopy
+        if(this.warehouseInfo.warehouseName.indexOf('(临)') != -1){
+          this.warehouseInfo.warehouseName = this.warehouseInfo.warehouseName.replace(' (临)','')
+        }
         this.getList1()
-       
       },
       warehouseQuery(query){
         if(query){
           this.warehouseXiaLa = this.warehouseAllXiaLa
-          this.warehouseXiaLa=this.warehouseAllXiaLa.filter(item=>item.warehouseName.indexOf(query)>-1)
+          this.warehouseXiaLa = this.warehouseAllXiaLa.filter(item=>item.warehouseName.indexOf(query)>-1)
         }else{
           this.warehouseXiaLa = this.warehouseXiaLaCopy
         }
-      },
-      optionsOther(){
-
       },
       getCurrentDate(format) {
       var now = new Date();
@@ -855,7 +849,6 @@
             // warehouseBaseInfoList: JSON.stringify(this.list)
           }
         })
-        // this.$router.push({ path: 'tranManagementWarehouseInOutTask',query:{warehouseBaseInfoList:JSON.stringify(this.list)} })
       },
       getSummaries(param) {
         const {
@@ -867,7 +860,6 @@
           if (index === 0) {
             sums[index] = '合计'
           } else if (
-           
             index === 4 ||
             index === 5 ||
             index === 6
@@ -983,9 +975,12 @@
             })
               .toPromise()
               .then((response) => {
+                for(var tmp = 0 ; tmp < response.length ; tmp++){
+                  if(response[tmp].warehouseType == '2'){
+                    response[tmp].warehouseName = response[tmp].warehouseName + " (临)"
+                  }
+                }
                 this.warehouseAllXiaLa = response
-                // this.warehouseInfo.warehouseName = this.warehouseXiaLa[0].warehouseName
-                // this.getList1()
               })
         getsponsible({
             compId: localStorage.getItem('ws-pf_compId')
@@ -1018,7 +1013,6 @@
                   if (response.warehouseViewList[q].warehouseNumViewList[i].storage) {
                     response.warehouseViewList[q].warehouseNumViewList[i].storage = Number(response.warehouseViewList[q].warehouseNumViewList[i].storage).toFixed(3)
                   }
-                  // debugger
                   if (response.warehouseViewList[q].warehouseNumViewList[i].inNetWeight && response.warehouseViewList[q].warehouseNumViewList[i].outNetWeight) {
                     response.warehouseViewList[q].warehouseNumViewList[i].surplus = (response.warehouseViewList[q].warehouseNumViewList[i].inNetWeight - response.warehouseViewList[q].warehouseNumViewList[i].outNetWeight).toFixed(3)
                   } else if (response.warehouseViewList[q].warehouseNumViewList[i].inNetWeight) {
@@ -1027,7 +1021,6 @@
                 }  
               }
             }
-            // }
             
             if(this.warehouseType == '1'){
               this.totalReserves = response.warehouseNumViewList
@@ -1039,6 +1032,20 @@
             this.warehouseInfo = this.warehouseList[0]
             this.warehouseInfo.warehouseLocation = this.warehouseList[0].warehousePrivate + this.warehouseList[0].warehouseCity + this.warehouseList[0].warehouseArea
             this.warehouseInfo.maxReserves = 0
+            //经纬度
+             this.warehousePositioning.lat = this.warehouseInfo.warehousePositioning.split(",")[1]
+             this.warehousePositioning.lng = this.warehouseInfo.warehousePositioning.split(",")[0]
+            //   if(this.warehouseType == '2'){
+            //   this.maptitle = "定位"
+            //   this.btnCss2 ="btn1"
+            //   this.mapshow = true
+            //   this.mapChange(2)
+            //   }else{
+            //   this.maptitle = "库点监控"
+            //   this.btnCss1 ="btn1"
+            //   this.btnCss2 ="btn"
+            //   this.mapshow = false
+            // }
              for(let j = 0 ; j < this.warehouseXiaLa.length ; j++){
                 if(this.warehouseInfo.warehouseName == this.warehouseXiaLa[j].warehouseName){
                 for(let count = 0 ;count < this.warehouseXiaLa[j].goodsNameInfos.length ; count++){