diff --git a/config/routers/capital.ts b/config/routers/capital.ts index 0d06bb4..4a3be95 100644 --- a/config/routers/capital.ts +++ b/config/routers/capital.ts @@ -28,11 +28,19 @@ export default [ component: './capital/StandardName' }, { + path: '/ams/maintenance/stock', // 运维库存池查询 + component: './capital/Maintenance/StockQuery' + }, + { + path: '/ams/maintenance/standard/config/:disabled?', // 运维物品标准查询 + component: './capital/StandardMange' + }, + { path: '/ams/standardMange/receive/rules/goods/:id?/:name?', // 按物品领用规则 component: './capital/ReceiveRules/subPages/GoodsDimension' }, { - path: '/ams/standardMange/auth/goods/:id?', // 按物品授权分页列表 + path: '/ams/standardMange/auth/goods/:id?/:disabled?', // 按物品授权分页列表 component: './capital/ReceiveRules/subPages/GoodsDimension/components/PageAuthEdit' }, { diff --git a/src/pages/attendance/FieldService/subpages/WorkAddress/components/TravelAddressModal.tsx b/src/pages/attendance/FieldService/subpages/WorkAddress/components/TravelAddressModal.tsx index 44446bb..87d68ed 100644 --- a/src/pages/attendance/FieldService/subpages/WorkAddress/components/TravelAddressModal.tsx +++ b/src/pages/attendance/FieldService/subpages/WorkAddress/components/TravelAddressModal.tsx @@ -46,6 +46,9 @@ export default function ModalIndex(props: Props) { if ((current.maxStayMinute || 0) >= 60) { maxStayMinute = (current.maxStayMinute || 0) % 60; maxStayHour = Math.floor((current.maxStayMinute || 0) / 60) + } else { + maxStayMinute = (current.maxStayMinute || 0) + maxStayHour = 0 } let feildsValue: any = { ...current, @@ -87,7 +90,7 @@ export default function ModalIndex(props: Props) { // return; // } // } - const maxStayMinute = params.maxStayMinute + params.maxStayHour * 60; + const maxStayMinute = (params.maxStayMinute || 0)+ (params.maxStayHour || 0) * 60; setLoading(true); let _param = { ...params, diff --git a/src/pages/capital/Maintenance/StockQuery/api.ts b/src/pages/capital/Maintenance/StockQuery/api.ts new file mode 100644 index 0000000..753a157 --- /dev/null +++ b/src/pages/capital/Maintenance/StockQuery/api.ts @@ -0,0 +1,59 @@ +import request from '@/utils/request'; +import { AMS_HOST } from '@/utils/host'; +import { http } from '@/typing/http'; + +export interface ListParams { + /**是否代管物品 1代管 0被领用 */ + agent?: boolean; + /**资产类型 1固定资产 2低质品 3易耗品 */ + type?: number; + /**关键字 */ + keywords?: string; + /**库存来源类型 1.资产 2.配件 3.市场物料 */ + sourceType?: number; + /**状态 1正常2已报废3已变卖 */ + status?: number; + /**是否维修中 0正常1处理中 */ + repair?: boolean; + /**是否报废中 0正常1处理中 */ + scrap?: boolean; + /**是否变卖中 0正常1处理中 */ + sell?: boolean; + /**是否调拨中 0正常1处理中 */ + allocate?: boolean; + /**是否退回中 0正常1处理中 */ + transfer?: boolean; + /**管理人员姓名 + 216 */ + staffName?: string; + /** 物品唯一标识 */ + uniqueCode?: string; + pageSize?: number; + current?: number; +} +export interface ListItems { + poolId: number; + fids: string; + name: string; + type: number; + standardId: number; + code: string; + uniqueCode: string; + unit: string; + specList: StanderList.AuthSpecList, + assetShopId: number; + assetShopName: string; + useShopId: number; + useShopName: string; + storageTime: number; + receiveTime: number; + storageNum: number; + staffId: number; + staffName: string; + manager: string; + unitPrice: number; +} + +export function getDateApi(params: ListParams): http.PromisePageResp { + return request.get(`${AMS_HOST}/erp/operations/inventory/pool/page`, { params }); +} diff --git a/src/pages/capital/Maintenance/StockQuery/components/Filter.tsx b/src/pages/capital/Maintenance/StockQuery/components/Filter.tsx new file mode 100644 index 0000000..4612886 --- /dev/null +++ b/src/pages/capital/Maintenance/StockQuery/components/Filter.tsx @@ -0,0 +1,120 @@ +import React from 'react'; +import { Input, Radio, Row, Select } from 'antd'; +import { debounce } from 'lodash'; +import useInitail from '@/hooks/useInitail'; +import { getShopApi } from '@/common/api'; + +const Option = Select.Option; +interface Props { + setParams: Function; + innerParams: AmsSpec.ListParams; +} +export default function SeriesFilter({ setParams, innerParams }: Props) { + const { data: shopList } = useInitail, CommonApi.ShopParam>(getShopApi, [], {}); + + const fetchListByName = debounce(value => { + setParams({ ...value, current: 1 }, true); + }, 500); + + const onSearch = (value: object) => setParams({ ...value, current: 1 }, true); + return ( +
+ + fetchListByName({ keywords: e.target.value })} + onSearch={v => setParams({ keywords: v }, true)} + placeholder="物品名称/编码" + /> + {/* fetchListByName({ uniqueCode: e.target.value })} + onSearch={v => setParams({ uniqueCode: v }, true)} + placeholder="物品唯一标识" + /> */} + fetchListByName({ staffName: e.target.value })} + onSearch={v => setParams({ staffName: v }, true)} + placeholder="管理人员姓名" + /> + + + + + + + + {/* */} + + + + + + + + + + +
+ ); +} \ No newline at end of file diff --git a/src/pages/capital/Maintenance/StockQuery/index.tsx b/src/pages/capital/Maintenance/StockQuery/index.tsx new file mode 100644 index 0000000..1aa88b4 --- /dev/null +++ b/src/pages/capital/Maintenance/StockQuery/index.tsx @@ -0,0 +1,55 @@ +import React from 'react'; +import { PageHeaderWrapper } from '@ant-design/pro-layout'; +import { Card, Table } from 'antd'; +import * as api from './api'; +import Column from 'antd/lib/table/Column'; +import Filter from './components/Filter'; +import moment from 'moment'; +import usePagination from '@/hooks/usePagination'; +import RenderGoodsSpec from '@/pages/capital/components/RenderGoodsSpec'; +import { AssetTypeEnum } from '@/pages/capital/entity'; + +export default function SpecConfig() { + const { list, loading, paginationConfig, setParams, innerParams, setLoading } = usePagination(api.getDateApi, { status: 1 }); + + return ( + + + + + + + + } + /> + ( + {AssetTypeEnum[value]} + )} + /> + + + (t ? "是" : "否")} /> + `${t || 0}${record.unit}`} /> + + t && moment(t).format("YYYY-MM-DD hh:mm") || '--'} /> + t && moment(t).format("YYYY-MM-DD hh:mm") || '--'} /> + {/* */} +
+
+
+ ); +} \ No newline at end of file diff --git a/src/pages/capital/ReceiveRules/subPages/GoodsDimension/components/PageAuthEdit/index.tsx b/src/pages/capital/ReceiveRules/subPages/GoodsDimension/components/PageAuthEdit/index.tsx index 416400d..957b68e 100644 --- a/src/pages/capital/ReceiveRules/subPages/GoodsDimension/components/PageAuthEdit/index.tsx +++ b/src/pages/capital/ReceiveRules/subPages/GoodsDimension/components/PageAuthEdit/index.tsx @@ -18,7 +18,7 @@ interface Props { export default function SpecConfig(props: Props) { const { match } = props; - const { id } = match.params; + const { id, disabled } = match.params; const { list, loading, setLoading, paginationConfig, innerParams, setParams } = usePagination(getGoodsAuthDetail, { standardId: id }); const [confirLoaing, setConfirLoading] = useState(false); const [modalPa, setModalPa] = useState({ visible: false, rowValue: undefined }); @@ -82,7 +82,7 @@ export default function SpecConfig(props: Props) { /> - + {!disabled && ()} { - return ( + return !disabled ? ( <> - ); + ) : null; }} />
diff --git a/src/pages/capital/ReceiveRules/subPages/GoodsDimension/index.tsx b/src/pages/capital/ReceiveRules/subPages/GoodsDimension/index.tsx index df132af..6fb5fa9 100644 --- a/src/pages/capital/ReceiveRules/subPages/GoodsDimension/index.tsx +++ b/src/pages/capital/ReceiveRules/subPages/GoodsDimension/index.tsx @@ -53,9 +53,10 @@ export default function Index(props: Props) { ) : ( - - - + // + // + // + null )} diff --git a/src/pages/capital/StandardMange/components/Add/index.tsx b/src/pages/capital/StandardMange/components/Add/index.tsx index a0891f8..92484ba 100644 --- a/src/pages/capital/StandardMange/components/Add/index.tsx +++ b/src/pages/capital/StandardMange/components/Add/index.tsx @@ -17,10 +17,13 @@ const Option = Select.Option; const RadioGroup = Radio.Group; export default function AddItem() { - const { typeName, data = [], currentItem = {}, unitItem, setBreadcrumbs, setLoading, setCurrentBreadcrumb, setIsPart } = useStore() + const { typeName, data = [], currentItem = {}, unitItem, setBreadcrumbs, setLoading, setCurrentBreadcrumb, setIsPart, editDisabled } = useStore(); const [saveConfig, setSaveConfig] = useState(false); const [nameId, setNameId] = useState(); const [visible, setVisible] = useState(false); + const [partValue, setPartValue] = useState<{ + partId?: number, partCode?: string, + }>({}); const [form] = Form.useForm(); useEffect(() => { @@ -33,11 +36,13 @@ export default function AddItem() { part: Number(currentItem.part) || 0, purchaseChannelList: currentItem.purchaseChannelList && JSON.stringify(currentItem) != '{}' ? currentItem.purchaseChannelList.map(i => ({ value: i.subjectId, label: i.subjectName })) : undefined, }); + currentItem.partCode && setPartValue({ partCode: currentItem.partCode, partId: currentItem.partId }); }, []); function save(feildValue: any) { const params = { ...feildValue, + ...partValue, id: currentItem.id, name: currentItem.name || feildValue.name.label || feildValue.name, nameId: currentItem.nameId || feildValue.name.value || nameId, @@ -49,6 +54,7 @@ export default function AddItem() { api.saveForm(params).then(res => { setSaveConfig(false); setNameId(undefined); + setPartValue({}); if (res.data && !currentItem.id) { Modal.confirm({ title: '保存成功', @@ -57,7 +63,7 @@ export default function AddItem() { okText: '去授权', cancelText: '返回', onOk() { - history.push(`/ams/standardMange/receive/rules/goods/${res.data}/${params.name}`); + history.push(`/ams/standardMange/receive/rules/goods/${res.data}/name`); }, onCancel() { setLoading(true); @@ -104,7 +110,8 @@ export default function AddItem() { }).catch(e => { message.error(e.message); }); - form.setFieldsValue({ name: item.partName, specList: spec, type: 2 }); + setPartValue({ partCode: item.partCode, partId: item.id }); + form.setFieldsValue({ name: item.partName, partCode: item.partCode, partId: item.id, specList: spec, type: 2 }); } return ( @@ -112,7 +119,7 @@ export default function AddItem() {

1.基本信息

- { changeSpc(e.target.value); }}> + { changeSpc(e.target.value); }}> @@ -147,6 +154,7 @@ export default function AddItem() { labelInValue optionFilterProp="children" showSearch + disabled={!!editDisabled} > {unitItem.map((i: StanderList.UnitItem) => ( @@ -154,19 +162,19 @@ export default function AddItem() { - + prevValues.type != currentValues.type}> {({ getFieldValue }): any => { return getFieldValue("type") === 1 ? ( - + ) : null; }} - +

2.规格型号

@@ -180,7 +188,7 @@ export default function AddItem() { noStyle rules={[{ required: true, message: '最大采购金额(单个物品)' }]} > - + @@ -188,16 +196,16 @@ export default function AddItem() { {({ getFieldValue }): any => { return getFieldValue("type") === 3 ? ( - + ) : null; }} - + - {(data || []).map((i: any) => ( ))} @@ -205,7 +213,7 @@ export default function AddItem() {

4.领用条件

- @@ -215,15 +223,15 @@ export default function AddItem() { {({ getFieldValue }): any => { const premise = getFieldValue("premise"); return premise ? ( - - + + ) : null; }} - + { - console.log("handleMenuClick", e.key); switch (e.key) { case '1': history.push("/ams/standardMange/receive/rules/goods"); @@ -68,8 +68,9 @@ export default function List() { }; const clickToAuth = (item: StanderList.ListVO) => { - history.push(`/ams/standardMange/auth/goods/${item.id}`); + history.push(`/ams/standardMange/auth/goods/${item.id}/${editDisabled || ''}`); }; + return ( @@ -85,29 +86,35 @@ export default function List() { 禁用 - _onChangeType({ type: e })} placeholder="请选择类型"> {typeName.map(i => ( ))} + _onChange(e.target.value)} /> -
- - } - > - - - -
+ {!editDisabled && ( +
+ + } + > + + + +
+ )}
changeSwich(value)} /> )} @@ -166,7 +174,7 @@ export default function List() { align="center" render={(record: StanderList.ListVO) => ( <> - + diff --git a/src/pages/capital/StandardMange/index.tsx b/src/pages/capital/StandardMange/index.tsx index 3698bc2..f0c7bc5 100644 --- a/src/pages/capital/StandardMange/index.tsx +++ b/src/pages/capital/StandardMange/index.tsx @@ -8,9 +8,15 @@ import AddItem from './components/Add'; export const { Provider, useStore } = createStore(store); -function EditMange() { +function EditMange(props: any) { + const { match } = props; + const { disabled } = match.params; const [IndexDOM, setIndexDOM] = useState(); - const { setLoading, currentItem, breadcrumbs, currentBreadcrumb, setCurrentItem, setBreadcrumbs, setCurrentBreadcrumb } = useStore(); + const { setLoading, currentItem, breadcrumbs, currentBreadcrumb, setCurrentItem, setBreadcrumbs, setEditDisabled, setCurrentBreadcrumb } = useStore(); + + useEffect(() => { + setEditDisabled(!!disabled); + }, [disabled]); useEffect(() => { switch (currentBreadcrumb.key) { @@ -49,4 +55,4 @@ function EditMange() { ); } -export default () => ; \ No newline at end of file +export default (props: any) => ; \ No newline at end of file diff --git a/src/pages/capital/StandardMange/interface.d.ts b/src/pages/capital/StandardMange/interface.d.ts index 295f168..4b31580 100644 --- a/src/pages/capital/StandardMange/interface.d.ts +++ b/src/pages/capital/StandardMange/interface.d.ts @@ -6,6 +6,8 @@ declare namespace StanderList { type?: number, //物品类型 1固定资产2低值品3易耗品 name?: string, //物品名称 nameId?: number, + partCode?: string, + partId?: number, unit?: number, //单位 1个2只3把4枚5台6包7车8瓶9壶10套11张12打13担 unitName?: string, spec?: string, //型号规格 diff --git a/src/pages/capital/StandardMange/store.ts b/src/pages/capital/StandardMange/store.ts index f2562d4..37306f5 100644 --- a/src/pages/capital/StandardMange/store.ts +++ b/src/pages/capital/StandardMange/store.ts @@ -22,6 +22,8 @@ export default function useStore() { const { list: postList, loading: postLoading } = usePagination(api.getPostList, {}); const { list, setParams, paginationConfig, innerParams, loading, setLoading } = usePagination(api.getListApi, { status: 1 }); const [isPart, setIsPart] = useState(false); + /**是否可编辑 */ + const [editDisabled, setEditDisabled] = useState(false); const typeName = [ { name: '固定资产', type: 1 }, @@ -60,6 +62,8 @@ export default function useStore() { setLoading, isPart, setIsPart, - MenuItems + MenuItems, + editDisabled, + setEditDisabled }; } \ No newline at end of file diff --git a/src/pages/capital/components/RenderGoodsSpec.tsx b/src/pages/capital/components/RenderGoodsSpec.tsx index f17681c..98b57f1 100644 --- a/src/pages/capital/components/RenderGoodsSpec.tsx +++ b/src/pages/capital/components/RenderGoodsSpec.tsx @@ -1,25 +1,67 @@ -import React from 'react'; -import { Popover } from 'antd'; +import React, { useCallback, useState } from 'react'; +import { Button, Modal, Popover, Table } from 'antd'; interface Props { specList: StanderList.AuthSpecList[] } export default function RenderGoodsSpec({ specList }: Props) { + const [visible, setVisible] = useState(false); const items = (specList || []).map(i => `${i.standardSpecName}:${i.specDetails}`); + const RenderSpecModal = useCallback(() => (visible ? ( + setVisible(false)} + items={specList} + /> + ) : null), [visible]); return ( - {items.join(';')}} - > -
- {items.slice(0, 3).map((i: string) => { - return ( -

{i}

- ); - })} - {items.length > 3 ? (...) : null} -
-
+ <> + {items.join(';')}} + > +
+ {items.slice(0, 3).map((i: string) => { + return ( +

{i}

+ ); + })} + {items.length > 3 ? (...) : null} +
+ +
+ {RenderSpecModal()} + + ); +} + +function SpecModal({ items, onCancel, visible }: any) { + const columns = [ + { + title: '规格名称', + dataIndex: 'standardSpecName', + }, + { + title: '规格内容', + dataIndex: 'specDetails', + }, + { + title: '排序', + dataIndex: 'sort', + }, + ]; + + return ( + +
+ ); } \ No newline at end of file diff --git a/src/pages/order3/RetailTask/api.ts b/src/pages/order3/RetailTask/api.ts index 2a384c3..043af70 100644 --- a/src/pages/order3/RetailTask/api.ts +++ b/src/pages/order3/RetailTask/api.ts @@ -18,6 +18,7 @@ export interface ShopTaskList { clueDealTaskCount?: number // 线索到店零售数量 clueDealTaskRate?: number // 线索到店零售占比 staffTaskList?: StaffTaskList[]//员工任务列表 + addedValueTask?: number } interface StaffTaskList { @@ -26,6 +27,7 @@ interface StaffTaskList { taskCount?: number//任务数量 clueDealTaskCount?: number // 线索到店零售数量 regularMonth?: number//转正几个月 + addedValueTask?: number } export interface saveParams { id?: number, diff --git a/src/pages/pms/entity.ts b/src/pages/pms/entity.ts index 7297756..1342f8a 100644 --- a/src/pages/pms/entity.ts +++ b/src/pages/pms/entity.ts @@ -190,12 +190,12 @@ export const planPoolTypeData = [ export const typeReceiverObj: {[key: string]: string} = { '售后工单锁定': '服务', '装潢零售锁定': '销售', - '调件锁定': '', + '调出锁定': '', '': '', }; export const typeSenderObj: {[key: string]: string} = { - '售后工单锁定': '送修人', - '装潢零售锁定': '下单人', - '调件锁定': '', + '售后工单锁定': '送修人:', + '装潢零售锁定': '下单人:', + '调出锁定': '', '': '', }; diff --git a/src/pages/pms/part/Repertory/components/EPCModal.tsx b/src/pages/pms/part/Repertory/components/EPCModal.tsx index 98119bb..89d8d26 100644 --- a/src/pages/pms/part/Repertory/components/EPCModal.tsx +++ b/src/pages/pms/part/Repertory/components/EPCModal.tsx @@ -4,7 +4,6 @@ import { useStore } from '../index'; import usePagination from '@/hooks/usePagination'; import { getEpcdetailApi, deleteApi } from '../api'; import AddepcModal from './AddepcModal'; -import debounce from 'lodash/debounce'; const { Column } = Table; @@ -14,9 +13,9 @@ export default function FactoryEpcDetailModal() { const [addVisible, setAddVisible] = useState(false); const { list, loading, setLoading, setParams, paginationConfig } = usePagination(getEpcdetailApi, { partCode: currentItem.partCode }, { delay }); - const _onChange = debounce((param: string) => { + const _onChange = (param: string) => { setParams({ partCode: currentItem.partCode, current: 1, keywords: param }, true); - }, 500); + }; useEffect(() => { if (currentItem.partCode) { @@ -81,7 +80,8 @@ export default function FactoryEpcDetailModal() { placeholder="搜索车型代码" allowClear style={{ width: 200 }} - onChange={(e) => _onChange(e.target.value)} + onSearch={v => _onChange(v)} + enterButton /> diff --git a/src/pages/pms/part/Repertory/components/SpecEpcModal.tsx b/src/pages/pms/part/Repertory/components/SpecEpcModal.tsx index 160bd67..0ddf52b 100644 --- a/src/pages/pms/part/Repertory/components/SpecEpcModal.tsx +++ b/src/pages/pms/part/Repertory/components/SpecEpcModal.tsx @@ -79,11 +79,11 @@ export default function specEcpModal() {
_onChange(v)} - onChange={e => _onChange(e.target.value)} + enterButton />
diff --git a/src/pages/pms/partPlan/PlanPool/api.ts b/src/pages/pms/partPlan/PlanPool/api.ts index 4cf9915..13c5587 100644 --- a/src/pages/pms/partPlan/PlanPool/api.ts +++ b/src/pages/pms/partPlan/PlanPool/api.ts @@ -13,6 +13,7 @@ export interface Params { storageId?: number; // Form isOil?: boolean; keywords?: string + poolType?:number } export interface ListVO { @@ -40,6 +41,8 @@ export interface ListVO { unit?: string; // 采购规格(配件展示) splitUnit?: string; // 拆分件规格(配件展示) splitCnt?: number; // 拆分件数量(配件展示) + typeName?:string + partType?:number } /** diff --git a/src/pages/pms/partPlan/PlanPool/components/Filter.tsx b/src/pages/pms/partPlan/PlanPool/components/Filter.tsx index ed11695..0c86726 100644 --- a/src/pages/pms/partPlan/PlanPool/components/Filter.tsx +++ b/src/pages/pms/partPlan/PlanPool/components/Filter.tsx @@ -7,7 +7,6 @@ import usePagination from "@/hooks/usePagination"; import {getStoragePage} from "@/pages/pms/storage/StorageManage/api"; import useInitail from "@/hooks/useInitail"; import * as api from "@/pages/pms/storage/partShop/api"; -import {getPartTypeApi} from '@/pages/pms/part/Repertory/api'; import PmsSelect from '@/pages/pms/comonents/PmsSelect'; const { Search } = Input; @@ -15,8 +14,7 @@ const { Search } = Input; export default function Filter() { const { list: storages } = usePagination(getStoragePage, {pageSize: 1000}); const { data: shops } = useInitail(api.getShopApi, [], {}); - const { dfParams, setDfParams } = useStore(); - const { data: partTypeData } = useInitail(getPartTypeApi, [], {}); + const { dfParams, setDfParams, partTypeData } = useStore(); const handleChangeKeywords = debounce((value: string) => { setDfParams({ ...dfParams, current: 1, keywords: value }); diff --git a/src/pages/pms/partPlan/PlanPool/components/PartTable.tsx b/src/pages/pms/partPlan/PlanPool/components/PartTable.tsx index bb40f57..71b3bff 100644 --- a/src/pages/pms/partPlan/PlanPool/components/PartTable.tsx +++ b/src/pages/pms/partPlan/PlanPool/components/PartTable.tsx @@ -16,7 +16,7 @@ interface Props { id?: number, // 上一个列表ID } export default function Index(props: Props = {}) { - const { dfParams, key } = useStore(); + const { dfParams, key, partTypeData } = useStore(); const {showAnalyse=true} = props; const { data: parts, setParams } = useInitial(getList, [], {...dfParams, ...props}); const [visible, setVisible] = useState(false); @@ -35,6 +35,8 @@ export default function Index(props: Props = {}) {
`${v.id}`} scroll={{y: 500, x: 2000}} dataSource={parts || []} pagination={false}> + + partTypeData.find(i => i.value == t)?.label} /> @@ -82,8 +84,6 @@ export default function Index(props: Props = {}) { )} /> - - )}
diff --git a/src/pages/pms/partPlan/PlanPool/components/StoragePartTable.tsx b/src/pages/pms/partPlan/PlanPool/components/StoragePartTable.tsx index 18460d3..4a375d5 100644 --- a/src/pages/pms/partPlan/PlanPool/components/StoragePartTable.tsx +++ b/src/pages/pms/partPlan/PlanPool/components/StoragePartTable.tsx @@ -12,7 +12,7 @@ interface Props { type?: number, // 类型1区域库2库房3车系4车型5配件 } export default function Index(props: Props = {}) { - const { dfParams, key } = useStore(); + const { dfParams, key, partTypeData } = useStore(); const [form] = Form.useForm(); const { data: parts, setParams } = useInitial(getList, [], dfParams); const [visible, setVisible] = useState(false); @@ -40,6 +40,7 @@ export default function Index(props: Props = {}) { + partTypeData.find(i => i.value == t)?.label} /> t || '--'} /> diff --git a/src/pages/pms/partPlan/PlanPool/useStore.ts b/src/pages/pms/partPlan/PlanPool/useStore.ts index cc2ea81..cdce14f 100644 --- a/src/pages/pms/partPlan/PlanPool/useStore.ts +++ b/src/pages/pms/partPlan/PlanPool/useStore.ts @@ -1,12 +1,17 @@ import { useState } from 'react'; +import useInitail from "@/hooks/useInitail"; +import { getPartTypeApi } from '@/pages/pms/part/Repertory/api'; export default function useStore() { const [dfParams, setDfParams] = useState({}); const [key, setKey] = useState('1'); + const { data: partTypeData } = useInitail(getPartTypeApi, [], {}); + return { dfParams, setDfParams, key, - setKey + setKey, + partTypeData }; } diff --git a/src/pages/pms/purchase/PurchaseRecord/comonents/AddPurchaseModal.tsx b/src/pages/pms/purchase/PurchaseRecord/comonents/AddPurchaseModal.tsx index f53ac8e..7fb419e 100644 --- a/src/pages/pms/purchase/PurchaseRecord/comonents/AddPurchaseModal.tsx +++ b/src/pages/pms/purchase/PurchaseRecord/comonents/AddPurchaseModal.tsx @@ -10,6 +10,9 @@ import {purchaseApply, getrelationlist, EditItem} from '../api'; import {getList, ListVO, Params} from '@/pages/pms/partPlan/PlanPool/api'; import _ from 'lodash'; import useInitial from '@/hooks/useInitail'; +import PmsSelect from '@/pages/pms/comonents/PmsSelect'; +import { getPartTypeApi } from '@/pages/pms/part/Repertory/api'; +import {planPoolTypeData} from '@/pages/pms/entity'; const Option = Select.Option; const {Item} = Form; @@ -33,7 +36,8 @@ export default function PartStorageModal({ onCancel, visible, itemData, setItemD const {data: planeData, setParams, setData: setPlaneData} = useInitial(getList, [], {}, delay); const {data: casData, setParams: casSetParams, setData: casSetData} = useInitial(getPurchasePool, [], {}, delay); const [planePart, setPlanePart] = useState([]); - + const { data: partTypeData } = useInitial(getPartTypeApi, [], {}); + const [choosePartVisable, setChoosePartVisable] = useState(false); const [selectedParts, setSelectedParts] = useState([]); const [form] = Form.useForm(); @@ -259,7 +263,23 @@ export default function PartStorageModal({ onCancel, visible, itemData, setItemD allowClear placeholder="请输入配件名称/编码" onChange={e => setParams({keywords: e.target.value}, true)} - style={{ width: 240 }} + style={{ width: 210 }} + /> + { + setParams({poolType: v}, true); + }} + placeholder="请选择来源类型" + options={planPoolTypeData.map(i => ({value: i.value, label: i.label}))} + /> + setParams({partType: v}, true)} + placeholder="请选择配件类型" + options={partTypeData.map(i => ({value: i.value, label: i.label}))} /> + + partTypeData.find(i => i.value == t)?.label} /> _.ceil((r.cnt * r.price), 2)} /> diff --git a/src/pages/pms/storage/partShop/components/LockDetailModal.tsx b/src/pages/pms/storage/partShop/components/LockDetailModal.tsx index ce6a63b..9418bb0 100644 --- a/src/pages/pms/storage/partShop/components/LockDetailModal.tsx +++ b/src/pages/pms/storage/partShop/components/LockDetailModal.tsx @@ -60,7 +60,7 @@ export default function Index({ item = {}, visible, onCancel }: Props) {
{`锁定库存数: ${it.lockCnt || 0}件`}
{`锁库天数: ${(it.days || 0).toFixed(0)}天`}
{!!obj.receiverName &&
{`${typeReceiverObj[it.type || '']}顾问: ${obj.receiverName}`}
} - {!!obj.senderName &&
{`${typeSenderObj[it.type || '']}: ${obj.senderName}`}
} + {!!obj.senderName && !!typeSenderObj[it.type || ''] &&
{`${typeSenderObj[it.type || '']}${obj.senderName}`}
} {!!obj.ownerName &&
{`车主: ${obj.ownerName}`}
} {!!obj.senderTime &&
{`进站时间: ${moment(obj.senderTime).format('YYYY-MM-DD HH:mm')}`}
} {!!obj.plateNo &&
{`车牌号: ${obj.plateNo}`}
}