Commit 9699ea47 by weijiguang

1

parent b2676bd1
...@@ -33,7 +33,7 @@ import { ...@@ -33,7 +33,7 @@ import {
createVehicle, createVehicle,
updateVehicle, updateVehicle,
listContract, listContract,
listLogs, listContractLogs,
signContract, signContract,
updateContract, updateContract,
terminateContract, terminateContract,
...@@ -50,6 +50,7 @@ import { ...@@ -50,6 +50,7 @@ import {
searchPlanning, searchPlanning,
paying, paying,
delay, delay,
listPlanningLogs,
getContract, getContract,
getDriver, getDriver,
getVehicle, getVehicle,
...@@ -176,8 +177,8 @@ export default { ...@@ -176,8 +177,8 @@ export default {
asyncListContract(_, payload) { asyncListContract(_, payload) {
return listContract(payload) return listContract(payload)
}, },
asyncListLogs(_, payload) { asyncListContractLogs(_, payload) {
return listLogs(payload) return listContractLogs(payload)
}, },
asyncSignContract(_, payload) { asyncSignContract(_, payload) {
return signContract(payload) return signContract(payload)
...@@ -203,6 +204,9 @@ export default { ...@@ -203,6 +204,9 @@ export default {
asyncDelay(_, payload) { asyncDelay(_, payload) {
return delay(payload) return delay(payload)
}, },
asyncListPlanningLogs(_, payload) {
return listPlanningLogs(payload)
},
asyncListDriver(_, payload) { asyncListDriver(_, payload) {
return listDriver(payload) return listDriver(payload)
......
...@@ -87,7 +87,7 @@ export const updateVehicle = data => axios.post(`${proxy}/vehicle/update`, data) ...@@ -87,7 +87,7 @@ export const updateVehicle = data => axios.post(`${proxy}/vehicle/update`, data)
// 合同 / 合同 列表 // 合同 / 合同 列表
export const listContract = data => axios.post(`${proxy}/contract/list`, data); export const listContract = data => axios.post(`${proxy}/contract/list`, data);
// 合同 / 日志 列表 // 合同 / 日志 列表
export const listLogs = data => axios.post(`${proxy}/contract/logs/${data}`); export const listContractLogs = data => axios.post(`${proxy}/contract/logs/${data}`);
// 合同 / 车源合同 签订 // 合同 / 车源合同 签订
export const signContract = data => axios.post(`${proxy}/contract/sign`, data); export const signContract = data => axios.post(`${proxy}/contract/sign`, data);
// 合同 / 车源合同 修改 // 合同 / 车源合同 修改
...@@ -99,11 +99,13 @@ export const returnDeposit = data => axios.post(`${proxy}/contract/return/deposi ...@@ -99,11 +99,13 @@ export const returnDeposit = data => axios.post(`${proxy}/contract/return/deposi
// 合同 / 费用计划列表 // 合同 / 费用计划列表
export const listPlanningByContractId = data => axios.post(`${proxy}/planning/list/${data.contractId}/${data.type}`); export const listPlanningByContractId = data => axios.post(`${proxy}/planning/list/${data.contractId}/${data.type}`);
// 应收帐款 / 费用计划列表 // 应收帐款 / 费用计划列表
export const searchPlanning = data => axios.post(`${proxy}/planning/list/`, data); export const searchPlanning = data => axios.post(`${proxy}/planning/list`, data);
// 应收帐款 / 付款 // 应收帐款 / 付款
export const paying = data => axios.post(`${proxy}/planning/paying/`, data); export const paying = data => axios.post(`${proxy}/planning/paying/`, data);
// 应收帐款 / 延期 // 应收帐款 / 延期
export const delay = data => axios.post(`${proxy}/planning/delay/`, data); export const delay = data => axios.post(`${proxy}/planning/delay/`, data);
// 应收帐款 / 付款日志
export const listPlanningLogs = data => axios.post(`${proxy}/planning/list/logs`, data);
// 司机 / 列表 // 司机 / 列表
export const listDriver = data => axios.post(`${proxy}/driver/list`, data); export const listDriver = data => axios.post(`${proxy}/driver/list`, data);
......
...@@ -28,3 +28,10 @@ export const paymentStatusOption = [ ...@@ -28,3 +28,10 @@ export const paymentStatusOption = [
{text: "部分已付", value: 1}, {text: "部分已付", value: 1},
{text: "全部已付", value: 2}, {text: "全部已付", value: 2},
]; ];
// 帐号等级
export const levelOption = [
{text: "普通(5)", value: 1},
{text: "初级(10)", value: 2},
{text: "高级(50)", value: 3},
];
...@@ -130,22 +130,6 @@ export default [ ...@@ -130,22 +130,6 @@ export default [
visable: false, visable: false,
component: () => import("@/view/source_contract/list/index.vue") component: () => import("@/view/source_contract/list/index.vue")
}, },
{
path: '/source_contract/bill_week',
key: 'source_contract_bill_week',
icon: 'logo-xbox',
title: '七日内交租',
visable: false,
component: () => import("@/view/vehicle/list/index.vue")
},
{
path: '/source_contract/bill_month',
key: 'source_contract_bill_month',
icon: 'logo-xbox',
title: '本月交租',
visable: false,
component: () => import("@/view/vehicle/list/index.vue")
},
] ]
}, },
{ {
...@@ -179,7 +163,7 @@ export default [ ...@@ -179,7 +163,7 @@ export default [
title: '合同查询', title: '合同查询',
visable: false, visable: false,
component: () => import("@/view/driver_contract/list/index.vue") component: () => import("@/view/driver_contract/list/index.vue")
}, },
{ {
path: '/driver_contract/receivables', path: '/driver_contract/receivables',
key: 'driver_receivables', key: 'driver_receivables',
...@@ -187,7 +171,15 @@ export default [ ...@@ -187,7 +171,15 @@ export default [
title: '应收帐款', title: '应收帐款',
visable: false, visable: false,
component: () => import("@/view/driver_contract/receivables/index.vue") component: () => import("@/view/driver_contract/receivables/index.vue")
}, },
{
path: '/driver_contract/bill_logs',
key: 'driver_bill_logs',
icon: 'logo-xbox',
title: '帐款日志',
visable: false,
component: () => import("@/view/driver_contract/bill_logs/index.vue")
},
] ]
}, },
] ]
...@@ -7,35 +7,12 @@ export default { ...@@ -7,35 +7,12 @@ export default {
return { return {
visible: false, visible: false,
submitLoading: false, submitLoading: false,
companyAbbr: null,
accountFormRule: { accountFormRule: {
username: [ username: [{ required: true, message: "请输入帐号", trigger: "blur" }],
{ password: [{ required: true, message: "请输入密码", trigger: "blur" }],
required: true, realName: [{ required: true, message: "请输入真实姓名", trigger: "blur" }],
message: "请输入帐号", phone: [{ required: true, message: "请输入联系电话", trigger: "blur" }],
trigger: "blur"
}
],
password: [
{
required: true,
message: "请输入密码",
trigger: "blur"
}
],
realName: [
{
required: true,
message: "请输入真实姓名",
trigger: "blur"
}
],
phone: [
{
required: true,
message: "请输入联系电话",
trigger: "blur"
}
],
}, },
accountForm: { accountForm: {
username: "", username: "",
...@@ -52,6 +29,8 @@ export default { ...@@ -52,6 +29,8 @@ export default {
}, },
watch: { watch: {
visible(show) { visible(show) {
var tokenInfo = JSON.parse(localStorage.getItem("tokenInfo"));
this.companyAbbr = "@" + tokenInfo.abbr;
this.submitLoading = false; this.submitLoading = false;
this.$refs.accountForm.resetFields(); this.$refs.accountForm.resetFields();
}, },
......
...@@ -3,38 +3,40 @@ ...@@ -3,38 +3,40 @@
<Button icon="ios-add" type="primary" @click="visible = true">添加帐号</Button> <Button icon="ios-add" type="primary" @click="visible = true">添加帐号</Button>
<Modal width="400" v-model="visible" title="帐号信息"> <Modal width="400" v-model="visible" title="帐号信息">
<div> <div>
<Form ref="accountForm" :model="accountForm" :rules="accountFormRule" :label-width="60"> <Form ref="accountForm" :model="accountForm" :rules="accountFormRule" :label-width="60" label-colon>
<Row> <Row>
<Col span="24"> <Col span="24">
<FormItem label="帐号:" prop="username"> <FormItem label="帐号" prop="username">
<Input v-model.trim="accountForm.username" type="text" /> <Input v-model.trim="accountForm.username" type="text" placeholder="长度至少4位">
<span slot="append">{{ companyAbbr }}</span>
</Input>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row> <Row>
<Col span="24"> <Col span="24">
<FormItem label="密码:" prop="password"> <FormItem label="密码" prop="password">
<Input v-model.trim="accountForm.password" type="password" /> <Input v-model.trim="accountForm.password" type="password" placeholder="长度至少6位" />
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row> <Row>
<Col span="24"> <Col span="24">
<FormItem label="姓名:" prop="realName"> <FormItem label="姓名" prop="realName">
<Input v-model.trim="accountForm.realName" type="text" /> <Input v-model.trim="accountForm.realName" type="text" />
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row> <Row>
<Col span="24"> <Col span="24">
<FormItem label="电话:" prop="phone"> <FormItem label="电话" prop="phone">
<Input v-model.trim="accountForm.phone" type="text" /> <Input v-model.trim="accountForm.phone" type="text" />
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row> <Row>
<Col span="24"> <Col span="24">
<FormItem label="地址:" prop="address"> <FormItem label="地址" prop="address">
<Input v-model.trim="accountForm.address" type="text" /> <Input v-model.trim="accountForm.address" type="text" />
</FormItem> </FormItem>
</Col> </Col>
......
export const columns = (disable, enable, updatePassword) => [ export const columns = (disable, enable, showUpdatePassword) => [
{ {
title: "帐号", title: "帐号",
key: "username", key: "username",
...@@ -56,17 +56,14 @@ export const columns = (disable, enable, updatePassword) => [ ...@@ -56,17 +56,14 @@ export const columns = (disable, enable, updatePassword) => [
fixed: 'right', fixed: 'right',
width: 180, width: 180,
render(h, { row }) { render(h, { row }) {
const { status } = row; const { type, status } = row;
var emptyTag = h("span"," "); var emptyTag = h("span"," ");
var updatePasswordTag = h( var updatePasswordTag = h(
"Button", "Button",
{ {
props: { type: "primary", size: "small" }, props: { type: "primary", size: "small" },
on: { click: () => { on: { click: () => { showUpdatePassword(row); }}
updatePassword.dataSource = row;
updatePassword.visible = true;
}}
}, },
"修改密码" "修改密码"
); );
...@@ -89,7 +86,11 @@ export const columns = (disable, enable, updatePassword) => [ ...@@ -89,7 +86,11 @@ export const columns = (disable, enable, updatePassword) => [
"启用" "启用"
); );
return h("span", [updatePasswordTag, emptyTag, status == 1 ? disableTag : enableTag]); if(type == 1 ) {
return h("span", [updatePasswordTag]);
} else {
return h("span", [updatePasswordTag, emptyTag, status == 1 ? disableTag : enableTag]);
}
} }
}, },
]; ];
...@@ -2,7 +2,7 @@ import store from "@/store"; ...@@ -2,7 +2,7 @@ import store from "@/store";
const { dispatch } = store; const { dispatch } = store;
import { columns } from "./helper.js"; import { columns } from "./helper.js";
import AddAccount from "./add/index.vue"; import AddAccount from "./add/index.vue";
import UpdatePassword from "./updatePassword/index.vue"; import UpdatePassword from "./update_password/index.vue";
export default { export default {
components: { AddAccount, UpdatePassword }, components: { AddAccount, UpdatePassword },
...@@ -37,9 +37,13 @@ export default { ...@@ -37,9 +37,13 @@ export default {
} }
}); });
}, },
showUpdatePassword(account) {
this.$refs.updatePassword.account = account;
this.$refs.updatePassword.visible = true;
}
}, },
mounted() { mounted() {
this.columns = columns(this.disable, this.enable, this.$refs.updatePassword); this.columns = columns(this.disable, this.enable, this.showUpdatePassword);
this.search(); this.search();
} }
}; };
<template> <template>
<div> <div>
<Card> <Card>
<AddAccount @search="search"/> <AddAccount @search="search" />
<UpdatePassword ref="updatePassword"/> <UpdatePassword ref="updatePassword" />
</Card> </Card>
<Card style="margin-top:10px"> <Card style="margin-top:10px">
<Table <Table
......
...@@ -5,22 +5,18 @@ export default { ...@@ -5,22 +5,18 @@ export default {
components: { }, components: { },
data() { data() {
return { return {
dataSource: null, account: null,
visible: false, visible: false,
submitLoading: false, submitLoading: false,
accountFormRule: { accountFormRule: {
password: [ password: [{ required: true, message: "请输入密码", trigger: "blur" }],
{ passwordAgain: [{ required: true, message: "请输入密码", trigger: "blur" }],
required: true,
message: "请输入密码",
trigger: "blur"
}
],
}, },
accountForm: { accountForm: {
id: 0, id: 0,
username: "", username: "",
password: "", password: "",
passwordAgain: "",
} }
}; };
}, },
...@@ -31,12 +27,16 @@ export default { ...@@ -31,12 +27,16 @@ export default {
this.submitLoading = false; this.submitLoading = false;
this.$refs.accountForm.resetFields(); this.$refs.accountForm.resetFields();
this.accountForm.id = this.dataSource.id; this.accountForm.id = this.account.id;
this.accountForm.username = this.dataSource.username; this.accountForm.username = this.account.username;
}, },
}, },
methods: { methods: {
saveAccount() { saveAccount() {
if(this.accountForm.password != this.accountForm.passwordAgain) {
this.$Message.error("两次密码输入不一致");
return;
}
this.$refs.accountForm.validate(valid => { this.$refs.accountForm.validate(valid => {
if (valid) { if (valid) {
this.submitLoading = true; this.submitLoading = true;
......
...@@ -2,18 +2,23 @@ ...@@ -2,18 +2,23 @@
<div> <div>
<Modal width="400" v-model="visible" title="修改密码"> <Modal width="400" v-model="visible" title="修改密码">
<div> <div>
<Form ref="accountForm" :model="accountForm" :rules="accountFormRule" :label-width="60"> <Form ref="accountForm" :model="accountForm" :rules="accountFormRule" :label-width="80" label-colon>
<Row> <Row>
<Col span="24"> <Col span="24">
<FormItem label="帐号:" prop="username"> <FormItem label="帐号" prop="username">{{ accountForm.username }}</FormItem>
<Input v-model.trim="accountForm.username" type="text" :disabled="true" /> </Col>
</Row>
<Row>
<Col span="24">
<FormItem label="密码" prop="password">
<Input v-model.trim="accountForm.password" type="password" placeholder="新密码,长度至少6位"/>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row> <Row>
<Col span="24"> <Col span="24">
<FormItem label="密码:" prop="password"> <FormItem label="确认密码" prop="passwordAgain">
<Input v-model.trim="accountForm.password" type="password" /> <Input v-model.trim="accountForm.passwordAgain" type="password" placeholder="重新输入密码,长度至少6位"/>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
......
import EditCompany from "./add/index.vue";
import EditExpired from "./expired/index.vue";
export const columns = (search, disable, enable, updateExpired, updateCompany) => [
{
title: "企业名称",
key: "name",
align: "center",
minWidth: 60,
render: (h, { row }) => {
return h(EditCompany, {
props: { dataSource: row },
on: { search }
});
}
},
{
title: "企业简称",
key: "abbr",
align: "center",
minWidth: 60,
},
{
title: "地址",
key: "address",
align: "center",
minWidth: 60,
},
{
title: "联系人",
key: "contactName",
align: "center",
minWidth: 60,
},
{
title: "联系电话",
key: "contactPhone",
align: "center",
minWidth: 60,
},
{
title: "有效期",
key: "expiredDate",
align: "center",
minWidth: 60,
},
{
title: "省",
key: "province",
align: "center",
minWidth: 60,
},
{
title: "市",
key: "city",
align: "center",
minWidth: 60,
},
{
title: "区",
key: "district",
align: "center",
minWidth: 60,
},
{
title: "状态",
align: "center",
minWidth: 60,
render(h, { row }) {
try {
const { status } = row;
return h("span", {style: {color: status == 1 ? 'green' : 'red' }}, status == 1 ? '有效' : '失效');
} catch(e) {
console.log(e);
}
}
},
{
title: "操作",
align: "center",
fixed: 'right',
width: 180,
render(h, { row }) {
try {
const { status } = row;
var emptyTag = h("span"," ");
var disableTag = h(
"Poptip",
{
props: { title: "确定停用当前帐号吗?", transfer: true, confirm: true, size: "small" },
on: { "on-ok": () => { row.status=0; disable(row); } }
},
[
h("Button", {props: {type: "error", size: "small"}}, "停用")
]
);
var enableTag = h(
"Button",
{
props: { type: "primary", size: "small" },
on: { click: () => { row.status=1; enable(row); }}
},
"启用"
);
var updateExpiredTag = h(EditExpired, {
props: { dataSource: row },
on: { search }
});
return h("span", status == 1 ? [updateExpiredTag, emptyTag, disableTag] : [enableTag]);
} catch(e) {
console.log(e);
}
}
},
];
import store from "@/store"; import store from "@/store";
const { dispatch } = store; const { dispatch } = store;
import { Timing } from "@/components/index.js"; import { Timing } from "@/components/index.js";
import moment from "moment"; import {levelOption} from "@/libs/constants.js";
export default { export default {
components: { Timing }, components: { Timing, levelOption },
props: ["dataSource"],
data() { data() {
return { return {
abbrDisabled: false,
visible: false, visible: false,
submitLoading: false, submitLoading: false,
levelOption: levelOption,
saveCompanyRule: { saveCompanyRule: {
name: [ name: [{ required: true, message: "请输入企业名称", trigger: "blur" }],
{ abbr: [{ required: true, message: "请输入企业简称", trigger: "blur" }],
required: true, contactName: [{ required: true, message: "请输入联系人", trigger: "blur" }],
message: "请输入企业名称", contactPhone: [{ required: true, message: "请输入联系电话", trigger: "blur" }],
trigger: "blur" expiredDate: [{ type: "date", required: true, message: "请输入有效期", trigger: "blur" }],
}
],
abbr: [
{
required: true,
message: "请输入企业简称",
trigger: "blur"
}
],
contactName: [
{
required: true,
message: "请输入联系人",
trigger: "blur"
}
],
contactPhone: [
{
required: true,
message: "请输入联系电话",
trigger: "blur"
}
],
// expiredDate: [
// {
// type: "date",
// required: true,
// message: "请输入有效期",
// trigger: "blur"
// }
// ],
}, },
companyForm: { companyForm: {
id: 0, name: null,
name: "", abbr: null,
abbr: "", address: null,
address: "", contactName: null,
contactName: "", contactPhone: null,
contactPhone: "", expiredDate: null,
expiredDate: "" level: 1,
} }
}; };
}, },
...@@ -67,23 +36,8 @@ export default { ...@@ -67,23 +36,8 @@ export default {
watch: { watch: {
visible(show) { visible(show) {
this.submitLoading = false; this.submitLoading = false;
this.$refs.companyForm.resetFields();
if (show) { if (show) {
this.$refs.companyForm.resetFields();
if(this.dataSource) { // 编辑
this.companyForm.id = this.dataSource.id;
this.companyForm.name = this.dataSource.name;
this.companyForm.abbr = this.dataSource.abbr;
this.companyForm.address = this.dataSource.address;
this.companyForm.contactName = this.dataSource.contactName;
this.companyForm.contactPhone = this.dataSource.contactPhone;
this.abbrDisabled = true;
} else { // 添加
this.abbrDisabled = false;
}
} else {
} }
}, },
}, },
...@@ -93,20 +47,18 @@ export default { ...@@ -93,20 +47,18 @@ export default {
if (valid) { if (valid) {
this.submitLoading = true; this.submitLoading = true;
const requestData = { const requestData = {
id: this.companyForm.id,
name: this.companyForm.name, name: this.companyForm.name,
abbr: this.companyForm.abbr, abbr: this.companyForm.abbr,
address: this.companyForm.address, address: this.companyForm.address,
contactName: this.companyForm.contactName, contactName: this.companyForm.contactName,
contactPhone: this.companyForm.contactPhone, contactPhone: this.companyForm.contactPhone,
expiredDate: moment(this.companyForm.expiredDate).valueOf() expiredDate: this.companyForm.expiredDate,
level: this.companyForm.level,
} }
var methodName = this.dataSource ? "invoke/asyncUpdateCompany" : "invoke/asyncCreateCompany"; dispatch("invoke/asyncCreateCompany", requestData).then(({ code }) => {
dispatch(methodName, requestData).then(({ code }) => {
this.submitLoading = false; this.submitLoading = false;
if (code === 1) { if (code === 1) {
this.$Message.success(this.dataSource ? "修改成功" : "添加成功"); this.$Message.success("添加成功");
this.$emit("search"); this.$emit("search");
this.visible = false; this.visible = false;
} }
......
<template> <template>
<div> <div>
<a v-if="dataSource" href="javascript:;" @click="visible = true">{{dataSource.name}}</a> <Button icon="ios-add" type="primary" @click="visible = true">创建企业</Button>
<Button v-else icon="ios-add" type="primary" @click="visible = true">创建企业</Button>
<Modal width="400" v-model="visible" title="企业信息"> <Modal width="400" v-model="visible" title="企业信息">
<div> <div>
<Form ref="companyForm" :model="companyForm" :rules="saveCompanyRule" :label-width="100"> <Form ref="companyForm" :model="companyForm" :rules="saveCompanyRule" :label-width="100" label-colon>
<Row> <Row>
<Col span="24" style="margin-top:-5px"> <Col span="24" style="margin-top:-5px">
<FormItem label="企业名称:" prop="name"> <FormItem label="企业名称" prop="name">
<Input v-model.trim="companyForm.name" type="text" /> <Input v-model.trim="companyForm.name" type="text" />
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row> <Row>
<Col span="24" style="margin-top:-5px"> <Col span="24" style="margin-top:-5px">
<FormItem label="企业简称:" prop="abbr"> <FormItem label="企业简称" prop="abbr">
<Input v-model.trim="companyForm.abbr" type="text" :disabled='abbrDisabled' /> <Input v-model.trim="companyForm.abbr" type="text" />
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row> <Row>
<Col span="24" style="margin-top:-5px"> <Col span="24" style="margin-top:-5px">
<FormItem label="企业地址:" prop="address"> <FormItem label="企业地址" prop="address">
<Input v-model.trim="companyForm.address" type="text" /> <Input v-model.trim="companyForm.address" type="text" />
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row> <Row>
<Col span="24" style="margin-top:-5px"> <Col span="24" style="margin-top:-5px">
<FormItem label="联系人:" prop="contactName"> <FormItem label="联系人" prop="contactName">
<Input v-model.trim="companyForm.contactName" type="text" /> <Input v-model.trim="companyForm.contactName" type="text" />
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row> <Row>
<Col span="24" style="margin-top:-5px"> <Col span="24" style="margin-top:-5px">
<FormItem label="联系电话:" prop="contactPhone"> <FormItem label="联系电话" prop="contactPhone">
<Input v-model.trim="companyForm.contactPhone" type="text" /> <Input v-model.trim="companyForm.contactPhone" type="text" />
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row v-if="!dataSource"> <Row>
<Col span="24" style="margin-top:-5px">
<FormItem label="有效期" prop="expiredDate">
<DatePicker v-model="companyForm.expiredDate" type="date" style="width: 100%" placeholder="请输入有效期"></DatePicker>
</FormItem>
</Col>
</Row>
<Row>
<Col span="24" style="margin-top:-5px"> <Col span="24" style="margin-top:-5px">
<FormItem label="有效期:" prop="expiredDate"> <FormItem label="等级" prop="level">
<DatePicker <Select v-model="companyForm.level">
v-model="companyForm.expiredDate" <Option v-for="item in levelOption" :value="item.value" :key="item.value">{{ item.text }}</Option>
type="date" </Select>
style="width: 100%"
placeholder="请输入有效期"></DatePicker>
<!-- // format="yyyy-MM-dd HH:mm" -->
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
......
import store from "@/store";
const { dispatch } = store;
export default {
components: { },
data() {
return {
visible: false,
submitLoading: false,
company: null,
companyAbbr: null,
accountFormRule: {
username: [{ required: true, message: "请输入帐号", trigger: "blur" }],
password: [{ required: true, message: "请输入密码", trigger: "blur" }],
realName: [{ required: true, message: "请输入真实姓名", trigger: "blur" }],
phone: [{ required: true, message: "请输入联系电话", trigger: "blur" }],
},
accountForm: {
username: "",
password: "",
realName: "",
phone: "",
address: "",
type: 1, // 主帐号
companyId: 0,
}
};
},
computed: {
},
watch: {
visible(show) {
this.accountForm.companyId = this.company.id;
this.companyAbbr = "@" + this.company.abbr;
this.submitLoading = false;
this.$refs.accountForm.resetFields();
},
},
methods: {
saveAccount() {
this.$refs.accountForm.validate(valid => {
if (valid) {
this.submitLoading = true;
dispatch("invoke/asyncCreateAccount", this.accountForm).then(({ code }) => {
this.submitLoading = false;
if (code === 1) {
this.$Message.success("添加成功");
this.$emit("search");
this.visible = false;
}
});
}
});
}
},
mounted() {
}
};
<template>
<div>
<Modal width="400" v-model="visible" title="添加主帐号">
<div>
<Form ref="accountForm" :model="accountForm" :rules="accountFormRule" :label-width="60" label-colon>
<Row>
<Col span="24">
<FormItem label="帐号" prop="username">
<Input v-model.trim="accountForm.username" type="text" placeholder="长度至少4位">
<span slot="append">{{ companyAbbr }}</span>
</Input>
</FormItem>
</Col>
</Row>
<Row>
<Col span="24">
<FormItem label="密码" prop="password">
<Input v-model.trim="accountForm.password" type="password" placeholder="长度至少6位" />
</FormItem>
</Col>
</Row>
<Row>
<Col span="24">
<FormItem label="姓名" prop="realName">
<Input v-model.trim="accountForm.realName" type="text" />
</FormItem>
</Col>
</Row>
<Row>
<Col span="24">
<FormItem label="电话" prop="phone">
<Input v-model.trim="accountForm.phone" type="text" />
</FormItem>
</Col>
</Row>
<Row>
<Col span="24">
<FormItem label="地址" prop="address">
<Input v-model.trim="accountForm.address" type="text" />
</FormItem>
</Col>
</Row>
</Form>
</div>
<div slot="footer">
<Button @click="visible = false">取消</Button>
<Button @click="saveAccount" :loading="submitLoading" type="primary">确定</Button>
</div>
</Modal>
</div>
</template>
<script src="./index.js"/>
import store from "@/store";
const { dispatch } = store;
import { Timing } from "@/components/index.js";
import {levelOption} from "@/libs/constants.js";
export default {
components: { Timing, levelOption },
data() {
return {
visible: false,
submitLoading: false,
company: null,
levelOption: levelOption,
saveCompanyRule: {
name: [{ required: true, message: "请输入企业名称", trigger: "blur" }],
contactName: [{ required: true, message: "请输入联系人", trigger: "blur" }],
contactPhone: [{ required: true, message: "请输入联系电话", trigger: "blur" }],
},
companyForm: {
id: 0,
name: null,
abbr: null,
address: null,
contactName: null,
contactPhone: null,
expiredDate: null,
level: null,
}
};
},
watch: {
visible(show) {
this.submitLoading = false;
if (show) {
this.$refs.companyForm.resetFields();
this.companyForm.id = this.company.id;
this.companyForm.name = this.company.name;
this.companyForm.abbr = this.company.abbr;
this.companyForm.address = this.company.address;
this.companyForm.contactName = this.company.contactName;
this.companyForm.contactPhone = this.company.contactPhone;
this.companyForm.level = this.company.level;
}
},
},
methods: {
saveCompany() {
this.$refs.companyForm.validate(valid => {
if (valid) {
this.submitLoading = true;
const requestData = {
id: this.companyForm.id,
name: this.companyForm.name,
abbr: this.companyForm.abbr,
address: this.companyForm.address,
contactName: this.companyForm.contactName,
contactPhone: this.companyForm.contactPhone,
expiredDate: this.companyForm.expiredDate,
level: this.companyForm.level,
}
dispatch("invoke/asyncUpdateCompany", requestData).then(({ code }) => {
this.submitLoading = false;
if (code === 1) {
this.$Message.success("修改成功");
this.$emit("search");
this.visible = false;
}
});
}
});
}
},
mounted() {
}
};
<template>
<div>
<Modal width="400" v-model="visible" title="企业信息">
<div>
<Form ref="companyForm" :model="companyForm" :rules="saveCompanyRule" :label-width="100" label-colon>
<Row>
<Col span="24" style="margin-top:-5px">
<FormItem label="企业名称" prop="name">
<Input v-model.trim="companyForm.name" type="text" />
</FormItem>
</Col>
</Row>
<Row>
<Col span="24" style="margin-top:-5px">
<FormItem label="企业简称" prop="abbr">
<Input v-model.trim="companyForm.abbr" type="text" disabled />
</FormItem>
</Col>
</Row>
<Row>
<Col span="24" style="margin-top:-5px">
<FormItem label="企业地址" prop="address">
<Input v-model.trim="companyForm.address" type="text" />
</FormItem>
</Col>
</Row>
<Row>
<Col span="24" style="margin-top:-5px">
<FormItem label="联系人" prop="contactName">
<Input v-model.trim="companyForm.contactName" type="text" />
</FormItem>
</Col>
</Row>
<Row>
<Col span="24" style="margin-top:-5px">
<FormItem label="联系电话" prop="contactPhone">
<Input v-model.trim="companyForm.contactPhone" type="text" />
</FormItem>
</Col>
</Row>
<Row>
<Col span="24" style="margin-top:-5px">
<FormItem label="等级" prop="level">
<Select v-model="companyForm.level">
<Option v-for="item in levelOption" :value="item.value" :key="item.value">{{ item.text }}</Option>
</Select>
</FormItem>
</Col>
</Row>
</Form>
</div>
<div slot="footer">
<Button @click="visible = false">取消</Button>
<Button @click="saveCompany" :loading="submitLoading" type="primary">确定</Button>
</div>
</Modal>
</div>
</template>
<script src="./index.js"/>
import store from "@/store"; import store from "@/store";
const { dispatch } = store; const { dispatch } = store;
import { Timing } from "@/components/index.js"; import { Timing } from "@/components/index.js";
import moment from "moment";
export default { export default {
components: { Timing }, components: { Timing },
props: ["dataSource"],
data() { data() {
return { return {
visible: false, visible: false,
submitLoading: false, submitLoading: false,
company: null,
saveCompanyRule: {
expiredDate: [{ type: "date", required: true, message: "请输入有效期", trigger: "blur" }],
},
companyForm: { companyForm: {
id: 0, id: 0,
name: "", name: null,
expiredDate: "" expiredDate: null
} }
}; };
}, },
...@@ -26,39 +29,31 @@ export default { ...@@ -26,39 +29,31 @@ export default {
if (show) { if (show) {
this.$refs.companyForm.resetFields(); this.$refs.companyForm.resetFields();
if(this.dataSource) { // 编辑 this.companyForm.id = this.company.id;
this.companyForm.id = this.dataSource.id; this.companyForm.name = this.company.name;
this.companyForm.name = this.dataSource.name; this.companyForm.expiredDate = this.company.expiredDate;
this.companyForm.expiredDate = this.dataSource.expiredDate;
} else { // 添加
}
} else {
} }
}, },
}, },
methods: { methods: {
updateExpired() { updateExpired() {
if(!this.companyForm.expiredDate) { this.$refs.companyForm.validate(valid => {
this.$Message.error("请选择有效期"); if (valid) {
return; this.submitLoading = true;
} const requestData = {
this.submitLoading = true; id: this.companyForm.id,
const requestData = { expiredDate: this.companyForm.expiredDate
id: this.companyForm.id, }
expiredDate: moment(this.companyForm.expiredDate).valueOf() dispatch("invoke/asyncUpdateCompanyExpired", requestData).then(({ code }) => {
} this.submitLoading = false;
dispatch("invoke/asyncUpdateCompanyExpired", requestData).then(({ code }) => { if (code === 1) {
this.submitLoading = false; this.$Message.success("修改成功");
if (code === 1) { this.$emit("search");
this.$Message.success(this.dataSource ? "修改成功" : "添加成功"); this.visible = false;
this.$emit("search"); }
this.visible = false; });
} }
}); });
},
getExpiredDate(date) {
this.companyForm.expiredDate = date;
} }
}, },
mounted() { mounted() {
......
<template> <template>
<div> <div>
<Button type="primary" @click="visible = true" size="small">延期</Button>
<Modal width="400" v-model="visible" title="修改有效期"> <Modal width="400" v-model="visible" title="修改有效期">
<div> <div>
<Form ref="companyForm" :model="companyForm" :label-width="100"> <Form ref="companyForm" :model="companyForm" :rules="saveCompanyRule" :label-width="100">
<Row> <Row>
<Col span="24" style="margin-top:-5px"> <Col span="24" style="margin-top:-5px">
<FormItem label="企业名称:" prop="name"> <FormItem label="企业名称:" prop="name">
...@@ -14,13 +13,7 @@ ...@@ -14,13 +13,7 @@
<Row> <Row>
<Col span="24" style="margin-top:-5px"> <Col span="24" style="margin-top:-5px">
<FormItem label="有效期:" prop="expiredDate"> <FormItem label="有效期:" prop="expiredDate">
<DatePicker <DatePicker v-model.trim="companyForm.expiredDate" type="date" style="width: 100%" placeholder="请输入有效期"></DatePicker>
:value="companyForm.expiredDate"
ref="expiredDate"
type="date"
style="width: 100%"
placeholder="请输入有效期"
@on-change="getExpiredDate"></DatePicker>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
......
import EditCompany from "./add/index.vue"; import {levelOption} from "@/libs/constants.js";
import EditExpired from "./expired/index.vue";
export const columns = (search, disable, enable, updateExpired, updateCompany) => [ export const columns = (search, disable, enable, showEditExpired, showEdit, showAddAccount, showUpdatePassword) => [
{ {
title: "企业名称", title: "企业名称",
key: "name",
align: "center", align: "center",
minWidth: 60, minWidth: 60,
render: (h, { row }) => { render: (h, { row }) => {
return h(EditCompany, { const { name } = row;
props: { dataSource: row }, return h(
on: { search } "a",
}); { on: { click: () => { showEdit(row); }} },
name
);
}
},
{
title: "主帐号",
align: "center",
minWidth: 80,
render(h, { row }) {
try {
const { account } = row;
if(account) {
return h(
"a",
{ on: { click: () => { showUpdatePassword(account); }} },
account.username
);
} else {
var setMainAccountTag = h(
"Button",
{
props: { type: "primary", size: "small" },
on: { click: () => { showAddAccount(row); }}
},
"设置"
);
return h("span", [setMainAccountTag]);
}
} catch(e) {
console.log(e);
}
} }
}, },
{ {
...@@ -45,22 +74,32 @@ export const columns = (search, disable, enable, updateExpired, updateCompany) = ...@@ -45,22 +74,32 @@ export const columns = (search, disable, enable, updateExpired, updateCompany) =
minWidth: 60, minWidth: 60,
}, },
{ {
title: "等级",
align: "center",
minWidth: 60,
render: (h, { row }) => {
const { level } = row;
const text = levelOption.filter(item => item.value === level)[0].text;
return h("div", text);
}
},
{
title: "省", title: "省",
key: "province", key: "province",
align: "center", align: "center",
minWidth: 60, minWidth: 40,
}, },
{ {
title: "市", title: "市",
key: "city", key: "city",
align: "center", align: "center",
minWidth: 60, minWidth: 40,
}, },
{ {
title: "区", title: "区",
key: "district", key: "district",
align: "center", align: "center",
minWidth: 60, minWidth: 40,
}, },
{ {
title: "状态", title: "状态",
...@@ -103,10 +142,15 @@ export const columns = (search, disable, enable, updateExpired, updateCompany) = ...@@ -103,10 +142,15 @@ export const columns = (search, disable, enable, updateExpired, updateCompany) =
}, },
"启用" "启用"
); );
var updateExpiredTag = h(EditExpired, {
props: { dataSource: row }, var updateExpiredTag = h(
on: { search } "Button",
}); {
props: { type: "primary", size: "small" },
on: { click: () => { showEditExpired(row); }}
},
"有效期"
);
return h("span", status == 1 ? [updateExpiredTag, emptyTag, disableTag] : [enableTag]); return h("span", status == 1 ? [updateExpiredTag, emptyTag, disableTag] : [enableTag]);
} catch(e) { } catch(e) {
......
import store from "@/store"; import store from "@/store";
const { dispatch } = store; const { dispatch } = store;
import { columns } from "./helper.js"; import { columns } from "./helper.js";
import EditCompany from "./add/index.vue"; import AddCompany from "./add/index.vue";
import EditCompany from "./edit/index.vue";
import EditExpired from "./expired/index.vue";
import AddAccount from "./add_account/index.vue";
import UpdatePassword from "../accounts/update_password/index.vue";
export default { export default {
components: { EditCompany }, components: { AddCompany, EditCompany, EditExpired, AddAccount, UpdatePassword },
data() { data() {
return { return {
loading: false, loading: false,
...@@ -69,9 +73,25 @@ export default { ...@@ -69,9 +73,25 @@ export default {
this.page.size = value this.page.size = value
this.search(); this.search();
}, },
showEdit(company) {
this.$refs.editCompany.company = company;
this.$refs.editCompany.visible = true;
},
showEditExpired(company) {
this.$refs.editExpired.company = company;
this.$refs.editExpired.visible = true;
},
showAddAccount(company) {
this.$refs.addAccount.company = company;
this.$refs.addAccount.visible = true;
},
showUpdatePassword(account) {
this.$refs.updatePassword.account = account;
this.$refs.updatePassword.visible = true;
}
}, },
mounted() { mounted() {
this.columns = columns(this.search, this.disable, this.enable, this.updateExpired, this.updateCompany); this.columns = columns(this.search, this.disable, this.enable, this.showEditExpired, this.showEdit, this.showAddAccount, this.showUpdatePassword);
this.search(); this.search();
} }
}; };
...@@ -5,9 +5,13 @@ ...@@ -5,9 +5,13 @@
<Row> <Row>
<Col span="24"> <Col span="24">
企业名称: 企业名称:
<Input v-model="name" placeholder="Enter something..." style="width: 200px; margin-right:10px" /> <Input v-model="name" placeholder="企业名称" style="width: 200px; margin-right:10px" />
<Button @click="() => search()" type="primary"><Icon type="ios-search-outline" /> 查询</Button> <Button @click="() => search()" type="primary"><Icon type="ios-search-outline" /> 查询</Button>
<EditCompany @search="search" style="float:right" /> <AddCompany ref="addCompany" @search="search" style="float:right" />
<EditCompany ref="editCompany" @search="search" style="float:right" />
<EditExpired ref="editExpired" @search="search" style="float:right" />
<AddAccount ref="addAccount" @search="search" style="float:right" />
<UpdatePassword ref="updatePassword" @search="search" style="float:right" />
</Col> </Col>
</Row> </Row>
</Form> </Form>
......
import store from "@/store"; import store from "@/store";
const { dispatch } = store; const { dispatch } = store;
import moment from "moment";
import {levelOption} from "@/libs/constants.js";
export default { export default {
components: { }, components: { },
...@@ -7,16 +9,23 @@ export default { ...@@ -7,16 +9,23 @@ export default {
return { return {
loading: false, loading: false,
company: null, company: null,
level: null,
validText: null,
} }
}, },
methods: { methods: {
setValidText() {
moment.locale();
this.validText = "你的企业帐号有效期至" + moment(this.company.expiredDate).format('YYYY年MM月DD日');
this.level = levelOption.filter(item => item.value === this.company.level)[0].text;
},
getMyCompany() { getMyCompany() {
this.loading = true;
this.loading = true
dispatch("invoke/asyncMyCompany").then(({ data }) => { dispatch("invoke/asyncMyCompany").then(({ data }) => {
this.loading = false this.loading = false
if (data != null) { if (data != null) {
this.company = {...data}; this.company = {...data};
this.setValidText();
} else { } else {
this.company = null; this.company = null;
} }
......
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
<div v-else> <div v-else>
<Form :label-width="100" :label-colon="true" id="fontstyle"> <Form :label-width="100" :label-colon="true" id="fontstyle">
<Row> <Row>
<Col span="24" style="text-align:center; font-size:22px; color:#FF3333">{{ validText }}</Col>
</Row>
<Row>
<Col span="24"> <Col span="24">
<FormItem label="企业ID">{{ company.id }}</FormItem> <FormItem label="企业ID">{{ company.id }}</FormItem>
</Col> </Col>
...@@ -43,6 +46,11 @@ ...@@ -43,6 +46,11 @@
</Row> </Row>
<Row> <Row>
<Col span="24"> <Col span="24">
<FormItem label="等级">{{ level }}</FormItem>
</Col>
</Row>
<Row>
<Col span="24">
<FormItem label="状态">{{ company.status == 1 ? "正常" : "禁用" }}</FormItem> <FormItem label="状态">{{ company.status == 1 ? "正常" : "禁用" }}</FormItem>
</Col> </Col>
</Row> </Row>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<Row> <Row>
<Col span="12"> <Col span="12">
车源名称: 车源名称:
<Input v-model="name" placeholder="Enter something..." style="width: 200px; margin-right:10px" /> <Input v-model="name" placeholder="车源名称" style="width: 200px; margin-right:10px" />
<Button @click="() => search()" type="primary"><Icon type="ios-search-outline" /> 查询</Button> <Button @click="() => search()" type="primary"><Icon type="ios-search-outline" /> 查询</Button>
</Col> </Col>
<Col span="12"> <Col span="12">
......
...@@ -3,25 +3,25 @@ ...@@ -3,25 +3,25 @@
<Card> <Card>
<Form :label-width="80" label-colon> <Form :label-width="80" label-colon>
<Row :gutter="5"> <Row :gutter="5">
<Col span="4"> <Col span="5">
<FormItem label="姓名" > <FormItem label="姓名" >
<Input v-model="name" placeholder="Enter something..." /> <Input v-model="name" placeholder="姓名" />
</FormItem> </FormItem>
</Col> </Col>
<Col span="4"> <Col span="5">
<FormItem label="手机号" > <FormItem label="手机号" >
<Input v-model="phone" placeholder="Enter something..." /> <Input v-model="phone" placeholder="手机号" />
</FormItem> </FormItem>
</Col> </Col>
<Col span="4"> <Col span="5">
<FormItem label="身份证" > <FormItem label="身份证" >
<Input v-model="identityNumber" placeholder="Enter something..." /> <Input v-model="identityNumber" placeholder="身份证" />
</FormItem> </FormItem>
</Col> </Col>
<Col span="4"> <Col span="5">
<Button @click="search()" type="primary"><Icon type="ios-search-outline" /> 查询</Button> <Button @click="search()" type="primary"><Icon type="ios-search-outline" /> 查询</Button>
</Col> </Col>
<Col span="8"> <Col span="4">
<AddDriver ref="addDriver" @search="search" style="float:right" /> <AddDriver ref="addDriver" @search="search" style="float:right" />
<EditDriver ref="editDriver" @search="search" style="float:right" /> <EditDriver ref="editDriver" @search="search" style="float:right" />
</Col> </Col>
......
import { paymentStatusOption } from "@/libs/constants.js";
export const columns = (search, showContract, showDriver, showVehicle, showPaying, showDelay) => [
// {
// title: "id",
// key: "id",
// align: "center",
// width: 60,
// },
{
title: "计划类型",
key: "planName",
align: "center",
minWidth: 80,
},
{
title: "日志类型",
key: "action",
align: "center",
minWidth: 80,
},
{
title: "车牌号",
key: "plateNo",
align: "center",
minWidth: 100,
},
{
title: "品牌/型号",
align: "center",
minWidth: 120,
render(h, { row }) {
try {
const { brandName, model } = row;
return h("span", `${brandName} / ${model}`);
} catch(e) {
console.log(e);
}
}
},
{
title: "司机姓名",
key: "driverName",
align: "center",
minWidth: 100,
},
{
title: "司机手机号",
key: "driverPhone",
align: "center",
minWidth: 100,
},
{
title: "应收金额",
key: "payableAmount",
align: "center",
minWidth: 80,
},
{
title: "实收金额",
key: "amount",
align: "center",
minWidth: 80,
},
{
title: "计划日期",
key: "planDate",
align: "center",
minWidth: 120,
},
{
title: "收款时间",
key: "createTime",
align: "center",
minWidth: 140,
},
{
title: "收款人",
key: "createByName",
align: "center",
minWidth: 120,
},
{
title: "备注",
key: "remark",
align: "center",
width: 200,
},
];
import store from "@/store"; import store from "@/store";
const { dispatch } = store; const { dispatch } = store;
import { columns } from "./helper.js"; import { columns } from "./helper.js";
import EditCompany from "./add/index.vue"; import { Timing } from "@/components/index.js";
import { paymentStatusOption } from "@/libs/constants.js";
export default { export default {
components: { EditCompany }, components: { Timing, paymentStatusOption },
data() { data() {
return { return {
loading: false, loading: false,
loadingVisible: false,
columns: [], columns: [],
name: "", paymentStatusOption: paymentStatusOption,
changeCurrent: 1, changeCurrent: 1,
searchForm: {
contractType: 2,
type: null,
operationType: null,
driverInfo: null,
vehicleInfo: null,
planDate: null,
planDateStart: null,
planDateEnd: null,
createDate: null,
createDateStart: null,
createDateEnd: null,
},
data: { data: {
total:0, total:0,
current: 1, current: 1,
records:[], records:[],
}, },
page: { page: {
size: 10, size: 50,
}, },
} }
}, },
watch: {
},
methods: { methods: {
disable(company) {
dispatch("invoke/asyncUpdateCompanyStatus", company);
},
enable(company) {
dispatch("invoke/asyncUpdateCompanyStatus", company);
},
updateExpired(company) {
dispatch("invoke/asyncUpdateCompanyExpired", company);
},
updateCompany(company) {
dispatch("invoke/asyncUpdateCompany", company);
},
search(current = 1) { search(current = 1) {
this.searchForm = { this.loading = true;
name: this.name if(this.searchForm.planDate != null) {
}; this.searchForm.planDateStart = this.searchForm.planDate[0];
this.searchForm.planDateEnd = this.searchForm.planDate[1];
this.loading = true }
const initQuery = { if(this.searchForm.createDate != null) {
this.searchForm.createDateStart = this.searchForm.createDate[0];
this.searchForm.createDateEnd = this.searchForm.createDate[1];
}
dispatch("invoke/asyncListPlanningLogs", {
current, current,
size: this.page.size, size: this.page.size,
records: this.searchForm records: this.searchForm
};
dispatch("invoke/asyncListCompany", {
...initQuery
}).then(({ data }) => { }).then(({ data }) => {
this.loading = false this.loading = false
if (data != null) { if (data != null) {
...@@ -71,7 +77,7 @@ export default { ...@@ -71,7 +77,7 @@ export default {
}, },
}, },
mounted() { mounted() {
this.columns = columns(this.search, this.disable, this.enable, this.updateExpired, this.updateCompany); this.columns = columns();
this.search(); this.search();
} }
}; };
<template> <template>
<div> <div>
<Card> <Card>
<Form :label-width="100"> <Form :label-width="80" label-colon>
<Row> <Row :gutter="5">
<Col span="24"> <Col span="6">
企业名称: <FormItem label="计划日期" >
<Input v-model="name" placeholder="Enter something..." style="width: 200px; margin-right:10px" /> <Timing v-model="searchForm.planDate" data-type="date" :intervalWidth="5" />
<Button @click="() => search()" type="primary"><Icon type="ios-search-outline" /> 查询</Button> </FormItem>
<EditCompany class="searchBtn" @search="search" style="float:right" /> </Col>
</Col> <Col span="6">
<FormItem label="付款日期" >
<Timing v-model="searchForm.createDate" data-type="date" :intervalWidth="5" />
</FormItem>
</Col>
<Col span="6">
<FormItem label="日志类型" >
<Select v-model.trim="searchForm.operationType" filterable clearable>
<Option :value="1" :key="1">付款</Option>
<Option :value="2" :key="2">延期</Option>
</Select>
</FormItem>
</Col>
</Row>
<Row :gutter="5">
<Col span="6">
<FormItem label="司机信息" >
<Input v-model="searchForm.driverInfo" placeholder="姓名/手机号/身份证" clearable/>
</FormItem>
</Col>
<Col span="6">
<FormItem label="车辆信息" >
<Input v-model="searchForm.vehicleInfo" placeholder="车牌号/品牌" clearable/>
</FormItem>
</Col>
<Col span="6">
<Button @click="search()" type="primary"><Icon type="ios-search-outline" /> 查询</Button>
</Col>
</Row> </Row>
</Form> </Form>
</Card> </Card>
<Card style="margin-top:10px"> <Card style="margin-top:10px">
<Table <Table border :loading="loading" :columns="columns" :data="data.records"/>
border
:loading="loading"
:columns="columns"
:data="data.records"/>
<Page <Page
style="margin-top:10px" style="margin-top:10px"
:total="Number(data.total)" :total="Number(data.total)"
...@@ -26,6 +49,7 @@ ...@@ -26,6 +49,7 @@
@on-page-size-change="changeSize" @on-page-size-change="changeSize"
:placement="'top'" :placement="'top'"
:page-size-opts="[10, 30, 50, 100]" :page-size-opts="[10, 30, 50, 100]"
:page-size="page.size"
show-sizer show-sizer
show-elevator show-elevator
show-total></Page> show-total></Page>
...@@ -36,9 +60,6 @@ ...@@ -36,9 +60,6 @@
<script src="./index.js"></script> <script src="./index.js"></script>
<style> <style>
.newTableClass {
overflow: visible;
}
.ivu-table-cell { .ivu-table-cell {
padding-left: 0; padding-left: 0;
padding-right: 0; padding-right: 0;
......
...@@ -11,6 +11,8 @@ export default { ...@@ -11,6 +11,8 @@ export default {
logDatas: [], logDatas: [],
logColumns: [], logColumns: [],
leaseTypeOption: leaseTypeOption, leaseTypeOption: leaseTypeOption,
imageVisible: false,
imageUrl: null,
rentLoading: false, rentLoading: false,
rentDatas: [], rentDatas: [],
...@@ -95,7 +97,7 @@ export default { ...@@ -95,7 +97,7 @@ export default {
}) })
} }
this.listLogs(); this.listContractLogs();
this.listRentPlanning(); this.listRentPlanning();
this.listFeePlanning(); this.listFeePlanning();
} else { } else {
...@@ -108,6 +110,10 @@ export default { ...@@ -108,6 +110,10 @@ export default {
}, },
}, },
methods: { methods: {
handleView (item) {
this.imageUrl = item.url;
this.imageVisible = true;
},
listVehicles() { listVehicles() {
dispatch("invoke/asyncListNoSourceContractVehicles").then(({ data }) => { dispatch("invoke/asyncListNoSourceContractVehicles").then(({ data }) => {
this.vehicles = data; this.vehicles = data;
...@@ -118,10 +124,10 @@ export default { ...@@ -118,10 +124,10 @@ export default {
this.sources = data; this.sources = data;
}); });
}, },
listLogs() { listContractLogs() {
this.logLoading = true; this.logLoading = true;
const contractId = this.contract.id; const contractId = this.contract.id;
dispatch("invoke/asyncListLogs", contractId).then(({ data }) => { dispatch("invoke/asyncListContractLogs", contractId).then(({ data }) => {
this.logLoading = false; this.logLoading = false;
this.logDatas = data; this.logDatas = data;
}); });
......
...@@ -66,6 +66,9 @@ ...@@ -66,6 +66,9 @@
<template v-else><Spin size="small" fix ></Spin></template> <template v-else><Spin size="small" fix ></Spin></template>
</div> </div>
</FormItem> </FormItem>
<Modal v-model="imageVisible">
<img :src="imageUrl" v-if="imageVisible" style="width: 100%">
</Modal>
</Col> </Col>
</Row> </Row>
</Form> </Form>
......
...@@ -193,7 +193,7 @@ export const columns = (search, showContract, showVehicle, showReturnDeposit, sh ...@@ -193,7 +193,7 @@ export const columns = (search, showContract, showVehicle, showReturnDeposit, sh
const params = { const params = {
edit: status == 1 ? true : false, edit: status == 1 ? true : false,
terminate: status == 1 ? true : false, terminate: status == 1 ? true : false,
returnDeposit: depositStatus == 2 || status == 1 ? false : true, returnDeposit: depositStatus == 1 || status == 1 ? false : true,
}; };
return h(Actions, { return h(Actions, {
......
...@@ -27,9 +27,12 @@ export default { ...@@ -27,9 +27,12 @@ export default {
}, },
}; };
}, },
computed: {
},
watch: { watch: {
// "payingForm.amount"() {
// if(this.payingForm.amount > this.payingForm.diffAmount) {
// this.setAll();
// }
// },
visible(show) { visible(show) {
this.submitLoading = false; this.submitLoading = false;
this.$refs.payingForm.resetFields(); this.$refs.payingForm.resetFields();
...@@ -61,6 +64,11 @@ export default { ...@@ -61,6 +64,11 @@ export default {
this.payingForm.amount = "" + this.payingForm.diffAmount; this.payingForm.amount = "" + this.payingForm.diffAmount;
}, },
saveReturnDeposit() { saveReturnDeposit() {
if(this.payingForm.amount > this.payingForm.diffAmount) {
this.$Message.error("收款金额不能超过欠收金额,已修改为:" + this.payingForm.diffAmount);
this.setAll();
return;
}
this.$refs.payingForm.validate(valid => { this.$refs.payingForm.validate(valid => {
if (valid) { if (valid) {
const requestData = { const requestData = {
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
<Row :gutter="10"> <Row :gutter="10">
<Col span="20"> <Col span="20">
<FormItem label="本次缴款金额" prop="amount"> <FormItem label="本次缴款金额" prop="amount">
<!-- v-model.trim="payingForm.amount" -->
<Input v-model.trim="payingForm.amount" type="number" /> <Input v-model.trim="payingForm.amount" type="number" />
</FormItem> </FormItem>
</Col> </Col>
......
...@@ -14,6 +14,9 @@ export default { ...@@ -14,6 +14,9 @@ export default {
submitLoading: false, submitLoading: false,
feeColumns: [], feeColumns: [],
leaseTypeOption: leaseTypeOption, leaseTypeOption: leaseTypeOption,
imageVisible: false,
imageUrl: null,
contractFormRule: { contractFormRule: {
vehicleId: [{ type: "number", required: true, message: "请选择车辆", trigger: "change" }], vehicleId: [{ type: "number", required: true, message: "请选择车辆", trigger: "change" }],
driverId: [{ type: "number", required: true, message: "请选择司机", trigger: "change" }], driverId: [{ type: "number", required: true, message: "请选择司机", trigger: "change" }],
...@@ -79,6 +82,7 @@ export default { ...@@ -79,6 +82,7 @@ export default {
if(show) { if(show) {
this.contractForm.files = []; this.contractForm.files = [];
this.contractForm.fees = []; this.contractForm.fees = [];
this.uploadList = [];
this.listVehicles(); this.listVehicles();
this.listDrivers(); this.listDrivers();
this.listEnableFees(); this.listEnableFees();
...@@ -91,7 +95,9 @@ export default { ...@@ -91,7 +95,9 @@ export default {
} }
}, },
methods: { methods: {
handleView(item) { handleView (item) {
this.imageUrl = item.url;
this.imageVisible = true;
}, },
handleRemove(file) { handleRemove(file) {
this.uploadList.splice(this.uploadList.indexOf(file), 1); this.uploadList.splice(this.uploadList.indexOf(file), 1);
......
...@@ -131,6 +131,9 @@ ...@@ -131,6 +131,9 @@
</div> </div>
</Upload> </Upload>
</FormItem> </FormItem>
<Modal v-model="imageVisible">
<img :src="imageUrl" v-if="imageVisible" style="width: 100%">
</Modal>
</Col> </Col>
</Row> </Row>
</Form> </Form>
......
import store from "@/store";
const { dispatch } = store;
import UpdatePassword from "@/view/company/accounts/update_password/index.vue";
export default {
components: { UpdatePassword },
data() {
return {
username: null,
avatarText: null,
}
},
methods: {
setUsername() {
var tokenInfo = JSON.parse(localStorage.getItem("tokenInfo"));
if(!tokenInfo) {
this.quit();
return;
}
this.username = tokenInfo.realName;
this.avatarText = tokenInfo.realName.substr(0,1);
},
onClick(name) {
if(name == "updatePassword") {
this.showUpdatePassword();
} else if(name == "quit") {
this.quit();
}
},
quit() {
localStorage.removeItem("tokenInfo");
this.$router.push({ path: "/" });
},
showUpdatePassword() {
var tokenInfo = JSON.parse(localStorage.getItem("tokenInfo"));
this.$refs.updatePassword.account = tokenInfo;
this.$refs.updatePassword.visible = true;
}
},
mounted() {
this.setUsername();
}
};
\ No newline at end of file
<template>
<Dropdown transfer @on-click="onClick" trigger="hover">
<div>
<Avatar>{{avatarText}}</Avatar>
<div style="color: white; float:right; margin-left:10px">
{{username}}
<Icon type="md-arrow-dropdown" />
</div>
</div>
<UpdatePassword ref="updatePassword" />
<DropdownMenu slot="list">
<DropdownItem name="updatePassword" ><Icon type="md-create" /> 修改密码</DropdownItem>
<DropdownItem divided name="quit"><Icon type="ios-exit" /> 退出登录</DropdownItem>
</DropdownMenu>
</Dropdown>
</template>
<script src="./index.js"></script>
...@@ -2,8 +2,10 @@ import store from "@/store"; ...@@ -2,8 +2,10 @@ import store from "@/store";
import routers from "@/router/routers.js"; import routers from "@/router/routers.js";
import "./main.less"; import "./main.less";
const { dispatch } = store; const { dispatch } = store;
import AvatarView from "./avatar/index.vue";
export default { export default {
components: { }, components: { AvatarView },
data() { data() {
return { return {
maps:[], maps:[],
...@@ -21,11 +23,17 @@ export default { ...@@ -21,11 +23,17 @@ export default {
var menusJson = JSON.parse(tokenInfo.menus); var menusJson = JSON.parse(tokenInfo.menus);
menusJson.forEach(item => { menusJson.forEach(item => {
var menu = this.getMenuFromRouter(item.key); var menu = this.getMenuFromRouter(item.key);
if(!menu) {
return;
}
menu.visable = true; menu.visable = true;
if(item.children) { if(item.children) {
item.children.forEach(childItem => { item.children.forEach(childItem => {
var childMenu = this.getMenuFromRouter(childItem.key); var childMenu = this.getMenuFromRouter(childItem.key);
if(!childMenu) {
return;
}
childMenu.visable = true; childMenu.visable = true;
}) })
} }
......
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
<MenuItem name="2"><Icon type="ios-navigate"></Icon>Item 2</MenuItem> <MenuItem name="2"><Icon type="ios-navigate"></Icon>Item 2</MenuItem>
<MenuItem name="3"><Icon type="ios-navigate"></Icon>Item 3</MenuItem> <MenuItem name="3"><Icon type="ios-navigate"></Icon>Item 3</MenuItem>
</div> </div>
<div class="layout-avatar">
<AvatarView></AvatarView>
</div>
</Menu> </Menu>
</Header> </Header>
<Layout style="position:absolute; top:64px; bottom:0px; left:0px; right:0px;"> <Layout style="position:absolute; top:64px; bottom:0px; left:0px; right:0px;">
...@@ -54,16 +57,21 @@ ...@@ -54,16 +57,21 @@
.layout-logo{ .layout-logo{
width: 100px; width: 100px;
height: 30px; height: 30px;
background: #5b6270; background: #990000;
border-radius: 3px; border-radius: 3px;
float: left; float: left;
position: relative; position: relative;
top: 15px; top: 15px;
left: 20px;
} }
.layout-nav{ .layout-nav {
width: 420px; // width: 420px;
margin: 0 auto; // margin: 0 auto;
margin-right: 20px; padding-left: 100px;
}
.layout-avatar {
// width: 420px;
// margin: 0 auto;
// margin-right: 20px;
float: right;
} }
</style> </style>
...@@ -88,7 +88,7 @@ export default { ...@@ -88,7 +88,7 @@ export default {
}) })
} }
this.listLogs(); this.listContractLogs();
this.listRentPlanning(); this.listRentPlanning();
} else { } else {
this.logDatas = []; this.logDatas = [];
...@@ -108,9 +108,9 @@ export default { ...@@ -108,9 +108,9 @@ export default {
this.sources = data; this.sources = data;
}); });
}, },
listLogs() { listContractLogs() {
const contractId = this.contract.id; const contractId = this.contract.id;
dispatch("invoke/asyncListLogs", contractId).then(({ data }) => { dispatch("invoke/asyncListContractLogs", contractId).then(({ data }) => {
this.logDatas = data; this.logDatas = data;
}); });
}, },
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<Row :gutter="5"> <Row :gutter="5">
<Col span="5"> <Col span="5">
<FormItem label="车牌号码" > <FormItem label="车牌号码" >
<Input v-model="plateNo" placeholder="Enter something..." /> <Input v-model="plateNo" placeholder="车牌号码" />
</FormItem> </FormItem>
</Col> </Col>
<Col span="5"> <Col span="5">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment