Commit 0cbd87a7 authored by TZW's avatar TZW

editer

parent e8807339
...@@ -53,6 +53,7 @@ export async function getInitialState() { ...@@ -53,6 +53,7 @@ export async function getInitialState() {
const currentUserData = await fetchUserInfo(); const currentUserData = await fetchUserInfo();
let menuData; let menuData;
if (currentUserData?.data?.username) { if (currentUserData?.data?.username) {
console.log(1);
menuData = await getmenuData(); menuData = await getmenuData();
} }
return { return {
......
...@@ -25,7 +25,7 @@ const loginOut = async () => { ...@@ -25,7 +25,7 @@ const loginOut = async () => {
if (window.location.pathname !== '/user/login' && !redirect) { if (window.location.pathname !== '/user/login' && !redirect) {
localStorage.clear(); localStorage.clear();
// history.replace(logoutRedirectUrl); // history.replace(logoutRedirectUrl);
window.location.href(logoutRedirectUrl); window.location.href = logoutRedirectUrl;
} }
}; };
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-11-10 09:39:56 * @Date: 2022-11-10 09:39:56
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-16 09:28:06 * @Last Modified time: 2022-12-16 15:40:58
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -744,7 +744,6 @@ function Model(props) { ...@@ -744,7 +744,6 @@ function Model(props) {
url: urlParams.detail, url: urlParams.detail,
params: { id: drawer?.item?.id }, params: { id: drawer?.item?.id },
}); });
//console.log(res?.data?.data);
let obj = {}; let obj = {};
res?.data?.data['equipmentCharList']?.forEach((it) => { res?.data?.data['equipmentCharList']?.forEach((it) => {
obj[it?.fieldId] = it?.fieldRealValue; obj[it?.fieldId] = it?.fieldRealValue;
...@@ -1774,6 +1773,7 @@ function Model(props) { ...@@ -1774,6 +1773,7 @@ function Model(props) {
<> <>
<ProDescriptions <ProDescriptions
request={async () => { request={async () => {
console.log('cc');
const { data } = await doFetch({ const { data } = await doFetch({
url: urlParams.detail, url: urlParams.detail,
params: { id: drawer?.item?.id }, params: { id: drawer?.item?.id },
...@@ -1862,6 +1862,7 @@ function Model(props) { ...@@ -1862,6 +1862,7 @@ function Model(props) {
}); });
if (res.code === '0000') { if (res.code === '0000') {
message.success('登记成功!'); message.success('登记成功!');
console.log(drawer);
setDrawer((s) => ({ setDrawer((s) => ({
...s, ...s,
visible: false, visible: false,
...@@ -2194,6 +2195,7 @@ function Model(props) { ...@@ -2194,6 +2195,7 @@ function Model(props) {
setDrawer((s) => ({ setDrawer((s) => ({
...s, ...s,
visible: false, visible: false,
detailpath: '',
})); }));
}} }}
{...drawer} {...drawer}
......
function getcolumns(setdrawer) { function getcolumns(ifs) {
return [ return [
{ title: '产线代码', dataIndex: 'productionLineCode', key: 'productionLineCode', width: 180 }, { title: '产线代码', dataIndex: 'productionLineCode', key: 'productionLineCode', width: 180 },
{ {
...@@ -12,7 +12,11 @@ function getcolumns(setdrawer) { ...@@ -12,7 +12,11 @@ function getcolumns(setdrawer) {
title: '所属工厂', title: '所属工厂',
dataIndex: 'factoryName', dataIndex: 'factoryName',
key: 'factoryId', key: 'factoryId',
search: false,
width: 180, width: 180,
fieldProps: {
disabled: ifs,
},
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
valueType: 'select', valueType: 'select',
options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} }, options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
...@@ -20,7 +24,44 @@ function getcolumns(setdrawer) { ...@@ -20,7 +24,44 @@ function getcolumns(setdrawer) {
{ {
title: '所属车间', title: '所属车间',
dataIndex: 'shopName', dataIndex: 'shopName',
search: false,
key: 'shopId', key: 'shopId',
fieldProps: {
disabled: ifs,
},
width: 180,
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
valueType: 'select',
options: {
path: '/auth/sysShop/getShopSelectionByFactory',
linkParams: {
factoryId: '', //key 后面如果存在value 则该value会在调用接口时format
},
},
},
{
title: '所属工厂',
dataIndex: 'factoryName',
key: 'factoryId',
width: 180,
hideInTable: true,
hideInForm: true,
fieldProps: {
disabled: ifs,
},
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
valueType: 'select',
options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
},
{
title: '所属车间',
dataIndex: 'shopName',
key: 'shopId',
hideInTable: true,
hideInForm: true,
fieldProps: {
disabled: ifs,
},
width: 180, width: 180,
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
valueType: 'select', valueType: 'select',
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-11-09 14:43:54 * @Date: 2022-11-09 14:43:54
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-30 13:16:10 * @Last Modified time: 2022-12-16 16:07:33
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -56,11 +56,16 @@ function Section(props) { ...@@ -56,11 +56,16 @@ function Section(props) {
<PremButton <PremButton
btn={{ btn={{
size: 'small', size: 'small',
onClick: () => { onClick: async () => {
let { data } = await doFetch({
url: '/auth/sysProductionLine/checkProductLineRelation',
params: { id: drawer?.id },
});
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
visible: true, visible: true,
title: '编辑', title: '编辑',
fields: getcolumns(data),
params: { id: row.id }, params: { id: row.id },
detailpath: urlParams.detail, detailpath: urlParams.detail,
val: 'edit', val: 'edit',
......
function getcolumns(setdrawer) { function getcolumns(ifs) {
return [ return [
{ title: '工段代码', dataIndex: 'sectionCode', key: 'sectionCode' }, { title: '工段代码', dataIndex: 'sectionCode', key: 'sectionCode' },
{ {
...@@ -10,10 +10,43 @@ function getcolumns(setdrawer) { ...@@ -10,10 +10,43 @@ function getcolumns(setdrawer) {
{ {
title: '所属工厂', title: '所属工厂',
dataIndex: 'factoryName', dataIndex: 'factoryName',
search: false,
width: 180, width: 180,
key: 'factoryId', key: 'factoryId',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
valueType: 'select', valueType: 'select',
fieldProps: {
disabled: ifs,
},
options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
},
{
title: '所属车间',
dataIndex: 'shopName',
width: 180,
search: false,
key: 'shopId',
fieldProps: {
disabled: ifs,
},
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
valueType: 'select',
options: {
path: '/auth/sysShop/getShopSelectionByFactory',
linkParams: {
factoryId: '', //key 后面如果存在value 则该value会在调用接口时format
},
},
},
{
title: '所属工厂',
dataIndex: 'factoryName',
width: 180,
key: 'factoryId',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
valueType: 'select',
hideInTable: true,
hideInForm: true,
options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} }, options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
}, },
{ {
...@@ -21,6 +54,8 @@ function getcolumns(setdrawer) { ...@@ -21,6 +54,8 @@ function getcolumns(setdrawer) {
dataIndex: 'shopName', dataIndex: 'shopName',
width: 180, width: 180,
key: 'shopId', key: 'shopId',
hideInTable: true,
hideInForm: true,
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
valueType: 'select', valueType: 'select',
options: { options: {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-11-09 14:43:54 * @Date: 2022-11-09 14:43:54
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-30 13:15:45 * @Last Modified time: 2022-12-16 16:02:16
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -56,12 +56,17 @@ function Section(props) { ...@@ -56,12 +56,17 @@ function Section(props) {
<PremButton <PremButton
btn={{ btn={{
size: 'small', size: 'small',
onClick: () => { onClick: async () => {
let { data } = await doFetch({
url: '/auth/sysSection/checkSectionRelation',
params: { id: drawer?.id },
});
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
visible: true, visible: true,
title: '编辑', title: '编辑',
params: { id: row.id }, params: { id: row.id },
fields: getcolumns(data),
detailpath: '/auth/sysSection/getById', detailpath: '/auth/sysSection/getById',
val: 'edit', val: 'edit',
onFinish: async (vals) => { onFinish: async (vals) => {
......
...@@ -20,12 +20,24 @@ function getcolumns(ifs) { ...@@ -20,12 +20,24 @@ function getcolumns(ifs) {
dataIndex: 'factoryName', dataIndex: 'factoryName',
key: 'factoryId', key: 'factoryId',
valueType: 'select', valueType: 'select',
search: false,
options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} }, options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] }, formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
fieldProps: { fieldProps: {
disabled: ifs, disabled: ifs,
}, },
}, },
{
width: 180,
title: '所属工厂',
dataIndex: 'factoryName',
key: 'factoryId',
valueType: 'select',
options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
hideInForm: true,
hideInTable: true,
},
]; ];
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-11-09 14:44:18 * @Date: 2022-11-09 14:44:18
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-07 16:37:56 * @Last Modified time: 2022-12-16 15:53:09
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -57,15 +57,18 @@ function Factory(props) { ...@@ -57,15 +57,18 @@ function Factory(props) {
btn={{ btn={{
size: 'small', size: 'small',
onClick: async () => { onClick: async () => {
// let res = await doFetch({ url: '', params: {} }); let { data } = await doFetch({
url: '/auth/sysShop/checkShopRelation',
params: { id: drawer?.id },
});
console.log(data);
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
visible: true, visible: true,
item: row, item: row,
title: '编辑', title: '编辑',
val: 'edit', val: 'edit',
fields: getcolumns(true), fields: getcolumns(data),
onFinish: async (vals) => { onFinish: async (vals) => {
let params = { let params = {
...vals, ...vals,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment