caojunjie 3 anni fa
parent
commit
17606e40ac

+ 37 - 10
src/views/businessManagement/purchaseOrder/index.vue

@@ -10,27 +10,21 @@
         <template slot="menuLeft" slot-scope="{size}">
           <el-button type="success" :size="size" icon="el-icon-copy-document" @click="copyOrder" :disabled="single">复制单据
           </el-button>
-          <el-button type="info" :size="size" icon="el-icon-printer">报表打印</el-button>
+          <el-button type="info" :size="size" icon="el-icon-printer" @click="outExport">导出</el-button>
           <el-button type="warning" :size="size" icon="el-icon-thumb" :disabled="multiple" @click="applyPayment">申请货款
           </el-button>
         </template>
         <template slot-scope="scope" slot="orgOrderNo">
-          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row, scope.index)">{{
-              scope.row.orgOrderNo
-          }}</span>
+          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row, scope.index)">{{ scope.row.orgOrderNo }}</span>
         </template>
         <template slot="corpIdSearch">
           <crop-select v-model="search.corpId" corpType="GYS"></crop-select>
         </template>
         <template slot-scope="scope" slot="corpId">
-          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row, scope.index)">{{
-              scope.row.strCorpName
-          }}</span>
+          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row, scope.index)">{{ scope.row.strCorpName }}</span>
         </template>
         <template slot-scope="scope" slot="orderNo">
-          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row, scope.index)">{{
-              scope.row.orderNo
-          }}</span>
+          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row, scope.index)">{{ scope.row.orderNo }}</span>
         </template>
         <template slot-scope="scope" slot="createUser">
           {{ scope.row.createUserName }}
@@ -83,6 +77,7 @@ import financialAccount from "../../../components/finance/financialAccount";
 import { gainUser } from "@/api/basicData/customerInquiry";
 import { customerList as feeList } from "@/api/basicData/basicFeesDesc";
 import { getCurrentDate } from "@/util/date";
+import {getToken} from "@/util/auth";
 export default {
   name: "customerInformation",
   props: {
@@ -323,6 +318,38 @@ export default {
       this.isShow = false;
       this.$store.commit("DOMCG_IN_DETAIL");
     },
+    //导出
+    outExport() {
+      this.$confirm('是否导出数据明细?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        let queryParams = this.search
+        if (queryParams.requiredArrivalDate) {
+          this.$set(queryParams, 'requiredArrivalStartDate', queryParams.requiredArrivalDate[0] + " " + "00:00:00")
+          this.$set(queryParams, 'requiredArrivalEndDate', queryParams.requiredArrivalDate[1] + " " + "23:59:59")
+          this.$delete(queryParams, 'requiredArrivalDate')
+        }
+        if (queryParams.createTime) {
+          queryParams.createStartTime = queryParams.createTime[0] + " " + "00:00:00"
+          queryParams.createEndTime = queryParams.createTime[1] + " " + "23:59:59"
+          this.$delete(queryParams, 'createTime')
+        }
+        const routeData = this.$router.resolve({
+          path: '/api/trade-purchase/purchase-order/selOrderExport',      //跳转目标窗口的地址
+          query: {
+            ...queryParams    //括号内是要传递给新窗口的参数
+          }
+        })
+        window.open(routeData.href.slice(1,routeData.href.length-1)+'&'+`${this.website.tokenHeader}=${getToken()}`);
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消' //
+        });
+      })
+    },
     //点击新增时触发
     beforeClose(done) {
       this.parentId = "";

+ 54 - 44
src/views/landTransportation/bulkCargo/detailPage.vue

@@ -42,10 +42,7 @@
               size="small"
               v-if="goodsForm.status > 0"
               :disabled="
-            (roleName.indexOf('平台') !== -1
-            ||roleName.indexOf('经理') !== -1
-            ||roleName.indexOf('部门经理') !== -1
-            ||roleName.indexOf('总经理') !== -1) && !(roleName.indexOf('admin') !== -1)"
+            !(roleName.indexOf('平台') !== -1||roleName.indexOf('经理') !== -1||roleName.indexOf('部门经理') !== -1||roleName.indexOf('总经理') !== -1) && !(roleName.indexOf('admin') !== -1)"
               @click="confirmChange"
           >变更
           </el-button>
@@ -59,44 +56,43 @@
           </el-button>
           <el-button
               type="success"
-              v-if="goodsForm.status > 0 && goodsForm.status !== 5"
+              v-if="goodsForm.status > 0 && goodsForm.status !== 5 && roleName.indexOf('客户') === -1"
               size="small"
               :loading="type"
               v-show="
-              (roleName.indexOf('客户') !== -1 && goodsForm.status < 2)
-            || (roleName.indexOf('车队') !== -1 && goodsForm.status === 2)
-            || (roleName.indexOf('司机') !== -1 && (goodsForm.status === 3||goodsForm.status === 6||goodsForm.status === 4))
-            || (roleName.indexOf('平台') !== -1
-            ||roleName.indexOf('经理') !== -1
-            ||roleName.indexOf('部门经理') !== -1
-            ||roleName.indexOf('总经理') !== -1)"
+              (roleName.indexOf('平台') !== -1 && goodsForm.status === 1)
+              || (roleName.indexOf('车队') !== -1 && goodsForm.status === 2)
+              || (roleName.indexOf('司机') !== -1 && goodsForm.status === 3)
+              || (roleName.indexOf('司机') !== -1 && goodsForm.status === 4)
+              || (roleName.indexOf('司机') !== -1 && goodsForm.status === 6)"
               @click="modifyState"
           >
             {{
-              goodsForm.status === 1 ? '调度' : goodsForm.status === 2 ? '派车' : goodsForm.status === 3 ? '受理' : goodsForm.status === 4 ? '确认完工' : goodsForm.status === 6 ? '确认到厂' : goodsForm.status === 7 ? '提箱' : '未知状态:' + goodsForm.status
+              goodsForm.status === 1 ? '调度' : goodsForm.status === 2 ? '派车' : goodsForm.status === 3 ? '受理' : goodsForm.status === 4 ? '确认完工' : goodsForm.status === 6 ? '确认到厂' :  '未知状态:' + goodsForm.status
             }}
           </el-button>
           <el-button
               type="warning"
-              v-if="goodsForm.status === 2"
+              v-if="goodsForm.status === 2 && roleName.indexOf('平台') !== -1 "
               size="small"
               @click="cancelScheduling(false)"
           >取消调度
           </el-button>
           <el-button
               type="warning"
-              v-if="goodsForm.status === 3"
+              v-if="goodsForm.status === 3 && roleName.indexOf('车队') !== -1"
               size="small"
               @click="cancelScheduling(true)"
           >取消派车
           </el-button>
           <el-button
               type="success"
-              v-if="goodsForm.status === 1"
+              v-if="goodsForm.status === 1 && roleName.indexOf('客户') !== -1"
               size="small"
               @click="submit(false)"
           >取消提交
           </el-button>
+<!--          !(roleName.indexOf('客户') !== -1 || roleName.indexOf('平台') !== -1 || roleName.indexOf('车队') !== -1)-->
           <el-button
               type="primary"
               :disabled="goodsForm.status === 5"
@@ -434,6 +430,7 @@
                     :disabled="goodsForm.status !== 0"
                     style="width: 100%;"
                     filterable
+                    clearable
                     v-model="scope.row.corpId"
                     size="small" placeholder="请选择"
                     @change="withAddress({},scope,true)">
@@ -653,7 +650,7 @@
                 @clear="clear(scope.row)"
                 @getCorpData="(row)=>{withAddressTwo(row,scope)}">
               <template slot="slot">
-                <el-select @change="withAddressTwo({},scope,true)" :disabled="goodsForm.status !== 0"
+                <el-select @change="withAddressTwo({},scope,true)" :disabled="goodsForm.status !== 0" clearable
                            style="width: 100%;" filterable v-model="scope.row.corpId" size="small" placeholder="请选择">
                   <el-option
                       v-for="item in corpList"
@@ -832,7 +829,7 @@
     </basic-container>
     </span>
     <containerTitle title="杂费明细"
-                    v-if="roleName.indexOf('平台') !== -1 || this.roleName.indexOf('客户') !== -1"></containerTitle>
+                    v-if="roleName.indexOf('平台') !== -1 || roleName.indexOf('客户') !== -1"></containerTitle>
     <basic-container v-if="roleName.indexOf('平台') !== -1 || roleName.indexOf('客户') !== -1">
       <el-tabs v-model="activeIndex" @tab-click="handleSelect">
         <el-tab-pane label="应收" name="1"></el-tab-pane>
@@ -1022,7 +1019,7 @@ import {gaude, location} from "@/api/gaude";
 import trackPlayback from "@/components/trackPlayback"
 import {fleetList, telephone} from "@/api/landTransportation";
 import {getDictionary} from "@/api/system/dictbiz";
-import {allCropList} from "@/api/basicData/customerInformation";
+import {allCropList, customerList} from "@/api/basicData/customerInformation";
 // goodsOptionFormTwo
 export default {
   comments: {
@@ -1042,7 +1039,6 @@ export default {
         this.collectionOption.disabled = this.paymentOption.disabled = this.goodsForm.status === 5
         if (this.roleName.indexOf('客户') !== -1 || this.roleName.indexOf('司机') !== -1){
           this.goodsOptionFormTwo.disabled = true
-          this.findObject(this.goodsOptionFormTwo.column, "freightPay").display = false
         } else {
           if (this.goodsForm.status === 0) {
             this.goodsOptionFormTwo.disabled = true
@@ -1053,7 +1049,6 @@ export default {
               this.findObject(this.goodsOptionFormTwo.column, "plateNo").disabled = false
               this.findObject(this.goodsOptionFormTwo.column, "driverId").disabled = false
               this.findObject(this.goodsOptionFormTwo.column, "driverTel").disabled = false
-              this.findObject(this.goodsOptionFormTwo.column, "fleetVolum").disabled = false
               this.findObject(this.goodsOptionFormTwo.column, "freightPay").disabled = false
             }
           }else if (this.goodsForm.status === 2){
@@ -1063,16 +1058,20 @@ export default {
               this.findObject(this.goodsOptionFormTwo.column, "plateNo").disabled = false
               this.findObject(this.goodsOptionFormTwo.column, "driverId").disabled = false
               this.findObject(this.goodsOptionFormTwo.column, "driverTel").disabled = false
-              this.findObject(this.goodsOptionFormTwo.column, "fleetVolum").disabled = false
+              this.findObject(this.goodsOptionFormTwo.column, "freightPay").disabled = true
+            }else {
+              this.findObject(this.goodsOptionFormTwo.column, "fleetId").disabled = true
+              this.findObject(this.goodsOptionFormTwo.column, "plateNo").disabled = true
+              this.findObject(this.goodsOptionFormTwo.column, "driverId").disabled = true
+              this.findObject(this.goodsOptionFormTwo.column, "driverTel").disabled = true
               this.findObject(this.goodsOptionFormTwo.column, "freightPay").disabled = true
             }
           }else{
-            this.findObject(this.goodsOptionFormTwo.column, "fleetId").disabled = false
-            this.findObject(this.goodsOptionFormTwo.column, "plateNo").disabled = false
-            this.findObject(this.goodsOptionFormTwo.column, "driverId").disabled = false
-            this.findObject(this.goodsOptionFormTwo.column, "driverTel").disabled = false
-            this.findObject(this.goodsOptionFormTwo.column, "fleetVolum").disabled = false
-            this.findObject(this.goodsOptionFormTwo.column, "freightPay").disabled = false
+            this.findObject(this.goodsOptionFormTwo.column, "fleetId").disabled = true
+            this.findObject(this.goodsOptionFormTwo.column, "plateNo").disabled = true
+            this.findObject(this.goodsOptionFormTwo.column, "driverId").disabled = true
+            this.findObject(this.goodsOptionFormTwo.column, "driverTel").disabled = true
+            this.findObject(this.goodsOptionFormTwo.column, "freightPay").disabled = true
           }
         }
       }
@@ -1498,15 +1497,6 @@ export default {
           props: {
             label: "dictValue",
             value: "dictValue"
-          },
-          change: (data) => {
-            if (data.value === '集装箱') {
-              this.findObject(this.goodsOptionForm.column, "dispatchNumber").rules[0].required = true
-            } else if (!data.value) {
-              this.findObject(this.goodsOptionForm.column, "dispatchNumber").rules[0].required = true
-            } else {
-              this.findObject(this.goodsOptionForm.column, "dispatchNumber").rules[0].required = false
-            }
           }
         }, {
           label: '平台号',
@@ -1547,6 +1537,7 @@ export default {
         }, {
           label: '物流运输',
           prop: 'dispatchDept',
+          span: 6,
           dicUrl: "/api/blade-system/dept/top-list?deptCategory=1",
           cascader: ['dispatcher'],
           type: "select",
@@ -1562,6 +1553,7 @@ export default {
         }, {
           label: '运输调度',
           prop: 'dispatcher',
+          span: 6,
           type: "select",
           dicUrl: "/api/blade-user/userList?deptPid={{key}}",
           props: {
@@ -1572,9 +1564,14 @@ export default {
           label: '委托日期',
           prop: 'bsDate',
           type: "datetime",
+          span: 6,
           format: 'yyyy-MM-dd HH:mm',
           valueFormat: 'yyyy-MM-dd HH:mm:ss',
         }, {
+          label: '车体积',
+          span: 6,
+          prop: 'fleetVolum'
+        }, {
           label: '合同号',
           span: 6,
           prop: 'contractNo'
@@ -1691,12 +1688,11 @@ export default {
           label: '车队',
           prop: 'fleetId',
           type: 'select',
+          dicData:[],
           cascader: ['plateNo'],
-          dicUrl: "/api/blade-client/corpsdesc/list?size=500&current=1&&corpType=CD",
           props: {
             label: "cname",
-            value: "id",
-            res: "data.records"
+            value: "id"
           }
         }, {
           label: '车号',
@@ -1725,9 +1721,6 @@ export default {
           label: '电话',
           prop: 'driverTel'
         }, {
-          label: '车体积',
-          prop: 'fleetVolum'
-        }, {
           label: '应付运费',
           prop: 'freightPay'
         }]
@@ -2065,6 +2058,22 @@ export default {
     };
   },
   async created() {
+    if (this.roleName.indexOf('客户') !== -1){
+      this.findObject(this.goodsOptionFormTwo.column, "freightPay").display = false
+    }
+    if (this.roleName.indexOf('车队') !== -1){
+      console.log(this.goodsOptionFormTwo.column)
+      this.findObject(this.goodsOptionForm.column, "freightCollect").display = false
+    }
+    if (this.roleName.indexOf('司机') !== -1){
+      this.findObject(this.goodsOptionFormTwo.column, "freightPay").display = false
+      this.findObject(this.goodsOptionForm.column, "freightCollect").display = false
+    }
+    customerList({
+      size:500,current:1,corpType:'CD'
+    }).then(res=>{
+      this.findObject(this.goodsOptionFormTwo.column, "fleetId").dicData = res.data.data.records
+    })
     allCropList({
       corpType: 'GC'
     }).then(res => {
@@ -2219,7 +2228,7 @@ export default {
       getCorp().then(res => {
         this.goodsForm = {
           corpId: res.data.data ? res.data.data.id : '',
-          businessType: "出口",
+          businessType: "内贸",
           shippingMode: "散货",
           status: 0,
           salesman: JSON.parse(localStorage.getItem("saber-userInfo")).content.user_id,
@@ -2277,6 +2286,7 @@ export default {
       for (let item of this.salesmanList) {
         if (item.id == val) {
           this.goodsForm.salesmanDept = item.deptId.split(',')[0]
+          this.goodsForm.tel = item.phone
         }
       }
     },

+ 197 - 6
src/views/landTransportation/bulkCargo/index.vue

@@ -171,6 +171,10 @@
           <span class="el-button--text" style="cursor: pointer"
                 @click.stop="rowCell(row,index)">{{ row.corpName }}</span>
         </template>
+        <template slot="dispatchNumber" slot-scope="{row,index}">
+          <span class="el-button--text" style="cursor: pointer"
+                @click.stop="rowCell(row,index)">{{ row.dispatchNumber }}</span>
+        </template>
         <template slot="orderNo" slot-scope="{row,index}">
           <span class="el-button--text" style="cursor: pointer"
                 @click.stop="rowCell(row,index)">{{ row.orderNo }}</span>
@@ -198,10 +202,11 @@
 
 <script>
 import detailPage from './detailPage'
-import {removeDelegationList, selectInvoiceList, totalList} from "@/api/landTransportation/bulkCargo";
+import {getSalesman, removeDelegationList, selectInvoiceList, totalList} from "@/api/landTransportation/bulkCargo";
 import {getQueryString} from "@/util/util";
 import {businessStatisticsFrequency} from "@/api/wel";
 import {gaude, location} from "@/api/gaude";
+import {customerList} from "@/api/basicData/customerInformation";
 
 export default {
   name: "index",
@@ -335,7 +340,7 @@ export default {
             searchProp: 'fleetId',
             type: 'select',
             cascader: ['plateNo'],
-            dicUrl: "/api/blade-client/corpsdesc/list?size=1000&current=1&&corpType=CD",
+            dicUrl: "/api/blade-client/corpsdesc/list?size=500&current=1&corpType=CD",
             props: {
               label: "cname",
               value: "id",
@@ -493,8 +498,9 @@ export default {
             prop: 'fleetName',
             searchProp: 'fleetId',
             type: 'select',
+            dicData:[],
             cascader: ['plateNo'],
-            dicUrl: "/api/blade-client/corpsdesc/list?size=1000&current=1&&corpType=CD",
+            dicUrl: "/api/blade-client/corpsdesc/list?size=500&current=1&corpType=CD",
             props: {
               label: "cname",
               value: "id",
@@ -517,6 +523,12 @@ export default {
             index: 10,
             width: 86,
             prop: 'freightCollect'
+          },{
+            label: '应付运费',
+            prop: 'freightPay',
+            overHidden: true,
+            width: 100,
+            index: 13,
           }, {
             label: '状态',
             prop: 'status',
@@ -652,7 +664,7 @@ export default {
             searchProp: 'fleetId',
             type: 'select',
             cascader: ['plateNo'],
-            dicUrl: "/api/blade-client/corpsdesc/list?size=1000&current=1&&corpType=CD",
+            dicUrl: "/api/blade-client/corpsdesc/list?size=500&current=1&corpType=CD",
             props: {
               label: "cname",
               value: "id",
@@ -741,6 +753,176 @@ export default {
             search: true,
           }]
       },
+      optionListFour:{
+        align: 'center',
+        stripe: true,
+        index: true,
+        menu: true,
+        menuWidth: 80,
+        addBtn: false,
+        editBtn: false,
+        delBtn: false,
+        height: "auto",
+        searchSpan: 8,
+        searchIcon: true,
+        searchIndex: 2,
+        selection: true,
+        highlightCurrentRow: true,
+        showSummary: false,
+        summaryText: "合计",
+        sumColumnList: [{
+          name: 'freightCollect',
+          type: 'sum',
+          decimals: 2
+        },{
+          name: 'freightPay',
+          type: 'sum',
+          decimals: 2
+        }],
+        column: [
+          {
+            label: '货运日期',
+            prop: 'arrivalTime',
+            overHidden: true,
+            type: "date",
+            searchRange: true,
+            defaultTime: ['00:00:00', '23:59:59'],
+            format: "yyyy-MM-dd HH:mm",
+            valueFormat: "yyyy-MM-dd HH:mm:ss",
+            index: 1,
+            width: 126,
+            search: true,
+          }, {
+            label: '物流运输',
+            prop: 'dispatchDeptName',
+            searchProp: 'dispatchDept',
+            search: true,
+            filterable: true,
+            dicUrl: "/api/blade-system/dept/top-list?deptCategory=1",
+            type: "select",
+            props: {
+              label: "deptName",
+              value: "id"
+            },
+            overHidden: true,
+            index: 2,
+            width: 94
+          },{
+            label: '运输调度',
+            prop: 'dispatcherName',
+            overHidden: true,
+            index: 3,
+            width: 100,
+          }, {
+            label: '派车单号',
+            width: 140,
+            index: 4,
+            prop: 'dispatchNumber',
+            search: true,
+          }, {
+            label: '装货地址',
+            prop: 'addressDetail',
+            index: 5,
+            width: 132,
+            search: true,
+          }, {
+            label: '卸货地址',
+            prop: 'unloadingPlace',
+            index: 6,
+            width: 132,
+            search: true,
+          }, {
+            label: '车队',
+            width: 100,
+            index: 7,
+            overHidden: true,
+            prop: 'fleetName',
+            searchProp: 'fleetId',
+            type: 'select',
+            cascader: ['plateNo'],
+            dicUrl: "/api/blade-client/corpsdesc/list?size=500&current=1&corpType=CD",
+            props: {
+              label: "cname",
+              value: "id",
+              res: "data.records"
+            },
+            filterable: true,
+            search: true,
+          }, {
+            label: '车号',
+            width: 100,
+            index: 8,
+            prop: 'plateNo',
+            type: "select",
+            cascader: ['driverId'],
+            dicUrl: "/api/blade-client/land-vehicle/vehicle-list?fleetId={{key}}",
+            props: {
+              label: "plateNo",
+              value: "plateNo"
+            },
+            filterable: true,
+            search: true,
+          }, {
+            label: '司机',
+            width: 100,
+            index: 9,
+            prop: 'driverName',
+            searchProp: 'driverId',
+            filterable: true,
+            type: "select",
+            dicUrl: "/api/blade-client/land-driver/driver-list?plateNo={{key}}",
+            props: {
+              label: "name",
+              value: "id"
+            },
+            search: true,
+          }, {
+            label: '电话',
+            width: 160,
+            index: 10,
+            prop: 'tel'
+          }, {
+            label: '车体积',
+            width: 100,
+            index: 11,
+            prop: 'fleetVolum'
+          },{
+            label: '货物体积',
+            width: 100,
+            index: 12,
+            prop: 'volumeSum'
+          },
+          // {
+          //   label: '状态',
+          //   prop: 'status',
+          //   index: 13,
+          //   dicUrl: "/api/blade-system/dict-biz/dictionary?code=land_order_status_two",
+          //   props: {
+          //     label: "dictValue",
+          //     value: "dictKey"
+          //   },
+          //   dataType: "string",
+          //   type: 'select',
+          //   overHidden: true,
+          //   search: true,
+          //   width: 140
+          // },
+          {
+            label: '备注',
+            index: 14,
+            overHidden: true,
+            width: 140,
+            prop: 'remarks',
+          },
+          {
+            label: '订单号',
+            prop: 'orderNo',
+            index: 15,
+            overHidden: true,
+            width: 100,
+            search: true,
+          }]
+      },
       home: false,
       entrustTimer: null,
       roleName: localStorage.getItem("roleName").split(','),
@@ -757,7 +939,7 @@ export default {
   async created() {
     // this.option = this.optionListOne
     // this.option = this.optionListTwo
-    this.option = this.optionListThree
+    // this.option = this.optionListThree
     if (this.roleName.indexOf('客户') !== -1){
       this.optionList = this.optionListOne
     }else if (this.roleName.indexOf('平台') !== -1){
@@ -765,10 +947,19 @@ export default {
     }else if (this.roleName.indexOf('车队') !== -1){
       this.optionList = this.optionListThree
     }else {
-      this.optionList = this.optionListOne
+      this.optionList = this.optionListFour
     }
     this.option = await this.getColumnData(this.getColumnName(85.7), this.optionList);
     this.key++
+
+    customerList({
+      size:500,current:1,corpType:'CD'
+    }).then(res=>{
+      this.findObject(this.option.column, "fleetName").dicData = res.data.data.records
+    })
+    getSalesman().then(res=>{
+      this.findObject(this.option.column, "salesmanName").dicData = res.data.data
+    })
     let i = 0;
     this.option.column.forEach(item => {
       if (item.search) i++