ReservationSubmissionListLoading.vue 17.3 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474
<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="10">
            <a-form-item label="司机到达时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-range-picker
                style="width: 210px"
                format="YYYY-MM-DD"
                :placeholder="['开始时间', '结束时间']"
                @change="onArrivalChange"
                @ok="onDateOk"
              />
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="客户名称">
              <a-input placeholder="请输入客户名称" v-model="queryParam.customerName"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="车牌号">
              <a-input placeholder="请输入车牌号" v-model="queryParam.carNumber"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="订单号">
              <a-input placeholder="请输入订单号" v-model="queryParam.orderNumber"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="10">
            <a-form-item label="确定到达时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-range-picker
                style="width: 210px"
                format="YYYY-MM-DD"
                :placeholder="['开始时间', '结束时间']"
                @change="onDateChange"
                @ok="onDateOk"
              />
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="预约状态">
              <a-select v-model="queryParam.stare" placeholder="请选择预约状态">
                <a-select-option value="10">预约成功</a-select-option>
                <a-select-option value="15">司机到达</a-select-option>
                <a-select-option value="20">月台绑定</a-select-option>
                <a-select-option value="30">备货中</a-select-option>
                <a-select-option value="50">备货完成</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="审核状态">
              <a-select v-model="queryParam.auditStatus" placeholder="请选择审核状态">
                <a-select-option value="adopt">审核通过</a-select-option>
                <a-select-option value="failed">未通过</a-select-option>
                <a-select-option value="unapproved">未审核</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="车型">
              <a-select v-model="queryParam.vehicle" placeholder="请选择审核状态">
                <a-select-option value="xxc">箱型车</a-select-option>
                <a-select-option value="pbc">平板车</a-select-option>
                <a-select-option value="hg">货柜</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->

    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
      <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<!--      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
<!--        <a-button type="primary" icon="import">导入</a-button>-->
<!--      </a-upload>-->
      <a-button type="primary" icon="download" @click="handleExportXls('预约管理')">导出</a-button>
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
        </a-menu>
        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
      </a-dropdown>
    </div>

    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>

      <a-table
        ref="table"
        size="middle"
        :scroll="{x:true}"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        class="j-table-force-nowrap"
        @change="handleTableChange">
        <span slot="auditStatus" slot-scope="text, record, index">
            <a-tag color="#87d068" v-if="text=='adopt'">审核通过</a-tag>
            <a-tag color="pink" v-if="text=='failed'" >未通过</a-tag>
            <a-tag color="orange" v-if="text=='unapproved'" >未审核</a-tag>
        </span>
        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)">
            下载
          </a-button>
        </template>

        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)" >编辑</a>
          <a-divider type="vertical" />
          <a @click="poadingphotos(record.orderNumber)">查看照片</a>
          <a-divider type="vertical" v-if="record.stare ==10" />
          <a-popconfirm title="您确定要取消预约吗?" @confirm="deleteClick(record)">
          <a v-if="record.stare==10">取消预约</a>
          </a-popconfirm>
          <a-divider type="vertical" v-if="record.stare<50 && (record.auditStatus=='unapproved' || record.auditStatus=='failed') && record.phoneNumber != null && record.phoneNumber !=''"/>
          <a-popconfirm title="确定该预约信息通过审核吗?" @confirm="approvedClick(record.id)">
            <a v-if="record.stare<50 && (record.auditStatus=='unapproved' || record.auditStatus=='failed') && record.phoneNumber != null && record.phoneNumber !=''">审核通过</a>
          </a-popconfirm>
                    <a-divider type="vertical" v-if="record.stare<50 && record.auditStatus=='adopt'"/>
          <a-popconfirm title="您确定取消审核吗?" @confirm="unapproveClick(record.id)">
            <a v-if="record.stare<50 && record.auditStatus=='adopt'">取消审核</a>
          </a-popconfirm>
        </span>
        <span slot="workOrder" slot-scope="text, record">
            <a @click="inventoryClick(record)">{{(record.orderNumber)}}</a>
        </span>
        <span slot="carNumber" slot-scope="text, record">
            <a @click="carNumberClick(record)">{{(record.carNumber)}}</a>
        </span>
      </a-table>
    </div>
    <reservation-submission-modal ref="modalForm" @ok="modalFormOk"></reservation-submission-modal>
    <j-popup
      v-show="showRentPrise"
      ref="shipment_header"
      code="find_shipment_header"
      :param="params"
      org-fields="username"
      dest-fields="popup"
      field="popup"/>
    <j-popup
      v-show="showRentPrise"
      ref="vehicle_analysis"
      code="find_vehicle_analysis"
      :param="carNumberParams"
      org-fields="id"
      dest-fields="id"
      field="popup"/>
  </a-card>
</template>

<script>

  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import ReservationSubmissionModal from './modules/ReservationSubmissionModalto'
  import {httpAction} from "@api/manage";
  import {filterObj} from "@/utils/util";

  export default {
    name: 'ReservationSubmissionList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      ReservationSubmissionModal
    },
    data () {
      return {
        description: '预约表管理页面',
        params:{code:''},
        carNumberParams:{id:''},
        queryParam:{
          createTimeRange:"",
          customerName:"",
          carNumber:"",
          orderNumber:"",
          stare:"",
          auditStatus:"",
          vehicle:"",
          confirmedArrivalTime:"",
          beginDate:"",
          finishDate:"",
          determineBegin:"",
          determineEnd:""
        },
        // 表头
        columns: [
          // {
          //   title:'预约时间',
          //   align:"center",
          //   dataIndex: 'appointmentTime'
          // },
          // {
          //   title:'时间段',
          //   align:"center",
          //   dataIndex: 'timeSelection'
          // },
          {
            title:'司机到达时间',
            align:"center",
            dataIndex: 'driverArrivalTime',
            sorter: true
          },
          {
            title:'确定到达时间',
            align:"center",
            dataIndex: 'confirmedArrivalTime',
            sorter: true
          },
          {
            title:'司机离厂时间',
            align:"center",
            dataIndex: 'driverLeaveTime',
            sorter: true
          },
          {
            title:'司机逗留时间',
            align:"center",
            dataIndex: 'stayTime',
            sorter: true
          },
          {
            title:'装车时间',
            align:"center",
            dataIndex: 'loadingTime',
            sorter: true
          },
          {
            title:'订单号',
            align:"center",
            dataIndex: 'orderNumber',
            scopedSlots:{
              customRender:'workOrder'
            }
          },
          {
            title:'车牌号',
            align:"center",
            dataIndex: 'carNumber',
            sorter: true,
            scopedSlots:{
              customRender:'carNumber'
            }
          },
          {
            title:'司机名称',
            align:"center",
            dataIndex: 'driverName',
            sorter: true
          },
          {
            title:'司机手机号',
            align:"center",
            dataIndex: 'phoneNumber'
          },
          {
            title:'身份证',
            align:"center",
            dataIndex: 'identityCard'
          },
          {
            title:'车型',
            align:"center",
            dataIndex: 'vehicle_dictText',
            sorter: true
          },
          {
            title:'客户名称',
            align:"center",
            dataIndex: 'customerName'
          },

          {
            title:'填表人电话',
            align:"center",
            dataIndex: 'submitPhone'
          },
          // {
          //   title:'月台组编码',
          //   align:"center",
          //   dataIndex: 'railwayPlatform'
          // },
          {
            title:'月台',
            align:"center",
            dataIndex: 'platformDetailId',
            sorter: true
          },
          {
            title: '审核状态',
            align: 'center',
            dataIndex: 'auditStatus',
            scopedSlots: { customRender: 'auditStatus' },
            sorter: true
          },
          {
            title:'预约状态',
            align:"center",
            dataIndex: 'stare_dictText',
            sorter: true
          },
          {
            title:'预约来源',
            align:"center",
            dataIndex: 'reservationMethod'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/reservationsubmission/reservationSubmission/loading",
          delete: "/reservationsubmission/reservationSubmission/cancel",
          approved: "/reservationsubmission/reservationSubmission/approved",
          unapprove:"/reservationsubmission/reservationSubmission/unapprove",
          deleteBatch: "/reservationsubmission/reservationSubmission/deleteBatch",
          exportXlsUrl: "/reservationsubmission/reservationSubmission/exportXls",
          importExcelUrl: "/reservationsubmission/reservationSubmission/importExcel",
          edit: "/reservationsubmission/reservationSubmission/edit"

        },
        labelCol: {
          xs: {span: 1},
          sm: {span: 2},
        },
        wrapperCol: {
          xs: {span: 10},
          sm: {span: 16},
        },
        dictOptions:{},
        superFieldList:[],
      }
    },
    created() {
    this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
      getQueryParams(){
        var param = Object.assign({}, this.queryParam,this.isorter);
        param.field = this.getQueryField();
        param.pageNo = this.ipagination.current;
        param.pageSize = this.ipagination.pageSize;
        delete param.createTimeRange; // 时间参数不传递后台
        if (this.superQueryParams) {
          param['superQueryParams'] = encodeURI(this.superQueryParams)
          param['superQueryMatchType'] = this.superQueryMatchType
        }
        return filterObj(param);
      },
      initDictConfig(){
      },
      carNumberClick(data){
        this.carNumberParams.id = data.id;
        this.$refs.vehicle_analysis.openModal();
      },
      inventoryClick(data){
        this.params.code=data.orderNumber;
        this.$refs.shipment_header.openModal();
      },
      deleteClick(data){
        debugger
        httpAction(this.url.delete, data,'post').then((res) => {
          if (res.success) {
            //重新计算分页问题
            this.$message.success(res.message);
            this.loadData();
          } else {
            this.$message.warning(res.message);
          }
        });
      },
      approvedClick(id){
        httpAction(this.url.approved, {"id": id}, 'post').then((res) =>{
          if (res.success) {
            //重新计算分页问题
            this.$message.success(res.message);
            this.loadData();
          } else {
            this.$message.warning(res.message);
          }
        })
      },
      unapproveClick(id){
        httpAction(this.url.unapprove, {"id": id}, 'post').then((res) =>{
          if (res.success) {
            //重新计算分页问题
            this.$message.success(res.message);
            this.loadData();
          } else {
            this.$message.warning(res.message);
          }
        })
      },
      onDateChange: function (value, dateString) {
        console.log(dateString[0], dateString[1]);
        this.queryParam.determineBegin = dateString[0];
        this.queryParam.determineEnd = dateString[1];
      },
      onArrivalChange: function (value, dataString){
        this.queryParam.beginDate  = dataString[0];
        this.queryParam.finishDate  = dataString[1];
      },
      onDateOk(value) {
        console.log(value);
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'string',value:'railwayPlatform',text:'月台',dictCode:'platform_management,name,name'})
        fieldList.push({type:'string',value:'appointmentTime',text:'预约时间',dictCode:'time'})
        fieldList.push({type:'string',value:'timeSelection',text:'时间段',dictCode:''})
        fieldList.push({type:'string',value:'orderNumber',text:'订单号',dictCode:''})
        fieldList.push({type:'string',value:'reservationMethod',text:'预约形式',dictCode:''})
        fieldList.push({type:'string',value:'carNumber',text:'车牌号',dictCode:''})
        fieldList.push({type:'string',value:'driverName',text:'司机名称',dictCode:''})
        fieldList.push({type:'string',value:'phoneNumber',text:'司机手机号',dictCode:''})
        fieldList.push({type:'string',value:'vehicle',text:'车型',dictCode:'vehicle_table,name,name'})
        fieldList.push({type:'int',value:'stare',text:'预约状态',dictCode:'go_order_status'})
        fieldList.push({type:'string',value:'platformGroup',text:'汽车吨位',dictCode:''})
        fieldList.push({type:'string',value:'customerName',text:'客户名称',dictCode:''})
        fieldList.push({type:'string',value:'submitPhone',text:'填表人电话',dictCode:''})
        fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
        this.superFieldList = fieldList
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>