luobang 2 years ago
parent
commit
37acabe12b

+ 1 - 1
build/utils.js

@@ -19,7 +19,7 @@ const devPathSrc = path.resolve(__dirname, '../../../src') // node_modules应用
 // >>>>>>> ecb211626d4aa9a51230114ced8866039cba10e1
 // let devModules = ['all']
 let devModules = ['all']
-//let devModules = ['index', 'statisticalReport', 'queue', 'sale','TMS','QMS','appoint']
+// let devModules = ['index', 'statisticalReport']
 // let devModules = ['index', 'ADMINISTRATORS']
 
 if (pathSrc.indexOf('node_modules') > -1) {

+ 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)
         })

+ 188 - 3
src/views/statisticalReport/components/salesLogisticsStatistics/saleSteelReports.vue

@@ -114,7 +114,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()"
@@ -122,7 +122,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"
@@ -133,6 +133,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"
@@ -1367,6 +1377,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>
@@ -1645,7 +1668,8 @@ export default {
         'capacityNo',
         'batchCarrier',
         'select',
-        'exceptionHandle'
+        'exceptionHandle',
+        'mergeSplit'
       ]
     }
     //只要涉及提交即必须设计防抖,在初始化时绑定防抖函数
@@ -1730,6 +1754,165 @@ 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'
+          })
+        })
+    },
     deleteRow(index, rows) {
       if (rows.length > 1) {
         rows.splice(index, 1)
@@ -3472,6 +3655,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)
         })
@@ -3561,6 +3745,7 @@ export default {
         )
         .then(res => {
           this.tableData = res.data.data
+          this.steelMap = {}
           this.totalHeight += this.itemHeight
           this.visibleList = []
           this.maxHeight = window.innerHeight - 130