Browse Source

提交

dev
gwbvipvip 1 year ago
parent
commit
bfc4bc172f
3 changed files with 90 additions and 39 deletions
  1. +1
    -1
      config/proxy.js
  2. +77
    -38
      src/pages/store/storeStaff/index.jsx
  3. +12
    -0
      src/pages/store/storeStaff/services.js

+ 1
- 1
config/proxy.js View File

@@ -9,7 +9,7 @@
export default {
dev: {
'/kitchen/': {
target: 'http://kitchen.dev1.com',
target: 'https://localhost:5001',
changeOrigin: true,
secure: false, //关闭证书验证
pathRewrite: {


+ 77
- 38
src/pages/store/storeStaff/index.jsx View File

@@ -1,12 +1,12 @@
import { PlusOutlined } from '@ant-design/icons';
import { Modal,Button, message, Input, Drawer } from 'antd';
import React, { useState, useRef,useEffect } from 'react';
import { Modal, Button, message, Input, Drawer, Form } from 'antd';
import React, { useState, useRef, useEffect } from 'react';
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
import ProTable from '@ant-design/pro-table';
import QRCode from 'qrcode.react';
import ProDescriptions from '@ant-design/pro-descriptions';
import CreateForm from './components/CreateForm';
import { Getstorestaffpage, Addstorestaff, Updatestorestaff, Delstorestaff, } from "./services"
import { Getstorestaffpage, Addstorestaff, Updatestorestaff, Delstorestaff, UpdatestorestaffPwd, } from "./services"
import { gettree } from '../../sys/org/service';
const key = 'message';

@@ -79,6 +79,7 @@ const handleRemove = async (selectedRows) => {
const GoodsTypeManage = () => {
/** 新建/更新窗口的弹窗 */
const [createModalVisible, handleModalVisible] = useState(false);
const [pwdModal, setpwdModal] = useState(false);
/** 分布更新窗口的弹窗 */

const [showDetail, setShowDetail] = useState(false);
@@ -89,42 +90,42 @@ const GoodsTypeManage = () => {
const [OrgListArray, setOrgListArray] = useState([]);
/** 国际化配置 */

//初始化数据
useEffect(() => {
function initOrgList() {
gettree().then((r) => {
inittree(r.data);
function inittree(datas) {
for (var i in datas) {
if( datas[i]['type']==2|| datas[i]['type']==3){
datas[i]['disabled']=false;
}else{
datas[i]['disabled']=true;
}
if (datas[i].children) {
inittree(datas[i].children);
}
//初始化数据
useEffect(() => {

function initOrgList() {
gettree().then((r) => {
inittree(r.data);
function inittree(datas) {
for (var i in datas) {
if (datas[i]['type'] == 2 || datas[i]['type'] == 3) {
datas[i]['disabled'] = false;
} else {
datas[i]['disabled'] = true;
}

if (datas[i].children) {
inittree(datas[i].children);
}
}
setOrgList(r.data);
let list = {};
formateData(r.data);
function formateData(datas) {
for (var i in datas) {
list[datas[i]['disabled']]=true;
list[datas[i]['value']] = { text: datas[i]['title'] };
if (datas[i].children) {
formateData(datas[i].children);
}
}
setOrgList(r.data);
let list = {};
formateData(r.data);
function formateData(datas) {
for (var i in datas) {
list[datas[i]['disabled']] = true;
list[datas[i]['value']] = { text: datas[i]['title'] };
if (datas[i].children) {
formateData(datas[i].children);
}
}
setOrgListArray(list);
});
}
initOrgList();
}, []);
}
setOrgListArray(list);
});
}
initOrgList();
}, []);

const columns = [
{
@@ -186,7 +187,14 @@ const GoodsTypeManage = () => {
onClick={() => {
handleModalVisible(true);
setCurrentRow(record);
}} > 更新</a>
}} > 更新</a>,
<a
key="config"
onClick={() => {
setpwdModal(true);
record.pwd="";
setCurrentRow(record);
}} > 修改密码</a>
],
},
];
@@ -262,8 +270,8 @@ const GoodsTypeManage = () => {
</FooterToolbar>
)}

<CreateForm
<CreateForm
onFinish={async (value) => {
var success = false;
if (value.id) {
@@ -285,6 +293,37 @@ const GoodsTypeManage = () => {
OrgData={OrgList}
values={currentRow || {}}
/>

<Modal title="修改密码" open={pwdModal} footer={null}
onCancel={() => {
setpwdModal(false);
}}>
<Form
preserve={false}
onFinish={async ()=>{
await UpdatestorestaffPwd(JSON.stringify(currentRow)).then((r) => {
if (r.data) {
message.success('修改成功',);
setpwdModal(false);
} else {
message.error('修改失败');
}
});
}}
initialValues={currentRow}>
<Form.Item name="id" hidden={true}>
<Input />
</Form.Item>
<Form.Item label={"密码"} name="pwd" rules={[{ required: true }]} >
<Input />
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit">
保存
</Button>
</Form.Item>
</Form>
</Modal>
</PageContainer>
);
};


+ 12
- 0
src/pages/store/storeStaff/services.js View File

@@ -25,6 +25,7 @@ export async function Updatestorestaff(data) {
// ...(options || {}),
});
}

/** 删除 */
export async function Delstorestaff(data) {
@@ -36,3 +37,14 @@ export async function Delstorestaff(data) {
// ...(options || {}),
});
}


/** 修改 */
export async function UpdatestorestaffPwd(data) {
return request(`/kitchen​//api/cashierplatformapplication/storestaffpwd`, {
method: 'put',
data: data,
// params: { ...params },
// ...(options || {}),
});
}

Loading…
Cancel
Save