This commit is contained in:
ljx 2024-05-15 16:26:48 +08:00
parent 4529931416
commit 39fee5e0b3
5 changed files with 153 additions and 42 deletions

View File

@ -94,7 +94,7 @@
</template>
</vxe-form>
<!-- 表格区 -->
<div class="gridPanel">
<div class="">
<vxe-grid ref='xGrid' v-bind="gridOptions">
<!-- =============================== 表格列 自动生成 Start =============================== -->
@ -289,6 +289,14 @@ export default {
{ field: 'outbound_mileage', align: 'center', sortable: true, title: '出车公里数', width: 120 }, //
{ field: 'outbound_remark', align: 'center', sortable: true, title: '出车备注', width: 250 }, //
{ field: 'accessories_fee', align: 'center', sortable: true, title: '配件费', width: 120 }, //
{ field: 'repair_fee', align: 'center', sortable: true, title: '维修费', width: 120 }, //
{ field: 'electric_fee', align: 'center', sortable: true, title: '电器费', width: 120 }, //
{ field: 'tire_cost', align: 'center', sortable: true, title: '轮胎费', width: 120 }, //
{ field: 'tire_fee', align: 'center', sortable: true, title: '轮胎工费', width: 120 }, //
{ field: 'other_fee', align: 'center', sortable: true, title: '其他费用', width: 120 }, //
{ field: 'truck_profit', align: 'center', sortable: true, title: '车利润', width: 120 }, //
{ field: 'material_profit', align: 'center', sortable: true, title: '土利润', width: 120 }, //
{
field: 'income', sortable: true, title: '收入', width: 80, fixed: 'right',
align: 'center',

View File

@ -29,7 +29,7 @@
<div @click="nowIndex = index">
<vxe-form :data="item" :title-width="formOptions.titleWidth"
:title-align="formOptions.titleAlign">
<vxe-form-item v-for="(item,index) in train_numberOptions.items" :title="item.title" :field="item.field" :span="item.span" :key="index" :item-render="item.itemRender">
<vxe-form-item v-for="(i,idx) in train_numberOptions.items" :title="i.title" :field="i.field" :span="i.span" :key="idx" :item-render="i.itemRender" :visible="isShow2(i,index)">
</vxe-form-item>
</vxe-form>
</div>
@ -39,7 +39,7 @@
<vxe-form :data="formOptions.data" ref="xForm1" :title-width="formOptions.titleWidth"
:title-align="formOptions.titleAlign" :rules="formOptions.rules" titleColon>
<!-- =========================== 自定义区域 Start ======================= -->
<vxe-form-item v-for="(item,index) in driver_subsidyOptions.items" :title="item.title" :field="item.field" :span="item.span" :key="index" :item-render="item.itemRender" :visible="isShow(item)">
<vxe-form-item v-for="(item,index) in driver_subsidyOptions.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">
@ -159,7 +159,7 @@
<vxe-form :data="formOptions.data" ref="xForm2" :title-width="formOptions.titleWidth"
:title-align="formOptions.titleAlign" :rules="formOptions.rules" titleColon>
<!-- =========================== 自定义区域 Start ======================= -->
<vxe-form-item v-for="(item,index) in formOptions3.items" :title="item.title" :field="item.field" :span="item.span" :key="index" :item-render="item.itemRender" :visible="isShow(item)">
<vxe-form-item v-for="(item,index) in formOptions3.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">
@ -219,6 +219,7 @@ export default {
TrainNumberList: `${BASE_URL.BASE_URL}/TrainNumber/v1/train/number/list`, //
TrainNumberSearch: `${BASE_URL.BASE_URL}/TrainNumber/v1/train/number/search`, //
TrainNumberDetail: `${BASE_URL.BASE_URL}/TrainNumber/v1/train/number/detail`, //
SoilQualityMaterialDetail:`${BASE_URL.BASE_URL}/SoilQualityMaterial/v1/soil/quality/material/detail`, //
TrainNumberCreate: `${BASE_URL.BASE_URL}/TrainNumber/v1/train/number/create`, //
TrainNumberUpdate: `${BASE_URL.BASE_URL}/TrainNumber/v1/train/number/update`, //
TrainNumberDelete: `${BASE_URL.BASE_URL}/TrainNumber/v1/train/number/detele`, //
@ -272,6 +273,8 @@ export default {
supplier_id: 0,
supplier_name: "",
soil_quality_material_id: 0,
soil_name_1:'',
soil_name_2:'',
outbound_soil_quality_material_id: 0,
warehousing_soil_quality_material_id: 0,
outbound_remark: "",
@ -496,8 +499,7 @@ export default {
textField: "name",
listdataFieldName: 'Truck',
dataUrl: `${BASE_URL.BASE_URL}/Truck/v1/truck/list`,
onDataChanged: ({value,data}) => {
console.log(value,data)
onDataChanged: ({data}) => {
this.formOptions.data.truck_id = data.id;
this.formOptions.data.current_distance = data.current_distance;
this.formOptions.data.end_mileage = data.current_distance;
@ -517,7 +519,6 @@ export default {
listdataFieldName: 'MesStaff',
dataUrl: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`,
onDataChanged: ({data}) => {
console.log(data)
this.formOptions.data.driver_id = data.id;
}
}
@ -566,9 +567,9 @@ export default {
}
],
},
onDataChanged: ({value,data}) => {
console.log(value,data)
onDataChanged: ({data}) => {
this.formOptions.data.custom_id = data.id;
this.handleSoilName();
}
}
}
@ -590,9 +591,9 @@ export default {
],
},
dataUrl: `${BASE_URL.BASE_URL}/Custom/v1/custom/list`,
onDataChanged: ({value,data}) => {
console.log(value,data)
onDataChanged: ({data}) => {
this.formOptions.data.supplier_id = data.id;
this.handleSoilName();
}
}
}
@ -614,17 +615,17 @@ export default {
// ],
// },
dataUrl: `${BASE_URL.BASE_URL}/SoilQualityMaterial/v1/soil/quality/material/list`,
onDataChanged: ({value,data}) => {
console.log(value,data)
onDataChanged: ({data}) => {
this.formOptions.data.soil_quality_material_id = data.id;
this.formOptions.data.buy_unit_price = data.price;
this.formOptions.data.unit_price = data.price;
this.handleSoilName();
}
}
}
}},
{field: 'soil_name_1', title: '物料别名(客户)', span: 8,isSoil1:true, itemRender: {name: '$input', props: {type: "",readonly:true}}},
{field: 'soil_name_2', title: '物料别名(供应商)', span: 8,isSoil2:true, itemRender: {name: '$input', props: {type: "",readonly:true}}},
// {field: 'outbound_soil_quality_material_id', title: '', span: 8, itemRender: {name: '$input'}},
{field: 'supplier_outbound_tonnage',title: '供应商出库吨位',span: 8,itemRender: {name: '$input', props: {type: "number"}, events: { input: this.handleInputNumber,blur:this.handleBuyTotalPrice }}},
@ -701,9 +702,9 @@ export default {
}
],
},
onDataChanged: ({value,data}) => {
console.log(value,data)
onDataChanged: ({data}) => {
this.formOptions.data.train_number[this.nowIndex].custom_id = data.id;
this.handleSoilName1();
}
}
}
@ -725,9 +726,9 @@ export default {
],
},
dataUrl: `${BASE_URL.BASE_URL}/Custom/v1/custom/list`,
onDataChanged: ({value,data}) => {
console.log(value,data)
onDataChanged: ({data}) => {
this.formOptions.data.train_number[this.nowIndex].supplier_id = data.id;
this.handleSoilName1();
}
}
}
@ -740,15 +741,17 @@ export default {
textField: "name",
listdataFieldName: 'SoilQualityMaterial',
dataUrl: `${BASE_URL.BASE_URL}/SoilQualityMaterial/v1/soil/quality/material/list`,
onDataChanged: ({value,data}) => {
console.log(value,data)
onDataChanged: ({data}) => {
this.formOptions.data.train_number[this.nowIndex].soil_quality_material_id = data.id;
this.formOptions.data.train_number[this.nowIndex].buy_unit_price = data.price;
this.formOptions.data.train_number[this.nowIndex].unit_price = data.price;
this.handleSoilName1();
}
}
}
}},
{field: 'soil_name_1', title: '物料别名(客户)', span: 8,isSoil1:true, itemRender: {name: '$input', props: {type: "",readonly:true} }},
{field: 'soil_name_2', title: '物料别名(供应商)', span: 8,isSoil2:true, itemRender: {name: '$input', props: {type: "",readonly:true}}},
{field: 'supplier_outbound_tonnage',title: '供应商出库吨位',span: 8,itemRender: {name: '$input', props: {type: "number"}, events: { input: this.handleInputNumber,blur:this.handleBuyTotalPrice1 }}},
{field: 'buy_unit_price', title: '购入单价', span: 8, itemRender: {name: '$input', props: {type: "number"}, events: { input: this.handleInputNumber,blur:this.handleBuyTotalPrice1 } }},
{field: 'buy_total_price', title: '购入总价', span: 8, itemRender: {name: '$input', props: {type: "number"}, events: { input: this.handleInputNumber }}},
@ -902,7 +905,7 @@ export default {
this.$openPage('/TrainNumber/TrainNumberList')
},
isShow(item){
if(!item.isOutsourcing && !item.isNeedOutbound){
if(!item.isOutsourcing && !item.isNeedOutbound && !item.isSoil1 && !item.isSoil2){
return true
}
if(item.isOutsourcing && this.formOptions.data.is_outsourcing == 1){
@ -910,7 +913,28 @@ export default {
}
if(item.isNeedOutbound && this.formOptions.data.is_need_outbound == 1){
return true
}else{
}
if(item.isSoil1 && this.formOptions.data.custom_name && this.formOptions.data.soil_quality_material){
return true
}
if(item.isSoil2 && this.formOptions.data.supplier_name && this.formOptions.data.soil_quality_material){
return true
}
else{
return false
}
},
isShow2(item,index){
if(!item.isSoil1 && !item.isSoil2){
return true
}
if(item.isSoil1 && this.formOptions.data.train_number[index].custom_name && this.formOptions.data.train_number[index].soil_quality_material){
return true
}
if(item.isSoil2 && this.formOptions.data.train_number[index].supplier_name && this.formOptions.data.train_number[index].soil_quality_material){
return true
}
else{
return false
}
},
@ -921,6 +945,8 @@ export default {
custom_name: "",
supplier_id: null,
supplier_name: "",
soil_name_1:'',
soil_name_2:'',
soil_quality_material_id: null,
supplier_outbound_tonnage:0,
//
@ -955,7 +981,6 @@ export default {
pageDelete(row,field,table) {
const $table = this.$refs[table];
console.log(this.formOptions.data[field])
if (this.formOptions.data[field].length == 1) {
this.$mk.error("至少保留一行");
return;
@ -1002,6 +1027,63 @@ export default {
handleOilTotalPrice(){
this.formOptions.data.oil_consumption['oil_consumption_total_price'] = this.formOptions.data.oil_consumption['oil_consumption_number']*this.formOptions.data.oil_consumption['oil_consumption_price'];
},
handleSoilName(){
if(this.formOptions.data.custom_id && this.formOptions.data.soil_quality_material_id){
let postdata = {
custom_id: this.formOptions.data.custom_id,
id: this.formOptions.data.soil_quality_material_id
}
this.$mk.post({
url: this.actions.SoilQualityMaterialDetail,
data: postdata,
useBigInt: true,
}).then((res) => {
this.formOptions.data.soil_name_1 = res.data.soil_quality_material.name
})
}
if(this.formOptions.data.supplier_name&&this.formOptions.data.soil_quality_material_id){
let postdata = {
custom_id: this.formOptions.data.supplier_id,
id: this.formOptions.data.soil_quality_material_id
}
this.$mk.post({
url: this.actions.SoilQualityMaterialDetail,
data: postdata,
useBigInt: true,
}).then((res) => {
this.formOptions.data.soil_name_2 = res.data.soil_quality_material.name
})
}
},
handleSoilName1(){
if(this.formOptions.data.train_number[this.nowIndex].custom_id && this.formOptions.data.train_number[this.nowIndex].soil_quality_material_id){
let postdata = {
custom_id: this.formOptions.data.train_number[this.nowIndex].custom_id,
id: this.formOptions.data.train_number[this.nowIndex].soil_quality_material_id
}
this.$mk.post({
url: this.actions.SoilQualityMaterialDetail,
data: postdata,
useBigInt: true,
}).then((res) => {
this.formOptions.data.train_number[this.nowIndex].soil_name_1 = res.data.soil_quality_material.name
})
}
if(this.formOptions.data.train_number[this.nowIndex].supplier_name&&this.formOptions.data.train_number[this.nowIndex].soil_quality_material_id){
let postdata = {
custom_id: this.formOptions.data.train_number[this.nowIndex].supplier_id,
id: this.formOptions.data.train_number[this.nowIndex].soil_quality_material_id
}
this.$mk.post({
url: this.actions.SoilQualityMaterialDetail,
data: postdata,
useBigInt: true,
}).then((res) => {
this.formOptions.data.train_number[this.nowIndex].soil_name_2 = res.data.soil_quality_material.name
})
}
},
//
ok() {

View File

@ -324,7 +324,16 @@ export default {
// }, //
{ field: 'outbound_mileage', align: 'center', sortable: true, title: '出车公里数', width: 120 }, //
{ field: 'outbound_remark', align: 'center', sortable: true, title: '出车备注', width: 250 }, //
{ field: 'outbound_remark', align: 'center', sortable: true, title: '出车备注', width: 120 }, //
{ field: 'accessories_fee', align: 'center', sortable: true, title: '配件费', width: 120 }, //
{ field: 'repair_fee', align: 'center', sortable: true, title: '维修费', width: 120 }, //
{ field: 'electric_fee', align: 'center', sortable: true, title: '电器费', width: 120 }, //
{ field: 'tire_cost', align: 'center', sortable: true, title: '轮胎费', width: 120 }, //
{ field: 'tire_fee', align: 'center', sortable: true, title: '轮胎工费', width: 120 }, //
{ field: 'other_fee', align: 'center', sortable: true, title: '其他费用', width: 120 }, //
{ field: 'truck_profit', align: 'center', sortable: true, title: '车利润', width: 120 }, //
{ field: 'material_profit', align: 'center', sortable: true, title: '土利润', width: 120 }, //
{
field: 'income', sortable: true, title: '收入', width: 80, fixed: 'right',
align: 'center',

View File

@ -50,7 +50,7 @@
</a-descriptions>
<a-tabs default-active-key="1" size="large">
<a-tab-pane key="1" tab="货车收入列表">
<a-tab-pane key="1" tab="货车收入列表" style="min-height: 400px;">
<TruckIncomeList :ListUrl="TruckIncomeList" :ListUrlData="TSelectData" :ListFieldName="TSelectDataFieldName"
:Columns="this.$data.Tcolumns" :truckID="truckID">
</TruckIncomeList>
@ -129,26 +129,38 @@ export default {
{
field: 'is_outsourcing', align: 'center', sortable: true, title: '类型', width: 80,
slots: { default: 'is_outsourcing' }
}, //
// {field: 'is_need_outbound', sortable: true, title: '', width: 70}, //
},
//
{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: 'is_oil', align: 'center', sortable: true, title: '加油', width: 70,
slots: { default: 'is_oil' }
}, //
{ 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',
// }, //
{ field: 'accessories_fee', align: 'center', sortable: true, title: '配件费', width: 120 }, //
{ field: 'repair_fee', align: 'center', sortable: true, title: '维修费', width: 120 }, //
{ field: 'electric_fee', align: 'center', sortable: true, title: '电器费', width: 120 }, //
{ field: 'tire_cost', align: 'center', sortable: true, title: '轮胎费', width: 120 }, //
{ field: 'tire_fee', align: 'center', sortable: true, title: '轮胎工费', width: 120 }, //
{ field: 'other_fee', align: 'center', sortable: true, title: '其他费用', width: 120 }, //
{ field: 'truck_profit', align: 'center', sortable: true, title: '车利润', width: 120 }, //
{ field: 'material_profit', align: 'center', sortable: true, title: '土利润', width: 120 }, //
{
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 ===============================

View File

@ -126,7 +126,7 @@ export default {
export: true, //
custom: true, //
slots: {
buttons: 'toolbar_buttons' //
buttons: 'toolbar_buttons', //
}
},
columns: this.Columns, //