实际成本 #9
@@ -239,6 +239,18 @@ export const constantRoutes = [
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
// Bom,工序,采购价格
|
// Bom,工序,采购价格
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: Layout,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: "actualCost",
|
||||||
|
component: () => import("@/views/actualCost/index"),
|
||||||
|
name: "ActualCost",
|
||||||
|
meta: { title: "实际成本", icon: "tree", affix: true }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
//本地调试默认路由
|
//本地调试默认路由
|
||||||
|
|||||||
@@ -0,0 +1,103 @@
|
|||||||
|
<script lang="tsx">
|
||||||
|
//表格
|
||||||
|
import { defineComponent, ref } from "vue";
|
||||||
|
import {
|
||||||
|
costStandardDetailList,
|
||||||
|
exportcostStandardDetail
|
||||||
|
} from "@/api/singleLineQuery.js";
|
||||||
|
import { transformPageResponse } from "@/utils/qomo";
|
||||||
|
import { download } from "@qomo-platform/utils";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
export default defineComponent({
|
||||||
|
setup() {
|
||||||
|
const tableRef = ref();
|
||||||
|
//列
|
||||||
|
const columns = ref([
|
||||||
|
{ type: "selection" },
|
||||||
|
{ prop: "materialNumber", label: "内部订单号" },
|
||||||
|
{ label: "物料号", prop: "versionNumber" },
|
||||||
|
{ label: "总实际成本", prop: "level", hideInSearchForm: true },
|
||||||
|
{ label: "材料成本", prop: "figureNumber", hideInSearchForm: true },
|
||||||
|
{ label: "直接人工", prop: "dosage", hideInSearchForm: true },
|
||||||
|
{ label: "折旧", prop: "unit", hideInSearchForm: true },
|
||||||
|
{ label: "燃动力", prop: "materialCost", hideInSearchForm: true },
|
||||||
|
{ label: "辅料", prop: "laborCost", hideInSearchForm: true },
|
||||||
|
{ label: "其他费用", prop: "equipmentCost", hideInSearchForm: true },
|
||||||
|
{ label: "人工工时(分钟)", prop: "driveCost", hideInSearchForm: true },
|
||||||
|
{
|
||||||
|
label: "机器工时(分钟)",
|
||||||
|
prop: "supplyMaterialCost",
|
||||||
|
hideInSearchForm: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "operation",
|
||||||
|
label: "操作",
|
||||||
|
minWidth: 120,
|
||||||
|
render: ({ row }) => (
|
||||||
|
<base-table-operation
|
||||||
|
btnList={[
|
||||||
|
{
|
||||||
|
key: "edit",
|
||||||
|
label: "查看结构树",
|
||||||
|
onclick: () => checkTree(row)
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
const render = () => {
|
||||||
|
return (
|
||||||
|
<BaseTable
|
||||||
|
columns={columns.value}
|
||||||
|
queryParamsToUrl
|
||||||
|
toolbar={{ layout: "search-dnamic,reload,column-setting,fullscreen" }}
|
||||||
|
ref={tableRef}
|
||||||
|
issortTable
|
||||||
|
request={async ({
|
||||||
|
pageSize = 10,
|
||||||
|
current = 1,
|
||||||
|
...otherSearchParams
|
||||||
|
}) => {
|
||||||
|
return transformPageResponse(
|
||||||
|
await costStandardDetailList({
|
||||||
|
pageNo: current,
|
||||||
|
pageSize,
|
||||||
|
...otherSearchParams
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
v-slots={{
|
||||||
|
toolbar: ({ doAddOrEdit }) => (
|
||||||
|
<el-space>
|
||||||
|
<el-button type="success" onclick={handleExport}>
|
||||||
|
批量导出
|
||||||
|
</el-button>
|
||||||
|
</el-space>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
const handleExport = () => {
|
||||||
|
exportcostStandardDetail(
|
||||||
|
tableRef.value.selectionRows
|
||||||
|
? {
|
||||||
|
selections: tableRef.value.selectionRows
|
||||||
|
.map(item => item.id)
|
||||||
|
.join(",")
|
||||||
|
}
|
||||||
|
: {}
|
||||||
|
).then(res => {
|
||||||
|
download(res, "费用预测明细.xlsx");
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const checkTree = (row) => {
|
||||||
|
ElMessage.info("查看结构树");
|
||||||
|
};
|
||||||
|
return render;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped></style>
|
||||||
@@ -10,34 +10,28 @@ export default defineComponent({
|
|||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const forecastDialogRef = ref();
|
const forecastDialogRef = ref();
|
||||||
const selectionRows = ref([]);
|
const selectionRows = ref([]);
|
||||||
const btnTitle = ref("工时差异");
|
const btnTitle = ref("工时差异");
|
||||||
// const uploadUrl = ref("/c7525cost/importExcel");
|
// const uploadUrl = ref("/c7525cost/importExcel");
|
||||||
//列
|
//列
|
||||||
const columnsCheck = ref([
|
const columnsCheck = ref([
|
||||||
{ prop: "type", label: "对比项", hideInSearchForm: true },
|
{ prop: "type", label: "对比项", hideInSearchForm: true },
|
||||||
{
|
{
|
||||||
label: "金额(单位:元)",
|
label: "实际",
|
||||||
prop: "costCenterCode",
|
prop: "costCenterCode",
|
||||||
hideInSearchForm: true
|
hideInSearchForm: true
|
||||||
},
|
},
|
||||||
{ label: "版本1", prop: "factory", hideInSearchForm: true },
|
{ label: "标准", prop: "factory", hideInSearchForm: true },
|
||||||
{ label: "版本2", prop: "factory", hideInSearchForm: true },
|
{ label: "差值", prop: "factory", hideInSearchForm: true },
|
||||||
{ label: "差异金额", prop: "factory", hideInSearchForm: true },
|
|
||||||
{
|
{
|
||||||
type: "operation",
|
type: "operation",
|
||||||
label: "差异分析",
|
label: "挖掘分析",
|
||||||
minWidth: 120,
|
minWidth: 120,
|
||||||
render: ({ row }) => (
|
render: ({ row }) => (
|
||||||
<base-table-operation
|
<base-table-operation
|
||||||
btnList={[
|
btnList={[
|
||||||
{
|
{
|
||||||
key: "check",
|
key: "check",
|
||||||
label:
|
label:"查看明细",
|
||||||
row.type === 0
|
|
||||||
? "工时差异"
|
|
||||||
: row.type === 1
|
|
||||||
? "人工制费差异"
|
|
||||||
: "材料成本差异",
|
|
||||||
onclick: () => timeVariance(row)
|
onclick: () => timeVariance(row)
|
||||||
}
|
}
|
||||||
]}
|
]}
|
||||||
@@ -47,20 +41,20 @@ export default defineComponent({
|
|||||||
]);
|
]);
|
||||||
const columns = ref([
|
const columns = ref([
|
||||||
{ type: "selection" },
|
{ type: "selection" },
|
||||||
{ prop: "year", label: "内部订单号" },
|
{ prop: "year", label: "工厂号" },
|
||||||
{ label: "物料号", prop: "costCenterCode" },
|
{ label: "物料号", prop: "costCenterCode" },
|
||||||
{ label: "成本阶段", prop: "factory" },
|
{ label: "成本阶段", prop: "factory" },
|
||||||
{ prop: "laborHourRate", label: "版本号", hideInSearchForm: true },
|
{ prop: "laborHourRate", label: "版本号", hideInSearchForm: true },
|
||||||
{ prop: "equipHourRate", label: "状态",hideInAddOrEditForm: true},
|
{ prop: "equipHourRate", label: "工单年月",hideInAddOrEditForm: true},
|
||||||
{
|
{
|
||||||
prop: "fuelHourRate",
|
prop: "fuelHourRate",
|
||||||
label: "总标准成本(版本1)",
|
label: "实际总成本",
|
||||||
hideInSearchForm: true,
|
hideInSearchForm: true,
|
||||||
hideInAddOrEditForm: true
|
hideInAddOrEditForm: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: "auxiliaryHourRate",
|
prop: "auxiliaryHourRate",
|
||||||
label: "总标准成本(版本2)",
|
label: "标准总成本",
|
||||||
hideInSearchForm: true,
|
hideInSearchForm: true,
|
||||||
hideInAddOrEditForm: true
|
hideInAddOrEditForm: true
|
||||||
},
|
},
|
||||||
@@ -75,7 +69,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "operation",
|
type: "operation",
|
||||||
label: "操作",
|
label: "报告状态",
|
||||||
minWidth: 120,
|
minWidth: 120,
|
||||||
render: ({ row, doAddOrEdit, doDeleteRows, doPreview }) => (
|
render: ({ row, doAddOrEdit, doDeleteRows, doPreview }) => (
|
||||||
<base-table-operation
|
<base-table-operation
|
||||||
@@ -138,7 +132,7 @@ export default defineComponent({
|
|||||||
toolbar: ({ doAddOrEdit, doDeleteRows }) => (
|
toolbar: ({ doAddOrEdit, doDeleteRows }) => (
|
||||||
<el-space>
|
<el-space>
|
||||||
<el-button type="primary" onClick={doAddOrEdit}>
|
<el-button type="primary" onClick={doAddOrEdit}>
|
||||||
添加对比项
|
新增挖掘任务
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-space>
|
</el-space>
|
||||||
)
|
)
|
||||||
|
|||||||
+146
-206
@@ -3,214 +3,154 @@
|
|||||||
import { defineComponent, ref } from "vue";
|
import { defineComponent, ref } from "vue";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import { transformPageResponse } from "@/utils/qomo";
|
import { transformPageResponse } from "@/utils/qomo";
|
||||||
import { useRouter } from "vue-router";
|
import { hourRateList, addHourRate, editHourRate, deleteHourRate, deleteBatchHourRate } from '@/api/hour';
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
setup() {
|
setup() {
|
||||||
const router = useRouter();
|
const tableRef = ref();
|
||||||
const tableRef = ref();
|
const forecastDialogRef = ref();
|
||||||
const forecastDialogRef = ref();
|
const selectionRows = ref([]);
|
||||||
const selectionRows = ref([]);
|
// const uploadUrl = ref("/c7525cost/importExcel");
|
||||||
const btnTitle = ref("工时差异");
|
//列
|
||||||
// const uploadUrl = ref("/c7525cost/importExcel");
|
const columns = ref([
|
||||||
//列
|
{ type: "selection" },
|
||||||
const columnsCheck = ref([
|
{ prop: "year", label: "年度" },
|
||||||
{ prop: "type", label: "对比项", hideInSearchForm: true },
|
{ label: "成本中心代码", prop: "costCenterCode" },
|
||||||
{
|
{ label: "工厂代码", prop: "factory" },
|
||||||
label: "金额(单位:元)",
|
{ prop: "laborHourRate", label: "人工小时费率", hideInSearchForm: true },
|
||||||
prop: "costCenterCode",
|
{ prop: "equipHourRate", label: "设备小时费率", hideInSearchForm: true },
|
||||||
hideInSearchForm: true
|
{ prop: "fuelHourRate", label: "燃动小时费率", hideInSearchForm: true },
|
||||||
},
|
{ prop: "auxiliaryHourRate", label: "辅料小时费率", hideInSearchForm: true },
|
||||||
{ label: "版本1", prop: "factory", hideInSearchForm: true },
|
{ prop: "otherHourRate", label: "其他小时费率", hideInSearchForm: true },
|
||||||
{ label: "版本2", prop: "factory", hideInSearchForm: true },
|
{ valueType: "date", prop: "effectiveDate", label: "生效日期", hideInSearchForm: true },
|
||||||
{ label: "差异金额", prop: "factory", hideInSearchForm: true },
|
{ valueType: "date", prop: "expirationDate", label: "失效日期", hideInSearchForm: true },
|
||||||
{
|
{ prop: "guardian", label: "维护人员", hideInSearchForm: true },
|
||||||
type: "operation",
|
{
|
||||||
label: "差异分析",
|
type: "operation",
|
||||||
minWidth: 120,
|
label: "操作",
|
||||||
render: ({ row }) => (
|
minWidth: 120,
|
||||||
<base-table-operation
|
render: ({ row, doAddOrEdit, doDeleteRows, doPreview }) => (
|
||||||
btnList={[
|
<base-table-operation
|
||||||
{
|
btnList={
|
||||||
key: "check",
|
[{
|
||||||
label:
|
key: "edit",
|
||||||
row.type === 0
|
label: "编辑",
|
||||||
? "工时差异"
|
onclick: () => doAddOrEdit(row)
|
||||||
: row.type === 1
|
},
|
||||||
? "人工制费差异"
|
{
|
||||||
: "材料成本差异",
|
key: "delete",
|
||||||
onclick: () => timeVariance(row)
|
label: "删除",
|
||||||
}
|
onclick: () => doDeleteRows(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 }) => (
|
|
||||||
<base-table-operation
|
|
||||||
btnList={[
|
|
||||||
{
|
|
||||||
key: "check",
|
|
||||||
label: "查看报告",
|
|
||||||
onclick: () => checkReport(row)
|
|
||||||
}
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
|
|
||||||
const render = () => {
|
const render = () => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<BaseTable
|
<BaseTable
|
||||||
columns={columns.value}
|
columns={columns.value}
|
||||||
ref={tableRef}
|
ref={tableRef}
|
||||||
selectionRows={selectionRows.value}
|
selectionRows = {selectionRows.value}
|
||||||
toolbar={{
|
toolbar={{ layout: "search-dnamic,reload,column-setting,fullscreen" }}
|
||||||
layout: "search-dnamic,reload,column-setting,fullscreen"
|
request={async ({
|
||||||
}}
|
pageSize = 10,
|
||||||
request={async ({
|
current = 1,
|
||||||
pageSize = 10,
|
...otherSearchParams
|
||||||
current = 1,
|
}) => {
|
||||||
...otherSearchParams
|
return transformPageResponse(
|
||||||
}) => {
|
await hourRateList({
|
||||||
await new Promise(resolve =>
|
pageNo: current,
|
||||||
setTimeout(resolve, Math.random() * 1111)
|
pageSize,
|
||||||
);
|
...otherSearchParams
|
||||||
return {
|
})
|
||||||
data: Array(pageSize)
|
);
|
||||||
.fill(0)
|
}}
|
||||||
.map((item, index) => ({
|
curdConfig={{
|
||||||
id: Math.random(),
|
/**
|
||||||
name: "Tom" + current,
|
* 接受自动表单的数据
|
||||||
date123: "date123" + current,
|
* @param data
|
||||||
createTime: new Date().getTime(),
|
*/
|
||||||
districtName: "区划" + index,
|
async onAddOrEdit(data) {
|
||||||
districtName1: "区划1" + index
|
if (data.id) {
|
||||||
})),
|
await editHourRate(data)
|
||||||
current,
|
} else {
|
||||||
// pages: 500 / pageSize,
|
await addHourRate(data)
|
||||||
total: 500
|
}
|
||||||
};
|
},
|
||||||
}}
|
/*删除*/
|
||||||
curdConfig={{
|
async onDeleteRows(data) {
|
||||||
/**
|
if (Array.isArray(data)) {
|
||||||
* 接受自动表单的数据
|
await deleteBatchHourRate({ ids: data.map(item => item.id).join(',') })
|
||||||
* @param data
|
} else {
|
||||||
*/
|
await deleteHourRate({ id: data.id })
|
||||||
async onAddOrEdit(data) {},
|
}
|
||||||
|
},
|
||||||
|
unitColSpan: 12,
|
||||||
|
// rules: {
|
||||||
|
// 'name': [{required:true}]
|
||||||
|
// },
|
||||||
|
}}
|
||||||
|
v-slots={{
|
||||||
|
toolbar: ({ doAddOrEdit, doDeleteRows }) => (
|
||||||
|
<el-space>
|
||||||
|
<el-button type="success" onclick={handleBatchImport}>批量导入</el-button>
|
||||||
|
<el-button type="success" onclick={handleExport}>导出</el-button>
|
||||||
|
<el-button type="primary" onClick={doAddOrEdit}>
|
||||||
|
添加
|
||||||
|
</el-button>
|
||||||
|
<el-button type="warning" onClick={doDeleteRows}>批量删除</el-button>
|
||||||
|
</el-space>
|
||||||
|
),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<base-dialog-form
|
||||||
|
ref={forecastDialogRef}
|
||||||
|
title={"批量导入文件"}
|
||||||
|
width={400}
|
||||||
|
labelWidth={0}
|
||||||
|
rules={{
|
||||||
|
filed: [
|
||||||
|
{ required: true, message: "请上传附件", trigger: "blur" }
|
||||||
|
]
|
||||||
|
}}
|
||||||
|
confirm= { () =>{
|
||||||
|
{/* forecastDialogRef.value.open() */}
|
||||||
|
}}
|
||||||
|
v-slots={{
|
||||||
|
default: ({ model }) => (
|
||||||
|
<el-form-item label="" prop="filed">
|
||||||
|
<base-upload
|
||||||
|
dragx
|
||||||
|
multiple
|
||||||
|
limit={1}
|
||||||
|
v-model={model.fileIds}
|
||||||
|
>
|
||||||
|
<el-icon>
|
||||||
|
<upload-filled />
|
||||||
|
</el-icon>
|
||||||
|
<div class="w-full">请上传文件</div>
|
||||||
|
</base-upload>
|
||||||
|
</el-form-item>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
unitColSpan: 24
|
);
|
||||||
}}
|
};
|
||||||
v-slots={{
|
const handleBatchImport = () => {
|
||||||
toolbar: ({ doAddOrEdit, doDeleteRows }) => (
|
forecastDialogRef.value.open()
|
||||||
<el-space>
|
};
|
||||||
<el-button type="primary" onClick={doAddOrEdit}>
|
const handleExport = () => {
|
||||||
添加对比项
|
console.log(selectionRows.value,"PPPPPPPPPPPPPPPPPP");
|
||||||
</el-button>
|
|
||||||
</el-space>
|
};
|
||||||
)
|
return render;
|
||||||
}}
|
},
|
||||||
/>
|
|
||||||
<BaseDialog
|
|
||||||
title="报告详情"
|
|
||||||
width="80%"
|
|
||||||
ref={forecastDialogRef}
|
|
||||||
confirmButtonProps={false}
|
|
||||||
>
|
|
||||||
<BaseTable
|
|
||||||
columns={columnsCheck.value}
|
|
||||||
ref={tableRef}
|
|
||||||
selectionRows={selectionRows.value}
|
|
||||||
request={async ({ pageSize = 10, current = 1 }) => {
|
|
||||||
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
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</BaseDialog>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
Reference in New Issue
Block a user