This commit is contained in:
xielue 2023-07-03 18:22:39 +08:00
parent 937d0307d8
commit 7e833a5d3f
5 changed files with 233 additions and 87 deletions

View File

@ -74,7 +74,8 @@
<vxe-column field="paint_material" title="材料(油漆)" width="160" :params="editorMaterial" formatter="formatRef"
:edit-render="{ name: 'MkGridDataSelector' }"></vxe-column>
<vxe-column field="long_formula" title="长" width="160" :edit-render="{ name: 'EditExpressions' }">
<vxe-column field="long_formula" title="长" width="160" :edit-render="{ name: 'EditExpressions' }"
:params="{ moreExpressionsList: getMoreExpressionsList_material_height }">
<template #default="{ row }">
<a-tooltip>
<template slot="title">
@ -87,7 +88,8 @@
</a-tooltip>
</template>
</vxe-column>
<vxe-column field="width_formula" title="宽" width="160" :edit-render="{ name: 'EditExpressions' }">
<vxe-column field="width_formula" title="宽" width="160" :edit-render="{ name: 'EditExpressions' }"
:params="{ moreExpressionsList: getMoreExpressionsList_material_height }">
<template #default="{ row }">
<a-tooltip>
<template slot="title">
@ -100,7 +102,8 @@
</a-tooltip>
</template>
</vxe-column>
<vxe-column field="height_formula" title="厚" width="160" :edit-render="{ name: 'EditExpressions' }">
<vxe-column field="height_formula" title="厚" width="160" :edit-render="{ name: 'EditExpressions' }"
:params="{ moreExpressionsList: getMoreExpressionsList_material_height }">
<template #default="{ row }">
<a-tooltip>
<template slot="title">
@ -313,8 +316,24 @@
</a-tooltip>
</template>
</vxe-column>
<vxe-column field="price" title="单价" width="120"
:edit-render="{ name: '$input', props: { type: 'number' } }"></vxe-column>
<vxe-column field="price_formula" title="单价" width="200" :edit-render="{ name: 'EditExpressions' }">
<template #default="{ row }">
<a-tooltip>
<template slot="title">
{{ row.price_formula || '' }}
</template>
<span v-if="showExp">
{{ row.price_formula || '' }}
</span>
<span v-else v-html="formatShowNumber(row.price, 2)"></span>
</a-tooltip>
</template>
</vxe-column>
<vxe-column field="amount_formula" title="金额" width="200" :edit-render="{ name: 'EditExpressions' }">
<template #default="{ row }">
<a-tooltip>
@ -383,10 +402,10 @@
:edit-config="{ trigger: 'click', mode: 'cell', icon: 'vxe-icon-edit', showStatus: false, beforeEditMethod: material_beforeEditMethod }">
<vxe-column width="60" v-if="!isReadonly">
<template #default="{ row }">
<div class="oplinks2">
<a @click.stop="material_pageAdd(row)" title="新增">
<a-icon type="plus-circle" />
</a>
<div class="oplinks2">
<a @click.stop="material_pageAdd(row)" title="新增">
<a-icon type="plus-circle" />
</a>
<a @click.stop="material_pageDelete(row)" title="删除">
<a-icon type="delete" />
</a>
@ -397,8 +416,8 @@
<vxe-column field="material" title="材料" width="260" :params="editorMaterial2" formatter="formatRef"
:edit-render="{ name: 'MkGridDataSelector' }"></vxe-column>
<vxe-column field="quantity_formula" title="总用量" width="200"
:params="{hasTotalQuantity:true}" :edit-render="{ name: 'EditExpressions' }">
<vxe-column field="quantity_formula" title="总用量" width="200" :params="{ hasTotalQuantity: true }"
:edit-render="{ name: 'EditExpressions' }">
<template #default="{ row }">
<a-tooltip>
<template slot="title">
@ -414,6 +433,8 @@
</vxe-column>
<vxe-column field="price" title="单价" width="120"
:edit-render="{ name: '$input', props: { type: 'number' } }"></vxe-column>
<vxe-column field="amount_formula" title="金额" width="200" :edit-render="{ name: 'EditExpressions' }">
<template #default="{ row }">
<a-tooltip>
@ -566,8 +587,8 @@
<vxe-column field="material" title="材料" width="260" :params="editorMaterial2" formatter="formatRef"
:edit-render="{ name: 'MkGridDataSelector' }"></vxe-column>
<vxe-column field="quantity_formula" title="总用量" width="200"
:params="{hasTotalQuantity:true}" :edit-render="{ name: 'EditExpressions' }">
<vxe-column field="quantity_formula" title="总用量" width="200" :params="{ hasTotalQuantity: true }"
:edit-render="{ name: 'EditExpressions' }">
<template #default="{ row }">
<a-tooltip>
<template slot="title">
@ -723,9 +744,9 @@
v-model="modalVisible" @confirm="confirmSelectScheme">
<template #default>
<vxe-grid :keyboard-config="{ isArrow: true }" auto-resize height="400" ref="scheme_grid"
@cell-dblclick="dblClickEvent"
:row-config="{ isCurrent: true, isHover: true }" :loading="scheme_loading" :pager-config="scheme_tablePage"
:data="scheme_tableData" :columns="scheme_tableColumn" @page-change="scheme_pageChangeEvent">
@cell-dblclick="dblClickEvent" :row-config="{ isCurrent: true, isHover: true }" :loading="scheme_loading"
:pager-config="scheme_tablePage" :data="scheme_tableData" :columns="scheme_tableColumn"
@page-change="scheme_pageChangeEvent">
</vxe-grid>
</template>
</vxe-modal>
@ -778,7 +799,7 @@ export default {
showExp: false, //
showType: "1", //
modalVisible: false, //
isPreview:false, //
isPreview: false, //
scheme_loading: false, //
scheme_tableData: [], //
scheme_tableColumn: [ //
@ -831,7 +852,7 @@ export default {
],
placeholder: "请输入名称",
searchFieldNames: ['name'],
extendData : [{id:'封边条', name : '封边条'}],
extendData: [{ id: '封边条', name: '封边条' }],
textField: 'name'
},
editorBanding: {
@ -889,6 +910,8 @@ export default {
labor_detailsData: [], //
paintMaterial_detailsData: [], //
paintLabor_detailsData: [], //
bathroomMaterial_list: [],//
moreExpressionsList_material_height:[],//
expense_detailsData: [ //
{
@ -1139,7 +1162,7 @@ export default {
// id
let dataId = this.getDataId(); // id
if(dataId && dataId.indexOf && dataId.indexOf('d') == 0){ // id
if (dataId && dataId.indexOf && dataId.indexOf('d') == 0) { // id
this.isPreview = true; //
this.loadSchemeDataById(dataId.substr(1)); //
}
@ -1225,10 +1248,13 @@ export default {
data: { "page": 1, "limit": 100, "order_bys": [], "search_rules": [] }
}).then(a => {
this.bathroomMaterial_list = a.data.BathroomMaterial || [];
this.moreExpressionsList_material_height = [];
a.data.BathroomMaterial.forEach(o => { //
this.bathroomMaterial_list.forEach(o => { //
this.fittings_detailsData.forEach(item => { //
if (item.material && item.material[0] && item.material[0].toString() == o.id.toString()) { // idid
item.material_default_height = o.spec || "15"; //
@ -1238,10 +1264,19 @@ export default {
});
this.bathroomMaterial_list.forEach(o => { //
this.moreExpressionsList_material_height.push(this.formatName(o.name) +"的厚度");
});
});
},
getMoreExpressionsList_material_height(){
return this.moreExpressionsList_material_height;
},
loadSettings() { //
@ -1367,8 +1402,8 @@ export default {
this.scheme_load(); //
},
dblClickEvent( ) { //
this.confirmSelectScheme(); //
dblClickEvent() { //
this.confirmSelectScheme(); //
},
confirmSelectScheme() { //
let row = this.$refs.scheme_grid.getCurrentRecord(); //
@ -1378,7 +1413,7 @@ export default {
this.modalVisible = false; //
},
loadSchemeDataById(dataId){ //
loadSchemeDataById(dataId) { //
const json = `{"id":${dataId}}`; // json
this.$mk.post({ //
url: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/detail`, //
@ -1395,7 +1430,7 @@ export default {
});
},
loadSchemeData(row){ //
loadSchemeData(row) { //
let scheme_id = row.id.toString() // id
@ -1606,7 +1641,7 @@ export default {
if (column.field == "material") { //
this.resetMaterial(); //
if (selectedData.spec) { //
if (selectedData && selectedData.spec) { //
row.material_default_height = selectedData.spec; //
}
}
@ -1626,8 +1661,9 @@ export default {
}
},
//
fittings_onPopupSelected({ rows, name, params }) { // rows name params
fittings_onPopupSelected({ rows, name, params }) { // rows name params
console.log(rows, name, params); //
},
//
fittings_beforeEditMethod({ column, row }) { // column row
@ -1779,9 +1815,16 @@ export default {
//
packaging_onPulldownSelected({ row, name, params }) {
packaging_onPulldownSelected({ row, name, column,params, selectedData }) {
console.log(row, name, params);
if (column.field == "packaging") {
if (selectedData && selectedData.default_quantity) {
row.quantity = selectedData.default_quantity; //
}
}
},
//
packaging_onPopupSelected({ rows, name, params }) {
@ -2571,6 +2614,26 @@ export default {
return sum;
}
//
if (name.indexOf('的厚度') > 0) {
name = this.formatName(name);
name = name.substr(0, name.length - 3);
console.log(name);
let v = 0;
this.bathroomMaterial_list.forEach(o => { //
if (name == this.formatName(o.name)) {
v = parseFloat(o.spec || 15);
}
});
return v;
}
let fun = settings.expressionsDefines[name];
if (!fun) {
return defaultValue || 0;
@ -2625,7 +2688,7 @@ export default {
this.calculateRows({ detailsData: this.material_detailsData, names: ["quantity", "amount"], totalPrev: "material" });
//
this.calculateRows({ detailsData: this.labor_detailsData, names: ["amount"], totalPrev: "labor" });
//
//
this.calculateRows({ detailsData: this.paintMaterial_detailsData, names: ["quantity", "amount"], totalPrev: "paintMaterial" });
//
this.calculateRows({ detailsData: this.paintLabor_detailsData, names: ["amount"], totalPrev: "paintLabor" });

View File

@ -46,7 +46,8 @@
<vxe-column field="paint_material" title="材料(油漆)" width="160" :params="editorMaterial" formatter="formatRef"
:edit-render="{ name: 'MkGridDataSelector' }"></vxe-column>
<vxe-column field="long_formula" title="长" width="160" :edit-render="{ name: 'EditExpressions' }">
<vxe-column field="long_formula" title="长" width="160" :edit-render="{ name: 'EditExpressions' }"
:params="{ moreExpressionsList: getMoreExpressionsList_material_height }">
<template #default="{ row }">
<a-tooltip>
<template slot="title">
@ -59,7 +60,8 @@
</a-tooltip>
</template>
</vxe-column>
<vxe-column field="width_formula" title="宽" width="160" :edit-render="{ name: 'EditExpressions' }">
<vxe-column field="width_formula" title="宽" width="160" :edit-render="{ name: 'EditExpressions' }"
:params="{ moreExpressionsList: getMoreExpressionsList_material_height }">
<template #default="{ row }">
<a-tooltip>
<template slot="title">
@ -72,7 +74,8 @@
</a-tooltip>
</template>
</vxe-column>
<vxe-column field="height_formula" title="厚" width="160" :edit-render="{ name: 'EditExpressions' }">
<vxe-column field="height_formula" title="厚" width="160" :edit-render="{ name: 'EditExpressions' }"
:params="{ moreExpressionsList: getMoreExpressionsList_material_height }">
<template #default="{ row }">
<a-tooltip>
<template slot="title">
@ -710,6 +713,9 @@ export default {
parts_detailsData: [],
bathroomMaterial_list: [],//
moreExpressionsList_material_height: [],//
editorFittings: {
dataUrl: `${BASE_URL.BASE_URL}/BathroomFittings/v1/bathroom/fittings/list`,
listdataFieldName: 'BathroomFittings',
@ -927,8 +933,10 @@ export default {
}).then(a => {
this.bathroomMaterial_list = a.data.BathroomMaterial || [];
this.moreExpressionsList_material_height = [];
a.data.BathroomMaterial.forEach(o => {
this.bathroomMaterial_list.forEach(o => {
this.fittings_detailsData.forEach(item => {
if (item.material && item.material[0] && item.material[0].toString() == o.id.toString()) {
@ -938,11 +946,22 @@ export default {
});
this.bathroomMaterial_list.forEach(o => { //
this.moreExpressionsList_material_height.push(this.formatName(o.name) + "的厚度");
});
});
},
getMoreExpressionsList_material_height() {
return this.moreExpressionsList_material_height;
},
loadSettings() {
this.$mk.post({
@ -1271,9 +1290,17 @@ export default {
packaging_onPulldownSelected({ row, name, params }) {
//
packaging_onPulldownSelected({ row, name, column,params, selectedData }) {
console.log(row, name, params);
if (column.field == "packaging") {
if (selectedData && selectedData.default_quantity) {
row.quantity = selectedData.default_quantity; //
}
}
},
packaging_onPopupSelected({ rows, name, params }) {
console.log(rows, name, params);
@ -1857,6 +1884,27 @@ export default {
return sum;
}
//
if (name.indexOf('的厚度') > 0) {
name = this.formatName(name);
name = name.substr(0, name.length - 3);
console.log(name);
let v = 0;
this.bathroomMaterial_list.forEach(o => { //
if (name == this.formatName(o.name)) {
v = parseFloat(o.spec || 15);
}
});
return v;
}
let fun = settings.expressionsDefines[name];
if (!fun) {
return defaultValue || 0;
@ -2075,5 +2123,4 @@ p.tip {
h3 {
font-weight: bold;
}
}
</style>
}</style>

View File

@ -7,7 +7,7 @@
<a-button type="primary" @click="ok">保存</a-button>
<a-button @click="selectScheme">复制方案</a-button>
<a-button @click="cancel">取消</a-button>
<a-button @click="previewScheme" >预览方案</a-button>
<a-button @click="previewScheme">预览方案</a-button>
</div>
@ -48,10 +48,13 @@
:edit-render="{ name: 'MkGridDataSelector' }"></vxe-column>
<vxe-column field="long_formula" title="长(公式)" width="220"
:params="{ moreExpressionsList: getMoreExpressionsList_material_height }"
:edit-render="{ name: 'EditExpressions' }"></vxe-column>
<vxe-column field="width_formula" title="宽(公式)" width="220"
:params="{ moreExpressionsList: getMoreExpressionsList_material_height }"
:edit-render="{ name: 'EditExpressions' }"></vxe-column>
<vxe-column field="height_formula" title="厚(公式)" width="220"
:params="{ moreExpressionsList: getMoreExpressionsList_material_height }"
:edit-render="{ name: 'EditExpressions' }"></vxe-column>
<vxe-column field="quantity" title="数量" width="80"
:edit-render="{ name: '$input', props: { type: 'number' } }"></vxe-column>
@ -184,8 +187,7 @@
<vxe-column field="material" title="材料" width="260" :params="editorMaterial2" formatter="formatRef"
:edit-render="{ name: 'MkGridDataSelector' }"></vxe-column>
<vxe-column field="quantity_formula" title="总用量(公式)" width="220"
:params="{hasTotalQuantity:true}"
<vxe-column field="quantity_formula" title="总用量(公式)" width="220" :params="{ hasTotalQuantity: true }"
:edit-render="{ name: 'EditExpressions' }"></vxe-column>
<vxe-column field="price" title="单价" width="120"
:edit-render="{ name: '$input', props: { type: 'number' } }"></vxe-column>
@ -260,8 +262,7 @@
<vxe-column field="material" title="材料" width="260" :params="editorMaterial2" formatter="formatRef"
:edit-render="{ name: 'MkGridDataSelector' }"></vxe-column>
<vxe-column field="quantity_formula" title="总用量(公式)" width="220"
:params="{hasTotalQuantity:true}"
<vxe-column field="quantity_formula" title="总用量(公式)" width="220" :params="{ hasTotalQuantity: true }"
:edit-render="{ name: 'EditExpressions' }"></vxe-column>
<vxe-column field="price" title="单价" width="120"
:edit-render="{ name: '$input', props: { type: 'number' } }"></vxe-column>
@ -417,7 +418,7 @@ export default {
],
placeholder: "请输入名称",
searchFieldNames: ['name'],
extendData : [{id:'封边条', name : '封边条'}],
extendData: [{ id: '封边条', name: '封边条' }],
textField: 'name'
},
editorBanding: {
@ -476,6 +477,9 @@ export default {
paintMaterial_detailsData: [],
paintLabor_detailsData: [],
bathroomMaterial_list: [],//
moreExpressionsList_material_height: [],//
uploadDefaultImg: null,
detailDataFieldName: "bathroom_scheme",
@ -760,23 +764,35 @@ export default {
}).then(a => {
this.bathroomMaterial_list = a.data.BathroomMaterial || [];
this.moreExpressionsList_material_height = [];
a.data.BathroomMaterial.forEach(o => {
this.bathroomMaterial_list.forEach(o => {
this.fittings_detailsData.forEach(item => {
if (item.material && item.material[0] && item.material[0].toString() == o.id.toString()) {
item.material_default_height = o.spec || "15";
item.material_default_height = o.spec || "15";
}
});
});
this.bathroomMaterial_list.forEach(o => { //
this.moreExpressionsList_material_height.push(this.formatName(o.name) + "的厚度");
});
console.log(this.fittings_detailsData)
});
},
getMoreExpressionsList_material_height() {
return this.moreExpressionsList_material_height;
},
loadSettings() {
this.$mk.post({
@ -988,9 +1004,17 @@ export default {
packaging_onPulldownSelected({ row, name, params }) {
//
packaging_onPulldownSelected({ row, name, column,params, selectedData }) {
console.log(row, name, params);
if (column.field == "packaging") {
if (selectedData && selectedData.default_quantity) {
row.quantity = selectedData.default_quantity; //
}
}
},
packaging_onPopupSelected({ rows, name, params }) {
console.log(rows, name, params);
@ -1433,7 +1457,7 @@ export default {
this.modalVisible = true;
this.scheme_load();
},
previewScheme(){
previewScheme() {
let dataId = this.getDataId();
this.$openPage("/BathroomQuotation/BathroomQuotationUpdate/d" + dataId); //
},

View File

@ -15,7 +15,7 @@
</div>
<h4>选择变量</h4>
<ul>
<li v-for="item in expressions_list" :key="item">
<li v-for="(item,index) in expressions_list" :key="index">
<a @click="addText(item)">{{ item }}</a>
</li>
</ul>
@ -107,6 +107,10 @@ export default {
}
}
if (column.params && typeof(column.params.moreExpressionsList)=="function") {
this.expressions_list = [ ... this.expressions_list,...column.params.moreExpressionsList()]
}
},
formatName(v) {
return (v || "").replace("\r", "").replace("\n", "").replace("\t", "").replace(" ", "");

View File

@ -131,6 +131,14 @@ var config = {
return row.height;
},
"无妨布袋的默认单价" : ({ data }) => {
if(data.main_cabinet_length +60 < 1000){
return 3;
}
return 4;
},
},