表单列表修改

This commit is contained in:
ljx 2024-03-19 17:33:20 +08:00
parent d45c3e80fe
commit bf13d95f7b
6 changed files with 81 additions and 56 deletions

View File

@ -2,8 +2,17 @@
<div class="page-body">
<vxe-form :data="options.formOptions.data" ref="xForm" :title-width="options.formOptions.titleWidth"
:title-align="options.formOptions.titleAlign" :rules="options.formOptions.rules" :items="options.formOptions.items"
:title-align="options.formOptions.titleAlign" :rules="options.formOptions.rules"
titleColon>
<vxe-form-item v-for="(item,index) in options.formOptions.items" :title="item.title" :field="item.field" :span="item.span" :key="index" :item-render="item.itemRender">
<div v-if="item.isTitle" class="Htitle">
<div class="left-line"></div>
<p class="Htitle-p">
{{ item.Htitle }}
</p>
<div class="right-line"></div>
</div>
</vxe-form-item>
</vxe-form>
<div class="footerbar">
@ -194,6 +203,7 @@ export default {
.footerbar {
padding-left: 10px;
padding-top: 20px;
}
.imagePanel {
@ -206,4 +216,16 @@ export default {
height: 80px;
}
}
.Htitle{
font-weight: bold;
font-size: 16px;
color: #122ed1;
display: flex;
align-items: center;
width: 100%;
padding-left: 10px;
.Htitle-p{margin-bottom: 0;margin: 0 10px;}
.left-line{width: 40px;height: 1px;background-color:#122ed1;}
.right-line{flex-grow: 1;height: 1px;background-color:#122ed1;}
}
</style>

View File

@ -1,5 +1,5 @@
<template>
<basic-page-edit :desc="desc" :dataId="getDataId()" :options="pageOptions"></basic-page-edit>
<basic-page-edit :dataId="getDataId()" :options="pageOptions"></basic-page-edit>
</template>
<script>
@ -102,14 +102,14 @@ export default {
total_count: 0,
last_time: "",
remark: "",
status: 0,
status: 1,
total_balance: 0,
total_amount: 0,
create_uid: 0,
update_uid: 0,
},
//
titleWidth: 150,
titleWidth: 125,
//
titleAlign: 'right',
@ -164,21 +164,22 @@ export default {
//
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'}},
{field: 'type', title: '类型', span: 6, itemRender: { name: '$select', props: { options:[{value:"0",label:"客户"},{value:"1",label:"供应商"}] } }},
{field: 'level', title: '等级', span: 6, itemRender: {name: '$input',props: {type: "number"},}},
{field: 'source', title: '来源', span: 6, itemRender: {name: '$input'}},
{field: 'industry', title: '行业', span: 6, itemRender: {name: '$input'}},
{field: 'area', title: '区域', span: 6, itemRender: {name: '$input'}},
{field: 'contact', title: '联系人', span: 6, itemRender: {name: '$input'}},
{field: 'contact_phone', title: '联系人电话', span: 6, itemRender: {name: '$input',props: {type: "number"},}},
{field: 'contact_position', title: '联系人职位', span: 6, itemRender: {name: '$input'}},
{field: 'address', title: '地址', span: 24, itemRender: {name: '$input'}},
{field: 'description', title: '描述', span: 24, itemRender: {name: '$input'}},
{field: 'type', title: '客户类型', span: 6, itemRender: {name: '$input'}},
{field: 'level', title: '客户等级', span: 6, itemRender: {name: '$input'}},
{field: 'source', title: '客户来源', span: 6, itemRender: {name: '$input'}},
{field: 'industry', title: '客户行业', span: 6, itemRender: {name: '$input'}},
{field: 'area', title: '客户区域', span: 6, itemRender: {name: '$input'}},
{field: 'contact', title: '客户联系人', span: 6, itemRender: {name: '$input'}},
{field: 'contact_phone', title: '客户联系人电话', span: 6, itemRender: {name: '$input'}},
{field: 'contact_position', title: '客户联系人职位', span: 6, itemRender: {name: '$input'}},
{field: 'address', title: '客户地址', span: 24, itemRender: {name: '$input'}},
{field: 'remark', title: '备注', span: 12, itemRender: {name: '$input'}},
{field: 'status', title: '状态', span: 12, itemRender: {name: '$select',}},
{field: 'remark', title: '备注', span: 24, itemRender: {name: '$input'}},
{field: 'status', title: '状态', span: 12, itemRender: { name: '$switch', props: { openLabel: '启用', openValue: 1, closeValue: 0, closeLabel: '禁用' } }},
// =============================== End ===============================
]

View File

@ -1,5 +1,5 @@
<template>
<page-layout :desc="desc">
<!-- <page-layout :desc="desc"> -->
<div class="page-body">
<vxe-form :data="formOptions.data" ref="xForm" :title-width="formOptions.titleWidth"
@ -19,19 +19,19 @@
</div>
</div>
</page-layout>
<!-- </page-layout> -->
</template>
<script>
import BASE_URL from '@/services/Middle/transport/DriverWages/api.js';
import PageLayout from '@/layouts/PageLayout'
// import PageLayout from '@/layouts/PageLayout'
export default {
name: 'DriverWagesUpdate',
i18n: require('./i18n'),
components: {PageLayout},
// components: {PageLayout},
props: {
pageMode: {
type: String,

View File

@ -1,5 +1,5 @@
<template>
<page-layout :desc="desc">
<!-- <page-layout :desc="desc"> -->
<div class="page-body">
<vxe-form :data="formOptions.data" ref="xForm" :title-width="formOptions.titleWidth"
@ -19,19 +19,19 @@
</div>
</div>
</page-layout>
<!-- </page-layout> -->
</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: 'MaintenanceUpdate',
i18n: require('./i18n'),
components: {PageLayout},
// components: {PageLayout},
props: {
pageMode: {
type: String,
@ -115,7 +115,7 @@ export default {
{field: 'code', title: '编码', span: 12, itemRender: {name: '$input'}},
{field: 'name', title: '名称', span: 12, itemRender: {name: '$input'}},
{field: 'description', title: '描述', span: 12, itemRender: {name: '$input'}},
{field: 'description', title: '描述', span: 24, itemRender: {name: '$input'}},
// =============================== End ===============================
]
@ -297,6 +297,7 @@ export default {
}
.footerbar {
padding-top: 20px;
padding-left: 10px;
}

View File

@ -101,7 +101,7 @@ export default {
update_uid: 0,
},
//
titleWidth: 150,
titleWidth: 125,
//
titleAlign: 'right',
@ -129,12 +129,12 @@ export default {
//
items: [
// =============================== Start ===============================
{field: 'code', title: '编码', span: 12, itemRender: {name: '$input'}},
{field: 'name', title: '品名', span: 12, itemRender: {name: '$input'}},
{field: 'description', title: '描述', span: 12, itemRender: {name: '$input'}},
{field: 'image', title: '图片', span: 12, itemRender: {name: '$input'}},
{field: 'remark', title: '备注', span: 12, itemRender: {name: '$input'}},
{field:'',title:'',span:24,isTitle:true,Htitle:'土质物料信息',itemRender:{}},//线
{field: 'code', title: '编码', span: 8, itemRender: {name: '$input'}},
{field: 'name', title: '品名', span: 8, itemRender: {name: '$input'}},
{field: 'image', title: '图片', span: 8, itemRender: {name: '$input'}},
{field: 'description', title: '描述', span: 24, itemRender: {name: '$input'}},
{field: 'remark', title: '备注', span: 24, itemRender: {name: '$input'}},
// =============================== End ===============================

View File

@ -77,33 +77,17 @@
</vxe-table>
</div>
<div class="tablebox" v-if="formOptions.data.is_oil == 1">
<div class="tablebox">
<div class="Htitle" style="margin-bottom: 20px;">
<div class="left-line"></div>
<p class="Htitle-p">加油信息</p>
<div class="right-line"></div>
</div>
<vxe-table border show-overflow keep-source ref="xTable3" :data="tableData"
:edit-config="{ trigger: 'click', mode: 'cell', icon: 'vxe-icon-edit', showStatus: false, }">
<vxe-column width="60">
<template #default="{ row }">
<div style="font-size: 18px;">
<a @click.stop="pageAdd(row)" title="新增" style="margin-right: 5px;">
<a-icon type="plus-circle" />
</a>
<a @click.stop="pageDelete(row)" title="删除">
<a-icon type="delete" />
</a>
</div>
</template>
</vxe-column>
<vxe-column type="seq" width="60"></vxe-column>
<vxe-column field="name" title="加油数量" :edit-render="{ name: '$input',props: { type: 'number' }}"></vxe-column>
<vxe-column field="name1" title="油费单价" formatter="formatNumber" :edit-render="{ name: '$input',props: { type: 'number' } }"></vxe-column>
<vxe-column field="name2" title="油费总价" :edit-render="{ name: '$input',props: { type: 'number' } }"></vxe-column>
<vxe-column field="age" title="备注" :edit-render="{ name: '$input' }"></vxe-column>
</vxe-table>
<vxe-form :data="formOptions.data.oil_consumption" :title-width="formOptions.titleWidth"
:title-align="formOptions.titleAlign">
<vxe-form-item v-for="(item,index) in formOptions2.items" :title="item.title" :field="item.field" :span="item.span" :key="index" :item-render="item.itemRender">
</vxe-form-item>
</vxe-form>
</div>
<div class="tablebox">
<div class="Htitle" style="margin-bottom: 20px;">
@ -236,6 +220,12 @@ export default {
customer_warehousing_tonnage: 0,
driver_salary: 0,
driver_subsidy: 0,
oil_consumption:{
oil_consumption_number:null,
oil_consumption_price:null,
oil_consumption_total_price:null,
oil_consumption_remark:null,
},
other_expenses_log:[{
other_expenses_amount:null,
other_expenses_name: "",
@ -533,7 +523,6 @@ export default {
// {field: 'income', title: '', span: 8, itemRender: {name: '$input', props: {type: "number"}}},
// {field: 'cost', title: '', span: 8, itemRender: {name: '$input', props: {type: "number"}}},
// {field: 'profit', title: '', span: 8, itemRender: {name: '$input', props: {type: "number"}}},
@ -541,6 +530,14 @@ export default {
// =============================== End ===============================
]
},
formOptions2:{
items: [
{field: "oil_consumption_number", title: '油耗数量', span: 4, itemRender: {name: '$input', props: {type: "number"}, events: { input: this.handleInputNumber } }},
{field: "oil_consumption_price", title: '油耗单价', span: 4, itemRender: {name: '$input', props: {type: "number"}, events: { input: this.handleInputNumber } }},
{field: "oil_consumption_total_price", title: '油耗总价', span: 4, itemRender: {name: '$input', props: {type: "number"}, events: { input: this.handleInputNumber }}},
{field: "oil_consumption_remark", title: '油耗备注', span: 12, itemRender: {name: '$input'}},
]
},
//
addModeItems: [],
tableData: [
@ -698,7 +695,11 @@ export default {
},
handleInputNumber(e){
if(e.field){
this.formOptions.data[e.field] = Number(this.formOptions.data[e.field])
if(e.field.includes('oil_consumption')){
this.formOptions.data.oil_consumption[e.field] = Number(this.formOptions.data.oil_consumption[e.field])
}else{
this.formOptions.data[e.field] = Number(this.formOptions.data[e.field])
}
}else{
return
}