|
|
@@ -1,6 +1,7 @@
|
|
|
import { shallowRef, reactive } from 'vue'
|
|
|
import { useDataTable } from '@/hooks/datatable'
|
|
|
import { getTableColumns } from '@/business/table'
|
|
|
+import { getReceiptTypeName } from '@/constants/receipt'
|
|
|
import { queryMyPerformance, performanceManualConfirm, performanceDelayApply, performanceContractedApply, performanceModifyContact } from '@/services/api/order'
|
|
|
import { sessionData } from '@/stores'
|
|
|
import { BuyOrSell } from '@/constants/order'
|
|
|
@@ -114,12 +115,12 @@ export function usePerformanceDelay(selectedRow: Ermcp.MyPerformancRsp) {
|
|
|
|
|
|
// 履约违约申请
|
|
|
export function usePerformanceContracted(selectedRow: Ermcp.MyPerformancRsp) {
|
|
|
- const { UserID } = sessionData.getValue('loginInfo')
|
|
|
+ const { UserID, AccountIDs } = sessionData.getValue('loginInfo')
|
|
|
const loading = shallowRef(false)
|
|
|
|
|
|
const formData = reactive<Proto.PerformanceContractedApplyReq>({
|
|
|
- PerformancePlanID: Long.fromString(selectedRow.curstepid), // uint64 履约计划ID
|
|
|
- BreachType: 0, // uint32 违约方类型
|
|
|
+ PerformancePlanID: Long.fromString(selectedRow.performanceplanid), // uint64 履约计划ID
|
|
|
+ BreachType: selectedRow.buyaccountid === AccountIDs[0] ? 2 : 1, // uint32 违约方类型
|
|
|
Applicant: UserID, // uint64 违约申请人
|
|
|
})
|
|
|
|
|
|
@@ -138,4 +139,84 @@ export function usePerformanceContracted(selectedRow: Ermcp.MyPerformancRsp) {
|
|
|
formData,
|
|
|
formSubmit
|
|
|
}
|
|
|
+}
|
|
|
+
|
|
|
+// 履约修改联络信息
|
|
|
+export function usePerformanceModify(selectedRow: Ermcp.MyPerformancRsp) {
|
|
|
+ const { AccountIDs } = sessionData.getValue('loginInfo')
|
|
|
+ const loading = shallowRef(false)
|
|
|
+ const formData = reactive<{ address?: Ermcp.UserReceiveInfoRsp, invoice?: Ermcp.WrUserReceiptInfoRsp, contactInfo?: string }>({})
|
|
|
+
|
|
|
+ const formSubmit = () => {
|
|
|
+ loading.value = true
|
|
|
+
|
|
|
+ const jsonParam = {
|
|
|
+ ContactInfo: formData.contactInfo,
|
|
|
+ ReceiveInfo: '',
|
|
|
+ ReceiptInfo: ''
|
|
|
+ }
|
|
|
+
|
|
|
+ if (formData.address) {
|
|
|
+ const { provincename, cityname, districtname, address } = formData.address
|
|
|
+ jsonParam.ReceiveInfo = [provincename, cityname, districtname, address].join(' ')
|
|
|
+ }
|
|
|
+
|
|
|
+ if (formData.invoice) {
|
|
|
+ Object.entries(formData.invoice).forEach(([key, value]) => {
|
|
|
+ if (value !== '') {
|
|
|
+ switch (key) {
|
|
|
+ case 'receipttype': {
|
|
|
+ jsonParam.ReceiptInfo += '发票类型:' + getReceiptTypeName(Number(value)) + '\n'
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'username': {
|
|
|
+ jsonParam.ReceiptInfo += '户名:' + value + '\n'
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'address': {
|
|
|
+ jsonParam.ReceiptInfo += '地址:' + value + '\n'
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'contactinfo': {
|
|
|
+ jsonParam.ReceiptInfo += '联系方式:' + value + '\n'
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'idnum': {
|
|
|
+ jsonParam.ReceiptInfo += '身份证号码:' + value + '\n'
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'receiptaccount': {
|
|
|
+ jsonParam.ReceiptInfo += '发票帐号:' + value + '\n'
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'receiptbank': {
|
|
|
+ jsonParam.ReceiptInfo += '发票开户行:' + value + '\n'
|
|
|
+ break
|
|
|
+ }
|
|
|
+ case 'taxpayerid': {
|
|
|
+ jsonParam.ReceiptInfo += '纳税人识别号:' + value + '\n'
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ return performanceModifyContact({
|
|
|
+ data: {
|
|
|
+ PerformancePlanID: Long.fromString(selectedRow.performanceplanid), // uint64 履约计划ID
|
|
|
+ AccountID: AccountIDs[0], // uint64 账号
|
|
|
+ ContactInfo: JSON.stringify(jsonParam), // string 联络信息
|
|
|
+ },
|
|
|
+ complete: () => {
|
|
|
+ loading.value = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ return {
|
|
|
+ loading,
|
|
|
+ formData,
|
|
|
+ formSubmit
|
|
|
+ }
|
|
|
}
|