| | |
| | | <Card> |
| | | <Row class="operation"> |
| | | <Date-picker v-model="value" @on-change="getDataByDate" value-format="yyyy-MM-dd" type="daterange" |
| | | placement="bottom-start" placeholder="请选择日期" style="width: 240px;padding-left: 20px"> |
| | | placement="bottom-start" placeholder="请选择日期" |
| | | style="width: 240px;padding-left: 20px;margin-right: 20px"> |
| | | </Date-picker> |
| | | <Input v-model="carNo" suffix="ios-search" @on-change="getSign" placeholder="输入车牌号搜索" clearable |
| | | style="width: 250px;margin-right: 20px"/> |
| | | <Input v-model="line" suffix="ios-search" @on-change="getSign" placeholder="输入区域搜索" clearable |
| | | style="width: 250px"/> |
| | | <Button @click="exportExcel" class="init-button export-button">导出数据</Button> |
| | | <!-- <Button @click="exportAllExcel" class="init-button export-button">导出全部数据</Button> --> |
| | | <Button @click="init" icon="md-refresh" class="init-button">刷新</Button> |
| | | <Button type="dashed" @click="openTip = !openTip">{{ |
| | | openTip ? "关闭提示" : "开启提示" |
| | | }} |
| | | }} |
| | | </Button> |
| | | <Input v-model="carNo" suffix="ios-search" @on-change="getSign" placeholder="输入车牌号搜索" clearable |
| | | style="width: 250px" /> |
| | | <Button @click="exportExcel" class="init-button export-button">导出本页数据</Button> |
| | | <!-- <Button @click="exportAllExcel" class="init-button export-button">导出全部数据</Button> --> |
| | | <div @click="switchnum = 1"> |
| | | <Button class="init-button export-button">日签收率</Button> |
| | | </div> |
| | | <div @click="switchnum = 2"> |
| | | <Button class="init-button export-button">月签收率</Button> |
| | | </div> |
| | | </Row> |
| | | <Alert show-icon v-show="openTip"> |
| | | 已选择 |
| | | <span class="select-count">{{ selectList.length }}</span> 项 |
| | | <a class="select-clear" @click="clearSelectAll">清空</a> |
| | | </Alert> |
| | | <!-- 日签收率的表 --> |
| | | <div v-show="switchnum === 1"> |
| | | <!-- 签收率的表 --> |
| | | <div> |
| | | <Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" |
| | | :span-method="handleSpan" @on-sort-change="changeSort" @on-selection-change="changeSelect" height="600"></Table> |
| | | :span-method="handleSpan" @on-sort-change="changeSort" @on-selection-change="changeSelect" |
| | | height="615"></Table> |
| | | </div> |
| | | <!-- 月签收率的表 --> |
| | | <div v-show="switchnum === 2"> |
| | | <Table :loading="loading" border :columns="columnsMonth" :data="monthData" sortable="custom" |
| | | :span-method="handleSpan" @on-sort-change="changeSort" @on-selection-change="changeSelect" height="600"> |
| | | </Table> |
| | | </div> |
| | | <div v-show="switchnum === 1"> |
| | | <div> |
| | | <Row type="flex" justify="end" class="page"> |
| | | <Page :current="pageNum" :total="total" :page-size="pageSize" @on-change="changePage" |
| | | @on-page-size-change="changePageSize" :page-size-opts="[18, 36]" size="small" show-total show-elevator |
| | | show-sizer></Page> |
| | | </Row> |
| | | </div> |
| | | <div v-show="switchnum === 2"> |
| | | <Row type="flex" justify="end" class="page"> |
| | | <Page :current="pageNum" :total="totalmonth" :page-size="pageSize" @on-change="changePage" |
| | | @on-page-size-change="changePageSize" :page-size-opts="[18, 36]" size="small" show-total show-elevator |
| | | show-sizer></Page> |
| | | @on-page-size-change="changePageSize" :page-size-opts="[60, 120]" size="small" show-total show-elevator |
| | | show-sizer></Page> |
| | | </Row> |
| | | </div> |
| | | </Card> |
| | |
| | | <Modal :title="modalTitle" v-model="roleModalVisible" :mask-closable="false" :width="500"> |
| | | <Form ref="carForm" :model="carForm" :label-width="80" :rules="carFormValidate"> |
| | | <FormItem label="品牌" prop="brand"> |
| | | <Input v-model="carForm.brand" /> |
| | | <Input v-model="carForm.brand"/> |
| | | </FormItem> |
| | | <FormItem label="型号" prop="model"> |
| | | <Input v-model="carForm.model" /> |
| | | <Input v-model="carForm.model"/> |
| | | </FormItem> |
| | | <FormItem label="排量" prop="displacement"> |
| | | <Input v-model="carForm.displacement" /> |
| | | <Input v-model="carForm.displacement"/> |
| | | </FormItem> |
| | | <Form-item label="购置年份"> |
| | | <Row> |
| | | <Col span="11"> |
| | | <Date-picker @on-change="change1" type="date" value="yyyy-MM-dd" placeholder="选择日期" |
| | | v-model="carForm.buyYear"></Date-picker> |
| | | <Date-picker @on-change="change1" type="date" value="yyyy-MM-dd" placeholder="选择日期" |
| | | v-model="carForm.buyYear"></Date-picker> |
| | | </Col> |
| | | </Row> |
| | | </Form-item> |
| | | <FormItem label="牌照" prop="carNo"> |
| | | <Input v-model="carForm.carNo" /> |
| | | <Input v-model="carForm.carNo"/> |
| | | </FormItem> |
| | | <FormItem label="加油卡号" prop="addOilCode"> |
| | | <Input v-model="carForm.addOilCode" /> |
| | | <Input v-model="carForm.addOilCode"/> |
| | | </FormItem> |
| | | <FormItem label="车辆编号" prop="code"> |
| | | <Input v-model="carForm.code" /> |
| | | <Input v-model="carForm.code"/> |
| | | </FormItem> |
| | | <FormItem label="司机" prop="userId"> |
| | | <Select v-model="carForm.userId" filterable> |
| | |
| | | <Button @click="init" icon="md-refresh">刷新</Button> |
| | | </Row> |
| | | <Table :loading="loading" border :columns="columns2" :data="data2" ref="table" sortable="custom" |
| | | @on-sort-change="changeSort" @on-selection-change="changeSelect"> |
| | | @on-sort-change="changeSort" @on-selection-change="changeSelect"> |
| | | |
| | | |
| | | </Table> |
| | |
| | | </Select> |
| | | </FormItem> |
| | | <FormItem label="编号" prop="code"> |
| | | <Input v-model="equipmentForm.code" /> |
| | | <Input v-model="equipmentForm.code"/> |
| | | </FormItem> |
| | | <FormItem label="ip地址" prop="ip"> |
| | | <Input v-model="equipmentForm.ip" /> |
| | | <Input v-model="equipmentForm.ip"/> |
| | | </FormItem> |
| | | <FormItem label="端口号" prop="port"> |
| | | <Input v-model="equipmentForm.port" /> |
| | | <Input v-model="equipmentForm.port"/> |
| | | </FormItem> |
| | | |
| | | </Form> |
| | |
| | | <Modal :title="modalTitle" v-model="carModalVisible" :mask-closable="false" :width="500" class="depModal"> |
| | | <Form :label-width="85" ref="removeForm" :model="removeForm"> |
| | | <FormItem label="移除原因" prop="removeReason"> |
| | | <Input v-model="removeForm.removeReason" /> |
| | | <Input v-model="removeForm.removeReason"/> |
| | | </FormItem> |
| | | </Form> |
| | | <div v-show="dataType == 1" style="margin-top: 15px"> |
| | | <div style="position: relative"> |
| | | <Tree ref="depTree" :data="depData" :load-data="loadData" @on-toggle-expand="expandCheckDep" multiple |
| | | style="margin-top: 15px"></Tree> |
| | | style="margin-top: 15px"></Tree> |
| | | <Spin size="large" fix v-if="depTreeLoading"></Spin> |
| | | </div> |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getAllPermissionList, |
| | | setDefaultRole, |
| | | editRolePerm, |
| | | initDepartment, |
| | | loadDepartment, |
| | | editRoleDep, |
| | | } from "@/api/index"; |
| | | import {editRoleDep, editRolePerm, getAllPermissionList, loadDepartment, setDefaultRole,} from "@/api/index"; |
| | | |
| | | import { |
| | | getAll, |
| | | addCar, |
| | | getCarList, |
| | | editCar, |
| | | deleteCar, |
| | | getEquipment, |
| | | addEquipment, |
| | | getUser, |
| | | getDriver, |
| | | deleteCar, |
| | | deleteEquipment, |
| | | getSignList, |
| | | getLicense, |
| | | getSignByMonth, |
| | | editCar, |
| | | getDriver, |
| | | getEquipment, |
| | | getNewSignList, |
| | | outExcel |
| | | } from "@/api/open"; |
| | | import util from "@/libs/util.js"; |
| | | import { childColumn, childData, childDataTwo, childColumnTwo, childColumnthree } from "./exportColumn" |
| | | import Vue from "vue" |
| | | |
| | | export default { |
| | | name: "car-manage", |
| | | data() { |
| | |
| | | searchForm: { |
| | | // 搜索框初始化对象 |
| | | pageNumber: 1, // 当前页数 |
| | | pageSize: 10, // 页面大小 |
| | | pageSize: 60, // 页面大小 |
| | | sort: "createTime", // 默认排序字段 |
| | | order: "desc", // 默认排序方式 |
| | | key: "", |
| | |
| | | }, |
| | | carFormValidate: { |
| | | name: [ |
| | | { required: true, message: "角色名称不能为空", trigger: "change" }, |
| | | {required: true, message: "角色名称不能为空", trigger: "change"}, |
| | | ], |
| | | }, |
| | | submitLoading: false, |
| | |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "配送员", |
| | | key: "name", |
| | | title: "区域", |
| | | key: "line", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | // { |
| | | // title: "年月", |
| | | // key: "sendMonth", |
| | | // minWidth: 120, |
| | | // align: "center", |
| | | // }, |
| | | { |
| | | title: "01段", |
| | | // key: "oneBatch", |
| | | key: "oneBatch", |
| | | minWidth: 140, |
| | | align: "center", |
| | | children: [ |
| | | { |
| | | title: '日期', |
| | | align: 'center', |
| | | key: 'sendDate', |
| | | minWidth: 120, |
| | | className: 'no_border', |
| | | render: (h, params) => { |
| | | return h("div", [ |
| | | h("Table", { |
| | | props: { |
| | | columns: childColumn, |
| | | "show-header": false, |
| | | data: params.row.childone, |
| | | align: 'center', |
| | | }, |
| | | }), |
| | | ]) |
| | | }, |
| | | }, |
| | | { |
| | | title: '日签收率', |
| | | align: 'center', |
| | | className: 'no_border', |
| | | minWidth: 120, |
| | | render: (h, params) => { |
| | | return h("div", [ |
| | | h("Table", { |
| | | props: { |
| | | columns: childColumnTwo, |
| | | data: params.row.childone, |
| | | "show-header": false, |
| | | }, |
| | | }), |
| | | ]) |
| | | }, |
| | | }, |
| | | ] |
| | | |
| | | }, |
| | | { |
| | | title: "02段", |
| | | key: "twoBatch", |
| | | minWidth: 140, |
| | | align: "center", |
| | | children: [ |
| | | { |
| | | title: '日期', |
| | | align: 'center', |
| | | key: 'model', |
| | | minWidth: 120, |
| | | className: 'no_border', |
| | | render: (h, params) => { |
| | | return h("div", [ |
| | | h("Table", { |
| | | props: { |
| | | columns: childColumn, |
| | | data: params.row.childtwo, |
| | | "show-header": false, |
| | | }, |
| | | }), |
| | | ]) |
| | | }, |
| | | }, |
| | | { |
| | | title: '日签收率', |
| | | align: 'center', |
| | | key: 'model', |
| | | minWidth: 120, |
| | | className: 'no_border', |
| | | render: (h, params) => { |
| | | return h("div", [ |
| | | h("Table", { |
| | | props: { |
| | | columns: childColumnTwo, |
| | | data: params.row.childtwo, |
| | | "show-header": false, |
| | | }, |
| | | }), |
| | | ]) |
| | | }, |
| | | }, |
| | | ] |
| | | }, |
| | | { |
| | | title: "03段", |
| | | key: "threeBatch", |
| | | minWidth: 140, |
| | | align: "center", |
| | | children: [ |
| | | { |
| | | title: '日期', |
| | | align: 'center', |
| | | key: 'model', |
| | | minWidth: 120, |
| | | className: 'no_border', |
| | | render: (h, params) => { |
| | | return h("div", [ |
| | | h("Table", { |
| | | props: { |
| | | columns: childColumn, |
| | | data: params.row.childthree, |
| | | "show-header": false, |
| | | }, |
| | | }), |
| | | ]) |
| | | }, |
| | | }, |
| | | { |
| | | title: '日签收率', |
| | | align: 'center', |
| | | key: 'model', |
| | | minWidth: 120, |
| | | className: 'no_border', |
| | | render: (h, params) => { |
| | | return h("div", [ |
| | | h("Table", { |
| | | props: { |
| | | columns: childColumnTwo, |
| | | data: params.row.childthree, |
| | | "show-header": false, |
| | | }, |
| | | }), |
| | | ]) |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | title: "04段", |
| | |
| | | minWidth: 140, |
| | | align: "center", |
| | | tooltip: true, |
| | | children: [ |
| | | { |
| | | title: '日期', |
| | | align: 'center', |
| | | key: 'model', |
| | | minWidth: 120, |
| | | className: 'no_border', |
| | | render: (h, params) => { |
| | | return h("div", [ |
| | | h("Table", { |
| | | props: { |
| | | columns: childColumn, |
| | | data: params.row.childfour, |
| | | "show-header": false, |
| | | }, |
| | | }), |
| | | ]) |
| | | }, |
| | | }, |
| | | { |
| | | title: '日签收率', |
| | | align: 'center', |
| | | key: 'model', |
| | | minWidth: 120, |
| | | className: 'no_border', |
| | | render: (h, params) => { |
| | | return h("div", [ |
| | | h("Table", { |
| | | props: { |
| | | columns: childColumnTwo, |
| | | data: params.row.childfour, |
| | | "show-header": false, |
| | | }, |
| | | }), |
| | | ]) |
| | | }, |
| | | }, |
| | | ] |
| | | }, |
| | | { |
| | | title: "05段", |
| | | key: "fiveBatch", |
| | | minWidth: 140, |
| | | align: "center", |
| | | children: [ |
| | | { |
| | | title: '日期', |
| | | align: 'center', |
| | | key: 'model', |
| | | minWidth: 120, |
| | | className: 'no_border', |
| | | render: (h, params) => { |
| | | return h("div", [ |
| | | h("Table", { |
| | | props: { |
| | | columns: childColumn, |
| | | data: params.row.childfive, |
| | | "show-header": false, |
| | | }, |
| | | }), |
| | | ]) |
| | | }, |
| | | }, |
| | | { |
| | | title: '日签收率', |
| | | align: 'center', |
| | | key: 'model', |
| | | minWidth: 120, |
| | | className: 'no_border', |
| | | render: (h, params) => { |
| | | return h("div", [ |
| | | h("Table", { |
| | | props: { |
| | | columns: childColumnTwo, |
| | | data: params.row.childfive, |
| | | "show-header": false, |
| | | }, |
| | | }), |
| | | ]) |
| | | }, |
| | | }, |
| | | ] |
| | | }, |
| | | ], |
| | | columnsMonth: [ |
| | | { |
| | | type: "selection", |
| | | width: 60, |
| | | align: "center", |
| | | }, |
| | | { |
| | | type: "index", |
| | | title: "序号", |
| | | width: 80, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "车牌号", |
| | | key: "carName", |
| | | width: 140, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "司机", |
| | | key: "userName", |
| | | width: 140, |
| | | align: "center", |
| | | }, |
| | | // { |
| | | // title: "配送员", |
| | | // key: "name", |
| | | // width: 100, |
| | | // align: "center", |
| | | // }, |
| | | // { |
| | | // title: "年月", |
| | | // key: "sendMonth", |
| | | // minWidth: 120, |
| | | // align: "center", |
| | | // }, |
| | | { |
| | | title: "01段", |
| | | width: 140, |
| | | align: "center", |
| | | children: [ |
| | | { |
| | | title: '月份', |
| | | align: 'center', |
| | | key: 'sendDate', |
| | | width: 120, |
| | | className: 'no_border', |
| | | render: (h, params) => { |
| | | console.log(params.row.childone); |
| | | return h("div", [ |
| | | h("Table", { |
| | | props: { |
| | | columns: childColumn, |
| | | "show-header": false, |
| | | data: params.row.childone, |
| | | align: 'center', |
| | | }, |
| | | }), |
| | | ]) |
| | | }, |
| | | }, |
| | | { |
| | | title: '月签收率', |
| | | align: 'center', |
| | | key: 'proportion', |
| | | width: 120, |
| | | className: 'no_border Sign', |
| | | render: (h, params) => { |
| | | return h("div", [ |
| | | h("Table", { |
| | | props: { |
| | | columns: childColumnthree, |
| | | data: params.row.childone, |
| | | "show-header": false, |
| | | }, |
| | | }), |
| | | ]) |
| | | }, |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | title: "02段", |
| | | key: "twoBatch", |
| | | title: "总(平均)签收率", |
| | | key: "sendMonth", |
| | | minWidth: 140, |
| | | align: "center", |
| | | children: [ |
| | | { |
| | | title: '月份', |
| | | align: 'center', |
| | | key: 'model', |
| | | width: 120, |
| | | className: 'no_border', |
| | | render: (h, params) => { |
| | | return h("div", [ |
| | | h("Table", { |
| | | props: { |
| | | columns: childColumn, |
| | | data: params.row.childtwo, |
| | | "show-header": false, |
| | | }, |
| | | }), |
| | | ]) |
| | | }, |
| | | }, |
| | | { |
| | | title: '月签收率', |
| | | align: 'center', |
| | | // key: 'proportion', |
| | | width: 120, |
| | | className: 'no_border Sign', |
| | | render: (h, params) => { |
| | | return h("div", [ |
| | | h("Table", { |
| | | props: { |
| | | columns: childColumnthree, |
| | | data: params.row.childtwo, |
| | | "show-header": false, |
| | | }, |
| | | }), |
| | | ]) |
| | | }, |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | title: "03段", |
| | | key: "threeBatch", |
| | | minWidth: 140, |
| | | align: "center", |
| | | children: [ |
| | | { |
| | | title: '月份', |
| | | align: 'center', |
| | | key: 'model', |
| | | width: 120, |
| | | className: 'no_border', |
| | | render: (h, params) => { |
| | | return h("div", [ |
| | | h("Table", { |
| | | props: { |
| | | columns: childColumn, |
| | | data: params.row.childthree, |
| | | "show-header": false, |
| | | }, |
| | | }), |
| | | ]) |
| | | }, |
| | | }, |
| | | { |
| | | title: '月签收率', |
| | | align: 'center', |
| | | // key: 'model', |
| | | width: 120, |
| | | className: 'no_border Sign', |
| | | render: (h, params) => { |
| | | return h("div", [ |
| | | h("Table", { |
| | | props: { |
| | | columns: childColumnthree, |
| | | data: params.row.childthree, |
| | | "show-header": false, |
| | | }, |
| | | }), |
| | | ]) |
| | | }, |
| | | } |
| | | ], |
| | | }, |
| | | { |
| | | title: "04段", |
| | | key: "fourBatch", |
| | | minWidth: 140, |
| | | align: "center", |
| | | tooltip: true, |
| | | children: [ |
| | | { |
| | | title: '月份', |
| | | align: 'center', |
| | | key: 'model', |
| | | width: 120, |
| | | className: 'no_border', |
| | | render: (h, params) => { |
| | | return h("div", [ |
| | | h("Table", { |
| | | props: { |
| | | columns: childColumn, |
| | | data: params.row.childfour, |
| | | "show-header": false, |
| | | }, |
| | | }), |
| | | ]) |
| | | }, |
| | | }, |
| | | { |
| | | title: '月签收率', |
| | | align: 'center', |
| | | // key: 'model', |
| | | width: 120, |
| | | className: 'no_border Sign', |
| | | render: (h, params) => { |
| | | return h("div", [ |
| | | h("Table", { |
| | | props: { |
| | | columns: childColumnthree, |
| | | data: params.row.childfour, |
| | | "show-header": false, |
| | | }, |
| | | }), |
| | | ]) |
| | | }, |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | title: "05段", |
| | | key: "fiveBatch", |
| | | minWidth: 140, |
| | | align: "center", |
| | | children: [ |
| | | { |
| | | title: '月份', |
| | | align: 'center', |
| | | key: 'model', |
| | | width: 120, |
| | | className: 'no_border', |
| | | render: (h, params) => { |
| | | return h("div", [ |
| | | h("Table", { |
| | | props: { |
| | | columns: childColumn, |
| | | data: params.row.childfive, |
| | | "show-header": false, |
| | | }, |
| | | }), |
| | | ]) |
| | | }, |
| | | }, |
| | | { |
| | | title: '月签收率', |
| | | align: 'center', |
| | | // key: 'model', |
| | | width: 120, |
| | | className: 'no_border Sign', |
| | | render: (h, params) => { |
| | | return h("div", [ |
| | | h("Table", { |
| | | props: { |
| | | columns: childColumnthree, |
| | | data: params.row.childfive, |
| | | "show-header": false, |
| | | }, |
| | | }), |
| | | ]) |
| | | }, |
| | | } |
| | | ] |
| | | }, |
| | | } |
| | | ], |
| | | columns2: [ |
| | | { |
| | |
| | | render: (h, params) => { |
| | | return h("div", [ |
| | | h( |
| | | "a", |
| | | { |
| | | on: { |
| | | click: () => { |
| | | this.editEquipment(params.row); |
| | | "a", |
| | | { |
| | | on: { |
| | | click: () => { |
| | | this.editEquipment(params.row); |
| | | }, |
| | | }, |
| | | }, |
| | | }, |
| | | "编辑" |
| | | "编辑" |
| | | ), |
| | | h("Divider", { |
| | | props: { |
| | |
| | | }, |
| | | }), |
| | | h( |
| | | "a", |
| | | { |
| | | on: { |
| | | click: () => { |
| | | this.removeEquipment(params.row); |
| | | "a", |
| | | { |
| | | on: { |
| | | click: () => { |
| | | this.removeEquipment(params.row); |
| | | }, |
| | | }, |
| | | }, |
| | | }, |
| | | "删除" |
| | | "删除" |
| | | ), |
| | | ]); |
| | | }, |
| | |
| | | // 页码 |
| | | pageNum: 1, |
| | | // 每页条数 |
| | | pageSize: 36, |
| | | pageSize: 60, |
| | | // 车牌号 |
| | | carNo: "", |
| | | // 线路 |
| | | line: "", |
| | | // 开始日期 |
| | | beginTime: "", |
| | | // 结束日期 |
| | | endTime: "", |
| | | // 按月查询的data |
| | | monthData: [], |
| | | // monthData: [], |
| | | // 导出的数据 |
| | | exportData: "", |
| | | // 日 月签收率两张表的切换 |
| | | switchnum: 1 |
| | | dateOption: { |
| | | disabledDate(date) { |
| | | const now = new Date(); |
| | | const year = now.getFullYear(); |
| | | const month = now.getMonth(); |
| | | return date.getFullYear() !== year || date.getMonth() !== month; |
| | | } |
| | | } |
| | | }; |
| | | }, |
| | | computed: { |
| | | firstDate() { |
| | | let y = new Date().getFullYear(); //获取年份 |
| | | let m = new Date().getMonth() + 1; //获取月份 |
| | | let d = '01'; |
| | | m = m < 10 ? '0' + m : m; //月份补 0 |
| | | return [y, m, d].join('-') |
| | | }, |
| | | lastDate() { |
| | | let y = new Date().getFullYear(); //获取年份 |
| | | let m = new Date().getMonth() + 1; //获取月份 |
| | | let d = new Date(y, m, 0).getDate(); //获取当月最后一日 |
| | | m = m < 10 ? '0' + m : m; //月份补 0 |
| | | d = d < 10 ? '0' + d : d; //日数补 0 |
| | | return [y, m, d].join('-') |
| | | }, |
| | | }, |
| | | created() { |
| | | this.beginTime = this.firstDate |
| | | this.endTime = this.lastDate |
| | | this.value = [this.firstDate, this.lastDate] |
| | | //请求数据 |
| | | this.getSign() |
| | | // 按月请求的数据 |
| | | this.getSignByMonthList() |
| | | }, |
| | | methods: { |
| | | getSign() { |
| | | getSignList(this.pageNum, this.pageSize, this.carNo, this.beginTime, this.endTime).then(result => { |
| | | this.loading = true; |
| | | getNewSignList(this.pageNum, this.pageSize, this.carNo, this.beginTime, this.endTime, this.line, '', '', '').then(result => { |
| | | this.loading = false; |
| | | if (result.success) { |
| | | this.data = result.result.records; |
| | | let reg = /\d/g; |
| | | this.data = result.result.records.map(v => { |
| | | return { |
| | | ...v, |
| | | sendMonth: v.sendMonth.length >= 6 ? v.sendMonth.slice(0, 5) + '%' : v.sendMonth, |
| | | proportion: v.proportion.length >= 6 ? v.proportion.slice(0, 5) + '%' : v.proportion, |
| | | line: v.line.replace(reg, '').replace('车', '') |
| | | } |
| | | }) |
| | | this.total = result.result.total; |
| | | this.data = this.merge(this.data) |
| | | // console.log(this.data); |
| | | |
| | | } |
| | | }) |
| | | }, |
| | | getSignByMonthList() { |
| | | getSignByMonth(this.pageNum, this.pageSize, this.carNo, 3).then(result => { |
| | | this.loading = false; |
| | | if (result.success) { |
| | | this.dataMonth = result.result.records |
| | | this.totalmonth = result.result.total; |
| | | this.monthData = this.merge(this.dataMonth) |
| | | // console.log(this.monthData); |
| | | merge(data) { |
| | | return Object.values(data.reduce((acc, cur) => { |
| | | if (!acc[cur.userName]) { |
| | | acc[cur.userName] = [cur]; |
| | | } else { |
| | | acc[cur.userName].push(cur); |
| | | } |
| | | }) |
| | | }, |
| | | merge(index) { |
| | | let dataInfo = {}; |
| | | index.forEach((item, index) => { |
| | | let { userName, carName, sendMonth, name } = item; |
| | | if (!dataInfo[userName]) { |
| | | dataInfo[userName] = { |
| | | userName, |
| | | carName, |
| | | sendMonth, |
| | | name, |
| | | childone: [], |
| | | childtwo: [], |
| | | childthree: [], |
| | | childfour: [], |
| | | childfive: [] |
| | | return acc; |
| | | }, {})).map(group => { |
| | | return group.reduce((acc, cur) => { |
| | | acc.sendMonth = cur.sendMonth; |
| | | acc.carName = cur.carName; |
| | | acc.line = cur.line |
| | | if (cur.oneBatch) { |
| | | acc.oneBatch = cur.proportion; |
| | | } |
| | | } |
| | | if (item.batch === "01段") { |
| | | dataInfo[userName].childone.push(item); |
| | | } |
| | | if (item.batch === "02段") { |
| | | dataInfo[userName].childtwo.push(item); |
| | | } |
| | | if (item.batch === "03段") { |
| | | dataInfo[userName].childthree.push(item); |
| | | } |
| | | if (item.batch === "04段") { |
| | | dataInfo[userName].childfour.push(item); |
| | | } |
| | | if (item.batch === "05段") { |
| | | dataInfo[userName].childfive.push(item); |
| | | } |
| | | if (cur.twoBatch) { |
| | | acc.twoBatch = cur.proportion; |
| | | } |
| | | if (cur.threeBatch) { |
| | | acc.threeBatch = cur.proportion; |
| | | } |
| | | if (cur.fourBatch) { |
| | | acc.fourBatch = cur.proportion; |
| | | } |
| | | if (cur.fiveBatch) { |
| | | acc.fiveBatch = cur.proportion; |
| | | } |
| | | return acc; |
| | | }, {userName: group[0].userName}); |
| | | }); |
| | | let list = Object.values(dataInfo); |
| | | list.forEach(item => { |
| | | let arr = new Array(5 - item.childone.length).fill({ proportion: "" }) |
| | | let arr1 = new Array(5 - item.childtwo.length).fill({ proportion: "" }) |
| | | let arr2 = new Array(5 - item.childthree.length).fill({ proportion: "" }) |
| | | let arr3 = new Array(5 - item.childfour.length).fill({ proportion: "" }) |
| | | let arr4 = new Array(5 - item.childfive.length).fill({ proportion: "" }) |
| | | item.childone = [...item.childone, ...arr] |
| | | item.childtwo = [...item.childtwo, ...arr1] |
| | | item.childthree = [...item.childthree, ...arr2] |
| | | item.childfour = [...item.childfour, ...arr3] |
| | | item.childfive = [...item.childfive, ...arr4] |
| | | }) |
| | | return list |
| | | |
| | | }, |
| | | handleSummary({ columns, data }) { |
| | | handleSummary({columns, data}) { |
| | | const sums = {}; |
| | | columns.forEach((column, index) => { |
| | | const key = column.key; |
| | |
| | | }, |
| | | // 导出为excel |
| | | exportExcel() { |
| | | outExcel(this.pageNum, this.pageSize, this.carNo, this.beginTime, this.endTime).then((res) => { |
| | | let blob = new Blob([res], { type: 'application/vnd.ms-excel' }); |
| | | outExcel(this.pageNum, this.pageSize, this.carNo, this.beginTime, this.endTime, this.line).then((res) => { |
| | | let blob = new Blob([res], {type: 'application/vnd.ms-excel'}); |
| | | let url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); //创建a标签 |
| | | link.href = url; |
| | |
| | | URL.revokeObjectURL(url); |
| | | }) |
| | | }, |
| | | exportAllExcel() { |
| | | outExcel().then(res => { |
| | | let blob = new Blob([res], { type: 'application/vnd.ms-excel' }); |
| | | let url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); //创建a标签 |
| | | link.href = url; |
| | | link.download = '全部配送信息.xlsx'; //重命名文件 |
| | | link.click(); |
| | | URL.revokeObjectURL(url); |
| | | }) |
| | | }, |
| | | handleSpan({ row, column, rowIndex, columnIndex }) { |
| | | handleSpan({row, column, rowIndex, columnIndex}) { |
| | | if (rowIndex || !rowIndex) { |
| | | return {} |
| | | } |
| | |
| | | this.getDataList(); |
| | | // 获取所有菜单权限树 |
| | | }, |
| | | renderContent(h, { root, node, data }) { |
| | | renderContent(h, {root, node, data}) { |
| | | let icon = ""; |
| | | if (data.level == 0) { |
| | | icon = "ios-navigate"; |
| | |
| | | icon = "md-radio-button-off"; |
| | | } |
| | | return h( |
| | | "span", |
| | | { |
| | | style: { |
| | | display: "inline-block", |
| | | cursor: "pointer", |
| | | }, |
| | | on: { |
| | | click: () => { |
| | | if (data.status == -1) { |
| | | return; |
| | | } |
| | | data.checked = !data.checked; |
| | | "span", |
| | | { |
| | | style: { |
| | | display: "inline-block", |
| | | cursor: "pointer", |
| | | }, |
| | | on: { |
| | | click: () => { |
| | | if (data.status == -1) { |
| | | return; |
| | | } |
| | | data.checked = !data.checked; |
| | | }, |
| | | }, |
| | | }, |
| | | }, |
| | | [ |
| | | h("span", [ |
| | | h("Icon", { |
| | | props: { |
| | | type: icon, |
| | | size: "16", |
| | | }, |
| | | style: { |
| | | "margin-right": "8px", |
| | | "margin-bottom": "3px", |
| | | }, |
| | | }), |
| | | h("span", data.title), |
| | | ]), |
| | | ] |
| | | [ |
| | | h("span", [ |
| | | h("Icon", { |
| | | props: { |
| | | type: icon, |
| | | size: "16", |
| | | }, |
| | | style: { |
| | | "margin-right": "8px", |
| | | "margin-bottom": "3px", |
| | | }, |
| | | }), |
| | | h("span", data.title), |
| | | ]), |
| | | ] |
| | | ); |
| | | }, |
| | | changePage(v) { |
| | | this.loading = true; |
| | | this.pageNum = v |
| | | this.getSign(); |
| | | this.getSignByMonthList() |
| | | this.clearSelectAll(); |
| | | }, |
| | | changePageSize(v) { |
| | | this.loading = true; |
| | | this.pageSize = v; |
| | | this.getSign(); |
| | | this.getSignByMonthList() |
| | | }, |
| | | getAllUser() { |
| | | getDriver({ type: 0 }).then((res) => { |
| | | getDriver({type: 0}).then((res) => { |
| | | if (res.success) { |
| | | this.userList = res.result; |
| | | } |
| | | }); |
| | | //this.type.type=1; |
| | | getDriver({ type: 1 }).then((res) => { |
| | | getDriver({type: 1}).then((res) => { |
| | | if (res.success) { |
| | | this.driverList = res.result; |
| | | } |
| | |
| | | m = m < 10 ? ('0' + m) : m |
| | | let d = date.getDate() |
| | | d = d < 10 ? ('0' + d) : d |
| | | const time = y + '-' + m + '-' + d; |
| | | return time |
| | | return y + '-' + m + '-' + d |
| | | }, |
| | | //根据选择的日期返回数据 |
| | | getDataByDate() { |
| | | this.loading = true; |
| | | if (this.value[0] != "" && this.value[1] != "") { |
| | | console.log(this.value) |
| | | this.beginTime = this.selectDate(this.value[0]); |
| | | this.endTime = this.selectDate(this.value[1]); |
| | | this.page = false; |
| | | } else { |
| | | // var date = new Date(); |
| | | // this.endTime = this.selectDate(date); |
| | | // this.value[1] = this.endTime; |
| | | // date.setDate(1); |
| | | // this.value[0] = date; |
| | | // this.beginTime = this.selectDate(date); |
| | | this.beginTime = ""; |
| | | this.endTime = "" |
| | | this.beginTime = this.firstDate; |
| | | this.endTime = this.lastDate; |
| | | this.value = [this.firstDate, this.lastDate] |
| | | } |
| | | this.getSign(); |
| | | }, |
| | |
| | | content: "您确认要删除吗 ", |
| | | loading: true, |
| | | onOk: () => { |
| | | deleteCar({ ids: v.id }).then((res) => { |
| | | deleteCar({ids: v.id}).then((res) => { |
| | | this.$Modal.remove(); |
| | | if (res.success) { |
| | | this.clearSelectAll(); |
| | |
| | | content: "您确认要删除吗 ", |
| | | loading: true, |
| | | onOk: () => { |
| | | deleteEquipment({ ids: v.id }).then((res) => { |
| | | deleteEquipment({ids: v.id}).then((res) => { |
| | | this.$Modal.remove(); |
| | | if (res.success) { |
| | | this.clearSelectAll(); |
| | |
| | | ids += e.id + ","; |
| | | }); |
| | | ids = ids.substring(0, ids.length - 1); |
| | | deleteCar({ ids: ids }).then((res) => { |
| | | deleteCar({ids: ids}).then((res) => { |
| | | this.$Modal.remove(); |
| | | if (res.success) { |
| | | this.$Message.success("删除成功"); |
| | |
| | | this.permModalVisible = false; |
| | | }, |
| | | loadData(item, callback) { |
| | | loadDepartment(item.id, { openDataFilter: false }).then((res) => { |
| | | loadDepartment(item.id, {openDataFilter: false}).then((res) => { |
| | | if (res.success) { |
| | | res.result.forEach(function (e) { |
| | | e.selected = false; |