Commit c8e9f24849a0da5f38ac3fa5e474c735b316a3f1
1 parent
aa8f3ce6
配件外采申请增加是否推送外勤
Showing
2 changed files
with
16 additions
and
6 deletions
src/pages/pms/purchase/PurchaseRecord/api.ts
@@ -105,6 +105,7 @@ export interface ApplyParams{ | @@ -105,6 +105,7 @@ export interface ApplyParams{ | ||
105 | payType?: string, | 105 | payType?: string, |
106 | accountCheckPeriod?:number | 106 | accountCheckPeriod?:number |
107 | parts?: any[] | 107 | parts?: any[] |
108 | + isOutSide?: boolean | ||
108 | } | 109 | } |
109 | interface relationParams{ | 110 | interface relationParams{ |
110 | tradeCompanyId?: number, | 111 | tradeCompanyId?: number, |
@@ -158,6 +159,7 @@ export interface EditItem{ | @@ -158,6 +159,7 @@ export interface EditItem{ | ||
158 | parts?:partItem[] | 159 | parts?:partItem[] |
159 | poolParts?: poolPart[] | 160 | poolParts?: poolPart[] |
160 | planParts?: planePartItem[] | 161 | planParts?: planePartItem[] |
162 | + isOutSide?: boolean | ||
161 | } | 163 | } |
162 | interface poolPart{ | 164 | interface poolPart{ |
163 | id: string// 类型id(vin) | 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,7 +57,8 @@ export default function PartStorageModal({ onCancel, visible, itemData, setItemD | ||
57 | storageId: itemData.storageId, | 57 | storageId: itemData.storageId, |
58 | supplierId: itemData.supplierId, | 58 | supplierId: itemData.supplierId, |
59 | settlementMethod: itemData.payType, | 59 | settlementMethod: itemData.payType, |
60 | - proportion: itemData.proportion | 60 | + proportion: itemData.proportion, |
61 | + isOutSide: itemData.isOutSide ? "1" : "0" | ||
61 | }); | 62 | }); |
62 | getrelationlist({tradeCompanyId: itemData.supplierId, compCategory: 1, dealerId: storages.find(i => i.id == itemData.storageId)?.dealerId}).then(res => { | 63 | getrelationlist({tradeCompanyId: itemData.supplierId, compCategory: 1, dealerId: storages.find(i => i.id == itemData.storageId)?.dealerId}).then(res => { |
63 | if (res.success) { | 64 | if (res.success) { |
@@ -98,8 +99,6 @@ export default function PartStorageModal({ onCancel, visible, itemData, setItemD | @@ -98,8 +99,6 @@ export default function PartStorageModal({ onCancel, visible, itemData, setItemD | ||
98 | form.validateFields().then(fields => { | 99 | form.validateFields().then(fields => { |
99 | const supplier = suppliers.find(it => it.supplierId == fields.supplierId) || {}; | 100 | const supplier = suppliers.find(it => it.supplierId == fields.supplierId) || {}; |
100 | const storage = storages.find(it => it.id == fields.storageId) || {}; | 101 | const storage = storages.find(it => it.id == fields.storageId) || {}; |
101 | - | ||
102 | - setBtnloading(true); | ||
103 | const params = { | 102 | const params = { |
104 | storageId: storage.id, | 103 | storageId: storage.id, |
105 | storageName: storage.storageName, | 104 | storageName: storage.storageName, |
@@ -111,8 +110,10 @@ export default function PartStorageModal({ onCancel, visible, itemData, setItemD | @@ -111,8 +110,10 @@ export default function PartStorageModal({ onCancel, visible, itemData, setItemD | ||
111 | parts: [...selectedParts.map(i => ({partId: i.partId, partCnt: i.partCnt, price: i.price, type: 1})), | 110 | parts: [...selectedParts.map(i => ({partId: i.partId, partCnt: i.partCnt, price: i.price, type: 1})), |
112 | ...planePart.map(i => ({poolId: i.poolId, partId: i.partId, partCnt: i.cnt, price: i.price, type: 2})), | 111 | ...planePart.map(i => ({poolId: i.poolId, partId: i.partId, partCnt: i.cnt, price: i.price, type: 2})), |
113 | ...(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() || []) | 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 | purchaseApply(params).then(res => { | 117 | purchaseApply(params).then(res => { |
117 | message.success("提交成功"); | 118 | message.success("提交成功"); |
118 | setBtnloading(false); | 119 | setBtnloading(false); |
@@ -189,8 +190,6 @@ export default function PartStorageModal({ onCancel, visible, itemData, setItemD | @@ -189,8 +190,6 @@ export default function PartStorageModal({ onCancel, visible, itemData, setItemD | ||
189 | if (res.data?.length) { | 190 | if (res.data?.length) { |
190 | form.setFieldsValue({ proportion: res.data[0].billAmountRatio, accountCheckPeriod: res.data && res.data[0].accountCheckPeriod}); | 191 | form.setFieldsValue({ proportion: res.data[0].billAmountRatio, accountCheckPeriod: res.data && res.data[0].accountCheckPeriod}); |
191 | setListRelation(res.data && res.data[0].settleMethodList); | 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 | }).catch(e => message.error(e.message)); | 194 | }).catch(e => message.error(e.message)); |
196 | }} | 195 | }} |
@@ -230,6 +229,15 @@ export default function PartStorageModal({ onCancel, visible, itemData, setItemD | @@ -230,6 +229,15 @@ export default function PartStorageModal({ onCancel, visible, itemData, setItemD | ||
230 | <Item label="发票金额要求比例" name="proportion"> | 229 | <Item label="发票金额要求比例" name="proportion"> |
231 | <Input style={{ width: 250 }} disabled addonAfter="%" /> | 230 | <Input style={{ width: 250 }} disabled addonAfter="%" /> |
232 | </Item> | 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 | </Form> | 241 | </Form> |
234 | <Tabs animated> | 242 | <Tabs animated> |
235 | <TabPane tab="配件" key="1"> | 243 | <TabPane tab="配件" key="1"> |