Browse Source

提交代码

zengyf 2 years ago
parent
commit
28249dc7ca

+ 3 - 4
build/utils.js

@@ -16,11 +16,10 @@ const devPathSrc = path.resolve(__dirname, '../../../src') // node_modules应用
 //       统计报表       组织机构/系统管理 采购  仓储
 //  'statisticalReport','systemConfig','TMS','WMS','workFlow','ADMINISTRATORS']
 
-//let devModules = ['all']
-//let devModules = ['index', 'statisticalReport', 'queue', 'sale','TMS','QMS','appoint','RMS']
-let devModules = ['all']
-//let devModules=['index']
 
+let devModules = ['all']
+//let devModules = ['index', 'statisticalReport', 'queue', 'sale','TMS','QMS','appoint']
+// let devModules = ['index', 'ADMINISTRATORS']
 
 if (pathSrc.indexOf('node_modules') > -1) {
   devModules = require('../../../cors.js').devModules

+ 1 - 1
config/index.js

@@ -73,7 +73,7 @@ let proxyTable = {
   // 所有数据的请求域名地址
   '/api/v1': {
     target: 'http://172.16.33.166:80',
-    //target: 'http://localhost:8080',
+    // target: 'http://localhost:8080',
     // target: 'http://192.168.1.104:8080',
     ws: true,
     pathRewrite: {

+ 100 - 26
src/views/ADMINISTRATORS/components/ADMINISTRATORS1.vue

@@ -308,10 +308,7 @@
               </div>
               <div class="from">
                 <span class="text">进厂门岗:</span>
-                <el-select
-                  v-model="enFactoryGatepost"
-                  placeholder="请选择"
-                >
+                <el-select v-model="enFactoryGatepost" placeholder="请选择">
                   <el-option
                     v-for="item in gatePostList"
                     :key="item.gatepostId"
@@ -319,7 +316,7 @@
                     :value="item.gatepostId"
                   >
                   </el-option>
-              </el-select>
+                </el-select>
               </div>
               <div class="button_box">
                 <el-button
@@ -361,10 +358,7 @@
               </div>
               <div class="from">
                 <span class="text">出厂门岗:</span>
-                <el-select
-                  v-model="enFactoryGatepost"
-                  placeholder="请选择"
-                >
+                <el-select v-model="enFactoryGatepost" placeholder="请选择">
                   <el-option
                     v-for="item in gatePostList"
                     :key="item.gatepostId"
@@ -460,6 +454,58 @@
               </div>
             </div>
           </el-tab-pane>
+          <el-tab-pane label="物流单向删皮/删毛接口(仅限钢材)" name="zero">
+            <div class="admin2">
+              <div class="carrier from">
+                <el-form
+                  :inline="true"
+                  class="demo-form-inline"
+                  label-width="80px"
+                >
+                  <el-form-item label="车牌号:">
+                    <el-autocomplete
+                      class="inline-input"
+                      v-model="capacityName"
+                      :fetch-suggestions="querySearchCapacity"
+                      placeholder="车牌号"
+                      :trigger-on-focus="false"
+                      @select="handleSelectCapacity"
+                    >
+                      <template slot-scope="{ item }">
+                        <div class="name">{{ item.capacityNumber }}</div>
+                      </template>
+                    </el-autocomplete>
+                  </el-form-item>
+                </el-form>
+              </div>
+              <div class="material from">
+                <span class="text">物资:</span>
+                <el-select v-model="materialId" placeholder="请选择">
+                  <el-option
+                    v-for="item in materialList"
+                    :key="item.materialId"
+                    :label="item.materialName"
+                    :value="item.materialId"
+                  >
+                  </el-option>
+                </el-select>
+              </div>
+              <div class="block">
+                <span class="text">毛重时间:</span>
+                <el-date-picker
+                  v-model="value1"
+                  type="datetime"
+                  placeholder="选择日期时间"
+                >
+                </el-date-picker>
+              </div>
+            </div>
+            <div class="button_box">
+              <el-button type="primary" @click="linkageDeleteTransportOrder"
+                >确认</el-button
+              >
+            </div>
+          </el-tab-pane>
         </el-tabs>
       </div>
     </template>
@@ -509,6 +555,34 @@ export default {
     this.information()
   },
   methods: {
+    linkageDeleteTransportOrder() {
+      let good = ''
+      let goodspa = ''
+      let goodList = []
+      let mapList = []
+      if (this.materialId != null) {
+        goodList = this.materialList.filter(e => {
+          if (e.materialId == this.materialId) {
+            return e
+          }
+        })
+        good = goodList[0].good
+        goodspa = goodList[0].goodspa
+      }
+      let map = {
+        orderNumber: this.orderNumber,
+        good: good,
+        goodspa: goodspa,
+        resultCrossWeightTime: toDateString(this.value1)
+      }
+      mapList.push(map)
+      this.axios
+        .post('/api/v1/join/linkageDeleteTransportOrder', mapList)
+        .then(res => {
+          console.log(res)
+        })
+      console.log(toDateString(this.value1))
+    },
     updateOrderStatus() {
       if (
         this.orderNumber != null &&
@@ -540,28 +614,28 @@ export default {
         orderNumber: this.orderNumber + ' ',
         gatepostId: this.enFactoryGatepost
       }
-      this.axios.post('/api/v1/tms/enFactoryResultByPDA',map).then(res=>{
-        console.log(res);
-        if(res.data.status=='succeed'){
-          this.$message.success("进厂成功!");
-        }else{
-          this.$message.error("操作失败:"+res.data.data);
+      this.axios.post('/api/v1/tms/enFactoryResultByPDA', map).then(res => {
+        console.log(res)
+        if (res.data.status == 'succeed') {
+          this.$message.success('进厂成功!')
+        } else {
+          this.$message.error('操作失败:' + res.data.data)
         }
-      });
+      })
     },
-    leaveFactoryResultByPDA(){
-       let map = {
+    leaveFactoryResultByPDA() {
+      let map = {
         orderNumber: this.orderNumber + ' ',
-        gatepostId:  this.enFactoryGatepost
+        gatepostId: this.enFactoryGatepost
       }
-      this.axios.post('/api/v1/tms/addLeaveFactoryResult',map).then(res=>{
-        console.log(res);
-        if(res.data.status=='succeed'){
-          this.$message.success("出厂成功!");
-        }else{
-          this.$message.error("操作失败:"+res.data.data);
+      this.axios.post('/api/v1/tms/addLeaveFactoryResult', map).then(res => {
+        console.log(res)
+        if (res.data.status == 'succeed') {
+          this.$message.success('出厂成功!')
+        } else {
+          this.$message.error('操作失败:' + res.data.data)
         }
-      });
+      })
     },
     allowEnfactoryClick() {},
     queueClick() {

+ 100 - 16
src/views/sale/components/transportFreight/saleTruckSettlement/bmsTruckDetailsOrderNew.vue

@@ -67,7 +67,7 @@
             style="width:150px"
           >
           </el-date-picker>
-          <el-button type="primary" class="btn" @click="onclick">
+          <el-button type="primary" class="btn" @click="getSteelReport">
             <i class="el-icon-search"></i>
           </el-button>
         </el-form-item>
@@ -104,11 +104,16 @@
             ><i class="el-icon-map-location"></i>实时路径</el-button
           > -->
         </el-form-item>
-        <el-form-item>
+        <el-form-item v-show="activeName=='first'">
           <el-button type="primary" @click="makeSurePrice"
           v-if="!notRoutList.includes('capacityNo')"
             ><i class="el-icon-circle-check"></i>确认执行价</el-button
           >
+        </el-form-item>
+         <el-form-item v-show="activeName=='second'">
+          <el-button type="primary" @click="openStatement">
+            <i class="el-icon-circle-check"></i>生成账单
+          </el-button>
         </el-form-item>
         <!-- <el-form-item v-if="isShowOperate">
           <el-button type="primary" @click="openReceive()">
@@ -352,7 +357,7 @@
             </el-table>
           </div>
         </el-tab-pane>
-        <el-tab-pane label="已结算" name="second">
+        <el-tab-pane label="已确认" name="second">
           <div class="table1">
             <el-table
               :data="visibleList1"
@@ -361,18 +366,12 @@
               border
               style="width: 100%; margin-top: 20px"
               :height="maxHeight"
-              :row-class-name="tableRowClassName"
-              @cell-click="cellClik"
-              @cell-mouse-enter="cellMouse1"
-              @cell-mouse-leave="cellLeave1"
-              @row-click="rowClick"
               :cell-style="cellStyle"
               @filter-change="filterChange"
-              :key="saleSteelKey"
               id="salesLogisticsStat_saleSteelReports_table"
               individual-panel
-              @resetTable="reset"
             >
+            <el-table-column type="selection" width="30" label="选择"></el-table-column>
             <el-table-column
                 width="50"
                 label="序号"
@@ -680,6 +679,42 @@
         <el-button type="primary" @click="makeSure">只修改单价</el-button>
       </div>
     </el-drawer>
+    <el-dialog
+      title="上传账单"
+      :visible.sync="showStatementUpLoad"
+      :before-close="closeUpload"
+    >
+      <el-form style="margin-left:20%">
+        <el-form-item label="发票金额">
+          <el-input v-model="excludeTax" style="width:200px" type="number"></el-input>
+        </el-form-item>
+        <el-form-item label="发票图片" style="">
+          <el-upload
+            ref="statementUpload"
+            list-type="picture-card"
+            action="/api/v1/otms/addtmstruckArrivalResult"
+            :limit="1"
+            :on-change="fileChange1"
+            :on-preview="handlePictureCardPreview"
+            :on-exceed="exceed"
+            accept=".jpg,.jpeg,.png,.gif,.bmp,.pdf,.JPG,.JPEG,.PBG,.GIF,.BMP,.PDF"
+            :auto-upload="false"
+          >
+            <i class="el-icon-plus"></i>
+          </el-upload>
+        </el-form-item>
+      </el-form>
+      <el-button
+        type="primary"
+        @click="generateStatement"
+        :loading="isLoading"
+        style="margin-left:40%"
+        >确定</el-button
+      >
+    </el-dialog>
+    <el-dialog :visible.sync="dialogVisible" width="80%">
+      <img width="100%" :src="dialogImageUrl" alt="" />
+    </el-dialog>
   </div>
 </template>
 
@@ -922,7 +957,6 @@ export default {
       location: null,
       orderNumber: null,
       capacityNumber: null,
-      arrivalReceiving: false,
       fileListArrival: [],
       fileListReceive: [],
       dialogImageUrl: '',
@@ -960,7 +994,10 @@ export default {
           opacity: 0.8, //滚动条透明度
           'overflow-x': 'hidden'
         }
-      }
+      },
+      excludeTax:null,
+      statementList:[],
+      showStatementUpLoad:false
     }
   },
   created() {
@@ -1108,6 +1145,53 @@ export default {
           })
         })
     },
+    openStatement(){
+      console.log(this.$refs.tableRef1.selection, 'selection');
+      if(!this.$refs.tableRef1.selection || this.$refs.tableRef1.selection.length<=0){
+        this.$message.warning("请选择需要上传发票的订单");
+      }else{
+        this.excludeTax=null;
+        this.statementList=[];
+        this.showStatementUpLoad=true;
+      }
+    },
+    generateStatement(){
+      this.isLoading=true;
+      if(!this.excludeTax){
+        this.$message.warning('请填写发票金额')
+        this.isLoading=false;
+      }else if(this.statementList.length < 1) {
+        this.$message.warning('请上传发票')
+        this.isLoading=false;
+      }else{
+        let orderList = this.$refs.tableRef1.selection.map(e => {
+         return e.orderId
+        })
+        let formData = new window.FormData();
+        formData.append('file0', this.statementList[0].raw);
+        formData.append('orderList',orderList);
+        formData.append('excludeTax', this.excludeTax);
+        formData.append('userId',getCookie('userId'));
+        let options = {
+          url: '/api/v1/bms/addTruckStatement',
+          data: formData,
+          method: 'post',
+          headers: {
+            'Content-Type': 'multipart/form-data'
+          }
+        }
+        this.axios(options).then(res => {
+          console.log('uploadRes:', res)
+          if(res.data.status=='succeed'){
+            this.$message.success('上传成功!')
+            this.closeUpload()
+          }else{
+            this.$message.error(res.data.data);
+            this.isLoading = false
+          }
+        })
+      }
+    },
     receiveClick(src, title) {
       // this.dialogImageUrl = src
       downloadFile(src, `${this.downloadCapacityNo}${title}照片`, '.jpg')
@@ -1396,7 +1480,7 @@ export default {
       })
     },
     fileChange1(file, fileList) {
-      this.fileListArrival = fileList
+      this.statementList = fileList
     },
     fileChange2(file, fileList) {
       this.fileListReceive = fileList
@@ -1409,10 +1493,10 @@ export default {
       this.dialogVisible = true
     },
     closeUpload() {
-      this.arrivalReceiving = false
+      this.showStatementUpLoad = false
       this.isLoading = false
-      this.$refs.arrival.clearFiles()
-      this.$refs.receive.clearFiles()
+      this.$refs.statementUpload.clearFiles()
+      // this.$refs.receive.clearFiles()
     },
     //防抖函数--防止用户重复点击
     debounce(func, delay) {

+ 421 - 0
src/views/sale/components/transportFreight/saleTruckSettlement/bmsTruckStatementNew.vue

@@ -0,0 +1,421 @@
+// 新计费账单
+<template>
+  <div class="steel_inbound" style="width:100%">
+    <div class="sache">
+      <el-input placeholder="请输入收货客户" v-model="input" clearable> </el-input>
+      <el-date-picker
+            v-model="startTime"
+            type="date"
+            placeholder="选择日期"
+            style="width:150px"
+          >
+          </el-date-picker>
+          <span>至</span>
+          <el-date-picker
+            v-model="endTime"
+            type="date"
+            placeholder="选择日期"
+            style="width:150px"
+          >
+      </el-date-picker>
+      <el-button type="primary" class="btn" @click="onclick">
+        <i class="el-icon-search"></i>查询
+      </el-button>
+    </div>
+    <div class="table">
+      <dilTable v-bind.sync="options">
+        <el-table-column fixed="right" label="操作" width="180">
+          <template slot-scope="scope">
+            <el-button
+              type="text"
+              size="small"
+              @click="showPhoto(scope.row)"
+            >
+              查看发票
+            </el-button>
+            <el-button
+              type="text"
+              size="small"
+              @click="showDetails(scope.row)"
+            >
+              查看详单
+            </el-button>
+            <el-button
+              type="text"
+              size="small"
+              @click="deleteStatement(scope.row)"
+            >
+              删除账单
+            </el-button>
+          </template>
+        </el-table-column>
+      </dilTable>
+    </div>
+    <!-- 发票图片 -->
+    <el-dialog
+      title="发票图片"
+      :visible.sync="isShowPhoto"
+    >
+      <div  v-for="(item, i) in photoList" :key="i">
+          <el-image :src="item" fit="fill" :preview-src-list="photoList" style="width:300px;height:300px">
+            <div slot="error" class="image-slot">
+              <span>图片加载失败</span>
+            </div>
+          </el-image>
+      </div>
+    </el-dialog>
+    <!-- 查询账单底下的计费详单-->
+    <el-dialog
+      title="详单信息"
+      :visible.sync="isShowDetails"
+      style="height:600px;width:100%"
+      >
+       <div class="table1">
+            <el-table
+              :data="visibleList1"
+              :span-method="objectSpanMethod1"
+              ref="tableRef1"
+              border
+              style="width: 100%; margin-top: 20px"
+              :height="350"
+              id="salesLogisticsStat_saleSteelReports_table"
+              individual-panel
+            >
+            <el-table-column
+                width="50"
+                label="序号"
+                align="center"
+                :resizable="false"
+                fixed="left"
+              >
+                <template slot-scope="scope">{{
+                  scope.row.group + 1
+                }}</template>
+              </el-table-column>
+              <el-table-column
+                prop="orderTime"
+                label="订单日期"
+                width="110px"
+                align="center"
+                show-overflow-tooltip
+              >
+              </el-table-column>
+              <el-table-column
+                prop="saleMakeDate"
+                label="制单时间"
+                width="110px"
+                align="center"
+              >
+              </el-table-column>
+              <el-table-column
+                prop="capacityNo"
+                column-key="capacityNo"
+                label="车牌号"
+                align="center"
+                width="90px"
+                sortable
+                show-overflow-tooltip
+              >
+              </el-table-column>
+              <el-table-column
+                prop="addressPlace"
+                label="收货地址"
+                width="250px"
+                sortable
+                column-key="addressPlace"
+              >
+              </el-table-column>
+              <el-table-column
+                prop="actualAddress"
+                label="实际收货地址"
+                width="250px"
+                sortable
+                column-key="actualAddress"
+              >
+              </el-table-column>
+              <el-table-column
+                prop="priceValue"
+                label="最终运价"
+                width="100px"
+              >
+              </el-table-column>
+              <el-table-column
+                prop="detailsAmount"
+                label="最终运费"
+                width="100px"
+              ></el-table-column>
+              <el-table-column
+                prop="netWeight"
+                label="净重"
+                show-overflow-tooltip
+              >
+              </el-table-column>
+              <el-table-column
+                prop="materialWeight"
+                label="理重"
+                show-overflow-tooltip
+              >
+              </el-table-column>
+              <el-table-column
+                prop="materialName"
+                column-key="materialNameList"
+                label="物资名称"
+                align="center"
+                width="150px"
+                sortable
+              >
+              </el-table-column>
+              <el-table-column
+                prop="materialSpe"
+                label="物资规格"
+                column-key="materialSpe"
+                align="center"
+                sortable
+                width="120px"
+              >
+              </el-table-column>
+              <el-table-column
+                prop="materialPlanNumber"
+                label="计划件数"
+                align="center"
+                width="50px"
+              >
+              </el-table-column>
+              <el-table-column
+                prop="materialNum"
+                label="装车件数"
+                align="center"
+                width="50px"
+              >
+              </el-table-column>
+              <el-table-column
+                prop="saleRemark"
+                column-key="saleRemark"
+                label="摘要"
+                width="150px"
+                align="center"
+                show-overflow-tooltip
+              >
+              </el-table-column>
+              <el-table-column
+                prop="actualCity"
+                label="卸货城市"
+                width="120px"
+                show-overflow-tooltip
+              >
+              </el-table-column>
+              <el-table-column
+                prop="areaName"
+                label="分区"
+                width="150px"
+                align="center"
+                column-key="saleAreaList"
+              >
+              </el-table-column>
+              <el-table-column
+                prop="unloadType"
+                label="卸货类别"
+                width="60px"
+              >
+              </el-table-column>
+              <el-table-column
+                prop="paymentCustomer"
+                label="付款单位"
+                width="120px"
+                show-overflow-tooltip
+              >
+              </el-table-column>
+              <el-table-column
+                prop="consingneeSettlementMethod"
+                label="结算方式"
+                width="120px"
+                show-overflow-tooltip
+              >
+              </el-table-column>
+              <el-table-column
+                prop="saleOrderReceiveCustomer"
+                label="收款单位"
+                width="120px"
+                show-overflow-tooltip
+              >
+              </el-table-column>
+            </el-table>
+          </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { getCookie } from '@/utils/util.js'
+import { sjTime } from '@/utils/sharedJsFile'
+export default {
+  data(){
+    return{
+      input:"",
+      userId:null,
+      photoList:[],
+      isShowPhoto:false,
+      isShowDetails:false,
+      startTime:null,
+      endTime:null,
+      spanArr1:[],
+      visibleList1:[],
+      options:{
+        requestUrl:""
+      },
+      orgCodeList: [
+        'wuliuyunshubu',
+        'dagangadmin',
+        'shichangxinxibu',
+        'zidonghuabu'
+      ],
+      mergeList1: [
+        '选择',
+        '序号',
+        '整车操作',
+        '销售订单状态',
+        '销售订单号',
+        '发货单位',
+        '司机电话',
+        '运输订单号',
+        '签收地址',
+        '签收时间',
+        '抵达地址',
+        '抵达时间',
+        '出厂时间',
+        '进厂时间',
+        '运单状态',
+        '车牌号',
+        '承运商',
+        '客户',
+        '收货地址',
+        '实际收货地址',
+        '业务员',
+        '送货单打印',
+        '收货客户电话',
+        '是否自提',
+        '订单日期',
+        '短信发送',
+        '销售片区',
+        '抵达时间',
+        '签收时间',
+        '最终运价',
+        '摘要'
+      ],
+    }
+  },
+  created(){
+    if (!this.orgCodeList.includes(getCookie('orgCode'))) {
+      this.userId=getCookie("userId");
+    }
+    this.startTime=new Date();
+    this.endTime=new Date();
+    this.startTime.setDate(1);
+    this.onclick();
+  },
+  methods:{
+    onclick(){
+      if (this.startTime && this.endTime) {
+        let startTime = sjTime(this.startTime)
+        let endTime = sjTime(this.endTime)
+        this.options.requestUrl = "/api/v1/bms/getTruckStatementList?apiId=179&con="+this.input
+        +"&userId="+this.userId
+        +"&i="+new Date()
+        +"&startTime="+startTime
+        +"&endTime="+endTime
+      }else{
+         this.options.requestUrl = "/api/v1/bms/getTruckStatementList?apiId=179&con="+this.input
+        +"&userId="+this.userId
+        +"&i="+new Date()
+      }
+    },
+    showPhoto(row){
+      this.photoList=[];
+      this.isShowPhoto=true;
+      this.axios
+        .post('/api/v1/bms/getStatementPhoto?statementId=' + row.statementId)
+        .then(res => {
+          console.log('statementPhoto:', res)
+          if (res.data) {
+            this.photoList = res.data
+          }
+      })
+    },
+    showDetails(row){
+      this.isShowDetails=true;
+      this.visibleList1=[];
+      let map={
+        statementId:row.statementId
+      }
+      this.axios
+        .post('/api/v1/bms/findDetailsForStatement',map)
+        .then(res => {
+          console.log('findDetailsForStatement:', res)
+          this.visibleList1=res.data.data;
+          this.getSpanArr1(this.visibleList1);
+      })
+    },
+    deleteStatement(row){
+      this.$confirm('此操作将永久删除该账单, 是否继续?', '提示',{
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(()=>{
+         this.axios
+        .post('/api/v1/bms/deleteConvertedTruckStatement/' + row.statementId)
+        .then(res => {
+          this.$message.success(res.data.data);
+          this.onclick();
+        })
+      }).catch(()=>{
+
+      });
+      
+    },
+    getSpanArr1(data) {
+      //每次调用方法初始化
+      this.spanArr1 = []
+      for (var i = 0; i < data.length; i++) {
+        if (i === 0) {
+          this.spanArr1.push(1)
+          data[i].group = i
+          this.pos = 0
+        } else {
+          // 判断当前元素与上一个元素是否相同
+          if (data[i].saleOrderMaterialId === data[i - 1].saleOrderMaterialId) {
+            this.spanArr1[this.pos] += 1
+            data[i].group = data[i - 1].group
+            this.spanArr1.push(0)
+          } else {
+            this.spanArr1.push(1)
+            this.pos = i
+            data[i].group = data[i - 1].group + 1
+          }
+        }
+      }
+    },
+    objectSpanMethod1({ row, column, rowIndex, columnIndex }) {
+      if (this.mergeList1.indexOf(column.label) != -1) {
+        const _row = this.spanArr1[rowIndex]
+        const _col = _row > 0 ? 1 : 0
+        return {
+          rowspan: _row,
+          colspan: _col
+        }
+      }
+    },
+  }
+}
+</script>
+
+<style lang="scss" scode>
+.steel_inbound{
+  .sache{
+    padding: 1.25rem 0.375rem;
+			.el-input {
+			width: 20%;
+			margin-right: 1.25rem;
+			}
+  }
+}
+</style>

+ 7 - 0
src/views/sale/router/index.js

@@ -107,6 +107,7 @@ import bmsTruckDetailsOrderNew from "../components/transportFreight/saleTruckSet
 import bmsTruckFormula from "../components/transportFreight/saleTruckSettlement/bmsTruckFormula.vue";
 import bmsTruckInvoice from "../components/transportFreight/saleTruckSettlement/bmsTruckInvoice.vue";
 import bmsTruckStatement from "../components/transportFreight/saleTruckSettlement/bmsTruckStatement.vue";
+import bmsTruckStatementNew from "../components/transportFreight/saleTruckSettlement/bmsTruckStatementNew.vue";
 import getBmsTruckStatementOrder from "../components/transportFreight/saleTruckSettlement/getBmsTruckStatementOrder.vue";
 import getTransportResult from "../components/transportFreight/saleTruckSettlement/getTransportResult.vue";
 import mapTest from "../components/offSiteTransportation/mapTest.vue";
@@ -724,6 +725,12 @@ const constantRouterMap = [
         meta: { code: "xtpzgl-yhgl" },
         component: bmsTruckStatement
       },
+      {
+        path: "bmsTruckStatementNew",
+        name: "bmsTruckStatementNew",
+        meta: { code: "xtpzgl-yhgl" },
+        component: bmsTruckStatementNew
+      },
       {
         path: "getBmsTruckStatementOrder/:statementId",
         name: "getBmsTruckStatementOrder",

+ 385 - 6
src/views/statisticalReport/components/salesLogisticsStatistics/saleSteelReports.vue

@@ -123,6 +123,16 @@
             <i class="el-icon-finished"></i>获取制单日期</el-button
           >
         </el-form-item>
+        <el-form-item v-if="isShowOperate">
+          <el-button
+            type="primary"
+            @click="exceptionHandle()"
+            v-if="!notRoutList.includes('exceptionHandle')"
+          >
+            <i class="el-icon-s-open"></i>
+            异常处理
+          </el-button>
+        </el-form-item>
         <el-form-item>
           <label
             class="el-form-item__label"
@@ -289,6 +299,14 @@
           show-overflow-tooltip
         >
         </el-table-column>
+        <el-table-column
+          prop="truckRemark"
+          label="备注"
+          width="150"
+          align="center"
+          show-overflow-tooltip
+        >
+        </el-table-column>
         <el-table-column
           prop="capacityTel"
           label="司机电话"
@@ -393,7 +411,7 @@
           label="实际运费"
           width="100px"
         ></el-table-column>
-          <el-table-column
+        <el-table-column
           prop="isAccept"
           label="异地库接收标志"
           width="60px"
@@ -751,20 +769,20 @@
               <template slot-scope="scope">
                 <button
                   type="primary"
-                  @click="scope.row.materialNum--"
+                  @click="scope.row.materialNumber--"
                   style="height:40px"
                   v-if="!notRoutList.includes('materialNum')"
                 >
                   -
                 </button>
                 <input
-                  v-model="scope.row.materialNum"
+                  v-model="scope.row.materialNumber"
                   style="width:40px;height: 40px;font-size:16px;line-height: 40px;text-align: center;"
                   :disabled="notRoutList.includes('materialNum')"
                 />
                 <button
                   type="primary"
-                  @click="scope.row.materialNum++"
+                  @click="scope.row.materialNumber++"
                   style="height:40px"
                   v-if="!notRoutList.includes('materialNum')"
                 >
@@ -1153,6 +1171,214 @@
       <el-button @click="batchCarrierVisible = false">取 消</el-button>
       <el-button type="primary" @click="batchCarrierMakeSure">确 定</el-button>
     </el-dialog>
+    <div class="dialog">
+      <el-dialog
+        :visible.sync="exceptionHandleVisible"
+        width="90%"
+        center
+        title="异常处理"
+      >
+        <div class="exceptionHandleClass">
+          <span>新增件数,修改规格,加拼数</span>
+        </div>
+        <div class="steelMapClass">
+          <div class="steelMapClass1">
+            <div class="steelMapClass12">
+              <span>销售订单号:</span>
+              <span>{{ steelMap.saleOrderNo }}</span>
+            </div>
+            <div class="steelMapClass12">
+              <span>订单状态:</span>
+              <span>{{ steelMap.saleOrderStatus }}</span>
+            </div>
+            <div class="steelMapClass12">
+              <span>业务员:</span>
+              <span>{{ steelMap.saler }}</span>
+            </div>
+            <div class="steelMapClass12">
+              <span>客户:</span>
+              <span>{{ steelMap.consigneeName }}</span>
+            </div>
+          </div>
+          <div class="steelMapClass2">
+            <div class="steelMapClass22">
+              <span>收货地址:</span>
+              <span>{{ steelMap.addressPlace }}</span>
+            </div>
+          </div>
+          <div class="steelMapClass3">
+            <div class="steelMapClass32">
+              <span>收货客户电话:</span>
+              <span>{{ steelMap.consigneeTel }}</span>
+            </div>
+            <div class="steelMapClass33" v-if="steelMap.carrierName">
+              <span>承运商:</span>
+              <span>{{ steelMap.carrierName }}</span>
+            </div>
+            <div class="steelMapClass33" v-if="steelMap.capacityNo">
+              <span>车牌号:</span>
+              <span>{{ steelMap.capacityNo }}</span>
+            </div>
+            <div class="steelMapClass33" v-if="steelMap.capacityTel != null">
+              <span>司机电话:</span>
+              <span>{{ steelMap.capacityTel }}</span>
+            </div>
+          </div>
+          <div class="steelMapClass4">
+            <div class="steelMapClass42" v-if="steelMap.orderNo != null">
+              <span>运输订单号:</span>
+              <span>{{ steelMap.orderNo }}</span>
+            </div>
+            <div class="steelMapClass43">
+              <span>运单状态:</span>
+              <span>{{ steelMap.orderStatus }}</span>
+            </div>
+            <div
+              class="steelMapClass43"
+              v-if="steelMap.orderStatusTime != null"
+            >
+              <span>状态更新时间:</span>
+              <span>{{ steelMap.orderStatusTime }}</span>
+            </div>
+          </div>
+        </div>
+        <div class="table1">
+          <el-table
+            :data="steelMap.mapList"
+            border
+            style="width: 100%; margin-top: 20px"
+          >
+            <el-table-column
+              prop="materialName"
+              label="物资名称"
+              align="center"
+              width="180px"
+            >
+              <template slot-scope="scope">
+                <el-input
+                  v-model="scope.row.materialName"
+                  :disabled="scope.row.netWeight != null"
+                >
+                </el-input>
+              </template>
+            </el-table-column>
+            <el-table-column
+              prop="materialSpecification"
+              label="物资规格"
+              align="center"
+              sortable
+            >
+              <template slot-scope="scope">
+                <el-input
+                  v-model="scope.row.materialSpecification"
+                  :disabled="scope.row.netWeight != null"
+                ></el-input>
+              </template>
+            </el-table-column>
+            <el-table-column
+              prop="materialModel"
+              label="物资型号"
+              align="center"
+              width="150"
+              sortable
+            >
+              <template slot-scope="scope">
+                <el-input
+                  v-model="scope.row.materialModel"
+                  :disabled="scope.row.netWeight != null"
+                ></el-input>
+              </template>
+            </el-table-column>
+            <el-table-column
+              prop="materialNumber"
+              label="物资件数"
+              align="center"
+              width="200px"
+            >
+              <template slot-scope="scope">
+                <button
+                  type="primary"
+                  @click="scope.row.materialNumber--"
+                  style="height:40px"
+                  :disabled="scope.row.netWeight != null"
+                >
+                  -
+                </button>
+                <input
+                  v-model="scope.row.materialNumber"
+                  style="width:40px;height: 40px;font-size:16px;line-height: 40px;text-align: center;"
+                  :disabled="scope.row.netWeight != null"
+                />
+                <button
+                  type="primary"
+                  @click="scope.row.materialNumber++"
+                  style="height:40px"
+                  :disabled="scope.row.netWeight != null"
+                >
+                  +
+                </button>
+              </template>
+            </el-table-column>
+            <el-table-column prop="steelMeters" label="米数" align="center">
+              <template slot-scope="scope">
+                <el-input
+                  v-model="scope.row.steelMeters"
+                  :disabled="scope.row.netWeight != null"
+                ></el-input>
+              </template>
+            </el-table-column>
+            <el-table-column prop="grossWeight" label="毛重"> </el-table-column>
+            <el-table-column
+              prop="grossWeightTime"
+              label="毛重时间"
+              width="130px"
+            >
+            </el-table-column>
+            <el-table-column prop="tareWeight" label="皮重"> </el-table-column>
+            <el-table-column
+              prop="tareWeightTime"
+              label="皮重时间"
+              width="130px"
+            >
+            </el-table-column>
+            <el-table-column prop="netWeight" label="净重"> </el-table-column>
+            <el-table-column prop="loadTime" label="装货时间" width="130px">
+            </el-table-column>
+            <el-table-column
+              prop="closeEntryId"
+              label="金蝶分录ID"
+              width="100px"
+            >
+            </el-table-column>
+            <el-table-column fixed="right" label="操作" width="200">
+              <template slot-scope="scope">
+                <el-button
+                  @click.native.prevent="
+                    deleteRow(scope.$index, steelMap.mapList)
+                  "
+                  type="text"
+                  icon="el-icon-close"
+                  size="big"
+                  v-if="scope.row.netWeight == null"
+                ></el-button>
+                <el-button
+                  @click.native.prevent="copyRowflu(scope.$index, scope.row)"
+                  type="text"
+                  size="big"
+                  >新增一拼</el-button
+                >
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+        <div class="exceptionHandleClass">
+          <el-button @click="exceptionHandleVisible = false">取 消</el-button>
+          <el-button type="primary" @click="exceptionHandleMakeSure"
+            >确 定</el-button
+          >
+        </div>
+      </el-dialog>
+    </div>
   </div>
 </template>
 
@@ -1169,6 +1395,7 @@ export default {
   },
   data() {
     return {
+      exceptionHandleVisible: false,
       batchCarrierName: null,
       batchCarrierVisible: false,
       batchAddressProvince: '',
@@ -1275,7 +1502,8 @@ export default {
         '摘要',
         '排队开始时间',
         '钢材科放行时间',
-        '异地库接收标志'
+        '备注',
+        '订单变更时间'
       ],
       //钢材多拼车辆线路ID
       //索引从1-10为1-10拼路线ID
@@ -1416,7 +1644,8 @@ export default {
         'closeEntry',
         'capacityNo',
         'batchCarrier',
-        'select'
+        'select',
+        'exceptionHandle'
       ]
     }
     //只要涉及提交即必须设计防抖,在初始化时绑定防抖函数
@@ -1432,6 +1661,9 @@ export default {
     this.cellLeave1 = this.debounce((row, column, cell) => {
       this.cellLeave(row, column, cell)
     }, 100)
+    this.exceptionHandleMakeSure = this.debounce(() => {
+      this.exceptionHandleMakeSure1()
+    }, 500)
     this.getSteelReport()
   },
   watch: {
@@ -1498,6 +1730,142 @@ export default {
   },
   computed: {},
   methods: {
+    deleteRow(index, rows) {
+      if (rows.length > 1) {
+        rows.splice(index, 1)
+      }
+    },
+    copyRowflu(index, row) {
+      console.log(index)
+      let copyRowflu = new Object()
+      Object.keys(row).forEach(key => {
+        copyRowflu[key] = row[key]
+      })
+      delete copyRowflu.materialId
+      delete copyRowflu.netWeight
+      delete copyRowflu.grossWeight
+      delete copyRowflu.grossWeightTime
+      delete copyRowflu.tareWeight
+      delete copyRowflu.tareWeightTime
+      delete copyRowflu.loadTime
+      delete copyRowflu.closeEntryId
+      this.steelMap.mapList.splice(index + 1, 0, copyRowflu)
+    },
+    exceptionHandleMakeSure1() {
+      console.log(this.steelMap)
+      this.$confirm(
+        `该操作会将${this.steelMap.capacityNo}下未出净重的分录关闭,并重新上传金蝶,确认操作?`,
+        '提示',
+        {
+          cancelButtonText: '取消',
+          confirmButtonText: '确定',
+          center: true
+        }
+      )
+        .then(() => {
+          let saleDateOfReceipt = null
+          let loadTime1 = new Date(
+            new Date(new Date().toLocaleDateString()).getTime() +
+              (3600 * 1000 * 8 - 1)
+          ) // 当天8点前
+          let loadTime2 = new Date(
+            new Date(new Date().toLocaleDateString()).getTime() +
+              (3600 * 1000 * 32 - 1)
+          ) // 次天8点前
+          if (new Date().getTime() - loadTime1 > 0) {
+            saleDateOfReceipt = loadTime2
+          } else {
+            saleDateOfReceipt = loadTime1
+          }
+          let closeEntryList = []
+          let map = this.steelMap
+          map.mapList.forEach(e => {
+            let map = {}
+            e.saleDateOfReceipt = sjTime(saleDateOfReceipt)
+            map.saleMaterialId = e.saleMaterialId
+            map.closeEntryId = e.closeEntryId
+            map.number = e.saleOrderNo
+            closeEntryList.push(map)
+          })
+          let mapList = map.mapList.filter(e => {
+            if (typeof e.netWeight == 'undefined' || e.netWeight == null) {
+              return e
+            }
+          })
+          if (mapList.length == 0) {
+            this.$message({
+              type: 'info',
+              message: '所有分录包含净重,退出!',
+              offset: '250',
+              duration: '2500'
+            })
+            return
+          }
+          map.mapList = mapList
+          map.isUploadEas = 1
+          this.axios
+            .post('/api/v1/ams/addSteelSaleOrder', map, {
+              timeout: 3 * 60 * 1000
+            })
+            .then(res => {
+              if (res.data.code == '200') {
+                this.axios
+                  .post('/api/v1/ams/closingEntries', closeEntryList, {
+                    timeout: 3 * 60 * 1000
+                  })
+                  .then(res => {
+                    if (res.data.code == '200') {
+                      this.getSteelReport()
+                      this.$message({
+                        type: 'success',
+                        offset: '250',
+                        message: '生成订单成功,关闭分录成功',
+                        duration: 2000
+                      })
+                      this.exceptionHandleVisible = false
+                    }
+                  })
+                  .catch(e => {})
+              } else {
+                this.$message({
+                  type: 'error',
+                  offset: '250',
+                  duration: '2500',
+                  message: '新增失败'
+                })
+              }
+            })
+        })
+        .catch(e => {
+          this.$message({
+            type: 'info',
+            message: '取消操作',
+            offset: '200',
+            duration: 2500
+          })
+        })
+    },
+    exceptionHandle() {
+      if (this.$refs.tableRef.selection.length == 1) {
+        console.log(this.$refs.tableRef.selection[0])
+        this.axios
+          .post(
+            '/api/v1/tms/getSteelReportDetailsBySmId?saleOrderMaterialId=' +
+              this.$refs.tableRef.selection[0].saleOrderMaterialId
+          )
+          .then(res => {
+            this.steelMap = res.data.data
+            this.exceptionHandleVisible = true
+          })
+      } else {
+        this.$message({
+          message: '异常处理单次仅能勾选一辆车',
+          offset: '250',
+          duration: '2500',
+          type: 'warning'
+        })
+      }
+    },
     getMakeDate() {
       if (this.$refs.tableRef.selection.length > 0) {
         let easPrimaryList = []
@@ -1549,12 +1917,14 @@ export default {
             this.$message.success('授权承运商成功')
             this.batchCarrierList = []
             this.batchCarrierVisible = false
+            this.batchCarrierName = null
             this.getSteelReport()
             loading.close()
           } else {
             this.$message.error('授权失败,请联系管理员')
             this.batchCarrierList = []
             this.batchCarrierVisible = false
+            this.batchCarrierName = null
             this.getSteelReport()
             loading.close()
           }
@@ -2125,6 +2495,7 @@ export default {
       this.tableRowIndex = row.group
       this.isRowClick = 1
       this.steelMap = row
+      this.$refs.tableRef.toggleRowSelection(row)
     },
     tableRowClassName({ row, rowIndex }) {
       if (row.group == this.tableRowIndex && this.tableRowIndex !== '') {
@@ -3240,6 +3611,14 @@ export default {
   }
 
   .dialog {
+    .exceptionHandleClass {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      font-size: 20px;
+      margin-top: 20px;
+      margin-bottom: 20px;
+    }
     .steelMapClass {
       .steelMapClass1 {
         display: flex;

+ 11 - 4
src/views/statisticalReport/components/salesLogisticsStatistics/unloadingSteelReports.vue

@@ -649,8 +649,15 @@ export default {
           let closeEntryList = []
           this.$refs.tableRef.selection.forEach(e => {
             let map = {}
-            e.saleRemark =
-              this.remarkDateNew + e.saleRemark.split(this.remarkDateOld)[1]
+            if (
+              typeof e.saleRemark.split(this.remarkDateOld)[1] === 'undefined'
+            ) {
+              e.saleRemark = `${this.remarkDateNew}${e.areaName},直发${e.addressDistrict}`
+            } else {
+              e.saleRemark =
+                this.remarkDateNew + e.saleRemark.split(this.remarkDateOld)[1]
+            }
+
             map.saleMaterialId = e.saleMaterialId
             map.closeEntryId = e.closeEntryId
             map.number = e.saleOrderNo
@@ -735,8 +742,8 @@ export default {
       return `${month}.${day}`
     },
     getRemarkDateOld() {
-      let day = new Date().getDate() - 1
-      let month = new Date().getMonth() + 1
+      let day = new Date(new Date().getTime() - 86400000).getDate()
+      let month = new Date(new Date().getTime() - 86400000).getMonth() + 1
       console.log(day)
       if (day < 10) {
         day = '0' + day