Commit feb9957b by weijiguang

1

parent 6d96045f
...@@ -35,3 +35,4 @@ export const levelOption = [ ...@@ -35,3 +35,4 @@ export const levelOption = [
{text: "初级(10)", value: 2}, {text: "初级(10)", value: 2},
{text: "高级(50)", value: 3}, {text: "高级(50)", value: 3},
]; ];
...@@ -7,52 +7,43 @@ ...@@ -7,52 +7,43 @@
<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> <Col span="24" class="tip">{{ validText }}</Col>
</Row> </Row>
<Row> <Row class="row">
<Col span="24"> <Col span="2" class="left">企业ID:</Col>
<FormItem label="企业ID">{{ company.id }}</FormItem> <Col span="22" class="right">{{ company.id }}</Col>
</Col>
</Row> </Row>
<Row> <Row class="row">
<Col span="24"> <Col span="2" class="left">企业名称:</Col>
<FormItem label="企业名称">{{ company.name }}</FormItem> <Col span="22" class="right">{{ company.name }}</Col>
</Col>
</Row> </Row>
<Row> <Row class="row">
<Col span="24"> <Col span="2" class="left">企业简称:</Col>
<FormItem label="企业简称">{{ company.abbr }}</FormItem> <Col span="22" class="right">{{ company.abbr }}</Col>
</Col>
</Row> </Row>
<Row> <Row class="row">
<Col span="24"> <Col span="2" class="left">企业地址:</Col>
<FormItem label="企业地址">{{ company.address }}</FormItem> <Col span="22" class="right">{{ company.address }}</Col>
</Col>
</Row> </Row>
<Row> <Row class="row">
<Col span="24"> <Col span="2" class="left">联系人:</Col>
<FormItem label="联系人">{{ company.contactName }}</FormItem> <Col span="22" class="right">{{ company.contactName }}</Col>
</Col>
</Row> </Row>
<Row> <Row class="row">
<Col span="24"> <Col span="2" class="left">联系电话:</Col>
<FormItem label="联系电话">{{ company.contactPhone }}</FormItem> <Col span="22" class="right">{{ company.contactPhone }}</Col>
</Col>
</Row> </Row>
<Row> <Row class="row">
<Col span="24"> <Col span="2" class="left">省/市/区:</Col>
<FormItem label="省/市/区">{{ company.province }} / {{ company.city }} / {{ company.district }}</FormItem> <Col span="22" class="right">{{ company.province }} / {{ company.city }} / {{ company.district }}</Col>
</Col>
</Row> </Row>
<Row> <Row class="row">
<Col span="24"> <Col span="2" class="left">等级:</Col>
<FormItem label="等级">{{ level }}</FormItem> <Col span="22" class="right">{{ level }}</Col>
</Col>
</Row> </Row>
<Row> <Row class="row">
<Col span="24"> <Col span="2" class="left">状态:</Col>
<FormItem label="状态">{{ company.status == 1 ? "正常" : "禁用" }}</FormItem> <Col span="22" class="right">{{ company.status == 1 ? "正常" : "禁用" }}</Col>
</Col>
</Row> </Row>
</Form> </Form>
</div> </div>
...@@ -76,4 +67,20 @@ ...@@ -76,4 +67,20 @@
#fontstyle .ivu-form-item-content { #fontstyle .ivu-form-item-content {
color:#999; color:#999;
} }
.tip {
text-align: center;
font-size: 22px;
color: #FF3333
}
.row {
margin-top: 20px;
}
.left {
text-align: right;
padding-right: 10px;
font-weight: bold;
}
.right {
}
</style> </style>
\ No newline at end of file
...@@ -23,7 +23,7 @@ export default { ...@@ -23,7 +23,7 @@ export default {
identityValidPeriodEnd: [{ type: "date", required: true, message: "请输入身份证有效斯", trigger: "change" }], identityValidPeriodEnd: [{ type: "date", required: true, message: "请输入身份证有效斯", trigger: "change" }],
credentialNo: [{ required: true, message: "请输入驾驶证号", trigger: "change" }], credentialNo: [{ required: true, message: "请输入驾驶证号", trigger: "change" }],
fileNo: [{ required: true, message: "请输入驾驶证档案编号", trigger: "change" }], // fileNo: [{ required: true, message: "请输入驾驶证档案编号", trigger: "change" }],
firstIssue: [{ type: "date", required: true, message: "请输入首次发证日期", trigger: "change" }], firstIssue: [{ type: "date", required: true, message: "请输入首次发证日期", trigger: "change" }],
licenseValidPeriodStart: [{ type: "date", required: true, message: "请输入驾驶证有效斯", trigger: "change" }], licenseValidPeriodStart: [{ type: "date", required: true, message: "请输入驾驶证有效斯", trigger: "change" }],
licenseValidPeriodEnd: [{ type: "date", required: true, message: "请输入驾驶证有效斯", trigger: "change" }], licenseValidPeriodEnd: [{ type: "date", required: true, message: "请输入驾驶证有效斯", trigger: "change" }],
...@@ -196,11 +196,11 @@ export default { ...@@ -196,11 +196,11 @@ export default {
saveDriver() { saveDriver() {
this.$refs.driverForm.validate(valid => { this.$refs.driverForm.validate(valid => {
if (valid) { if (valid) {
dispatch("invoke/asyncCreateDriver", this.driverForm).then(({ code }) => { dispatch("invoke/asyncCreateDriver", this.driverForm).then(({ code, data }) => {
this.submitLoading = false; this.submitLoading = false;
if (code === 1) { if (code === 1) {
this.$Message.success("添加成功"); this.$Message.success("添加成功");
this.$emit("search"); this.$emit("search", 1, data);
this.visible = false; this.visible = false;
} }
}); });
......
...@@ -165,13 +165,13 @@ ...@@ -165,13 +165,13 @@
</FormItem> </FormItem>
</Col> </Col>
<Col span="8"> <Col span="8">
<FormItem label="档案编号" prop="fileNo"> <FormItem label="准驾车型" prop="drivingClass">
<Input v-model.trim="driverForm.fileNo" type="text" /> <Input v-model.trim="driverForm.drivingClass" type="text" />
</FormItem> </FormItem>
</Col> </Col>
<Col span="8"> <Col span="8">
<FormItem label="准驾车型" prop="drivingClass"> <FormItem label="档案编号" prop="fileNo">
<Input v-model.trim="driverForm.drivingClass" type="text" /> <Input v-model.trim="driverForm.fileNo" type="text" />
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
......
...@@ -25,7 +25,7 @@ export default { ...@@ -25,7 +25,7 @@ export default {
identityValidPeriodEnd: [{ type: "date", required: true, message: "请输入身份证有效斯", trigger: "change" }], identityValidPeriodEnd: [{ type: "date", required: true, message: "请输入身份证有效斯", trigger: "change" }],
credentialNo: [{ required: true, message: "请输入驾驶证号", trigger: "change" }], credentialNo: [{ required: true, message: "请输入驾驶证号", trigger: "change" }],
fileNo: [{ required: true, message: "请输入驾驶证档案编号", trigger: "change" }], // fileNo: [{ required: true, message: "请输入驾驶证档案编号", trigger: "change" }],
firstIssue: [{ type: "date", required: true, message: "请输入首次发证日期", trigger: "change" }], firstIssue: [{ type: "date", required: true, message: "请输入首次发证日期", trigger: "change" }],
licenseValidPeriodStart: [{ type: "date", required: true, message: "请输入驾驶证有效斯", trigger: "change" }], licenseValidPeriodStart: [{ type: "date", required: true, message: "请输入驾驶证有效斯", trigger: "change" }],
licenseValidPeriodEnd: [{ type: "date", required: true, message: "请输入驾驶证有效斯", trigger: "change" }], licenseValidPeriodEnd: [{ type: "date", required: true, message: "请输入驾驶证有效斯", trigger: "change" }],
......
...@@ -182,13 +182,13 @@ ...@@ -182,13 +182,13 @@
</FormItem> </FormItem>
</Col> </Col>
<Col span="8"> <Col span="8">
<FormItem label="档案编号" prop="fileNo"> <FormItem label="准驾车型" prop="drivingClass">
<Input v-model.trim="driverForm.fileNo" type="text" :disabled="readonly"/> <Input v-model.trim="driverForm.drivingClass" type="text" :disabled="readonly"/>
</FormItem> </FormItem>
</Col> </Col>
<Col span="8"> <Col span="8">
<FormItem label="准驾车型" prop="drivingClass"> <FormItem label="档案编号" prop="fileNo">
<Input v-model.trim="driverForm.drivingClass" type="text" :disabled="readonly"/> <Input v-model.trim="driverForm.fileNo" type="text" :disabled="readonly"/>
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
......
...@@ -36,18 +36,18 @@ export const columns = (search, showEdit) => [ ...@@ -36,18 +36,18 @@ export const columns = (search, showEdit) => [
minWidth: 120, minWidth: 120,
}, },
{ {
title: "地址",
key: "address",
align: "center",
minWidth: 200,
},
{
title: "身份证号", title: "身份证号",
key: "identityNumber", key: "identityNumber",
align: "center", align: "center",
minWidth: 150, minWidth: 150,
}, },
{ {
title: "地址",
key: "address",
align: "center",
minWidth: 200,
},
{
title: "联系人", title: "联系人",
key: "contactName", key: "contactName",
align: "center", align: "center",
......
...@@ -30,7 +30,7 @@ export default { ...@@ -30,7 +30,7 @@ export default {
this.$refs.editDriver.driver = driver; this.$refs.editDriver.driver = driver;
this.$refs.editDriver.visible = true; this.$refs.editDriver.visible = true;
}, },
search(current = 1) { search(current = 1, driver) {
this.searchForm = { this.searchForm = {
name: this.name, name: this.name,
phone: this.phone, phone: this.phone,
......
...@@ -34,7 +34,7 @@ export const logColumns = () => [ ...@@ -34,7 +34,7 @@ export const logColumns = () => [
export const rentColumns = () => [ export const rentColumns = () => [
{ {
title: "状态", title: "付款状态",
align: "center", align: "center",
width: 120, width: 120,
render(h, { row }) { render(h, { row }) {
...@@ -47,6 +47,19 @@ export const rentColumns = () => [ ...@@ -47,6 +47,19 @@ export const rentColumns = () => [
} }
}, },
{ {
title: "状态",
align: "center",
width: 120,
render(h, { row }) {
try {
const { status } = row;
return h("span", {style: {color: status == 1 ? 'green' : 'red' }}, status == 1 ? '正常' : '已中止');
} catch(e) {
console.log(e);
}
}
},
{
title: "类型", title: "类型",
key: "name", key: "name",
align: "center", align: "center",
...@@ -80,7 +93,7 @@ export const rentColumns = () => [ ...@@ -80,7 +93,7 @@ export const rentColumns = () => [
export const feeColumns = () => [ export const feeColumns = () => [
{ {
title: "状态", title: "付款状态",
align: "center", align: "center",
width: 120, width: 120,
render(h, { row }) { render(h, { row }) {
...@@ -93,6 +106,19 @@ export const feeColumns = () => [ ...@@ -93,6 +106,19 @@ export const feeColumns = () => [
} }
}, },
{ {
title: "状态",
align: "center",
width: 120,
render(h, { row }) {
try {
const { status } = row;
return h("span", {style: {color: status == 1 ? 'green' : 'red' }}, status == 1 ? '正常' : '已中止');
} catch(e) {
console.log(e);
}
}
},
{
title: "类型", title: "类型",
key: "name", key: "name",
align: "center", align: "center",
......
<template> <template>
<div> <div>
<Modal width="800" v-model="visible" title="车源合同 - 修改" fullscreen> <Modal width="800" v-model="visible" title="司机合同 - 修改" fullscreen>
<Tabs v-model="selectTab"> <Tabs v-model="selectTab">
<TabPane label="合同信息" icon="md-document" name="contractTab"> <TabPane label="合同信息" icon="md-document" name="contractTab">
<div> <div>
......
...@@ -11,6 +11,8 @@ export default { ...@@ -11,6 +11,8 @@ export default {
}, },
data() { data() {
return { return {
terminateVisiable: false,
terminateDeletePlanning: "保留",
} }
}, },
methods: { methods: {
...@@ -29,17 +31,12 @@ export default { ...@@ -29,17 +31,12 @@ export default {
} }
}, },
showConfirmTerminate() { showConfirmTerminate() {
this.$Modal.confirm({ this.terminateVisiable = true;
title: '中止',
content: '确定中止当前合同?',
onOk: () => {
this.terminateContract();
}
});
}, },
terminateContract() { terminateContract() {
const requestData = { const requestData = {
contractId: this.data.id, contractId: this.data.id,
deletePlanning: this.terminateDeletePlanning == "删除" ? 1 : 0,
} }
dispatch("invoke/asyncTerminateContract", requestData).then(({ code }) => { dispatch("invoke/asyncTerminateContract", requestData).then(({ code }) => {
this.submitLoading = false; this.submitLoading = false;
......
...@@ -10,6 +10,13 @@ ...@@ -10,6 +10,13 @@
<DropdownItem v-if="params.returnDeposit" name="returnDeposit">返还押金</DropdownItem> <DropdownItem v-if="params.returnDeposit" name="returnDeposit">返还押金</DropdownItem>
<DropdownItem v-if="params.terminate" name="terminate">中止合同</DropdownItem> <DropdownItem v-if="params.terminate" name="terminate">中止合同</DropdownItem>
</DropdownMenu> </DropdownMenu>
<Modal title="确定中止当前合同?" v-model="terminateVisiable" @on-ok="terminateContract">
同时删除费用计划:
<RadioGroup v-model="terminateDeletePlanning">
<Radio label="保留" value="0"></Radio>
<Radio label="删除" value="1"></Radio>
</RadioGroup>
</Modal>
</Dropdown> </Dropdown>
</template> </template>
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</Col> </Col>
<Col span="4"> <Col span="4">
<FormItem label="押金状态" > <FormItem label="押金状态" >
<Select v-model.trim="depositStatus" filterable clearable> <Select v-model.trim="depositStatus" filterable clearable multiple>
<Option v-for="item in depositStatusOption" :value="item.value" :key="item.value">{{ item.text }}</Option> <Option v-for="item in depositStatusOption" :value="item.value" :key="item.value">{{ item.text }}</Option>
</Select> </Select>
</FormItem> </FormItem>
......
...@@ -18,6 +18,19 @@ export const columns = (search, showContract, showDriver, showVehicle, showPayin ...@@ -18,6 +18,19 @@ export const columns = (search, showContract, showDriver, showVehicle, showPayin
} }
}, },
{ {
title: "状态",
align: "center",
width: 120,
render(h, { row }) {
try {
const { status } = row;
return h("span", {style: {color: status == 1 ? 'green' : 'red' }}, status == 1 ? '正常' : '已中止');
} catch(e) {
console.log(e);
}
}
},
{
title: "费用类型", title: "费用类型",
key: "name", key: "name",
align: "center", align: "center",
......
...@@ -29,7 +29,7 @@ export default { ...@@ -29,7 +29,7 @@ export default {
planDate: null, planDate: null,
planDateStart: null, planDateStart: null,
planDateEnd: null, planDateEnd: null,
paymentStatus: 0, paymentStatus: null,
status: null, status: null,
}, },
data: { data: {
......
...@@ -43,6 +43,14 @@ ...@@ -43,6 +43,14 @@
</FormItem> </FormItem>
</Col> </Col>
<Col span="6"> <Col span="6">
<FormItem label="状态" >
<Select v-model.trim="searchForm.status" filterable clearable>
<Option :value="1" :key="1">有效</Option>
<Option :value="0" :key="0">已中止</Option>
</Select>
</FormItem>
</Col>
<Col span="6">
<Button @click="search()" type="primary"><Icon type="ios-search-outline" /> 查询</Button> <Button @click="search()" type="primary"><Icon type="ios-search-outline" /> 查询</Button>
</Col> </Col>
</Row> </Row>
......
...@@ -3,10 +3,11 @@ const { dispatch } = store; ...@@ -3,10 +3,11 @@ const { dispatch } = store;
import moment from "moment"; import moment from "moment";
import { isInteger } from "@/libs/validator.js"; import { isInteger } from "@/libs/validator.js";
import { feeColumns } from "./columns.js"; import { feeColumns } from "./columns.js";
import AddDriver from "@/view/driver/add/index.vue";
import { leaseTypeOption } from "@/libs/constants.js"; import { leaseTypeOption } from "@/libs/constants.js";
export default { export default {
components: { feeColumns, leaseTypeOption }, components: { feeColumns, leaseTypeOption, AddDriver },
data() { data() {
return { return {
visible: false, visible: false,
...@@ -26,7 +27,7 @@ export default { ...@@ -26,7 +27,7 @@ export default {
rentAmount: [{ required: true, message: "请输入月租金", trigger: "blur" }, { validator: isInteger, trigger: "blur" }], rentAmount: [{ required: true, message: "请输入月租金", trigger: "blur" }, { validator: isInteger, trigger: "blur" }],
firstPaidAmount: [{ required: true, message: "首次实收租金", trigger: "blur" }, { validator: isInteger, trigger: "blur" }], firstPaidAmount: [{ required: true, message: "首次实收租金", trigger: "blur" }, { validator: isInteger, trigger: "blur" }],
leaseType: [{ type: "number", required: true, message: "请选择租赁方式", trigger: "change" }], leaseType: [{ type: "number", required: true, message: "请选择租赁方式", trigger: "change" }],
startDate: [{ type: "date", required: true, message: "请选择开始日期", trigger: "change" }], startDateText: [{ type: "date", required: true, message: "请选择开始日期", trigger: "change" }],
leasePeriod: [{ required: true, message: "请输入租赁周期", trigger: "blur" }, { validator: isInteger, trigger: "blur" }], leasePeriod: [{ required: true, message: "请输入租赁周期", trigger: "blur" }, { validator: isInteger, trigger: "blur" }],
}, },
contractForm: { contractForm: {
...@@ -36,6 +37,7 @@ export default { ...@@ -36,6 +37,7 @@ export default {
odograph: null, odograph: null,
odographEv: null, odographEv: null,
startDate: null, startDate: null,
startDateText: null,
// endDate: null, // endDate: null,
payableDepositAmount: null, payableDepositAmount: null,
paidDepositAmount: null, paidDepositAmount: null,
...@@ -86,7 +88,8 @@ export default { ...@@ -86,7 +88,8 @@ export default {
this.listVehicles(); this.listVehicles();
this.listDrivers(); this.listDrivers();
this.listEnableFees(); this.listEnableFees();
this.contractForm.startDate = moment().format().substring(0,10); // console.log(this.$refs.startDate);
this.contractForm.startDateText = moment().format().substring(0,10);
} }
}, },
feeDialogVisible(show) { feeDialogVisible(show) {
...@@ -95,6 +98,10 @@ export default { ...@@ -95,6 +98,10 @@ export default {
} }
}, },
methods: { methods: {
onAddComplete(current, driver) {
this.drivers.unshift(driver);
this.contractForm.driverId = driver.id;
},
handleView (item) { handleView (item) {
this.imageUrl = item.url; this.imageUrl = item.url;
this.imageVisible = true; this.imageVisible = true;
...@@ -138,6 +145,7 @@ export default { ...@@ -138,6 +145,7 @@ export default {
saveContract() { saveContract() {
this.$refs.contractForm.validate(valid => { this.$refs.contractForm.validate(valid => {
if (valid) { if (valid) {
this.contractForm.startDate = this.contractForm.startDateText.valueOf();
this.uploadList.forEach(f => { this.uploadList.forEach(f => {
this.contractForm.files.push(f.id); this.contractForm.files.push(f.id);
}) })
......
...@@ -4,18 +4,19 @@ ...@@ -4,18 +4,19 @@
<Modal width="800" v-model="visible" title="司机合同 - 签约" fullscreen> <Modal width="800" v-model="visible" title="司机合同 - 签约" fullscreen>
<div> <div>
<Form ref="contractForm" :model="contractForm" :rules="contractFormRule" :label-width="80" label-colon> <Form ref="contractForm" :model="contractForm" :rules="contractFormRule" :label-width="80" label-colon>
<Row> <Row :gutter="5">
<Col span="8"> <Col span="8">
<FormItem label="车辆信息" prop="vehicleId"> <FormItem label="司机信息" prop="driverId">
<Select v-model.trim="contractForm.vehicleId" filterable> <Select v-model.trim="contractForm.driverId" filterable style="width:80%">
<Option v-for="item in vehicles" :value="item.id" :key="item.id">{{ item.id + " / " + item.plateNo + " / " + item.color + " / " + item.brandName + " / " + item.model }}</Option> <Option v-for="item in drivers" :value="item.id" :key="item.id">{{ item.name + " / " + item.phone}}</Option>
</Select> </Select>
<AddDriver ref="addDriverDialog" @search="onAddComplete" style="float:right; width:20%"/>
</FormItem> </FormItem>
</Col> </Col>
<Col span="8"> <Col span="8">
<FormItem label="司机信息" prop="driverId"> <FormItem label="车辆信息" prop="vehicleId">
<Select v-model.trim="contractForm.driverId" filterable> <Select v-model.trim="contractForm.vehicleId" filterable>
<Option v-for="item in drivers" :value="item.id" :key="item.id">{{ item.name + " / " + item.phone}}</Option> <Option v-for="item in vehicles" :value="item.id" :key="item.id">{{ item.id + " / " + item.plateNo + " / " + item.color + " / " + item.brandName + " / " + item.model }}</Option>
</Select> </Select>
</FormItem> </FormItem>
</Col> </Col>
...@@ -25,7 +26,7 @@ ...@@ -25,7 +26,7 @@
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row> <Row :gutter="5">
<Col span="8"> <Col span="8">
<FormItem label="应收押金" prop="payableDepositAmount"> <FormItem label="应收押金" prop="payableDepositAmount">
<Input v-model.trim="contractForm.payableDepositAmount" type="number" /> <Input v-model.trim="contractForm.payableDepositAmount" type="number" />
...@@ -42,19 +43,7 @@ ...@@ -42,19 +43,7 @@
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row> <Row :gutter="5">
<Col span="8">
<FormItem label="周期租金" prop="rentAmount">
<Input v-model.trim="contractForm.rentAmount" type="number" />
</FormItem>
</Col>
<Col span="8">
<FormItem label="首次实收租金" prop="firstPaidAmount">
<Input v-model.trim="contractForm.firstPaidAmount" type="number" />
</FormItem>
</Col>
</Row>
<Row>
<Col span="8"> <Col span="8">
<FormItem label="租赁方式" prop="leaseType"> <FormItem label="租赁方式" prop="leaseType">
<Select v-model="contractForm.leaseType"> <Select v-model="contractForm.leaseType">
...@@ -63,8 +52,10 @@ ...@@ -63,8 +52,10 @@
</FormItem> </FormItem>
</Col> </Col>
<Col span="8"> <Col span="8">
<FormItem label="开始日期" prop="startDate"> <FormItem label="开始日期" prop="startDateText">
<DatePicker v-model="contractForm.startDate" style="width: 100%" placeholder="请输入开始日期"></DatePicker> <!-- @on-change="getStartDate" -->
<!-- v-model="contractForm.startDate" format="yyyy-MM-dd" -->
<DatePicker style="width: 100%" placeholder="请输入开始日期" v-model="contractForm.startDateText"></DatePicker>
</FormItem> </FormItem>
</Col> </Col>
<Col span="8"> <Col span="8">
...@@ -73,7 +64,19 @@ ...@@ -73,7 +64,19 @@
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row> <Row :gutter="5">
<Col span="8">
<FormItem label="周期租金" prop="rentAmount">
<Input v-model.trim="contractForm.rentAmount" type="number" />
</FormItem>
</Col>
<Col span="8">
<FormItem label="首次实收租金" prop="firstPaidAmount">
<Input v-model.trim="contractForm.firstPaidAmount" type="number" />
</FormItem>
</Col>
</Row>
<Row :gutter="5">
<Col span="24"> <Col span="24">
<FormItem label="备注" prop="remark"> <FormItem label="备注" prop="remark">
<Input v-model="contractForm.remark" type="textarea" :rows="4" placeholder="请输入备注" style="width: 100%" /> <Input v-model="contractForm.remark" type="textarea" :rows="4" placeholder="请输入备注" style="width: 100%" />
...@@ -98,7 +101,7 @@ ...@@ -98,7 +101,7 @@
</Modal> </Modal>
</Col> </Col>
</Row> </Row>
<Row> <Row :gutter="5">
<Col span="24"> <Col span="24">
<FormItem label="验车照片"> <FormItem label="验车照片">
<div class="demo-upload-list" v-for="item in uploadList"> <div class="demo-upload-list" v-for="item in uploadList">
......
...@@ -34,7 +34,7 @@ export const logColumns = () => [ ...@@ -34,7 +34,7 @@ export const logColumns = () => [
export const rentColumns = () => [ export const rentColumns = () => [
{ {
title: "状态", title: "付款状态",
align: "center", align: "center",
width: 120, width: 120,
render(h, { row }) { render(h, { row }) {
...@@ -47,6 +47,19 @@ export const rentColumns = () => [ ...@@ -47,6 +47,19 @@ export const rentColumns = () => [
} }
}, },
{ {
title: "状态",
align: "center",
width: 120,
render(h, { row }) {
try {
const { status } = row;
return h("span", {style: {color: status == 1 ? 'green' : 'red' }}, status == 1 ? '正常' : '已中止');
} catch(e) {
console.log(e);
}
}
},
{
title: "类型", title: "类型",
key: "name", key: "name",
align: "center", align: "center",
......
...@@ -11,6 +11,8 @@ export default { ...@@ -11,6 +11,8 @@ export default {
}, },
data() { data() {
return { return {
terminateVisiable: false,
terminateDeletePlanning: "保留",
} }
}, },
methods: { methods: {
...@@ -29,17 +31,12 @@ export default { ...@@ -29,17 +31,12 @@ export default {
} }
}, },
showConfirmTerminate() { showConfirmTerminate() {
this.$Modal.confirm({ this.terminateVisiable = true;
title: '中止',
content: '确定中止当前合同?',
onOk: () => {
this.terminateContract();
}
});
}, },
terminateContract() { terminateContract() {
const requestData = { const requestData = {
contractId: this.data.id, contractId: this.data.id,
deletePlanning: this.terminateDeletePlanning == "删除" ? 1 : 0,
} }
dispatch("invoke/asyncTerminateContract", requestData).then(({ code }) => { dispatch("invoke/asyncTerminateContract", requestData).then(({ code }) => {
this.submitLoading = false; this.submitLoading = false;
......
...@@ -10,6 +10,13 @@ ...@@ -10,6 +10,13 @@
<DropdownItem v-if="params.returnDeposit" name="returnDeposit">返还押金</DropdownItem> <DropdownItem v-if="params.returnDeposit" name="returnDeposit">返还押金</DropdownItem>
<DropdownItem v-if="params.terminate" name="terminate">中止合同</DropdownItem> <DropdownItem v-if="params.terminate" name="terminate">中止合同</DropdownItem>
</DropdownMenu> </DropdownMenu>
<Modal title="确定中止当前合同?" v-model="terminateVisiable" @on-ok="terminateContract">
同时删除费用计划:
<RadioGroup v-model="terminateDeletePlanning">
<Radio label="保留" value="0"></Radio>
<Radio label="删除" value="1"></Radio>
</RadioGroup>
</Modal>
</Dropdown> </Dropdown>
</template> </template>
......
...@@ -110,7 +110,7 @@ export const columns = (search, showContract, showVehicle, showReturnDeposit) => ...@@ -110,7 +110,7 @@ export const columns = (search, showContract, showVehicle, showReturnDeposit) =>
} }
}, },
{ {
title: "租金", title: "租金",
key: "rentAmount", key: "rentAmount",
align: "center", align: "center",
minWidth: 100, minWidth: 100,
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</Col> </Col>
<Col span="4"> <Col span="4">
<FormItem label="押金状态" > <FormItem label="押金状态" >
<Select v-model.trim="depositStatus" filterable clearable> <Select v-model.trim="depositStatus" filterable clearable multiple>
<Option v-for="item in depositStatusOption" :value="item.value" :key="item.value">{{ item.text }}</Option> <Option v-for="item in depositStatusOption" :value="item.value" :key="item.value">{{ item.text }}</Option>
</Select> </Select>
</FormItem> </FormItem>
......
...@@ -21,7 +21,7 @@ export default { ...@@ -21,7 +21,7 @@ export default {
rentAmount: [{ required: true, message: "请输入月租金", trigger: "blur" }, { validator: isInteger, trigger: "blur" }], rentAmount: [{ required: true, message: "请输入月租金", trigger: "blur" }, { validator: isInteger, trigger: "blur" }],
firstPaidAmount: [{ required: true, message: "首次实收租金", trigger: "blur" }, { validator: isInteger, trigger: "blur" }], firstPaidAmount: [{ required: true, message: "首次实收租金", trigger: "blur" }, { validator: isInteger, trigger: "blur" }],
leaseType: [{ type: "number", required: true, message: "请选择租赁方式", trigger: "change" }], leaseType: [{ type: "number", required: true, message: "请选择租赁方式", trigger: "change" }],
startDate: [{ type: "date", required: true, message: "请选择开始日期", trigger: "change" }], startDateText: [{ type: "date", required: true, message: "请选择开始日期", trigger: "change" }],
leasePeriod: [{ required: true, message: "请输入租赁周期", trigger: "blur" }, { validator: isInteger, trigger: "blur" }], leasePeriod: [{ required: true, message: "请输入租赁周期", trigger: "blur" }, { validator: isInteger, trigger: "blur" }],
}, },
contractForm: { contractForm: {
...@@ -32,6 +32,7 @@ export default { ...@@ -32,6 +32,7 @@ export default {
payableDepositAmount: null, payableDepositAmount: null,
paidDepositAmount: null, paidDepositAmount: null,
diffDepositAmount: null, diffDepositAmount: null,
startDateText: null,
startDate: null, startDate: null,
rentAmount: null, rentAmount: null,
firstPaidAmount: null, firstPaidAmount: null,
...@@ -72,12 +73,12 @@ export default { ...@@ -72,12 +73,12 @@ export default {
this.contractForm.files = []; this.contractForm.files = [];
this.listVehicles(); this.listVehicles();
this.listSources(); this.listSources();
this.contractForm.startDate = moment().format().substring(0,10); this.contractForm.startDateText = moment().format().substring(0,10);
} }
}, },
}, },
methods: { methods: {
onAddComplete(vehicle) { onAddComplete(current, vehicle) {
this.vehicles.unshift(vehicle); this.vehicles.unshift(vehicle);
this.contractForm.vehicleId = vehicle.id; this.contractForm.vehicleId = vehicle.id;
}, },
...@@ -129,6 +130,7 @@ export default { ...@@ -129,6 +130,7 @@ export default {
this.contractForm.files.push(f.id); this.contractForm.files.push(f.id);
}) })
dispatch("invoke/asyncSignContract", this.contractForm).then(({ code }) => { dispatch("invoke/asyncSignContract", this.contractForm).then(({ code }) => {
this.contractForm.startDate = this.contractForm.startDateText.valueOf();
this.submitLoading = false; this.submitLoading = false;
if (code === 1) { if (code === 1) {
this.$Message.success("合同签订成功"); this.$Message.success("合同签订成功");
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<Select v-model.trim="contractForm.vehicleId" filterable style="width:80%"> <Select v-model.trim="contractForm.vehicleId" filterable style="width:80%">
<Option v-for="item in vehicles" :value="item.id" :key="item.id">{{ item.id + " / " + item.plateNo + " / " + item.color + " / " + item.brandName + " / " + item.model }}</Option> <Option v-for="item in vehicles" :value="item.id" :key="item.id">{{ item.id + " / " + item.plateNo + " / " + item.color + " / " + item.brandName + " / " + item.model }}</Option>
</Select> </Select>
<AddVehicle ref="addVehicleDialog" @search="onAddComplete($event)" style="float:right; width:20%"/> <AddVehicle ref="addVehicleDialog" @search="onAddComplete" style="float:right; width:20%"/>
</FormItem> </FormItem>
</Col> </Col>
<Col span="8"> <Col span="8">
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row> <Row :gutter="5">
<Col span="8"> <Col span="8">
<FormItem label="应付押金" prop="payableDepositAmount"> <FormItem label="应付押金" prop="payableDepositAmount">
<Input v-model.trim="contractForm.payableDepositAmount" type="number" /> <Input v-model.trim="contractForm.payableDepositAmount" type="number" />
...@@ -43,19 +43,7 @@ ...@@ -43,19 +43,7 @@
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row> <Row :gutter="5">
<Col span="8">
<FormItem label="周期租金" prop="rentAmount">
<Input v-model.trim="contractForm.rentAmount" type="number" />
</FormItem>
</Col>
<Col span="8">
<FormItem label="首次实收租金" prop="firstPaidAmount">
<Input v-model.trim="contractForm.firstPaidAmount" type="number" />
</FormItem>
</Col>
</Row>
<Row>
<Col span="8"> <Col span="8">
<FormItem label="租赁方式" prop="leaseType"> <FormItem label="租赁方式" prop="leaseType">
<Select v-model="contractForm.leaseType"> <Select v-model="contractForm.leaseType">
...@@ -64,8 +52,8 @@ ...@@ -64,8 +52,8 @@
</FormItem> </FormItem>
</Col> </Col>
<Col span="8"> <Col span="8">
<FormItem label="开始日期" prop="startDate"> <FormItem label="开始日期" prop="startDateText">
<DatePicker v-model="contractForm.startDate" style="width: 100%" placeholder="请输入开始日期"></DatePicker> <DatePicker v-model="contractForm.startDateText" style="width: 100%" placeholder="请输入开始日期"></DatePicker>
</FormItem> </FormItem>
</Col> </Col>
<Col span="8"> <Col span="8">
...@@ -74,6 +62,18 @@ ...@@ -74,6 +62,18 @@
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row :gutter="5">
<Col span="8">
<FormItem label="周期租金" prop="rentAmount">
<Input v-model.trim="contractForm.rentAmount" type="number" />
</FormItem>
</Col>
<Col span="8">
<FormItem label="首次实收租金" prop="firstPaidAmount">
<Input v-model.trim="contractForm.firstPaidAmount" type="number" />
</FormItem>
</Col>
</Row>
<Row> <Row>
<Col span="24"> <Col span="24">
<FormItem label="备注" prop="remark"> <FormItem label="备注" prop="remark">
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
<Row> <Row :gutter="5">
<Col span="24"> <Col span="24">
<FormItem label="验车照片"> <FormItem label="验车照片">
<div class="demo-upload-list" v-for="item in uploadList"> <div class="demo-upload-list" v-for="item in uploadList">
......
...@@ -184,7 +184,7 @@ export default { ...@@ -184,7 +184,7 @@ export default {
this.submitLoading = false; this.submitLoading = false;
if (code === 1) { if (code === 1) {
this.$Message.success("添加成功"); this.$Message.success("添加成功");
this.$emit("search", data); this.$emit("search", 1, data);
this.visible = false; this.visible = false;
} }
}); });
......
...@@ -54,7 +54,7 @@ export default { ...@@ -54,7 +54,7 @@ export default {
this.$refs.editVehicle.vehicle = vehicle; this.$refs.editVehicle.vehicle = vehicle;
this.$refs.editVehicle.visible = true; this.$refs.editVehicle.visible = true;
}, },
search(current = 1) { search(current = 1, v) {
this.searchForm = { this.searchForm = {
plateNo: this.plateNo, plateNo: this.plateNo,
brandName: this.brandName, brandName: this.brandName,
...@@ -69,7 +69,7 @@ export default { ...@@ -69,7 +69,7 @@ export default {
dispatch("invoke/asyncListVehicle", { dispatch("invoke/asyncListVehicle", {
...initQuery ...initQuery
}).then(({ data }) => { }).then(({ data }) => {
this.loading = false this.loading = false;
if (data != null) { if (data != null) {
this.data = {...data}; this.data = {...data};
} else { } else {
......
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