Bläddra i källkod

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

zhangyuewww 2 år sedan
förälder
incheckning
e9397137e4

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

@@ -106,6 +106,8 @@ export const API_POST_WORKFLOW_TASK = `/newWorkflow/getTaskWebsocket`
 export const API_POST_SUSPENDINSTANCE ='/paymentManagement/api/ReSettlement'
 //导入
 export const API_POST_IMPORT ='/qualityInspectionManagement/api/importQuality'
+//导入移库
+export const API_POST_IMPORT_YK ='/weighingManagement/api/importWeighing'
 // 结算单
 export const API_GET_SETTLEACCOUT = '/warehouseInOutInfo/getInfo'
 // 退回

+ 4 - 0
src/api/V2/outboundManagement/index.js

@@ -42,4 +42,8 @@ export const API_POST_NEW_SUBMIT = '/warehouseInOutInfo/api/newInOutWarehouse'
 export const API_POST_CHANE_NO = `/weighingManagement/api/changeWarehouse`
 // 退回
 export const API_POST_GO_BACK = `/weighingManagement/api/outWeightReturn`
+//导入销售出库
+export const API_POST_IMPORT_SALE ='/weighingManagement/api/importWeighingOut'
+//导入移库出库
+export const API_POST_IMPORT_YK ='/weighingManagement/api/importWeighingMoveOut'
 

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

@@ -158,11 +158,11 @@
         var that = this
         this.makeJsonData()
         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
+          '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) => {
           this.loadmap()
@@ -192,26 +192,26 @@
           _coordinates1.push(Number(_position1[1]))
           _coordinates1.push(Number(_position1[0]))
           let _obj1 = {
-            "type": "Feature",
-            "properties": {
-              "type": i,
+            'type': 'Feature',
+            'properties': {
+              'type': i,
             },
-            "geometry": {
-              "type": "Point",
-              "coordinates": _coordinates1
+            'geometry': {
+              'type': 'Point',
+              'coordinates': _coordinates1
             }
           }
           let _position11 = _data.startPlace ? _data.startPlace.split(',') : []
           _coordinates11.push(Number(_position11[1]))
           _coordinates11.push(Number(_position11[0]))
           let _obj11 = {
-            "type": "Feature",
-            "properties": {
-              "type": i,
+            'type': 'Feature',
+            'properties': {
+              'type': i,
             },
-            "geometry": {
-              "type": "Point",
-              "coordinates": _coordinates11
+            'geometry': {
+              'type': 'Point',
+              'coordinates': _coordinates11
             }
           }
 
@@ -235,31 +235,31 @@
           _marker.name = _data.name
           this.markerList.push(_marker)
           let _obj2 = {
-            "type": "Feature",
-            "properties": {
+            'type': 'Feature',
+            'properties': {
 
             },
-            "geometry": {
-              "type": "LineString",
-              "coordinates": _coordinates2
+            'geometry': {
+              'type': 'LineString',
+              'coordinates': _coordinates2
             }
           }
           _features2.push(_obj2)
         }
         this.mapPointData = {
-          "type": "FeatureCollection",
-          "features": _features1
+          'type': 'FeatureCollection',
+          'features': _features1
         }
         this.mapLineData = {
-          "type": "FeatureCollection",
-          "features": _features2
+          'type': 'FeatureCollection',
+          'features': _features2
         }
-        console.log("this.mapPointData", this.mapPointData)
-        console.log("this.mapPointData", this.mapLineData)
+        console.log('this.mapPointData', this.mapPointData)
+        console.log('this.mapPointData', this.mapLineData)
 
       },
       loadmap(val) {
-        var map = new AMap.Map('mapContainer', {
+          let map = new AMap.Map('mapContainer', {
           zoom: 4.89,
           showLabel: true,
           viewMode: '3D',
@@ -270,13 +270,13 @@
           showIndoorMap: false,
         });
 
-        var loca = new Loca.Container({
+        let loca = new Loca.Container({
           map,
         });
         for (let i = 0; i < this.markerList.length; i++) {
           // 构造点标记
           if (this.markerList[i].iconSrc[0] && this.markerList[i].iconSrc[1]) {
-            var marker = new AMap.Marker({
+            let marker = new AMap.Marker({
               position: this.markerList[i].iconSrc,
               anchor: 'bottom-center',
               icon: new AMap.Icon({
@@ -288,7 +288,7 @@
             map.add(marker);
             marker.setLabel({
               offset: new AMap.Pixel(0, 0), //设置文本标注偏移量
-              content: "<div class = 'maker-item'>" + this.markerList[i].name + "</div>", //设置文本标注内容
+              content: '<div class = \'maker-item\'>' + this.markerList[i].name + '</div>', //设置文本标注内容
               direction: 'right' //设置文本标注方位
 
             });
@@ -301,8 +301,8 @@
         this.timer = setInterval(function() {
           _markerDom[_index].style.opacity = 1
           _markerDom[_index].style.transition = '2s'
-          var elseLi = _markerDom;
-          for (var i = 0; i < elseLi.length; i++) {
+          let elseLi = _markerDom;
+          for (let i = 0; i < elseLi.length; i++) {
             if (elseLi[i] !== _markerDom[_index]) { //判断是否是ele节点,是否与触发事件的节点相同
               elseLi[i].style.opacity = 0
               _markerDom[_index].style.transition = '2s'
@@ -314,7 +314,7 @@
 
 
         // 呼吸点
-        var scatter = new Loca.ScatterLayer({
+        let scatter = new Loca.ScatterLayer({
           loca,
           zIndex: 10,
           opacity: 0.6,
@@ -322,7 +322,7 @@
           zooms: [2, 22],
         });
 
-        var pointGeo = new Loca.GeoJSONSource({
+        let pointGeo = new Loca.GeoJSONSource({
           // url: 'https://a.amap.com/Loca/static/loca-v2/demos/mock_data/pulselink-china-city-point.json',
           data: this.mapPointData
         });
@@ -338,7 +338,7 @@
         loca.add(scatter);
 
         // 弧线
-        var pulseLink = new Loca.PulseLinkLayer({
+        let pulseLink = new Loca.PulseLinkLayer({
           // loca,
           zIndex: 10,
           opacity: 1,
@@ -347,7 +347,7 @@
           depth: true,
         });
 
-        var geo = new Loca.GeoJSONSource({
+        let geo = new Loca.GeoJSONSource({
           // url: 'https://a.amap.com/Loca/static/loca-v2/demos/mock_data/data-line-out.json',
           data: this.mapLineData
         });

+ 3 - 0
src/model/houseSelfCollect/index.js

@@ -54,6 +54,7 @@ import {
   API_POST_INSPECT_GETWEIGHTDELETE,
   API_POST_SUSPENDINSTANCE,
   API_POST_IMPORT,
+  API_POST_IMPORT_YK,
   API_GET_INSPECT_CONTRACTNO,
   API_GET_SETTLEACCOUT,
   API_POST_RETURN,
@@ -169,6 +170,8 @@ export const workflowcontent = appRx.get(API_POST_WORKFLOW_TASK, errorCatcher, e
 export const suspendinstance = appRx.post(API_POST_SUSPENDINSTANCE, errorCatcher, errorHandle, filter)
 // 导入
 export const importWord = appRx.post(API_POST_IMPORT, errorCatcher, errorHandle, filter)
+// 导入移库
+export const importWordYk = appRx.post(API_POST_IMPORT_YK, errorCatcher, errorHandle, filter)
 // 查看结算单
 export const getsettleaccout = appRx.get(API_GET_SETTLEACCOUT, errorCatcher, errorHandle, filter)
 // 退回

+ 7 - 1
src/model/outboundManagement/index.js

@@ -23,6 +23,8 @@ import {
     API_GET_INSPECT_CONTRANCLISTWEIGHING,
     API_POST_NEW_SUBMIT,
     API_POST_CHANE_NO,
+    API_POST_IMPORT_SALE,
+    API_POST_IMPORT_YK,
     API_POST_GO_BACK
 }   from '@/api/V2/outboundManagement'
 
@@ -69,4 +71,8 @@ export const newSubmit = appRx.post(API_POST_NEW_SUBMIT, errorCatcher, errorHand
 // 换仓
 export const changeNo = appRx.post(API_POST_CHANE_NO, errorCatcher, errorHandle, filter)
 // 退回
-export const goBack = appRx.post(API_POST_GO_BACK, errorCatcher, errorHandle, filter)
+export const goBack = appRx.post(API_POST_GO_BACK, errorCatcher, errorHandle, filter)
+// 导入销售出库
+export const importWordSale = appRx.post(API_POST_IMPORT_SALE, errorCatcher, errorHandle, filter)
+// 导入移库出库
+export const importWordYk = appRx.post(API_POST_IMPORT_YK, errorCatcher, errorHandle, filter)

+ 25 - 9
src/utils/util.js

@@ -199,25 +199,41 @@ export const fullscreenEnable = () => {
  * 浏览器全屏
  */
 export const reqFullScreen = () => {
-  if (document.documentElement.requestFullScreen) {
-    document.documentElement.requestFullScreen();
-  } else if (document.documentElement.webkitRequestFullScreen) {
-    document.documentElement.webkitRequestFullScreen();
-  } else if (document.documentElement.mozRequestFullScreen) {
-    document.documentElement.mozRequestFullScreen();
+  let _documentDom = document.getElementById('contentView')
+  if (_documentDom.requestFullScreen) {
+    _documentDom.requestFullScreen();
+  } else if (_documentDom.webkitRequestFullScreen) {
+    _documentDom.webkitRequestFullScreen();
+  } else if (_documentDom.mozRequestFullScreen) {
+    _documentDom.mozRequestFullScreen();
   }
+  // if (document.documentElement.requestFullScreen) {
+  //   document.documentElement.requestFullScreen();
+  // } else if (document.documentElement.webkitRequestFullScreen) {
+  //   document.documentElement.webkitRequestFullScreen();
+  // } else if (document.documentElement.mozRequestFullScreen) {
+  //   document.documentElement.mozRequestFullScreen();
+  // }
 };
 /**
  * 浏览器退出全屏
  */
 export const exitFullScreen = () => {
-  if (document.documentElement.requestFullScreen) {
+  let _documentDom = document.getElementById('contentView')
+    if (_documentDom.requestFullScreen) {
     document.exitFullScreen();
-  } else if (document.documentElement.webkitRequestFullScreen) {
+  } else if (_documentDom.webkitRequestFullScreen) {
     document.webkitCancelFullScreen();
-  } else if (document.documentElement.mozRequestFullScreen) {
+  } else if (_documentDom.mozRequestFullScreen) {
     document.mozCancelFullScreen();
   }
+  // if (document.documentElement.requestFullScreen) {
+  //   document.exitFullScreen();
+  // } else if (document.documentElement.webkitRequestFullScreen) {
+  //   document.webkitCancelFullScreen();
+  // } else if (document.documentElement.mozRequestFullScreen) {
+  //   document.mozCancelFullScreen();
+  // }
 };
 /**
  * 递归寻找子类的父类

+ 35 - 7
src/views/home/index.vue

@@ -1,6 +1,6 @@
 <!-- 首页模块 首页面 -->
 <template>
-  <div class="home">
+  <div class="home" id='contentView'>
     <div class="body-middle" :class="{ 'body-middle-height': blockList[0].flag }">
       <div class="body-middle-left">
         <!-- 任务、消息、提醒、超期 -->
@@ -75,7 +75,7 @@
             </el-row>
             <el-row>
               <h3 class="content2-map">库点流向分布</h3>
-              <div class="center-map">
+              <div class="center-map" style="border: 2px solid #6a5f5f">
                 <map-drag :listData=' mapInfo'></map-drag>
               </div>
             </el-row>
@@ -237,7 +237,7 @@
         nowTime: null, //存放时分秒变量
         timer: '', //定义一个定时器的变量
         currentTime: new Date(), // 获取当前时间
-        timer: '',
+        timer1: '',
         dialogVisible: false,
         showEchart: false,
         phone: '', // 正式租户电话号码
@@ -360,6 +360,7 @@
       // this.checkUserInfoDialog()
       // {
       this.timer = setInterval(this.getTime, 1000);
+      this.timer1 = setInterval(this.flushData, 120000);
       // }
     },
     beforeDestroy() {
@@ -367,6 +368,10 @@
       if (this.timer) {
         clearInterval(this.timer); // 在Vue实例销毁前,清除定时器
       }
+      clearInterval(this.timer1);
+      if (this.timer1) {
+        clearInterval(this.timer1); // 在Vue实例销毁前,清除定时器
+      }
     },
     async mounted() {
       var staffId = JSON.parse(localStorage.getItem('winseaview-userInfo')).content.staffId
@@ -406,6 +411,7 @@
       // this.getNewList()
       gChartsData({
         compId: localStorage.getItem('ws-pf_compId'),
+        loadingstatus: 1,
         seachMoth: '2022'
       }).toPromise().then(res => {
         console.log('··············', res)
@@ -453,6 +459,27 @@
     },
     methods: {
       ...mapActions('user', ['toSetShow', 'changeVesslBank']),
+      flushData(){
+         gChartsData({
+          compId: localStorage.getItem('ws-pf_compId'),
+          loadingstatus: 1,
+          seachMoth: '2022'
+        }).toPromise().then(res => {
+          console.log('··············', res)
+          // this.chartsData = res
+          this.carCount1 = res[6].biViewInfoList[0].count
+          this.carCount2 = res[6].biViewInfoList[1].count
+          this.carCount3 = res[6].biViewInfoList[2].count
+          // this.physicalInventory = Number(res[7].biViewInfoList[0].count).toFixed(2)
+          // this.procurementPending= Number(res[7].biViewInfoList[1].count).toFixed(2)
+          // this.salesPending =  Number(res[7].biViewInfoList[2].count).toFixed(2)
+          // this.position = Number(Number(this.physicalInventory)+Number(this.procurementPending) - Number(this.salesPending)).toFixed(2)
+          // this.totalReserves = res[8].biViewInfoList
+          // this.mapInfo = res[9]
+          // console.log(res)
+          // this.initCharts()
+        })
+      },
       getChartsData() {
         noticeNumber().toPromise().then(res => {
           const {
@@ -554,7 +581,7 @@
       },
       initCharts() {
         let app = this;
-        var roseCharts = document.getElementsByClassName('roseChart');
+        let roseCharts = document.getElementsByClassName('roseChart');
         for (let i = 0; i < roseCharts.length; i++) {
           let myChart = app.$echarts.init(roseCharts[i]);
           let color = []
@@ -586,7 +613,7 @@
               color = ['#247ef4', '#3a3b40'];
               // 圆环图各环节的名称和值(系列中各数据项的名称和值)
               data = [{
-                name: '已开票1',
+                name: '已开票',
                 value: Number((this.chartsData[i].biViewInfoList[0].count)/10000).toFixed(2),
                 type: '采购合同'
               }, {
@@ -751,7 +778,8 @@
         let _y = []
         for (let i = 0; i < this.totalReserves.length; i++) {
           _x.push(this.totalReserves[i].name)
-          _y.push(this.totalReserves[i].count)
+          var a = Number(this.totalReserves[i].count).toFixed(2)
+          _y.push(a)
         }
 
         // 柱状图
@@ -1952,7 +1980,7 @@
   }
 
   .home {
-    background: rgb(27, 28, 30);
+    background: #2a2a2a;
     padding-bottom: 20px
   }
 

+ 119 - 1
src/views/houseSelfCollect/weightCheckRecord.vue

@@ -40,7 +40,12 @@
       <el-button :type="choice == 2?'primary':''" size="small" @click="screen(2)" class="btn_css">已称毛重</el-button>
       <el-button :type="choice == 3?'primary':''" size="small" @click="screen(3)" class="btn_css">已称皮重</el-button>
       <el-button size="small" @click="print('',1)">批量打印</el-button>
-        
+       <el-upload style="margin-top: -35px; margin-left:430px" class="upload-demo inline-block margin-right-10" action=""
+          :on-change="importClick" :show-file-list="false"
+          accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
+          :auto-upload="false">
+          <ws-button type="primary">导入</ws-button>
+        </el-upload>
       <el-table class="forData" :data="weighingRecordList" style="width: 100%; margin-top: 20px" height="780"
         @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55"></el-table-column>
@@ -170,6 +175,7 @@
     getPrint,
     returnInfo,
     changeNo,
+    importWordYk,
     getweighingDelete
   } from '@/model/houseSelfCollect/index'
   import weightCheckPrint from './component/weightCheckPrint.vue'
@@ -311,6 +317,118 @@
       this.getList()
     },
     methods: {
+      importClick(file, fileList) {
+        this.fileTemp = file.raw
+        let fileName = file.raw.name
+        let fileType = fileName.substring(fileName.lastIndexOf('.') + 1)
+        // 判断上传文件格式
+        if (this.fileTemp) {
+          if (fileType == 'xlsx' || fileType == 'xls') {
+            this.importf(this.fileTemp)
+          } else {
+            this.$message({
+              type: 'warning',
+              message: '附件格式错误,请删除后重新上传!',
+            })
+          }
+        } else {
+          this.$message({
+            type: 'warning',
+            message: '请上传附件!',
+          })
+        }
+      },
+      importf(obj) {
+        this.excelFreightspace = []
+        // this.dialogVisible = true;
+        let _this = this;
+        let inputDOM = this.$refs.inputer; // 通过DOM取文件数据
+        this.file = event.currentTarget.files[0];
+        var rABS = false; //是否将文件读取为二进制字符串
+        var f = this.file;
+        var reader = new FileReader();
+        //if (!FileReader.prototype.readAsBinaryString) {
+        FileReader.prototype.readAsBinaryString = function(f) {
+          var binary = '';
+          var rABS = false; //是否将文件读取为二进制字符串
+          var pt = this;
+          var wb; //读取完成的数据
+          var outdata;
+          var reader = new FileReader();
+          reader.onload = function(e) {
+            var bytes = new Uint8Array(reader.result);
+            var length = bytes.byteLength;
+            for (var i = 0; i < length; i++) {
+              binary += String.fromCharCode(bytes[i]);
+            }
+            var XLSX = require('xlsx');
+            if (rABS) {
+              wb = XLSX.read(btoa(fixdata(binary)), { //手动转化
+                type: 'base64',
+                cellDates: true
+              });
+            } else {
+              wb = XLSX.read(binary, {
+                type: 'binary'
+              });
+            }
+            // outdata就是你想要的东西 excel导入的数据
+            outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
+            // excel 数据再处理
+            let arr = []
+            outdata.map(v => {
+              // let jsonString = JSON.stringify(v).replace(/\*/g, '').replace(/\s/ig,'');
+              let jsonString = JSON.stringify(v).replace(/\//g, '').replace(/\s/ig, '');
+              v = JSON.parse(jsonString);
+              let obj = {}
+              //xxx代表列名
+              obj.number = v.业务编号
+              obj.inOutTaskNo = v.移库任务编号
+              obj.outType = v.运输方式
+              obj.carNumber = v.车牌号
+              obj.grossWeight = v.毛重
+              obj.tare = v.皮重
+              obj.netWeight = v.净重
+              obj.grossDate = _this.formatDate(v.入库日期, '-')
+              _this.excelFreightspace.push(obj)
+            })
+            if (_this.excelFreightspace) {
+              importWordYk({
+                  warehouseName: _this.warehouseName,
+                  weighingManagementList: _this.excelFreightspace
+                }).toPromise()
+                .then((response) => {
+                  if (response == 'ok') {
+                    this.$notify({
+                      title: '成功',
+                      message: '导入成功',
+                      type: 'success'
+                    });
+                    _this.getList()
+                  }
+                })
+
+            }
+          }
+          reader.readAsArrayBuffer(f);
+        }
+        if (rABS) {
+          reader.readAsArrayBuffer(f);
+        } else {
+          reader.readAsBinaryString(f);
+        }
+
+      },
+      formatDate(numb, format) {
+        const old = numb - 1;
+        const t = Math.round((old - Math.floor(old)) * 24 * 60 * 60);
+        const time = new Date(1900, 0, old, 0, 0, t)
+        const year = time.getFullYear();
+        const month = time.getMonth() + 1;
+        const date = time.getDate();
+        return year + format + (month < 10 ? '0' + month : month) + format + (date < 10 ? '0' + date : date) +
+          ' 00:00:00'
+      },
       binNumberChange(e){
         this.binNumber = e
         for(let i = 0 ; i < this.binnumberList.length ; i++){

+ 8 - 7
src/views/outboundManagement/weighingManagementNew.vue

@@ -1672,6 +1672,7 @@
         }
         this.weighingList.inOutTaskNo=e
         this.warehouseCount = this.warehouseCount1
+        var data = null
         for (let i = 0; i < this.taskNolist.length; i++) {
           if (this.taskNolist[i].inOutTaskNo == e) {
             //  this.weighingList.number = this.taskNolist[i].inOutTaskNo
@@ -1679,7 +1680,7 @@
             this.weighingList.numberLetter = 'XSCK'
             this.weighingList.goodsName = this.taskNolist[i].goodsName
             this.weighingList.tips = this.taskNolist[i].businessDescribe
-            var data = this.taskNolist[i]
+            data = this.taskNolist[i]
             if(this.taskNolist[i].inOutType=='移库出库'){
               this.weighingList.contractNo = this.taskNolist[i].moveTaskNo
             }else{
@@ -1693,7 +1694,7 @@
             
           }
         }
-        if (!data) return
+        // if (!data) return
         for (var i = 0; i < this.outContractNo.length; i++) {
           if (this.outContractNo[i].contractNo == this.weighingList.contractNo) {
             this.weighingList.goodsName = this.outContractNo[i].goodsName
@@ -1731,18 +1732,18 @@
 
               this.weighingList.buyer = this.outContractNo[i].receiveWarehouse
               this.weighingList.seller = this.outContractNo[i].sendWarehouse
-              this.weighingList.goodsName = data.goodsName
-              this.weighingList.goodsNameKey = data.goodsNameKey
-              this.weighingList.grade = data.grade
+              this.weighingList.goodsName = data == null?'玉米':data.goodsName
+              this.weighingList.goodsNameKey = data == null?'1':data.goodsNameKey
+              this.weighingList.grade = data == null?'二等品':data.grade
               if (this.outContractNo[i].unitContractPrice) {
                 this.weighingList.tips =
                   '入货库' +
-                  data.receiveWarehouse +
+                  data == null?'':data.receiveWarehouse +
                   '( ' +
                   this.outContractNo[i].unitContractPrice +
                   '元/吨)'
               } else {
-                this.weighingList.tips = '入货库' + data.receiveWarehouse
+                this.weighingList.tips = '入货库' + data == null?'':data.receiveWarehouse
               }
               this.weighingList.inOutTypeKey = 3
             } else if (this.outContractNo[i].inOutType == '暂存入库') {

+ 236 - 0
src/views/outboundManagement/weighingManagementrecord.vue

@@ -3,6 +3,20 @@
   <div>
     <BaseHeaderLayout :leftSpan="12">
       <template slot="left">
+         <el-upload style="margin-left: 8px;" class="upload-demo inline-block margin-right-10" action=""
+          :on-change="importClick" :show-file-list="false"
+          accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
+          :auto-upload="false">
+          <ws-button type="primary">导入(销售)</ws-button>
+        </el-upload>
+      </template>
+      <template slot="left">
+         <el-upload style="margin-left: 8px;" class="upload-demo inline-block margin-right-10" action=""
+          :on-change="importClickYk" :show-file-list="false"
+          accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
+          :auto-upload="false">
+          <ws-button type="primary">导入(移库)</ws-button>
+        </el-upload>
       </template>
       <!-- <template slot="left"> </template> -->
       <template slot="right">
@@ -134,6 +148,8 @@
     delelteWeighing,
     getweighing,
     changeNo,
+    importWordSale,
+    importWordYk,
     goBack
   } from '@/model/outboundManagement/index'
   import {
@@ -185,6 +201,226 @@
       this.showType = this.isShow
     },
     methods: {
+            importClick(file, fileList) {
+        this.fileTemp = file.raw
+        let fileName = file.raw.name
+        let fileType = fileName.substring(fileName.lastIndexOf('.') + 1)
+        // 判断上传文件格式
+        if (this.fileTemp) {
+          if (fileType == 'xlsx' || fileType == 'xls') {
+            this.importf(this.fileTemp)
+          } else {
+            this.$message({
+              type: 'warning',
+              message: '附件格式错误,请删除后重新上传!',
+            })
+          }
+        } else {
+          this.$message({
+            type: 'warning',
+            message: '请上传附件!',
+          })
+        }
+      },
+      importf(obj) {
+        this.excelFreightspace = []
+        // this.dialogVisible = true;
+        let _this = this;
+        let inputDOM = this.$refs.inputer; // 通过DOM取文件数据
+        this.file = event.currentTarget.files[0];
+        var rABS = false; //是否将文件读取为二进制字符串
+        var f = this.file;
+        var reader = new FileReader();
+        //if (!FileReader.prototype.readAsBinaryString) {
+        FileReader.prototype.readAsBinaryString = function(f) {
+          var binary = '';
+          var rABS = false; //是否将文件读取为二进制字符串
+          var pt = this;
+          var wb; //读取完成的数据
+          var outdata;
+          var reader = new FileReader();
+          reader.onload = function(e) {
+            var bytes = new Uint8Array(reader.result);
+            var length = bytes.byteLength;
+            for (var i = 0; i < length; i++) {
+              binary += String.fromCharCode(bytes[i]);
+            }
+            var XLSX = require('xlsx');
+            if (rABS) {
+              wb = XLSX.read(btoa(fixdata(binary)), { //手动转化
+                type: 'base64',
+                cellDates: true
+              });
+            } else {
+              wb = XLSX.read(binary, {
+                type: 'binary'
+              });
+            }
+            // outdata就是你想要的东西 excel导入的数据
+            outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
+            // excel 数据再处理
+            let arr = []
+            outdata.map(v => {
+              // let jsonString = JSON.stringify(v).replace(/\*/g, '').replace(/\s/ig,'');
+              let jsonString = JSON.stringify(v).replace(/\//g, '').replace(/\s/ig, '');
+              v = JSON.parse(jsonString);
+              let obj = {}
+              //xxx代表列名
+              obj.number = v.业务编号
+              obj.inOutTaskNo = v.出库任务编号
+              obj.outType = v.运输方式
+              obj.carNumber = v.车牌号
+              obj.grossWeight = v.毛重
+              obj.tare = v.皮重
+              obj.netWeight = v.净重
+              obj.contractNo = v.销售合同号
+              obj.contractPrice = v.销售合同单价
+              obj.grossDate = _this.formatDate(v.出库日期, '-')
+              obj.settleWeight = v.结算数量
+              obj.settlePrice = v.结算单价
+              obj.settleDate = v.结算日期
+              obj.settleMoney = v.结算金额
+              _this.excelFreightspace.push(obj)
+            })
+            if (_this.excelFreightspace) {
+              importWordSale({
+                  warehouseName: _this.warehouseName,
+                  weighingManagementList: _this.excelFreightspace
+                }).toPromise()
+                .then((response) => {
+                  if (response == 'ok') {
+                    this.$notify({
+                      title: '成功',
+                      message: '导入成功',
+                      type: 'success'
+                    });
+                    _this.getList()
+                  }
+                })
+
+            }
+          }
+          reader.readAsArrayBuffer(f);
+        }
+        if (rABS) {
+          reader.readAsArrayBuffer(f);
+        } else {
+          reader.readAsBinaryString(f);
+        }
+
+      },
+      importClickYk(file, fileList) {
+        this.fileTemp = file.raw
+        let fileName = file.raw.name
+        let fileType = fileName.substring(fileName.lastIndexOf('.') + 1)
+        // 判断上传文件格式
+        if (this.fileTemp) {
+          if (fileType == 'xlsx' || fileType == 'xls') {
+            this.importfYk(this.fileTemp)
+          } else {
+            this.$message({
+              type: 'warning',
+              message: '附件格式错误,请删除后重新上传!',
+            })
+          }
+        } else {
+          this.$message({
+            type: 'warning',
+            message: '请上传附件!',
+          })
+        }
+      },
+      importfYk(obj) {
+        this.excelFreightspace = []
+        // this.dialogVisible = true;
+        let _this = this;
+        let inputDOM = this.$refs.inputer; // 通过DOM取文件数据
+        this.file = event.currentTarget.files[0];
+        var rABS = false; //是否将文件读取为二进制字符串
+        var f = this.file;
+        var reader = new FileReader();
+        //if (!FileReader.prototype.readAsBinaryString) {
+        FileReader.prototype.readAsBinaryString = function(f) {
+          var binary = '';
+          var rABS = false; //是否将文件读取为二进制字符串
+          var pt = this;
+          var wb; //读取完成的数据
+          var outdata;
+          var reader = new FileReader();
+          reader.onload = function(e) {
+            var bytes = new Uint8Array(reader.result);
+            var length = bytes.byteLength;
+            for (var i = 0; i < length; i++) {
+              binary += String.fromCharCode(bytes[i]);
+            }
+            var XLSX = require('xlsx');
+            if (rABS) {
+              wb = XLSX.read(btoa(fixdata(binary)), { //手动转化
+                type: 'base64',
+                cellDates: true
+              });
+            } else {
+              wb = XLSX.read(binary, {
+                type: 'binary'
+              });
+            }
+            // outdata就是你想要的东西 excel导入的数据
+            outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
+            // excel 数据再处理
+            let arr = []
+            outdata.map(v => {
+              // let jsonString = JSON.stringify(v).replace(/\*/g, '').replace(/\s/ig,'');
+              let jsonString = JSON.stringify(v).replace(/\//g, '').replace(/\s/ig, '');
+              v = JSON.parse(jsonString);
+              let obj = {}
+              //xxx代表列名
+              obj.number = v.业务编号
+              obj.inOutTaskNo = v.出库任务编号
+              obj.outType = v.运输方式
+              obj.carNumber = v.车牌号
+              obj.grossWeight = v.毛重
+              obj.tare = v.皮重
+              obj.netWeight = v.净重
+              obj.grossDate = _this.formatDate(v.出库日期, '-')
+              _this.excelFreightspace.push(obj)
+            })
+            if (_this.excelFreightspace) {
+              importWordYk({
+                  warehouseName: _this.warehouseName,
+                  weighingManagementList: _this.excelFreightspace
+                }).toPromise()
+                .then((response) => {
+                  if (response == 'ok') {
+                    this.$notify({
+                      title: '成功',
+                      message: '导入成功',
+                      type: 'success'
+                    });
+                    _this.getList()
+                  }
+                })
+
+            }
+          }
+          reader.readAsArrayBuffer(f);
+        }
+        if (rABS) {
+          reader.readAsArrayBuffer(f);
+        } else {
+          reader.readAsBinaryString(f);
+        }
+
+      },
+      formatDate(numb, format) {
+        const old = numb - 1;
+        const t = Math.round((old - Math.floor(old)) * 24 * 60 * 60);
+        const time = new Date(1900, 0, old, 0, 0, t)
+        const year = time.getFullYear();
+        const month = time.getMonth() + 1;
+        const date = time.getDate();
+        return year + format + (month < 10 ? '0' + month : month) + format + (date < 10 ? '0' + date : date) +
+          ' 00:00:00'
+      },
       returnBack(item){   
           goBack({id:item.id}).toPromise()
 						.then((response) => {

+ 5 - 7
src/views/taskManagement/inOutWarehouseTaskEdit.vue

@@ -81,10 +81,9 @@
             <div>  {{dataList.contractNo}}</div>
           </el-form-item>
           <!-- 货名 -->
-          <el-form-item label="货源" class="huom">
+          <!-- <el-form-item label="货源" class="huom">
             {{goods}}
-            <!-- </el-select> -->
-          </el-form-item>
+          </el-form-item> -->
           <!--重量(吨)-->
           <el-form-item label="重量(吨)" span="1" style=" margin-left: 350px; margin-top: -40px">
             {{dataList.weight}}
@@ -195,10 +194,9 @@
             {{dataList.goodsName}}
             <!-- </el-select> -->
           </el-form-item>
-          <el-form-item v-else label="货源" class="huom">
+          <!-- <el-form-item v-else label="货源" class="huom">
             {{goods}}
-            <!-- </el-select> -->
-          </el-form-item>
+          </el-form-item> -->
           <!--重量(吨)-->
           <el-form-item label="重量(吨)" span="1" style=" margin-left: 350px; margin-top: -40px">
             {{dataList1.weight}}
@@ -302,7 +300,7 @@
             <!-- </el-select> -->
           </el-form-item>
           <!-- 货名 -->
-          <el-form-item label="货源" class="huom">
+          <!-- <el-form-item label="货源" class="huom"> -->
             {{goods}}
             <!-- </el-select> -->
           </el-form-item>

+ 23 - 16
src/views/taskManagement/tranManagementWarehouseInOutTaskAdd.vue

@@ -67,14 +67,21 @@
 						</el-input>
 					</el-form-item>
 					<!-- 货名 -->
-					<el-form-item label="货源" class="huom">
+					<el-form-item v-if="dataList.taskTypeKey != 3" label="货名" class="huom">
+						<el-select disabled v-model="dataList.goodsName" placeholder="货名" class="huom" @change="selectgoodsName"
+						filterable clearable>
+						<el-option v-for="item in goodnameList" :key="item.constKey" :label="item.constValue"
+							:value="item.constValue"></el-option>
+						</el-select>
+					</el-form-item>
+					<!-- <el-form-item label="货源" class="huom">
 						<el-input disabled v-model="goods" placeholder="请选择货源"
 							maxlength="120" size="small" class="huom" />
 						<el-button class="bg-bottom" type="primary" size="small" @click="supplygoods()">选择货源</el-button>
-					</el-form-item>
+					</el-form-item> -->
 					<!--重量(吨)-->
 					<el-form-item label="重量(吨)">
-						<el-input disabled @input="weightchange1" v-model="dataList.weight" placeholder="请输入重量(吨)"
+						<el-input  @input="weightchange1" v-model="dataList.weight" placeholder="请输入重量(吨)"
 							maxlength="120" size="small" class="huom" />
 					</el-form-item>
 					<!-- 品级 -->
@@ -181,14 +188,14 @@
 							:value="item.constValue"></el-option>
 						</el-select>
 					</el-form-item>
-					<el-form-item v-else label="货源" class="huom">
+					<!-- <el-form-item v-else label="货源" class="huom">
 						<el-input disabled v-model="goods" placeholder="请选择货源"
 							maxlength="120" size="small" class="huom" />
 						<el-button v-if='dataList.taskTypeKey!=3' class="bg-bottom" type="primary" size="small" @click="supplygoods()">选择货源</el-button>
-					</el-form-item>
+					</el-form-item> -->
 					<!--重量(吨)-->
 					<el-form-item label="重量(吨)">
-						<el-input disabled @input="weightchange" v-model="dataList1.weight" placeholder="请输入重量(吨)"
+						<el-input  @input="weightchange" v-model="dataList1.weight" placeholder="请输入重量(吨)"
 							maxlength="120" size="small" class="huom" />
 					</el-form-item>
 					<!-- 品级 -->
@@ -287,14 +294,14 @@
 						</el-select>
 					</el-form-item>
 					<!-- 货名 -->
-					<el-form-item label="货源" class="huom">
+					<!-- <el-form-item label="货源" class="huom">
 						<el-input disabled v-model="goods" placeholder="请选择货源"
 							maxlength="120" size="small" class="huom" />
 						 <el-button class="bg-bottom" v-if='dataList.taskTypeKey!=4' type="primary" size="small" @click="supplygoods()">选择货源</el-button>
-					</el-form-item>
+					</el-form-item> -->
 					<!--重量(吨)-->
 					<el-form-item label="重量(吨)">
-						<el-input disabled v-model="dataList.weight" placeholder="请输入重量(吨)"
+						<el-input  v-model="dataList.weight" placeholder="请输入重量(吨)"
 							maxlength="120" size="small" class="huom" />
 					</el-form-item>
 					<!-- 品级 -->
@@ -1498,13 +1505,13 @@
 						data[i].sourceId=data[i].id
 					}
 				}else{
-					if(this.dataList.taskTypeKey == 1||this.dataList.taskTypeKey == 3||this.dataList.taskTypeKey == 4||this.dataList1.taskTypeKey == 2&&this.dataList1.inOutType){
-						this.$message({
-							message: '请选择货源!',
-							type: 'warning'
-						})
-						return
-					}
+					// if(this.dataList.taskTypeKey == 1||this.dataList.taskTypeKey == 3||this.dataList.taskTypeKey == 4||this.dataList1.taskTypeKey == 2&&this.dataList1.inOutType){
+					// 	this.$message({
+					// 		message: '请选择货源!',
+					// 		type: 'warning'
+					// 	})
+					// 	return
+					// }
 					
 				}
 				var supplygoods=data

+ 6 - 6
src/views/taskManagement/tranManagementWarehouseInOutTaskAudit.vue

@@ -96,11 +96,11 @@
                 :value="item.constValue"></el-option>
             </el-select>
           </el-form-item> -->
-          <el-form-item label="货源" class="huom">
+          <!-- <el-form-item label="货源" class="huom">
             <el-input disabled v-model="goods" placeholder="请选择货源"
 							maxlength="120" size="small" class="huom" />
             <el-button class="bg-bottom" type="primary" size="small" @click="supplygoods()">查看货源</el-button>
-          </el-form-item>
+          </el-form-item> -->
           <!--重量(吨)-->
           <el-form-item label="重量(吨)">
             <el-input disabled v-model="dataList.weight" placeholder="请输入重量(吨)" maxlength="120" size="small"
@@ -226,11 +226,11 @@
 							:value="item.constValue"></el-option>
 						</el-select>
 					</el-form-item>
-					<el-form-item v-else label="货源" class="huom">
+					<!-- <el-form-item v-else label="货源" class="huom">
 						<el-input disabled v-model="goods" placeholder="请选择货源"
 							maxlength="120" size="small" class="huom" />
 						<el-button v-if='dataList.taskTypeKey!=3' class="bg-bottom" type="primary" size="small" @click="supplygoods()">查看货源</el-button>
-					</el-form-item>
+					</el-form-item> -->
           <!--重量(吨)-->
           <el-form-item label="重量(吨)">
             <el-input @input="weightchange" v-model="dataList1.weight" placeholder="请输入重量(吨)" maxlength="120"
@@ -347,11 +347,11 @@
           </el-form-item>
           <!-- 货名 -->
 
-          <el-form-item label="货源" class="huom">
+          <!-- <el-form-item label="货源" class="huom">
             <el-input disabled v-model="goods" placeholder="请选择货源"
 							maxlength="120" size="small" class="huom" />
              <el-button class="bg-bottom" v-if='dataList.taskTypeKey!=4' type="primary" size="small" @click="supplygoods()">查看货源</el-button>
-          </el-form-item>
+          </el-form-item> -->
           <!--重量(吨)-->
           <el-form-item label="重量(吨)">
             <el-input disabled v-model="dataList.weight" placeholder="请输入重量(吨)" maxlength="120" size="small"

+ 9 - 12
src/views/taskManagement/tranManagementWarehouseInOutTaskEdit.vue

@@ -163,19 +163,18 @@
             />
           </el-form-item>
           <!-- 货名 -->
-          <el-form-item label="货源" class="huom">
+          <!-- <el-form-item label="货源" class="huom">
             <el-input disabled v-model="goods" placeholder="请选择货源"
 							maxlength="120" size="small" class="huom" />
             <el-button class="bg-bottom" type="primary" size="small" @click="supplygoods()">选择货源</el-button>
-          </el-form-item>
+          </el-form-item> -->
           <!--重量(吨)-->
           <el-form-item
             label="重量(吨)"
             span="1"
-            style="margin-left: 350px; margin-top: -40px"
+            style="margin-left: 650px; margin-top: -40px"
           >
             <el-input
-            disabled
               v-model="dataList.weight"
               placeholder="请输入重量(吨)"
               maxlength="120"
@@ -413,19 +412,18 @@
 							:value="item.constValue"></el-option>
 						</el-select>
 					</el-form-item>
-					<el-form-item v-else label="货源" class="huom">
+					<!-- <el-form-item v-else label="货源" class="huom">
 						<el-input disabled v-model="goods" placeholder="请选择货源"
 							maxlength="120" size="small" class="huom" />
 						<el-button v-if='dataList.taskTypeKey!=3' class="bg-bottom" type="primary" size="small" @click="supplygoods()">选择货源</el-button>
-					</el-form-item>
+					</el-form-item> -->
           <!--重量(吨)-->
           <el-form-item
             label="重量(吨)"
             span="1"
-            style="margin-left: 350px; margin-top: -40px"
+            style="margin-left: 650px; margin-top: -40px"
           >
             <el-input
-              disabled
               @input="weightchange"
               v-model="dataList1.weight"
               placeholder="请输入重量(吨)"
@@ -635,19 +633,18 @@
             />
           </el-form-item>
           <!-- 货名 -->
-          <el-form-item label="货源" class="huom">
+          <!-- <el-form-item label="货源" class="huom">
             <el-input disabled v-model="goods" placeholder="请选择货源"
 							maxlength="120" size="small" class="huom" />
             <el-button class="bg-bottom" v-if='dataList.taskTypeKey!=4' type="primary" size="small" @click="supplygoods()">选择货源</el-button>
-          </el-form-item>
+          </el-form-item> -->
           <!--重量(吨)-->
           <el-form-item
             label="重量(吨)"
             span="1"
-            style="margin-left: 350px; margin-top: -40px"
+            style="margin-left: 650px; margin-top: -40px"
           >
             <el-input
-              disabled
               v-model="dataList.weight"
               placeholder="请输入重量(吨)"
               maxlength="120"