This commit is contained in:
zxx 2024-03-26 11:47:28 +08:00
parent a5db38b3c8
commit 5b719b9542
20 changed files with 1162 additions and 584 deletions

View File

@ -181,7 +181,7 @@ export default {
// =============================== Start ===============================
{title: '操作', slots: {default: 'op'}, width: 120}
{title: '操作', slots: {default: 'op'}, width: 120,fixed: 'right'}
]
}

View File

@ -207,7 +207,7 @@ export default {
// =============================== Start ===============================
{title: '操作', slots: {default: 'op'}, width: 120}
{title: '操作', slots: {default: 'op'}, width: 120,fixed: 'right'}
]
}
@ -277,7 +277,7 @@ export default {
for (let i in this.searchRules) { //
if (this.searchRules[i].key == k) return this.searchRules[i].mode; //
}
return "equal"; //
return "="; //
};
for (let key in this.searchFormData) { //

View File

@ -177,11 +177,11 @@ export default {
// =============================== Start ===============================
{field: 'code', sortable: true, title: '编码', width: 250}, //
{field: 'code', sortable: true, title: '编码', width: 120}, //
{field: 'staff_name', sortable: true, title: '员工姓名', width: 250}, //
{field: 'staff_code', sortable: true, title: '员工编号', width: 250}, //
{field: 'staff_phone', sortable: true, title: '员工手机号', width: 250}, //
{field: 'wages_date', sortable: true, title: '工资日期', width: 250}, //
{field: 'wages_date', sortable: true, title: '工资日期', width: 120}, //
{field: 'wages_year', sortable: true, title: '工资年份', width: 250}, //
{field: 'wages_month', sortable: true, title: '工资月份', width: 250}, //
{field: 'wages_type', sortable: true, title: '工资类型', width: 250}, //
@ -203,7 +203,7 @@ export default {
// =============================== Start ===============================
{title: '操作', slots: {default: 'op'}, width: 120}
{title: '操作', slots: {default: 'op'}, width: 120,fixed: 'right'}
]
}

View File

@ -167,7 +167,7 @@ export default {
// =============================== Start ===============================
{field: 'code', sortable: true, title: '编码', width: 250}, //
{field: 'code', sortable: true, title: '编码', width: 120}, //
{field: 'staff_uid', sortable: true, title: '员工uid', width: 250}, // uid
{field: 'balance_type', sortable: true, title: '结余类型', width: 250}, // :12
{field: 'balance_amount', sortable: true, title: '修改金额', width: 250}, //
@ -187,7 +187,7 @@ export default {
// =============================== Start ===============================
{title: '操作', slots: {default: 'op'}, width: 120}
{title: '操作', slots: {default: 'op'}, width: 120,fixed: 'right'}
]
}

View File

@ -181,8 +181,8 @@ export default {
{field: 'staff_uid', sortable: true, title: '员工uid', width: 250}, // uid
{field: 'transport_mileage', sortable: true, title: '运输总公里数', width: 250}, //
{field: 'month_mileage', sortable: true, title: '本月份总公里数', width: 250}, //
{field: 'transport_mileage', sortable: true, title: '运输总公里数', width: 120}, //
{field: 'month_mileage', sortable: true, title: '本月份总公里数', width: 120}, //
{field: 'wages_balance', sortable: true, title: '工资结余', width: 250}, //
{
field: 'status',
@ -206,7 +206,7 @@ export default {
// =============================== Start ===============================
{title: '操作', slots: {default: 'op'}, width: 120}
{title: '操作', slots: {default: 'op'}, width: 120,fixed: 'right'}
]
}

View File

@ -165,7 +165,7 @@ export default {
// =============================== Start ===============================
{field: 'code', sortable: true, title: '编码', width: 250}, //
{field: 'code', sortable: true, title: '编码', width: 120}, //
{field: 'name', sortable: true, title: '名称', width: 250}, //
{field: 'description', sortable: true, title: '描述', width: 250}, //
@ -182,7 +182,7 @@ export default {
// =============================== Start ===============================
{title: '操作', slots: {default: 'op'}, width: 120}
{title: '操作', slots: {default: 'op'}, width: 120,fixed: 'right'}
]
}

View File

@ -1,37 +1,36 @@
<template>
<page-layout>
<div class="page-body">
<vxe-form :data="formOptions.data" ref="xForm" :title-width="formOptions.titleWidth"
:title-align="formOptions.titleAlign" :rules="formOptions.rules" :items="formOptions.items" titleColon>
<!-- =========================== 自定义区域 Start ======================= -->
<div class="page-body">
<!-- =========================== 自定义区域 End ======================= -->
</vxe-form>
<vxe-form :data="formOptions.data" ref="xForm" :title-width="formOptions.titleWidth"
:title-align="formOptions.titleAlign" :rules="formOptions.rules" :items="formOptions.items" titleColon>
<!-- =========================== 自定义区域 Start ======================= -->
<div class="mk-toolbar" v-if="isEdit">
<!-- =========================== 自定义区域 End ======================= -->
</vxe-form>
</div>
<div class="footerbar">
<a-button type="primary" @click="ok">确定</a-button>
<a-button @click="cancel">取消</a-button>
</div>
<div class="mk-toolbar" v-if="isEdit">
</div>
</page-layout>
<div class="footerbar">
<a-button type="primary" @click="ok">确定</a-button>
<a-button @click="cancel">取消</a-button>
</div>
</div>
</template>
<script>
import BASE_URL from '@/services/Middle/transport/Maintenance/api.js';
import PageLayout from '@/layouts/PageLayout'
// import PageLayout from '@/layouts/PageLayout'
export default {
name: 'MaintenanceGiornaleLogUpdate',
i18n: require('./i18n'),
components: {PageLayout},
// components: { PageLayout },
props: {
pageMode: {
type: String,
@ -97,8 +96,11 @@ export default {
truck_code: "",
truck_name: "",
truck_number: "",
other_expenses_name: "",
other_expenses_remark: "",
maintenance_id: 0,
maintenance_name: "",
maintenance_date: new Date(2100, 1, 1).getTime() / 10000,
maintenance_price: 0,
maintenance_remark: "",
create_uid: 0,
update_uid: 0,
create_time: new Date(2100, 1, 1).getTime() / 10000,
@ -117,31 +119,34 @@ export default {
// =============================== Start ===============================
truck_number_id: [
{message: '请输入车次id'}
{ message: '请输入车次id' }
],
truck_number_code: [
{message: '请输入车次单号'}
{ message: '请输入车次单号' }
],
truck_id: [
{message: '请输入车辆id'}
{ message: '请输入车辆id' }
],
truck_code: [
{message: '请输入车辆编码'}
{ message: '请输入车辆编码' }
],
truck_name: [
{message: '请输入车辆名称'}
{ message: '请输入车辆名称' }
],
truck_number: [
{message: '请输入车牌号'}
{ message: '请输入车牌号' }
],
other_expenses_name: [
{message: '请输入其他费用名称'}
maintenance_id: [
{ message: '请输入维修项目' }
],
other_expenses_remark: [
{message: '请输入其他费用备注'}
maintenance_date:[
{ message: '请输入维修日期' }
],
other_expenses_amount: [
{message: '请输入其他费用金额'}
maintenance_remark: [
{ message: '请输入维修备注' }
],
maintenance_price: [
{ message: '请输入维修金额' }
],
// =============================== End ===============================
@ -150,15 +155,63 @@ export default {
items: [
// =============================== Start ===============================
{field: 'truck_number_id', title: '车次id', span: 12, itemRender: {name: '$input'}},
{field: 'truck_number_code', title: '车次单号', span: 12, itemRender: {name: '$input'}},
{field: 'truck_id', title: '车辆id', span: 12, itemRender: {name: '$input'}},
{field: 'truck_code', title: '车辆编码', span: 12, itemRender: {name: '$input'}},
{field: 'truck_name', title: '车辆名称', span: 12, itemRender: {name: '$input'}},
{field: 'truck_number', title: '车牌号', span: 12, itemRender: {name: '$input'}},
{field: 'other_expenses_name', title: '其他费用名称', span: 12, itemRender: {name: '$input'}},
{field: 'other_expenses_remark', title: '其他费用备注', span: 12, itemRender: {name: '$input'}},
{field: 'other_expenses_amount', title: '其他费用金额', span: 12, itemRender: {name: '$input'}},
{
title: '车辆', span: 6,
field: 'Truck',
dataRule: {
fromField: "name",
saveField: "name"
},
itemRender: {
name: 'MkFormDataSelector', props: {
params: {
dataType: "string",
valueField: "id",
textField: "name",
listdataFieldName: 'Truck',
dataUrl: `${BASE_URL.BASE_URL}/Truck/v1/truck/list`,
onDataChanged: ({ data }) => {
console.log(data)
this.formOptions.data.truck_id = data.id;
this.formOptions.data.truck_code = data.code;
this.formOptions.data.truck_name = data.name;
this.formOptions.data.truck_number = data.plate_number;
}
}
}
}
},
{
title: '维修项目', span: 6,
field: 'Maintenance',
dataRule: {
fromField: "name",
saveField: "name"
},
itemRender: {
name: 'MkFormDataSelector', props: {
params: {
dataType: "string",
valueField: "id",
textField: "name",
listdataFieldName: 'Maintenance',
dataUrl: `${BASE_URL.BASE_URL}/Maintenance/v1/maintenance/list`,
onDataChanged: ({ data }) => {
console.log(data)
this.formOptions.data.maintenance_id = data.id;
}
}
}
}
},
{ field: 'maintenance_date', dataRule: { type: 'timestamp' }, title: '维修日期', span: 6, itemRender: { name: '$input', props: { type: "date" } } },
{
field: 'maintenance_price', title: '维修金额', span: 6, itemRender: {
name: '$input', props: { type: 'number' }
}
},
{ field: 'maintenance_remark', title: '维修备注', span: 24, itemRender: { name: '$textarea' } },
// =============================== End ===============================
]
@ -269,7 +322,9 @@ export default {
let save = () => {
// this.formOptions.data.maintenance_price
this.formOptions.data.maintenance_price = Number(this.formOptions.data.maintenance_price);
//
let action = !this.isEdit ? this.actions.MaintenanceGiornaleLogCreate : this.actions.MaintenanceGiornaleLogUpdate;
// id id
@ -279,7 +334,7 @@ export default {
// postdata = { MaintenanceGiornaleLog: postdata }
}
//
this.$mk.formatFormData({data: postdata, rules: this.formOptions.items});
this.$mk.formatFormData({ data: postdata, rules: this.formOptions.items });
//
@ -302,7 +357,7 @@ export default {
//
this.$mk.validateForm({form: this.$refs.xForm}).then(() => { //
this.$mk.validateForm({ form: this.$refs.xForm }).then(() => { //
save(); //
}).catch(count => { //
this.$mk.error(`存在${count}项错误,请检查`);

View File

@ -66,12 +66,12 @@ export default {
},
data() {
const listFieldName = 'Maintenance';
const listFieldName = 'MaintenanceGiornaleLog';
//
var pageData = { //
keyName: 'id', //
listFieldName: 'maintenance_giornale_log',
listFieldName: 'MaintenanceGiornaleLog',
//
@ -179,30 +179,40 @@ export default {
// =============================== Start ===============================
{field: 'truck_number_id', sortable: true, title: '车次id', width: 250}, // id
{field: 'truck_number_code', sortable: true, title: '车次单号', width: 250}, //
{field: 'truck_id', sortable: true, title: '车辆id', width: 250}, // id
{field: 'truck_code', sortable: true, title: '车辆编码', width: 250}, //
{field: 'truck_name', sortable: true, title: '车辆名称', width: 250}, //
{field: 'truck_number', sortable: true, title: '车牌号', width: 250}, //
{field: 'other_expenses_name', sortable: true, title: '其他费用名称', width: 250}, //
{field: 'other_expenses_remark', sortable: true, title: '其他费用备注', width: 250}, //
{field: 'truck_code', sortable: true, title: '车辆编码', width: 120}, //
{field: 'truck_name', sortable: true, title: '车辆名称', width: 120}, //
{field: 'truck_number', sortable: true, title: '车牌号', width: 120}, //
{field: 'maintenance_name', sortable: true, title: '维修项目名称', width: 150}, //
{field: 'maintenance_code', sortable: true, title: '维修项目编码', width: 140}, //
{field: 'last_maintenance_date', sortable: true, title: '上次维修日期', width: 130}, //
{field: 'last_mileage', sortable: true, title: '上次维修公里数', width: 140}, //
{field: 'mileage', sortable: true, title: '维修公里数记录', width: 140}, //
{field: 'maintenance_interval', sortable: true, title: '维修时间间隔', width: 140}, //
{field: 'mileage_interval', sortable: true, title: '维修公里数间隔', width: 140}, //
{field: 'maintenance_abolish_date', sortable: true, title: '维修作废日期', width: 140}, //
{field: 'maintenance_abolish_mileage', sortable: true, title: '维修作废公里数', width: 140}, //
{field: 'maintenance_mileage', sortable: true, title: '维修公里数', width: 120}, //
{
field: 'create_time',
field: 'maintenance_date',
formatter: 'formatDate',
width: 100,
sortable: true,
title: '创建时间',
title: '维修日期',
showHeaderOverflow: true
}, //
}, //
{field: 'maintenance_remark', sortable: true, title: '维修备注', width: 250}, //
{field: 'other_expenses_amount', sortable: true, title: '其他费用金额', width: 250}, //
// =============================== Start ===============================
{title: '操作', slots: {default: 'op'}, width: 120}
{title: '操作', slots: {default: 'op'}, width: 120,fixed: 'right'}
]
}

View File

@ -1,37 +1,35 @@
<template>
<page-layout :desc="desc">
<div class="page-body">
<div class="page-body">
<vxe-form :data="formOptions.data" ref="xForm" :title-width="formOptions.titleWidth"
:title-align="formOptions.titleAlign" :rules="formOptions.rules" :items="formOptions.items" titleColon>
<!-- =========================== 自定义区域 Start ======================= -->
<vxe-form :data="formOptions.data" ref="xForm" :title-width="formOptions.titleWidth"
:title-align="formOptions.titleAlign" :rules="formOptions.rules" :items="formOptions.items" titleColon>
<!-- =========================== 自定义区域 Start ======================= -->
<!-- =========================== 自定义区域 End ======================= -->
</vxe-form>
<!-- =========================== 自定义区域 End ======================= -->
</vxe-form>
<div class="mk-toolbar" v-if="isEdit">
</div>
<div class="footerbar">
<a-button type="primary" @click="ok">确定</a-button>
<a-button @click="cancel">取消</a-button>
</div>
<div class="mk-toolbar" v-if="isEdit">
</div>
</page-layout>
<div class="footerbar">
<a-button type="primary" @click="ok">确定</a-button>
<a-button @click="cancel">取消</a-button>
</div>
</div>
</template>
<script>
import BASE_URL from '@/services/Middle/transport/Maintenance/api.js';
import PageLayout from '@/layouts/PageLayout'
// import PageLayout from '@/layouts/PageLayout'
export default {
name: 'OtherExpensesLogUpdate',
i18n: require('./i18n'),
components: {PageLayout},
// components: {PageLayout},
props: {
pageMode: {
type: String,
@ -150,15 +148,35 @@ export default {
items: [
// =============================== Start ===============================
{field: 'truck_number_id', title: '车次id', span: 12, itemRender: {name: '$input'}},
{field: 'truck_number_code', title: '车次单号', span: 12, itemRender: {name: '$input'}},
{field: 'truck_id', title: '车辆id', span: 12, itemRender: {name: '$input'}},
{field: 'truck_code', title: '车辆编码', span: 12, itemRender: {name: '$input'}},
{field: 'truck_name', title: '车辆名称', span: 12, itemRender: {name: '$input'}},
{field: 'truck_number', title: '车牌号', span: 12, itemRender: {name: '$input'}},
{
title: '车辆', span: 6,
field: 'Truck',
dataRule: {
fromField: "name",
saveField: "name"
},
itemRender: {
name: 'MkFormDataSelector', props: {
params: {
dataType: "string",
valueField: "id",
textField: "name",
listdataFieldName: 'Truck',
dataUrl: `${BASE_URL.BASE_URL}/Truck/v1/truck/list`,
onDataChanged: ({ data }) => {
console.log(data)
this.formOptions.data.truck_id = data.id;
this.formOptions.data.truck_code = data.code;
this.formOptions.data.truck_name = data.name;
this.formOptions.data.truck_number = data.plate_number;
}
}
}
}
},
{field: 'other_expenses_name', title: '其他费用名称', span: 12, itemRender: {name: '$input'}},
{field: 'other_expenses_remark', title: '其他费用备注', span: 12, itemRender: {name: '$input'}},
{field: 'other_expenses_amount', title: '其他费用金额', span: 12, itemRender: {name: '$input'}},
{field: 'other_expenses_amount', title: '其他费用金额', span: 12, itemRender: {name: '$input', props: { type: 'number' }}},
// =============================== End ===============================
]
@ -270,8 +288,12 @@ export default {
let save = () => {
// this.formOptions.data.other_expenses_amount
this.formOptions.data.other_expenses_amount = parseFloat(this.formOptions.data.other_expenses_amount);
//
let action = !this.isEdit ? this.actions.create : this.actions.update;
let action = !this.isEdit ? this.actions.OtherExpensesLogCreate : this.actions.OtherExpensesLogUpdate;
// id id
let postdata = Object.assign({}, this.formOptions.data);
//

View File

@ -66,7 +66,7 @@ export default {
},
data() {
const listFieldName = 'other_expenses_log';
const listFieldName = 'OtherExpensesLog';
//
var pageData = { //
@ -178,12 +178,11 @@ export default {
// =============================== Start ===============================
{field: 'truck_number_id', sortable: true, title: '车次id', width: 250}, // id
{field: 'truck_number_code', sortable: true, title: '车次单号', width: 250}, //
{field: 'truck_id', sortable: true, title: '车辆id', width: 250}, // id
{field: 'truck_code', sortable: true, title: '车辆编码', width: 250}, //
{field: 'truck_name', sortable: true, title: '车辆名称', width: 250}, //
{field: 'truck_number', sortable: true, title: '车牌号', width: 250}, //
{field: 'truck_number_id', sortable: true, title: '车次id', width: 120}, // id
{field: 'truck_number_code', sortable: true, title: '车次单号', width: 120}, //
{field: 'truck_code', sortable: true, title: '车辆编码', width: 120}, //
{field: 'truck_name', sortable: true, title: '车辆名称', width: 120}, //
{field: 'truck_number', sortable: true, title: '车牌号', width: 120}, //
{field: 'other_expenses_name', sortable: true, title: '其他费用名称', width: 250}, //
{field: 'other_expenses_remark', sortable: true, title: '其他费用备注', width: 250}, //
@ -201,7 +200,7 @@ export default {
// =============================== Start ===============================
{title: '操作', slots: {default: 'op'}, width: 120}
{title: '操作', slots: {default: 'op'}, width: 120,fixed: 'right'}
]
}

View File

@ -1,65 +1,58 @@
<template>
<basic-page-edit :desc="desc" :dataId="getDataId()" :options="pageOptions"></basic-page-edit>
<div class="page-body">
<vxe-form :data="formOptions.data" ref="xForm" :title-width="formOptions.titleWidth"
:title-align="formOptions.titleAlign" :rules="formOptions.rules" :items="formOptions.items" titleColon>
<!-- =========================== 自定义区域 Start ======================= -->
<!-- =========================== 自定义区域 End ======================= -->
</vxe-form>
<div class="mk-toolbar" v-if="isEdit">
</div>
<div class="footerbar">
<a-button type="primary" @click="ok">确定</a-button>
<a-button @click="cancel">取消</a-button>
</div>
</div>
</template>
<script>
import BASE_URL from '@/services/Middle/transport/OilConsumption/api.js';
// import PageLayout from '@/layouts/PageLayout'
export default {
name: 'OilConsumptionUpdate',
i18n: require('./i18n'),
components: {},
// components: {PageLayout},
props: {
pageMode: {
type: String,
default: "edit"
},
dataId: {}
},
data() {
return {
pageOptions: {}
};
},
//
var pageData = {
//
currentConfigName: "",
// ID
currentBeid: 0,
computed: {
// desc() {
// return this.$t('editPageDesc')
// }
},
uploadDefaultImg: null,
detailDataFieldName: "OilConsumption",
created() {
this.optionsInit();
this.dataInit();
},
//
methods: {
optionsInit() {
//
var pageData = {
//
currentConfigName: "",
// ID
currentBeid: 0,
addPageUrl: "/OilConsumption/OilConsumptionCreate",
editPageUrl: "/OilConsumption/OilConsumptionUpdate/",
listPageUrl: "/OilConsumption/OilConsumptionList",
uploadDefaultImg: null, //
detailDataFieldName: "OilConsumption", //
actions: {
// =============================== Start ===============================
actions: {
// =============================== Start ===============================
OilConsumptionList: `${BASE_URL.BASE_URL}/OilConsumption/v1/oil/consumption/list`, //
OilConsumptionSearch: `${BASE_URL.BASE_URL}/OilConsumption/v1/oil/consumption/search`, //
OilConsumptionDetail: `${BASE_URL.BASE_URL}/OilConsumption/v1/oil/consumption/detail`, //
@ -70,17 +63,16 @@ export default {
OilConsumptionBatchUpdate: `${BASE_URL.BASE_URL}/OilConsumption/v1/oil/consumption/batchUpdate`, //
OilConsumptionBatchCreate: `${BASE_URL.BASE_URL}/OilConsumption/v1/oil/consumption/batchCreate`, //
OilConsumptionBatchHandle: `${BASE_URL.BASE_URL}/OilConsumption/v1/oil/consumption/batchHandle`, //
// =============================== End ===============================
},
// =============================== End ===============================
},
keyName: 'id',
//
isEdit: false,
//
formOptions: {
data: {
keyName: 'id',
//
isEdit: false,
//
formOptions: {
data: {
// =============================== Start ===============================
id: 0,
truck_number_id: 0,
@ -100,112 +92,163 @@ export default {
oil_consumption_remark: "",
create_uid: 0,
update_uid: 0,
},
//
titleWidth: 150,
//
titleAlign: 'right',
//
rules: {
// =============================== Start ===============================
// =============================== End ===============================
},
//
titleWidth: 150,
//
titleAlign: 'right',
//
rules: {
// =============================== Start ===============================
// =============================== End ===============================
},
//
items: [
// =============================== Start ===============================
{field: 'truck_id', title: '车辆id', span: 12, itemRender: {name: '$input'}},
{field: 'truck_code', title: '车辆编码', span: 12, itemRender: {name: '$input'}},
{field: 'truck_name', title: '车辆名称', span: 12, itemRender: {name: '$input'}},
{field: 'truck_number', title: '车牌号', span: 12, itemRender: {name: '$input'}},
{field: 'truck_number_before_mileage', title: '出车前总公里数', span: 12, itemRender: {name: '$input'}},
{field: 'truck_number_after_mileage', title: '回车后总公里数', span: 12, itemRender: {name: '$input'}},
{field: 'oil_consumption_number', title: '油耗数量', span: 12, itemRender: {name: '$input'}},
{field: 'oil_consumption_price', title: '油耗单价', span: 12, itemRender: {name: '$input'}},
{field: 'oil_consumption_total_price', title: '油耗总价', span: 12, itemRender: {name: '$input'}},
// =============================== End ===============================
},
//
items: [
// =============================== Start ===============================
// {
// title: '', span: 6,
// field: 'TrainNumber',
// dataRule: {
// fromField: "TrainNumber",
// saveField: "TrainNumber"
// },
// itemRender: {
// name: 'MkFormDataSelector', props: {
// params: {
// dataType: "string",
// valueField: "truck_number_id",
// textField: "truck_number_code",
// listdataFieldName: 'TrainNumber',
// dataUrl: `${BASE_URL.BASE_URL}/TrainNumber/v1/train/number/list`,
// onDataChanged: ({ data }) => {
// console.log(data)
// this.formOptions.data.truck_number_id = data.id;
// this.formOptions.data.truck_number_code = data.code;
// }
// }
// }
// }
// },
{
title: '车辆', span: 6,
field: 'Truck',
dataRule: {
fromField: "name",
saveField: "name"
},
itemRender: {
name: 'MkFormDataSelector', props: {
params: {
dataType: "string",
valueField: "id",
textField: "name",
listdataFieldName: 'Truck',
dataUrl: `${BASE_URL.BASE_URL}/Truck/v1/truck/list`,
onDataChanged: ({ data }) => {
console.log(data)
this.formOptions.data.truck_id = data.id;
this.formOptions.data.truck_code = data.code;
this.formOptions.data.truck_name = data.name;
this.formOptions.data.truck_number = data.plate_number;
}
}
}
}
},
{
field: 'oil_consumption_date',
dataRule: {type: "timestamp"},
title: '油耗日期',
span: 12,
span: 6,
itemRender: {name: '$input', props: {type: "date"}}
},
{field: 'oil_consumption_hundred', title: '百公里油耗', span: 12, itemRender: {name: '$input'}},
{field: 'oil_consumption_remark', title: '油耗备注', span: 12, itemRender: {name: '$input'}},
{field: 'truck_number_before_mileage', title: '出车前总公里数', span: 6, itemRender: {name: '$input'}},
{field: 'truck_number_after_mileage', title: '回车后总公里数', span: 6, itemRender: {name: '$input'}},
{field: 'oil_consumption_number', title: '油耗数量', span: 12, itemRender: {name: '$input', props: { type: 'number'}}},
{field: 'oil_consumption_price', title: '油耗单价', span: 12, itemRender: {name: '$input', props: { type: 'number'}}},
{field: 'oil_consumption_total_price', title: '油耗总价', span: 12, itemRender: {name: '$input', props: { type: 'number'}}},
{field: 'oil_consumption_hundred', title: '百公里油耗', span: 12, itemRender: {name: '$input', props: { type: 'number'}}},
{field: 'oil_consumption_remark', title: '油耗备注', span: 24, itemRender: {name: '$textarea'}},
// =============================== End ===============================
]
},
//
addModeItems: [],
// =============================== End ===============================
]
},
//
addModeItems: [],
};
pageData.actions.get = pageData.actions.OilConsumptionDetail;
pageData.actions.create = pageData.actions.OilConsumptionCreate;
pageData.actions.update = pageData.actions.OilConsumptionUpdate;
//
pageData.formOptions = Object.assign({}, this.$mk.config.defaults.formOptions, pageData.formOptions);
return pageData;
},
computed: {
// desc() {
// return this.$t('editPageDesc')
// }
},
};
created() {
pageData.actions.get = pageData.actions.OilConsumptionDetail;
pageData.actions.create = pageData.actions.OilConsumptionCreate;
pageData.actions.update = pageData.actions.OilConsumptionUpdate;
//
pageData.formOptions = Object.assign({}, this.$mk.config.defaults.formOptions, pageData.formOptions);
// id
let dataId = this.getDataId();
this.pageOptions = pageData;
},
dataInit() {
// id
let dataId = this.getDataId();
// id
if (dataId) {
const json = `{"id":${dataId}}`;
this.$mk.post({
url: this.pageOptions.actions.get,
loading: "加载中...",
data: json,
config: {
headers: {
'Content-Type': 'application/json'
}
// id
if (dataId) {
const json = `{"id":${dataId}}`;
this.$mk.post({
url: this.actions.get,
loading: "加载中...",
data: json,
config: {
headers: {
'Content-Type': 'application/json'
}
}).then(a => {
}
}).then(a => {
// =============================== Start ===============================
let detailDataFieldName = this.pageOptions.detailDataFieldName;
if (a.data[this.detailDataFieldName].create_time) {
a.data[this.detailDataFieldName].create_time = new Date(a.data[this.detailDataFieldName].create_time * 1000);
}
if (a.data[this.detailDataFieldName].update_time) {
a.data[this.detailDataFieldName].update_time = new Date(a.data[this.detailDataFieldName].update_time * 1000);
}
let rules = [
{field: "warehouse_effective_date", dataRule: "timestamp"},
{field: "warehouse_invalid_date", dataRule: "timestamp"},
{field: "create_time", dataRule: "timestamp"},
{field: "update_time", dataRule: "timestamp"},
];
rules = []; //
this.$mk.formatInitFormData({
data: a.data[detailDataFieldName],
rules: [...this.pageOptions.formOptions.items, ...rules]
}); //
// =============================== End ===============================
this.formOptions.data = a.data[this.detailDataFieldName];
}).catch((a) => {
this.$mk.error(a.data.msg);
});
this.pageOptions.formOptions.data = a.data[detailDataFieldName];
this.isEdit = true;
} else {
// id
this.addModeItems.forEach(item => {
this.formOptions.items.push(item);
})
this.$forceUpdate()
}).catch((a) => {
this.$mk.error(a.data.msg);
});
}
this.pageOptions.isEdit = true;
},
//
methods: {
this.$forceUpdate()
} else {
// id
this.addModeItems.forEach(item => {
this.pageOptions.formOptions.items.push(item);
})
}
},
// id
getDataId() {
@ -217,6 +260,86 @@ export default {
dataId = 0;
}
return dataId;
},
//
back() {
//
if (!this.isEdit) {
this.$closePage({
closeRoute: "/OilConsumption/OilConsumptionCreate"
});
} else {
//
this.$closePage({
closeRoute: "/OilConsumption/OilConsumptionUpdate"
});
}
//
this.$openPage('/OilConsumption/OilConsumptionList')
},
//
ok() {
let save = () => {
// this.formOptions.data.tire_count
this.formOptions.data.oil_consumption_number = parseFloat(this.formOptions.data.oil_consumption_number);
this.formOptions.data.oil_consumption_price = parseFloat(this.formOptions.data.oil_consumption_price);
this.formOptions.data.oil_consumption_total_price = parseFloat(this.formOptions.data.oil_consumption_total_price);
this.formOptions.data.oil_consumption_hundred = parseFloat(this.formOptions.data.oil_consumption_hundred);
this.formOptions.data. truck_number_before_mileage = parseFloat(this.formOptions.data. truck_number_before_mileage);
this.formOptions.data. truck_number_after_mileage = parseFloat(this.formOptions.data. truck_number_after_mileage);
//
let action = !this.isEdit ? this.actions.OilConsumptionCreate : this.actions.OilConsumptionUpdate;
// id id
let postdata = Object.assign({}, this.formOptions.data);
//
if (this.isEdit) {
// postdata = { OilConsumption: postdata }
}
//
this.$mk.formatFormData({data: postdata, rules: this.formOptions.items});
//
this.$mk.post({
url: action,
loading: "保存中...",
data: postdata,
useBigInt: true,
}).then(() => { //
this.$mk.success("保存成功");
if (!this.isEdit) { //
this.back();
}
}).catch((a) => { //
this.$mk.error(a.data.msg); //
});
};
//
this.$mk.validateForm({form: this.$refs.xForm}).then(() => { //
save(); //
}).catch(count => { //
this.$mk.error(`存在${count}项错误,请检查`);
});
},
//
cancel() {
this.back();
}
},
//
@ -224,3 +347,35 @@ export default {
};
</script>
<style scoped lang="less">
.page-body {
padding: 30px;
background: @base-bg-color;
}
.formtabs .ant-tabs-tabpane {
/* background: white; */
padding: 12px;
}
.gridPanel {
height: calc(100vh - 600px);
}
.footerbar {
padding-left: 10px;
}
.imagePanel {
cursor: pointer;
padding: 10px;
width: 100px;
img {
width: 80px;
height: 80px;
}
}
</style>

View File

@ -165,16 +165,15 @@ export default {
// =============================== Start ===============================
{field: 'truck_number_id', sortable: true, title: '车次id', width: 250}, // id
{field: 'truck_number_code', sortable: true, title: '车次单号', width: 250}, //
{field: 'truck_id', sortable: true, title: '车辆id', width: 250}, // id
{field: 'truck_code', sortable: true, title: '车辆编码', width: 250}, //
{field: 'truck_name', sortable: true, title: '车辆名称', width: 250}, //
{field: 'truck_number', sortable: true, title: '车牌号', width: 250}, //
{field: 'truck_number_id', sortable: true, title: '车次id', width: 120}, // id
{field: 'truck_number_code', sortable: true, title: '车次单号', width: 120}, //
{field: 'truck_code', sortable: true, title: '车辆编码', width: 120}, //
{field: 'truck_name', sortable: true, title: '车辆名称', width: 120}, //
{field: 'truck_number', sortable: true, title: '车牌号', width: 120}, //
{field: 'oil_consumption_number', sortable: true, title: '油耗数量', width: 250}, //
{field: 'oil_consumption_price', sortable: true, title: '油耗单价', width: 250}, //
{field: 'oil_consumption_total_price', sortable: true, title: '油耗总价', width: 250}, //
{field: 'oil_consumption_date', sortable: true, title: '油耗日期', width: 250}, //
{field: 'oil_consumption_date', sortable: true, title: '油耗日期', width: 120}, //
{field: 'oil_consumption_hundred', sortable: true, title: '百公里油耗', width: 250}, //
{field: 'oil_consumption_remark', sortable: true, title: '油耗备注', width: 250}, //
@ -191,7 +190,7 @@ export default {
// =============================== Start ===============================
{title: '操作', slots: {default: 'op'}, width: 120}
{title: '操作', slots: {default: 'op'}, width: 120,fixed: 'right'}
]
}

View File

@ -195,7 +195,7 @@ export default {
// =============================== Start ===============================
{title: '操作', slots: {default: 'op'}, width: 120}
{title: '操作', slots: {default: 'op'}, width: 120,fixed: 'right'}
]
}

View File

@ -193,7 +193,7 @@ export default {
// =============================== Start ===============================
{title: '操作', slots: {default: 'op'}, width: 120}
{title: '操作', slots: {default: 'op'}, width: 120,fixed: 'right'}
]
}

View File

@ -1,64 +1,58 @@
<template>
<basic-page-edit :desc="desc" :dataId="getDataId()" :options="pageOptions"></basic-page-edit>
<div class="page-body">
<vxe-form :data="formOptions.data" ref="xForm" :title-width="formOptions.titleWidth"
:title-align="formOptions.titleAlign" :rules="formOptions.rules" :items="formOptions.items" titleColon>
<!-- =========================== 自定义区域 Start ======================= -->
<!-- =========================== 自定义区域 End ======================= -->
</vxe-form>
<div class="mk-toolbar" v-if="isEdit">
</div>
<div class="footerbar">
<a-button type="primary" @click="ok">确定</a-button>
<a-button @click="cancel">取消</a-button>
</div>
</div>
</template>
<script>
import BASE_URL from '@/services/Middle/transport/Tire/api.js';
// import PageLayout from '@/layouts/PageLayout'
export default {
name: 'TireUpdate',
i18n: require('./i18n'),
components: {},
// components: {PageLayout},
props: {
pageMode: {
type: String,
default: "edit"
},
dataId: {}
},
data() {
return {
pageOptions: {}
};
},
//
var pageData = {
//
currentConfigName: "",
// ID
currentBeid: 0,
computed: {
// desc() {
// return this.$t('editPageDesc')
// }
},
uploadDefaultImg: null,
detailDataFieldName: "Tire",
created() {
this.optionsInit();
this.dataInit();
},
//
methods: {
optionsInit() {
//
var pageData = {
//
currentConfigName: "",
// ID
currentBeid: 0,
addPageUrl: "/Truck/TruckCreate",
editPageUrl: "/Truck/TruckUpdate/",
listPageUrl: "/Truck/TruckList",
uploadDefaultImg: null,
detailDataFieldName: "mes_warehouse",
actions: {
// =============================== Start ===============================
actions: {
// =============================== Start ===============================
TireList: `${BASE_URL.BASE_URL}/Tire/v1/tire/list`, //
TireSearch: `${BASE_URL.BASE_URL}/Tire/v1/tire/search`, //
TireDetail: `${BASE_URL.BASE_URL}/Tire/v1/tire/detail`, //
@ -70,17 +64,16 @@ export default {
TireBatchCreate: `${BASE_URL.BASE_URL}/Tire/v1/tire/batchCreate`, //
TireBatchHandle: `${BASE_URL.BASE_URL}/Tire/v1/tire/batchHandle`, //
TireAbolish: `${BASE_URL.BASE_URL}/Tire/v1/tire/abolish`, //
// =============================== End ===============================
},
// =============================== End ===============================
},
keyName: 'id',
//
isEdit: false,
//
formOptions: {
data: {
keyName: 'id',
//
isEdit: false,
//
formOptions: {
data: {
// =============================== Start ===============================
truck_number_id: 0,
truck_number_code: "",
truck_id: 0,
@ -105,109 +98,173 @@ export default {
create_uid: 0,
update_uid: 0,
tire_date: new Date(2100, 1, 1).getTime() / 10000,
},
//
titleWidth: 150,
//
titleAlign: 'right',
//
rules: {
// =============================== Start ===============================
// =============================== End ===============================
},
//
titleWidth: 100,
//
titleAlign: 'right',
//
rules: {
// =============================== Start ===============================
// =============================== End ===============================
},
//
items: [
// =============================== Start ===============================
{field: 'truck_id', title: '车辆id', span: 12, itemRender: {name: '$input'}},
{field: 'truck_code', title: '车辆编码', span: 12, itemRender: {name: '$input'}},
{field: 'truck_name', title: '车辆名称', span: 12, itemRender: {name: '$input'}},
{field: 'truck_number', title: '车牌号', span: 12, itemRender: {name: '$input'}},
{field: 'tire_type', title: '轮胎更换类型', span: 12, itemRender: {name: '$input'}},
{field: 'tire_brand', title: '轮胎品牌', span: 12, itemRender: {name: '$input'}},
{field: 'tire_model', title: '轮胎型号', span: 12, itemRender: {name: '$input'}},
{field: 'tire_count', title: '轮胎更换数量', span: 12, itemRender: {name: '$input'}},
{field: 'tire_price', title: '轮胎更换价格', span: 12, itemRender: {name: '$input'}},
{field: 'tire_number', title: '轮胎胎号', span: 12, itemRender: {name: '$input'}},
{field: 'tire_remark', title: '轮胎更换备注', span: 12, itemRender: {name: '$input'}},
// =============================== End ===============================
},
//
items: [
// =============================== Start ===============================
// {
// title: '', span: 6,
// field: 'TrainNumber',
// dataRule: {
// fromField: "TrainNumber",
// saveField: "TrainNumber"
// },
// itemRender: {
// name: 'MkFormDataSelector', props: {
// params: {
// dataType: "string",
// valueField: "truck_number_id",
// textField: "truck_number_code",
// listdataFieldName: 'TrainNumber',
// dataUrl: `${BASE_URL.BASE_URL}/TrainNumber/v1/train/number/list`,
// onDataChanged: ({ data }) => {
// console.log(data)
// this.formOptions.data.truck_number_id = data.id;
// this.formOptions.data.truck_number_code = data.code;
// }
// }
// }
// }
// },
{
title: '车辆', span: 6,
field: 'Truck',
dataRule: {
fromField: "name",
saveField: "name"
},
itemRender: {
name: 'MkFormDataSelector', props: {
params: {
dataType: "string",
valueField: "id",
textField: "name",
listdataFieldName: 'Truck',
dataUrl: `${BASE_URL.BASE_URL}/Truck/v1/truck/list`,
onDataChanged: ({ data }) => {
console.log(data)
this.formOptions.data.truck_id = data.id;
this.formOptions.data.truck_code = data.code;
this.formOptions.data.truck_name = data.name;
this.formOptions.data.truck_number = data.plate_number;
}
}
}
}
},
{
field: 'tire_type', title: '类型', span: 12,
itemRender: {
name: '$select',
props: {
options: [
{ label: '更换', value: '1' },
{ label: '补胎', value: '2' },
]
}
}
},
{ field: 'tire_brand', title: '品牌', span: 12, itemRender: { name: '$input' } },
{ field: 'tire_model', title: '型号', span: 12, itemRender: { name: '$input' } },
{ field: 'tire_count', title: '数量', span: 12, itemRender: { name: '$input' , props: { type: 'number' }} },
{ field: 'tire_price', title: '价格', span: 12, itemRender: { name: '$input', props: { type: 'number' } } },
{ field: 'tire_number', title: '胎号', span: 12, itemRender: { name: '$input' } },
{ field: 'tire_remark', title: '备注', span: 12, itemRender: { name: '$input' } },
{
field: 'tire_date',
dataRule: {type: "timestamp"},
title: '轮胎更换日期',
dataRule: { type: "timestamp" },
title: '日期',
span: 12,
itemRender: {name: '$input', props: {type: "date"}}
itemRender: { name: '$input', props: { type: "date" } }
},
// =============================== End ===============================
]
},
//
addModeItems: [],
// =============================== End ===============================
]
},
//
addModeItems: [],
};
};
pageData.actions.get = pageData.actions.TruckDetail;
pageData.actions.create = pageData.actions.TruckCreate;
pageData.actions.update = pageData.actions.TruckUpdate;
pageData.actions.get = pageData.actions.TireDetail;
pageData.actions.create = pageData.actions.TireCreate;
pageData.actions.update = pageData.actions.TireUpdate;
//
pageData.formOptions = Object.assign({}, this.$mk.config.defaults.formOptions, pageData.formOptions);
//
pageData.formOptions = Object.assign({}, this.$mk.config.defaults.formOptions, pageData.formOptions);
this.pageOptions = pageData;
},
return pageData;
},
dataInit() {
// id
let dataId = this.getDataId();
// id
if (dataId) {
const json = `{"id":${dataId}}`;
this.$mk.post({
url: this.pageOptions.actions.get,
loading: "加载中...",
data: json,
config: {
headers: {
'Content-Type': 'application/json'
}
computed: {
// desc() {
// return this.$t('editPageDesc')
// }
},
created() {
// id
let dataId = this.getDataId();
// id
if (dataId) {
const json = `{"id":${dataId}}`;
this.$mk.post({
url: this.actions.get,
loading: "加载中...",
data: json,
config: {
headers: {
'Content-Type': 'application/json'
}
}).then(a => {
}
}).then(a => {
// =============================== Start ===============================
let detailDataFieldName = this.pageOptions.detailDataFieldName;
if (a.data[this.detailDataFieldName].create_time) {
a.data[this.detailDataFieldName].create_time = new Date(a.data[this.detailDataFieldName].create_time * 1000);
}
if (a.data[this.detailDataFieldName].update_time) {
a.data[this.detailDataFieldName].update_time = new Date(a.data[this.detailDataFieldName].update_time * 1000);
}
let rules = [
{field: "warehouse_effective_date", dataRule: "timestamp"},
{field: "warehouse_invalid_date", dataRule: "timestamp"},
{field: "create_time", dataRule: "timestamp"},
{field: "update_time", dataRule: "timestamp"},
];
rules = []; //
this.$mk.formatInitFormData({
data: a.data[detailDataFieldName],
rules: [...this.pageOptions.formOptions.items, ...rules]
}); //
// =============================== End ===============================
this.formOptions.data = a.data[this.detailDataFieldName];
}).catch((a) => {
this.$mk.error(a.data.msg);
});
this.pageOptions.formOptions.data = a.data[detailDataFieldName];
this.isEdit = true;
} else {
// id
this.addModeItems.forEach(item => {
this.formOptions.items.push(item);
})
this.$forceUpdate()
}).catch((a) => {
this.$mk.error(a.data.msg);
});
}
this.pageOptions.isEdit = true;
},
//
methods: {
this.$forceUpdate()
} else {
// id
this.addModeItems.forEach(item => {
this.pageOptions.formOptions.items.push(item);
})
}
},
// id
getDataId() {
@ -219,6 +276,83 @@ export default {
dataId = 0;
}
return dataId;
},
//
back() {
//
if (!this.isEdit) {
this.$closePage({
closeRoute: "/Tire/TireAdd"
});
} else {
//
this.$closePage({
closeRoute: "/Tire/TireUpdate"
});
}
//
this.$openPage('/Tire/TireList')
},
//
ok() {
let save = () => {
// this.formOptions.data.tire_count
this.formOptions.data.tire_count = parseFloat(this.formOptions.data.tire_count);
this.formOptions.data.tire_price = parseFloat(this.formOptions.data.tire_price);
//
let action = !this.isEdit ? this.actions.TireCreate : this.actions.TireUpdate;
// id id
let postdata = Object.assign({}, this.formOptions.data);
//
if (this.isEdit) {
// postdata = { Tire: postdata }
}
//
this.$mk.formatFormData({data: postdata, rules: this.formOptions.items});
//
this.$mk.post({
url: action,
loading: "保存中...",
data: postdata,
useBigInt: true,
}).then(() => { //
this.$mk.success("保存成功");
if (!this.isEdit) { //
this.back();
}
}).catch((a) => { //
this.$mk.error(a.data.msg); //
});
};
//
this.$mk.validateForm({form: this.$refs.xForm}).then(() => { //
save(); //
}).catch(count => { //
this.$mk.error(`存在${count}项错误,请检查`);
});
},
//
cancel() {
this.back();
}
},
//
@ -226,3 +360,35 @@ export default {
};
</script>
<style scoped lang="less">
.page-body {
padding: 30px;
background: @base-bg-color;
}
.formtabs .ant-tabs-tabpane {
/* background: white; */
padding: 12px;
}
.gridPanel {
height: calc(100vh - 600px);
}
.footerbar {
padding-left: 10px;
}
.imagePanel {
cursor: pointer;
padding: 10px;
width: 100px;
img {
width: 80px;
height: 80px;
}
}
</style>

View File

@ -166,27 +166,25 @@ export default {
// =============================== Start ===============================
{field: 'truck_number_id', sortable: true, title: '车次id', width: 250}, // id
{field: 'truck_number_code', sortable: true, title: '车次单号', width: 250}, //
{field: 'truck_id', sortable: true, title: '车辆id', width: 250}, // id
{field: 'truck_code', sortable: true, title: '车辆编码', width: 250}, //
{field: 'truck_name', sortable: true, title: '车辆名称', width: 250}, //
{field: 'truck_number', sortable: true, title: '车牌号', width: 250}, //
{field: 'tire_type', sortable: true, title: '轮胎更换类型', width: 250}, // : 1.,2.
{field: 'tire_brand', sortable: true, title: '轮胎品牌', width: 250}, //
{field: 'tire_model', sortable: true, title: '轮胎型号', width: 250}, //
{field: 'tire_count', sortable: true, title: '轮胎更换数量', width: 250}, //
{field: 'tire_price', sortable: true, title: '轮胎更换价格', width: 250}, //
{field: 'old_tire_number', sortable: true, title: '轮胎更换旧胎号', width: 250}, //
{field: 'last_mileage', sortable: true, title: '更换公里数', width: 250}, //
{field: 'tire_number', sortable: true, title: '轮胎胎号', width: 250}, //
{field: 'mileage', sortable: true, title: '轮胎使用公里数', width: 250}, // 使
{field: 'tire_change_date', sortable: true, title: '轮胎更换日期间隔', width: 250}, //
{field: 'tire_change_mileage', sortable: true, title: '轮胎更换公里数间隔', width: 250}, //
{field: 'tire_abolish_date', sortable: true, title: '轮胎作废日期', width: 250}, //
{field: 'tire_abolish_mileage', sortable: true, title: '轮胎作废公里数', width: 250}, //
{field: 'tire_mileage', sortable: true, title: '轮胎使用公里数', width: 250}, // 使
{field: 'tire_remark', sortable: true, title: '轮胎更换备注', width: 250}, //
// {field: 'truck_number_id', sortable: true, title: 'id', width: 120}, // id
{field: 'truck_number_code', sortable: true, title: '车次单号', width: 120}, //
{field: 'truck_code', sortable: true, title: '车辆编码', width: 120}, //
{field: 'truck_name', sortable: true, title: '车辆名称', width: 120}, //
{field: 'truck_number', sortable: true, title: '车牌号', width: 120}, //
{field: 'tire_type', sortable: true, title: '类型', width: 70}, // : 1.,2.
{field: 'tire_brand', sortable: true, title: '品牌', width: 100}, //
{field: 'tire_model', sortable: true, title: '型号', width: 100}, //
{field: 'tire_count', sortable: true, title: '更换数量', width: 100}, //
{field: 'tire_price', sortable: true, title: '价格', width: 120}, //
{field: 'tire_number', sortable: true, title: '胎号', width: 150}, //
{field: 'old_tire_number', sortable: true, title: '旧胎号', width: 150}, //
{field: 'last_mileage', sortable: true, title: '更换时公里数', width: 130}, //
{field: 'mileage', sortable: true, title: '使用公里数', width: 120}, // 使
{field: 'tire_change_date', sortable: true, title: '更换日期间隔',formatter: 'formatDate', width: 150}, //
{field: 'tire_change_mileage', sortable: true, title: '更换公里数间隔', width: 150}, //
{field: 'tire_abolish_date', sortable: true, title: '作废日期',formatter: 'formatDate', width: 120}, //
{field: 'tire_abolish_mileage', sortable: true, title: '作废公里数', width: 120}, //
{field: 'tire_remark', sortable: true, title: '备注', width: 250}, //
{
field: 'create_time',
@ -201,7 +199,7 @@ export default {
// =============================== Start ===============================
{title: '操作', slots: {default: 'op'}, width: 120}
{title: '操作', slots: {default: 'op'}, width: 120,fixed: 'right'}
]
}

View File

@ -192,15 +192,15 @@ export default {
outsourcing_driver_name: "",
outsourcing_driver_phone: "",
is_need_outbound: 0,
truck_name: null,
truck_id: null,
driver_id: null,
truck_name: "",
truck_id: 0,
driver_id: 0,
outbound_date: new Date(2100, 1, 1).getTime() / 10000,
return_date: new Date(2100, 1, 1).getTime() / 10000,
end_mileage: 0,
driver_subsidy_remark: "",
is_change_tire: 0,
tire_id: null,
tire_id: 0,
is_repair: 0,
repair_id: 0,
is_oil: 0,
@ -361,7 +361,7 @@ export default {
items: [
// =============================== Start ===============================
{field:'',title:'',span:24,isTitle:true,Htitle:'车辆信息',itemRender:{}},//线
{field: 'is_outsourcing', title: '是否委外', span: 3, itemRender: { name: '$switch', props: { openLabel: '是', openValue: 1, closeValue: 0, closeLabel: '否' } }},
{field: 'is_outsourcing', title: '是否委外', span: 24, itemRender: { name: '$switch', props: { openLabel: '是', openValue: 1, closeValue: 0, closeLabel: '否' } }},
{field: 'outsourcing_truck_number',isOutsourcing:true, title: '委外车牌号', span: 7, itemRender: {name: '$input'}},
{field: 'outsourcing_driver_name',isOutsourcing:true, title: '委外司机姓名', span: 7, itemRender: {name: '$input'}},
{
@ -401,14 +401,14 @@ export default {
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`,
onDataChanged: ({data}) => {
console.log(data)
this.formOptions.data.warehouse_mobile = data.phone;
this.formOptions.data.driver_id = data.id;
}
}
}
}
},
{field: 'driver_salary', title: '司机工资', span: 6, itemRender: {name: '$input', props: {type: "number"}, events: { input: this.handleInputNumber }}},
{field: 'is_need_outbound', title: '是否需要出车', span: 6, itemRender: { name: '$switch', props: { openLabel: '是', openValue: 1, closeValue: 0, closeLabel: '否' } }},
{field: 'is_need_outbound', title: '是否需要出车', span: 24, itemRender: { name: '$switch', props: { openLabel: '是', openValue: 1, closeValue: 0, closeLabel: '否' } }},
{
field: 'outbound_date',
dataRule: {type: "timestamp"},
@ -718,6 +718,7 @@ export default {
this.formOptions.data.other_expenses_log.forEach(item => {
console.log(item)
item.other_expenses_amount = Number(item.other_expenses_amount)
console.log("item.driver_id",item.driver_id)
})
let postdata = Object.assign({}, this.formOptions.data);
//

View File

@ -31,7 +31,47 @@
<vxe-grid ref='xGrid' v-bind="gridOptions">
<!-- =============================== 表格列 自动生成 Start =============================== -->
<template #truck_id="{ row }">
{{ row.truck_name }}
</template>
<template #driver_id="{ row }">
{{ row.driver_name }}
</template>
<template #is_outsourcing="{ row }">
<a-tag color="green" v-if="row.is_outsourcing === 1">
委外出车
</a-tag>
<a-tag color="blue" v-if="row.is_need_outbound === 1">
正常出车
</a-tag>
</template>
<template #is_change_tire="{ row }">
<a-tag color="green" v-if="row.is_change_tire === 0">
</a-tag>
<a-tag color="red" v-else>
</a-tag>
</template>
<template #is_repair="{ row }">
<a-tag color="green" v-if="row.is_repair === 0">
</a-tag>
<a-tag color="red" v-else>
</a-tag>
</template>
<template #is_oil="{ row }">
<a-tag color="green" v-if="row.is_oil === 0">
</a-tag>
<a-tag color="red" v-else>
</a-tag>
</template>
<!-- =============================== 表格列 自动生成 End =============================== -->
<template #op="{ row }">
@ -103,7 +143,12 @@ export default {
],
//
searchFormItems: [ //
{field: 'code', title: '车次单号', span: 5, itemRender: {name: '$input', props: {placeholder: '请输入车次单号'}}},
{
field: 'code',
title: '车次单号',
span: 5,
itemRender: {name: '$input', props: {placeholder: '请输入车次单号'}}
},
// {field: 'desc', title: '', span: 5, itemRender: {name: '$input', props: {placeholder: ''}}},
{span: 8, slots: {default: 'date'}}, //
{
@ -162,59 +207,66 @@ export default {
// =============================== Start ===============================
{field: 'code', sortable: true, title: '车次单号', width: 250}, //
{field: 'code',align: 'center', sortable: true, title: '车次单号', width: 120}, //
{field: 'truck_id', align: 'center',sortable: true, title: '车辆', width: 150,
slots: {default: 'truck_id'}}, // id
{field: 'driver_id',align: 'center', sortable: true, title: '司机', width: 150,
slots: {default: 'driver_id'}}, // id
// {field: 'custom_id', sortable: true, title: 'id', width: 250}, // id
{field: 'custom_name', sortable: true, title: '客户名称', width: 250}, //
{field: 'custom_name', align: 'center',sortable: true, title: '客户名称', width: 200}, //
// {field: 'supplier_id', sortable: true, title: 'id', width: 250}, // id
{field: 'supplier_name', sortable: true, title: '供应商名称', width: 250}, //
{field: 'supplier_name', align: 'center',sortable: true, title: '供应商名称', width: 200}, //
// {field: 'soil_quality_material_id', sortable: true, title: 'id', width: 250}, // id
// {field: 'outbound_soil_quality_material_id', sortable: true, title: 'id', width: 250}, // id
// {field: 'warehousing_soil_quality_material_id', sortable: true, title: 'id', width: 250}, // id
{field: 'is_outsourcing', sortable: true, title: '是否委外', width: 250}, //
{field: 'outsourcing_truck_number', sortable: true, title: '委外车牌号', width: 250}, //
{field: 'outsourcing_driver_name', sortable: true, title: '委外司机姓名', width: 250}, //
{field: 'outsourcing_driver_phone', sortable: true, title: '委外司机手机号', width: 250}, //
{field: 'is_need_outbound', sortable: true, title: '是否需要出车', width: 250}, //
{field: 'truck_id', sortable: true, title: '车辆', width: 250}, // id
{field: 'driver_id', sortable: true, title: '司机id', width: 250}, // id
{field: 'outbound_date', sortable: true, title: '出车日期', width: 250}, //
{field: 'return_date', sortable: true, title: '回车日期', width: 250}, //
{field: 'outbound_remark', sortable: true, title: '出车备注', width: 250}, //
{field: 'end_mileage', sortable: true, title: '结束公里数', width: 250}, //
{field: 'driver_subsidy_remark', sortable: true, title: '司机补贴备注', width: 250}, //
{field: 'is_change_tire', sortable: true, title: '是否更换轮胎', width: 250}, //
{field: 'tire_id', sortable: true, title: '轮胎id', width: 250}, // id
{field: 'is_repair', sortable: true, title: '是否维修', width: 250}, //
{field: 'repair_id', sortable: true, title: '维修id', width: 250}, // id
{field: 'is_oil', sortable: true, title: '是否加油', width: 250}, //
{field: 'oil_id', sortable: true, title: '加油id', width: 250}, // id
{field: 'other_id', sortable: true, title: '其他费用id', width: 250}, // id
// {field: 'unit_price', sortable: true, title: '', width: 120}, //
// {field: 'total_price', sortable: true, title: '', width: 120}, //
{field: 'is_outsourcing', align: 'center',sortable: true, title: '类型', width: 80,
slots: {default: 'is_outsourcing'}
}, //
// {field: 'is_need_outbound', sortable: true, title: '', width: 70}, //
{field: 'outbound_date', align: 'center',sortable: true, formatter: 'formatDate', title: '出车日期', width: 100}, //
{field: 'return_date', align: 'center',sortable: true, formatter: 'formatDate', title: '回车日期', width: 100}, //
{
field: 'create_time',
formatter: 'formatDate',
width: 100,
sortable: true,
title: '创建时间',
showHeaderOverflow: true
}, //
field: 'is_change_tire', align: 'center',sortable: true, title: '更换轮胎', width: 100,
slots: {default: 'is_change_tire'}
}, //
{field: 'is_repair', align: 'center',sortable: true, title: '维修', width: 70,
slots: {default: 'is_repair'}
}, //
{field: 'is_oil',align: 'center', sortable: true, title: '加油', width: 70,
slots: {default: 'is_oil'}
}, //
{field: 'outbound_mileage', sortable: true, title: '出车公里数', width: 250}, //
{field: 'income', sortable: true, title: '收入', width: 250}, //
{field: 'cost', sortable: true, title: '成本', width: 250}, //
{field: 'profit', sortable: true, title: '利润', width: 250}, //
{field: 'unit_price', sortable: true, title: '单价', width: 250}, //
{field: 'total_price', sortable: true, title: '总价', width: 250}, //
{field: 'supplier_outbound_tonnage', sortable: true, title: '供应商出库吨位', width: 250}, //
{field: 'customer_warehousing_tonnage', sortable: true, title: '客户入库吨位', width: 250}, //
{field: 'driver_salary', sortable: true, title: '司机工资', width: 250}, //
{field: 'driver_subsidy', sortable: true, title: '司机补贴', width: 250}, //
// {
// field: 'create_time',
// formatter: 'formatDate',
// width: 100,
// sortable: true,
// title: '',
// showHeaderOverflow: true
// }, //
{field: 'outbound_mileage', align: 'center',sortable: true, title: '出车公里数', width: 120}, //
{field: 'outbound_remark', align: 'center',sortable: true, title: '出车备注', width: 250}, //
{
field: 'income', sortable: true, title: '收入', width: 80, fixed: 'right',
align: 'center',
}, //
{
field: 'cost', sortable: true, title: '成本', width: 80, fixed: 'right',
align: 'center',
}, //
{
field: 'profit', sortable: true, title: '利润', width: 80, fixed: 'right',
align: 'center',
}, //
// =============================== Start ===============================
{title: '操作', slots: {default: 'op'}, width: 120}
{title: '操作', slots: {default: 'op'}, width: 120, fixed: 'right'}
]
}

View File

@ -1,72 +1,78 @@
<template>
<div>
<basic-page-edit :dataId="getDataId()" :options="pageOptions" @afterSave="afterSave"></basic-page-edit>
<div class="page-body">
<div class="page-header">
<a-descriptions title="User Info">
<a-descriptions-item label="UserName">
Zhou Maomao
</a-descriptions-item>
<a-descriptions-item label="Telephone">
1810000000
</a-descriptions-item>
<a-descriptions-item label="Live">
Hangzhou, Zhejiang
</a-descriptions-item>
<a-descriptions-item label="Remark">
empty
</a-descriptions-item>
<a-descriptions-item label="Address">
No. 18, Wantang Road, Xihu District, Hangzhou, Zhejiang, China
</a-descriptions-item>
</a-descriptions>
</div>
<vxe-form :data="formOptions.data" ref="xForm" :title-width="formOptions.titleWidth"
:title-align="formOptions.titleAlign" :rules="formOptions.rules" :items="formOptions.items" titleColon>
<!-- =========================== 自定义区域 Start ======================= -->
<!-- =========================== 自定义区域 End ======================= -->
</vxe-form>
<div class="mk-toolbar" v-if="isEdit">
</div>
<div class="footerbar">
<a-button type="primary" @click="ok">确定</a-button>
<a-button @click="cancel">取消</a-button>
</div>
<!-- <Update :options="pageOptions"></Update> -->
</div>
</template>
<script>
// import BASE_URL from '@/services/Middle/transport/Truck/api.js';
// import PageLayout from '@/layouts/PageLayout'
// import Update from "@/pages/Middle/transport/Truck/Truck/Update.vue";
export default {
// i18n: require('./i18n'),
components: {
// Update
},
name: 'TruckUpdate',
i18n: require('./i18n'),
// components: {PageLayout},
props: {
pageMode: {
type: String,
default: "edit"
},
dataId: {}
},
data() {
return {
pageOptions: {}
};
},
//
var pageData = {
//
currentConfigName: "",
// ID
currentBeid: 0,
computed: {
// desc() {
// return this.$t('editPageDesc')
// }
},
uploadDefaultImg: null,
detailDataFieldName: "truck",
created() {
this.optionsInit();
this.dataInit();
},
//
methods: {
optionsInit() {
//
var pageData = {
//
currentConfigName: "",
// ID
currentBeid: 0,
addPageUrl: "/Truck/TruckCreate",
editPageUrl: "/Truck/TruckUpdate/",
listPageUrl: "/Truck/TruckList",
uploadDefaultImg: null,
detailDataFieldName: "truck",
actions: {
// =============================== Start ===============================
actions: {
// =============================== Start ===============================
TruckList: `${this.$BASE_URL}/Truck/v1/truck/list`, //
TruckSearch: `${this.$BASE_URL}/Truck/v1/truck/search`, //
TruckDetail: `${this.$BASE_URL}/Truck/v1/truck/detail`, //
@ -78,18 +84,18 @@ export default {
TruckBatchCreate: `${this.$BASE_URL}/Truck/v1/truck/batchCreate`, //
TruckBatchHandle: `${this.$BASE_URL}/Truck/v1/truck/batchHandle`, //
// =============================== End ===============================
},
// =============================== End ===============================
},
keyName: 'id',
//
isEdit: false,
//
formOptions: {
data: {
keyName: 'id',
//
isEdit: false,
//
formOptions: {
data: {
// =============================== Start ===============================
id: 0,
id: 0,
code: "",
name: "",
plate_number: "",
@ -111,17 +117,20 @@ export default {
remark: "",
create_uid: 0,
update_uid: 0,
},
//
titleWidth: 125,
//
titleAlign: 'right',
current_distance:0,
//
rules: {
// =============================== Start ===============================
// =============================== End ===============================
},
//
titleWidth: 150,
//
titleAlign: 'right',
code: [
//
rules: {
// =============================== Start ===============================
code: [
{message: '请输入编码'}
],
name: [
@ -160,11 +169,15 @@ export default {
remark: [
{message: '请输入车辆备注'}
],
// =============================== End ===============================
},
//
items: [
// =============================== Start ===============================
current_distance: [
{message: '请输入当前公里数'}
],
// =============================== End ===============================
},
//
items: [
// =============================== Start ===============================
{field:'',title:'',span:24,isTitle:true,Htitle:'车辆信息',itemRender:{}},//线
{field: 'code', title: '编码', span: 12, itemRender: {name: '$input'}},
{field: 'name', title: '名称', span: 12, itemRender: {name: '$input'}},
@ -172,79 +185,82 @@ export default {
{field: 'type', title: '类型', span: 6, itemRender: {name: '$input'}},
{field: 'manager_name', title: '负责人姓名', span: 6, itemRender: {name: '$input'}},
{field: 'manager_phone', title: '负责人电话', span: 6, itemRender: {name: '$input'}},
{field: 'remark', title: '备注', span: 24, itemRender: {name: '$input'}},
{field: 'current_distance', title: '车辆当前公里数', span: 6, itemRender: {name: '$input',props:{type:'number'}}},
{field: 'remark', title: '备注', span: 24, itemRender: {name: '$textarea'}},
// =============================== End ===============================
]
},
//
addModeItems: [],
// =============================== End ===============================
]
},
//
addModeItems: [],
};
};
pageData.actions.get = pageData.actions.TruckDetail;
pageData.actions.create = pageData.actions.TruckCreate;
pageData.actions.update = pageData.actions.TruckUpdate;
pageData.actions.get = pageData.actions.TruckDetail;
pageData.actions.create = pageData.actions.TruckCreate;
pageData.actions.update = pageData.actions.TruckUpdate;
//
pageData.formOptions = Object.assign({}, this.$mk.config.defaults.formOptions, pageData.formOptions);
//
pageData.formOptions = Object.assign({}, this.$mk.config.defaults.formOptions, pageData.formOptions);
this.pageOptions = pageData;
},
return pageData;
},
//
dataInit() {
// id
let dataId = this.getDataId();
// id
if (dataId) {
const json = `{"id":${dataId}}`;
this.$mk.post({
url: this.pageOptions.actions.get,
loading: "加载中...",
data: json,
config: {
headers: {
'Content-Type': 'application/json'
}
computed: {
// desc() {
// return this.$t('editPageDesc')
// }
},
created() {
// id
let dataId = this.getDataId();
// id
if (dataId) {
const json = `{"id":${dataId}}`;
this.$mk.post({
url: this.actions.get,
loading: "加载中...",
data: json,
config: {
headers: {
'Content-Type': 'application/json'
}
}).then(a => {
}
}).then(a => {
// =============================== Start ===============================
let detailDataFieldName = this.pageOptions.detailDataFieldName;
let rules = [
{field: "warehouse_effective_date", dataRule: "timestamp"},
{field: "warehouse_invalid_date", dataRule: "timestamp"},
{field: "create_time", dataRule: "timestamp"},
{field: "update_time", dataRule: "timestamp"},
];
rules = []; //
this.$mk.formatInitFormData({
data: a.data[detailDataFieldName],
rules: [...this.pageOptions.formOptions.items, ...rules]
}); //
this.pageOptions.formOptions.data = a.data[detailDataFieldName];
this.$forceUpdate()
}).catch((a) => {
this.$mk.error(a.data.msg);
});
this.pageOptions.isEdit = true;
this.$forceUpdate()
} else {
// id
if (this.pageOptions.addModeItems.length > 0) {
this.addModeItems.forEach(item => {
this.pageOptions.formOptions.items.push(item);
})
if (a.data[this.detailDataFieldName].create_time) {
a.data[this.detailDataFieldName].create_time = new Date(a.data[this.detailDataFieldName].create_time * 1000);
}
if (a.data[this.detailDataFieldName].update_time) {
a.data[this.detailDataFieldName].update_time = new Date(a.data[this.detailDataFieldName].update_time * 1000);
}
}
},
// =============================== End ===============================
this.formOptions.data = a.data[this.detailDataFieldName];
}).catch((a) => {
this.$mk.error(a.data.msg);
});
this.isEdit = true;
} else {
// id
this.addModeItems.forEach(item => {
this.formOptions.items.push(item);
})
}
},
//
methods: {
// id
getDataId() {
@ -257,8 +273,80 @@ export default {
}
return dataId;
},
afterSave(data) {
console.log("afterSave:", data);
//
back() {
//
if (!this.isEdit) {
this.$closePage({
closeRoute: "/Truck/TruckCreate"
});
} else {
//
this.$closePage({
closeRoute: "/Truck/TruckUpdate"
});
}
//
this.$openPage('/Truck/TruckList')
},
//
ok() {
let save = () => {
// this.formOptions.data.tire_count
this.formOptions.data.current_distance = Number(this.formOptions.data.current_distance);
//
let action = !this.isEdit ? this.actions.TruckCreate : this.actions.TruckUpdate;
// id id
let postdata = Object.assign({}, this.formOptions.data);
//
if (this.isEdit) {
// postdata = { Truck: postdata }
}
//
this.$mk.formatFormData({data: postdata, rules: this.formOptions.items});
//
this.$mk.post({
url: action,
loading: "保存中...",
data: postdata,
useBigInt: true,
}).then(() => { //
this.$mk.success("保存成功");
if (!this.isEdit) { //
this.back();
}
}).catch((a) => { //
this.$mk.error(a.data.msg); //
});
};
//
this.$mk.validateForm({form: this.$refs.xForm}).then(() => { //
save(); //
}).catch(count => { //
this.$mk.error(`存在${count}项错误,请检查`);
});
},
//
cancel() {
this.back();
}
},
//
@ -266,3 +354,35 @@ export default {
};
</script>
<style scoped lang="less">
.page-body {
padding: 30px;
background: @base-bg-color;
}
.formtabs .ant-tabs-tabpane {
/* background: white; */
padding: 12px;
}
.gridPanel {
height: calc(100vh - 600px);
}
.footerbar {
padding-left: 10px;
}
.imagePanel {
cursor: pointer;
padding: 10px;
width: 100px;
img {
width: 80px;
height: 80px;
}
}
</style>

View File

@ -84,6 +84,7 @@ export default {
{field: 'code', sortable: true, title: '编码', width: 120}, //
{field: 'plate_number', sortable: true, title: '车牌号', width: 120}, //
{field: 'type', sortable: true, title: '车辆类型', width: 120}, //
{field: 'current_distance', sortable: true, title: '当前公里数', width: 150}, //
{field: 'manager_name', sortable: true, title: '负责人姓名', width: 120}, //
{field: 'manager_phone', sortable: true, title: '负责人电话', width: 150}, //
{field: 'out_count', sortable: true, title: '出车次数', width: 120}, //