成本挖掘页面 #7

Merged
hanchaobo merged 1 commits from hcb into dev 2024-08-14 00:59:28 +00:00
17 changed files with 1055 additions and 250 deletions
Showing only changes of commit 49855f198a - Show all commits
+2 -2
View File
@@ -2,7 +2,7 @@ import request from "@/service/request";
/*新增版本号*/
export function costStandardVersionAdd(data) {
return request.post("/costStandardVersion/add", {}, data, {
return request.post("/costCount/addCostCountTask", {}, data, {
message: {
success: "生成成功",
error: true
@@ -11,7 +11,7 @@ export function costStandardVersionAdd(data) {
}
// 查询列表
export function costStandardList(params) {
return request.get(`/costStandard/list`, params);
return request.get(`/costCount/list`, params);
}
//删除
export function deleteCostStandard(data) {
+31 -19
View File
@@ -3,30 +3,42 @@ import request from "@/service/request";
export function modelList(params) {
return request.get(`/cost-model/pageList`, params);
}
// /*新增小时费率*/
// export function addHourRate(data) {
// return request.post("/hourRate/add", {}, data, {
// message: {
// success: "新增成功",
// error: true
// }
// });
// }
// /*编辑小时费率*/
// export function editHourRate(data) {
// return request.post("/hourRate/edit", {}, data, {
// message: {
// success: "编辑成功",
// error: true
// }
// });
// }
/*新增*/
export function addModel(data) {
return request.post("/cost-model/add", {}, data, {
message: {
success: "新增成功",
error: true
}
});
}
/*编辑*/
export function editCostModel(data) {
return request.post("/cost-model/edit", {}, data, {
message: {
success: "编辑成功",
error: true
}
});
}
/*删除*/
export function deleteModel(data) {
return request.post("/cost-model/delete",{}, data,{
return request.delete("/cost-model/delete", data,{
message: {
success: "删除成功",
error: true
}
});
}
/*获取流程管理员列表*/
export function listAll() {
return request.get(`/sys/user/listAll`);
}
/*获取环境配置*/
export function environmentList(params) {
return request.get(`/api/environment/list`, params);
}
/*获取操作系统租户*/
export function tenantList(params) {
return request.get(`/api/tenant/list`, params);
}
+2 -2
View File
@@ -5,8 +5,8 @@ export function costStandardDetailList(params) {
return request.get(`/costStandardDetail/list`, params);
}
/*导出excel*/
export function exportcostStandardDetail(data) {
return request.get("/costStandardDetail/exportXls", data, {
export function exportcostStandardDetail(params) {
return request.get("/costStandardDetail/exportXls", params,{ responseType:"blob"}, {
message: {
success: "导出成功",
error: true
+18
View File
@@ -60,6 +60,24 @@ export const qomoPlatformOptions = {
label: "物流费",
value: "LogisticsFee"
}
],
statusList:[
{
label: "未执行",
value: "0"
},
{
label: "计算中",
value: "1"
},
{
label: "计算完成",
value: "2"
},
{
label: "出错中止",
value: "3"
},
]
},
async provider(dictType) {
+60
View File
@@ -165,6 +165,66 @@ export const constantRoutes = [
}
]
},
{
path: '',
component: Layout,
children: [
{
path: "standardComparison/index",
component: () => import("@/views/standardComparison/index"),
name: "Standardcomparison",
meta: { title: "标准成本对比", icon: "tree", affix: true }
}
]
},
{
path: '',
component: Layout,
children: [
{
path: "standardComparison/manHour",
component: () => import("@/views/standardComparison/component/manHour"),
name: "ManHour",
hidden: true,
}
]
},
{
path: '',
component: Layout,
children: [
{
path: "standardComparison/artificial",
component: () => import("@/views/standardComparison/component/artificial"),
name: "Artificial",
hidden: true,
}
]
},
{
path: '',
component: Layout,
children: [
{
path: "standardComparison/materials",
component: () => import("@/views/standardComparison/component/materials"),
name: "Materials",
hidden: true,
}
]
},
{
path: '',
component: Layout,
children: [
{
path: "stageComparison/index",
component: () => import("@/views/stageComparison/index"),
name: "StageComparison",
meta: { title: "阶段成本对比", icon: "tree", affix: true }
}
]
},
// Bom,工序,采购价格
];
@@ -1,120 +1,159 @@
<script lang="tsx">
//表格
import { defineComponent, ref, watch } from "vue";
import { costStandardVersionAdd } from '@/api/costCalculation';
import { costStandardVersionAdd } from "@/api/costCalculation";
import { modelList } from "@/api/modelManagement";
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>
);
props: {
visible: Boolean,
tableRef: Object
},
setup(props, { emit }) {
const forecastDialogRef = ref();
const rileForm = ref();
const formData = ref({
drawingNo: "",
stage: "",
createTime: "",
costVersion: "",
materialNo: "",
year: "",
flowDefinitionId: ""
});
const modelSelect = ref([]);
// 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.year = 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="drawingNo">
<el-input
v-model={formData.value.drawingNo}
onChange={splicing}
/>
</el-form-item>
<el-form-item label="物料号" prop="materialNo">
<el-input v-model={formData.value.materialNo} />
</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="stage">
<el-select
v-model={formData.value.flowDefinitionId}
placeholder="请选择项目阶段"
onChange={splicing}
>
{modelSelect.value.map(item => (
<ElOption
key={item.value}
label={item.label}
value={item.value}
/>
))}
</el-select>
</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="costVersion">
<el-input
type="textarea"
disabled
rows="2"
v-model={formData.value.costVersion}
/>
</el-form-item>
</el-form>
</base-dialog-form>
</div>
);
};
const splicing = () => {
formData.value.costVersion = "";
formData.value.costVersion =
formData.value.drawingNo +
"_" +
formData.value.stage +
"_" +
formData.value.createTime;
};
watch(props, (newVal, oldVal) => {
if (newVal.visible) {
formData.value = {
drawingNo: "",
stage: "",
createTime: "",
costVersion: "",
materialNo: "",
year: "",
flowDefinitionId: ""
};
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: ''
}
}
modelList({ pageNo: 1, pageSize: 999, projectId: 49 }).then(res => {
modelSelect.value = res.records.map(item => {
return {
value: item.id,
label: item.name
};
});
console.log(modelSelect.value, "PPPPPPPPPPPPPPPPPPPPP");
});
return render;
},
}
});
return render;
}
});
</script>
<style lang="scss" scoped></style>
@@ -13,27 +13,12 @@ export default defineComponent({
//列
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: "costVersion" },
{ label: "年份", prop: "year", valueType: "year" },
{ label: "物料编号", prop: "materialNo" },
{ label: "创建日期", prop: "createTime", hideInSearchForm: true, valueType: "datetime" },
{ label: "阶段", prop: "stage", valueType: 'dict-select', extraProps: { dictType: 'stageData' } },
{ label: "版本状态", prop: "versionStatus" },
{ label: "总成本", prop: "totalCost", hideInSearchForm: true },
{ label: "状态", prop: "status",valueType: 'dict-select',extraProps: { dictType: 'statusList' } },
{
type: "operation",
label: "操作",
+20 -13
View File
@@ -3,6 +3,7 @@
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() {
@@ -14,20 +15,24 @@ export default defineComponent({
{ 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: "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 },
{ label: "本阶其他费", prop: "otherCost", hideInSearchForm: true },
{ label: "本阶物流费", prop: "logisticsCost", hideInSearchForm: true },
{ label: "本阶标准成本", prop: "currentStandardCost", hideInSearchForm: true },
{ label: "累计物料成本", prop: "totalMaterialCost", hideInSearchForm: true },
{ label: "累计人工成本", prop: "totalLaborCost", hideInSearchForm: true },
{ label: "累计设备费", prop: "totalEquipmentCost", hideInSearchForm: true },
{ label: "累计燃动费", prop: "totalDriveCost", hideInSearchForm: true },
{ label: "累计辅料费", prop: "totalSupplyMaterialCost", hideInSearchForm: true },
{ label: "累计其他费", prop: "totalOtherCost", hideInSearchForm: true },
{ label: "累计物流成本", prop: "totalLogisticsCost", hideInSearchForm: true },
{ label: "累计标准成本", prop: "totalCurrentStandardCost", hideInSearchForm: true },
]);
const render = () => {
@@ -62,7 +67,9 @@ export default defineComponent({
);
};
const handleExport = () => {
exportcostStandardDetail(tableRef.value.selectionRows ? {selections:tableRef.value.selectionRows.map(item => item.id).join(',')} : {} )
exportcostStandardDetail(tableRef.value.selectionRows ? {selections:tableRef.value.selectionRows.map(item => item.id).join(',')} : {} ).then(res=>{
download(res, '费用预测明细.xlsx');
})
};
return render;
},
+72 -31
View File
@@ -35,7 +35,6 @@ export default defineComponent({
await queryBomTree({
...otherSearchParams
}).then((res) => {
console.log(res, "PPPPPPPPPPPPPPPPPPP")
treeData.value = addLabelRecursively(res);
});
}}
@@ -48,56 +47,98 @@ export default defineComponent({
<div class="treeMain-right">
<el-form v-model={formData.value} label-width="150px" disabled>
<el-row>
<el-col span="12">
<el-col span="12" v-show={formData.value.materialNumber}>
<el-form-item label="物料编号" prop="materialNumber">
<el-input v-model={formData.value.materialNumber} />
</el-form-item>
</el-col>
<el-col span="12">
<el-col span="12" v-show={formData.value.figureNumber}>
<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-col span="12" v-show={formData.value.materialCost}>
<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-col span="12" v-show={formData.value.laborCost}>
<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-col span="12" v-show={formData.value.equipmentCost}>
<el-form-item label="本阶设备费" prop="equipmentCost">
<el-input v-model={formData.value.equipmentCost} />
</el-form-item>
</el-col>
{/* <el-col span="12">
<el-form-item label="本阶制造费用" prop="figureNumber">
<el-input v-model={formData.value.figureNumber} />
<el-col span="12" v-show={formData.value.driveCost}>
<el-form-item label="本阶燃动费" prop="driveCost">
<el-input v-model={formData.value.driveCost} />
</el-form-item>
</el-col> */}
{/* <el-col span="12">
<el-form-item label="累计制作费用" prop="figureNumber">
<el-input v-model={formData.value.figureNumber} />
</el-col>
<el-col span="12" v-show={formData.value.supplyMaterialCost}>
<el-form-item label="本阶辅料费" prop="supplyMaterialCost">
<el-input v-model={formData.value.supplyMaterialCost} />
</el-form-item>
</el-col> */}
</el-col>
<el-col span="12" v-show={formData.value.otherCost}>
<el-form-item label="本阶其他费" prop="otherCost">
<el-input v-model={formData.value.otherCost} />
</el-form-item>
</el-col>
<el-col span="12" v-show={formData.value.logisticsCost}>
<el-form-item label="本阶物流费" prop="logisticsCost">
<el-input v-model={formData.value.logisticsCost} />
</el-form-item>
</el-col>
<el-col span="12" v-show={formData.value.currentStandardCost}>
<el-form-item label="本阶标准成本" prop="currentStandardCost">
<el-input v-model={formData.value.currentStandardCost} />
</el-form-item>
</el-col>
<el-col span="12" v-show={formData.value.totalMaterialCost}>
<el-form-item label="累计物料成本" prop="totalMaterialCost">
<el-input v-model={formData.value.totalMaterialCost} />
</el-form-item>
</el-col>
<el-col span="12" v-show={formData.value.totalLaborCost}>
<el-form-item label="累计人工成本" prop="totalLaborCost">
<el-input v-model={formData.value.totalLaborCost} />
</el-form-item>
</el-col>
<el-col span="12" v-show={formData.value.totalEquipmentCost}>
<el-form-item label="累计设备费" prop="totalEquipmentCost">
<el-input v-model={formData.value.totalEquipmentCost} />
</el-form-item>
</el-col>
<el-col span="12" v-show={formData.value.totalDriveCost}>
<el-form-item label="累计燃动费" prop="totalDriveCost">
<el-input v-model={formData.value.totalDriveCost} />
</el-form-item>
</el-col>
<el-col span="12" v-show={formData.value.totalSupplyMaterialCost}>
<el-form-item label="累计辅料费" prop="totalSupplyMaterialCost">
<el-input v-model={formData.value.totalSupplyMaterialCost} />
</el-form-item>
</el-col>
<el-col span="12" v-show={formData.value.totalOtherCost}>
<el-form-item label="累计其他费" prop="totalOtherCost">
<el-input v-model={formData.value.totalOtherCost} />
</el-form-item>
</el-col>
<el-col span="12" v-show={formData.value.totalLogisticsCost}>
<el-form-item label="累计物流成本" prop="totalLogisticsCost">
<el-input v-model={formData.value.totalLogisticsCost} />
</el-form-item>
</el-col>
<el-col span="12" v-show={formData.value.totalCurrentStandardCost}>
<el-form-item label="累计标准成本" prop="totalCurrentStandardCost">
<el-input v-model={formData.value.totalCurrentStandardCost} />
</el-form-item>
</el-col>
{/* TODO 分割 */}
<el-divider></el-divider>
<el-col span="12">
<el-form-item label="人工工时" prop="figureNumber">
<el-input v-model={formData.value.figureNumber} />
+111 -51
View File
@@ -1,41 +1,105 @@
<script lang="tsx">
//表格
import { defineComponent, ref } from "vue";
import { defineComponent, ref, onMounted } from "vue";
import { ElMessage } from "element-plus";
import { useRouter } from "vue-router";
import { transformPageResponse } from "@/utils/qomo";
import { modelList,deleteModel } from "@/api/modelManagement";
import { useRouter } from 'vue-router';
import {
modelList,
deleteModel,
addModel,
listAll,
environmentList,
tenantList,
editCostModel
} from "@/api/modelManagement";
import { ro } from "element-plus/es/locale";
export default defineComponent({
setup() {
const router = useRouter();
const tableRef = ref();
const forecastDialogRef = ref();
const selectionRows = ref([]);
// const uploadUrl = ref("/c7525cost/importExcel");
const userList = ref([]);
const environmentOptions = ref([]);
const tenantOptions = ref([]);
const router = useRouter();
onMounted(() => {
listAll().then(res => {
res.records.forEach(item => {
userList.value.push({
label: item.username,
value: item.id
});
});
});
environmentList({ pageNo: 1, pageSize: 999 }).then(res => {
res.records.forEach(item => {
environmentOptions.value.push({
label: item.name,
value: item.id
});
});
});
tenantList({ pageNo: 1, pageSize: 999 }).then(res => {
res.records.forEach(item => {
tenantOptions.value.push({
label: item.tenantCode,
value: item.id
});
});
});
});
//列
const columns = ref([
{ prop: "drawingNo", label: "图号" },
{ label: "物料号", prop: "materialNo" },
{ label: "物料类型", prop: "materialType" },
{ prop: "modelName", label: "模型名称", hideInSearchForm: true },
{ prop: "modelVersion", label: "模型版本", hideInSearchForm: true },
{ prop: "name", label: "模型名称",render: ({ row }) => <el-link onClick={() => router.push({ path: "/test/index", query: { id: row.id, code:row.code,type:1,space:'标准成本',spaceId:row.projectId } })}>{row?.name}</el-link>},
{ label: "模型编码", prop: "code" },
{
valueType: "date",
prop: "createTime",
label: "创建时间",
hideInSearchForm: true
label: "模型管理员",
prop: "userName",
hideInSearchForm: true,
hideInAddOrEditForm: true
},
{
prop: "status",
label: "状态",
valueType: "dict-select",
extraProps: { dictType: "modelStatus" }
label: "模型管理员",
prop: "userId",
valueType: "select",
hideInSearchForm: true,
hideInTable: true,
extraProps: { options: userList.value }
},
{
valueType: "date",
prop: "updateTime",
label: "最后修改",
hideInSearchForm: true,
hideInAddOrEditForm: true
},
{
prop: "environmentId",
label: "环境配置",
valueType: "select",
extraProps: { options: environmentOptions.value },
hideInSearchForm: true,
hideInTable: true
},
{
prop: "tenantId",
label: "系统租户",
valueType: "select",
extraProps: { options: tenantOptions.value },
hideInSearchForm: true,
hideInTable: true
},
{
prop: "description",
label: "备注",
valueType: "textarea",
extraProps: { dictType: "modelStatus" },
hideInSearchForm: true
},
{
type: "operation",
label: "操作",
minWidth: 120,
minWidth: 70,
render: ({ row, doAddOrEdit, doDeleteRows, doPreview }) => (
<base-table-operation
btnList={[
@@ -44,22 +108,27 @@ export default defineComponent({
label: "编辑",
onclick: () => doAddOrEdit(row)
},
{
key: "edit",
label: "配置模型",
onclick: () => editModel(row)
},
{
key: "delete",
label: "删除",
onclick: () => doDeleteRows(row)
},
{
key: "release",
label: "发布",
onclick: () => releaseRows(row)
}
]}
/>
)
}
]);
const editModel = row => {
router.push({
path: "/test/index",
query: { id: 123 }
});
};
const render = () => {
return (
<div>
@@ -75,26 +144,14 @@ export default defineComponent({
current = 1,
...otherSearchParams
}) => {
let tableData = {};
tableData = transformPageResponse(
return transformPageResponse(
await modelList({
pageNo: current,
pageSize,
projectId: 49,
...otherSearchParams
})
);
tableData.data.forEach(item => {
if (item.status == "1") {
item.status = "草稿";
} else if (item.status == "2") {
item.status = "已发布";
} else if (item.status == "3") {
item.status = "运行中";
} else if (item.status == "4") {
item.status = "已完成";
}
});
return tableData;
}}
curdConfig={{
/**
@@ -103,21 +160,30 @@ export default defineComponent({
*/
async onAddOrEdit(data) {
if (data.id) {
await editHourRate(data);
const findName = userList.value.find(
item => item.value == data.userId
);
data.userName = findName.label;
await editCostModel(data);
} else {
await addHourRate(data);
const findName = userList.value.find(
item => item.value == data.userId
);
data.userName = findName.label;
data.projectId = 49;
await addModel(data);
}
},
/*删除*/
async onDeleteRows(data) {
await deleteModel({ id: data.id });
},
unitColSpan: 12
unitColSpan: 24
}}
v-slots={{
toolbar: () => (
toolbar: ({ doAddOrEdit }) => (
<el-space>
<el-button type="primary" onClick={addModel}>
<el-button type="primary" onClick={doAddOrEdit}>
新增模型
</el-button>
</el-space>
@@ -127,12 +193,6 @@ export default defineComponent({
</div>
);
};
const releaseRows = () => {
console.log("发布");
};
const addModel = () => {
router.push({ path: "/test/index" });
}
return render;
}
});
+98
View File
@@ -0,0 +1,98 @@
<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: "BOM材料(含包装材料+辅料)", prop: "materialCost", hideInSearchForm: true },
{ label: "人工费用", prop: "laborCost", hideInSearchForm: true },
{ label: "机器折旧", prop: "equipmentCost", hideInSearchForm: true },
{ label: "机器料消耗", prop: "driveCost", hideInSearchForm: true },
{
label: "水电费",
prop: "supplyMaterialCost",
hideInSearchForm: true
},
{ label: "他制费(含物流)", prop: "otherCost", hideInSearchForm: true },
{ label: "制造成本", prop: "logisticsCost", hideInSearchForm: true },
{
label: "模具",
prop: "currentStandardCost",
hideInSearchForm: true
},
{
label: "工装",
prop: "totalMaterialCost",
hideInSearchForm: true
},
{ label: "检具", prop: "totalLaborCost", hideInSearchForm: true },
{ label: "测试费用", prop: "totalDriveCost", 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(",")
}
: {}
).then(res => {
download(res, "费用预测明细.xlsx");
});
};
return render;
}
});
</script>
<style lang="scss" scoped></style>
@@ -0,0 +1,118 @@
<script lang="tsx">
//表格
import { defineComponent, ref } from "vue";
import { ElMessage } from "element-plus";
import { useRouter } from 'vue-router';
export default defineComponent({
setup() {
const tableRef = ref();
const router = useRouter();
//列
const columns = ref([
{ prop: "districtName", label: "内部订单号",hideInSearchForm: true },
{ label: "物料编码", prop: "name",hideInSearchForm: true },
{ label: "物料信息", prop: "date123",hideInSearchForm: true },
{ prop: "createTime", label: "成本中心代码" ,hideInSearchForm: true },
{ prop: "districtName", label: "成本中心名称",hideInSearchForm: true },
{ label: "基于成品结构用量(版本1)", prop: "name",hideInSearchForm: true },
{ label: "单个零件报工工时(版本1)", prop: "date123",hideInSearchForm: true },
{ prop: "createTime", label: "人工工时(版本1)" ,hideInSearchForm: true },
{ prop: "districtName", label: "人工费率(版本1)",hideInSearchForm: true },
{ label: "基于成品结构用量(版本2)", prop: "name",hideInSearchForm: true },
{ label: "单个零件报工工时(版本2)", prop: "date123",hideInSearchForm: true },
{ prop: "createTime", label: "人工工时(版本2)" ,hideInSearchForm: true },
{ prop: "districtName", label: "人工费率(版本2)",hideInSearchForm: true },
{ label: "人工差价", prop: "name",hideInSearchForm: true },
{ label: "人工量差", prop: "date123",hideInSearchForm: true },
{ prop: "createTime", label: "人工总差" ,hideInSearchForm: true },
{ prop: "districtName", label: "基于成品结构用量(版本1)",hideInSearchForm: true },
{ label: "单个零件报工工时(版本1)", prop: "name",hideInSearchForm: true },
{ label: "燃动力工时(版本1)", prop: "date123",hideInSearchForm: true },
{ prop: "createTime", label: "燃动力费率(版本1)" ,hideInSearchForm: true },
{ prop: "districtName", label: "基于成品结构用量(版本2)",hideInSearchForm: true },
{ label: "单个零件报工工时(版本2)", prop: "name",hideInSearchForm: true },
{ label: "燃动力工时(版本2)", prop: "date123",hideInSearchForm: true },
{ prop: "createTime", label: "燃动力费率(版本2)" ,hideInSearchForm: true },
{ prop: "districtName", label: "燃动力价差",hideInSearchForm: true },
{ label: "燃动力量差", prop: "name",hideInSearchForm: true },
{ label: "燃动力总差", prop: "date123",hideInSearchForm: true },
{ prop: "createTime", label: "基于成品结构用量(版本1)" ,hideInSearchForm: true },
{ prop: "districtName", label: "单个零件报工工时(版本1)",hideInSearchForm: true },
{ label: "辅料工时(版本1)", prop: "name",hideInSearchForm: true },
{ label: "辅料费率(版本1)", prop: "date123",hideInSearchForm: true },
{ prop: "createTime", label: "基于成品结构用量(版本2)" ,hideInSearchForm: true },
{ prop: "districtName", label: "单个零件报工工时(版本2)",hideInSearchForm: true },
{ label: "辅料工时(版本2)", prop: "name",hideInSearchForm: true },
{ label: "辅料费率(版本2)", prop: "date123",hideInSearchForm: true },
{ prop: "createTime", label: "辅料价差" ,hideInSearchForm: true },
{ prop: "districtName", label: "辅料量差",hideInSearchForm: true },
{ label: "辅料总差", prop: "name",hideInSearchForm: true },
{ label: "基于成品结构用量(版本1)", prop: "date123",hideInSearchForm: true },
{ prop: "createTime", label: "单个零件报工工时(版本1)" ,hideInSearchForm: true },
{ prop: "districtName", label: "其他工时(版本1)",hideInSearchForm: true },
{ label: "其他费率(版本1)", prop: "name",hideInSearchForm: true },
{ label: "基于成品结构用量(版本2)", prop: "date123",hideInSearchForm: true },
{ prop: "createTime", label: "单个零件报工工时(版本2)" ,hideInSearchForm: true },
{ prop: "districtName", label: "其他工时(版本2)",hideInSearchForm: true },
{ label: "其他费率(版本2)", prop: "name",hideInSearchForm: true },
{ label: "其他价差", prop: "date123",hideInSearchForm: true },
{ prop: "createTime", label: "其他量差" ,hideInSearchForm: true },
{ prop: "districtName", label: "其他总差",hideInSearchForm: true },
]);
const render = () => {
return (
<BaseTable
columns={columns.value}
queryParamsToUrl
ref={tableRef}
request={async ({ pageSize = 10, current = 1, ...otherSearchParams }) => {
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={{
}}
v-slots={{
toolbar: ({ doAddOrEdit }) => (
<el-space>
<el-button type="danger" onClick={toBack}>返回</el-button>
</el-space>
),
}}
/>
);
};
const toBack = ()=>{
router.go(-1);
}
return render;
},
});
</script>
<style lang="scss" scoped></style>
@@ -0,0 +1,73 @@
<script lang="tsx">
//表格
import { defineComponent, ref } from "vue";
import { ElMessage } from "element-plus";
import { useRouter } from 'vue-router';
export default defineComponent({
setup() {
const tableRef = ref();
const router = useRouter();
//列
const columns = ref([
{ prop: "districtName", label: "成本中心代码",hideInSearchForm: true },
{ label: "成本中心代码名称", prop: "name",hideInSearchForm: true },
{ label: "基于成品结构用量(版本1)", prop: "date123",hideInSearchForm: true },
{ prop: "createTime", label: "单个零件报工工时(版本1)" ,hideInSearchForm: true },
{ prop: "districtName", label: "人工工时(版本1)",hideInSearchForm: true },
{ label: "基于成品结构用量(版本2)", prop: "name",hideInSearchForm: true },
{ label: "单个零件报工工时(版本2)", prop: "date123",hideInSearchForm: true },
{ prop: "createTime", label: "人工工时(版本2)" ,hideInSearchForm: true },
{ prop: "districtName", label: "人工工时总差",hideInSearchForm: true },
{ label: "基于成品结构用量(版本1)", prop: "name",hideInSearchForm: true },
{ label: "单个零件报工工时(版本1)", prop: "date123",hideInSearchForm: true },
{ prop: "createTime", label: "机器工时(版本1)" ,hideInSearchForm: true },
{ prop: "districtName", label: "基于成品结构用量(版本2)",hideInSearchForm: true },
{ label: "单个零件报工工时(版本2)", prop: "name",hideInSearchForm: true },
{ label: "机器工时(版本2)", prop: "date123",hideInSearchForm: true },
{ prop: "createTime", label: "机器工时总差" ,hideInSearchForm: true },
]);
const render = () => {
return (
<BaseTable
columns={columns.value}
queryParamsToUrl
ref={tableRef}
request={async ({ pageSize = 10, current = 1, ...otherSearchParams }) => {
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={{
}}
v-slots={{
toolbar: ({ doAddOrEdit }) => (
<el-space>
<el-button type="danger" onClick={toBack}>返回</el-button>
</el-space>
),
}}
/>
);
};
const toBack = ()=>{
router.go(-1);
}
return render;
},
});
</script>
<style lang="scss" scoped></style>
@@ -0,0 +1,75 @@
<script lang="tsx">
//表格
import { defineComponent, ref } from "vue";
import { ElMessage } from "element-plus";
import { useRouter } from 'vue-router';
export default defineComponent({
setup() {
const tableRef = ref();
const router = useRouter();
//列
const columns = ref([
{ prop: "districtName", label: "单位",hideInSearchForm: true },
{ label: "采购类型", prop: "name",hideInSearchForm: true },
{ label: "特殊采购类型", prop: "date123",hideInSearchForm: true },
{ prop: "createTime", label: "结构用量" ,hideInSearchForm: true },
{ prop: "districtName", label: "单位材料价格",hideInSearchForm: true },
{ label: "单位总成本", prop: "name",hideInSearchForm: true },
{ label: "版本1", prop: "date123",hideInSearchForm: true },
{ prop: "createTime", label: "结构用量" ,hideInSearchForm: true },
{ prop: "districtName", label: "单位材料价格",hideInSearchForm: true },
{ label: "单位总成本", prop: "name",hideInSearchForm: true },
{ label: "版本2", prop: "date123",hideInSearchForm: true },
{ prop: "createTime", label: "结构用量量差" ,hideInSearchForm: true },
{ prop: "districtName", label: "材料价格价差",hideInSearchForm: true },
{ label: "单位成本差异", prop: "name",hideInSearchForm: true },
{ label: "备注", prop: "date123",hideInSearchForm: true },
]);
const render = () => {
return (
<BaseTable
columns={columns.value}
queryParamsToUrl
ref={tableRef}
request={async ({ pageSize = 10, current = 1, ...otherSearchParams }) => {
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={{
}}
v-slots={{
toolbar: ({ doAddOrEdit }) => (
<el-space>
<el-button type="danger" onClick={toBack}>返回</el-button>
</el-space>
),
}}
/>
);
};
const toBack = ()=>{
router.go(-1);
}
return render;
},
});
</script>
<style lang="scss" scoped></style>
+216
View File
@@ -0,0 +1,216 @@
<script lang="tsx">
//表格
import { defineComponent, ref } from "vue";
import { ElMessage } from "element-plus";
import { transformPageResponse } from "@/utils/qomo";
import { useRouter } from "vue-router";
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 }) => (
<base-table-operation
btnList={[
{
key: "check",
label:
row.type === 0
? "工时差异"
: row.type === 1
? "人工制费差异"
: "材料成本差异",
onclick: () => 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 }) => (
<base-table-operation
btnList={[
{
key: "check",
label: "查看报告",
onclick: () => checkReport(row)
}
]}
/>
)
}
]);
const render = () => {
return (
<div>
<BaseTable
columns={columns.value}
ref={tableRef}
selectionRows={selectionRows.value}
toolbar={{
layout: "search-dnamic,reload,column-setting,fullscreen"
}}
request={async ({
pageSize = 10,
current = 1,
...otherSearchParams
}) => {
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) {},
unitColSpan: 24
}}
v-slots={{
toolbar: ({ doAddOrEdit, doDeleteRows }) => (
<el-space>
<el-button type="primary" onClick={doAddOrEdit}>
添加对比项
</el-button>
</el-space>
)
}}
/>
<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>
<style lang="scss" scoped></style>
+3 -1
View File
@@ -18,9 +18,11 @@ import { transformPageResponse } from "@/utils/qomo";
import _ from "lodash";
import { download } from "@qomo-platform/utils";
import request from "@/service/request";
import { useRoute } from 'vue-router';
export default defineComponent({
name: "flowableOptions",
setup(props, { attrs, expose, slots = {} }) {
const route = useRoute();
const { dialogRef, ...exposeDialogArgs } = useExposeDialogArgs();
return () => (
@@ -33,7 +35,7 @@ export default defineComponent({
return data;
}}
saveRequest={async data => {
data.id = '19';
data.id = route.query.id;
data.topMaterialCode = 'mn001';
await saveFlowModel(data);
//await saveMode(data);
+2 -1
View File
@@ -55,7 +55,8 @@ export default defineConfig(({ mode, command }) => {
// https://cn.vitejs.dev/config/#server-proxy
"/qomo": {
// target: "http://172.16.0.241:8095", //wq
target: "http://172.16.0.162:8082", //bgy
// target: "http://172.16.0.162:8082", //bgy
target: "http://172.16.2.127:8082", //bgy远程
// target: "http://192.168.50.9:2999",//中智平台
changeOrigin: true,
pathRewrite: {