luobang 2 лет назад
Родитель
Сommit
aac98995f9

+ 1 - 1
build/utils.js

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

+ 103 - 2
src/views/statisticalReport/components/salesLogisticsStatistics/saleSteelReports.vue

@@ -105,6 +105,15 @@
             <i class="el-icon-document"></i>签收抵达</el-button
           >
         </el-form-item>
+        <el-form-item v-if="isShowOperate">
+          <el-button
+            type="primary"
+            @click="batchCarrier()"
+            v-if="!notRoutList.includes('batchCarrier')"
+          >
+            <i class="el-icon-share"></i>批量授权</el-button
+          >
+        </el-form-item>
         <el-form-item>
           <label
             class="el-form-item__label"
@@ -134,7 +143,14 @@
         id="salesLogisticsStat_saleSteelReports_table"
         individual-panel
         @resetTable="reset"
+        @selection-change="handleSelectionChange()"
       >
+        <el-table-column
+          type="selection"
+          width="30"
+          label="选择"
+          v-if="!notRoutList.includes('select')"
+        ></el-table-column>
         <el-table-column
           width="50"
           label="序号"
@@ -169,7 +185,6 @@
           column-key="consigneeName"
           :filters="filterConsigneeList"
           sortable
-          show-overflow-tooltip
         >
         </el-table-column>
         <el-table-column
@@ -1097,6 +1112,23 @@
     <el-dialog :visible.sync="dialogVisible" width="80%">
       <img width="100%" :src="dialogImageUrl" alt="" />
     </el-dialog>
+    <el-dialog :visible.sync="batchCarrierVisible" width="30%" center>
+      <div>批量授权承运商</div>
+      <el-form>
+        <el-form-item>
+          <el-autocomplete
+            style="width:250px"
+            v-model="batchCarrierName"
+            :fetch-suggestions="querySearchCarrier"
+            placeholder="请输入承运商"
+            @select="handleSelectCarrier"
+          >
+          </el-autocomplete>
+        </el-form-item>
+      </el-form>
+      <el-button @click="batchCarrierVisible = false">取 消</el-button>
+      <el-button type="primary" @click="batchCarrierMakeSure">确 定</el-button>
+    </el-dialog>
   </div>
 </template>
 
@@ -1113,6 +1145,8 @@ export default {
   },
   data() {
     return {
+      batchCarrierName: null,
+      batchCarrierVisible: false,
       batchAddressProvince: '',
       batchAddressDistrict: '',
       batchAddressTown: '',
@@ -1321,6 +1355,7 @@ export default {
       originalAddress: null,
       aaadrawer: false,
       downloadCapacityNo: null,
+      batchCarrierList: [],
       ops: {
         vuescroll: {},
         scrollPanel: {},
@@ -1355,7 +1390,9 @@ export default {
         'closeOrder',
         'materialNum',
         'closeEntry',
-        'capacityNo'
+        'capacityNo',
+        'batchCarrier',
+        'select'
       ]
     }
     //只要涉及提交即必须设计防抖,在初始化时绑定防抖函数
@@ -1437,6 +1474,70 @@ export default {
   },
   computed: {},
   methods: {
+    batchCarrierMakeSure() {
+      console.log(this.batchCarrierName)
+      let batchCarrierId = null
+      this.carrierList.forEach(item => {
+        if (item.carrierName == this.batchCarrierName) {
+          batchCarrierId = item.carrierId
+        }
+      })
+      this.batchCarrierList.forEach(e => {
+        e.carrierId = batchCarrierId
+      })
+      const loading = this.$loading({
+        lock: true,
+        text: '正在批量授权承运商',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      })
+      this.axios
+        .post('/api/v1/ams/dispatchToCarrier', this.batchCarrierList)
+        .then(res => {
+          if (res.data.code == '0') {
+            this.$message.success('授权承运商成功')
+            this.batchCarrierList = []
+            this.batchCarrierVisible = false
+            this.getSteelReport()
+            loading.close()
+          } else {
+            this.$message.error('授权失败,请联系管理员')
+            this.batchCarrierList = []
+            this.batchCarrierVisible = false
+            this.getSteelReport()
+            loading.close()
+          }
+        })
+        .catch(() => {
+          this.$message.error('授权失败,请联系管理员')
+          this.batchCarrierList = []
+          this.batchCarrierVisible = false
+          this.getSteelReport()
+          loading.close()
+        })
+    },
+    batchCarrier() {
+      if (this.batchCarrierList.length > 0) {
+        this.batchCarrierVisible = true
+      } else {
+        this.$message({
+          type: 'warning',
+          message: '请选择要批量授权的订单',
+          offset: '250',
+          duration: '2500'
+        })
+      }
+    },
+    handleSelectionChange() {
+      console.log(this.$refs.tableRef.selection, 'selection')
+      this.batchCarrierList = []
+      this.batchCarrierList = this.$refs.tableRef.selection.map(e => {
+        let map = {}
+        map.saleOrderMaterialId = e.saleOrderMaterialId
+        return map
+      })
+      console.log(this.batchCarrierList)
+    },
     receiveClick(src, title) {
       // this.dialogImageUrl = src
       downloadFile(src, `${this.downloadCapacityNo}${title}照片`, '.jpg')