Commit 9699ea47 by weijiguang

1

parent b2676bd1
......@@ -33,7 +33,7 @@ import {
createVehicle,
updateVehicle,
listContract,
listLogs,
listContractLogs,
signContract,
updateContract,
terminateContract,
......@@ -50,6 +50,7 @@ import {
searchPlanning,
paying,
delay,
listPlanningLogs,
getContract,
getDriver,
getVehicle,
......@@ -176,8 +177,8 @@ export default {
asyncListContract(_, payload) {
return listContract(payload)
},
asyncListLogs(_, payload) {
return listLogs(payload)
asyncListContractLogs(_, payload) {
return listContractLogs(payload)
},
asyncSignContract(_, payload) {
return signContract(payload)
......@@ -203,6 +204,9 @@ export default {
asyncDelay(_, payload) {
return delay(payload)
},
asyncListPlanningLogs(_, payload) {
return listPlanningLogs(payload)
},
asyncListDriver(_, payload) {
return listDriver(payload)
......
......@@ -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 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);
// 合同 / 车源合同 修改
......@@ -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 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 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);
......
......@@ -28,3 +28,10 @@ export const paymentStatusOption = [
{text: "部分已付", value: 1},
{text: "全部已付", value: 2},
];
// 帐号等级
export const levelOption = [
{text: "普通(5)", value: 1},
{text: "初级(10)", value: 2},
{text: "高级(50)", value: 3},
];
......@@ -130,22 +130,6 @@ export default [
visable: false,
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")
},
]
},
{
......@@ -188,6 +172,14 @@ export default [
visable: false,
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 {
return {
visible: false,
submitLoading: false,
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"
}
],
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: "",
......@@ -52,6 +29,8 @@ export default {
},
watch: {
visible(show) {
var tokenInfo = JSON.parse(localStorage.getItem("tokenInfo"));
this.companyAbbr = "@" + tokenInfo.abbr;
this.submitLoading = false;
this.$refs.accountForm.resetFields();
},
......
......@@ -3,38 +3,40 @@
<Button icon="ios-add" type="primary" @click="visible = true">添加帐号</Button>
<Modal width="400" v-model="visible" title="帐号信息">
<div>
<Form ref="accountForm" :model="accountForm" :rules="accountFormRule" :label-width="60">
<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" />
<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" />
<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">
<FormItem label="姓名" prop="realName">
<Input v-model.trim="accountForm.realName" type="text" />
</FormItem>
</Col>
</Row>
<Row>
<Col span="24">
<FormItem label="电话:" prop="phone">
<FormItem label="电话" prop="phone">
<Input v-model.trim="accountForm.phone" type="text" />
</FormItem>
</Col>
</Row>
<Row>
<Col span="24">
<FormItem label="地址:" prop="address">
<FormItem label="地址" prop="address">
<Input v-model.trim="accountForm.address" type="text" />
</FormItem>
</Col>
......
export const columns = (disable, enable, updatePassword) => [
export const columns = (disable, enable, showUpdatePassword) => [
{
title: "帐号",
key: "username",
......@@ -56,17 +56,14 @@ export const columns = (disable, enable, updatePassword) => [
fixed: 'right',
width: 180,
render(h, { row }) {
const { status } = row;
const { type, status } = row;
var emptyTag = h("span"," ");
var updatePasswordTag = h(
"Button",
{
props: { type: "primary", size: "small" },
on: { click: () => {
updatePassword.dataSource = row;
updatePassword.visible = true;
}}
on: { click: () => { showUpdatePassword(row); }}
},
"修改密码"
);
......@@ -89,7 +86,11 @@ export const columns = (disable, enable, updatePassword) => [
"启用"
);
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";
const { dispatch } = store;
import { columns } from "./helper.js";
import AddAccount from "./add/index.vue";
import UpdatePassword from "./updatePassword/index.vue";
import UpdatePassword from "./update_password/index.vue";
export default {
components: { AddAccount, UpdatePassword },
......@@ -37,9 +37,13 @@ export default {
}
});
},
showUpdatePassword(account) {
this.$refs.updatePassword.account = account;
this.$refs.updatePassword.visible = true;
}
},
mounted() {
this.columns = columns(this.disable, this.enable, this.$refs.updatePassword);
this.columns = columns(this.disable, this.enable, this.showUpdatePassword);
this.search();
}
};
<template>
<div>
<Card>
<AddAccount @search="search"/>
<UpdatePassword ref="updatePassword"/>
<AddAccount @search="search" />
<UpdatePassword ref="updatePassword" />
</Card>
<Card style="margin-top:10px">
<Table
......
......@@ -5,22 +5,18 @@ export default {
components: { },
data() {
return {
dataSource: null,
account: null,
visible: false,
submitLoading: false,
accountFormRule: {
password: [
{
required: true,
message: "请输入密码",
trigger: "blur"
}
],
password: [{ required: true, message: "请输入密码", trigger: "blur" }],
passwordAgain: [{ required: true, message: "请输入密码", trigger: "blur" }],
},
accountForm: {
id: 0,
username: "",
password: "",
passwordAgain: "",
}
};
},
......@@ -31,12 +27,16 @@ export default {
this.submitLoading = false;
this.$refs.accountForm.resetFields();
this.accountForm.id = this.dataSource.id;
this.accountForm.username = this.dataSource.username;
this.accountForm.id = this.account.id;
this.accountForm.username = this.account.username;
},
},
methods: {
saveAccount() {
if(this.accountForm.password != this.accountForm.passwordAgain) {
this.$Message.error("两次密码输入不一致");
return;
}
this.$refs.accountForm.validate(valid => {
if (valid) {
this.submitLoading = true;
......
......@@ -2,18 +2,23 @@
<div>
<Modal width="400" v-model="visible" title="修改密码">
<div>
<Form ref="accountForm" :model="accountForm" :rules="accountFormRule" :label-width="60">
<Form ref="accountForm" :model="accountForm" :rules="accountFormRule" :label-width="80" label-colon>
<Row>
<Col span="24">
<FormItem label="帐号:" prop="username">
<Input v-model.trim="accountForm.username" type="text" :disabled="true" />
<FormItem label="帐号" prop="username">{{ accountForm.username }}</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="password">
<Input v-model.trim="accountForm.password" type="password" />
<FormItem label="确认密码" prop="passwordAgain">
<Input v-model.trim="accountForm.passwordAgain" type="password" placeholder="重新输入密码,长度至少6位"/>
</FormItem>
</Col>
</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";
const { dispatch } = store;
import { Timing } from "@/components/index.js";
import moment from "moment";
import {levelOption} from "@/libs/constants.js";
export default {
components: { Timing },
props: ["dataSource"],
components: { Timing, levelOption },
data() {
return {
abbrDisabled: false,
visible: false,
submitLoading: false,
levelOption: levelOption,
saveCompanyRule: {
name: [
{
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"
// }
// ],
name: [{ 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: {
id: 0,
name: "",
abbr: "",
address: "",
contactName: "",
contactPhone: "",
expiredDate: ""
name: null,
abbr: null,
address: null,
contactName: null,
contactPhone: null,
expiredDate: null,
level: 1,
}
};
},
......@@ -67,23 +36,8 @@ export default {
watch: {
visible(show) {
this.submitLoading = false;
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 {
if (show) {
}
},
},
......@@ -93,20 +47,18 @@ export default {
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: moment(this.companyForm.expiredDate).valueOf()
expiredDate: this.companyForm.expiredDate,
level: this.companyForm.level,
}
var methodName = this.dataSource ? "invoke/asyncUpdateCompany" : "invoke/asyncCreateCompany";
dispatch(methodName, requestData).then(({ code }) => {
dispatch("invoke/asyncCreateCompany", requestData).then(({ code }) => {
this.submitLoading = false;
if (code === 1) {
this.$Message.success(this.dataSource ? "修改成功" : "添加成功");
this.$Message.success("添加成功");
this.$emit("search");
this.visible = false;
}
......
<template>
<div>
<a v-if="dataSource" href="javascript:;" @click="visible = true">{{dataSource.name}}</a>
<Button v-else 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="企业信息">
<div>
<Form ref="companyForm" :model="companyForm" :rules="saveCompanyRule" :label-width="100">
<Form ref="companyForm" :model="companyForm" :rules="saveCompanyRule" :label-width="100" label-colon>
<Row>
<Col span="24" style="margin-top:-5px">
<FormItem label="企业名称:" prop="name">
<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='abbrDisabled' />
<FormItem label="企业简称" prop="abbr">
<Input v-model.trim="companyForm.abbr" type="text" />
</FormItem>
</Col>
</Row>
<Row>
<Col span="24" style="margin-top:-5px">
<FormItem label="企业地址:" prop="address">
<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">
<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">
<FormItem label="联系电话" prop="contactPhone">
<Input v-model.trim="companyForm.contactPhone" type="text" />
</FormItem>
</Col>
</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">
<FormItem label="有效期:" prop="expiredDate">
<DatePicker
v-model="companyForm.expiredDate"
type="date"
style="width: 100%"
placeholder="请输入有效期"></DatePicker>
<!-- // format="yyyy-MM-dd HH:mm" -->
<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>
......
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";
const { dispatch } = store;
import { Timing } from "@/components/index.js";
import moment from "moment";
export default {
components: { Timing },
props: ["dataSource"],
data() {
return {
visible: false,
submitLoading: false,
company: null,
saveCompanyRule: {
expiredDate: [{ type: "date", required: true, message: "请输入有效期", trigger: "blur" }],
},
companyForm: {
id: 0,
name: "",
expiredDate: ""
name: null,
expiredDate: null
}
};
},
......@@ -26,39 +29,31 @@ export default {
if (show) {
this.$refs.companyForm.resetFields();
if(this.dataSource) { // 编辑
this.companyForm.id = this.dataSource.id;
this.companyForm.name = this.dataSource.name;
this.companyForm.expiredDate = this.dataSource.expiredDate;
} else { // 添加
}
} else {
this.companyForm.id = this.company.id;
this.companyForm.name = this.company.name;
this.companyForm.expiredDate = this.company.expiredDate;
}
},
},
methods: {
updateExpired() {
if(!this.companyForm.expiredDate) {
this.$Message.error("请选择有效期");
return;
}
this.$refs.companyForm.validate(valid => {
if (valid) {
this.submitLoading = true;
const requestData = {
id: this.companyForm.id,
expiredDate: moment(this.companyForm.expiredDate).valueOf()
expiredDate: this.companyForm.expiredDate
}
dispatch("invoke/asyncUpdateCompanyExpired", requestData).then(({ code }) => {
this.submitLoading = false;
if (code === 1) {
this.$Message.success(this.dataSource ? "修改成功" : "添加成功");
this.$Message.success("修改成功");
this.$emit("search");
this.visible = false;
}
});
},
getExpiredDate(date) {
this.companyForm.expiredDate = date;
}
});
}
},
mounted() {
......
<template>
<div>
<Button type="primary" @click="visible = true" size="small">延期</Button>
<Modal width="400" v-model="visible" title="修改有效期">
<div>
<Form ref="companyForm" :model="companyForm" :label-width="100">
<Form ref="companyForm" :model="companyForm" :rules="saveCompanyRule" :label-width="100">
<Row>
<Col span="24" style="margin-top:-5px">
<FormItem label="企业名称:" prop="name">
......@@ -14,13 +13,7 @@
<Row>
<Col span="24" style="margin-top:-5px">
<FormItem label="有效期:" prop="expiredDate">
<DatePicker
:value="companyForm.expiredDate"
ref="expiredDate"
type="date"
style="width: 100%"
placeholder="请输入有效期"
@on-change="getExpiredDate"></DatePicker>
<DatePicker v-model.trim="companyForm.expiredDate" type="date" style="width: 100%" placeholder="请输入有效期"></DatePicker>
</FormItem>
</Col>
</Row>
......
import EditCompany from "./add/index.vue";
import EditExpired from "./expired/index.vue";
import {levelOption} from "@/libs/constants.js";
export const columns = (search, disable, enable, updateExpired, updateCompany) => [
export const columns = (search, disable, enable, showEditExpired, showEdit, showAddAccount, showUpdatePassword) => [
{
title: "企业名称",
key: "name",
align: "center",
minWidth: 60,
render: (h, { row }) => {
return h(EditCompany, {
props: { dataSource: row },
on: { search }
});
const { name } = row;
return h(
"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) =
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: "省",
key: "province",
align: "center",
minWidth: 60,
minWidth: 40,
},
{
title: "市",
key: "city",
align: "center",
minWidth: 60,
minWidth: 40,
},
{
title: "区",
key: "district",
align: "center",
minWidth: 60,
minWidth: 40,
},
{
title: "状态",
......@@ -103,10 +142,15 @@ export const columns = (search, disable, enable, updateExpired, updateCompany) =
},
"启用"
);
var updateExpiredTag = h(EditExpired, {
props: { dataSource: row },
on: { search }
});
var updateExpiredTag = h(
"Button",
{
props: { type: "primary", size: "small" },
on: { click: () => { showEditExpired(row); }}
},
"有效期"
);
return h("span", status == 1 ? [updateExpiredTag, emptyTag, disableTag] : [enableTag]);
} catch(e) {
......
import store from "@/store";
const { dispatch } = store;
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 {
components: { EditCompany },
components: { AddCompany, EditCompany, EditExpired, AddAccount, UpdatePassword },
data() {
return {
loading: false,
......@@ -69,9 +73,25 @@ export default {
this.page.size = value
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() {
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();
}
};
......@@ -5,9 +5,13 @@
<Row>
<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>
<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>
</Row>
</Form>
......
import store from "@/store";
const { dispatch } = store;
import moment from "moment";
import {levelOption} from "@/libs/constants.js";
export default {
components: { },
......@@ -7,16 +9,23 @@ export default {
return {
loading: false,
company: null,
level: null,
validText: null,
}
},
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() {
this.loading = true
this.loading = true;
dispatch("invoke/asyncMyCompany").then(({ data }) => {
this.loading = false
if (data != null) {
this.company = {...data};
this.setValidText();
} else {
this.company = null;
}
......
......@@ -7,6 +7,9 @@
<div v-else>
<Form :label-width="100" :label-colon="true" id="fontstyle">
<Row>
<Col span="24" style="text-align:center; font-size:22px; color:#FF3333">{{ validText }}</Col>
</Row>
<Row>
<Col span="24">
<FormItem label="企业ID">{{ company.id }}</FormItem>
</Col>
......@@ -43,6 +46,11 @@
</Row>
<Row>
<Col span="24">
<FormItem label="等级">{{ level }}</FormItem>
</Col>
</Row>
<Row>
<Col span="24">
<FormItem label="状态">{{ company.status == 1 ? "正常" : "禁用" }}</FormItem>
</Col>
</Row>
......
......@@ -5,7 +5,7 @@
<Row>
<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>
</Col>
<Col span="12">
......
......@@ -3,25 +3,25 @@
<Card>
<Form :label-width="80" label-colon>
<Row :gutter="5">
<Col span="4">
<Col span="5">
<FormItem label="姓名" >
<Input v-model="name" placeholder="Enter something..." />
<Input v-model="name" placeholder="姓名" />
</FormItem>
</Col>
<Col span="4">
<Col span="5">
<FormItem label="手机号" >
<Input v-model="phone" placeholder="Enter something..." />
<Input v-model="phone" placeholder="手机号" />
</FormItem>
</Col>
<Col span="4">
<FormItem label="身份证" >
<Input v-model="identityNumber" placeholder="Enter something..." />
<Col span="5">
<FormItem label="身份证" >
<Input v-model="identityNumber" placeholder="身份证" />
</FormItem>
</Col>
<Col span="4">
<Col span="5">
<Button @click="search()" type="primary"><Icon type="ios-search-outline" /> 查询</Button>
</Col>
<Col span="8">
<Col span="4">
<AddDriver ref="addDriver" @search="search" style="float:right" />
<EditDriver ref="editDriver" @search="search" style="float:right" />
</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";
const { dispatch } = store;
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 {
components: { EditCompany },
components: { Timing, paymentStatusOption },
data() {
return {
loading: false,
loadingVisible: false,
columns: [],
name: "",
paymentStatusOption: paymentStatusOption,
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: {
total:0,
current: 1,
records:[],
},
page: {
size: 10,
size: 50,
},
}
},
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);
watch: {
},
methods: {
search(current = 1) {
this.searchForm = {
name: this.name
};
this.loading = true
const initQuery = {
this.loading = true;
if(this.searchForm.planDate != null) {
this.searchForm.planDateStart = this.searchForm.planDate[0];
this.searchForm.planDateEnd = this.searchForm.planDate[1];
}
if(this.searchForm.createDate != null) {
this.searchForm.createDateStart = this.searchForm.createDate[0];
this.searchForm.createDateEnd = this.searchForm.createDate[1];
}
dispatch("invoke/asyncListPlanningLogs", {
current,
size: this.page.size,
records: this.searchForm
};
dispatch("invoke/asyncListCompany", {
...initQuery
}).then(({ data }) => {
this.loading = false
if (data != null) {
......@@ -71,7 +77,7 @@ export default {
},
},
mounted() {
this.columns = columns(this.search, this.disable, this.enable, this.updateExpired, this.updateCompany);
this.columns = columns();
this.search();
}
};
<template>
<div>
<Card>
<Form :label-width="100">
<Row>
<Col span="24">
企业名称:
<Input v-model="name" placeholder="Enter something..." style="width: 200px; margin-right:10px" />
<Button @click="() => search()" type="primary"><Icon type="ios-search-outline" /> 查询</Button>
<EditCompany class="searchBtn" @search="search" style="float:right" />
<Form :label-width="80" label-colon>
<Row :gutter="5">
<Col span="6">
<FormItem label="计划日期" >
<Timing v-model="searchForm.planDate" data-type="date" :intervalWidth="5" />
</FormItem>
</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>
</Form>
</Card>
<Card style="margin-top:10px">
<Table
border
:loading="loading"
:columns="columns"
:data="data.records"/>
<Table border :loading="loading" :columns="columns" :data="data.records"/>
<Page
style="margin-top:10px"
:total="Number(data.total)"
......@@ -26,6 +49,7 @@
@on-page-size-change="changeSize"
:placement="'top'"
:page-size-opts="[10, 30, 50, 100]"
:page-size="page.size"
show-sizer
show-elevator
show-total></Page>
......@@ -36,9 +60,6 @@
<script src="./index.js"></script>
<style>
.newTableClass {
overflow: visible;
}
.ivu-table-cell {
padding-left: 0;
padding-right: 0;
......
......@@ -11,6 +11,8 @@ export default {
logDatas: [],
logColumns: [],
leaseTypeOption: leaseTypeOption,
imageVisible: false,
imageUrl: null,
rentLoading: false,
rentDatas: [],
......@@ -95,7 +97,7 @@ export default {
})
}
this.listLogs();
this.listContractLogs();
this.listRentPlanning();
this.listFeePlanning();
} else {
......@@ -108,6 +110,10 @@ export default {
},
},
methods: {
handleView (item) {
this.imageUrl = item.url;
this.imageVisible = true;
},
listVehicles() {
dispatch("invoke/asyncListNoSourceContractVehicles").then(({ data }) => {
this.vehicles = data;
......@@ -118,10 +124,10 @@ export default {
this.sources = data;
});
},
listLogs() {
listContractLogs() {
this.logLoading = true;
const contractId = this.contract.id;
dispatch("invoke/asyncListLogs", contractId).then(({ data }) => {
dispatch("invoke/asyncListContractLogs", contractId).then(({ data }) => {
this.logLoading = false;
this.logDatas = data;
});
......
......@@ -66,6 +66,9 @@
<template v-else><Spin size="small" fix ></Spin></template>
</div>
</FormItem>
<Modal v-model="imageVisible">
<img :src="imageUrl" v-if="imageVisible" style="width: 100%">
</Modal>
</Col>
</Row>
</Form>
......
......@@ -193,7 +193,7 @@ export const columns = (search, showContract, showVehicle, showReturnDeposit, sh
const params = {
edit: 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, {
......
......@@ -27,9 +27,12 @@ export default {
},
};
},
computed: {
},
watch: {
// "payingForm.amount"() {
// if(this.payingForm.amount > this.payingForm.diffAmount) {
// this.setAll();
// }
// },
visible(show) {
this.submitLoading = false;
this.$refs.payingForm.resetFields();
......@@ -61,6 +64,11 @@ export default {
this.payingForm.amount = "" + this.payingForm.diffAmount;
},
saveReturnDeposit() {
if(this.payingForm.amount > this.payingForm.diffAmount) {
this.$Message.error("收款金额不能超过欠收金额,已修改为:" + this.payingForm.diffAmount);
this.setAll();
return;
}
this.$refs.payingForm.validate(valid => {
if (valid) {
const requestData = {
......
......@@ -33,6 +33,7 @@
<Row :gutter="10">
<Col span="20">
<FormItem label="本次缴款金额" prop="amount">
<!-- v-model.trim="payingForm.amount" -->
<Input v-model.trim="payingForm.amount" type="number" />
</FormItem>
</Col>
......
......@@ -14,6 +14,9 @@ export default {
submitLoading: false,
feeColumns: [],
leaseTypeOption: leaseTypeOption,
imageVisible: false,
imageUrl: null,
contractFormRule: {
vehicleId: [{ type: "number", required: true, message: "请选择车辆", trigger: "change" }],
driverId: [{ type: "number", required: true, message: "请选择司机", trigger: "change" }],
......@@ -79,6 +82,7 @@ export default {
if(show) {
this.contractForm.files = [];
this.contractForm.fees = [];
this.uploadList = [];
this.listVehicles();
this.listDrivers();
this.listEnableFees();
......@@ -91,7 +95,9 @@ export default {
}
},
methods: {
handleView(item) {
handleView (item) {
this.imageUrl = item.url;
this.imageVisible = true;
},
handleRemove(file) {
this.uploadList.splice(this.uploadList.indexOf(file), 1);
......
......@@ -131,6 +131,9 @@
</div>
</Upload>
</FormItem>
<Modal v-model="imageVisible">
<img :src="imageUrl" v-if="imageVisible" style="width: 100%">
</Modal>
</Col>
</Row>
</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";
import routers from "@/router/routers.js";
import "./main.less";
const { dispatch } = store;
import AvatarView from "./avatar/index.vue";
export default {
components: { },
components: { AvatarView },
data() {
return {
maps:[],
......@@ -21,11 +23,17 @@ export default {
var menusJson = JSON.parse(tokenInfo.menus);
menusJson.forEach(item => {
var menu = this.getMenuFromRouter(item.key);
if(!menu) {
return;
}
menu.visable = true;
if(item.children) {
item.children.forEach(childItem => {
var childMenu = this.getMenuFromRouter(childItem.key);
if(!childMenu) {
return;
}
childMenu.visable = true;
})
}
......
......@@ -9,6 +9,9 @@
<MenuItem name="2"><Icon type="ios-navigate"></Icon>Item 2</MenuItem>
<MenuItem name="3"><Icon type="ios-navigate"></Icon>Item 3</MenuItem>
</div>
<div class="layout-avatar">
<AvatarView></AvatarView>
</div>
</Menu>
</Header>
<Layout style="position:absolute; top:64px; bottom:0px; left:0px; right:0px;">
......@@ -54,16 +57,21 @@
.layout-logo{
width: 100px;
height: 30px;
background: #5b6270;
background: #990000;
border-radius: 3px;
float: left;
position: relative;
top: 15px;
left: 20px;
}
.layout-nav{
width: 420px;
margin: 0 auto;
margin-right: 20px;
.layout-nav {
// width: 420px;
// margin: 0 auto;
padding-left: 100px;
}
.layout-avatar {
// width: 420px;
// margin: 0 auto;
// margin-right: 20px;
float: right;
}
</style>
......@@ -88,7 +88,7 @@ export default {
})
}
this.listLogs();
this.listContractLogs();
this.listRentPlanning();
} else {
this.logDatas = [];
......@@ -108,9 +108,9 @@ export default {
this.sources = data;
});
},
listLogs() {
listContractLogs() {
const contractId = this.contract.id;
dispatch("invoke/asyncListLogs", contractId).then(({ data }) => {
dispatch("invoke/asyncListContractLogs", contractId).then(({ data }) => {
this.logDatas = data;
});
},
......
......@@ -5,7 +5,7 @@
<Row :gutter="5">
<Col span="5">
<FormItem label="车牌号码" >
<Input v-model="plateNo" placeholder="Enter something..." />
<Input v-model="plateNo" placeholder="车牌号码" />
</FormItem>
</Col>
<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