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

+ 1 - 1
build/utils.js

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

+ 2 - 2
config/index.js

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

+ 209 - 55
src/views/statisticalReport/components/salesLogisticsStatistics/saleSteelReports.vue

@@ -82,13 +82,19 @@
           </el-button>
         </el-form-item>
         <el-form-item v-if="isShowOperate">
-          <el-button type="primary" @click="checkTrans()"
+          <el-button
+            type="primary"
+            @click="checkTrans()"
+            v-if="!notRoutList.includes('checkTrans')"
             ><i class="el-icon-truck"></i>轨迹</el-button
           >
           <el-button type="primary" @click="operation()"
             ><i class="el-icon-edit"></i>更改</el-button
           >
-          <el-button type="primary" @click="checkPoint()"
+          <el-button
+            type="primary"
+            @click="checkPoint()"
+            v-if="!notRoutList.includes('checkPoint')"
             ><i class="el-icon-map-location"></i>实时路径</el-button
           >
         </el-form-item>
@@ -197,9 +203,10 @@
         <el-table-column
           prop="materialSpe"
           label="物资规格"
+          column-key="materialSpe"
           align="center"
           sortable
-          show-overflow-tooltip
+          :filters="filtermaterialSpe"
           width="120px"
         >
         </el-table-column>
@@ -215,14 +222,16 @@
           label="收货地址"
           width="250px"
           sortable
-          show-overflow-tooltip
+          column-key="addressPlace"
+          :filters="filteraddressPlace"
         >
         </el-table-column>
         <el-table-column
           prop="orderStatus"
+          column-key="orderStatus"
           label="运单状态"
           align="center"
-          show-overflow-tooltip
+          :filters="filterorderStatus"
         >
         </el-table-column>
         <el-table-column
@@ -435,6 +444,7 @@
                 placeholder="请选择"
                 @change="onchangeProvince"
                 style="width:120px"
+                :disabled="notRoutList.includes('province')"
               >
                 <el-option
                   v-for="item in provinceList"
@@ -449,6 +459,7 @@
                 placeholder="请选择"
                 @change="onchangeCity"
                 style="width:120px"
+                :disabled="notRoutList.includes('city')"
               >
                 <el-option
                   v-for="item in cityList"
@@ -463,6 +474,7 @@
                 placeholder="请选择"
                 @change="onchangeCounty"
                 style="width:120px"
+                :disabled="notRoutList.includes('country')"
               >
                 <el-option
                   v-for="item in countyList"
@@ -479,25 +491,36 @@
                 :trigger-on-focus="false"
                 @select="handleSelect1"
                 style="width:250px"
+                :disabled="notRoutList.includes('place')"
               >
               </el-autocomplete>
-              <el-button type="success" circle @click="addAddressClick"
+              <el-button
+                type="success"
+                circle
+                @click="addAddressClick"
+                v-if="!notRoutList.includes('addressClick')"
                 >提交</el-button
               >
             </div>
             <div
               class="steelMapClass23"
               v-if="
-                steelMap.carStatus == 4 ||
+                (steelMap.carStatus == 4 ||
                   steelMap.carStatus == 5 ||
-                  steelMap.carStatus == null
+                  steelMap.carStatus == null) &&
+                  !notRoutList.includes('closeOrder')
               "
             >
               <el-button type="danger" round @click="deleteEasEntryId"
                 >关闭运单</el-button
               >
             </div>
-            <div class="steelMapClass23" v-if="steelMap.carStatus == 7">
+            <div
+              class="steelMapClass23"
+              v-if="
+                steelMap.carStatus == 7 && !notRoutList.includes('closeOrder')
+              "
+            >
               <el-button type="danger" round @click="reverseCloseOrder"
                 >反关闭运单</el-button
               >
@@ -509,8 +532,13 @@
               <el-input
                 v-model="steelMap.consigneeTel"
                 style="width:150px"
+                :disabled="notRoutList.includes('consigeeTel')"
               ></el-input>
-              <el-button type="success" circle @click="updateconsigneeTel"
+              <el-button
+                type="success"
+                circle
+                @click="updateconsigneeTel"
+                v-if="!notRoutList.includes('consigeeTel')"
                 >提交</el-button
               >
             </div>
@@ -522,9 +550,14 @@
                 :fetch-suggestions="querySearchCarrier"
                 placeholder="请输入承运商"
                 @select="handleSelectCarrier"
+                :disabled="notRoutList.includes('carrierName')"
               >
               </el-autocomplete>
-              <el-button type="success" circle @click="updateTruckCarrier"
+              <el-button
+                type="success"
+                circle
+                @click="updateTruckCarrierDebounce"
+                v-if="!notRoutList.includes('carrierName')"
                 >提交</el-button
               >
             </div>
@@ -536,8 +569,21 @@
                 :fetch-suggestions="querySearch"
                 placeholder="请输入车牌号"
                 @select="handleSelect()"
+                :disabled="
+                  notRoutList.includes('capacityNo') &&
+                    steelMap.capacityId != null
+                "
               ></el-autocomplete>
-              <el-button type="success" circle @click="updateCapacity"
+              <el-button
+                type="success"
+                circle
+                @click="updateCapacityDebounce"
+                v-if="
+                  !(
+                    notRoutList.includes('capacityNo') &&
+                    steelMap.capacityId != null
+                  )
+                "
                 >提交</el-button
               >
             </div>
@@ -569,38 +615,17 @@
               <span>状态更新时间:</span>
               <span>{{ steelMap.orderStatusTime }}</span>
             </div>
-            <div class="steelMapClass44">
-              <el-button type="success" circle @click="continue1"
-                >继续装</el-button
-              >
-            </div>
           </div>
           <div class="steelMapClass5">
             <div class="steelMapClass52" v-if="steelMap.arrivalAddress != null">
               <span>抵达地址:</span>
               <span>{{ steelMap.arrivalAddress }}</span>
-              <span class="steelMapClass521"
-                ><el-button
-                  type="success"
-                  icon="el-icon-money"
-                  circle
-                  @click="toPhotoClick(steelMap.orderNo, 0)"
-                ></el-button
-              ></span>
             </div>
           </div>
           <div class="steelMapClass6">
             <div class="steelMapClass62" v-if="steelMap.receiptAddress != null">
               <span>签收地址:</span>
               <span>{{ steelMap.receiptAddress }}</span>
-              <span class="steelMapClass621"
-                ><el-button
-                  type="success"
-                  icon="el-icon-money"
-                  circle
-                  @click="receipctPhotoClick(steelMap.orderNo, 0)"
-                ></el-button
-              ></span>
             </div>
           </div>
         </div>
@@ -635,21 +660,27 @@
                   type="primary"
                   @click="scope.row.materialNum--"
                   style="height:40px"
+                  v-if="!notRoutList.includes('materialNum')"
                 >
                   -
                 </button>
                 <input
                   v-model="scope.row.materialNum"
                   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--"
                   style="height:40px"
+                  v-if="!notRoutList.includes('materialNum')"
                 >
-                  +
+                  -
                 </button>
-                <el-button type="primary" @click="updateBillOrder(scope.row)"
+                <el-button
+                  type="primary"
+                  @click="updateBillOrder(scope.row)"
+                  v-if="!notRoutList.includes('materialNum')"
                   >提交</el-button
                 >
               </template>
@@ -688,14 +719,20 @@
                   type="text"
                   size="small"
                   @click="closeEasEntryId(scope.row)"
-                  v-if="scope.row.deletedStatus == null"
+                  v-if="
+                    scope.row.deletedStatus == null &&
+                      !notRoutList.includes('closeEntry')
+                  "
                   >关闭分录</el-button
                 >
                 <el-button
                   type="text"
                   size="small"
                   @click="adverseCloseSaleMaterial(scope.row)"
-                  v-if="scope.row.deletedStatus != null"
+                  v-if="
+                    scope.row.deletedStatus != null &&
+                      !notRoutList.includes('closeEntry')
+                  "
                   >反关闭分录</el-button
                 >
               </template>
@@ -846,6 +883,7 @@ export default {
       pos: 0,
       //需要合并列的名称
       mergeList: [
+        '选择',
         '序号',
         '整车操作',
         '销售订单状态',
@@ -939,7 +977,8 @@ export default {
         'dagangadmin',
         'shichangxinxibu',
         'xiaoshouyewuyuan',
-        'zidonghuabu'
+        'zidonghuabu',
+        'chengyunshang'
       ],
       isShowOperate: false,
       filterConsigneeList: [],
@@ -947,13 +986,42 @@ export default {
       filterCapacityList: [],
       filtermaterialNameList: [],
       filterSaleAreaList: [],
-      filterMap: {}
+      filterorderStatus: [],
+      filteraddressPlace: [],
+      filtermaterialSpe: [],
+      filterMap: {},
+      //权限控制
+      notRoutList: []
     }
   },
   created() {
     if (this.orgCodeList.includes(getCookie('orgCode'))) {
       this.isShowOperate = true
     }
+    if (getCookie('orgCode') == 'chengyunshang') {
+      this.notRoutList = [
+        'checkPoint',
+        'checkTrans',
+        'carrierName',
+        'consigeeTel',
+        'province',
+        'city',
+        'country',
+        'place',
+        'addressClick',
+        'closeOrder',
+        'materialNum',
+        'closeEntry',
+        'capacityNo'
+      ]
+    }
+    //只要涉及提交即必须设计防抖,在初始化时绑定防抖函数
+    this.updateCapacityDebounce = this.debounce(() => {
+      this.updateCapacity()
+    }, 3000)
+    this.updateTruckCarrierDebounce = this.debounce(() => {
+      this.updateTruckCarrier()
+    }, 3000)
     this.getSteelReport()
   },
   watch: {
@@ -980,23 +1048,24 @@ export default {
   },
   computed: {},
   methods: {
-    //继续装
-    continue1(row) {
-      let map = {
-        orderId: this.steelMap.orderId
-      }
-      console.log(map)
-      this.axios.post('/api/v1/oms/updateContinueStaus', map).then(res => {
-        if (res.data.code == '200') {
-          this.$message.success('修改成功')
-        } else {
-          this.$message.error('修改失败')
+    //防抖函数--防止用户重复点击
+    debounce(func, delay) {
+      let timer = null
+      return function(...args) {
+        if (timer !== null) {
+          clearTimeout(timer)
         }
-      })
-      this.getSteelReport()
+        timer = setTimeout(function() {
+          func.apply(this, args)
+        }, delay)
+      }
     },
+    // handleSelectionChange(selection) {
+    //   console.log(selection)
+    // },
     //筛选
     filterChange(obj) {
+      //承运商筛选,后续有待优化
       if (typeof obj.carrierList != 'undefined' && obj.carrierList.length > 0) {
         this.filterMap.carrierList = obj.carrierList
       }
@@ -1006,6 +1075,7 @@ export default {
       ) {
         delete this.filterMap.carrierList
       }
+      //物资名称筛选,后续有待优化
       if (
         typeof obj.materialNameList != 'undefined' &&
         obj.materialNameList.length > 0
@@ -1018,12 +1088,14 @@ export default {
       ) {
         delete this.filterMap.materialNameList
       }
+      //车牌号筛选,后续有待优化
       if (typeof obj.capacityNo != 'undefined' && obj.capacityNo.length > 0) {
         this.filterMap.capacityList = obj.capacityNo
       }
       if (typeof obj.capacityNo != 'undefined' && obj.capacityNo.length == 0) {
         delete this.filterMap.capacityList
       }
+      //客户筛选,后续有待优化
       if (
         typeof obj.consigneeName != 'undefined' &&
         obj.consigneeName.length > 0
@@ -1036,6 +1108,7 @@ export default {
       ) {
         delete this.filterMap.consigneeNameList
       }
+      //销售片区筛选,后续有待优化
       if (
         typeof obj.saleAreaList != 'undefined' &&
         obj.saleAreaList.length > 0
@@ -1048,20 +1121,56 @@ export default {
       ) {
         delete this.filterMap.saleAreaList
       }
+      //物资规格筛选
+      if (typeof obj.materialSpe != 'undefined' && obj.materialSpe.length > 0) {
+        this.filterMap.materialSpeList = obj.materialSpe
+      }
+      if (
+        typeof obj.materialSpe != 'undefined' &&
+        obj.materialSpe.length == 0
+      ) {
+        delete this.filterMap.materialSpeList
+      }
+      //收货地址筛选
+      if (
+        typeof obj.addressPlace != 'undefined' &&
+        obj.addressPlace.length > 0
+      ) {
+        this.filterMap.addressPlaceList = obj.addressPlace
+      }
+      if (
+        typeof obj.addressPlace != 'undefined' &&
+        obj.addressPlace.length == 0
+      ) {
+        delete this.filterMap.addressPlaceList
+      }
+      if (typeof obj.orderStatus != 'undefined' && obj.orderStatus.length > 0) {
+        this.filterMap.orderStatusList = obj.orderStatus
+      }
+      if (
+        typeof obj.orderStatus != 'undefined' &&
+        obj.orderStatus.length == 0
+      ) {
+        delete this.filterMap.orderStatusList
+      }
       // if (obj)
       this.onclick(this.filterMap)
     },
     //控制筛选数组变化
     filterListChange() {
+      //客户筛选数组
       let consigneeNameList = this.tableData.map(e => {
         return e.consigneeName
       })
+      //承运商筛选数组
       let carrierNameList = this.tableData.map(e => {
         return e.carrierName
       })
+      //车牌号筛选数组
       let capacityList = this.tableData.map(e => {
         return e.capacityNo
       })
+      //物资筛选数组
       let materialNameList = this.tableData
         .map(e => {
           return e.materialName
@@ -1069,6 +1178,7 @@ export default {
         .filter(e => {
           return e != null
         })
+      //销售片区筛选数组
       let saleAreaList = this.tableData
         .map(e => {
           return e.areaName
@@ -1076,11 +1186,35 @@ export default {
         .filter(e => {
           return e != null
         })
+      let addressPlaceList = this.tableData
+        .map(e => {
+          return e.addressPlace
+        })
+        .filter(e => {
+          return e != null
+        })
+      let orderStatusList = this.tableData
+        .map(e => {
+          return e.orderStatus
+        })
+        .filter(e => {
+          return e != null
+        })
+      let materialSpeList = this.tableData
+        .map(e => {
+          return e.materialSpe
+        })
+        .filter(e => {
+          return e != null
+        })
       this.filterConsigneeList = []
       this.filterCarrierList = []
       this.filterCapacityList = []
       this.filtermaterialNameList = []
       this.filterSaleAreaList = []
+      this.filterorderStatus = []
+      this.filteraddressPlace = []
+      this.filtermaterialSpe = []
       Array.from(new Set(consigneeNameList)).forEach(e => {
         let map = {}
         map.text = e
@@ -1111,6 +1245,24 @@ export default {
         map.value = e
         this.filterSaleAreaList.push(map)
       })
+      Array.from(new Set(addressPlaceList)).forEach(e => {
+        let map = {}
+        map.text = e
+        map.value = e
+        this.filteraddressPlace.push(map)
+      })
+      Array.from(new Set(orderStatusList)).forEach(e => {
+        let map = {}
+        map.text = e
+        map.value = e
+        this.filterorderStatus.push(map)
+      })
+      Array.from(new Set(materialSpeList)).forEach(e => {
+        let map = {}
+        map.text = e
+        map.value = e
+        this.filtermaterialSpe.push(map)
+      })
     },
     cellStyle({ row, column, rowIndex, columnIndex }) {
       if (
@@ -1389,7 +1541,8 @@ export default {
       console.log(queryString)
       if (
         (queryString != null && queryString != '' && queryString.length > 3) ||
-        queryString == '取消'
+        queryString == '取消' ||
+        queryString == '待定'
       ) {
         this.axios
           .post('/api/v1/uc/getCapacityByLike?index=' + queryString)
@@ -1428,6 +1581,7 @@ export default {
       })
     },
     updateCapacity() {
+      console.log('我只想测')
       this.steelMap.capacityId = this.steelMap.newsCapacityId
       if (this.steelMap.newsCapacityId == null) {
         this.$message.warning('请先注册车牌号或者选中弹出后再提交!')
@@ -1435,7 +1589,8 @@ export default {
       }
       if (
         !isVehicleNumber(this.steelMap.capacityNo) &&
-        this.steelMap.capacityNo != '取消'
+        (this.steelMap.capacityNo != '取消' ||
+          this.steelMap.capacityNo != '待定')
       ) {
         this.$message.error('请输入正确格式的车牌号!')
         return
@@ -1657,7 +1812,6 @@ export default {
     },
     //修改承运商授权
     updateTruckCarrier() {
-      console.log(this.steelMap)
       if (this.steelMap.newCarrierId == null) {
         this.$message.warning('请注册承运商或者选中弹出层之后再提交!')
         this.getSteelReport()

+ 22 - 34
src/views/statisticalReport/components/salesLogisticsStatistics/unloadingSteelReports.vue

@@ -308,21 +308,11 @@
 </template>
 
 <script>
-import { sjTime, isVehicleNumber } from '@/utils/sharedJsFile'
+import { sjTime } from '@/utils/sharedJsFile'
 import { getCookie } from '@/utils/util.js'
 export default {
   data() {
     return {
-      carNumber: '',
-      //弹出框
-      centerDialogVisible: false,
-      //根据车序号查询的值
-      steelMap: {},
-      //钢材子表数据
-      steelList: [],
-      drawer: false,
-      isShow3: false,
-      isShow4: false,
       input: null,
       screen: '',
       screen1: '',
@@ -358,15 +348,11 @@ export default {
           lable: '车牌号'
         }
       ],
-      startTime: null,
-      endTime: null,
       //合计净重
       totalNumber: 0,
       //合计车数
       totalCapacity: 0,
       tableTitle: '销售统计报表',
-      capacityList: [],
-      carrierList: [],
       tableData: [],
       //筛选条件1(客户)
       filters1: [],
@@ -404,20 +390,7 @@ export default {
       ],
       //钢材多拼车辆线路ID
       //索引从1-10为1-10拼路线ID
-      lineSpelling: [
-        0,
-        110001,
-        110002,
-        110003,
-        110004,
-        110005,
-        110006,
-        110007,
-        110008,
-        110009,
-        110010
-      ],
-      tableTitle: '销售钢材统计报表',
+      tableTitle: '销售钢材未装货统计报表',
       //所有省
       provinceList: [],
       //选中的省
@@ -452,7 +425,6 @@ export default {
         'xiaoshouyewuyuan',
         'zidonghuabu'
       ],
-      isShowOperate: false,
       filterConsigneeList: [],
       filterCarrierList: [],
       filterCapacityList: [],
@@ -486,7 +458,9 @@ export default {
         'steelMeters',
         'isPoundSale'
       ],
-      saleDateOfReceipt: null
+      saleDateOfReceipt: null,
+      remarkDateNew: null,
+      remarkDateOld: null
     }
   },
   created() {
@@ -503,6 +477,8 @@ export default {
     } else {
       this.saleDateOfReceipt = loadTime1
     }
+    this.remarkDateNew = this.getRemarkDate()
+    this.remarkDateOld = this.getRemarkDateOld()
     this.getSteelReport()
   },
   watch: {
@@ -574,6 +550,9 @@ export default {
       }
     },
     addSaleOrder() {
+      //
+      let remark = '10.20钢材成都组'
+      console.log(remark.split(this.getRemarkDateOld)[0])
       const loading = this.$loading({
         lock: true,
         text: '正在快马加鞭为您生成上传销售订单,请稍候',
@@ -583,14 +562,14 @@ export default {
       let closeEntryList = []
       this.$refs.tableRef.selection.forEach(e => {
         let map = {}
-        e.saleRemark = `${this.getRemarkDate()}${e.areaName},直发${
-          e.addressDistrict
-        }`
+        e.saleRemark = this.remarkDateNew + e.saleRemark.split[1]
         map.saleMaterialId = e.saleMaterialId
         map.closeEntryId = e.closeEntryId
         map.number = e.saleOrderNo
         closeEntryList.push(map)
       })
+      console.log(this.$refs.tableRef.selection)
+      return
       const map1 = this.$refs.tableRef.selection.reduce((result, item) => {
         result[item.saleOrderNo] = result[item.saleOrderNo] || []
         result[item.saleOrderNo].push(item)
@@ -673,6 +652,15 @@ export default {
       }
       return `${month}.${day}`
     },
+    getRemarkDateOld() {
+      let day = new Date().getDate()
+      let month = new Date().getMonth() + 1
+      console.log(day)
+      if (day < 10) {
+        day = '0' + day
+      }
+      return `${month}.${day - 1}`
+    },
     //继续装
     //筛选
     filterChange(obj) {