This commit is contained in:
xielue 2023-06-25 18:30:07 +08:00
parent e1ddcc0314
commit 73c798e27a
7 changed files with 260 additions and 627 deletions

View File

@ -11,6 +11,7 @@
<template #dropdown>
<vxe-grid :keyboard-config="{ isArrow: true }" auto-resize height="400" ref="xgrid"
:row-config="{ isCurrent: true, isHover: true }" :loading="loading" :pager-config="tablePage" :data="tableData"
:columns="tableColumn" @cell-dblclick="dblClickEvent" @cell-click="selectEvent" @page-change="pageChangeEvent">
</vxe-grid>
@ -154,6 +155,10 @@ export default {
this.tablePage.total = data.total;
this.tableData = data[this.listdataFieldName];
if(column.params.extendData){
this.tableData = [...column.params.extendData,...this.tableData];
}
});
},
getData(key) {

View File

@ -383,10 +383,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" v-if="!row.isMain && !row.isBanding">
<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>
@ -394,10 +394,11 @@
</template>
</vxe-column>
<vxe-column type="seq" title="序号" width="48"></vxe-column>
<vxe-column field="material" title="材料" width="260" :params="editorMaterial" formatter="formatRef"
<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" :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">
@ -551,7 +552,7 @@
:edit-config="{ trigger: 'click', mode: 'cell', icon: 'vxe-icon-edit', showStatus: false, beforeEditMethod: paintMaterial_beforeEditMethod }">
<vxe-column width="60" v-if="!isReadonly">
<template #default="{ row }">
<div class="oplinks2" v-if="!row.isMain && !row.isBanding">
<div class="oplinks2">
<a @click.stop="paintMaterial_pageAdd(row)" title="新增">
<a-icon type="plus-circle" />
</a>
@ -562,10 +563,11 @@
</template>
</vxe-column>
<vxe-column type="seq" title="序号" width="48"></vxe-column>
<vxe-column field="material" title="材料" width="260" :params="editorMaterial" formatter="formatRef"
<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" :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">
@ -713,7 +715,7 @@
<div class="footerbar">
<a-button type="primary" @click="ok">保存</a-button>
<a-button type="primary" @click="ok" v-if="!isPreview">保存</a-button>
<a-button @click="cancel">关闭</a-button>
</div>
@ -721,6 +723,7 @@
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">
</vxe-grid>
@ -775,6 +778,7 @@ export default {
showExp: false,
showType: "1",
modalVisible: false,
isPreview:false,
scheme_loading: false, //
scheme_tableData: [], //
scheme_tableColumn: [ //
@ -807,6 +811,18 @@ export default {
textField: 'name'
},
editorMaterial: {
dataUrl: `${BASE_URL.BASE_URL}/BathroomMaterial/v1/bathroom/material/list`,
listdataFieldName: 'BathroomMaterial',
columns: [
{ field: 'name', title: '名称' },
{ field: 'remark', title: '备注' }
],
placeholder: "请输入名称",
searchFieldNames: ['name'],
textField: 'name'
},
editorMaterial2: {
dataUrl: `${BASE_URL.BASE_URL}/BathroomMaterial/v1/bathroom/material/list`,
listdataFieldName: 'BathroomMaterial',
columns: [
@ -815,6 +831,7 @@ export default {
],
placeholder: "请输入名称",
searchFieldNames: ['name'],
extendData : [{id:'封边条', name : '封边条'}],
textField: 'name'
},
editorBanding: {
@ -1113,9 +1130,12 @@ export default {
// id
let dataId = this.getDataId();
if(dataId && dataId.indexOf && dataId.indexOf('d') == 0){
this.isPreview = true;
this.loadSchemeDataById(dataId.substr(1));
}
// id
if (dataId) {
else if (dataId) {
const json = `{"id":${dataId}}`;
this.$mk.post({
url: this.actions.get,
@ -1208,8 +1228,7 @@ export default {
});
console.log(this.fittings_detailsData)
});
},
@ -1338,9 +1357,36 @@ export default {
this.modalVisible = true;
this.scheme_load();
},
dblClickEvent( ) {
this.confirmSelectScheme();
},
confirmSelectScheme() {
let row = this.$refs.scheme_grid.getCurrentRecord(); //
this.loadSchemeData(row);
this.modalVisible = false;
},
loadSchemeDataById(dataId){
const json = `{"id":${dataId}}`;
this.$mk.post({
url: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/detail`,
loading: "加载中...",
data: json,
config: {
headers: {
'Content-Type': 'application/json'
}
}
}).then(a => {
this.loadSchemeData(a.data.bathroom_scheme);
});
},
loadSchemeData(row){
let scheme_id = row.id.toString()
@ -1394,8 +1440,6 @@ export default {
}
this.modalVisible = false;
},
//
@ -1767,13 +1811,7 @@ export default {
console.log(rows, name, params);
},
material_beforeEditMethod({ column, row }) {
console.log(row, column);
if (column.field == "material" && (row.isMain || row.isBanding)) {
return false;
}
if (column.field == 'quantity_formula' && (row.isMain)) {
return false;
}
console.log(row, column);
return true;
},
material_afterEditEvent({ column, row }) {
@ -1945,14 +1983,7 @@ export default {
console.log(rows, name, params);
},
paintMaterial_beforeEditMethod({ column, row }) {
console.log(row, column);
if (column.field == "material" && (row.isMain || row.isBanding)) {
return false;
}
if (column.field == 'quantity_formula' && (row.isMain)) {
return false;
}
console.log(row, column);
return true;
},
paintMaterial_afterEditEvent({ column, row }) {

View File

@ -38,7 +38,7 @@
</div>
</template>
</vxe-column>
<vxe-column type="seq" title="序号" width="48"></vxe-column>
<vxe-column type="seq" title="序号" width="48"></vxe-column>
<vxe-column field="fittings" title="部件" width="160" :params="editorFittings" formatter="formatRef"
:edit-render="{ name: 'MkGridDataSelector' }"></vxe-column>
<vxe-column field="material" title="材料(免漆)" width="160" :params="editorMaterial" formatter="formatRef"
@ -55,8 +55,8 @@
<span v-if="showExp">
{{ row.long_formula || '' }}
</span>
<span v-else v-html="formatShowNumber(row.long, 0)"></span>
</a-tooltip>
<span v-else v-html="formatShowNumber(row.long, 0)"></span>
</a-tooltip>
</template>
</vxe-column>
<vxe-column field="width_formula" title="宽" width="160" :edit-render="{ name: 'EditExpressions' }">
@ -68,8 +68,8 @@
<span v-if="showExp">
{{ row.width_formula || '' }}
</span>
<span v-else v-html="formatShowNumber(row.width, 0)"></span>
</a-tooltip>
<span v-else v-html="formatShowNumber(row.width, 0)"></span>
</a-tooltip>
</template>
</vxe-column>
<vxe-column field="height_formula" title="厚" width="160" :edit-render="{ name: 'EditExpressions' }">
@ -81,9 +81,9 @@
<span v-if="showExp">
{{ row.height_formula || '' }}
</span>
<span v-else v-html="formatShowNumber(row.height, 0)"></span>
</a-tooltip>
<span v-else v-html="formatShowNumber(row.height, 0)"></span>
</a-tooltip>
</template>
</vxe-column>
<vxe-column field="quantity" title="数量" width="80"
@ -100,12 +100,12 @@
</template>
<span v-if="showExp">
{{ row.seal_formula || '' }}
</span>
<span v-else v-html="formatShowNumber(row.seal, 2)"></span>
</a-tooltip>
</span>
<span v-else v-html="formatShowNumber(row.seal, 2)"></span>
</a-tooltip>
</template>
</vxe-column>
<vxe-column type="seq" title="序号" width="48"></vxe-column>
<vxe-column type="seq" title="序号" width="48"></vxe-column>
<vxe-column field="rate_materials" title="主材利用率" width="80"
:edit-render="{ name: '$input', props: { type: 'number' } }"></vxe-column>
<vxe-column field="paint_number" title="油漆面" width="80"
@ -118,9 +118,9 @@
</template>
<span v-if="showExp">
{{ row.board_length_formula || '' }}
</span>
<span v-else v-html="formatShowNumber(row.board_length, 3)"></span>
</a-tooltip>
</span>
<span v-else v-html="formatShowNumber(row.board_length, 3)"></span>
</a-tooltip>
</template>
</vxe-column>
@ -171,7 +171,7 @@
</div>
</template>
</vxe-column>
<vxe-column type="seq" title="序号" width="48"></vxe-column>
<vxe-column type="seq" title="序号" width="48"></vxe-column>
<vxe-column field="parts" title="配件" width="260" :params="editorParts" formatter="formatRef"
:edit-render="{ name: 'MkGridDataSelector' }"></vxe-column>
<vxe-column field="spec" title="规格" width="120" :edit-render="{ name: '$input' }"></vxe-column>
@ -188,10 +188,10 @@
</template>
<span v-if="showExp">
{{ row.amount_formula || '' }}
</span>
<span v-else v-html="formatShowNumber(row.amount, 2)"></span>
</a-tooltip>
</span>
<span v-else v-html="formatShowNumber(row.amount, 2)"></span>
</a-tooltip>
</template>
</vxe-column>
@ -225,7 +225,7 @@
</div>
</template>
</vxe-column>
<vxe-column type="seq" title="序号" width="48"></vxe-column>
<vxe-column type="seq" title="序号" width="48"></vxe-column>
<vxe-column field="packaging" title="包装" width="260" :params="editorPackaging" formatter="formatRef"
:edit-render="{ name: 'MkGridDataSelector' }"></vxe-column>
<vxe-column field="long_formula" title="长" width="200" :edit-render="{ name: 'EditExpressions' }">
@ -237,9 +237,9 @@
<span v-if="showExp">
{{ row.long_formula || '' }}
</span>
<span v-else v-html="formatShowNumber(row.long, 1)"></span>
</a-tooltip>
<span v-else v-html="formatShowNumber(row.long, 1)"></span>
</a-tooltip>
</template>
</vxe-column>
<vxe-column field="width_formula" title="宽" width="200" :edit-render="{ name: 'EditExpressions' }">
@ -250,10 +250,10 @@
</template>
<span v-if="showExp">
{{ row.width_formula || '' }}
</span>
<span v-else v-html="formatShowNumber(row.width, 1)"></span>
</a-tooltip>
</template>
</span>
<span v-else v-html="formatShowNumber(row.width, 1)"></span>
</a-tooltip>
</template>
</vxe-column>
<vxe-column field="height_formula" title="高" width="200" :edit-render="{ name: 'EditExpressions' }">
<template #default="{ row }">
@ -263,9 +263,9 @@
</template>
<span v-if="showExp">
{{ row.height_formula || '' }}
</span>
<span v-else v-html="formatShowNumber(row.height, 1)"></span>
</a-tooltip>
</span>
<span v-else v-html="formatShowNumber(row.height, 1)"></span>
</a-tooltip>
</template>
</vxe-column>
@ -277,9 +277,9 @@
</template>
<span v-if="showExp">
{{ row.quantity_formula || '' }}
</span>
<span v-else v-html="formatShowNumber(row.quantity, 1)"></span>
</a-tooltip>
</span>
<span v-else v-html="formatShowNumber(row.quantity, 1)"></span>
</a-tooltip>
</template>
</vxe-column>
<vxe-column field="price" title="单价" width="120"
@ -292,9 +292,9 @@
</template>
<span v-if="showExp">
{{ row.amount_formula || '' }}
</span>
<span v-else v-html="formatShowNumber(row.amount, 2)"></span>
</a-tooltip>
</span>
<span v-else v-html="formatShowNumber(row.amount, 2)"></span>
</a-tooltip>
</template>
</vxe-column>
@ -324,7 +324,7 @@
: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" v-if="!row.isMain && !row.isBanding">
<div class="oplinks2">
<a @click.stop="material_pageAdd(row)" title="新增">
<a-icon type="plus-circle" />
</a>
@ -334,11 +334,12 @@
</div>
</template>
</vxe-column>
<vxe-column type="seq" title="序号" width="48"></vxe-column>
<vxe-column field="material" title="材料" width="260" :params="editorMaterial" formatter="formatRef"
<vxe-column type="seq" title="序号" width="48"></vxe-column>
<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" :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">
@ -347,8 +348,8 @@
<span v-if="showExp">
{{ row.quantity_formula || '' }}
</span>
<span v-else v-html="formatShowNumber(row.quantity, 3)"></span>
</a-tooltip>
<span v-else v-html="formatShowNumber(row.quantity, 3)"></span>
</a-tooltip>
</template>
</vxe-column>
@ -363,8 +364,8 @@
<span v-if="showExp">
{{ row.amount_formula || '' }}
</span>
<span v-else v-html="formatShowNumber(row.amount, 2)"></span>
</a-tooltip>
<span v-else v-html="formatShowNumber(row.amount, 2)"></span>
</a-tooltip>
</template>
</vxe-column>
@ -397,7 +398,7 @@
</div>
</template>
</vxe-column>
<vxe-column type="seq" title="序号" width="48"></vxe-column>
<vxe-column type="seq" title="序号" width="48"></vxe-column>
<vxe-column field="labor" title="项目" width="260" :params="editorLabor" formatter="formatRef"
:edit-render="{ name: 'MkGridDataSelector' }"></vxe-column>
@ -411,8 +412,8 @@
<span v-if="showExp">
{{ row.amount_formula || '' }}
</span>
<span v-else v-html="formatShowNumber(row.amount, 2)"></span>
</a-tooltip>
<span v-else v-html="formatShowNumber(row.amount, 2)"></span>
</a-tooltip>
</template>
</vxe-column>
@ -446,7 +447,7 @@
</div>
</template>
</vxe-column>
<vxe-column type="seq" title="序号" width="48"></vxe-column>
<vxe-column type="seq" title="序号" width="48"></vxe-column>
<vxe-column field="item_name" title="项目" width="220" :edit-render="{ name: '$input' }"></vxe-column>
<vxe-column field="amount_formula" title="金额" width="220" :edit-render="{ name: 'EditExpressions' }">
<template #default="{ row }">
@ -457,8 +458,8 @@
<span v-if="showExp">
{{ row.amount_formula || '' }}
</span>
<span v-else v-html="formatShowNumber(row.amount, 2)"></span>
</a-tooltip>
<span v-else v-html="formatShowNumber(row.amount, 2)"></span>
</a-tooltip>
</template>
</vxe-column>
@ -500,11 +501,12 @@
</div>
</template>
</vxe-column>
<vxe-column type="seq" title="序号" width="48"></vxe-column>
<vxe-column field="material" title="材料" width="260" :params="editorMaterial" formatter="formatRef"
<vxe-column type="seq" title="序号" width="48"></vxe-column>
<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" :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">
@ -512,9 +514,9 @@
</template>
<span v-if="showExp">
{{ row.quantity_formula || '' }}
</span>
<span v-else v-html="formatShowNumber(row.quantity, 2)"></span>
</a-tooltip>
</span>
<span v-else v-html="formatShowNumber(row.quantity, 2)"></span>
</a-tooltip>
</template>
</vxe-column>
<vxe-column field="price" title="单价" width="120"
@ -526,10 +528,10 @@
{{ row.amount_formula || '' }}
</template>
<span v-if="showExp">
{{ row.amount_formula || '' }}
</span>
<span v-else v-html="formatShowNumber(row.amount, 2)"></span>
</a-tooltip>
{{ row.amount_formula || '' }}
</span>
<span v-else v-html="formatShowNumber(row.amount, 2)"></span>
</a-tooltip>
</template>
</vxe-column>
@ -563,7 +565,7 @@
</div>
</template>
</vxe-column>
<vxe-column type="seq" title="序号" width="48"></vxe-column>
<vxe-column type="seq" title="序号" width="48"></vxe-column>
<vxe-column field="labor" title="项目" width="260" :params="editorLabor" formatter="formatRef"
:edit-render="{ name: 'MkGridDataSelector' }"></vxe-column>
@ -575,9 +577,9 @@
</template>
<span v-if="showExp">
{{ row.amount_formula || '' }}
</span>
<span v-else v-html="formatShowNumber(row.amount, 2)"></span>
</a-tooltip>
</span>
<span v-else v-html="formatShowNumber(row.amount, 2)"></span>
</a-tooltip>
</template>
</vxe-column>
@ -612,7 +614,7 @@
</div>
</template>
</vxe-column>
<vxe-column type="seq" title="序号" width="48"></vxe-column>
<vxe-column type="seq" title="序号" width="48"></vxe-column>
<vxe-column field="item_name" title="项目" width="220" :edit-render="{ name: '$input' }"></vxe-column>
<vxe-column field="amount_formula" title="金额" width="200" :edit-render="{ name: 'EditExpressions' }">
<template #default="{ row }">
@ -622,9 +624,9 @@
</template>
<span v-if="showExp">
{{ row.amount_formula || '' }}
</span>
<span v-else v-html="formatShowNumber(row.amount, 2)"></span>
</a-tooltip>
</span>
<span v-else v-html="formatShowNumber(row.amount, 2)"></span>
</a-tooltip>
</template>
</vxe-column>
@ -681,12 +683,12 @@ export default {
currentConfigName: "",
// ID
currentBeid: 0,
settignsValues : {},
settignsValues: {},
showType: '1',
showExp: false,
showAll:false,
showAll: false,
modalVisible: false,
scheme_loading: false, //
scheme_tableData: [], //
@ -730,6 +732,19 @@ export default {
searchFieldNames: ['name'],
textField: 'name'
},
editorMaterial2: {
dataUrl: `${BASE_URL.BASE_URL}/BathroomMaterial/v1/bathroom/material/list`,
listdataFieldName: 'BathroomMaterial',
columns: [
{ field: 'name', title: '名称' },
{ field: 'remark', title: '备注' }
],
placeholder: "请输入名称",
searchFieldNames: ['name'],
extendData: [{ id: '封边条', name: '封边条' }],
textField: 'name'
},
editorBanding: {
dataUrl: `${BASE_URL.BASE_URL}/BathroomBanding/v1/bathroom/banding/list`,
listdataFieldName: 'BathroomBanding',
@ -893,6 +908,8 @@ export default {
this.paintMaterial_detailsData = data.paint_materialList || [];
//this.expense_detailsData = data.expense_list;
//this.paintExpense_detailsData = data.paint_expenseList;
this.materialHeightInit()
this.detailDataInit();
this.resetMaterial();
this.resetPaintMaterial();
@ -902,6 +919,30 @@ export default {
methods: {
materialHeightInit() {
this.$mk.post({
url: `${BASE_URL.BASE_URL}/BathroomMaterial/v1/bathroom/material/list`,
data: { "page": 1, "limit": 100, "order_bys": [], "search_rules": [] }
}).then(a => {
a.data.BathroomMaterial.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";
}
});
});
});
},
loadSettings() {
this.$mk.post({
@ -930,7 +971,7 @@ export default {
},
formatShowNumber(value, points) {
if (!value) {
return '<span style="color:red;">'+(0.0).toFixed(points ||0)+'</span>';
return '<span style="color:red;">' + (0.0).toFixed(points || 0) + '</span>';
}
return parseFloat(value).toFixed(points || 0)
},
@ -1075,7 +1116,7 @@ export default {
if (column.field == "material") {
this.resetMaterial();
if(selectedData.spec){
if (selectedData.spec) {
row.material_default_height = selectedData.spec;
}
}
@ -1085,7 +1126,7 @@ export default {
if (!row.paint_number && this.settignsValues.Default_rate_of_paint_surface) {
row.paint_number = this.settignsValues.Default_rate_of_paint_surface;
}
if (!row.board_length_formula) {
row.board_length_formula = this.settignsValues.Default_board_length_formula || '{板材的长}*{板材的宽}*{部件的数量}/{主材利用率}/1000000/2.96';
}
@ -1167,11 +1208,11 @@ export default {
console.log(row, selectedData);
if (selectedData.spec) {
row.spec = selectedData.spec;
}
if(selectedData.price){
if (selectedData.price) {
row.price = selectedData.price;
}
},
@ -1297,12 +1338,6 @@ export default {
},
material_beforeEditMethod({ column, row }) {
console.log(row, column);
if (column.field == "material" && (row.isMain || row.isBanding)) {
return false;
}
if (column.field == 'quantity_formula' && (row.isMain)) {
return false;
}
return true;
},
material_afterEditEvent({ column, row }) {
@ -1478,13 +1513,6 @@ export default {
},
paintMaterial_beforeEditMethod({ column, row }) {
console.log(row, column);
if (column.field == "material" && (row.isMain || row.isBanding)) {
return false;
}
if (column.field == 'quantity_formula' && (row.isMain)) {
return false;
}
return true;
},
paintMaterial_afterEditEvent({ column, row }) {

View File

@ -7,6 +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>
</div>
<a-collapse v-model="groupbox1_activeKey">
@ -168,7 +171,7 @@
: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" v-if="!row.isMain && !row.isBanding">
<div class="oplinks2">
<a @click.stop="material_pageAdd(row)" title="新增">
<a-icon type="plus-circle" />
</a>
@ -178,10 +181,11 @@
</div>
</template>
</vxe-column>
<vxe-column field="material" title="材料" width="260" :params="editorMaterial" formatter="formatRef"
<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}"
:edit-render="{ name: 'EditExpressions' }"></vxe-column>
<vxe-column field="price" title="单价" width="120"
:edit-render="{ name: '$input', props: { type: 'number' } }"></vxe-column>
@ -243,7 +247,7 @@
:edit-config="{ trigger: 'click', mode: 'cell', icon: 'vxe-icon-edit', showStatus: false, beforeEditMethod: paintMaterial_beforeEditMethod }">
<vxe-column width="60" v-if="!isReadonly">
<template #default="{ row }">
<div class="oplinks2" v-if="!row.isMain && !row.isBanding">
<div class="oplinks2">
<a @click.stop="paintMaterial_pageAdd(row)" title="新增">
<a-icon type="plus-circle" />
</a>
@ -253,10 +257,11 @@
</div>
</template>
</vxe-column>
<vxe-column field="material" title="材料" width="260" :params="editorMaterial" formatter="formatRef"
<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}"
:edit-render="{ name: 'EditExpressions' }"></vxe-column>
<vxe-column field="price" title="单价" width="120"
:edit-render="{ name: '$input', props: { type: 'number' } }"></vxe-column>
@ -392,6 +397,18 @@ export default {
textField: 'name'
},
editorMaterial: {
dataUrl: `${BASE_URL.BASE_URL}/BathroomMaterial/v1/bathroom/material/list`,
listdataFieldName: 'BathroomMaterial',
columns: [
{ field: 'name', title: '名称' },
{ field: 'remark', title: '备注' }
],
placeholder: "请输入名称",
searchFieldNames: ['name'],
textField: 'name'
},
editorMaterial2: {
dataUrl: `${BASE_URL.BASE_URL}/BathroomMaterial/v1/bathroom/material/list`,
listdataFieldName: 'BathroomMaterial',
columns: [
@ -400,6 +417,7 @@ export default {
],
placeholder: "请输入名称",
searchFieldNames: ['name'],
extendData : [{id:'封边条', name : '封边条'}],
textField: 'name'
},
editorBanding: {
@ -1015,13 +1033,7 @@ export default {
},
material_beforeEditMethod({ column, row }) {
console.log(row, column);
if (column.field == "material" && (row.isMain || row.isBanding)) {
return false;
}
if (column.field == 'quantity_formula' && (row.isMain)) {
return false;
}
return true;
},
material_afterEditEvent({ column, row }) {
@ -1091,12 +1103,7 @@ export default {
paintMaterial_beforeEditMethod({ column, row }) {
console.log(row, column);
if (column.field == "material" && (row.isMain || row.isBanding)) {
return false;
}
if (column.field == 'quantity_formula' && (row.isMain)) {
return false;
}
return true;
},
paintMaterial_afterEditEvent({ column, row }) {
@ -1426,6 +1433,10 @@ export default {
this.modalVisible = true;
this.scheme_load();
},
previewScheme(){
let dataId = this.getDataId();
this.$openPage("/BathroomQuotation/BathroomQuotationUpdate/d" + dataId); //
},
confirmSelectScheme() {
let row = this.$refs.scheme_grid.getCurrentRecord(); //

View File

@ -1,461 +0,0 @@
<template>
<div class="page-body">
<a-row type="flex">
<a-col :flex="$mk.config.ui.searchFlex">
<!-- 搜索区 -->
<vxe-form :data="searchFormData" :items="searchFormItems" titleColon @submit="onSearch">
<template #date="{}">
<a-form-item label="创建时间" :style="{ display: 'inline-block', width: 120 }">
</a-form-item>
<a-form-item :style="{ display: 'inline-block', width: 'calc(100% - 120px )' }">
<a-range-picker @change="onDateChange" />
</a-form-item>
</template>
</vxe-form>
</a-col>
<a-col :flex="$mk.config.ui.toolbarFlex">
<!-- 工具条 -->
<mk-toolbar @toolbarClick="toolbarClick"></mk-toolbar>
</a-col>
</a-row>
<vxe-toolbar ref="xToolbar" custom>
<template #buttons>
<a-button type="primary" icon="delete" @click="pageDelete()">批量删除</a-button>
</template>
</vxe-toolbar>
<!-- 表格区 -->
<div class="gridPanel">
<vxe-grid ref='xGrid' v-bind="gridOptions">
<!-- =============================== 表格列 自动生成 Start =============================== -->
<!-- =============================== 表格列 自动生成 End =============================== -->
<template #op="{ row }">
<div class="oplinks">
<a @click.stop="pageEdit(row)" title="编辑"><a-icon type="edit" /></a>
<a @click.stop="pageDelete(row)" title="删除"><a-icon type="delete" /></a>
</div>
</template>
<template #image="{ row }">
<img v-if="row.image" :src="row.image" style="width: 100px;">
<span v-else></span>
</template>
</vxe-grid>
<a-row style="background: white;">
<a-col style="margin-bottom: 8px;" v-for="item in [1,2,3,4,4,4,4,4]" :key="item" :span="6">
<a-card hoverable style="width: 300px">
<img
slot="cover"
alt="example"
src="https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png"
/>
<template slot="actions" class="ant-card-actions">
<a-icon key="setting" type="setting" />
<a-icon key="edit" type="edit" />
<a-icon key="ellipsis" type="ellipsis" />
</template>
<a-card-meta title="Card title" description="This is the description">
</a-card-meta>
</a-card>
</a-col>
</a-row>
<a-pagination v-model="currentPageIndex" :total="50" show-less-items />
</div>
</div>
</template>
<script>
import BASE_URL from '@/services/Middle/bathroom/BathroomScheme/api.js';
const settings = require('../../basic/settings.js');
export default {
name: 'BathroomSchemeList',
i18n: require('./i18n'), //
props: {
pageMode: {
type: String,
default: "edit"
}
},
data() {
const listFieldName = 'BathroomScheme';
//
var pageData = { //
keyName: 'id', //
currentPageIndex:1,
//
actions: { // Api
// =============================== Start ===============================
BathroomSchemeList: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/list`, //
BathroomSchemeDetail: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/detail`, //
BathroomSchemeCreate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/create`, //
BathroomSchemeUpdate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/update`, //
BathroomSchemeDelete: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/detele`, //
BathroomSchemeBatchDelete: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/batchDelete`, //
BathroomSchemeBatchUpdate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/batchUpdate`, //
BathroomSchemeBatchCreate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/batchCreate`, //
BathroomSchemeExportExcel: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/export/excel`, // EXCEL
BathroomSchemeImportExcel: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/import/excel`, // EXCEL
BathroomSchemeFittingsList: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/fittings/list`, //
BathroomSchemeFittingsDetail: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/fittings/detail`, //
BathroomSchemeFittingsCreate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/fittings/create`, //
BathroomSchemeFittingsUpdate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/fittings/update`, //
BathroomSchemeFittingsDelete: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/fittings/detele`, //
BathroomSchemeFittingsBatchDelete: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/fittings/batchDelete`, //
BathroomSchemeFittingsBatchUpdate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/fittings/batchUpdate`, //
BathroomSchemeFittingsBatchCreate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/fittings/batchCreate`, //
BathroomSchemeFittingsExportExcel: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/fittings/export/excel`, // EXCEL
BathroomSchemeFittingsImportExcel: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/fittings/import/excel`, // EXCEL
BathroomSchemePartsList: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/parts/list`, //
BathroomSchemePartsDetail: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/parts/detail`, //
BathroomSchemePartsCreate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/parts/create`, //
BathroomSchemePartsUpdate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/parts/update`, //
BathroomSchemePartsDelete: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/parts/detele`, //
BathroomSchemePartsBatchDelete: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/parts/batchDelete`, //
BathroomSchemePartsBatchUpdate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/parts/batchUpdate`, //
BathroomSchemePartsBatchCreate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/parts/batchCreate`, //
BathroomSchemePartsExportExcel: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/parts/export/excel`, // EXCEL
BathroomSchemePartsImportExcel: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/parts/import/excel`, // EXCEL
BathroomSchemeMaterialList: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/material/list`, //
BathroomSchemeMaterialDetail: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/material/detail`, //
BathroomSchemeMaterialCreate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/material/create`, //
BathroomSchemeMaterialUpdate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/material/update`, //
BathroomSchemeMaterialDelete: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/material/detele`, //
BathroomSchemeMaterialBatchDelete: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/material/batchDelete`, //
BathroomSchemeMaterialBatchUpdate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/material/batchUpdate`, //
BathroomSchemeMaterialBatchCreate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/material/batchCreate`, //
BathroomSchemeMaterialExportExcel: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/material/export/excel`, // EXCEL
BathroomSchemeMaterialImportExcel: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/material/import/excel`, // EXCEL
BathroomSchemeLaborList: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/labor/list`, //
BathroomSchemeLaborDetail: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/labor/detail`, //
BathroomSchemeLaborCreate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/labor/create`, //
BathroomSchemeLaborUpdate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/labor/update`, //
BathroomSchemeLaborDelete: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/labor/detele`, //
BathroomSchemeLaborBatchDelete: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/labor/batchDelete`, //
BathroomSchemeLaborBatchUpdate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/labor/batchUpdate`, //
BathroomSchemeLaborBatchCreate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/labor/batchCreate`, //
BathroomSchemeLaborExportExcel: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/labor/export/excel`, // EXCEL
BathroomSchemeLaborImportExcel: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/labor/import/excel`, // EXCEL
BathroomSchemeProcessList: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/process/list`, //
BathroomSchemeProcessDetail: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/process/detail`, //
BathroomSchemeProcessCreate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/process/create`, //
BathroomSchemeProcessUpdate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/process/update`, //
BathroomSchemeProcessDelete: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/process/detele`, //
BathroomSchemeProcessBatchDelete: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/process/batchDelete`, //
BathroomSchemeProcessBatchUpdate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/process/batchUpdate`, //
BathroomSchemeProcessBatchCreate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/process/batchCreate`, //
BathroomSchemeProcessExportExcel: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/process/export/excel`, // EXCEL
BathroomSchemeProcessImportExcel: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/process/import/excel`, // EXCEL
BathroomSchemePackagingList: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/packaging/list`, //
BathroomSchemePackagingDetail: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/packaging/detail`, //
BathroomSchemePackagingCreate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/packaging/create`, //
BathroomSchemePackagingUpdate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/packaging/update`, //
BathroomSchemePackagingDelete: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/packaging/detele`, //
BathroomSchemePackagingBatchDelete: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/packaging/batchDelete`, //
BathroomSchemePackagingBatchUpdate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/packaging/batchUpdate`, //
BathroomSchemePackagingBatchCreate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/packaging/batchCreate`, //
BathroomSchemePackagingExportExcel: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/packaging/export/excel`, // EXCEL
BathroomSchemePackagingImportExcel: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/packaging/import/excel`, // EXCEL
BathroomSchemeOutsourcingList: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/outsourcing/list`, //
BathroomSchemeOutsourcingDetail: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/outsourcing/detail`, //
BathroomSchemeOutsourcingCreate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/outsourcing/create`, //
BathroomSchemeOutsourcingUpdate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/outsourcing/update`, //
BathroomSchemeOutsourcingDelete: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/outsourcing/detele`, //
BathroomSchemeOutsourcingBatchDelete: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/outsourcing/batchDelete`, //
BathroomSchemeOutsourcingBatchUpdate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/outsourcing/batchUpdate`, //
BathroomSchemeOutsourcingBatchCreate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/outsourcing/batchCreate`, //
BathroomSchemeOutsourcingExportExcel: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/outsourcing/export/excel`, // EXCEL
BathroomSchemeOutsourcingImportExcel: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/outsourcing/import/excel`, // EXCEL
BathroomSchemePaintList: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/paint/list`, //
BathroomSchemePaintDetail: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/paint/detail`, //
BathroomSchemePaintCreate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/paint/create`, //
BathroomSchemePaintUpdate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/paint/update`, //
BathroomSchemePaintDelete: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/paint/detele`, //
BathroomSchemePaintBatchDelete: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/paint/batchDelete`, //
BathroomSchemePaintBatchUpdate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/paint/batchUpdate`, //
BathroomSchemePaintBatchCreate: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/paint/batchCreate`, //
BathroomSchemePaintExportExcel: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/paint/export/excel`, // EXCEL
BathroomSchemePaintImportExcel: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/paint/import/excel`, // EXCEL
// =============================== End ===============================
},
start_time: 0, //
end_time: 0, //
//
searchFormData: {
title: '',
desc: '',
},
//
searchRules: [
{ key: "title", mode: "like" },
{ key: "desc", mode: "like" }
],
//
searchFormItems: [ //
{ field: 'title', title: '标题', span: 5, itemRender: { name: '$input', props: { placeholder: '请输入标题' } } },
{ field: 'desc', title: '描述', span: 5, itemRender: { name: '$input', props: { placeholder: '请输入描述' } } },
{ span: 8, slots: { default: 'date' } }, //
{
align: 'right', span: 4, itemRender: { //
name: '$buttons', children: [{ props: { type: 'submit', content: '搜索', status: 'primary' } }, //
{ props: { type: 'reset', content: '重置' } }]
}
}
],
//
gridOptions: { //
height: '100%', // 100%
stripe: true, //
id: 'datagrid_1', //
//
proxyConfig: { //
sort: true, // query
filter: true, // query
props: {
result: listFieldName, //
total: 'total' //
},
// Promise
ajax: {
// queryreload
query: (options) => { // options
const { page, sorts } = options; //
var params = {}; //
params.page = page.currentPage; //
params.limit = page.pageSize; //
params.order_bys = []; //
params.search_rules = this.getSearchParms(); //
if (sorts) { //
sorts.forEach((v) => { //
params.order_bys.push({ //
column: v.property, //
order: v.order //
})
});
}
return this.loadData({ params }); //
}
}
},
//
columns: [
{ type: 'checkbox', width: 50 }, //
{ title: '操作', slots: { default: 'op' }, width: 120 },
{ type: 'seq', width: 30 }, //
// =============================== Start ===============================
{ field: 'type', sortable: true, title: '类型', params:settings.options_schemeType, formatter: 'formatEnum', width: 250 }, // :1.,2.
{ field: 'name', sortable: true, title: '设计方案名称', width: 250 }, //
//{ field: 'code', sortable: true, title: '', width: 250 }, //
{ field: 'model', sortable: true, title: '型号', width: 250 }, //
//{ field: 'description', sortable: true, title: '', width: 250 }, //
{ field: 'image', sortable: true, title: '主图', width: 250 , slots: { default: 'image' } }, //
{ field: 'create_time', formatter: 'formatDate', width: 160, sortable: true, title: '创建时间', showHeaderOverflow: true }, //
{ field: 'update_time', formatter: 'formatDate', width: 160, sortable: true, title: '更新时间', showHeaderOverflow: true }, //
// =============================== Start ===============================
]
}
};
pageData.actions.getList = pageData.actions.BathroomSchemeList;
pageData.actions.delete = pageData.actions.BathroomSchemeBatchDelete;
pageData.gridOptions = Object.assign({}, this.$mk.config.defaults.gridOptions, pageData.gridOptions); //
return pageData; //
},
//
computed: {
//
desc() {
return this.$t('pageDesc')
}
},
//
created() {
this.$nextTick(() => { // DOM
//
this.$refs.xGrid.connect(this.$refs.xToolbar) //
});
},
//
onLoad() {
},
//
methods: {
// =============================== status Start ===============================
// =============================== status End ===============================
//
onDateChange(date) { //
if (date && date.length) { //
this.start_time = parseInt(date[0]._d.getTime() / 1000); //
this.end_time = parseInt(date[1]._d.getTime() / 1000); //
} else { //
this.start_time = 0; //
this.end_time = 0; //
}
},
//
getSearchParms() { //
var rules = []; //
let findMode = k => { //
for (let i in this.searchRules) { //
if (this.searchRules[i].key == k) return this.searchRules[i].mode; //
}
return "equal"; //
};
for (let key in this.searchFormData) { //
let value = this.searchFormData[key]; //
if (value) { //
let mode = findMode(key); //
if (mode == "like") { //
value = "%" + value + "%"; // %
}
rules.push({ //
column: key, //
mode: mode, //
value: value //
});
}
}
return rules; //
},
//
getSelectdRow() { //
let row = this.$refs.xGrid.getCurrentRecord(); //
if (!row) { //
let rows = this.$refs.xGrid.getCheckboxRecords(); //
if (rows && rows.length) { row = rows[0]; } //
}
return row; //
},
//
loadData({ params }) {
params.start_time = this.start_time; //
params.end_time = this.end_time; //
this.$mk.getPagedData({ url: this.actions.getList, data: params }).then(r=>{
console.log(r);
})
},
// add / log / setting
toolbarClick(e) {
if (e.name == "add") { //
this.$openPage("/BathroomScheme/BathroomSchemeAdd"); //
}
},
//
pageEdit(row) {
if (!row) { //
this.$mk.msg("请选择行"); //
return; //
}
this.$openPage("/BathroomScheme/BathroomSchemeUpdate/" + row[this.keyName]); //
},
//
pageDelete(row) {
let rows = row ? [row] : this.$refs.xGrid.getCheckboxRecords(); //
let ids = []; // id
rows.forEach((row) => { //
ids.push(row[this.keyName]); // idid
});
if (!ids.length) { //
this.$mk.error("请选择行"); //
return;
}
this.$mk.confirm('您确定要删除吗?').then(type => { //
if (type == 'confirm') { //
this.$mk.post({
url: this.actions.delete, //
loading: "删除中...", //
data: {
ids: ids // id
},
useBigInt : true
}).then(() => { //
this.$mk.success("删除成功"); //
this.onSearch(); //
}).catch((a) => { //
this.$mk.error(a.data.msg); //
});
}
});
},
//
onSearch() {
this.$refs.xGrid.commitProxy('query') //
},
},
//
watch: {
}
};
</script>
<style scoped lang="less">
.page-body {
padding: 30px;
background: @base-bg-color;
}
.gridPanel {
height: calc(100vh - 400px);
}
</style>
<style>
.oplinks svg {
width: 22px;
height: 22px;
margin: 0 5px 0 0;
}
</style>

View File

@ -3,7 +3,7 @@
<vxe-pulldown class="edit-down-pulldown" ref="xDown" transfer>
<template>
<vxe-textarea class="edit-expressions-textarea" ref="inputx" v-model="textboxValue" placeholder="输入表达式"
@click="clickEvent" @change="textChange" ></vxe-textarea>
@click="clickEvent" @change="textChange"></vxe-textarea>
</template>
<template #dropdown>
@ -41,8 +41,8 @@ export default {
actions: {
},
textboxValue: '',
expressions_list: settings.expressions_list,
sourceValue:'',
expressions_list: [],
sourceValue: '',
row: null,
column: null,
loading: false
@ -54,11 +54,11 @@ export default {
this.$nextTick(() => {
this.$refs.inputx.focus();
this.$refs.xDown.showPanel()
})
})
},
beforeDestroy() {
beforeDestroy() {
},
methods: {
methods: {
addText(item) {
const { row, column } = this.params
if (!this.textboxValue) {
@ -68,20 +68,20 @@ export default {
this.$refs.inputx.focus();
row[column.field] = this.textboxValue;
row[column.field] = this.textboxValue;
},
setText(){
setText() {
const { row, column } = this.params
this.textboxValue = this.sourceValue;
row[column.field] = this.textboxValue;
row[column.field] = this.textboxValue;
this.$refs.inputx.focus();
},
textChange(){
textChange() {
const { row, column } = this.params
row[column.field] = this.textboxValue;
row[column.field] = this.textboxValue;
},
load() {
const { row, column } = this.params
@ -90,11 +90,27 @@ export default {
this.textboxValue = row[column.field]
if(row.source && row.source[column.field]){
if (row.source && row.source[column.field]) {
this.sourceValue = row.source[column.field];
}
this.expressions_list = settings.expressions_list;
if (column.params && column.params.hasTotalQuantity) {
if (row.material && row.material[1]) {
let name = this.formatName(row.material[1]);
if(name == '封边条'){
this.expressions_list = ['封边条用量合计', ... this.expressions_list]
}else{
this.expressions_list = [name + '的总用量', ... this.expressions_list]
}
}
}
},
formatName(v) {
return (v || "").replace("\r", "").replace("\n", "").replace("\t", "").replace(" ", "");
},
clickEvent() {
this.$refs.xDown.showPanel()
@ -109,7 +125,7 @@ export default {
this.$refs.xDown.togglePanel()
},
}
}
@ -129,25 +145,28 @@ export default {
box-shadow: 0 0 6px 2px rgba(0, 0, 0, 0.1);
line-height: 180%;
font-size: 14px;
overflow:auto;
overflow: auto;
}
.edit-expressions-wrapper ul{
.edit-expressions-wrapper ul {
list-style: none;
padding-left: 20px;
}
.sourceValue{
.sourceValue {
padding-left: 20px;
cursor: pointer;
}
.edit-expressions-wrapper li {
list-style: none;
}
.edit-expressions-wrapper a {
color: #4286eb;
list-style: none;
}
.edit-expressions-wrapper a {
color: #4286eb;
cursor: pointer;
}
</style>
}</style>

View File

@ -142,7 +142,7 @@ var config = {
table_min_count: 4,
table_min_count: 1,
getGuid: () => {