部署 #8
+2
-2
@@ -5,10 +5,10 @@ VITE_APP_TITLE='Qomo Ai'
|
|||||||
VITE_APP_ENV='development'
|
VITE_APP_ENV='development'
|
||||||
|
|
||||||
# 子应用路径配置
|
# 子应用路径配置
|
||||||
VITE_APP_PATH='/layoutApp/testApp'
|
VITE_APP_PATH='/layoutApp/newEnergy'
|
||||||
|
|
||||||
# 子应用名称
|
# 子应用名称
|
||||||
VITE_APP_NAME='testApp'
|
VITE_APP_NAME='newEnergy'
|
||||||
|
|
||||||
# 开发环境
|
# 开发环境
|
||||||
VITE_APP_BASE_API=http://172.16.1.141:8082
|
VITE_APP_BASE_API=http://172.16.1.141:8082
|
||||||
|
|||||||
+2
-2
@@ -5,10 +5,10 @@ VITE_APP_TITLE='Qomo Ai'
|
|||||||
VITE_APP_ENV='production'
|
VITE_APP_ENV='production'
|
||||||
|
|
||||||
# 子应用路径配置
|
# 子应用路径配置
|
||||||
VITE_APP_PATH='/layoutApp/testApp'
|
VITE_APP_PATH='/layoutApp/newEnergy'
|
||||||
|
|
||||||
# 子应用名称
|
# 子应用名称
|
||||||
VITE_APP_NAME='testApp'
|
VITE_APP_NAME='newEnergy'
|
||||||
|
|
||||||
|
|
||||||
# 是否在打包时开启压缩,支持 gzip 和 brotli
|
# 是否在打包时开启压缩,支持 gzip 和 brotli
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@
|
|||||||
"@vueuse/core": "10.6.1",
|
"@vueuse/core": "10.6.1",
|
||||||
"axios": "1.6.7",
|
"axios": "1.6.7",
|
||||||
"echarts": "^5.5.0",
|
"echarts": "^5.5.0",
|
||||||
"element-plus": "2.7.3",
|
"element-plus": "2.4.3",
|
||||||
"file-saver": "2.0.5",
|
"file-saver": "2.0.5",
|
||||||
"js-cookie": "3.0.5",
|
"js-cookie": "3.0.5",
|
||||||
"jsencrypt": "3.3.2",
|
"jsencrypt": "3.3.2",
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { createApp } from "vue";
|
import { createApp } from "vue";
|
||||||
|
import { isHttp } from "@/utils/validate";
|
||||||
import "./assets/styles/tailwind.css";
|
import "./assets/styles/tailwind.css";
|
||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
import "@/utils/flexible.js";
|
import "@/utils/flexible.js";
|
||||||
|
|||||||
+44
-44
@@ -10,51 +10,51 @@ import usePermissionStore from "@/store/modules/permission";
|
|||||||
|
|
||||||
NProgress.configure({ showSpinner: false });
|
NProgress.configure({ showSpinner: false });
|
||||||
|
|
||||||
const whiteList = ["/login", "/register"];
|
// const whiteList = ["/login", "/register"];
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
// router.beforeEach((to, from, next) => {
|
||||||
NProgress.start();
|
// NProgress.start();
|
||||||
if (getToken()) {
|
// if (getToken()) {
|
||||||
to.meta.title && useSettingsStore().setTitle(to.meta.title);
|
// to.meta.title && useSettingsStore().setTitle(to.meta.title);
|
||||||
/* has token*/
|
// /* has token*/
|
||||||
if (to.path === "/login") {
|
// if (to.path === "/login") {
|
||||||
next({ path: "/" });
|
// next({ path: "/" });
|
||||||
NProgress.done();
|
// NProgress.done();
|
||||||
} else if (whiteList.indexOf(to.path) !== -1) {
|
// } else if (whiteList.indexOf(to.path) !== -1) {
|
||||||
next();
|
// next();
|
||||||
} else {
|
// } else {
|
||||||
if (useUserStore().roles.length === 0) {
|
// if (useUserStore().roles.length === 0) {
|
||||||
isRelogin.show = true;
|
// isRelogin.show = true;
|
||||||
useUserStore()
|
// useUserStore()
|
||||||
.getInfo()
|
// .getInfo()
|
||||||
.then(() => {
|
// .then(() => {
|
||||||
isRelogin.show = true;
|
// isRelogin.show = true;
|
||||||
usePermissionStore()
|
// usePermissionStore()
|
||||||
.generateRoutes()
|
// .generateRoutes()
|
||||||
.then(routes => {
|
// .then(routes => {
|
||||||
routes.forEach(route => {
|
// routes.forEach(route => {
|
||||||
if (!isHttp(route.path)) {
|
// if (!isHttp(route.path)) {
|
||||||
router.addRoute(route); // 动态添加可访问路由表
|
// router.addRoute(route); // 动态添加可访问路由表
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
next({ ...to, replace: true });
|
// next({ ...to, replace: true });
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
} else {
|
// } else {
|
||||||
next();
|
// next();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
// 没有token
|
// // 没有token
|
||||||
if (whiteList.indexOf(to.path) !== -1) {
|
// if (whiteList.indexOf(to.path) !== -1) {
|
||||||
// 在免登录白名单,直接进入
|
// // 在免登录白名单,直接进入
|
||||||
next();
|
// next();
|
||||||
} else {
|
// } else {
|
||||||
next(`/login?redirect=${to.fullPath}`); // 否则全部重定向到登录页
|
// next(`/login?redirect=${to.fullPath}`); // 否则全部重定向到登录页
|
||||||
NProgress.done();
|
// NProgress.done();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
router.afterEach(() => {
|
router.afterEach(() => {
|
||||||
NProgress.done();
|
NProgress.done();
|
||||||
|
|||||||
+25
-12
@@ -129,18 +129,18 @@ export const constantRoutes = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
path: '',
|
// path: '',
|
||||||
component: Layout,
|
// component: Layout,
|
||||||
children: [
|
// children: [
|
||||||
{
|
// {
|
||||||
path: "miningAnalysis/statistics",
|
// path: "miningAnalysis/statistics",
|
||||||
component: () => import("@/views/miningAnalysis/statistics/index"),
|
// component: () => import("@/views/miningAnalysis/statistics/index"),
|
||||||
name: "Statistics",
|
// name: "Statistics",
|
||||||
meta: { title: "挖掘统计", icon: "tree", affix: true }
|
// meta: { title: "挖掘统计", icon: "tree", affix: true }
|
||||||
}
|
// }
|
||||||
]
|
// ]
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
@@ -225,6 +225,19 @@ export const constantRoutes = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
//成本挖掘
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: Layout,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: "costMining",
|
||||||
|
component: () => import("@/views/costMining/index"),
|
||||||
|
name: "CostMining",
|
||||||
|
meta: { title: "成本挖掘", icon: "tree", affix: true }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
// Bom,工序,采购价格
|
// Bom,工序,采购价格
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,6 @@ export const genHttp = function (baseURL = "") {
|
|||||||
return httpRequest;
|
return httpRequest;
|
||||||
};
|
};
|
||||||
//http
|
//http
|
||||||
export const request = genHttp("/qomo");
|
export const request = genHttp("/newEnergy");
|
||||||
|
|
||||||
export default request;
|
export default request;
|
||||||
|
|||||||
@@ -10,6 +10,17 @@ import { qiankunWindow } from "vite-plugin-qiankun/dist/helper";
|
|||||||
// 匹配views里面所有的.vue文件
|
// 匹配views里面所有的.vue文件
|
||||||
const modules = import.meta.glob("./../../views/**/*.vue");
|
const modules = import.meta.glob("./../../views/**/*.vue");
|
||||||
const appPath = import.meta.env.VITE_APP_PATH;
|
const appPath = import.meta.env.VITE_APP_PATH;
|
||||||
|
// const requireComponent = import.meta.glob('@/views', true, /\/index\.vue$/)
|
||||||
|
// // const requireComponentjeep = require.context('@/jeep/views', true,/^(?!.*JVxeDemo).*\.vue$/)
|
||||||
|
// const map = new Map([])
|
||||||
|
// requireComponent.keys().forEach((fileName) => {
|
||||||
|
// const componentConfig = requireComponent(fileName)
|
||||||
|
// let componentName
|
||||||
|
// const _n = fileName.split('/').slice(1, fileName.split('/').length).join('/')
|
||||||
|
// if (_n) componentName = _n.replace(/.vue/g, '')
|
||||||
|
// else componentName = componentConfig.default.__file
|
||||||
|
// map.set(componentName, componentConfig.default || componentConfig)
|
||||||
|
// })
|
||||||
|
|
||||||
const usePermissionStore = defineStore("permission", {
|
const usePermissionStore = defineStore("permission", {
|
||||||
state: () => ({
|
state: () => ({
|
||||||
@@ -41,7 +52,7 @@ const usePermissionStore = defineStore("permission", {
|
|||||||
data = menu;
|
data = menu;
|
||||||
} else {
|
} else {
|
||||||
const menus = await listByApp({
|
const menus = await listByApp({
|
||||||
appId: this.$state.app.id
|
appId: JSON.parse(localStorage.getItem("appChild"))?.app.id
|
||||||
});
|
});
|
||||||
data = filterChangeType(menus);
|
data = filterChangeType(menus);
|
||||||
}
|
}
|
||||||
@@ -62,6 +73,22 @@ const usePermissionStore = defineStore("permission", {
|
|||||||
router.addRoute(rewriteRoutes);
|
router.addRoute(rewriteRoutes);
|
||||||
resolve(rewriteRoutes);
|
resolve(rewriteRoutes);
|
||||||
});
|
});
|
||||||
|
// const data = menu;
|
||||||
|
// const sdata = JSON.parse(JSON.stringify(data));
|
||||||
|
// const rdata = JSON.parse(JSON.stringify(data));
|
||||||
|
// const defaultData = JSON.parse(JSON.stringify(data));
|
||||||
|
// const sidebarRoutes = filterAsyncRouter(sdata);
|
||||||
|
// const rewriteRoutes = filterAsyncRouter(rdata, false, true);
|
||||||
|
// const defaultRoutes = filterAsyncRouter(defaultData);
|
||||||
|
// const asyncRoutes = filterDynamicRoutes(dynamicRoutes);
|
||||||
|
// asyncRoutes.forEach(route => {
|
||||||
|
// router.addRoute(route);
|
||||||
|
// });
|
||||||
|
// this.setRoutes(rewriteRoutes);
|
||||||
|
// this.setSidebarRouters(constantRoutes.concat(sidebarRoutes));
|
||||||
|
// this.setDefaultRoutes(sidebarRoutes);
|
||||||
|
// this.setTopbarRoutes(defaultRoutes);
|
||||||
|
// resolve(rewriteRoutes);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
persist: true
|
persist: true
|
||||||
@@ -72,11 +99,11 @@ function filterChangeType(routes) {
|
|||||||
return {
|
return {
|
||||||
component: route.menuType === 0 ? undefined : route.component,
|
component: route.menuType === 0 ? undefined : route.component,
|
||||||
hidden: route.hidden,
|
hidden: route.hidden,
|
||||||
path: route.url.replace(appPath, ""),
|
path: route.url.replace(appPath, "") + (route?.redirect || ""),
|
||||||
name: route.menuType === 0 ? undefined : route.name,
|
name: route.menuType === 0 ? undefined : route.name,
|
||||||
menuType: route.menuType,
|
menuType: route.menuType,
|
||||||
externalLinks: route.externalLinks,
|
externalLinks: route.externalLinks,
|
||||||
redirect: route.url.replace(appPath, "") + "/" + route.children[0]?.url,
|
// redirect: route.children[0]?.url,
|
||||||
meta: {
|
meta: {
|
||||||
title: route.name,
|
title: route.name,
|
||||||
icon: route.icon,
|
icon: route.icon,
|
||||||
|
|||||||
@@ -1,175 +1,330 @@
|
|||||||
<script lang="tsx">
|
<script lang="tsx">
|
||||||
//表格
|
//表格
|
||||||
import { defineComponent, ref } from "vue";
|
import { defineComponent, ref, watch } from "vue";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import Calculate from "./component/calculate.vue";
|
import Calculate from "./component/calculate.vue";
|
||||||
import { transformPageResponse } from "@/utils/qomo";
|
import { transformPageResponse } from "@/utils/qomo";
|
||||||
import { costStandardList,deleteCostStandard } from '@/api/costCalculation';
|
import { costStandardList, deleteCostStandard } from "@/api/costCalculation";
|
||||||
|
import { costStandardVersionAdd } from "@/api/costCalculation";
|
||||||
|
import { modelList } from "@/api/modelManagement";
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
setup() {
|
setup() {
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
const forecastDialogRef = ref();
|
const forecastDialogRef = ref();
|
||||||
//列
|
const forecastDialogRefNum = ref();
|
||||||
const columns = ref([
|
const formData = ref({
|
||||||
{ type: "selection" },
|
drawingNo: "",
|
||||||
{ label: "版本号", prop: "costVersion" },
|
stage: "",
|
||||||
{ label: "年份", prop: "year", valueType: "year" },
|
createTime: "",
|
||||||
{ label: "物料编号", prop: "materialNo" },
|
costVersion: "",
|
||||||
{ label: "创建日期", prop: "createTime", hideInSearchForm: true, valueType: "datetime" },
|
materialNo: "",
|
||||||
{ label: "阶段", prop: "stage", valueType: 'dict-select', extraProps: { dictType: 'stageData' } },
|
year: "",
|
||||||
{ label: "状态", prop: "status",valueType: 'dict-select',extraProps: { dictType: 'statusList' } },
|
flowDefinitionId: ""
|
||||||
{
|
});
|
||||||
type: "operation",
|
const rileForm = ref();
|
||||||
label: "操作",
|
const modelSelect = ref([]);
|
||||||
minWidth: 200,
|
//列
|
||||||
render: ({ row, doAddOrEdit, doDeleteRows, doReload, doPreview }) => (
|
const columns = ref([
|
||||||
<base-table-operation
|
{ type: "selection" },
|
||||||
btnList={
|
{ label: "版本号", prop: "costVersion" },
|
||||||
[{
|
{ label: "年份", prop: "year", valueType: "year" },
|
||||||
key: "edit",
|
{ label: "物料编号", prop: "materialNo" },
|
||||||
label: "重新计算",
|
{
|
||||||
onclick: () => doAddOrEdit(row)
|
label: "创建日期",
|
||||||
},
|
prop: "createTime",
|
||||||
{
|
hideInSearchForm: true,
|
||||||
key: "delete",
|
valueType: "datetime"
|
||||||
label: "删除",
|
},
|
||||||
onclick: () => doDeleteRows(row)
|
{
|
||||||
},
|
label: "阶段",
|
||||||
{
|
prop: "stage",
|
||||||
key: "deletion",
|
valueType: "dict-select",
|
||||||
label: "部件缺失信息",
|
extraProps: { dictType: "stageData" }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "preview",
|
label: "状态",
|
||||||
label: "查看详情",
|
prop: "status",
|
||||||
onclick: () => doPreview(row)
|
valueType: "dict-select",
|
||||||
}
|
extraProps: { dictType: "statusList" }
|
||||||
]
|
},
|
||||||
}
|
{
|
||||||
/>
|
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>
|
||||||
|
<base-dialog-form
|
||||||
|
ref={forecastDialogRefNum}
|
||||||
|
v-model={visible.value}
|
||||||
|
title={"生成设置版本号"}
|
||||||
|
width={400}
|
||||||
|
labelWidth={0}
|
||||||
|
confirm={() => {
|
||||||
|
const year = formData.value.createTime.split("-")[0];
|
||||||
|
formData.value.year = year;
|
||||||
|
costStandardVersionAdd(formData.value).then(res => {
|
||||||
|
tableRef.value.doReload();
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
cancel={() => {
|
||||||
|
|
||||||
const render = () => {
|
}}
|
||||||
return (
|
>
|
||||||
<div>
|
<el-form
|
||||||
<BasePageContainer flex-hidden={true} style={{ width: "100%", height: "800px", padding: "0" }}>
|
ref={rileForm}
|
||||||
<BaseTable
|
v-model={formData.value}
|
||||||
columns={columns.value}
|
label-width="100px"
|
||||||
queryParamsToUrl
|
>
|
||||||
toolbar={{ layout: "search-dnamic,reload,column-setting,fullscreen" }}
|
<el-form-item label="图号" prop="drawingNo">
|
||||||
ref={tableRef}
|
<el-input
|
||||||
request={async ({
|
v-model={formData.value.drawingNo}
|
||||||
pageSize = 10,
|
onChange={splicing}
|
||||||
current = 1,
|
/>
|
||||||
...otherSearchParams
|
</el-form-item>
|
||||||
}) => {
|
<el-form-item label="物料号" prop="materialNo">
|
||||||
let tableData = {};
|
<el-input v-model={formData.value.materialNo} />
|
||||||
tableData = transformPageResponse(
|
</el-form-item>
|
||||||
await costStandardList({
|
<el-form-item label="项目阶段" prop="stage">
|
||||||
pageNo: current,
|
<el-select
|
||||||
pageSize,
|
v-model={formData.value.stage}
|
||||||
...otherSearchParams
|
placeholder="请选择项目阶段"
|
||||||
})
|
onChange={splicing}
|
||||||
);
|
>
|
||||||
tableData.data.forEach(item => {
|
<el-option label="初始" value="A"></el-option>
|
||||||
if (item.stage == "A") {
|
<el-option label="量产" value="B"></el-option>
|
||||||
item.stage = "初始"
|
<el-option label="首批" value="C"></el-option>
|
||||||
} else if (item.stage == "B") {
|
</el-select>
|
||||||
item.stage = "量产"
|
</el-form-item>
|
||||||
} else if (item.stage == "C") {
|
<el-form-item label="选择模型" prop="stage">
|
||||||
item.stage = "首批"
|
<el-select
|
||||||
}
|
v-model={formData.value.flowDefinitionId}
|
||||||
})
|
placeholder="请选择项目阶段"
|
||||||
return tableData;
|
onChange={splicing}
|
||||||
}}
|
>
|
||||||
curdConfig={{
|
{modelSelect.value.map(item => (
|
||||||
unitColSpan: 12,
|
<ElOption
|
||||||
async onDeleteRows(data) {
|
key={item.value}
|
||||||
await deleteCostStandard({ id: data.id })
|
label={item.label}
|
||||||
},
|
value={item.value}
|
||||||
}}
|
|
||||||
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>
|
))}
|
||||||
);
|
</el-select>
|
||||||
};
|
</el-form-item>
|
||||||
const calculate = () => {
|
<el-form-item label="创建日期" prop="createTime">
|
||||||
visible.value = true;
|
<el-date-picker
|
||||||
}
|
v-model={formData.value.createTime}
|
||||||
const cancelVisible = () => {
|
type="datetime"
|
||||||
visible.value = false;
|
disabledDate={time => {
|
||||||
}
|
return time.getTime() > Date.now();
|
||||||
const batchCalculate = () => {
|
}}
|
||||||
forecastDialogRef.value.open();
|
value-format="YYYY-MM-DD HH:MM:ss"
|
||||||
}
|
onChange={splicing}
|
||||||
const batchExport = () => {
|
placeholder="选择日期"
|
||||||
console.log(tableRef.value.selectionRows, "批量导出");
|
></el-date-picker>
|
||||||
}
|
</el-form-item>
|
||||||
const onChange = (file) => {
|
<el-form-item label="生成版本号" prop="costVersion">
|
||||||
console.log(file, "PPPPPPPPPPPPPPPPPPPP");
|
<el-input
|
||||||
|
type="textarea"
|
||||||
|
disabled
|
||||||
|
rows="2"
|
||||||
|
v-model={formData.value.costVersion}
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</base-dialog-form>
|
||||||
|
{/* <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' ||
|
const isExcel =
|
||||||
file.raw.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
|
file.raw.type === "application/vnd.ms-excel" ||
|
||||||
if (!isExcel) {
|
file.raw.type ===
|
||||||
ElMessage.error('只能上传Excel文件!');
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
||||||
return false;
|
if (!isExcel) {
|
||||||
}
|
ElMessage.error("只能上传Excel文件!");
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
const doReload = () => { }
|
return true;
|
||||||
return render;
|
};
|
||||||
},
|
const splicing = () => {
|
||||||
|
formData.value.costVersion = "";
|
||||||
|
formData.value.costVersion =
|
||||||
|
formData.value.drawingNo +
|
||||||
|
"_" +
|
||||||
|
formData.value.stage +
|
||||||
|
"_" +
|
||||||
|
formData.value.createTime;
|
||||||
|
};
|
||||||
|
watch(visible, (newVal, oldVal) => {
|
||||||
|
if (newVal) {
|
||||||
|
formData.value = {
|
||||||
|
drawingNo: "",
|
||||||
|
stage: "",
|
||||||
|
createTime: "",
|
||||||
|
costVersion: "",
|
||||||
|
materialNo: "",
|
||||||
|
year: "",
|
||||||
|
flowDefinitionId: ""
|
||||||
|
};
|
||||||
|
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");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const doReload = () => {};
|
||||||
|
return render;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped></style>
|
<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>
|
||||||
@@ -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>
|
||||||
+204
-144
@@ -3,154 +3,214 @@
|
|||||||
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 { hourRateList, addHourRate, editHourRate, deleteHourRate, deleteBatchHourRate } from '@/api/hour';
|
import { useRouter } from "vue-router";
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
setup() {
|
setup() {
|
||||||
const tableRef = ref();
|
const router = useRouter();
|
||||||
const forecastDialogRef = ref();
|
const tableRef = ref();
|
||||||
const selectionRows = ref([]);
|
const forecastDialogRef = ref();
|
||||||
// const uploadUrl = ref("/c7525cost/importExcel");
|
const selectionRows = ref([]);
|
||||||
//列
|
const btnTitle = ref("工时差异");
|
||||||
const columns = ref([
|
// const uploadUrl = ref("/c7525cost/importExcel");
|
||||||
{ type: "selection" },
|
//列
|
||||||
{ prop: "year", label: "年度" },
|
const columnsCheck = ref([
|
||||||
{ label: "成本中心代码", prop: "costCenterCode" },
|
{ prop: "type", label: "对比项", hideInSearchForm: true },
|
||||||
{ label: "工厂代码", prop: "factory" },
|
{
|
||||||
{ prop: "laborHourRate", label: "人工小时费率", hideInSearchForm: true },
|
label: "金额(单位:元)",
|
||||||
{ prop: "equipHourRate", label: "设备小时费率", hideInSearchForm: true },
|
prop: "costCenterCode",
|
||||||
{ prop: "fuelHourRate", label: "燃动小时费率", hideInSearchForm: true },
|
hideInSearchForm: true
|
||||||
{ prop: "auxiliaryHourRate", label: "辅料小时费率", hideInSearchForm: true },
|
},
|
||||||
{ prop: "otherHourRate", label: "其他小时费率", hideInSearchForm: true },
|
{ label: "版本1", prop: "factory", hideInSearchForm: true },
|
||||||
{ valueType: "date", prop: "effectiveDate", label: "生效日期", hideInSearchForm: true },
|
{ label: "版本2", prop: "factory", hideInSearchForm: true },
|
||||||
{ valueType: "date", prop: "expirationDate", label: "失效日期", hideInSearchForm: true },
|
{ label: "差异金额", prop: "factory", hideInSearchForm: true },
|
||||||
{ prop: "guardian", label: "维护人员", hideInSearchForm: true },
|
{
|
||||||
{
|
type: "operation",
|
||||||
type: "operation",
|
label: "差异分析",
|
||||||
label: "操作",
|
minWidth: 120,
|
||||||
minWidth: 120,
|
render: ({ row }) => (
|
||||||
render: ({ row, doAddOrEdit, doDeleteRows, doPreview }) => (
|
<base-table-operation
|
||||||
<base-table-operation
|
btnList={[
|
||||||
btnList={
|
{
|
||||||
[{
|
key: "check",
|
||||||
key: "edit",
|
label:
|
||||||
label: "编辑",
|
row.type === 0
|
||||||
onclick: () => doAddOrEdit(row)
|
? "工时差异"
|
||||||
},
|
: row.type === 1
|
||||||
{
|
? "人工制费差异"
|
||||||
key: "delete",
|
: "材料成本差异",
|
||||||
label: "删除",
|
onclick: () => timeVariance(row)
|
||||||
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={{ layout: "search-dnamic,reload,column-setting,fullscreen" }}
|
toolbar={{
|
||||||
request={async ({
|
layout: "search-dnamic,reload,column-setting,fullscreen"
|
||||||
pageSize = 10,
|
}}
|
||||||
current = 1,
|
request={async ({
|
||||||
...otherSearchParams
|
pageSize = 10,
|
||||||
}) => {
|
current = 1,
|
||||||
return transformPageResponse(
|
...otherSearchParams
|
||||||
await hourRateList({
|
}) => {
|
||||||
pageNo: current,
|
await new Promise(resolve =>
|
||||||
pageSize,
|
setTimeout(resolve, Math.random() * 1111)
|
||||||
...otherSearchParams
|
);
|
||||||
})
|
return {
|
||||||
);
|
data: Array(pageSize)
|
||||||
}}
|
.fill(0)
|
||||||
curdConfig={{
|
.map((item, index) => ({
|
||||||
/**
|
id: Math.random(),
|
||||||
* 接受自动表单的数据
|
name: "Tom" + current,
|
||||||
* @param data
|
date123: "date123" + current,
|
||||||
*/
|
createTime: new Date().getTime(),
|
||||||
async onAddOrEdit(data) {
|
districtName: "区划" + index,
|
||||||
if (data.id) {
|
districtName1: "区划1" + index
|
||||||
await editHourRate(data)
|
})),
|
||||||
} else {
|
current,
|
||||||
await addHourRate(data)
|
// pages: 500 / pageSize,
|
||||||
}
|
total: 500
|
||||||
},
|
};
|
||||||
/*删除*/
|
}}
|
||||||
async onDeleteRows(data) {
|
curdConfig={{
|
||||||
if (Array.isArray(data)) {
|
/**
|
||||||
await deleteBatchHourRate({ ids: data.map(item => item.id).join(',') })
|
* 接受自动表单的数据
|
||||||
} else {
|
* @param data
|
||||||
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
|
||||||
};
|
}}
|
||||||
const handleBatchImport = () => {
|
v-slots={{
|
||||||
forecastDialogRef.value.open()
|
toolbar: ({ doAddOrEdit, doDeleteRows }) => (
|
||||||
};
|
<el-space>
|
||||||
const handleExport = () => {
|
<el-button type="primary" onClick={doAddOrEdit}>
|
||||||
console.log(selectionRows.value,"PPPPPPPPPPPPPPPPPP");
|
添加对比项
|
||||||
|
</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
|
||||||
return render;
|
}}
|
||||||
},
|
/>
|
||||||
|
</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>
|
||||||
|
|||||||
+8
-8
@@ -53,26 +53,26 @@ export default defineConfig(({ mode, command }) => {
|
|||||||
hmr: { overlay: false },
|
hmr: { overlay: false },
|
||||||
proxy: {
|
proxy: {
|
||||||
// https://cn.vitejs.dev/config/#server-proxy
|
// https://cn.vitejs.dev/config/#server-proxy
|
||||||
"/qomo": {
|
"/newEnergy": {
|
||||||
// target: "http://172.16.0.241:8095", //wq
|
// 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.43.195:8098", //bgy远程
|
||||||
// target: "http://192.168.50.9:2999",//中智平台
|
// target: "http://192.168.50.9:2999",//中制平台
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
"^/qomo": "/qomo"
|
"^/newEnergy": "/newEnergy"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/qomo/flowSocket": {
|
"/newEnergy/flowSocket": {
|
||||||
// target: 'ws://192.168.0.66:60601/',这是后端接口地址
|
// target: 'ws://192.168.0.66:60601/',这是后端接口地址
|
||||||
target: 'ws://172.16.0.162:8082',
|
// target: 'ws://192.168.43.195:8098',
|
||||||
// target: 'ws://192.168.50.99:2999',
|
// target: 'ws://192.168.50.99:2999',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
ws: true
|
ws: true
|
||||||
},
|
},
|
||||||
"/qomo/taskSocket": {
|
"/newEnergy/taskSocket": {
|
||||||
// target: 'ws://192.168.0.66:60601/',这是后端接口地址
|
// target: 'ws://192.168.0.66:60601/',这是后端接口地址
|
||||||
target: 'ws://172.16.0.162:8082',
|
// target: 'ws://192.168.43.195:8098',
|
||||||
// target: 'ws://192.168.50.99:2999',
|
// target: 'ws://192.168.50.99:2999',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
ws: true
|
ws: true
|
||||||
|
|||||||
Reference in New Issue
Block a user