update
This commit is contained in:
parent
debd5be7f6
commit
a05dd915f3
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ant-design-pro",
|
||||
"version": "4.5.38",
|
||||
"version": "4.5.40",
|
||||
"private": true,
|
||||
"description": "An out-of-box UI solution for enterprise applications",
|
||||
"scripts": {
|
||||
|
||||
@ -6,7 +6,7 @@ import type {ConnectState} from "@/models/connect";
|
||||
import { PageContainer } from "@ant-design/pro-layout";
|
||||
import ProTable from "@ant-design/pro-table";
|
||||
import { getEndaccountPhoto, getServerpartOption, handleGetShopTypeTree } from "@/pages/DataVerification/list/service";
|
||||
import {handleGetAccountList, handleGetServiceShopList, submitEndaccountState} from "@/pages/DataVerification/service";
|
||||
import { handleGetAccountList, handleGetServerpartShopList, handleGetServiceShopList, submitEndaccountState } from "@/pages/DataVerification/service";
|
||||
import './list.less'
|
||||
import { Button, DatePicker, Select, Drawer, message } from "antd";
|
||||
import useRequest from "@ahooksjs/use-request";
|
||||
@ -246,14 +246,33 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => {
|
||||
}
|
||||
onChange={async (e) => {
|
||||
setSelectServicePartId(e)
|
||||
// const req = {
|
||||
// ProvinceCode:currentUser?.USER_PROVINCE,
|
||||
// ServerpartId:e,
|
||||
// ShowWholePower:true
|
||||
// }
|
||||
// const data = await handleGetServiceShopList(req)
|
||||
|
||||
const req = {
|
||||
ProvinceCode:currentUser?.USER_PROVINCE,
|
||||
ServerpartId:e,
|
||||
ShowWholePower:true
|
||||
SearchParameter: {
|
||||
SERVERPART_IDS: e,
|
||||
ISVALID: 1
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999,
|
||||
SortStr: "SHOPREGION,SHOPTRADE,SHOPSHORTNAME,SHOPCODE"
|
||||
}
|
||||
const data = await handleGetServiceShopList(req)
|
||||
const data = await handleGetServerpartShopList(req)
|
||||
console.log('shop', data);
|
||||
let list: any = []
|
||||
if (data && data.length > 0) {
|
||||
data.forEach((item: any) => {
|
||||
list.push({ label: item.SHOPNAME, value: item.SHOPCODE })
|
||||
})
|
||||
}
|
||||
|
||||
setSelectShopId(null)
|
||||
setShopList(data.List)
|
||||
setShopList(list)
|
||||
}}
|
||||
></Select>
|
||||
</div>
|
||||
|
||||
@ -9,6 +9,7 @@ import { getServerpartOption} from "@/pages/DataVerification/list/service";
|
||||
import {
|
||||
handleBatchReview,
|
||||
handleGetAccountList,
|
||||
handleGetServerpartShopList,
|
||||
handleGetServiceShopList,
|
||||
submitEndaccountState
|
||||
} from "@/pages/DataVerification/service";
|
||||
@ -100,8 +101,10 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => {
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return <span style={{color:record.Treatment_MarkState===0?'red':
|
||||
record.Treatment_MarkState===1?'#ff6600':'#0066FF',fontWeight:'bold',textDecoration:'underline',cursor:'pointer'}} onClick={()=>{
|
||||
return <span style={{
|
||||
color: record.Treatment_MarkState === 0 ? 'red' :
|
||||
record.Treatment_MarkState === 1 ? '#ff6600' : '#0066FF', fontWeight: 'bold', textDecoration: 'underline', cursor: 'pointer'
|
||||
}} onClick={() => {
|
||||
setShowDrawer(true);
|
||||
setCurrentRow(record)
|
||||
}}>
|
||||
@ -306,14 +309,33 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => {
|
||||
}
|
||||
onChange={async (e) => {
|
||||
setSelectServicePartId(e)
|
||||
// const req = {
|
||||
// ProvinceCode:currentUser?.USER_PROVINCE,
|
||||
// ServerpartId:e,
|
||||
// ShowWholePower:true
|
||||
// }
|
||||
// const data = await handleGetServiceShopList(req)
|
||||
|
||||
const req = {
|
||||
ProvinceCode:currentUser?.USER_PROVINCE,
|
||||
ServerpartId:e,
|
||||
ShowWholePower:true
|
||||
SearchParameter: {
|
||||
SERVERPART_IDS: e,
|
||||
ISVALID: 1
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999,
|
||||
SortStr: "SHOPREGION,SHOPTRADE,SHOPSHORTNAME,SHOPCODE"
|
||||
}
|
||||
const data = await handleGetServiceShopList(req)
|
||||
const data = await handleGetServerpartShopList(req)
|
||||
console.log('shop', data);
|
||||
let list: any = []
|
||||
if (data && data.length > 0) {
|
||||
data.forEach((item: any) => {
|
||||
list.push({ label: item.SHOPNAME, value: item.SHOPCODE })
|
||||
})
|
||||
}
|
||||
|
||||
setSelectShopId(null)
|
||||
setShopList(data.List)
|
||||
setShopList(list)
|
||||
}}
|
||||
></Select>
|
||||
</div>
|
||||
@ -394,6 +416,7 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => {
|
||||
type: 'checkbox',
|
||||
...rowSelection,
|
||||
}}
|
||||
bordered
|
||||
columns={columns}
|
||||
dataSource={tableData}
|
||||
scroll={{ y: 'calc(100vh - 470px)' }}
|
||||
|
||||
@ -10,6 +10,7 @@ import {
|
||||
handleBatchReview,
|
||||
handleDailyException,
|
||||
handleGetAccountList,
|
||||
handleGetServerpartShopList,
|
||||
handleGetServiceShopList
|
||||
} from "@/pages/DataVerification/service";
|
||||
import './list.less'
|
||||
@ -310,14 +311,33 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => {
|
||||
}
|
||||
onChange={async (e) => {
|
||||
setSelectServicePartId(e)
|
||||
// const req = {
|
||||
// ProvinceCode:currentUser?.USER_PROVINCE,
|
||||
// ServerpartId:e,
|
||||
// ShowWholePower:true
|
||||
// }
|
||||
// const data = await handleGetServiceShopList(req)
|
||||
|
||||
const req = {
|
||||
ProvinceCode:currentUser?.USER_PROVINCE,
|
||||
ServerpartId:e,
|
||||
ShowWholePower:true
|
||||
SearchParameter: {
|
||||
SERVERPART_IDS: e,
|
||||
ISVALID: 1
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999,
|
||||
SortStr: "SHOPREGION,SHOPTRADE,SHOPSHORTNAME,SHOPCODE"
|
||||
}
|
||||
const data = await handleGetServiceShopList(req)
|
||||
const data = await handleGetServerpartShopList(req)
|
||||
console.log('shop', data);
|
||||
let list: any = []
|
||||
if (data && data.length > 0) {
|
||||
data.forEach((item: any) => {
|
||||
list.push({ label: item.SHOPNAME, value: item.SHOPCODE })
|
||||
})
|
||||
}
|
||||
|
||||
setSelectShopId(null)
|
||||
setShopList(data.List)
|
||||
setShopList(list)
|
||||
}}
|
||||
></Select>
|
||||
</div>
|
||||
@ -400,6 +420,7 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => {
|
||||
options={false}
|
||||
search={false}
|
||||
columns={columns}
|
||||
bordered
|
||||
dataSource={tableData}
|
||||
pagination={{ pageSize: 20 }}
|
||||
scroll={{ y: 'calc(100vh - 460px)' }}
|
||||
|
||||
@ -205,8 +205,10 @@ const ItemDetail: React.FC<{ currentItem?: any, showDetail?: any, currentRow?: a
|
||||
console.log('leftList', leftList);
|
||||
|
||||
if (leftList && leftList.length > 0) {
|
||||
setSelectLeftTime(leftList[0].value)
|
||||
handleGetDetail(leftList[0].value, selectTab)
|
||||
// setSelectLeftTime(leftList[0].value)
|
||||
// handleGetDetail(leftList[0].value, selectTab)
|
||||
setSelectLeftTime(currentRow?.Endaccount_Id)
|
||||
handleGetDetail(currentRow?.Endaccount_Id, selectTab)
|
||||
} else {
|
||||
formRef.current?.resetFields()
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@ import haveOwner from '@/assets/DataVerification/haveOwner.png'
|
||||
import interfaceImg from '@/assets/DataVerification/interface.png'
|
||||
import defaultIcon from '@/assets/brand/defaultIcon.png'
|
||||
import ItemDetail from './components/ItemDetail'
|
||||
import { dailyVerifyEndaccount, handleGetAccountList, handleGetServiceShopList, submitEndaccountState } from "@/pages/DataVerification/service";
|
||||
import { dailyVerifyEndaccount, handleGetAccountList, handleGetServerpartShopList, handleGetServiceShopList, submitEndaccountState } from "@/pages/DataVerification/service";
|
||||
import changeIcon from '../../../assets/versionChange.png'
|
||||
import ProForm, { ProFormInstance, ProFormSelect } from "@ant-design/pro-form";
|
||||
import UnUploadDetail from "./components/unUploadDetail";
|
||||
@ -49,7 +49,7 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => {
|
||||
|
||||
const UnUploadDetailRef = useRef<any>()
|
||||
|
||||
const [currentRow, setCurrentRow] = useState<EndaccountDetailModel>()
|
||||
const [currentRow, setCurrentRow] = useState<any>()
|
||||
// 切换页面版本
|
||||
const [pageVersion, setPageVersion] = useState<'new' | 'old'>('new')
|
||||
const [selectService, setSelectService] = useState<number>()// 页面选择的服务区
|
||||
@ -98,6 +98,7 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => {
|
||||
dataIndex: 'Serverpart_Name',
|
||||
title: '服务区名称',
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'ServerpartShop_Name',
|
||||
@ -305,6 +306,7 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => {
|
||||
EndDate: moment(selectTime[1]).format('YYYY-MM-DD'),
|
||||
TreatmentMarkState: selectState || selectState === 0 ? selectState : '',
|
||||
EndaccountState: selectState || selectState === 0 ? 1 : '',
|
||||
PageIndex: 1,
|
||||
PageSize: 999999
|
||||
}
|
||||
const data = await handleGetAccountList(req)
|
||||
@ -515,16 +517,37 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => {
|
||||
}
|
||||
onChange={async (e) => {
|
||||
setSelectServicePartId(e)
|
||||
// const req = {
|
||||
// ProvinceCode: currentUser?.ProvinceCode,
|
||||
// ServerpartId: e,
|
||||
// ShowWholePower: true
|
||||
// }
|
||||
// const data = await handleGetServiceShopList(req)
|
||||
// console.log('datadatadatadatadata', data);
|
||||
|
||||
|
||||
const req = {
|
||||
ProvinceCode: currentUser?.USER_PROVINCE,
|
||||
ServerpartId: e,
|
||||
ShowWholePower: true
|
||||
SearchParameter: {
|
||||
SERVERPART_IDS: e,
|
||||
ISVALID: 1
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999,
|
||||
SortStr: "SHOPREGION,SHOPTRADE,SHOPSHORTNAME,SHOPCODE"
|
||||
}
|
||||
const data = await handleGetServiceShopList(req)
|
||||
const data = await handleGetServerpartShopList(req)
|
||||
console.log('shop', data);
|
||||
let list: any = []
|
||||
if (data && data.length > 0) {
|
||||
data.forEach((item: any) => {
|
||||
list.push({ label: item.SHOPNAME, value: item.SHOPCODE })
|
||||
})
|
||||
}
|
||||
|
||||
setSelectShopId(null)
|
||||
let list: any = data.List
|
||||
// let list: any = data.List
|
||||
list.unshift({ label: '全部', value: '' })
|
||||
setShopList(data.List)
|
||||
setShopList(list)
|
||||
}}
|
||||
></Select>
|
||||
</div>
|
||||
@ -585,6 +608,7 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => {
|
||||
className={'proTableBox'}
|
||||
search={false}
|
||||
columns={columns}
|
||||
bordered
|
||||
dataSource={tableData}
|
||||
scroll={{ y: 'calc(100vh - 470px)' }}
|
||||
pagination={{ pageSize: 20 }}
|
||||
@ -607,6 +631,7 @@ const List: React.FC<{ currentUser?: CurrentUser }> = ({ currentUser }) => {
|
||||
destroyOnClose={true}
|
||||
onClose={() => {
|
||||
setShowDetail(false);
|
||||
setCurrentRow(null)
|
||||
}}
|
||||
footer={
|
||||
selectChildrenTab ?
|
||||
|
||||
@ -1,28 +1,34 @@
|
||||
.qualificationsData {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.dataBox {
|
||||
width: 100%;
|
||||
height: 120px;
|
||||
height: 130px;
|
||||
box-sizing: border-box;
|
||||
padding: 16px 24px;
|
||||
background: #fff;
|
||||
|
||||
.dataBoxTop {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.dataBoxTopLeft {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.leftIcon {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.pageSelect {
|
||||
width: 150px;
|
||||
}
|
||||
}
|
||||
|
||||
.dataBoxTopRight {
|
||||
.versionChangeBox {
|
||||
color: #fff;
|
||||
@ -35,6 +41,7 @@
|
||||
align-items: center;
|
||||
padding: 4px 15px;
|
||||
cursor: pointer;
|
||||
|
||||
.changeIcon {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
@ -43,26 +50,32 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dataBoxBottom {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 0 36px;
|
||||
margin-top: 12px;
|
||||
display: flex;
|
||||
|
||||
.dataBoxBottomLeft {
|
||||
width: 70%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.bottomItem {
|
||||
width: 30%;
|
||||
display: flex;
|
||||
|
||||
.typeIcon {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.smallData {
|
||||
margin-left: 12px;
|
||||
|
||||
.dataLabel {
|
||||
font-size: 14px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
@ -70,9 +83,11 @@
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.warningBoxs {
|
||||
display: flex;
|
||||
position: relative;
|
||||
|
||||
.dataLabel {
|
||||
font-size: 14px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
@ -81,13 +96,16 @@
|
||||
line-height: 22px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.unUpload {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.warningIcon {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
}
|
||||
|
||||
.unUploadText {
|
||||
font-size: 14px;
|
||||
font-family: AppleColorEmoji;
|
||||
@ -95,11 +113,13 @@
|
||||
line-height: 22px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
}
|
||||
}
|
||||
|
||||
.uploadBox {
|
||||
display: block;
|
||||
white-space: nowrap;
|
||||
@ -108,10 +128,12 @@
|
||||
border-radius: 8px;
|
||||
background: #fff;
|
||||
position: absolute;
|
||||
top: 18px;left: 0;
|
||||
top: 18px;
|
||||
left: 0;
|
||||
box-shadow: 0 1px 2px -2px rgba(0, 0, 0, 0.16), 0 3px 6px 0 rgba(0, 0, 0, 0.12), 0 5px 12px 4px rgba(0, 0, 0, 0.09);
|
||||
}
|
||||
}
|
||||
|
||||
.dataValue {
|
||||
font-size: 20px;
|
||||
font-family: DINAlternate-Bold, DINAlternate;
|
||||
@ -122,6 +144,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dataBoxBottomRight {
|
||||
width: 30%;
|
||||
display: flex;
|
||||
@ -138,16 +161,19 @@
|
||||
box-sizing: border-box;
|
||||
padding-bottom: 20px;
|
||||
position: relative;
|
||||
|
||||
.LoadingBox {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
right: 0;top: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
z-index: 999;
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.loading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -156,6 +182,7 @@
|
||||
border-radius: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.listBox {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
@ -163,6 +190,7 @@
|
||||
flex-wrap: wrap;
|
||||
overflow-y: auto;
|
||||
align-content: flex-start;
|
||||
|
||||
.listItem {
|
||||
cursor: pointer;
|
||||
margin-bottom: 20px;
|
||||
@ -173,13 +201,16 @@
|
||||
background: linear-gradient(180deg, rgba(246, 250, 255, 1) 0%, rgba(254, 255, 255, 1) 60%, rgba(255, 255, 255, 1) 100%);
|
||||
border-radius: 8px;
|
||||
border: 1px solid #E7E7E7;
|
||||
|
||||
.itemTop {
|
||||
display: flex;
|
||||
|
||||
.itemImg {
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
margin-right: 12px;
|
||||
}
|
||||
|
||||
.topBox {
|
||||
.topText {
|
||||
font-size: 16px;
|
||||
@ -188,6 +219,7 @@
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.typeList {
|
||||
display: inline-block;
|
||||
margin-top: 6px;
|
||||
@ -208,19 +240,23 @@
|
||||
margin-top: 20px;
|
||||
padding-bottom: 20px;
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
|
||||
|
||||
.realMoneyBox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 17px;
|
||||
|
||||
.moneyLeft {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.moneyIcon {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.leftLabel {
|
||||
font-size: 14px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
@ -229,6 +265,7 @@
|
||||
line-height: 22px;
|
||||
}
|
||||
}
|
||||
|
||||
.moneyRight {
|
||||
font-size: 18px;
|
||||
font-family: DINAlternate-Bold, DINAlternate;
|
||||
@ -244,6 +281,7 @@
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 4px;
|
||||
|
||||
.boxTopLabel {
|
||||
font-size: 14px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
@ -251,6 +289,7 @@
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.boxTopValue {
|
||||
font-size: 14px;
|
||||
font-family: PingFangSC-Semibold, PingFang SC;
|
||||
@ -259,17 +298,20 @@
|
||||
line-height: 22px;
|
||||
}
|
||||
}
|
||||
|
||||
.progress {
|
||||
width: 100%;
|
||||
height: 8px;
|
||||
background: #EDEDED;
|
||||
border-radius: 5px;
|
||||
position: relative;
|
||||
|
||||
.have {
|
||||
width: 50%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
left: 0;top: 0;
|
||||
left: 0;
|
||||
top: 0;
|
||||
background: #5B75FF;
|
||||
border-radius: 5px;
|
||||
}
|
||||
@ -282,12 +324,14 @@
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 22px;
|
||||
|
||||
.codeLeft {
|
||||
.code {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 14px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
@ -296,6 +340,7 @@
|
||||
line-height: 22px;
|
||||
}
|
||||
}
|
||||
|
||||
.codeRight {
|
||||
font-size: 14px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
@ -328,22 +373,27 @@
|
||||
margin-bottom: 24px;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
|
||||
.searchBoxLeft {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.searchItem {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
margin-right: 12px;
|
||||
|
||||
.searchLabel {
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.searchBoxRight {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.versionChangeBox {
|
||||
color: #fff;
|
||||
border-color: #40a9ff;
|
||||
@ -356,6 +406,7 @@
|
||||
padding: 4px 15px;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
|
||||
.changeIcon {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
@ -364,10 +415,12 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tableBox {
|
||||
box-sizing: border-box;
|
||||
padding: 24px;
|
||||
background: #fff;
|
||||
|
||||
.proTableBox {
|
||||
.ant-pro-card {
|
||||
.ant-pro-card-body {
|
||||
@ -380,6 +433,7 @@
|
||||
.ant-table-tbody {
|
||||
.greyRow {
|
||||
background: #e1e1e1;
|
||||
|
||||
.ant-table-cell-row-hover {
|
||||
background: #e1e1e1;
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@ import ProForm, { ProFormDigit, ProFormSelect, ProFormText, ProFormTextArea } fr
|
||||
import { useRef, useState } from "react";
|
||||
import Draggable from "react-draggable";
|
||||
import React from "react";
|
||||
import { handleGetINSALES_STATISTICDetail } from "../../service";
|
||||
import { handleGetCommodityInSaleList, handleGetGetCOMMODITYDetail, handleGetINSALES_STATISTICDetail } from "../../service";
|
||||
import session from "@/utils/session";
|
||||
import COMMODITYINFO from "./COMMODITYINFO";
|
||||
|
||||
@ -13,8 +13,10 @@ type DetailProps = {
|
||||
onShow: boolean
|
||||
parentRow: any
|
||||
onCancel: any
|
||||
come?: string
|
||||
}
|
||||
const InventoryDetailModal = ({ onShow, parentRow, onCancel }: DetailProps) => {
|
||||
const InventoryDetailModal = ({ onShow, parentRow, onCancel, come }: DetailProps) => {
|
||||
// come 若等于 inventory 那么说明是库存里面来的 那么请求详情的方法就不一样了
|
||||
const formRef = useRef<FormInstance>();
|
||||
const draggleRef = React.createRef<any>()
|
||||
|
||||
@ -102,6 +104,115 @@ const InventoryDetailModal = ({ onShow, parentRow, onCancel }: DetailProps) => {
|
||||
submitter={false}
|
||||
preserve={false}
|
||||
request={async () => {
|
||||
if (come === 'inventory') {
|
||||
console.log('parentRowparentRowparentRowparentRow', parentRow);
|
||||
const req: any = {
|
||||
ServerpartShopId: parentRow?.ServerpartShop_Id,
|
||||
CommodityId: parentRow?.COMMODITY_ID,
|
||||
CommodityBarcode: parentRow?.COMMODITY_BARCODE,
|
||||
}
|
||||
const data = await handleGetCommodityInSaleList(req)
|
||||
console.log('datadatadatadatadatadata', data);
|
||||
let obj: any = {}
|
||||
if (data && data.length > 0) {
|
||||
/// 1000:入库业务
|
||||
/// 2000:调拨业务
|
||||
/// 3000:退货业务
|
||||
/// 4000:领用业务
|
||||
/// 5000:单品销售
|
||||
/// 6000:盘点结存
|
||||
/// 6001:盘点损溢
|
||||
/// 6002:上期盘点结存
|
||||
/// 6003:上期盘点损溢
|
||||
data.forEach((item: any) => {
|
||||
if (item.OPERATE_TYPE === 1000) {
|
||||
obj = {
|
||||
...obj,
|
||||
PURCHASE_COUNT: item.OPERATE_COUNT,// 入库数量
|
||||
PURCHASE_TAXPRICE: item.PURCHASE_TAXPRICE,// 含税单价
|
||||
PURCHASE_TOTALTAXPRICE: item.OPERATE_TAXAMOUNT,// 含税金额
|
||||
PURCHASE_PRICE: item.PURCHASE_PRICE,// 除税单价
|
||||
PURCHASE_TOTALPRICE: item.OPERATE_AMOUNT,// 除税金额
|
||||
}
|
||||
} else if (item.OPERATE_TYPE === 2000) {
|
||||
obj = {
|
||||
...obj,
|
||||
TRANSFER_COUNT: item.OPERATE_COUNT,// 调拨数量
|
||||
TRANSFER_AMOUNT: item.OPERATE_TAXAMOUNT,// 调拨金额
|
||||
TRANSFER_PRICE: item.OPERATE_AMOUNT,// 除税金额
|
||||
}
|
||||
} else if (item.OPERATE_TYPE === 3000) {
|
||||
obj = {
|
||||
...obj,
|
||||
BACK_COUNT: item.OPERATE_COUNT,// 退货数量
|
||||
BACK_AMOUNT: item.OPERATE_TAXAMOUNT,// 退货金额
|
||||
BACK_PRICE: item.OPERATE_AMOUNT,// 除税金额
|
||||
}
|
||||
} else if (item.OPERATE_TYPE === 4000) {
|
||||
obj = {
|
||||
...obj,
|
||||
RECEIVE_COUNT: item.OPERATE_COUNT,// 领用数量
|
||||
RECEIVE_AMOUNT: item.OPERATE_TAXAMOUNT,// 领用金额
|
||||
RECEIVE_PRICE: item.OPERATE_AMOUNT,// 除税金额
|
||||
}
|
||||
} else if (item.OPERATE_TYPE === 5000) {
|
||||
obj = {
|
||||
...obj,
|
||||
SELL_COUNT: item.OPERATE_COUNT,// 销售数量
|
||||
SELL_UNITTAXPRICE: item.PURCHASE_TAXPRICE,// 含税单价
|
||||
SELL_TOTALTAXPRICE: item.OPERATE_TAXAMOUNT,// 含税金额
|
||||
// SELL_COST: item.OPERATE_AMOUNT,// 含税成本
|
||||
SELL_UNITPRICE: item.PURCHASE_PRICE,// 除税单价
|
||||
SELL_TOTALPRICE: item.OPERATE_AMOUNT,// 除税金额
|
||||
// SELL_COSTPRICE: item.OPERATE_AMOUNT,// 除税成本
|
||||
}
|
||||
} else if (item.OPERATE_TYPE === 6000) {
|
||||
obj = {
|
||||
...obj,
|
||||
PURCHASE_COUNT: item.OPERATE_COUNT,// 入库数量
|
||||
PURCHASE_TAXPRICE: item.PURCHASE_TAXPRICE,// 含税单价
|
||||
PURCHASE_TOTALTAXPRICE: item.OPERATE_TAXAMOUNT,// 含税金额
|
||||
PURCHASE_PRICE: item.PURCHASE_PRICE,// 除税单价
|
||||
LAST_OVERPLUSPRICE: item.OPERATE_AMOUNT,// 上期库存除税
|
||||
}
|
||||
} else if (item.OPERATE_TYPE === 6001) {
|
||||
obj = {
|
||||
...obj,
|
||||
LOSSPROFIT_COUNT: item.OPERATE_COUNT,// 损溢数量
|
||||
LOSSPROFIT_AMOUNT: item.OPERATE_TAXAMOUNT,// 损溢金额
|
||||
LOSSPROFIT_PRICE: item.OPERATE_AMOUNT,// 损溢除税
|
||||
}
|
||||
} else if (item.OPERATE_TYPE === 6002) {
|
||||
obj = {
|
||||
...obj,
|
||||
LAST_OVERPLUSCOUNT: item.OPERATE_COUNT,// 上期库存数量
|
||||
LAST_OVERPLUSAMOUNT: item.OPERATE_TAXAMOUNT,// 上期库存金额
|
||||
LAST_OVERPLUSPRICE: item.OPERATE_AMOUNT,// 上期库存除税
|
||||
}
|
||||
} else if (item.OPERATE_TYPE === 6003) {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
// 商品详情再调用一下
|
||||
const detail: any = await handleGetGetCOMMODITYDetail({ COMMODITYId: parentRow?.COMMODITY_ID })
|
||||
console.log('detaildetaildetaildetail', detail);
|
||||
obj = {
|
||||
...obj,
|
||||
SERVERPART_NAME: parentRow?.Serverpart_Name, // 服务区名
|
||||
SHOPNAME: parentRow?.ServerpartShop_Name, // 门店名称
|
||||
COMMODITY_CODE: detail?.COMMODITY_CODE, // 商品编码
|
||||
BUSINESSTYPE: detail?.BUSINESSTYPE, // 业态
|
||||
COMMODITY_TYPE: detail?.COMMODITY_TYPE, // 商品类型
|
||||
COMMODITY_BARCODE: detail?.COMMODITY_BARCODE, // 商品条码
|
||||
COMMODITY_NAME: detail?.COMMODITY_NAME, // 商品名称
|
||||
COMMODITY_UNIT: detail?.COMMODITY_UNIT, // 商品单位
|
||||
COMMODITY_RULE: detail?.COMMODITY_RULE, // 商品规格
|
||||
CHECKDATE_Start: "",
|
||||
CHECKDATE: "",
|
||||
}
|
||||
return obj
|
||||
} else {
|
||||
if (!parentRow?.INSALES_STATISTIC_ID) {
|
||||
return {}
|
||||
}
|
||||
@ -114,6 +225,7 @@ const InventoryDetailModal = ({ onShow, parentRow, onCancel }: DetailProps) => {
|
||||
console.log('抽屉的详情', data);
|
||||
setCommodityDetail(data)
|
||||
return data
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Divider orientation="left">商品基本信息</Divider>
|
||||
|
||||
@ -907,7 +907,7 @@ const InventoryDetails: React.FC<{ currentUser: CurrentUser, isComponents?: any,
|
||||
PageIndex: 1,
|
||||
PageSize: 999999
|
||||
}
|
||||
|
||||
setSearchParams(fromRes)
|
||||
console.log('reqreqreqreqreqreqreqreq', req);
|
||||
} else if (isComponents) {
|
||||
req = {
|
||||
@ -920,6 +920,7 @@ const InventoryDetails: React.FC<{ currentUser: CurrentUser, isComponents?: any,
|
||||
PageIndex: 1,
|
||||
PageSize: 999999
|
||||
}
|
||||
setSearchParams(params)
|
||||
} else {
|
||||
req = {
|
||||
SearchParameter: {
|
||||
@ -930,9 +931,10 @@ const InventoryDetails: React.FC<{ currentUser: CurrentUser, isComponents?: any,
|
||||
PageIndex: 1,
|
||||
PageSize: 999999
|
||||
}
|
||||
setSearchParams(params)
|
||||
}
|
||||
|
||||
setSearchParams(params)
|
||||
|
||||
const data = await handleGetINSALES_STATISTICList(req)
|
||||
console.log('dkasjdkajd', data);
|
||||
if (data && data.length > 0) {
|
||||
@ -1046,7 +1048,7 @@ const InventoryDetails: React.FC<{ currentUser: CurrentUser, isComponents?: any,
|
||||
buttonText={'导出excel'}
|
||||
ref={downloadBtnRef}
|
||||
table="table-to-xls-InventoryDetails"
|
||||
filename={`进销存明细报表${searchParams?.InventoryTime}`}
|
||||
filename={`进销存明细报表${searchParams?.InventoryTime || ""}`}
|
||||
sheet="sheet1"
|
||||
/>
|
||||
</span>,
|
||||
|
||||
@ -221,7 +221,7 @@ const inventoryDetail = ({ onShow, onCancel, parentRow, currentUser, ServerpartI
|
||||
|
||||
|
||||
{/* 进销存明细的悬浮框 */}
|
||||
<InventoryDetailModal onShow={showDetail} parentRow={currentRow} onCancel={handleModalCancel} />
|
||||
<InventoryDetailModal onShow={showDetail} parentRow={currentRow} onCancel={handleModalCancel} come={'inventory'} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@ -14,6 +14,7 @@ import ReactHTMLTableToExcel from "react-html-table-to-excel";
|
||||
import LeftSelectTree from "@/pages/reports/settlementAccount/component/leftSelectTree";
|
||||
import PageTitleBox from "@/components/PageTitleBox";
|
||||
import moment from "moment";
|
||||
import { handleGetMERCHANTSList, handleGetStorageBackSummary } from "../service";
|
||||
|
||||
|
||||
const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
@ -36,6 +37,8 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
const [showExportTable, setShowExportTable] = useState<boolean>(false)
|
||||
// 查询的条件
|
||||
const [searchParams, setSearchParams] = useState<any>()
|
||||
// 拿到服务区下的所有门店id集合
|
||||
const [handleAllShopId, sethandleAllShopId] = useState<any>()
|
||||
|
||||
const columns: any = [
|
||||
{
|
||||
@ -47,8 +50,8 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
search: {
|
||||
transform: (value) => {
|
||||
return {
|
||||
OPERATE_DATE_Start: value[0],
|
||||
OPERATE_DATE_End: value[1],
|
||||
StartDate: value[0],
|
||||
EndDate: value[1],
|
||||
};
|
||||
},
|
||||
},
|
||||
@ -62,69 +65,128 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
},
|
||||
initialValue: [moment().startOf('M'), moment()],
|
||||
},
|
||||
{
|
||||
title: "供应商",
|
||||
dataIndex: "SupplierId",
|
||||
valueType: 'select',
|
||||
request: async () => {
|
||||
const req: any = {
|
||||
PROVINCE_CODE: currentUser?.ProvinceCode,
|
||||
MERCHANTS_STATE: 1
|
||||
}
|
||||
const data = await handleGetMERCHANTSList(req)
|
||||
console.log('datadatadatadata', data);
|
||||
let list: any = []
|
||||
if (data && data.length > 0) {
|
||||
data.forEach((item: any) => {
|
||||
list.push({ label: item.MERCHANTS_NAME, value: item.MERCHANTS_ID })
|
||||
})
|
||||
|
||||
list.unshift({ label: "全部", value: "" })
|
||||
}
|
||||
return list
|
||||
},
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
filterOption: (input: any, option: any) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase()),
|
||||
},
|
||||
initialValue: "",
|
||||
hideInTable: true,
|
||||
},
|
||||
{
|
||||
title: "序号",
|
||||
dataIndex: "index",
|
||||
valueType: 'index',
|
||||
align: 'center',
|
||||
width: 80,
|
||||
width: 90,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: "服务区名",
|
||||
dataIndex: "",
|
||||
title: <div style={{ textAlign: 'center' }}>供应商/服务区名</div>,
|
||||
dataIndex: "Serverpart_Name",
|
||||
align: 'left',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return record?.Serverpart_Name || record?.Supplier_Name
|
||||
}
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>门店名称</div>,
|
||||
dataIndex: "ServerpartShop_Name",
|
||||
align: 'center',
|
||||
width: 150,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: "采购总数量",
|
||||
dataIndex: "",
|
||||
align: 'center',
|
||||
width: 150,
|
||||
title: <div style={{ textAlign: 'center' }}>商品名称</div>,
|
||||
dataIndex: "Commodity_Name",
|
||||
align: 'left',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: "采购含税金额",
|
||||
dataIndex: "",
|
||||
align: 'center',
|
||||
width: 150,
|
||||
title: <div style={{ textAlign: 'center' }}>采购总数量</div>,
|
||||
dataIndex: "Storage_Count",
|
||||
align: 'right',
|
||||
valueType: 'digit',
|
||||
width: 120,
|
||||
sorter: true,
|
||||
defaultSortOrder: 'descend',
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: "采购除税金额",
|
||||
dataIndex: "",
|
||||
align: 'center',
|
||||
width: 150,
|
||||
title: <div style={{ textAlign: 'center' }}>采购含税金额</div>,
|
||||
dataIndex: "Storage_TaxAmount",
|
||||
align: 'right',
|
||||
valueType: 'digit',
|
||||
width: 120,
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: "入库总数量",
|
||||
dataIndex: "",
|
||||
align: 'center',
|
||||
width: 150,
|
||||
title: <div style={{ textAlign: 'center' }}>采购除税金额</div>,
|
||||
dataIndex: "Storage_Amount",
|
||||
align: 'right',
|
||||
valueType: 'digit',
|
||||
width: 120,
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: "入库含税金额",
|
||||
dataIndex: "",
|
||||
align: 'center',
|
||||
width: 150,
|
||||
title: <div style={{ textAlign: 'center' }}>退货数量</div>,
|
||||
dataIndex: "Back_Count",
|
||||
align: 'right',
|
||||
valueType: 'digit',
|
||||
width: 120,
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: "入库除税金额",
|
||||
dataIndex: "",
|
||||
align: 'center',
|
||||
width: 150,
|
||||
title: <div style={{ textAlign: 'center' }}>退货含税金额</div>,
|
||||
dataIndex: "Back_TaxAmount",
|
||||
align: 'right',
|
||||
valueType: 'digit',
|
||||
width: 120,
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>退货除税金额</div>,
|
||||
dataIndex: "Back_Amount",
|
||||
align: 'right',
|
||||
valueType: 'digit',
|
||||
width: 120,
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
}
|
||||
@ -152,6 +214,34 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
tempTable.remove() // 防止重复打印一个内容
|
||||
}
|
||||
|
||||
const exportColumns: any = [
|
||||
{
|
||||
title: "序号",
|
||||
dataIndex: "index",
|
||||
valueType: 'index',
|
||||
align: 'center',
|
||||
width: 90,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>服务区名</div>,
|
||||
dataIndex: "Serverpart_Name",
|
||||
align: 'left',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>供应商名</div>,
|
||||
dataIndex: "Supplier_Name",
|
||||
align: 'left',
|
||||
width: 200,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
|
||||
},
|
||||
]
|
||||
|
||||
return (
|
||||
<div ref={(el) => {
|
||||
@ -193,7 +283,7 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
{
|
||||
showExportTable && reqDetailList && reqDetailList.length > 0 ?
|
||||
<ProTable
|
||||
columns={columns}
|
||||
columns={[...exportColumns, ...columns.slice(4, columns.length)]}
|
||||
dataSource={reqDetailList}
|
||||
pagination={false}
|
||||
expandable={{
|
||||
@ -205,7 +295,7 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
<div id='hiddenBox' style={{ position: 'fixed', zIndex: -1, top: 0, left: 0 }} />
|
||||
|
||||
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
|
||||
<LeftSelectTree setSelectedId={setSelectedId} setCollapsible={setCollapsible} collapsible={collapsible} />
|
||||
<LeftSelectTree setSelectedId={setSelectedId} setCollapsible={setCollapsible} setAllServiceShop={sethandleAllShopId} collapsible={collapsible} pageType={'ahjg'} />
|
||||
<div style={{
|
||||
width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
|
||||
paddingTop: 0,
|
||||
@ -220,15 +310,82 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
expandable={{
|
||||
expandRowByClick: true
|
||||
}}
|
||||
rowKey={(record: any) => {
|
||||
return `${record?.Supplier_Id}-${record?.Serverpart_Id}-${record?.ServerpartShop_Name}-${record?.Commodity_Id}-${record?.Commodity_BarCode}`
|
||||
}}
|
||||
scroll={{ x: "100%", y: "calc(100vh - 410px)" }}
|
||||
headerTitle={<PageTitleBox props={props} />} // 列表表头
|
||||
search={{ span: 6 }}
|
||||
request={async (params) => {
|
||||
request={async (params, sorter) => {
|
||||
console.log('selectedIdselectedIdselectedId', selectedId);
|
||||
|
||||
if (!selectedId) {
|
||||
return
|
||||
}
|
||||
|
||||
// 根据门店去判断 是哪个服务区里面的 再把服务区的id 记录下来 而且要去重
|
||||
let serverpartId: any = []
|
||||
|
||||
if (selectedId) {
|
||||
let list: any = selectedId.split(',')
|
||||
if (list && list.length > 0) {
|
||||
list.forEach((item: any) => {
|
||||
for (let key in handleAllShopId) {
|
||||
console.log('handleAllShopId[key]', handleAllShopId[key]);
|
||||
|
||||
if (handleAllShopId[key] && handleAllShopId[key].length > 0) {
|
||||
if (handleAllShopId[key].indexOf(Number(item)) !== -1) {
|
||||
if (serverpartId && serverpartId.length > 0) {
|
||||
if (serverpartId.indexOf(key) === -1) {
|
||||
serverpartId.push(key)
|
||||
}
|
||||
} else {
|
||||
serverpartId.push(key)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
// 排序字段
|
||||
const sortstr = Object.keys(sorter).map(n => {
|
||||
const value = sorter[n]
|
||||
return value ? `${n} ${value.replace('end', '')}` : ''
|
||||
})
|
||||
const req: any = {
|
||||
ServerpartId: serverpartId && serverpartId.length > 0 ? serverpartId.toString() : "",
|
||||
ServerpartShopId: selectedId,
|
||||
SupplierId: params?.SupplierId || "",
|
||||
StartDate: params?.StartDate || "",
|
||||
EndDate: params?.EndDate || "",
|
||||
SearchKeyName: "",
|
||||
SearchKeyValue: "",
|
||||
sortstr: sortstr.length ? sortstr.toString() : "",
|
||||
}
|
||||
setSearchParams(params)
|
||||
|
||||
const data = await handleGetStorageBackSummary(req)
|
||||
console.log('dafjkdjaf', data);
|
||||
if (data && data.length > 0) {
|
||||
|
||||
let exportList: any = []
|
||||
data.forEach((item: any) => {
|
||||
if (item.children && item.children.length > 0) {
|
||||
item.children.forEach((subItem: any) => {
|
||||
if (subItem.children && subItem.children.length > 0) {
|
||||
subItem.children.forEach((thirdItem: any) => {
|
||||
exportList.push(thirdItem)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
setReqDetailList(exportList)
|
||||
return { data, success: true }
|
||||
}
|
||||
return { data: [], success: true }
|
||||
}}
|
||||
toolbar={{
|
||||
actions: [
|
||||
@ -237,7 +394,7 @@ const purchaseReceiving: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
buttonText={'导出excel'}
|
||||
ref={downloadBtnRef}
|
||||
table="table-to-xls-purchaseReceiving"
|
||||
filename={`领用流程统计${searchParams?.StartDate}-${searchParams?.EndDate}`}
|
||||
filename={`入库退货统计表${searchParams?.StartDate}-${searchParams?.EndDate}`}
|
||||
sheet="sheet1"
|
||||
/>
|
||||
</span>,
|
||||
|
||||
274
src/pages/ahjgPage/returnProcess/components/returnGoodsTable.tsx
Normal file
274
src/pages/ahjgPage/returnProcess/components/returnGoodsTable.tsx
Normal file
@ -0,0 +1,274 @@
|
||||
import { connect } from "umi";
|
||||
import type { ConnectState } from "@/models/connect";
|
||||
import { Button, Descriptions, FormInstance, Modal } from "antd";
|
||||
import { useRef, useState } from "react";
|
||||
import React from "react";
|
||||
import Draggable from "react-draggable";
|
||||
import ProTable, { ActionType } from "@ant-design/pro-table";
|
||||
import { handleGetBACKCOMMODITYDetail, handleGetBACKCOMMODITYList, handleGetSALESTOREPROINSTDetail } from "../../service";
|
||||
import { handleNewPrint, handleNewPrintAHJG } from "@/utils/format";
|
||||
|
||||
type DetailProps = {
|
||||
showDetail: boolean;
|
||||
parentRow: any;
|
||||
onCencel: any;
|
||||
}
|
||||
const ReturnGoodsTable = ({ showDetail, parentRow, onCencel }: DetailProps) => {
|
||||
const actionRef = useRef<ActionType>();
|
||||
const formRef = useRef<FormInstance>();
|
||||
const draggleRef = React.createRef<any>()
|
||||
|
||||
// 弹出框拖动效果
|
||||
const [bounds, setBounds] = useState<{ left: number, right: number, top: number, bottom: number }>() // 移动的位置
|
||||
const [disabled, setDraggleDisabled] = useState<boolean>() // 是否拖动
|
||||
const onDraggaleStart = (event, uiData) => {
|
||||
const { clientWidth, clientHeight } = window.document.documentElement;
|
||||
const targetRect = draggleRef.current?.getBoundingClientRect();
|
||||
if (!targetRect) {
|
||||
return;
|
||||
}
|
||||
setBounds({
|
||||
left: -targetRect.left + uiData.x,
|
||||
right: clientWidth - (targetRect.right - uiData.x),
|
||||
top: -targetRect.top + uiData.y,
|
||||
bottom: clientHeight - (targetRect.bottom - uiData.y),
|
||||
});
|
||||
};
|
||||
// 当前查到的退货单详情
|
||||
const [currentModalDetail, setCurrentModalDetail] = useState<any>()
|
||||
|
||||
const columns: any = [
|
||||
{
|
||||
title: "序号",
|
||||
width: 80,
|
||||
valueType: 'index',
|
||||
dataIndex: "index",
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: "商品条码",
|
||||
width: 120,
|
||||
dataIndex: "COMMODITY_BARCODE",
|
||||
align: 'center',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>商品名称</div>,
|
||||
width: 150,
|
||||
dataIndex: "COMMODITY_NAME",
|
||||
align: 'left',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '退货门店',
|
||||
width: 120,
|
||||
dataIndex: "SHOPNAME",
|
||||
align: 'center',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>供应商名</div>,
|
||||
width: 150,
|
||||
dataIndex: "SUPPLIER_NAME",
|
||||
align: 'left',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>退货数量</div>,
|
||||
width: 120,
|
||||
dataIndex: "BACK_COUNT",
|
||||
valueType: 'digit',
|
||||
align: 'right',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>税率</div>,
|
||||
width: 120,
|
||||
dataIndex: "DUTY_PARAGRAPH",
|
||||
align: 'right',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>含税进价</div>,
|
||||
width: 120,
|
||||
dataIndex: "PURCHASE_TAXPRICE",
|
||||
valueType: 'digit',
|
||||
align: 'right',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>含税金额</div>,
|
||||
width: 120,
|
||||
dataIndex: "BACKTAXPRICE",
|
||||
valueType: 'digit',
|
||||
align: 'right',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '退货时间',
|
||||
width: 150,
|
||||
dataIndex: "BACK_DATE",
|
||||
align: 'center',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '退货原由',
|
||||
width: 120,
|
||||
dataIndex: "BACK_DESC",
|
||||
align: 'center',
|
||||
ellipsis: true
|
||||
}
|
||||
]
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Modal
|
||||
title={
|
||||
<div
|
||||
className="returnGoodsTableTitle"
|
||||
style={{
|
||||
width: '100%',
|
||||
cursor: 'move',
|
||||
}}
|
||||
onMouseOver={() => {
|
||||
if (disabled) {
|
||||
setDraggleDisabled(false)
|
||||
}
|
||||
}}
|
||||
onMouseOut={() => {
|
||||
setDraggleDisabled(true)
|
||||
}}
|
||||
|
||||
onFocus={() => { }}
|
||||
onBlur={() => { }}
|
||||
>退货表单</div>
|
||||
}
|
||||
destroyOnClose={true}
|
||||
width={'80%'}
|
||||
bodyStyle={{
|
||||
height: '700px', // 你可以根据需要调整高度
|
||||
overflowY: 'auto',
|
||||
}}
|
||||
visible={showDetail}
|
||||
onCancel={() => {
|
||||
if (onCencel) {
|
||||
onCencel()
|
||||
}
|
||||
}}
|
||||
footer={false}
|
||||
modalRender={(modal) => {
|
||||
return <Draggable
|
||||
disabled={disabled}
|
||||
bounds={bounds}
|
||||
onStart={(event, uiData) => onDraggaleStart(event, uiData)}
|
||||
handle=".returnGoodsTableTitle"
|
||||
>
|
||||
<div ref={draggleRef}>{modal}</div>
|
||||
</Draggable>
|
||||
}}
|
||||
>
|
||||
<div style={{ width: '100%', display: 'flex', alignItems: 'center', justifyContent: 'flex-end', boxSizing: 'border-box', padding: '0 24px' }}>
|
||||
<Button type={'primary'} onClick={() => {
|
||||
const printName: string = `${parentRow?.DEPT_NAME || ''}自采退货单`;
|
||||
|
||||
// 获取页面所有样式
|
||||
const styles = Array.from(document.styleSheets)
|
||||
.map((sheet: any) =>
|
||||
Array.from(sheet.cssRules || []).map((rule: any) => rule.cssText).join('\n')
|
||||
)
|
||||
.join('\n');
|
||||
|
||||
// 克隆表格 DOM
|
||||
const originalTable: any = document.getElementsByClassName('returnGoodsTable')[0];
|
||||
const clonedTable = originalTable.cloneNode(true) as HTMLElement;
|
||||
clonedTable.style.display = 'block';
|
||||
|
||||
// 遍历设置字体大小
|
||||
const setFontSizeRecursively = (element: HTMLElement) => {
|
||||
element.style.fontSize = '10px';
|
||||
element.style.padding = '4px';
|
||||
Array.from(element.children).forEach((child) =>
|
||||
setFontSizeRecursively(child as HTMLElement)
|
||||
);
|
||||
};
|
||||
const tableCells = clonedTable.querySelectorAll('thead th, tbody td, tfoot td');
|
||||
tableCells.forEach((cell) => setFontSizeRecursively(cell as HTMLElement));
|
||||
console.log('clonedTableclonedTableclonedTableclonedTable', clonedTable);
|
||||
|
||||
// 获取克隆后的 HTML 内容
|
||||
const clonedHTML = clonedTable.getElementsByClassName('ant-table')[0].innerHTML;
|
||||
|
||||
// 页眉(标题 + 描述)
|
||||
let neckList: any = [
|
||||
{ label: "退货单号", value: parentRow?.ACCEPT_CODE || '' },
|
||||
{ label: "退货数量", value: currentModalDetail?.RETURN_COUNT || '' },
|
||||
{ label: "退货金额", value: currentModalDetail?.RETURN_AMOUNT || '' },
|
||||
{ label: "申请人员", value: parentRow?.STAFF_NAME || '' },
|
||||
{ label: "退货说明", value: parentRow?.PROINST_DESC || '' },
|
||||
]
|
||||
|
||||
|
||||
// 调用统一打印方法
|
||||
handleNewPrintAHJG(printName, `${parentRow?.DEPT_NAME || ''}自采退货单`, neckList, styles, clonedHTML, '');
|
||||
}}>打印退货单</Button>
|
||||
</div>
|
||||
|
||||
<div style={{ width: "100%", display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: "24px", fontWeight: 500 }}>
|
||||
{`${parentRow?.DEPT_NAME}自采退货单`}
|
||||
</div>
|
||||
|
||||
<ProTable
|
||||
actionRef={actionRef}
|
||||
className="returnGoodsTable"
|
||||
formRef={formRef}
|
||||
bordered
|
||||
search={false}
|
||||
pagination={false}
|
||||
columns={columns}
|
||||
options={false}
|
||||
request={async () => {
|
||||
console.log('parentRow', parentRow);
|
||||
if (!parentRow?.SALESTOREPROINST_ID) {
|
||||
return
|
||||
}
|
||||
|
||||
const req: any = {
|
||||
SearchParameter: {
|
||||
SALESTOREPROINST_IDS: parentRow?.SALESTOREPROINST_ID,
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999
|
||||
}
|
||||
|
||||
const data = await handleGetBACKCOMMODITYList(req)
|
||||
console.log('退货单详情', data);
|
||||
if (data && data.length > 0) {
|
||||
return { data, success: true }
|
||||
}
|
||||
return { data: [], success: true }
|
||||
}}
|
||||
tableExtraRender={(_, data) => {
|
||||
return <div style={{ width: '100%', boxSizing: 'border-box', padding: '24px' }}>
|
||||
<Descriptions
|
||||
size="small" column={4}
|
||||
className="commity-sale-description"
|
||||
contentStyle={{ fontWeight: "bolder" }} labelStyle={{ color: "#00000073" }}
|
||||
>
|
||||
<Descriptions.Item label="退货单号">{parentRow?.ACCEPT_CODE || ""}</Descriptions.Item>
|
||||
<Descriptions.Item label="退货数量">{""}</Descriptions.Item>
|
||||
<Descriptions.Item label="退货金额">{""}</Descriptions.Item>
|
||||
<Descriptions.Item label="申请人员">{parentRow?.STAFF_NAME || ""}</Descriptions.Item>
|
||||
|
||||
<Descriptions.Item label="退货说明">{parentRow?.PROINST_DESC || ""}</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</div>
|
||||
}}
|
||||
/>
|
||||
</Modal >
|
||||
</div >
|
||||
)
|
||||
}
|
||||
|
||||
export default connect(({ user, }: ConnectState) => ({
|
||||
currentUser: user.currentUser,
|
||||
}))(ReturnGoodsTable);
|
||||
@ -15,6 +15,7 @@ import LeftSelectTree from "@/pages/reports/settlementAccount/component/leftSele
|
||||
import PageTitleBox from "@/components/PageTitleBox";
|
||||
import moment from "moment";
|
||||
import { handleGetSALESTOREPROINSTList } from "../service";
|
||||
import ReturnGoodsTable from "./components/returnGoodsTable";
|
||||
|
||||
|
||||
const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
@ -37,6 +38,11 @@ const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
// 查询的条件
|
||||
const [searchParams, setSearchParams] = useState<any>()
|
||||
|
||||
// 显示配送单
|
||||
const [onShow, setOnShow] = useState<boolean>(false)
|
||||
// 当前行数据
|
||||
const [currentRow, setCurrentRow] = useState<any>()
|
||||
|
||||
const columns: any = [
|
||||
{
|
||||
dataIndex: 'searchText',
|
||||
@ -123,13 +129,25 @@ const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
align: 'right',
|
||||
width: 150,
|
||||
ellipsis: true,
|
||||
sorter: true,
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return <a onClick={() => {
|
||||
console.log('recordrecordrecord', record);
|
||||
|
||||
setCurrentRow(record)
|
||||
setOnShow(true)
|
||||
}}>
|
||||
1
|
||||
</a>
|
||||
}
|
||||
},
|
||||
{
|
||||
title: <div style={{ textAlign: 'center' }}>合计含税进价</div>,
|
||||
dataIndex: "合计含税进价",
|
||||
align: 'right',
|
||||
width: 150,
|
||||
sorter: true,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
@ -189,6 +207,11 @@ const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
tempTable.remove() // 防止重复打印一个内容
|
||||
}
|
||||
|
||||
// 关闭方法
|
||||
const handleCloseModal = () => {
|
||||
setCurrentRow(null)
|
||||
setOnShow(false)
|
||||
}
|
||||
|
||||
return (
|
||||
<div ref={(el) => {
|
||||
@ -260,13 +283,16 @@ const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
scroll={{ x: "100%", y: "calc(100vh - 410px)" }}
|
||||
headerTitle={<PageTitleBox props={props} />} // 列表表头
|
||||
search={{ span: 6 }}
|
||||
request={async (params) => {
|
||||
console.log('selectedIdselectedIdselectedId', selectedId);
|
||||
console.log('paramsparamsparamsparamsparams', params);
|
||||
request={async (params, sorter) => {
|
||||
|
||||
if (!selectedId) {
|
||||
return
|
||||
}
|
||||
// 排序字段
|
||||
const sortstr = Object.keys(sorter).map(n => {
|
||||
const value = sorter[n]
|
||||
return value ? `${n} ${value.replace('end', '')}` : ''
|
||||
})
|
||||
const req: any = {
|
||||
SearchParameter: {
|
||||
DEPT_IDS: selectedId,
|
||||
@ -274,13 +300,16 @@ const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
CREATEDATE_End: params.CREATEDATE_End || "",
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999
|
||||
PageSize: 999999,
|
||||
sortstr: sortstr.length ? sortstr.toString() : "",
|
||||
}
|
||||
setSearchParams(params)
|
||||
|
||||
const data = await handleGetSALESTOREPROINSTList(req)
|
||||
console.log('datadatadata', data);
|
||||
if (data && data.length > 0) {
|
||||
setReqDetailList(data)
|
||||
|
||||
return { data, success: true }
|
||||
}
|
||||
return { data: [], success: true }
|
||||
@ -320,6 +349,9 @@ const returnProcess: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 退货单 */}
|
||||
<ReturnGoodsTable showDetail={onShow} parentRow={currentRow} onCencel={handleCloseModal} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import { wrapTreeNode } from "@/utils/format"
|
||||
import request from "@/utils/request"
|
||||
|
||||
// 拿到盘存信息的数据
|
||||
@ -150,3 +151,54 @@ export async function handleGetSALESTOREPROINSTList(params: any) {
|
||||
}
|
||||
return data.Result_Data.List
|
||||
}
|
||||
|
||||
|
||||
// 获取退货表列表
|
||||
export async function handleGetBACKCOMMODITYList(params: any) {
|
||||
const data = await request(`/SaleStore/GetBACKCOMMODITYList`, {
|
||||
method: 'POST',
|
||||
data: { ...params, requestEncryption: true }
|
||||
})
|
||||
if (data.Result_Code !== 100) {
|
||||
return []
|
||||
}
|
||||
return data.Result_Data.List
|
||||
}
|
||||
|
||||
|
||||
// 获取商户信息表列表
|
||||
export async function handleGetMERCHANTSList(params: any) {
|
||||
const data = await request(`/SaleStore/GetMERCHANTSList`, {
|
||||
method: 'POST',
|
||||
data: { ...params, requestEncryption: true }
|
||||
})
|
||||
if (data.Result_Code !== 100) {
|
||||
return []
|
||||
}
|
||||
return data.Result_Data.List
|
||||
}
|
||||
|
||||
// 入库退货统计表
|
||||
export async function handleGetStorageBackSummary(params: any) {
|
||||
const data = await request(`/SaleStore/GetStorageBackSummary`, {
|
||||
method: 'POST',
|
||||
data: { ...params, requestEncryption: true }
|
||||
})
|
||||
if (data.Result_Code !== 100) {
|
||||
return []
|
||||
}
|
||||
return wrapTreeNode(data.Result_Data.List)
|
||||
}
|
||||
|
||||
|
||||
// 查询商品实时进销存明细数据
|
||||
export async function handleGetCommodityInSaleList(params: any) {
|
||||
const data = await request(`/SaleStore/GetCommodityInSaleList`, {
|
||||
method: 'POST',
|
||||
data: { ...params, requestEncryption: true }
|
||||
})
|
||||
if (data.Result_Code !== 100) {
|
||||
return []
|
||||
}
|
||||
return data.Result_Data.List
|
||||
}
|
||||
@ -386,13 +386,13 @@ const servicePartAudit: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
let req: any = {}
|
||||
if (currentRow?.CASHWORKER_ID) {
|
||||
req = {
|
||||
...personDetail,
|
||||
...res,
|
||||
WORKER_OTHER: defaultAuthor,
|
||||
SERVERPART_CODE: SERVERPART_CODE
|
||||
}
|
||||
} else {
|
||||
req = {
|
||||
...personDetail,
|
||||
...res,
|
||||
WORKER_OTHER: defaultAuthor,
|
||||
SERVERPART_CODE: SERVERPART_CODE
|
||||
@ -560,18 +560,27 @@ const servicePartAudit: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
<ProFormRadio.Group
|
||||
name="POST"
|
||||
options={[{ label: "现场稽查", value: "现场稽查" }, { label: "区域稽查", value: "区域稽查" }, { label: "公司稽查", value: "公司稽查" }]}
|
||||
/>
|
||||
|
||||
<Divider orientation="left" plain>人员权限</Divider>
|
||||
|
||||
<ProFormCheckbox.Group
|
||||
name="WORKER_OTHER"
|
||||
request={() => {
|
||||
console.log('PROWERSET', PROWERSET);
|
||||
let list: any = []
|
||||
if (PROWERSET && PROWERSET.length > 0) {
|
||||
PROWERSET.forEach((item: any) => {
|
||||
if (item.value === 50 || item.value === '50') {
|
||||
item.value = item.value.toString()
|
||||
list.push(item)
|
||||
}
|
||||
})
|
||||
}
|
||||
return PROWERSET
|
||||
return list
|
||||
}}
|
||||
// options={[
|
||||
// { label: '销售', value: 1 },
|
||||
|
||||
@ -141,69 +141,38 @@ const warehouseInfo = ({ onShow, parentRow, onCencel }: DetailProps) => {
|
||||
const exportTable = (e) => {
|
||||
e.stopPropagation();
|
||||
|
||||
const main = document.getElementsByClassName(`saleReportHideBox${printIndex}`)[0];
|
||||
const originHead = main.querySelector('thead').cloneNode(true);
|
||||
const originBody = main.querySelector('tbody').cloneNode(true);
|
||||
const main = document.getElementsByClassName(`warehouseInfo${printIndex}`)[0];
|
||||
const thead = main.querySelector('thead').cloneNode(true);
|
||||
const tbody = main.querySelector('tbody').cloneNode(true);
|
||||
const tfoot = main.querySelector('tfoot').cloneNode(true); // 深克隆DOM节点
|
||||
const container = document.querySelector('#hiddenBox');
|
||||
|
||||
const tempTable = document.createElement('table');
|
||||
tempTable.setAttribute('id', 'table-to-xls-warehouseInfo');
|
||||
|
||||
// 标题
|
||||
const caption = document.createElement('caption');
|
||||
caption.innerText = `${currentModalDetail?.SERVERPART_NAME || ''}${currentModalDetail?.SHOPNAME || ''}入库单`;
|
||||
caption.style.fontSize = '20px';
|
||||
caption.style.fontWeight = '600';
|
||||
caption.style.padding = '10px 0';
|
||||
tempTable.appendChild(caption);
|
||||
const title = document.createElement('div');
|
||||
title.innerText = `${currentModalDetail?.SERVERPART_NAME || ''}${currentModalDetail?.SHOPNAME || ''}入库单`;
|
||||
title.setAttribute('style', 'width:100%;text-align:center;font-size:20px;font-weight: 600;')
|
||||
|
||||
const exportHead = document.createElement('thead');
|
||||
const mkTh = (text) => {
|
||||
const th = document.createElement('th');
|
||||
th.innerText = text || '';
|
||||
th.style.textAlign = 'left';
|
||||
return th;
|
||||
};
|
||||
const mkEmpty = () => document.createElement('th'); // 空单元格
|
||||
tempTable.appendChild(title);
|
||||
tempTable.appendChild(thead);
|
||||
tempTable.appendChild(tfoot);
|
||||
tempTable.appendChild(tbody);
|
||||
|
||||
// 第一行:单号 + 空格 + 数量 + 空格 + 金额 + 空格 + 时间
|
||||
const row1 = document.createElement('tr');
|
||||
row1.appendChild(mkTh(`入库单号:${currentModalDetail?.RECEIVECENTER_CODE ?? ''}`));
|
||||
row1.appendChild(mkEmpty());
|
||||
row1.appendChild(mkTh(`入库数量:${parentRow?.RECEIVE_TOTALCOUNT ?? ''}`));
|
||||
row1.appendChild(mkEmpty());
|
||||
row1.appendChild(mkTh(`入库金额:${parentRow?.RECEIVE_TOTALPRICE ?? ''}`));
|
||||
row1.appendChild(mkEmpty());
|
||||
row1.appendChild(mkTh(`入库时间:${parentRow?.RECEIVECENTER_DATE ?? ''}`));
|
||||
tempTable.setAttribute('id', 'table-to-xls-warehouseInfo'); // 给table添加id,值与按钮上的table字段对应
|
||||
|
||||
// 第二行:采购说明(跨满所有列)
|
||||
const row2 = document.createElement('tr');
|
||||
const noteTh = mkTh(`采购说明:${parentRow?.RECEIVESERVERPART_DESC ?? ''}`);
|
||||
noteTh.colSpan = 7; // 跨前面 7 列
|
||||
row2.appendChild(noteTh);
|
||||
container.appendChild(tempTable); // 把创建的节点添加到页面容器中
|
||||
|
||||
exportHead.appendChild(row1);
|
||||
exportHead.appendChild(row2);
|
||||
setShowLoading(false)
|
||||
|
||||
// 原始表头列标题
|
||||
Array.from(originHead.rows).forEach(r => exportHead.appendChild(r));
|
||||
|
||||
tempTable.appendChild(exportHead);
|
||||
tempTable.appendChild(originBody);
|
||||
|
||||
container.appendChild(tempTable);
|
||||
|
||||
setShowLoading(false);
|
||||
downloadBtnRef.current.handleDownload();
|
||||
setShowExportTable(false)
|
||||
tempTable.remove() // 防止重复打印一个内容
|
||||
|
||||
setShowExportTable(false);
|
||||
tempTable.remove();
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className={`saleReportHideBox${printIndex}`} style={{ position: 'fixed', zIndex: -1, top: 0, left: 0 }}>
|
||||
<div className={`warehouseInfo${printIndex}`} style={{ position: 'fixed', zIndex: -1, top: 0, left: 0 }}>
|
||||
{
|
||||
showExportTable && reqDetailList && reqDetailList.length > 0 ?
|
||||
<ProTable
|
||||
@ -283,7 +252,7 @@ const warehouseInfo = ({ onShow, parentRow, onCencel }: DetailProps) => {
|
||||
formRef={formRef}
|
||||
columns={columns}
|
||||
bordered
|
||||
scroll={{ x: '100%', y: 300 }}
|
||||
scroll={{ x: '100%', y: 270 }}
|
||||
search={false}
|
||||
options={false}
|
||||
request={async (params) => {
|
||||
|
||||
@ -5,7 +5,7 @@ import React, { useRef, useState } from "react";
|
||||
import ProCard from "@ant-design/pro-card";
|
||||
import { MenuFoldOutlined } from "@ant-design/icons";
|
||||
import type { FormInstance } from "antd";
|
||||
import { Button, Col, message, Modal, Row, Space, Spin, Tree } from "antd";
|
||||
import { Button, Col, Descriptions, message, Modal, Row, Space, Spin, Table, Tree, Typography } from "antd";
|
||||
import useRequest from "@ahooksjs/use-request";
|
||||
import { getServerpartTree } from "@/services/options";
|
||||
import type { ActionType } from "@ant-design/pro-table";
|
||||
@ -24,6 +24,7 @@ import { getMyShopList } from "@/pages/account/center/sevice";
|
||||
import { handleGetRECEIVESERVERPARTList } from "../service";
|
||||
import WarehouseInfo from "./components/warehouseInfo";
|
||||
|
||||
const { Text } = Typography;
|
||||
|
||||
const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
const { currentUser } = props
|
||||
@ -53,6 +54,12 @@ const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
// 是否显示打印的表格
|
||||
const [showExportTable, setShowExportTable] = useState<boolean>(false)
|
||||
const [reqDetailList, setReqDetailList] = useState<any>(); // 合计项数据源
|
||||
// 表格的合计值
|
||||
const [tableSumObj, setTableSumObj] = useState<any>();
|
||||
// 表格加载效果
|
||||
const [tableLoading, setTableLoading] = useState<boolean>(false)
|
||||
|
||||
|
||||
const onDraggaleStart = (event, uiData) => {
|
||||
const { clientWidth, clientHeight } = window.document.documentElement;
|
||||
const targetRect = draggleRef.current?.getBoundingClientRect();
|
||||
@ -104,7 +111,7 @@ const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
title: '查询内容',
|
||||
hideInTable: true,
|
||||
fieldProps: {
|
||||
placeholder: "请输入商品名称/商品条码"
|
||||
placeholder: "请输入商品名称/入库单号"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -218,6 +225,9 @@ const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
align: 'right',
|
||||
valueType: 'digit',
|
||||
width: 120,
|
||||
sorter: true,
|
||||
// sorter: (a, b) => a.RECEIVE_TOTALCOUNT - b.RECEIVE_TOTALCOUNT,
|
||||
defaultSortOrder: 'descend',
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
@ -227,6 +237,8 @@ const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
align: 'right',
|
||||
valueType: 'digit',
|
||||
width: 120,
|
||||
sorter: true,
|
||||
// sorter: (a, b) => a.RECEIVE_TOTALPRICE - b.RECEIVE_TOTALPRICE,
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
@ -235,6 +247,8 @@ const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
dataIndex: "RECEIVECENTER_DATE",
|
||||
align: 'center',
|
||||
width: 150,
|
||||
sorter: true,
|
||||
// sorter: (a, b) => new Date(a?.RECEIVECENTER_DATE).getTime() - new Date(b?.RECEIVECENTER_DATE).getTime(),
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
@ -372,29 +386,52 @@ const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
expandable={{
|
||||
expandRowByClick: true
|
||||
}}
|
||||
scroll={{ x: "100%", y: "calc(100vh - 450px)" }}
|
||||
loading={tableLoading}
|
||||
scroll={{ x: "100%", y: "calc(100vh - 520px)" }}
|
||||
headerTitle={<PageTitleBox props={props} />} // 列表表头
|
||||
search={{ span: 6, defaultCollapsed: false }} // 查询表单
|
||||
request={async (params) => {
|
||||
request={async (params, sorter) => {
|
||||
if (!selectedId) {
|
||||
return
|
||||
}
|
||||
|
||||
// 排序字段
|
||||
const sortstr = Object.keys(sorter).map(n => {
|
||||
const value = sorter[n]
|
||||
return value ? `${n} ${value.replace('end', '')}` : ''
|
||||
})
|
||||
const req: any = {
|
||||
SearchParameter: {
|
||||
SERVERPARTSHOP_IDS: selectedId,
|
||||
RECEIVECENTER_DATE_Start: params?.RECEIVECENTER_DATE_Start || "",
|
||||
RECEIVECENTER_DATE_End: params?.RECEIVECENTER_DATE_End || "",
|
||||
},
|
||||
keyWord: {
|
||||
Key: 'RECEIVECENTER_CODE',
|
||||
Value: params?.searchText || ''
|
||||
},
|
||||
PageIndex: 1,
|
||||
PageSize: 999999
|
||||
PageSize: 999999,
|
||||
sortstr: sortstr.length ? sortstr.toString() : "",
|
||||
}
|
||||
|
||||
setSearchParams(params)
|
||||
setTableLoading(true)
|
||||
const data = await handleGetRECEIVESERVERPARTList(req)
|
||||
setTableLoading(false)
|
||||
console.log('表格数据', data);
|
||||
setReqDetailList(data)
|
||||
if (data && data.length > 0) {
|
||||
// 总数合计
|
||||
let RECEIVE_TOTALCOUNTSUM: number = 0
|
||||
// 金额合计
|
||||
let RECEIVE_TOTALPRICESUM: number = 0
|
||||
data.forEach((item: any) => {
|
||||
RECEIVE_TOTALCOUNTSUM += item.RECEIVE_TOTALCOUNT
|
||||
RECEIVE_TOTALPRICESUM += item.RECEIVE_TOTALPRICE
|
||||
})
|
||||
setTableSumObj({
|
||||
RECEIVE_TOTALCOUNT: Number(RECEIVE_TOTALCOUNTSUM.toFixed(2)),
|
||||
RECEIVE_TOTALPRICE: Number(RECEIVE_TOTALPRICESUM.toFixed(2))
|
||||
})
|
||||
return { data, success: true }
|
||||
}
|
||||
return { data: [], success: true }
|
||||
@ -434,6 +471,58 @@ const shopProcurement: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
// }}>填写申请</Button>
|
||||
]
|
||||
}}
|
||||
tableExtraRender={
|
||||
(_, data) => {
|
||||
return <div style={{ paddingLeft: 24 }}>
|
||||
<Descriptions
|
||||
size="small" column={5}
|
||||
className="commity-sale-description"
|
||||
contentStyle={{ fontWeight: "bolder" }} labelStyle={{ color: "#00000073" }}
|
||||
>
|
||||
<Descriptions.Item label="入库总数">{tableSumObj?.RECEIVE_TOTALCOUNT ? tableSumObj?.RECEIVE_TOTALCOUNT.toLocaleString('zh-CN') : ""}<Text
|
||||
type="secondary"> </Text></Descriptions.Item>
|
||||
<Descriptions.Item label="入库金额">{tableSumObj?.RECEIVE_TOTALPRICE ? tableSumObj?.RECEIVE_TOTALPRICE.toLocaleString('zh-CN') : ""}<Text
|
||||
type="secondary"> </Text></Descriptions.Item>
|
||||
</Descriptions>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
summary={(pageData) => {
|
||||
// 总数合计
|
||||
let RECEIVE_TOTALCOUNTSUM: number = 0
|
||||
// 金额合计
|
||||
let RECEIVE_TOTALPRICESUM: number = 0
|
||||
|
||||
if (pageData && pageData.length > 0) {
|
||||
pageData.forEach((item: any) => {
|
||||
RECEIVE_TOTALCOUNTSUM += item.RECEIVE_TOTALCOUNT
|
||||
RECEIVE_TOTALPRICESUM += item.RECEIVE_TOTALPRICE
|
||||
})
|
||||
}
|
||||
return (
|
||||
<Table.Summary fixed="top">
|
||||
<Table.Summary.Row>
|
||||
<Table.Summary.Cell index={0} colSpan={3}>
|
||||
<div style={{ textAlign: 'center', fontWeight: 600 }}>本页合计</div>
|
||||
</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={1}></Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={2}></Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={3}></Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={4}>
|
||||
<div style={{ textAlign: 'right' }}>
|
||||
{RECEIVE_TOTALCOUNTSUM ? Number(RECEIVE_TOTALCOUNTSUM.toFixed(2)).toLocaleString('zh-CN') : ''}
|
||||
</div>
|
||||
</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={5}>
|
||||
<div style={{ textAlign: 'right' }}>
|
||||
{RECEIVE_TOTALPRICESUM ? Number(RECEIVE_TOTALPRICESUM.toFixed(2)).toLocaleString('zh-CN') : ''}
|
||||
</div>
|
||||
</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={6}></Table.Summary.Cell>
|
||||
</Table.Summary.Row>
|
||||
</Table.Summary>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -90,7 +90,7 @@ const ContractDetail = ({ tableData, detail }: DetailProps) => {
|
||||
console.log('detail', detail);
|
||||
let req: any = {
|
||||
SearchParameter: {
|
||||
SERVERPARTSHOP_ID: detail?.SERVERPARTSHOP_ID,
|
||||
SERVERPARTSHOP_ID: detail?.SERVERPARTSHOP_ID || detail?.PropertyShop.SERVERPARTSHOP_ID,
|
||||
PROJECT_VALID: 1
|
||||
},
|
||||
PageIndex: 1,
|
||||
|
||||
@ -51,6 +51,8 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
|
||||
const [relatedShop, setRelatedShop] = useState<any>()
|
||||
// 选择的门店id数组
|
||||
const [selectShop, setSelectShop] = useState<any>()
|
||||
// 显示的人员权限可以选择的内容
|
||||
const [showPROWERSETList, setShowPROWERSETList] = useState<any>()
|
||||
|
||||
const { loading: PROWERSETLoading, data: PROWERSET } = useRequest(async () => {
|
||||
const data = await getFieldEnum({ FieldExplainField: 'PROWERSET' })
|
||||
@ -362,7 +364,6 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
|
||||
<div>
|
||||
<Button type='primary' style={{ marginRight: '16px' }} onClick={() => {
|
||||
editFormRef.current?.validateFields().then(async (res) => {
|
||||
|
||||
// 根据当前的服务区 去拿个code
|
||||
const code = await handleNewGetSERVERPARTDetail({ SERVERPARTId: res.SERVERPART_ID })
|
||||
console.log('codecodecodecode', code);
|
||||
@ -385,13 +386,14 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
|
||||
let req: any = {}
|
||||
if (currentRow?.CASHWORKER_ID) {
|
||||
req = {
|
||||
...personDetail,
|
||||
...res,
|
||||
WORKER_OTHER: defaultAuthor,
|
||||
SERVERPART_CODE: SERVERPART_CODE
|
||||
}
|
||||
|
||||
} else {
|
||||
req = {
|
||||
...personDetail,
|
||||
...res,
|
||||
WORKER_OTHER: defaultAuthor,
|
||||
SERVERPART_CODE: SERVERPART_CODE
|
||||
@ -494,6 +496,36 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
|
||||
message: '请选择人员类别',
|
||||
},
|
||||
]}
|
||||
fieldProps={{
|
||||
onChange: (e: any) => {
|
||||
console.log('e', e);
|
||||
// WORKER_OTHER: ['']
|
||||
let list: any = []
|
||||
let nowValueList: any = []
|
||||
|
||||
if (e === 1) {
|
||||
editFormRef.current?.setFieldsValue({ WORKER_OTHER: ['1', '5', '8', '13', '15', '47', '52', '53'] })
|
||||
nowValueList = ['1', '2', '4', '5', '6', '8', '9', '10', '13', '15', '35', '47', '52', '53']
|
||||
} else if (e === 2) {
|
||||
editFormRef.current?.setFieldsValue({ WORKER_OTHER: ['2', '3', '4', '6', '18', '35', '36', '51'] })
|
||||
nowValueList = ['1', '2', '3', '4', '5', '6', '8', '9', '10', '13', '15', '18', '35', '36', '47', '50', '51', '52', '53', '120']
|
||||
} else if (e === 20) {
|
||||
editFormRef.current?.setFieldsValue({ WORKER_OTHER: ['2', '3', '4', '6', '8', '18', '35', '47', '51'] })
|
||||
nowValueList = ['2', '3', '4', '6', '8', '9', '10', '18', '35', '47', '51']
|
||||
}
|
||||
if (PROWERSET && PROWERSET.length > 0) {
|
||||
PROWERSET.forEach((item: any) => {
|
||||
if (nowValueList.indexOf(item.value.toString()) !== -1) {
|
||||
list.push(item)
|
||||
}
|
||||
})
|
||||
}
|
||||
console.log('PROWERSETPROWERSETPROWERSETPROWERSET', PROWERSET);
|
||||
console.log('listlistlistlistlist', list);
|
||||
|
||||
setShowPROWERSETList(list)
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
@ -561,15 +593,16 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) =>
|
||||
<Divider orientation="left" plain>人员权限</Divider>
|
||||
<ProFormCheckbox.Group
|
||||
name="WORKER_OTHER"
|
||||
request={() => {
|
||||
console.log('PROWERSET', PROWERSET);
|
||||
if (PROWERSET && PROWERSET.length > 0) {
|
||||
PROWERSET.forEach((item: any) => {
|
||||
item.value = item.value.toString()
|
||||
})
|
||||
}
|
||||
return PROWERSET
|
||||
}}
|
||||
options={showPROWERSETList}
|
||||
// request={() => {
|
||||
// if (PROWERSET && PROWERSET.length > 0) {
|
||||
// PROWERSET.forEach((item: any) => {
|
||||
// item.value = item.value.toString()
|
||||
// })
|
||||
// }
|
||||
// console.log('PROWERSET', PROWERSET);
|
||||
// return PROWERSET
|
||||
// }}
|
||||
// options={[
|
||||
// { label: '销售', value: 1 },
|
||||
// { label: '退货', value: 2 },
|
||||
|
||||
@ -253,7 +253,6 @@ const ConvenienceStoreProductReview: React.FC<{ currentUser: CurrentUser }> = (p
|
||||
let list: any = JSON.parse(JSON.stringify(selectedModalOrderRowKeys))
|
||||
console.log('listlistlist', list);
|
||||
console.log('tableDatatableDatatableData', tableData);
|
||||
|
||||
let reqList: any = []
|
||||
// 判断是不是所有的价格都已经输入了
|
||||
let isAllOk: boolean = true
|
||||
@ -261,6 +260,9 @@ const ConvenienceStoreProductReview: React.FC<{ currentUser: CurrentUser }> = (p
|
||||
let noPriceName: string = ''
|
||||
tableData.forEach((item: any) => {
|
||||
if (list.indexOf(item.COMMODITY_ID.toString()) !== -1) {
|
||||
if (item.COMMODITY_TYPE === '普通商品') {
|
||||
item.COMMODITY_TYPE = 1012
|
||||
}
|
||||
reqList.push(item)
|
||||
}
|
||||
if (!item.COMMODITY_CURRPRICE) {
|
||||
|
||||
@ -129,23 +129,23 @@ const commodityInfo: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
request: async () => {
|
||||
// const data = await getServerpartOption(340000)
|
||||
// return data
|
||||
const serverpartList: any = session.get('serverpartList')
|
||||
let serverpartId: string = ''
|
||||
if (serverpartList && serverpartList.length > 0) {
|
||||
serverpartList.forEach((item: any) => {
|
||||
if (serverpartId) {
|
||||
serverpartId += `,${item.value}`
|
||||
} else {
|
||||
serverpartId = item.value
|
||||
}
|
||||
})
|
||||
}
|
||||
const ServerpartIdsTree: any = session.get('ServerpartIdsTree')
|
||||
// let serverpartId: string = ''
|
||||
// if (serverpartList && serverpartList.length > 0) {
|
||||
// serverpartList.forEach((item: any) => {
|
||||
// if (serverpartId) {
|
||||
// serverpartId += `,${item.value}`
|
||||
// } else {
|
||||
// serverpartId = item.value
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
// serverpartList.unshift({
|
||||
// label: "全部",
|
||||
// value: ''
|
||||
// })
|
||||
return serverpartList
|
||||
return ServerpartIdsTree
|
||||
},
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
@ -364,7 +364,7 @@ const commodityInfo: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
// 拿到对应的商品业态
|
||||
const handleGetCommodity = async (id: any) => {
|
||||
const req: any = {
|
||||
ProvinceCode: currentUser?.USER_PROVINCE,
|
||||
ProvinceCode: currentUser?.ProvinceCode,
|
||||
ServerpartId: id
|
||||
}
|
||||
const data = await handleGetServerpartShopTrade(req)
|
||||
@ -455,7 +455,7 @@ const commodityInfo: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
setCollapsible(!collapsible)
|
||||
}} />}
|
||||
colSpan={!collapsible ? "300px" : "60px"}
|
||||
title={!collapsible ? "请选择服务区" : ""}
|
||||
title={!collapsible ? "请选择商品类别" : ""}
|
||||
headerBordered
|
||||
collapsed={collapsible}
|
||||
>
|
||||
@ -610,21 +610,23 @@ const commodityInfo: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
name="SERVERPART_ID"
|
||||
label="服务区名"
|
||||
request={async () => {
|
||||
const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true)
|
||||
const list: any = []
|
||||
if (data && data.length > 0) {
|
||||
data.forEach((item: any) => {
|
||||
if (item.children && item.children.length > 0) {
|
||||
item.children.forEach((subItem: any) => {
|
||||
list.push({ label: subItem.label, value: subItem.value })
|
||||
})
|
||||
}
|
||||
})
|
||||
data.forEach((item: any) => {
|
||||
list.push({ label: item.label, value: item.value })
|
||||
})
|
||||
}
|
||||
return list
|
||||
const ServerpartIdsTree: any = session.get('ServerpartIdsTree')
|
||||
|
||||
// const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true)
|
||||
// const list: any = []
|
||||
// if (data && data.length > 0) {
|
||||
// data.forEach((item: any) => {
|
||||
// if (item.children && item.children.length > 0) {
|
||||
// item.children.forEach((subItem: any) => {
|
||||
// list.push({ label: subItem.label, value: subItem.value })
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// data.forEach((item: any) => {
|
||||
// list.push({ label: item.label, value: item.value })
|
||||
// })
|
||||
// }
|
||||
return ServerpartIdsTree
|
||||
}}
|
||||
rules={[
|
||||
{
|
||||
|
||||
@ -123,8 +123,8 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
request: async () => {
|
||||
// const data = await getServerpartOption(currentUser?.ProvinceCode)
|
||||
// console.log('datadatadatadata', data);
|
||||
const serverpartList: any = session.get('serverpartList')
|
||||
return serverpartList
|
||||
const ServerpartIdsTree: any = session.get('ServerpartIdsTree')
|
||||
return ServerpartIdsTree
|
||||
},
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
@ -364,7 +364,7 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
setCollapsible(!collapsible)
|
||||
}} />}
|
||||
colSpan={!collapsible ? "300px" : "60px"}
|
||||
title={!collapsible ? "请选择服务区" : ""}
|
||||
title={!collapsible ? "请选择商品类别" : ""}
|
||||
headerBordered
|
||||
collapsed={collapsible}
|
||||
>
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
// 商品快捷键管理
|
||||
import { connect } from "umi";
|
||||
import type { CurrentUser } from "umi";
|
||||
import type { ConnectState } from "@/models/connect";
|
||||
@ -72,6 +73,10 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
valueType: 'select',
|
||||
// initialValue: '1000',
|
||||
valueEnum: commodityList,
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
filterOption: (input: any, option: any) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase()),
|
||||
},
|
||||
// request: async () => {
|
||||
// return await getFieldEnum({ FieldExplainField: 'BUSINESSTYPE', sessionName: 'SHOPTRADE', notformate: true })
|
||||
// }
|
||||
@ -263,7 +268,7 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
// 拿到对应的商品业态
|
||||
const handleGetCommodity = async (id: any) => {
|
||||
const req: any = {
|
||||
ProvinceCode: currentUser?.USER_PROVINCE,
|
||||
ProvinceCode: currentUser?.ProvinceCode,
|
||||
ServerpartId: id
|
||||
}
|
||||
const data = await handleGetServerpartShopTrade(req)
|
||||
@ -370,9 +375,10 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
if (!currenMenu) {
|
||||
return
|
||||
}
|
||||
|
||||
const req: any = {
|
||||
SearchType: 4,
|
||||
ProvinceCode: currentUser?.USER_PROVINCE,
|
||||
ProvinceCode: currentUser?.ProvinceCode,
|
||||
ServerpartID: currenMenu,
|
||||
CommodityState: params.CommodityState,
|
||||
ShopTrade: params.ShopTrade,
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
// 商品自定义归类
|
||||
import { connect } from "umi";
|
||||
import type { CurrentUser } from "umi";
|
||||
import type { ConnectState } from "@/models/connect";
|
||||
@ -20,9 +21,10 @@ import {
|
||||
} from "@/pages/reports/productControl/setUserDefinedType/service";
|
||||
import { handleGetShopTypeTree } from "@/pages/DataVerification/list/service";
|
||||
import { handleGetUSERDEFINEDTYPEList } from "@/pages/reports/productControl/userDefinedType/service";
|
||||
import {handleGetNestingCOMMODITYTYPETree} from "@/pages/reports/productControl/commodityInfo/service";
|
||||
import { handleGetNestingCOMMODITYTYPETree, handleGetServerpartShopTrade } from "@/pages/reports/productControl/commodityInfo/service";
|
||||
import './style.less'
|
||||
import PageTitleBox from "@/components/PageTitleBox";
|
||||
import session from "@/utils/session";
|
||||
|
||||
const setUserDefinedType: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
const { currentUser } = props
|
||||
@ -45,6 +47,7 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
setTreeView(data)
|
||||
return data
|
||||
})
|
||||
const [commodityList, setCommodityList] = useState<any>()
|
||||
|
||||
// 加载弹出框里面的关联商品的树状选择
|
||||
const { loading: modalTreeLoading, data: ModalTreeViews } = useRequest(async () => {
|
||||
@ -140,10 +143,15 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
title: '商品业态',
|
||||
dataIndex: 'BUSINESSTYPE',
|
||||
valueType: 'select',
|
||||
request:async ()=>{
|
||||
const data = await getFieldEnumTree({ FieldExplainField: 'BUSINESSTYPE' })
|
||||
return data
|
||||
}
|
||||
valueEnum: commodityList,
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
filterOption: (input: any, option: any) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase()),
|
||||
},
|
||||
// request: async () => {
|
||||
// const data = await getFieldEnumTree({ FieldExplainField: 'BUSINESSTYPE' })
|
||||
// return data
|
||||
// }
|
||||
},
|
||||
{
|
||||
title: '商品状态',
|
||||
@ -156,6 +164,26 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
hideInSearch: true,
|
||||
},
|
||||
]
|
||||
const commodityTree = session.get('CommodityTypeIdsTree')
|
||||
|
||||
const toLabelValueMapSimple = (tree: any[]) => {
|
||||
const map: Record<string, any> = {};
|
||||
const dfs = (nodes: any[]) => {
|
||||
if (!nodes) {
|
||||
return
|
||||
}
|
||||
nodes.forEach(n => {
|
||||
map[n.value.toString()] = n.label;
|
||||
if (n.children?.length) dfs(n.children);
|
||||
});
|
||||
};
|
||||
dfs(tree);
|
||||
return map;
|
||||
}
|
||||
|
||||
console.log('fdskfsd', toLabelValueMapSimple(commodityTree));
|
||||
|
||||
|
||||
|
||||
const modalColumns: any = [
|
||||
{
|
||||
@ -163,11 +191,8 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
width: 120,
|
||||
dataIndex: 'COMMODITY_TYPE',
|
||||
hideInSearch: true,
|
||||
valueType: 'treeSelect',
|
||||
request: async () => {
|
||||
const data = await handleGetShopTypeTree({ PROVINCE_CODE: currentUser?.ProvinceCode });
|
||||
return data
|
||||
},
|
||||
valueType: 'select',
|
||||
valueEnum: toLabelValueMapSimple(commodityTree)
|
||||
},
|
||||
{
|
||||
title: '商品条码',
|
||||
@ -317,6 +342,8 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
}
|
||||
|
||||
const loadSelectedId = (item?: any) => {
|
||||
console.log('itemitemitem', item);
|
||||
|
||||
// 选中的子菜单key
|
||||
const [type, value] = item.key.split('-')
|
||||
if (type === '1') {
|
||||
@ -326,6 +353,9 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
} else if (type === '2') {
|
||||
// setCurrenMenu(undefined)
|
||||
setSelectBusiness(value)
|
||||
// type 为2 那就说明是选择门店了
|
||||
let serverpartId: string = item.keyPath[1].split('-')[1]
|
||||
handleGetCommodity(serverpartId)
|
||||
} else {
|
||||
setCurrenMenu(undefined)
|
||||
setSelectBusiness(undefined)
|
||||
@ -345,7 +375,24 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
} else {
|
||||
setModalTreeSelect('')
|
||||
}
|
||||
actionModalRef?.current?.reload()
|
||||
// actionModalRef?.current?.reload()
|
||||
}
|
||||
|
||||
// 拿到对应的商品业态
|
||||
const handleGetCommodity = async (id: any) => {
|
||||
const req: any = {
|
||||
ProvinceCode: currentUser?.ProvinceCode,
|
||||
ServerpartId: id
|
||||
}
|
||||
const data = await handleGetServerpartShopTrade(req)
|
||||
console.log('data', data)
|
||||
const obj: any = {}
|
||||
if (data && data.length > 0) {
|
||||
data.forEach((item: any) => {
|
||||
obj[item.value] = item.label
|
||||
})
|
||||
}
|
||||
setCommodityList(obj)
|
||||
}
|
||||
|
||||
const modalRowSelection: any = {
|
||||
@ -501,10 +548,10 @@ const setUserDefinedType: React.FC<{ currentUser: CurrentUser}> = (props) => {
|
||||
onConfirm={async () => {
|
||||
console.log('selectRowList', selectRowList)
|
||||
console.log('selectedOrderRowKeys', selectedOrderRowKeys)
|
||||
if (selectedOrderRowKeys && selectedOrderRowKeys.length>0){
|
||||
if (selectRowList && selectRowList.length > 0) {
|
||||
const list: any = []
|
||||
selectedOrderRowKeys.forEach((item: any)=>{
|
||||
list.push({label:'',value:item})
|
||||
selectRowList.forEach((item: any) => {
|
||||
list.push({ label: item.USERDEFINEDTYPE_ID, value: item.COMMODITY_ID })
|
||||
})
|
||||
const data = await handleDeleteRTUDType(list)
|
||||
if (data.Result_Code === 100) {
|
||||
|
||||
@ -400,6 +400,197 @@ export const handleNewPrint = (printName: string, title: string, neckBox?: any,
|
||||
}
|
||||
}
|
||||
|
||||
// 自定义打印的内容的打印方法
|
||||
export const handleNewPrintAHJG = (printName: string, title: string, neckBox?: any, styles?: any, tableDom?: any, footer?: any) => {
|
||||
// printName 打印出来文件的名称
|
||||
// title 打印内容的标题
|
||||
// neckBox 标题下面可能会要求的打印的内容 数组 {label,value}格式 样式已写死
|
||||
// styles 获取页面的样式
|
||||
// tableDom 要打印显示的表格 直接dom元素拿进来(处理好的)
|
||||
// footer 打印内容底部的自定义样式 需求不一样 样式也不一样 外面写好样式和标签直接传入
|
||||
const printWindow = window.open('', '_blank', 'width=1400,height=800');
|
||||
if (printWindow) {
|
||||
printWindow.document.open();
|
||||
printWindow.document.write(`
|
||||
<html>
|
||||
<head>
|
||||
<title>${printName || ''}</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
margin: 20px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
${styles}
|
||||
.handlePrintBox{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
z-index: 0;
|
||||
box-sizing: border-box;
|
||||
padding: 20px 0 0 0;
|
||||
}
|
||||
.handlePrintBox .custom-header {
|
||||
font-size: 24px;
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.handlePrintBox .neckBox{
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 12px 5% 12px 5%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.handlePrintBox .neckBox .neckBoxItem{
|
||||
width: calc(100% / 4);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.handlePrintBox .neckBox .bigNeckBoxItem{
|
||||
width: calc((100% / 4) * 2);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.handlePrintBox .neckBox .bigNeckBoxItem .itemLabel{
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
margin-right: 2px;
|
||||
}
|
||||
.handlePrintBox .neckBox .bigNeckBoxItem .itemValue{
|
||||
font-size: 12px;
|
||||
}
|
||||
.handlePrintBox .neckBox .neckBoxItem .itemLabel{
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
margin-right: 2px;
|
||||
}
|
||||
.handlePrintBox .neckBox .neckBoxItem .itemValue{
|
||||
font-size: 12px;
|
||||
}
|
||||
.handlePrintBox .tableBox{
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 12px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
}
|
||||
.handlePrintBox .tableBox .ant-table-thead tr th{
|
||||
border: 2px solid #000;
|
||||
}
|
||||
.handlePrintBox .tableBox .ant-table-tbody tr td{
|
||||
border: 2px solid #000;
|
||||
}
|
||||
.handlePrintBox .tableBox .ant-table-summary tr td{
|
||||
border: 2px solid #000;
|
||||
}
|
||||
.handlePrintBox .tableUnit{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
box-sizing: border-box;
|
||||
font-size: 14px;
|
||||
}
|
||||
.handlePrintBox .tableUnit .tableRight{
|
||||
width: calc(100% / 3);
|
||||
font-size: 14px;
|
||||
box-sizing: border-box;
|
||||
padding-left: 5%;
|
||||
}
|
||||
.pro-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.pro-table th, .pro-table td {
|
||||
border: 1px solid #ddd;
|
||||
padding: 8px;
|
||||
}
|
||||
.pro-table th {
|
||||
background-color: #f2f2f2;
|
||||
text-align: left;
|
||||
}
|
||||
/* 水印样式 */
|
||||
.watermark {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: grid;
|
||||
grid-template-rows: repeat(4, 1fr); /* 水平行数 */
|
||||
grid-template-columns: repeat(4, 1fr); /* 垂直列数 */
|
||||
opacity: 0.2;
|
||||
pointer-events: none;
|
||||
z-index: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
.watermark span {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
transform: rotate(-45deg); /* 水印旋转 */
|
||||
font-size: 14px;
|
||||
color: rgba(0, 0, 0); /* 半透明水印 */
|
||||
user-select: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="handlePrintBox">
|
||||
<div class="custom-header">${title}</div>
|
||||
<div class="neckBox">
|
||||
${neckBox && neckBox.length > 0
|
||||
? neckBox
|
||||
.map((item: any) => {
|
||||
return `<div class="${item.label === '门店名称' ? 'bigNeckBoxItem' : 'neckBoxItem'}">
|
||||
<span class="itemLabel">${item.label ? item.label + ':' : ''}</span>
|
||||
<span class="itemValue">${item.value}</span>
|
||||
</div>`;
|
||||
})
|
||||
.join('') // 连接成单一字符串,避免逗号
|
||||
: ''}
|
||||
</div>
|
||||
<div class="tableBox">
|
||||
${tableDom}
|
||||
</div>
|
||||
<div>
|
||||
${footer}
|
||||
</div>
|
||||
</div>
|
||||
<div class="watermark">
|
||||
${Array(16) // 5x5 网格的水印内容
|
||||
.fill('<span>安徽建工集团投资运营管理有限公司</span>')
|
||||
.join('')}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
`)
|
||||
printWindow.document.close();
|
||||
printWindow.print();
|
||||
|
||||
// 使用定时器检测打印窗口是否关闭
|
||||
const closeCheckInterval = setInterval(() => {
|
||||
if (printWindow.closed) {
|
||||
clearInterval(closeCheckInterval);
|
||||
}
|
||||
}, 500);
|
||||
|
||||
// 监听窗口焦点事件,若打印窗口失去焦点,关闭窗口
|
||||
printWindow.onfocus = () => {
|
||||
printWindow.close();
|
||||
clearInterval(closeCheckInterval);
|
||||
};
|
||||
printWindow.onafterprint = () => printWindow.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 打印图片
|
||||
export const handlePrintImg = (url: any) => {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// 由 scripts/writeVersion.js 自动生成
|
||||
export const VERSION = "4.5.38";
|
||||
export const GIT_HASH = "9fb0245";
|
||||
export const BUILD_TIME = "2025-08-28T02:13:12.174Z";
|
||||
export const VERSION = "4.5.40";
|
||||
export const GIT_HASH = "debd5be";
|
||||
export const BUILD_TIME = "2025-08-29T07:11:29.945Z";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user