diff --git a/src/pages/Middle/bathroom/BathroomQuotation/BathroomQuotation/Edit.vue b/src/pages/Middle/bathroom/BathroomQuotation/BathroomQuotation/Edit.vue index d88fa64..16c2f22 100644 --- a/src/pages/Middle/bathroom/BathroomQuotation/BathroomQuotation/Edit.vue +++ b/src/pages/Middle/bathroom/BathroomQuotation/BathroomQuotation/Edit.vue @@ -769,7 +769,7 @@ export default { currentConfigName: "", // 当前项目ID currentBeid: 0, - + settignsValues : {}, tabKey: 'main', showAll: false, showExp: false, @@ -1109,7 +1109,7 @@ export default { created() { - + this.loadSettings(); // 获取路由的id参数 let dataId = this.getDataId(); @@ -1185,6 +1185,33 @@ export default { // 函数 methods: { + + loadSettings() { + + this.$mk.post({ + url: `${BASE_URL.BASE_URL}/BathroomScheme/v1/settings/list`, + data: { + } + }).then(a => { + + let data = {}; + let getName = (info) => { + for (let name in info) { + return name; + } + return null; + } + a.data.settings.forEach(o => { + let name = getName(o.setting); + if (!name) return; + data[name] = o.setting[name]; + }); + + this.settignsValues = data; + }).catch((a) => { + this.$mk.error(a.data.msg); + }); + }, formatShowNumber(value, points) { if (!value) { return '' + (0.0).toFixed(points || 0) + ''; @@ -1495,6 +1522,13 @@ export default { row.height_formula = selectedData.spec; } } + + if (!row.rate_materials && this.settignsValues.Main_material_utilization_rate) { + row.rate_materials = this.settignsValues.Main_material_utilization_rate; + } + if (!row.paint_number && this.settignsValues.Default_rate_of_paint_surface) { + row.paint_number = this.settignsValues.Default_rate_of_paint_surface; + } }, fittings_onPopupSelected({ rows, name, params }) { console.log(rows, name, params); diff --git a/src/pages/Middle/bathroom/BathroomQuotation/BathroomQuotation/List.vue b/src/pages/Middle/bathroom/BathroomQuotation/BathroomQuotation/List.vue index 0b012f0..5bcc8bc 100644 --- a/src/pages/Middle/bathroom/BathroomQuotation/BathroomQuotation/List.vue +++ b/src/pages/Middle/bathroom/BathroomQuotation/BathroomQuotation/List.vue @@ -349,8 +349,21 @@ export default { if (e.name == "add") { // 如果是添加 this.$openPage("/BathroomQuotation/BathroomQuotationAdd"); // 打开页面 } + if (e.name == "setting") { + this.openSettings(); + } + }, + openSettings() { + this.$mk.dialog.open({ + page: () => import("@/pages/Middle/bathroom/basic/settings.vue"), + title: "参数配置", + pageOptions: { + }, + width: 800, + height: 600, + dataId: 0 + }); }, - // 编辑 pageEdit(row) { if (!row) { // 如果没有选中行 diff --git a/src/pages/Middle/bathroom/BathroomQuotation/BathroomQuotation/drawer.vue b/src/pages/Middle/bathroom/BathroomQuotation/BathroomQuotation/drawer.vue index cb3c93d..4145acb 100644 --- a/src/pages/Middle/bathroom/BathroomQuotation/BathroomQuotation/drawer.vue +++ b/src/pages/Middle/bathroom/BathroomQuotation/BathroomQuotation/drawer.vue @@ -681,6 +681,7 @@ export default { currentConfigName: "", // 当前项目ID currentBeid: 0, + settignsValues : {}, showType: '1', showExp: false, @@ -880,6 +881,7 @@ export default { created() { + this.loadSettings(); let data = this.item; this.formOptions.data = data; this.fittings_detailsData = data.fittingsList || []; @@ -898,6 +900,34 @@ export default { }, // 函数 methods: { + + + loadSettings() { + + this.$mk.post({ + url: `${BASE_URL.BASE_URL}/BathroomScheme/v1/settings/list`, + data: { + } + }).then(a => { + + let data = {}; + let getName = (info) => { + for (let name in info) { + return name; + } + return null; + } + a.data.settings.forEach(o => { + let name = getName(o.setting); + if (!name) return; + data[name] = o.setting[name]; + }); + + this.settignsValues = data; + }).catch((a) => { + this.$mk.error(a.data.msg); + }); + }, formatShowNumber(value, points) { if (!value) { return ''+(0.0).toFixed(points ||0)+''; @@ -1049,6 +1079,12 @@ export default { row.height_formula = selectedData.spec; } } + if (!row.rate_materials && this.settignsValues.Main_material_utilization_rate) { + row.rate_materials = this.settignsValues.Main_material_utilization_rate; + } + if (!row.paint_number && this.settignsValues.Default_rate_of_paint_surface) { + row.paint_number = this.settignsValues.Default_rate_of_paint_surface; + } }, fittings_onPopupSelected({ rows, name, params }) { console.log(rows, name, params); diff --git a/src/pages/Middle/bathroom/BathroomScheme/BathroomScheme/Edit.vue b/src/pages/Middle/bathroom/BathroomScheme/BathroomScheme/Edit.vue index 113ffe7..e0fc0fe 100644 --- a/src/pages/Middle/bathroom/BathroomScheme/BathroomScheme/Edit.vue +++ b/src/pages/Middle/bathroom/BathroomScheme/BathroomScheme/Edit.vue @@ -96,15 +96,13 @@ - + + :edit-render="{ name: '$input', props: { type: 'number' } }"> - + @@ -142,11 +140,11 @@ :edit-render="{ name: 'EditExpressions' }"> + :edit-render="{ name: 'EditExpressions' }"> + :edit-render="{ name: 'EditExpressions' }"> @@ -218,7 +216,8 @@ - + @@ -228,17 +227,18 @@ - +

核算表(油漆)

- @@ -269,10 +269,11 @@ - @@ -291,7 +292,8 @@ - + @@ -352,8 +354,8 @@ export default { currentConfigName: "", // 当前项目ID currentBeid: 0, - - groupbox1_activeKey: ["1","2"], + settignsValues : {}, + groupbox1_activeKey: ["1", "2"], groupbox2_activeKey: [], groupbox3_activeKey: [], isReadonly: false, @@ -460,7 +462,7 @@ export default { detailDataFieldName: "bathroom_scheme", actions: { - + // =============================== 接口地址 自动生成 Start =============================== BathroomSchemeList: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/list`, // 设计方案列表 BathroomSchemeDetail: `${BASE_URL.BASE_URL}/BathroomScheme/v1/bathroom/scheme/detail`, // 设计方案详情 @@ -614,7 +616,7 @@ export default { { field: 'model', title: '型号', span: 24, itemRender: { name: '$input' } }, { field: 'type', title: '类型', span: 24, itemRender: { name: '$radio', options: settings.options_schemeType } }, - + ] }, { @@ -661,8 +663,7 @@ export default { }, created() { - - + this.loadSettings(); // 获取路由的id参数 let dataId = this.getDataId(); @@ -691,7 +692,7 @@ export default { let data = a.data[this.detailDataFieldName] - + this.formOptions.data = data; this.fittings_detailsData = JSON.parse(data.fittingsList || "[]"); @@ -703,7 +704,7 @@ export default { this.material_detailsData = JSON.parse(data.materialList || "[]"); this.paintLabor_detailsData = JSON.parse(data.paintLaborList || "[]"); this.paintMaterial_detailsData = JSON.parse(data.paintMaterialList || "[]"); - + @@ -732,8 +733,33 @@ export default { methods: { + loadSettings() { + + this.$mk.post({ + url: `${BASE_URL.BASE_URL}/BathroomScheme/v1/settings/list`, + data: { + } + }).then(a => { + + let data = {}; + let getName = (info) => { + for (let name in info) { + return name; + } + return null; + } + a.data.settings.forEach(o => { + let name = getName(o.setting); + if (!name) return; + data[name] = o.setting[name]; + }); + + this.settignsValues = data; + }).catch((a) => { + this.$mk.error(a.data.msg); + }); + }, - detailDataInit() { @@ -805,16 +831,25 @@ export default { } } + + + if (column.field == "paint_material") { this.resetPaintMaterial(); } if (column.field == "material") { this.resetMaterial(); - if(selectedData.spec){ + if (selectedData.spec) { row.height_formula = selectedData.spec; } - + + } + if (!row.rate_materials && this.settignsValues.Main_material_utilization_rate) { + row.rate_materials = this.settignsValues.Main_material_utilization_rate; + } + if (!row.paint_number && this.settignsValues.Default_rate_of_paint_surface) { + row.paint_number = this.settignsValues.Default_rate_of_paint_surface; } }, fittings_onPopupSelected({ rows, name, params }) { @@ -826,6 +861,8 @@ export default { }, fittings_afterEditEvent({ column, row }) { console.log(row, column); + + }, fittings_beforeEditEvent({ column, row }) { console.log(row, column); @@ -845,20 +882,20 @@ export default { const $table = this.$refs.fittings_xTable; this.fittings_detailsData.splice($table.getRowSeq(row) - 1, 1); this.resetMaterial(); - this.resetPaintMaterial(); + this.resetPaintMaterial(); }, - parts_onPulldownSelected({selectedData,row }) { - console.log(row, selectedData); - if(selectedData.spec){ + parts_onPulldownSelected({ selectedData, row }) { + console.log(row, selectedData); + if (selectedData.spec) { row.spec = selectedData.spec; - + } - if(selectedData.price){ + if (selectedData.price) { row.price = selectedData.price; - + } }, parts_onPopupSelected({ rows, name, params }) { @@ -1082,8 +1119,8 @@ export default { - formatName(v){ - return (v || "").replace("\r","").replace("\n","").replace("\t","").replace(" ",""); + formatName(v) { + return (v || "").replace("\r", "").replace("\n", "").replace("\t", "").replace(" ", ""); }, @@ -1103,7 +1140,7 @@ export default { let material_list = []; material_items.forEach(item => { - + let name = this.formatName(item[1]); let old = this.material_detailsData.filter(a => a.material && a.material[0] == item[0] ? true : false); let info = { @@ -1113,7 +1150,7 @@ export default { price: 0 }; if (old.length) { - info.quantity_formula = `{${name}的总用量}`; + info.quantity_formula = `{${name}的总用量}`; info.price = old[0].price; info.amount_formula = old[0].amount_formula; } @@ -1177,7 +1214,7 @@ export default { price: 0 }; if (old.length) { - info.quantity_formula = `{${name}的总用量}`; + info.quantity_formula = `{${name}的总用量}`; info.price = old[0].price; info.amount_formula = old[0].amount_formula; } @@ -1220,11 +1257,11 @@ export default { if (!data) return; data.forEach(item => { delete item._X_ROW_KEY; - if(!item.id){ + if (!item.id) { item.id = settings.getGuid(); } }); - }, + }, // 保存 ok() { @@ -1256,7 +1293,7 @@ export default { postdata.laborList = postdata.laborList.filter(item => item.labor && item.labor[1] ? true : false); postdata.materialList = postdata.materialList.filter(item => item.material && item.material[1] ? true : false); - + postdata.paintLaborList = postdata.paintLaborList.filter(item => item.labor && item.labor[1] ? true : false); postdata.paintMaterialList = postdata.paintMaterialList.filter(item => item.material && item.material[1] ? true : false); @@ -1353,7 +1390,7 @@ export default { }, confirmSelectScheme() { let row = this.$refs.scheme_grid.getCurrentRecord(); // 获取当前行 - + let fittingsList = JSON.parse(row.fittingsList || "[]"); fittingsList = fittingsList.filter(a => a.fittings && a.fittings[0]); let partsList = JSON.parse(row.partsList || "[]"); diff --git a/src/pages/Middle/bathroom/BathroomScheme/BathroomScheme/List.vue b/src/pages/Middle/bathroom/BathroomScheme/BathroomScheme/List.vue index b7323ca..a601656 100644 --- a/src/pages/Middle/bathroom/BathroomScheme/BathroomScheme/List.vue +++ b/src/pages/Middle/bathroom/BathroomScheme/BathroomScheme/List.vue @@ -303,8 +303,21 @@ export default { if (e.name == "add") { // 如果是添加 this.$openPage("/BathroomScheme/BathroomSchemeAdd"); // 打开页面 } + if (e.name == "setting") { + this.openSettings(); + } + }, + openSettings() { + this.$mk.dialog.open({ + page: () => import("@/pages/Middle/bathroom/basic/settings.vue"), + title: "参数配置", + pageOptions: { + }, + width: 800, + height: 600, + dataId: 0 + }); }, - // 编辑 pageEdit(row) { if (!row) { // 如果没有选中行 diff --git a/src/pages/Middle/bathroom/basic/settings.vue b/src/pages/Middle/bathroom/basic/settings.vue new file mode 100644 index 0000000..f353f4f --- /dev/null +++ b/src/pages/Middle/bathroom/basic/settings.vue @@ -0,0 +1,181 @@ + + + + diff --git a/src/router/Middle/Mes/basic/router.map.js b/src/router/Middle/Mes/basic/router.map.js new file mode 100644 index 0000000..22b5be6 --- /dev/null +++ b/src/router/Middle/Mes/basic/router.map.js @@ -0,0 +1,51 @@ + + + +// 视图组件 +const view = { + tabs: () => import('@/layouts/tabs'), + blank: () => import('@/layouts/BlankView'), + page: () => import('@/layouts/PageView') +} + +// 路由组件注册 +const routerMap = { +}; +routerMap['basic']= { + name: 'basic', + icon: 'idcard', + component: view.blank, + meta: { + }, + authority: { + permission: [], + } +}; + +routerMap['basic_materials']= { + name: '基础档案', + icon: 'idcard', + path: `/MesMaterials/MesMaterialsList`, + meta:{ + page:{ cacheAble:false} + }, + component: () => import(`@/pages/Middle/Mes/MesMaterials/MesMaterials/List`), + authority: { + permission: [], + } +}; + +routerMap['basic_unit']= { + name: '基础档案', + icon: 'idcard', + path: `/MesUnit/MesUnitList`, + meta:{ + page:{ cacheAble:false} + }, + component: () => import(`@/pages/Middle/Mes/MesUnit/MesUnit/List`), + authority: { + permission: [], + } +}; + +export default {} diff --git a/src/router/Middle/Mes/router.map.js b/src/router/Middle/Mes/router.map.js index da3ebb1..48dc021 100644 --- a/src/router/Middle/Mes/router.map.js +++ b/src/router/Middle/Mes/router.map.js @@ -17,6 +17,8 @@ import MesWarehouse from '@/router/Middle/Mes/MesWarehouse/router.map.js' import MesEnum from '@/router/Middle/Mes/MesEnum/router.map.js' import MesUnitRouterMap from '@/router/Middle/Mes/MesUnit/router.map.js' +import basic from '@/router/Middle/Mes/basic/router.map.js' + const routerMap = Object.assign({}, MesUnitRouterMap, MesCeramicsMaterialClassification, @@ -30,7 +32,9 @@ const routerMap = Object.assign({}, MesStaff, MesStock, MesWarehouse, - MesEnum + MesEnum, + + basic ) diff --git a/src/router/async/config.async.js b/src/router/async/config.async.js index a8b2cf8..a9fa65a 100644 --- a/src/router/async/config.async.js +++ b/src/router/async/config.async.js @@ -14,8 +14,7 @@ const routesConfig = [ router: 'exp403', path: '/403', name: '403' - }, - + }, ] const options = { routes: parseRoutes(routesConfig, routerMap)