Commit c8e9f24849a0da5f38ac3fa5e474c735b316a3f1

Authored by jiangwei
1 parent aa8f3ce6

配件外采申请增加是否推送外勤

src/pages/pms/purchase/PurchaseRecord/api.ts
... ... @@ -105,6 +105,7 @@ export interface ApplyParams{
105 105 payType?: string,
106 106 accountCheckPeriod?:number
107 107 parts?: any[]
  108 + isOutSide?: boolean
108 109 }
109 110 interface relationParams{
110 111 tradeCompanyId?: number,
... ... @@ -158,6 +159,7 @@ export interface EditItem{
158 159 parts?:partItem[]
159 160 poolParts?: poolPart[]
160 161 planParts?: planePartItem[]
  162 + isOutSide?: boolean
161 163 }
162 164 interface poolPart{
163 165 id: string// 类型id(vin)
... ...
src/pages/pms/purchase/PurchaseRecord/comonents/AddPurchaseModal.tsx
... ... @@ -57,7 +57,8 @@ export default function PartStorageModal({ onCancel, visible, itemData, setItemD
57 57 storageId: itemData.storageId,
58 58 supplierId: itemData.supplierId,
59 59 settlementMethod: itemData.payType,
60   - proportion: itemData.proportion
  60 + proportion: itemData.proportion,
  61 + isOutSide: itemData.isOutSide ? "1" : "0"
61 62 });
62 63 getrelationlist({tradeCompanyId: itemData.supplierId, compCategory: 1, dealerId: storages.find(i => i.id == itemData.storageId)?.dealerId}).then(res => {
63 64 if (res.success) {
... ... @@ -98,8 +99,6 @@ export default function PartStorageModal({ onCancel, visible, itemData, setItemD
98 99 form.validateFields().then(fields => {
99 100 const supplier = suppliers.find(it => it.supplierId == fields.supplierId) || {};
100 101 const storage = storages.find(it => it.id == fields.storageId) || {};
101   -
102   - setBtnloading(true);
103 102 const params = {
104 103 storageId: storage.id,
105 104 storageName: storage.storageName,
... ... @@ -111,8 +110,10 @@ export default function PartStorageModal({ onCancel, visible, itemData, setItemD
111 110 parts: [...selectedParts.map(i => ({partId: i.partId, partCnt: i.partCnt, price: i.price, type: 1})),
112 111 ...planePart.map(i => ({poolId: i.poolId, partId: i.partId, partCnt: i.cnt, price: i.price, type: 2})),
113 112 ...(casPart?.map(i => (i.details?.map(it => ({partId: it.partId, partCnt: it.partCnt, poolId: it.poolId, expectInTime: it.expectInTime, price: it.price, type: 3})))).flat() || [])
114   - ]
  113 + ],
  114 + isOutSide: !!fields.isOutSide
115 115 };
  116 + setBtnloading(true);
116 117 purchaseApply(params).then(res => {
117 118 message.success("提交成功");
118 119 setBtnloading(false);
... ... @@ -189,8 +190,6 @@ export default function PartStorageModal({ onCancel, visible, itemData, setItemD
189 190 if (res.data?.length) {
190 191 form.setFieldsValue({ proportion: res.data[0].billAmountRatio, accountCheckPeriod: res.data && res.data[0].accountCheckPeriod});
191 192 setListRelation(res.data && res.data[0].settleMethodList);
192   - } else {
193   - message.error(`请财务先配置${suppliers.find(i => i.supplierId == form.getFieldValue('supplierId'))?.supplierName}的结算方式`);
194 193 }
195 194 }).catch(e => message.error(e.message));
196 195 }}
... ... @@ -230,6 +229,15 @@ export default function PartStorageModal({ onCancel, visible, itemData, setItemD
230 229 <Item label="发票金额要求比例" name="proportion">
231 230 <Input style={{ width: 250 }} disabled addonAfter="%" />
232 231 </Item>
  232 + <Item label="是否推送外勤资格" name="isOutSide">
  233 + <Select
  234 + style={{ width: 250 }}
  235 + defaultValue="0"
  236 + >
  237 + <Option value="1" key="1">是</Option>
  238 + <Option value="0" key="0">否</Option>
  239 + </Select>
  240 + </Item>
233 241 </Form>
234 242 <Tabs animated>
235 243 <TabPane tab="配件" key="1">
... ...