页面
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
"@vueup/vue-quill": "1.2.0",
|
||||
"@vueuse/core": "10.6.1",
|
||||
"axios": "1.6.7",
|
||||
"echarts": "^5.5.0",
|
||||
"element-plus": "2.4.3",
|
||||
"file-saver": "2.0.5",
|
||||
"js-cookie": "3.0.5",
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import request from "@/service/request";
|
||||
|
||||
/*新增版本号*/
|
||||
export function costStandardVersionAdd(data) {
|
||||
return request.post("/costStandardVersion/add", {}, data, {
|
||||
message: {
|
||||
success: "生成成功",
|
||||
error: true
|
||||
}
|
||||
});
|
||||
}
|
||||
// 查询列表
|
||||
export function costStandardList(params) {
|
||||
return request.get(`/costStandard/list`, params);
|
||||
}
|
||||
//删除
|
||||
export function deleteCostStandard(data) {
|
||||
return request.delete("/costStandard/delete", data,{
|
||||
message: {
|
||||
success: "删除成功",
|
||||
error: true
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import request from "@/service/request";
|
||||
|
||||
// 查询列表
|
||||
export function costStandardDetailList(params) {
|
||||
return request.get(`/costStandardDetail/list`, params);
|
||||
}
|
||||
/*导出excel*/
|
||||
export function exportcostStandardDetail(data) {
|
||||
return request.get("/costStandardDetail/exportXls", data, {
|
||||
message: {
|
||||
success: "导出成功",
|
||||
error: true
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import request from "@/service/request";
|
||||
|
||||
// 查询列表
|
||||
export function queryBomTree(params) {
|
||||
return request.get(`/bomTree/queryBomTree`, params);
|
||||
}
|
||||
// 查询物料编号接口
|
||||
export function costMaterialBomList(params) {
|
||||
return request.get(`/cost-material-bom/list`, params);
|
||||
}
|
||||
// 查询版本号接口
|
||||
export function costStandardVersionList(params) {
|
||||
return request.get(`/costStandardVersion/list`, params);
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<script lang="tsx">
|
||||
//表格
|
||||
import { defineComponent, ref, onMounted, watch } from "vue";
|
||||
import * as echarts from 'echarts';
|
||||
export default defineComponent({
|
||||
props: {
|
||||
option:Object
|
||||
},
|
||||
setup(props) {
|
||||
const chartRef = ref();
|
||||
const render = () => {
|
||||
return (
|
||||
<div ref={chartRef} style="width: 100%; height: 100%;">
|
||||
|
||||
</div>
|
||||
);
|
||||
};
|
||||
onMounted(() => {
|
||||
// 初始化图表
|
||||
const chartInstance = echarts.init(chartRef.value);
|
||||
chartInstance.setOption(props.option);
|
||||
window.addEventListener('resize', () => {
|
||||
chartInstance.resize();
|
||||
});
|
||||
});
|
||||
watch(props, (newVal, oldVal) => {
|
||||
if (newVal.option) {
|
||||
const chartInstance = echarts.init(chartRef.value);
|
||||
chartInstance.setOption(props.option);
|
||||
}
|
||||
});
|
||||
return render;
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -51,6 +51,7 @@ function render(props = {}) {
|
||||
|
||||
// 使用element-plus 并且设置全局的大小
|
||||
app.use(ElementPlus, {
|
||||
name:'testApp',
|
||||
locale: locale,
|
||||
// 支持 large、default、small
|
||||
size: Cookies.get("size") || "default"
|
||||
|
||||
+18
-2
@@ -6,7 +6,22 @@ export const qomoPlatformOptions = {
|
||||
//字典配置
|
||||
dict: {
|
||||
//静态字典
|
||||
staticDictMaps: {},
|
||||
staticDictMaps: {
|
||||
stageData: [
|
||||
{
|
||||
label: "初始",
|
||||
value: "A"
|
||||
},
|
||||
{
|
||||
label: "量产",
|
||||
value: "B"
|
||||
},
|
||||
{
|
||||
label: "首批",
|
||||
value: "C"
|
||||
}
|
||||
]
|
||||
},
|
||||
async provider(dictType) {
|
||||
const result = await getDictCode({
|
||||
dictCode: dictType
|
||||
@@ -31,7 +46,8 @@ export const qomoPlatformOptions = {
|
||||
relativePath: files.name,
|
||||
name: files.originalName,
|
||||
url: location.origin + files?.fileurl
|
||||
})
|
||||
}),
|
||||
namespace: "testApp"
|
||||
}
|
||||
} as QomoPlatformInstallOptions;
|
||||
|
||||
|
||||
+57
-9
@@ -69,15 +69,39 @@ export const constantRoutes = [
|
||||
},
|
||||
]
|
||||
},
|
||||
// {
|
||||
// path: '',
|
||||
// component: Layout,
|
||||
// children: [
|
||||
// {
|
||||
// path: "/hour",
|
||||
// component: () => import("@/views/hour/index"),
|
||||
// name: "Hour",
|
||||
// meta: { title: "小时费率", icon: "money", affix: true }
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// path: '',
|
||||
// component: Layout,
|
||||
// children: [
|
||||
// {
|
||||
// path: "/unitPrice",
|
||||
// component: () => import("@/views/unitPrice/index"),
|
||||
// name: "UnitPrice",
|
||||
// meta: { title: "7525单价", icon: "money", affix: true }
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
{
|
||||
path: '',
|
||||
component: Layout,
|
||||
children: [
|
||||
{
|
||||
path: "/hour",
|
||||
component: () => import("@/views/hour/index"),
|
||||
name: "Hour",
|
||||
meta: { title: "小时费率", icon: "money", affix: true }
|
||||
path: "convolution/costCalculation",
|
||||
component: () => import("@/views/convolution/costCalculation/index"),
|
||||
name: "CostCalculation",
|
||||
meta: { title: "成本计算", icon: "money", affix: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -86,13 +110,37 @@ export const constantRoutes = [
|
||||
component: Layout,
|
||||
children: [
|
||||
{
|
||||
path: "/unitPrice",
|
||||
component: () => import("@/views/unitPrice/index"),
|
||||
name: "UnitPrice",
|
||||
meta: { title: "7525单价", icon: "money", affix: true }
|
||||
path: "convolution/singleLineQuery",
|
||||
component: () => import("@/views/convolution/singleLineQuery/index"),
|
||||
name: "SingleLineQuery",
|
||||
meta: { title: "单行查询", icon: "money", affix: true }
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
component: Layout,
|
||||
children: [
|
||||
{
|
||||
path: "convolution/treeQuery",
|
||||
component: () => import("@/views/convolution/treeQuery/index"),
|
||||
name: "TreeQuery",
|
||||
meta: { title: "结构树查询", icon: "tree", affix: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
component: Layout,
|
||||
children: [
|
||||
{
|
||||
path: "miningAnalysis/statistics",
|
||||
component: () => import("@/views/miningAnalysis/statistics/index"),
|
||||
name: "Statistics",
|
||||
meta: { title: "挖掘统计", icon: "tree", affix: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
];
|
||||
|
||||
//本地调试默认路由
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
<script lang="tsx">
|
||||
//表格
|
||||
import { defineComponent, ref, watch } from "vue";
|
||||
import { costStandardVersionAdd } from '@/api/costCalculation';
|
||||
export default defineComponent({
|
||||
props: {
|
||||
visible: Boolean,
|
||||
tableRef: Object,
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
const forecastDialogRef = ref();
|
||||
const rileForm = ref();
|
||||
const formData = ref({
|
||||
figureNumber: '',
|
||||
stage: '',
|
||||
createTime: '',
|
||||
versionNumber: '',
|
||||
materialNumber: '',
|
||||
versionYear: ''
|
||||
});
|
||||
// const rules ={
|
||||
// figureNumber: [
|
||||
// { required: true, message: '请输入图号', trigger: ['blur','change'] }
|
||||
// ],
|
||||
// stage: [
|
||||
// { required: true, message: '请选择项目阶段', trigger: ['blur','change'] }
|
||||
// ],
|
||||
// createTime: [
|
||||
// { required: true, message: '请选择项目时间', trigger: ['blur','change'] }
|
||||
// ],
|
||||
// versionNumber: [
|
||||
// { required: true, message: '请生成版本号', trigger: ['blur','change'] }
|
||||
// ]
|
||||
// };
|
||||
const render = () => {
|
||||
return (
|
||||
<div>
|
||||
<base-dialog-form
|
||||
ref={forecastDialogRef}
|
||||
v-model={props.visible}
|
||||
title={"生成设置版本号"}
|
||||
width={400}
|
||||
labelWidth={0}
|
||||
confirm={() => {
|
||||
emit('cancelVisible');
|
||||
const year = formData.value.createTime.split("-")[0];
|
||||
formData.value.versionYear = year;
|
||||
costStandardVersionAdd(formData.value).then(res => {
|
||||
props.tableRef.doReload();
|
||||
})
|
||||
}}
|
||||
cancel={() => {
|
||||
emit('cancelVisible');
|
||||
}}
|
||||
>
|
||||
<el-form ref={rileForm} v-model={formData.value} label-width="100px">
|
||||
<el-form-item label="图号" prop="figureNumber">
|
||||
<el-input v-model={formData.value.figureNumber} onChange={splicing} />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料号" prop="figurmaterialNumbereNumber">
|
||||
<el-input v-model={formData.value.materialNumber} />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目阶段" prop="stage">
|
||||
<el-select v-model={formData.value.stage} placeholder="请选择项目阶段" onChange={splicing}>
|
||||
<el-option label="初始" value="A"></el-option>
|
||||
<el-option label="量产" value="B"></el-option>
|
||||
<el-option label="首批" value="C"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
{/* <el-form-item label="年份" prop="versionYear">
|
||||
<el-date-picker
|
||||
v-model={formData.value.versionYear}
|
||||
type="year"
|
||||
value-format="YYYY"
|
||||
onChange={splicing}
|
||||
placeholder="选择年份">
|
||||
</el-date-picker>
|
||||
</el-form-item> */}
|
||||
<el-form-item label="创建日期" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model={formData.value.createTime}
|
||||
type="datetime"
|
||||
disabledDate={(time) => {
|
||||
return time.getTime() > Date.now();
|
||||
}}
|
||||
value-format="YYYY-MM-DD HH:MM:ss"
|
||||
onChange={splicing}
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="生成版本号" prop="versionNumber">
|
||||
<el-input type="textarea" disabled rows="2" v-model={formData.value.versionNumber} />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</base-dialog-form>
|
||||
</div>
|
||||
|
||||
);
|
||||
};
|
||||
const splicing = () => {
|
||||
formData.value.versionNumber = "";
|
||||
formData.value.versionNumber = formData.value.figureNumber + '_' + formData.value.stage + '_' + formData.value.createTime;
|
||||
};
|
||||
watch(props, (newVal, oldVal) => {
|
||||
if (newVal.visible) {
|
||||
formData.value = {
|
||||
figureNumber: '',
|
||||
stage: '',
|
||||
createTime: '',
|
||||
versionNumber: '',
|
||||
materialNumber: '',
|
||||
versionYear: ''
|
||||
}
|
||||
}
|
||||
});
|
||||
return render;
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,190 @@
|
||||
<script lang="tsx">
|
||||
//表格
|
||||
import { defineComponent, ref } from "vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
import Calculate from "./component/calculate.vue";
|
||||
import { transformPageResponse } from "@/utils/qomo";
|
||||
import { costStandardList,deleteCostStandard } from '@/api/costCalculation';
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const tableRef = ref();
|
||||
const visible = ref(false);
|
||||
const forecastDialogRef = ref();
|
||||
//列
|
||||
const columns = ref([
|
||||
{ type: "selection" },
|
||||
{ label: "版本号", prop: "versionNumber" },
|
||||
{ label: "年份", prop: "versionYear", valueType: "year" },
|
||||
{ label: "物料编号", prop: "materialNumber" },
|
||||
{ prop: "bomCost", label: "bom材料费", hideInAddOrEditForm: true, hideInSearchForm: true },
|
||||
{ label: "包装费", prop: "packingCost", hideInSearchForm: true },
|
||||
{ label: "辅料费", prop: "auxiliaryCost", hideInSearchForm: true },
|
||||
{ label: "人工费", prop: "laborCost", hideInSearchForm: true },
|
||||
{ label: "机器折旧费", prop: "euipDepreciationCost", hideInSearchForm: true },
|
||||
{ label: "机器料消耗费", prop: "equipConsumeCost", hideInSearchForm: true },
|
||||
{ label: "水电费", prop: "hydroelectricityCost", hideInSearchForm: true },
|
||||
{ label: "其他制造费", prop: "otherCost", hideInSearchForm: true },
|
||||
{ label: "物流费用", prop: "trailCost", hideInSearchForm: true },
|
||||
{ label: "制造成本", prop: "manufactureCost", hideInSearchForm: true },
|
||||
{ label: "工装费", prop: "toolingCost", hideInSearchForm: true },
|
||||
{ label: "检具费", prop: "inspectionCost", hideInSearchForm: true },
|
||||
{ label: "模具费", prop: "moldCost", hideInSearchForm: true },
|
||||
{ label: "测试费", prop: "testCost", hideInSearchForm: true },
|
||||
{ label: "创建日期", prop: "createTime", hideInSearchForm: true, valueType: "datetime" },
|
||||
{ label: "阶段", prop: "stage", valueType: 'dict-select', extraProps: { dictType: 'stageData' } },
|
||||
{ label: "版本状态", prop: "versionStatus" },
|
||||
{ label: "总成本", prop: "totalCost", hideInSearchForm: true },
|
||||
{
|
||||
type: "operation",
|
||||
label: "操作",
|
||||
minWidth: 200,
|
||||
render: ({ row, doAddOrEdit, doDeleteRows, doReload, doPreview }) => (
|
||||
<base-table-operation
|
||||
btnList={
|
||||
[{
|
||||
key: "edit",
|
||||
label: "重新计算",
|
||||
onclick: () => doAddOrEdit(row)
|
||||
},
|
||||
{
|
||||
key: "delete",
|
||||
label: "删除",
|
||||
onclick: () => doDeleteRows(row)
|
||||
},
|
||||
{
|
||||
key: "deletion",
|
||||
label: "部件缺失信息",
|
||||
},
|
||||
{
|
||||
key: "preview",
|
||||
label: "查看详情",
|
||||
onclick: () => doPreview(row)
|
||||
}
|
||||
]
|
||||
}
|
||||
/>
|
||||
)
|
||||
},
|
||||
]);
|
||||
|
||||
const render = () => {
|
||||
return (
|
||||
<div>
|
||||
<BasePageContainer flex-hidden={true} style={{ width: "100%", height: "800px", padding: "0" }}>
|
||||
<BaseTable
|
||||
columns={columns.value}
|
||||
queryParamsToUrl
|
||||
toolbar={{ layout: "search-dnamic,reload,column-setting,fullscreen" }}
|
||||
ref={tableRef}
|
||||
request={async ({
|
||||
pageSize = 10,
|
||||
current = 1,
|
||||
...otherSearchParams
|
||||
}) => {
|
||||
let tableData = {};
|
||||
tableData = transformPageResponse(
|
||||
await costStandardList({
|
||||
pageNo: current,
|
||||
pageSize,
|
||||
...otherSearchParams
|
||||
})
|
||||
);
|
||||
tableData.data.forEach(item => {
|
||||
if (item.stage == "A") {
|
||||
item.stage = "初始"
|
||||
} else if (item.stage == "B") {
|
||||
item.stage = "量产"
|
||||
} else if (item.stage == "C") {
|
||||
item.stage = "首批"
|
||||
}
|
||||
})
|
||||
return tableData;
|
||||
}}
|
||||
curdConfig={{
|
||||
unitColSpan: 12,
|
||||
async onDeleteRows(data) {
|
||||
await deleteCostStandard({ id: data.id })
|
||||
},
|
||||
}}
|
||||
v-slots={{
|
||||
toolbar: () => (
|
||||
<el-space>
|
||||
<el-button type="primary" onClick={calculate}>
|
||||
计算标准成本
|
||||
</el-button>
|
||||
<el-button type="success" onClick={batchCalculate}>批量计算</el-button>
|
||||
<el-button type="info" onClick={batchExport}>批量导出</el-button>
|
||||
</el-space>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
</BasePageContainer>
|
||||
<Calculate visible={visible.value} onCancelVisible={cancelVisible} tableRef={tableRef.value}></Calculate>
|
||||
<base-dialog-form
|
||||
ref={forecastDialogRef}
|
||||
title={"批量计算"}
|
||||
width={400}
|
||||
labelWidth={0}
|
||||
rules={{
|
||||
filed: [
|
||||
{ required: true, message: "请上传附件", trigger: "blur" }
|
||||
]
|
||||
}}
|
||||
confirm={() => {
|
||||
{/* forecastDialogRef.value.open(); */ }
|
||||
}}
|
||||
cancel={() => {
|
||||
forecastDialogRef.value.close();
|
||||
}}
|
||||
v-slots={{
|
||||
default: ({ model }) => (
|
||||
<el-form-item label="" prop="filed">
|
||||
<base-upload
|
||||
drag
|
||||
multiple
|
||||
limit={1}
|
||||
on-change={onChange}
|
||||
v-model={model.fileIds}
|
||||
accept=".xls,.xlsx,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||
>
|
||||
<el-icon class="el-icon-upload">
|
||||
<upload-filled />
|
||||
</el-icon>
|
||||
<div class="w-full">请上传文件</div>
|
||||
</base-upload>
|
||||
</el-form-item>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
const calculate = () => {
|
||||
visible.value = true;
|
||||
}
|
||||
const cancelVisible = () => {
|
||||
visible.value = false;
|
||||
}
|
||||
const batchCalculate = () => {
|
||||
forecastDialogRef.value.open();
|
||||
}
|
||||
const batchExport = () => {
|
||||
console.log(tableRef.value.selectionRows, "批量导出");
|
||||
}
|
||||
const onChange = (file) => {
|
||||
console.log(file, "PPPPPPPPPPPPPPPPPPPP");
|
||||
|
||||
const isExcel = file.raw.type === 'application/vnd.ms-excel' ||
|
||||
file.raw.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
|
||||
if (!isExcel) {
|
||||
ElMessage.error('只能上传Excel文件!');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
const doReload = () => { }
|
||||
return render;
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,71 @@
|
||||
<script lang="tsx">
|
||||
//表格
|
||||
import { defineComponent, ref } from "vue";
|
||||
import { costStandardDetailList,exportcostStandardDetail } from "@/api/singleLineQuery.js";
|
||||
import { transformPageResponse } from "@/utils/qomo";
|
||||
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: "specification", hideInSearchForm: true },
|
||||
{ label: "用量", prop: "dosage", hideInSearchForm: true },
|
||||
{ label: "bom材料费", prop: "bomCost", hideInSearchForm: true },
|
||||
{ label: "本阶人工费", prop: "laborCost", hideInSearchForm: true },
|
||||
{ label: "机器折旧费", prop: "euipDepreciationCost", hideInSearchForm: true },
|
||||
{ label: "水电费", prop: "hydroelectricityCost", hideInSearchForm: true },
|
||||
{ label: "本阶辅料费", prop: "auxiliaryCost", hideInSearchForm: true },
|
||||
{ label: "其他制造费", prop: "otherCost", hideInSearchForm: true },
|
||||
// { label: "累计bom材料费", prop: "date123", hideInSearchForm: true },
|
||||
{ label: "累计人工费", prop: "totalLaborCost", hideInSearchForm: true },
|
||||
// { label: "累计设备费", prop: "date123", hideInSearchForm: true },
|
||||
{ label: "累计水电费", prop: "totalHydroelectricityCost", hideInSearchForm: true },
|
||||
// { label: "累计辅料费", prop: "date123", hideInSearchForm: true },
|
||||
{ label: "累计其他费", prop: "totalOtherCost", hideInSearchForm: true },
|
||||
]);
|
||||
|
||||
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(',')} : {} )
|
||||
};
|
||||
return render;
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,207 @@
|
||||
<script lang="tsx">
|
||||
//表格
|
||||
import { defineComponent, ref, onMounted } from "vue";
|
||||
import { queryBomTree, costMaterialBomList, costStandardVersionList } from "@/api/treeQuery.js";
|
||||
import { ElMessage } from "element-plus";
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const tableRef = ref();
|
||||
const materialNumberList = ref([]);
|
||||
const versionNumberList = ref([]);
|
||||
//列
|
||||
const columns = ref([
|
||||
{ prop: "materialNumber", label: "物料编号", valueType: "select", extraProps: { options: materialNumberList } },
|
||||
{ label: "版本号", prop: "versionNumber", valueType: "select", extraProps: { options: versionNumberList } },
|
||||
]);
|
||||
const treeData = ref([
|
||||
|
||||
])
|
||||
const defaultProps = {
|
||||
children: 'children',
|
||||
label: 'label'
|
||||
}
|
||||
const formData = ref({});
|
||||
const render = () => {
|
||||
return (
|
||||
<BaseTable
|
||||
columns={columns.value}
|
||||
queryParamsToUrl
|
||||
pagination={false}
|
||||
toolbar={{ layout: "reload,fullscreen" }}
|
||||
ref={tableRef}
|
||||
request={async ({
|
||||
...otherSearchParams
|
||||
}) => {
|
||||
await queryBomTree({
|
||||
...otherSearchParams
|
||||
}).then((res) => {
|
||||
console.log(res, "PPPPPPPPPPPPPPPPPPP")
|
||||
treeData.value = addLabelRecursively(res);
|
||||
});
|
||||
}}
|
||||
v-slots={{
|
||||
body: ({ data }) => (
|
||||
<div class="treeMain">
|
||||
<div class="treeMain-left">
|
||||
<el-tree data={treeData.value} props={defaultProps} onNodeClick={handleNodeClick}></el-tree>
|
||||
</div>
|
||||
<div class="treeMain-right">
|
||||
<el-form v-model={formData.value} label-width="150px" disabled>
|
||||
<el-row>
|
||||
<el-col span="12">
|
||||
<el-form-item label="物料编号" prop="materialNumber">
|
||||
<el-input v-model={formData.value.materialNumber} />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-form-item label="图号" prop="figureNumber">
|
||||
<el-input v-model={formData.value.figureNumber} />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-form-item label="本阶标准成本" prop="standardCost">
|
||||
<el-input v-model={formData.value.standardCost} />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-form-item label="累计标准成本" prop="accumulatedStandardCost">
|
||||
<el-input v-model={formData.value.accumulatedStandardCost} />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-form-item label="本阶物料成本" prop="materialCost">
|
||||
<el-input v-model={formData.value.materialCost} />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-form-item label="累计物料成本" prop="accumulatedMaterialCost">
|
||||
<el-input v-model={formData.value.accumulatedMaterialCost} />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-form-item label="本阶人工成本" prop="laborCost">
|
||||
<el-input v-model={formData.value.laborCost} />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-form-item label="累计人工成本" prop="accumulatedLaborCost">
|
||||
<el-input v-model={formData.value.accumulatedLaborCost} />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
{/* <el-col span="12">
|
||||
<el-form-item label="本阶制造费用" prop="figureNumber">
|
||||
<el-input v-model={formData.value.figureNumber} />
|
||||
</el-form-item>
|
||||
</el-col> */}
|
||||
{/* <el-col span="12">
|
||||
<el-form-item label="累计制作费用" prop="figureNumber">
|
||||
<el-input v-model={formData.value.figureNumber} />
|
||||
</el-form-item>
|
||||
</el-col> */}
|
||||
<el-col span="12">
|
||||
<el-form-item label="人工工时" prop="figureNumber">
|
||||
<el-input v-model={formData.value.figureNumber} />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-form-item label="人工费率" prop="figureNumber">
|
||||
<el-input v-model={formData.value.figureNumber} />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-form-item label="设备工时" prop="figureNumber">
|
||||
<el-input v-model={formData.value.figureNumber} />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-form-item label="设备费率" prop="figureNumber">
|
||||
<el-input v-model={formData.value.figureNumber} />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-form-item label="燃动工时" prop="figureNumber">
|
||||
<el-input v-model={formData.value.figureNumber} />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-form-item label="燃动费率" prop="figureNumber">
|
||||
<el-input v-model={formData.value.figureNumber} />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-form-item label="辅料工时" prop="figureNumber">
|
||||
<el-input v-model={formData.value.figureNumber} />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-form-item label="辅料费率" prop="figureNumber">
|
||||
<el-input v-model={formData.value.figureNumber} />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-form-item label="其他工时" prop="figureNumber">
|
||||
<el-input v-model={formData.value.figureNumber} />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="12">
|
||||
<el-form-item label="其他费率" prop="figureNumber">
|
||||
<el-input v-model={formData.value.figureNumber} />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
const handleNodeClick = (data) => {
|
||||
console.log(data, "PPPPPPPPPPPPPPPPPPPPPPPP");
|
||||
formData.value = data;
|
||||
}
|
||||
const addLabelRecursively = (data) => {
|
||||
data.forEach((item) => {
|
||||
item.label = `${item.materialNumber}${item.materialName ? ' ' + '_' + item.materialName : ''}`;
|
||||
if (item.children && item.children.length > 0) {
|
||||
addLabelRecursively(item.children);
|
||||
}
|
||||
});
|
||||
return data;
|
||||
}
|
||||
onMounted(() => {
|
||||
costMaterialBomList().then(res => {
|
||||
res.forEach(item => {
|
||||
item.label = item.materialCode;
|
||||
item.value = item.materialCode;
|
||||
})
|
||||
materialNumberList.value = res;
|
||||
})
|
||||
costStandardVersionList().then(res => {
|
||||
res.forEach(item => {
|
||||
item.label = item.versionNumber;
|
||||
item.value = item.versionNumber;
|
||||
})
|
||||
versionNumberList.value = res;
|
||||
})
|
||||
})
|
||||
return render;
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.treeMain {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
|
||||
.treeMain-left {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.treeMain-right {
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,143 @@
|
||||
<script lang="tsx">
|
||||
//表格
|
||||
import { defineComponent, ref } from "vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
import Echarts from "@/components/Echarts/index.vue";
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const tableRef = ref();
|
||||
const tableRef1 = ref();
|
||||
//列
|
||||
const columns1 = ref([
|
||||
{ prop: "districtName", label: "物料编号", hideInAddOrEditForm: true, hideInSearchForm: true },
|
||||
{ label: "版本号", prop: "name" },
|
||||
{ label: "实际总成本", prop: "date123" },
|
||||
{ label: "标准总成本", prop: "date123" },
|
||||
{ label: "总额差", prop: "date123" },
|
||||
{ label: "总额比", prop: "date123" },
|
||||
{ label: "时间", prop: "date123" },
|
||||
{
|
||||
type: "operation",
|
||||
label: "操作",
|
||||
minWidth: 270,
|
||||
render: ({ row, doPreview }) => (
|
||||
<base-table-operation
|
||||
btnList={
|
||||
[
|
||||
{
|
||||
key: "preview",
|
||||
label: "查看详情",
|
||||
onclick: () => doPreview(row)
|
||||
}
|
||||
]
|
||||
}
|
||||
/>
|
||||
)
|
||||
},
|
||||
]);
|
||||
const columns = ref([
|
||||
{ prop: "districtName", label: "物料编号"},
|
||||
{ label: "版本号", prop: "name"},
|
||||
]);
|
||||
const option1 = ref({
|
||||
title: {
|
||||
text: '物料,人工,制造费用占比情况',
|
||||
left: 'center',
|
||||
top: 'bottom'
|
||||
},
|
||||
tooltip: {},
|
||||
legend: {
|
||||
orient: 'horizontal',
|
||||
left: 'center'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '访问来源',
|
||||
type: 'pie',
|
||||
radius: '50%',
|
||||
data: [
|
||||
{ value: 335, name: '直接访问' },
|
||||
{ value: 310, name: '邮件营销' },
|
||||
{ value: 234, name: '联盟广告' },
|
||||
{ value: 135, name: '视频广告' },
|
||||
{ value: 1548, name: '搜索引擎' }
|
||||
]
|
||||
}
|
||||
]
|
||||
});
|
||||
const option2 = ref({
|
||||
title: {
|
||||
text: '标准成本与实际成本统计图',
|
||||
left: 'center',
|
||||
top: 'bottom'
|
||||
},
|
||||
tooltip: {},
|
||||
legend: {
|
||||
orient: 'horizontal',
|
||||
left: 'center'
|
||||
},
|
||||
xAxis: {
|
||||
data: ['第一网格', '第二网格', '第三网格', '第丝网格', '第五网格', '第六网格', '第七网格',],
|
||||
},
|
||||
yAxis: [{
|
||||
type: 'value',
|
||||
}],
|
||||
series: [
|
||||
{
|
||||
name: '住房',
|
||||
type: 'bar',
|
||||
data: [90, 70, 98, 11, 22, 66, 77, 77],
|
||||
},
|
||||
{
|
||||
name: '企业',
|
||||
type: 'bar',
|
||||
data: [22, 33, 33, 44, 66, 66, 77, 88],
|
||||
}
|
||||
]
|
||||
});
|
||||
const render = () => {
|
||||
return (
|
||||
<div>
|
||||
<BaseTable
|
||||
columns={columns.value}
|
||||
queryParamsToUrl
|
||||
ref={tableRef}
|
||||
curdConfig={{
|
||||
|
||||
}}
|
||||
v-slots={{
|
||||
body: ({ data }) => (
|
||||
<div>
|
||||
<div class='topEacharts'>
|
||||
<Echarts option={option1.value}></Echarts>
|
||||
<Echarts option={option2.value}></Echarts>
|
||||
</div>
|
||||
<BaseTable
|
||||
columns={columns1.value}
|
||||
toolbar={false}
|
||||
ref={tableRef1}
|
||||
curdConfig={{
|
||||
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
);
|
||||
};
|
||||
|
||||
return render;
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.topEacharts {
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
</style>
|
||||
+2
-2
@@ -52,8 +52,8 @@ export default defineConfig(({ mode, command }) => {
|
||||
proxy: {
|
||||
// https://cn.vitejs.dev/config/#server-proxy
|
||||
"/qomo": {
|
||||
target: "http://172.16.0.241:8095", //wq
|
||||
// target: "http://172.16.0.87:8095", //bgy
|
||||
// target: "http://172.16.0.241:8095", //wq
|
||||
target: "http://172.16.0.214:8095", //bgy
|
||||
// target: "http://192.168.50.9:8095",
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
|
||||
Reference in New Issue
Block a user