liyg vor 2 Jahren
Ursprung
Commit
deb6387d30

+ 4 - 1
src/views/ADMINISTRATORS/components/ADMINISTRATORS1.vue

@@ -577,7 +577,10 @@ export default {
       }
       mapList.push(map)
       this.axios
-        .post('/api/v1/join/linkageDeleteTransportOrder', mapList)
+        .post(
+          '/api/v1/join/tmstruckweightresult/linkageDeleteTransportOrder',
+          mapList
+        )
         .then(res => {
           console.log(res)
         })

+ 43 - 6
src/views/sale/components/transportFreight/saleTruckSettlement/bmsTruckDetailsOrderNew.vue

@@ -107,8 +107,7 @@
         <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
-          >
+            ><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">
@@ -928,7 +927,7 @@ export default {
         startPointName: '',
         endPointName: ''
       },
-      someOnePriceValue:"",
+      someOnePriceValueList:[],
       saleSteelKey: false,
       tableRowIndex: '',
       isRowClick: 0,
@@ -978,6 +977,9 @@ export default {
       makeSurePlaceId: null,
       detailsAmount: null,
       mapValuenew:{},
+      //存放要执行的单价的位置Id,以及价格
+      amsPriceList:[],
+      placeIds:[],
       //用于赋予承运商的权限
       userId:'',
       ops: {
@@ -1102,20 +1104,48 @@ export default {
   computed: {},
   methods: {
     handleSelectionChange() {
+      this.amsPriceList=[]
       this.makeSurePriceOrderList = []
+      this.someOnePriceValueList=[]
       console.log(this.$refs.tableRef.selection, 'selection')
+      let mapvalue={
+        placeId:"",
+        priceValue:"",
+        orderId:""
+      }
+      let mapValue1={
+        priceValue:""
+      }
       this.makeSurePriceOrderList = this.$refs.tableRef.selection.map(e => {
         //运价判断
-        this.someOnePriceValue=e.priceValue
+        mapValue1.priceValue=e.priceValue
+        this.someOnePriceValueList.push(mapValue1)
+        mapvalue.placeId=e.placeId
+        mapvalue.priceValue=e.priceValue
+        mapvalue.orderId=e.orderId
+        this.amsPriceList.push(mapvalue)
         return e.orderId
       })
       console.log(this.makeSurePriceOrderList)
+      console.log(this.amsPriceList)
+      console.log(this.someOnePriceValueList)
     },
     makeSurePrice() {
       let map = {
-        orderList: this.makeSurePriceOrderList
+        orderList: this.makeSurePriceOrderList,
+        amsPriceList:this.amsPriceList
       }
-      if(this.priceValue==null){
+      console.log("确认执行价的顺序")
+      console.log(this.makeSurePriceOrderList)
+      console.log(map)
+      let flag=0;
+      this.someOnePriceValueList.forEach((e)=>{
+        if(e.priceValue==null){
+          console.log("进入了flag++")
+          flag++
+        }
+      })
+      if(flag!=0){
         this.$message({
               type: 'error',
               message: '没有单价',
@@ -1126,6 +1156,7 @@ export default {
       }
       console.log("确认执行价的顺序")
       console.log(this.makeSurePriceOrderList)
+      console.log(map)
       this.axios
         .post('/api/v1/bms/updateDetailsStatus', map)
         .then(res => {
@@ -1156,6 +1187,7 @@ export default {
             offset: '250'
           })
         })
+        this.amsPriceList=[]
     },
     openStatement(){
       console.log(this.$refs.tableRef1.selection, 'selection');
@@ -1275,6 +1307,7 @@ export default {
       console.log(this.userId)
       console.log(this.makeSurePriceOrderList)
       if (this.makeSurePriceOrderList.length == 0) {
+        this.amsPriceList=[]
         this.$message({
           type: 'success',
           message: '请先选择需要修改的单价',
@@ -1319,12 +1352,14 @@ export default {
             this.dialogFormVisible = false
           }
         })
+        this.amsPriceList=[]
     },
     //修改单价和收货地址
     makeSureAll(){
       console.log("获取数据")
       console.log(this.userId)
       if (this.makeSurePriceOrderList.length == 0) {
+        this.amsPriceList=[]
         this.$message({
           type: 'success',
           message: '请先选择需要修改的单价',
@@ -1361,6 +1396,7 @@ export default {
                   this.dialogFormVisible = false
                 }
               })
+              this.amsPriceList=[]
     },
     hanleScroll() {
       console.log('我滚动了')
@@ -2919,6 +2955,7 @@ export default {
     },
     //获取钢材统计报表
     getSteelReport() {
+      this.amsPriceList=[]
       const loading = this.$loading({
         lock: true,
         text: '正在获取数据,请稍候',

+ 210 - 23
src/views/statisticalReport/components/salesLogisticsStatistics/saleSteelReports.vue

@@ -87,15 +87,17 @@
           >
         </el-form-item>
         <el-form-item v-if="isShowOperate">
-          <el-button type="primary" @click="operation()"
-            >
+          <el-button type="primary" @click="operation()">
             <i class="el-icon-edit"></i>更改
             <span>
               <!-- || orgCode!='chengyunshang' -->
-              <el-badge :value="taskAllNum" :max="99" :hidden="taskAllNum < 1 "></el-badge>
+              <el-badge
+                :value="taskAllNum"
+                :max="99"
+                :hidden="taskAllNum < 1"
+              ></el-badge>
             </span>
-        </el-button
-          >
+          </el-button>
           <!-- <el-button type="primary" @click="batchoperation()"
             ><i class="el-icon-edit"></i>批量更改</el-button
           > -->
@@ -120,7 +122,7 @@
             <i class="el-icon-share"></i>批量授权</el-button
           >
         </el-form-item>
-        <el-form-item v-if="isShowOperate">
+        <!-- <el-form-item v-if="isShowOperate">
           <el-button
             type="primary"
             @click="getMakeDate()"
@@ -128,7 +130,7 @@
           >
             <i class="el-icon-finished"></i>获取制单日期</el-button
           >
-        </el-form-item>
+        </el-form-item> -->
         <el-form-item v-if="isShowOperate">
           <el-button
             type="primary"
@@ -139,6 +141,16 @@
             异常处理
           </el-button>
         </el-form-item>
+        <el-form-item v-if="isShowOperate">
+          <el-button
+            type="primary"
+            @click="mergeSplit()"
+            v-if="!notRoutList.includes('mergeSplit')"
+          >
+            <i class="el-icon-pie-chart"></i>
+            合并或拆分
+          </el-button>
+        </el-form-item>
         <el-form-item>
           <label
             class="el-form-item__label"
@@ -1379,6 +1391,19 @@
                   size="big"
                   >新增一拼</el-button
                 >
+                <el-button
+                  @click.native.prevent="
+                    linkageDeleteTransportOrder(scope.row, steelMap)
+                  "
+                  type="text"
+                  size="big"
+                  v-if="
+                    isShowOperate &&
+                      scope.row.netWeight != null &&
+                      scope.row.netWeight != ''
+                  "
+                  >删除计量实绩</el-button
+                >
               </template>
             </el-table-column>
           </el-table>
@@ -1642,8 +1667,8 @@ export default {
     }
   },
   created() {
-    this.orgCode=getCookie('orgCode');
-    this.userId=getCookie('userId');
+    this.orgCode = getCookie('orgCode')
+    this.userId = getCookie('userId')
     if (this.orgCodeList.includes(getCookie('orgCode'))) {
       this.isShowOperate = true
     }
@@ -1664,11 +1689,12 @@ export default {
         'capacityNo',
         'batchCarrier',
         'select',
-        'exceptionHandle'
+        'exceptionHandle',
+        'mergeSplit'
       ]
-      this.noticeInterval=setInterval(() => {
-        this.getinformation();
-      }, 1000*10);
+      this.noticeInterval = setInterval(() => {
+        this.getinformation()
+      }, 1000 * 10)
     }
     //只要涉及提交即必须设计防抖,在初始化时绑定防抖函数
     this.updateCapacityDebounce = this.debounce(() => {
@@ -1755,19 +1781,178 @@ export default {
   },
   computed: {},
   methods: {
+    //删除计量实绩
+    linkageDeleteTransportOrder(row, steelMap) {
+      console.log(row, 'row')
+      console.log(steelMap, 'steelMap')
+      if (row.netWeight != null && row.netWeight != '') {
+        //如果净重不为空
+        let arr = []
+        let map = {
+          orderNumber: row.orderNo,
+          good: row.materialName,
+          goodspa: `${row.materialSpecification}(${row.materialModel})`,
+          resultCrossWeightTime: row.grossWeightTime
+        }
+        arr.push(map)
+        this.axios
+          .post('/api/v1/uc/linkageDeleteTransportOrder', arr)
+          .then(res => {
+            this.$message({
+              message: '删除计量实绩成功',
+              type: 'success',
+              offset: '250',
+              duration: '2500'
+            })
+            this.exceptionHandleVisible = false
+            this.getSteelReport()
+          })
+      }
+    },
+    mergeSplit() {
+      //如果勾选了多条则执行合并操作,如果勾选了一条则执行拆分操作
+      if (this.$refs.tableRef.selection.length == 1) {
+        this.splitOrder()
+      } else if (this.$refs.tableRef.selection.length > 1) {
+        this.mergeOrder()
+      } else {
+        this.$message({
+          type: 'warning',
+          message: '请勾选/点击需要操作的行',
+          offset: '250',
+          duration: '2300'
+        })
+      }
+    },
+    splitOrder() {
+      this.$confirm(
+        `勾选了${this.$refs.tableRef.selection.length}条运单将执行拆分操作`,
+        '提醒',
+        {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          center: true
+        }
+      )
+        .then(() => {
+          let mapList = this.$refs.tableRef.selection.map(e => {
+            let map = {}
+            map.saleOrderMaterialId = e.saleOrderMaterialId
+            return map
+          })
+          let map = {
+            mapList: mapList
+          }
+          this.axios
+            .post('/api/v1/ams/splitOrder', map)
+            .then(res => {
+              if (res.data.code == '200') {
+                this.getSteelReport()
+                this.$message({
+                  type: 'success',
+                  message: '拆分成功',
+                  offset: '250',
+                  duration: '2500'
+                })
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: '拆分失败',
+                  offset: '250',
+                  duration: '2500'
+                })
+              }
+            })
+            .catch(() => {
+              this.$message({
+                type: 'error',
+                message: '拆分失败',
+                offset: '250',
+                duration: '2500'
+              })
+            })
+        })
+        .catch(() => {
+          this.$message({
+            type: 'info',
+            duration: '2500',
+            message: '操作取消',
+            offset: '250'
+          })
+        })
+    },
+    mergeOrder() {
+      this.$confirm(
+        `勾选了${this.$refs.tableRef.selection.length}条运单将执行合并操作`,
+        '提醒',
+        {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          center: true
+        }
+      )
+        .then(() => {
+          let mapList = this.$refs.tableRef.selection.map(e => {
+            let map = {}
+            map.saleOrderMaterialId = e.saleOrderMaterialId
+            map.orderId = e.orderId
+            map.saleOrderId = e.saleOrderId
+            return map
+          })
+          let map = {
+            mapList: mapList
+          }
+          this.axios
+            .post('/api/v1/ams/mergeOrder', map)
+            .then(res => {
+              if (res.data.code == '200') {
+                this.getSteelReport()
+                this.$message({
+                  type: 'success',
+                  message: '合并成功',
+                  offset: '250',
+                  duration: '2500'
+                })
+              } else {
+                this.$message({
+                  type: 'error',
+                  message: '合并失败',
+                  offset: '250',
+                  duration: '2500'
+                })
+              }
+            })
+            .catch(() => {
+              this.$message({
+                type: 'error',
+                message: '合并失败',
+                offset: '250',
+                duration: '2500'
+              })
+            })
+        })
+        .catch(() => {
+          this.$message({
+            type: 'info',
+            duration: '2500',
+            message: '操作取消',
+            offset: '250'
+          })
+        })
+    },
     //获取通知数量
     getinformation() {
       this.axios
         .post('/api/v1/ams/getNoticeAll', { userId: this.userId })
         .then(res => {
-          let taskAllNum = 0;
-          res.data.data.forEach((e)=>{
-            if(e.insertusername=='销售审核' && e.status==0){
-              taskAllNum++;
+          let taskAllNum = 0
+          res.data.data.forEach(e => {
+            if (e.insertusername == '销售审核' && e.status == 0) {
+              taskAllNum++
             }
-          });
-          this.taskAllNum=taskAllNum;
-          console.log("未接收数目:",this.taskAllNum);
+          })
+          this.taskAllNum = taskAllNum
+          console.log('未接收数目:', this.taskAllNum)
         })
     },
     readAll() {
@@ -1777,7 +1962,7 @@ export default {
           insertUserName: '销售审核'
         })
         .then(res => {
-           this.taskAllNum = 0
+          this.taskAllNum = 0
         })
     },
     deleteRow(index, rows) {
@@ -2636,8 +2821,8 @@ export default {
         row = this.steelMap
       }
       //所有销售审核通知标记为已读
-      if(this.taskAllNum>0){
-        this.readAll();
+      if (this.taskAllNum > 0) {
+        this.readAll()
       }
       this.axios
         .post(
@@ -3528,6 +3713,7 @@ export default {
           console.log(this.maxHeight, 'this.maxHeight')
           this.maxHeight = window.innerHeight - 130
           console.log(this.maxHeight, 'this.maxHeight')
+          this.steelMap = {}
           loading.close()
           console.log(this.visibleList)
         })
@@ -3617,6 +3803,7 @@ export default {
         )
         .then(res => {
           this.tableData = res.data.data
+          this.steelMap = {}
           this.totalHeight += this.itemHeight
           this.visibleList = []
           this.maxHeight = window.innerHeight - 130