This commit is contained in:
parent
937d0307d8
commit
7e833a5d3f
|
|
@ -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: [ // 表格列
|
||||
|
|
@ -818,10 +839,10 @@ export default {
|
|||
{ field: 'remark', title: '备注' }
|
||||
],
|
||||
placeholder: "请输入名称",
|
||||
searchFieldNames: ['name'],
|
||||
searchFieldNames: ['name'],
|
||||
textField: 'name'
|
||||
},
|
||||
|
||||
|
||||
editorMaterial2: {
|
||||
dataUrl: `${BASE_URL.BASE_URL}/BathroomMaterial/v1/bathroom/material/list`,
|
||||
listdataFieldName: 'BathroomMaterial',
|
||||
|
|
@ -831,7 +852,7 @@ export default {
|
|||
],
|
||||
placeholder: "请输入名称",
|
||||
searchFieldNames: ['name'],
|
||||
extendData : [{id:'封边条', name : '封边条'}],
|
||||
extendData: [{ id: '封边条', name: '封边条' }],
|
||||
textField: 'name'
|
||||
},
|
||||
editorBanding: {
|
||||
|
|
@ -883,12 +904,14 @@ export default {
|
|||
|
||||
|
||||
packaging_detailsData: [], // 包装
|
||||
|
||||
|
||||
|
||||
material_detailsData: [], // 材料
|
||||
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)); // 加载方案数据
|
||||
}
|
||||
|
|
@ -1187,7 +1210,7 @@ export default {
|
|||
this.drawer_detailsData = JSON.parse(data.drawer_list || "[]"); // 抽屉
|
||||
|
||||
this.materialHeightInit(); // 初始化材料高度
|
||||
|
||||
|
||||
this.detailDataInit(); // 初始化详情数据
|
||||
|
||||
|
||||
|
|
@ -1225,26 +1248,38 @@ 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()) { // 如果部件的材料id和材料列表的id相同
|
||||
|
||||
|
||||
if (item.material && item.material[0] && item.material[0].toString() == o.id.toString()) { // 如果部件的材料id和材料列表的id相同
|
||||
|
||||
item.material_default_height = o.spec || "15"; // 设置部件的默认高度
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
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({ // 获取设置列表
|
||||
url: `${BASE_URL.BASE_URL}/BathroomScheme/v1/settings/list`,
|
||||
data: {
|
||||
|
|
@ -1273,7 +1308,7 @@ export default {
|
|||
if (!value) {
|
||||
return '<span style="color:red;">' + (0.0).toFixed(points || 0) + '</span>';
|
||||
}
|
||||
return parseFloat(value).toFixed(points || 0)
|
||||
return parseFloat(value).toFixed(points || 0)
|
||||
},
|
||||
toggleAll() { // 展开/收起
|
||||
|
||||
|
|
@ -1336,7 +1371,7 @@ export default {
|
|||
let o = item[name]; // 获取字段值
|
||||
if (Array.isArray(o) && o[1]) { // 如果字段值是数组
|
||||
item[name] = o[1]; // 设置字段值为数组的第二个元素
|
||||
}
|
||||
}
|
||||
if (typeof (o) == "number") { // 如果字段值是数字
|
||||
item[name] = parseFloat(o || 0).toFixed(2) // 设置字段值为数字的字符串
|
||||
}
|
||||
|
|
@ -1366,23 +1401,23 @@ export default {
|
|||
this.modalVisible = true; // 显示模态框
|
||||
this.scheme_load(); // 加载方案列表
|
||||
},
|
||||
|
||||
dblClickEvent( ) { // 双击事件
|
||||
this.confirmSelectScheme(); // 确认选择方案
|
||||
|
||||
dblClickEvent() { // 双击事件
|
||||
this.confirmSelectScheme(); // 确认选择方案
|
||||
},
|
||||
confirmSelectScheme() { // 确认选择方案
|
||||
let row = this.$refs.scheme_grid.getCurrentRecord(); // 获取当前行
|
||||
|
||||
this.loadSchemeData(row); // 加载方案数据
|
||||
|
||||
|
||||
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`, // 详情接口地址
|
||||
loading: "加载中...",
|
||||
loading: "加载中...",
|
||||
data: json,
|
||||
config: {
|
||||
headers: {
|
||||
|
|
@ -1390,12 +1425,12 @@ export default {
|
|||
}
|
||||
}
|
||||
}).then(a => {
|
||||
|
||||
|
||||
this.loadSchemeData(a.data.bathroom_scheme); // 加载方案数据
|
||||
|
||||
});
|
||||
},
|
||||
loadSchemeData(row){ // 加载方案数据
|
||||
loadSchemeData(row) { // 加载方案数据
|
||||
|
||||
let scheme_id = row.id.toString() // 获取方案id
|
||||
|
||||
|
|
@ -1431,7 +1466,7 @@ export default {
|
|||
paintMaterialList // 油漆材料列表
|
||||
});
|
||||
|
||||
|
||||
|
||||
this.materialHeightInit(); // 初始化材料高度
|
||||
|
||||
this.$forceUpdate(); // 强制更新
|
||||
|
|
@ -1447,7 +1482,7 @@ export default {
|
|||
this.addToList({ scheme_id, listData: paintMaterialList, detailsData: this.paintMaterial_detailsData }); // 把来源数据添加到目标表格数据
|
||||
|
||||
|
||||
|
||||
|
||||
this.materialHeightInit(); // 初始化材料高度
|
||||
|
||||
this.calculateAll(); // 计算所有数据
|
||||
|
|
@ -1471,7 +1506,7 @@ export default {
|
|||
|
||||
if (oldDetailItem.length) { // 如果有原来行
|
||||
//覆盖 更新 原来行的数据
|
||||
Object.assign(oldDetailItem[0], info);
|
||||
Object.assign(oldDetailItem[0], info);
|
||||
} else { // 如果没有原来行
|
||||
//准备 要附加进去的行
|
||||
newInfos.push(info);
|
||||
|
|
@ -1484,7 +1519,7 @@ export default {
|
|||
let item = detailsData[i]; // 获取目标表格数据的每一行
|
||||
|
||||
//没有选择部件的行,覆盖数据
|
||||
if (!item.fittings || !item.fittings[0]) {
|
||||
if (!item.fittings || !item.fittings[0]) {
|
||||
Object.assign(detailsData[i], newInfos[j]); // 覆盖数据
|
||||
j++; // 新的数据的索引+1
|
||||
}
|
||||
|
|
@ -1506,7 +1541,7 @@ export default {
|
|||
"page": this.scheme_tablePage.currentPage, // 当前页
|
||||
"limit": this.scheme_tablePage.pageSize, // 每页条数
|
||||
"order_bys": [ // 排序
|
||||
],
|
||||
],
|
||||
"search_rules": [ // 查询条件
|
||||
],
|
||||
"start_time": 0, // 开始时间
|
||||
|
|
@ -1516,7 +1551,7 @@ export default {
|
|||
this.$mk.post({ // 发送请求
|
||||
url: this.actions.BathroomSchemeList, // 地址
|
||||
data: parms // 参数
|
||||
}).then(r => {
|
||||
}).then(r => {
|
||||
this.scheme_loading = false // 设置加载状态
|
||||
let data = r.data; // 获取数据
|
||||
this.scheme_tablePage.total = data.total; // 设置总条数
|
||||
|
|
@ -1535,13 +1570,13 @@ export default {
|
|||
}
|
||||
|
||||
for (let i = this.packaging_detailsData.length; i < settings.table_min_count; i++) { // 遍历包装列表
|
||||
this.packaging_detailsData.push({});
|
||||
this.packaging_detailsData.push({});
|
||||
}
|
||||
|
||||
|
||||
for (let i = this.material_detailsData.length; i < settings.table_min_count; i++) { // 遍历材料列表
|
||||
this.material_detailsData.push({});
|
||||
}
|
||||
}
|
||||
for (let i = this.labor_detailsData.length; i < settings.table_min_count; i++) { // 遍历人工列表
|
||||
this.labor_detailsData.push({});
|
||||
}
|
||||
|
|
@ -1562,7 +1597,7 @@ export default {
|
|||
|
||||
},
|
||||
// 获取路由的id参数
|
||||
getDataId() {
|
||||
getDataId() {
|
||||
let dataId = this.dataId;
|
||||
if (this.$route.params.id) {
|
||||
dataId = this.$route.params.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 当前行
|
||||
|
|
@ -1643,7 +1679,7 @@ export default {
|
|||
},
|
||||
// 部件编辑前事件
|
||||
fittings_beforeEditEvent({ column, row }) { // column 当前列 row 当前行
|
||||
console.log(row, column);
|
||||
console.log(row, column);
|
||||
},
|
||||
|
||||
// 部件表格添加事件
|
||||
|
|
@ -1680,15 +1716,15 @@ export default {
|
|||
}
|
||||
})
|
||||
// 返回一个二维数组的表尾合计
|
||||
return [sums]
|
||||
return [sums]
|
||||
},
|
||||
// 部件表格添加事件
|
||||
fittings_pageAdd(row) { // row 当前行
|
||||
const $table = this.$refs.fittings_xTable // 获取表格
|
||||
const record = { // 新的数据
|
||||
}
|
||||
}
|
||||
if (row) { // 如果有行
|
||||
|
||||
|
||||
this.fittings_detailsData.splice($table.getRowSeq(row), 0, record); // 添加数据
|
||||
} else { // 如果没有行
|
||||
this.fittings_detailsData.push(record) // 添加数据
|
||||
|
|
@ -1706,7 +1742,7 @@ export default {
|
|||
|
||||
// 配件下拉选择事件
|
||||
parts_onPulldownSelected({ selectedData, row }) { // selectedData 选择的数据 row 当前行
|
||||
console.log(row, selectedData);
|
||||
console.log(row, selectedData);
|
||||
if (selectedData.spec) { // 如果有规格
|
||||
row.spec = selectedData.spec; // 设置规格
|
||||
}
|
||||
|
|
@ -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 }) {
|
||||
|
|
@ -1855,7 +1898,7 @@ export default {
|
|||
},
|
||||
// 油漆材料编辑前事件
|
||||
material_beforeEditMethod({ column, row }) {
|
||||
console.log(row, column);
|
||||
console.log(row, column);
|
||||
return true;
|
||||
},
|
||||
// 油漆材料编辑后事件
|
||||
|
|
@ -2047,7 +2090,7 @@ export default {
|
|||
console.log(rows, name, params);
|
||||
},
|
||||
paintMaterial_beforeEditMethod({ column, row }) {
|
||||
console.log(row, column);
|
||||
console.log(row, column);
|
||||
return true;
|
||||
},
|
||||
paintMaterial_afterEditEvent({ column, row }) {
|
||||
|
|
@ -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" });
|
||||
|
|
@ -2634,11 +2697,11 @@ export default {
|
|||
this.calculateRows({ detailsData: this.expense_detailsData, names: ["amount"], totalPrev: "expense" });
|
||||
// 计算所有 油漆费用
|
||||
this.calculateRows({ detailsData: this.paintExpense_detailsData, names: ["amount"], totalPrev: "paintExpense" });
|
||||
|
||||
|
||||
console.log("this.formOptions.data.expense_total_amount:" + this.formOptions.data.expense_total_amount)
|
||||
this.formOptions.data.expense = this.formOptions.data.expense_total_amount; // 计算所有 费用
|
||||
this.formOptions.data.paint_expense = this.formOptions.data.paintExpense_total_amount; // 计算所有 油漆费用
|
||||
|
||||
|
||||
this.formOptions.data.show_expense = parseFloat(this.formOptions.data.expense || 0).toFixed(2); // 计算所有 费用
|
||||
this.formOptions.data.show_paint_expense = parseFloat(this.formOptions.data.paint_expense || 0).toFixed(2); // 计算所有 油漆费用
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@
|
|||
<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>
|
||||
|
||||
<a-collapse v-model="groupbox1_activeKey">
|
||||
|
|
@ -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>
|
||||
|
|
@ -404,10 +405,10 @@ export default {
|
|||
{ field: 'remark', title: '备注' }
|
||||
],
|
||||
placeholder: "请输入名称",
|
||||
searchFieldNames: ['name'],
|
||||
searchFieldNames: ['name'],
|
||||
textField: 'name'
|
||||
},
|
||||
|
||||
|
||||
editorMaterial2: {
|
||||
dataUrl: `${BASE_URL.BASE_URL}/BathroomMaterial/v1/bathroom/material/list`,
|
||||
listdataFieldName: 'BathroomMaterial',
|
||||
|
|
@ -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",
|
||||
|
||||
|
|
@ -759,24 +763,36 @@ export default {
|
|||
data: { "page": 1, "limit": 100, "order_bys": [], "search_rules": [] }
|
||||
}).then(a => {
|
||||
|
||||
|
||||
|
||||
a.data.BathroomMaterial.forEach(o => {
|
||||
this.bathroomMaterial_list = a.data.BathroomMaterial || [];
|
||||
this.moreExpressionsList_material_height = [];
|
||||
|
||||
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";
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
console.log(this.fittings_detailsData)
|
||||
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);
|
||||
|
|
@ -1033,7 +1057,7 @@ export default {
|
|||
},
|
||||
material_beforeEditMethod({ column, row }) {
|
||||
console.log(row, column);
|
||||
|
||||
|
||||
return true;
|
||||
},
|
||||
material_afterEditEvent({ column, row }) {
|
||||
|
|
@ -1103,7 +1127,7 @@ export default {
|
|||
paintMaterial_beforeEditMethod({ column, row }) {
|
||||
console.log(row, column);
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
},
|
||||
paintMaterial_afterEditEvent({ column, row }) {
|
||||
|
|
@ -1433,7 +1457,7 @@ export default {
|
|||
this.modalVisible = true;
|
||||
this.scheme_load();
|
||||
},
|
||||
previewScheme(){
|
||||
previewScheme() {
|
||||
let dataId = this.getDataId();
|
||||
this.$openPage("/BathroomQuotation/BathroomQuotationUpdate/d" + dataId); // 打开页面
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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(" ", "");
|
||||
|
|
|
|||
|
|
@ -131,6 +131,14 @@ var config = {
|
|||
return row.height;
|
||||
},
|
||||
|
||||
"无妨布袋的默认单价" : ({ data }) => {
|
||||
if(data.main_cabinet_length +60 < 1000){
|
||||
return 3;
|
||||
}
|
||||
|
||||
return 4;
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue