From 64e6a9ce3125494dce582d9899856cfcd592ae5f Mon Sep 17 00:00:00 2001 From: hanchaobo <1114523253@qq.com> Date: Sat, 14 Sep 2024 17:19:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E9=99=85=E6=88=90=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 12 ++ src/views/actualCost/index.vue | 103 ++++++++++ src/views/costMining/index.vue | 30 ++- src/views/hour/index.vue | 352 ++++++++++++++------------------- 4 files changed, 273 insertions(+), 224 deletions(-) create mode 100644 src/views/actualCost/index.vue diff --git a/src/router/index.js b/src/router/index.js index a0e6e49..b79ece3 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -239,6 +239,18 @@ export const constantRoutes = [ ] }, // Bom,工序,采购价格 + { + path: '', + component: Layout, + children: [ + { + path: "actualCost", + component: () => import("@/views/actualCost/index"), + name: "ActualCost", + meta: { title: "实际成本", icon: "tree", affix: true } + } + ] + }, ]; //本地调试默认路由 diff --git a/src/views/actualCost/index.vue b/src/views/actualCost/index.vue new file mode 100644 index 0000000..e2c8989 --- /dev/null +++ b/src/views/actualCost/index.vue @@ -0,0 +1,103 @@ + + diff --git a/src/views/costMining/index.vue b/src/views/costMining/index.vue index 2aca776..087e9f8 100644 --- a/src/views/costMining/index.vue +++ b/src/views/costMining/index.vue @@ -10,34 +10,28 @@ export default defineComponent({ const tableRef = ref(); const forecastDialogRef = ref(); const selectionRows = ref([]); - const btnTitle = ref("工时差异"); + const btnTitle = ref("工时差异"); // const uploadUrl = ref("/c7525cost/importExcel"); //列 const columnsCheck = ref([ { prop: "type", label: "对比项", hideInSearchForm: true }, { - label: "金额(单位:元)", + label: "实际", prop: "costCenterCode", hideInSearchForm: true }, - { label: "版本1", prop: "factory", hideInSearchForm: true }, - { label: "版本2", prop: "factory", hideInSearchForm: true }, - { label: "差异金额", prop: "factory", hideInSearchForm: true }, + { label: "标准", prop: "factory", hideInSearchForm: true }, + { label: "差值", prop: "factory", hideInSearchForm: true }, { type: "operation", - label: "差异分析", + label: "挖掘分析", minWidth: 120, render: ({ row }) => ( timeVariance(row) } ]} @@ -47,20 +41,20 @@ export default defineComponent({ ]); const columns = ref([ { type: "selection" }, - { prop: "year", label: "内部订单号" }, + { prop: "year", label: "工厂号" }, { label: "物料号", prop: "costCenterCode" }, { label: "成本阶段", prop: "factory" }, { prop: "laborHourRate", label: "版本号", hideInSearchForm: true }, - { prop: "equipHourRate", label: "状态",hideInAddOrEditForm: true}, + { prop: "equipHourRate", label: "工单年月",hideInAddOrEditForm: true}, { prop: "fuelHourRate", - label: "总标准成本(版本1)", + label: "实际总成本", hideInSearchForm: true, hideInAddOrEditForm: true }, { prop: "auxiliaryHourRate", - label: "总标准成本(版本2)", + label: "标准总成本", hideInSearchForm: true, hideInAddOrEditForm: true }, @@ -75,7 +69,7 @@ export default defineComponent({ }, { type: "operation", - label: "操作", + label: "报告状态", minWidth: 120, render: ({ row, doAddOrEdit, doDeleteRows, doPreview }) => ( ( - 添加对比项 + 新增挖掘任务 ) diff --git a/src/views/hour/index.vue b/src/views/hour/index.vue index 2aca776..7849238 100644 --- a/src/views/hour/index.vue +++ b/src/views/hour/index.vue @@ -3,214 +3,154 @@ import { defineComponent, ref } from "vue"; import { ElMessage } from "element-plus"; import { transformPageResponse } from "@/utils/qomo"; -import { useRouter } from "vue-router"; +import { hourRateList, addHourRate, editHourRate, deleteHourRate, deleteBatchHourRate } from '@/api/hour'; export default defineComponent({ - setup() { - const router = useRouter(); - const tableRef = ref(); - const forecastDialogRef = ref(); - const selectionRows = ref([]); - const btnTitle = ref("工时差异"); - // const uploadUrl = ref("/c7525cost/importExcel"); - //列 - const columnsCheck = ref([ - { prop: "type", label: "对比项", hideInSearchForm: true }, - { - label: "金额(单位:元)", - prop: "costCenterCode", - hideInSearchForm: true - }, - { label: "版本1", prop: "factory", hideInSearchForm: true }, - { label: "版本2", prop: "factory", hideInSearchForm: true }, - { label: "差异金额", prop: "factory", hideInSearchForm: true }, - { - type: "operation", - label: "差异分析", - minWidth: 120, - render: ({ row }) => ( - timeVariance(row) - } - ]} - /> - ) - } - ]); - const columns = ref([ - { type: "selection" }, - { prop: "year", label: "内部订单号" }, - { label: "物料号", prop: "costCenterCode" }, - { label: "成本阶段", prop: "factory" }, - { prop: "laborHourRate", label: "版本号", hideInSearchForm: true }, - { prop: "equipHourRate", label: "状态",hideInAddOrEditForm: true}, - { - prop: "fuelHourRate", - label: "总标准成本(版本1)", - hideInSearchForm: true, - hideInAddOrEditForm: true - }, - { - prop: "auxiliaryHourRate", - label: "总标准成本(版本2)", - hideInSearchForm: true, - hideInAddOrEditForm: true - }, - { prop: "otherHourRate", label: "总差额", hideInSearchForm: true,hideInAddOrEditForm: true }, - { prop: "effectiveDate", label: "差额比", hideInSearchForm: true,hideInAddOrEditForm: true }, - { - valueType: "date", - prop: "expirationDate", - label: "创建时间", - hideInSearchForm: true, - hideInAddOrEditForm: true - }, - { - type: "operation", - label: "操作", - minWidth: 120, - render: ({ row, doAddOrEdit, doDeleteRows, doPreview }) => ( - checkReport(row) - } - ]} - /> - ) - } - ]); + setup() { + const tableRef = ref(); + const forecastDialogRef = ref(); + const selectionRows = ref([]); + // const uploadUrl = ref("/c7525cost/importExcel"); + //列 + const columns = ref([ + { type: "selection" }, + { prop: "year", label: "年度" }, + { label: "成本中心代码", prop: "costCenterCode" }, + { label: "工厂代码", prop: "factory" }, + { prop: "laborHourRate", label: "人工小时费率", hideInSearchForm: true }, + { prop: "equipHourRate", label: "设备小时费率", hideInSearchForm: true }, + { prop: "fuelHourRate", label: "燃动小时费率", hideInSearchForm: true }, + { prop: "auxiliaryHourRate", label: "辅料小时费率", hideInSearchForm: true }, + { prop: "otherHourRate", label: "其他小时费率", hideInSearchForm: true }, + { valueType: "date", prop: "effectiveDate", label: "生效日期", hideInSearchForm: true }, + { valueType: "date", prop: "expirationDate", label: "失效日期", hideInSearchForm: true }, + { prop: "guardian", label: "维护人员", hideInSearchForm: true }, + { + type: "operation", + label: "操作", + minWidth: 120, + render: ({ row, doAddOrEdit, doDeleteRows, doPreview }) => ( + doAddOrEdit(row) + }, + { + key: "delete", + label: "删除", + onclick: () => doDeleteRows(row) + } + ] + } + /> + ) + }, + ]); - const render = () => { - return ( -
- { - await new Promise(resolve => - setTimeout(resolve, Math.random() * 1111) - ); - return { - data: Array(pageSize) - .fill(0) - .map((item, index) => ({ - id: Math.random(), - name: "Tom" + current, - date123: "date123" + current, - createTime: new Date().getTime(), - districtName: "区划" + index, - districtName1: "区划1" + index - })), - current, - // pages: 500 / pageSize, - total: 500 - }; - }} - curdConfig={{ - /** - * 接受自动表单的数据 - * @param data - */ - async onAddOrEdit(data) {}, + const render = () => { + return ( +
+ { + return transformPageResponse( + await hourRateList({ + pageNo: current, + pageSize, + ...otherSearchParams + }) + ); + }} + curdConfig={{ + /** + * 接受自动表单的数据 + * @param data + */ + async onAddOrEdit(data) { + if (data.id) { + await editHourRate(data) + } else { + await addHourRate(data) + } + }, + /*删除*/ + async onDeleteRows(data) { + if (Array.isArray(data)) { + await deleteBatchHourRate({ ids: data.map(item => item.id).join(',') }) + } else { + await deleteHourRate({ id: data.id }) + } + }, + unitColSpan: 12, + // rules: { + // 'name': [{required:true}] + // }, + }} + v-slots={{ + toolbar: ({ doAddOrEdit, doDeleteRows }) => ( + + 批量导入 + 导出 + + 添加 + + 批量删除 + + ), + }} + /> + { + {/* forecastDialogRef.value.open() */} + }} + v-slots={{ + default: ({ model }) => ( + + + + + +
请上传文件
+
+
+ ) + }} + /> +
- unitColSpan: 24 - }} - v-slots={{ - toolbar: ({ doAddOrEdit, doDeleteRows }) => ( - - - 添加对比项 - - - ) - }} - /> - - { - await new Promise(resolve => - setTimeout(resolve, Math.random() * 1111) - ); - return { - data: Array(pageSize) - .fill(0) - .map((item, index) => ({ - id: Math.random(), - name: "Tom" + current, - date123: "date123" + current, - createTime: new Date().getTime(), - districtName: "区划" + index, - districtName1: "区划1" + index, - type: index % 3 - })), - current, - total: 500 - }; - }} - curdConfig={{ - /** - * 接受自动表单的数据 - * @param data - */ - async onAddOrEdit(data) {}, - - unitColSpan: 24 - }} - /> - -
- ); - }; - const checkReport = () => { - forecastDialogRef.value.open(); - }; - const timeVariance = row => { - if (row.type == 0) { - // 工时 - router.push({ - path: "/standardComparison/manHour", - }); - } else if (row.type == 1) { - // 人工 - router.push({ - path: "/standardComparison/artificial", - }); - } else if (row.type == 2) { - // 材料 - router.push({ - path: "/standardComparison/materials", - }); - } - }; - return render; - } + ); + }; + const handleBatchImport = () => { + forecastDialogRef.value.open() + }; + const handleExport = () => { + console.log(selectionRows.value,"PPPPPPPPPPPPPPPPPP"); + + }; + return render; + }, }); - + \ No newline at end of file -- 2.54.0