diff --git a/src/api/wms/supplierinvoiceRequestMain/index.ts b/src/api/wms/supplierinvoiceRequestMain/index.ts index 4330d5a38..bcb8f218a 100644 --- a/src/api/wms/supplierinvoiceRequestMain/index.ts +++ b/src/api/wms/supplierinvoiceRequestMain/index.ts @@ -30,6 +30,16 @@ export const getSupplierinvoiceRequestMainPage = async (params) => { return await request.get({ url: `/wms/supplierinvoice-request-main/page`, params }) } } +// 查询页查询供应商发票申请主列表 +export const getSupplierinvoiceRequestMainPageAll = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/wms/supplierinvoice-request-main/seniorALL', data }) + } else { + return await request.get({ url: `/wms/supplierinvoice-request-main/pageALL`, params }) + } +} // 查询供应商发票申请主详情 export const getSupplierinvoiceRequestMain = async (id: number) => { @@ -116,7 +126,10 @@ export const printSupplierRecord = async (asnBillNum:string) => { export const printSupplierRecordByMasterId = async (masterId:number) => { return await request.post({ url: `/wms/supplierinvoice-request-main/querySupplierRecordByMasterId?masterId=`+masterId }) } - +// 导出供应商发票明细 +export const exportStatementDetail = async (params) => { + return await request.download({ url: `/wms/supplierinvoice-request-main/export-excel-detail-statement`, params }) +} // 导出供应商发票申请主 Excel export const exportSupplierinvoiceRequestMain = async (data) => { if(data.isSearch){ @@ -126,6 +139,15 @@ export const exportSupplierinvoiceRequestMain = async (data) => { } } +// 查询页导出供应商发票申请主 Excel +export const exportAllSupplierinvoiceRequestMain = async (data) => { + if(data.isSearch){ + return await request.downloadPost({ url: `/wms/supplierinvoice-request-main/export-excel-senior-all`, data }) + }else { + return await request.downloadPost({ url: `/wms/supplierinvoice-request-main/export-excel-all`, data }) + } +} + // 导出供应商发票申请明细 Excel export const exportSupplierinvoiceRequestDetail = async (params) => { return await request.download({ url: `/wms/supplierinvoice-request-main/export-excel-detail`, params }) diff --git a/src/components/BasicForm/index.ts b/src/components/BasicForm/index.ts index 131ef9dc5..184d587b2 100644 --- a/src/components/BasicForm/index.ts +++ b/src/components/BasicForm/index.ts @@ -1,3 +1,4 @@ import BasicForm from './src/BasicForm.vue' +import BasicFormV3 from './src/BasicFormV3.vue' -export { BasicForm } +export { BasicForm,BasicFormV3 } diff --git a/src/components/BasicForm/src/BasicFormV3.vue b/src/components/BasicForm/src/BasicFormV3.vue new file mode 100644 index 000000000..ea5ebfad7 --- /dev/null +++ b/src/components/BasicForm/src/BasicFormV3.vue @@ -0,0 +1,1320 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/SearchTableV3/index.ts b/src/components/SearchTableV3/index.ts new file mode 100644 index 000000000..1c2bc8047 --- /dev/null +++ b/src/components/SearchTableV3/index.ts @@ -0,0 +1,3 @@ +import SearchTableV3 from './src/SearchTable.vue' + +export { SearchTableV3} diff --git a/src/components/SearchTableV3/src/SearchTable.vue b/src/components/SearchTableV3/src/SearchTable.vue new file mode 100644 index 000000000..c51b5d1c6 --- /dev/null +++ b/src/components/SearchTableV3/src/SearchTable.vue @@ -0,0 +1,324 @@ + + + + + + + + + + + + + + + + + + {{ sureText }} + + 取 消 + + + + + + + + \ No newline at end of file diff --git a/src/components/Table/src/TableV2.vue b/src/components/Table/src/TableV2.vue new file mode 100644 index 000000000..de3cb01c1 --- /dev/null +++ b/src/components/Table/src/TableV2.vue @@ -0,0 +1,226 @@ + + + + + + + + + 已选{{ selections.length }}条数据 + + + + + + \ No newline at end of file diff --git a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue index 51f9c6225..b8bec811c 100644 --- a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue +++ b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue @@ -56,10 +56,12 @@ - - + { link: true, // 文本展现按钮 hasPermi: '' } + ,{ + label: t('导出对账单明细'), + name: 'export_statement_detail', + hide: false, + type: 'primary', + color: '', + link: true, // 文本展现按钮 + hasPermi: 'wms:supplierinvoice-request-main:export_statement_detail' + } ] } @@ -916,6 +927,28 @@ const buttonTableClick = async (val, row) => { } else if (val == 'repeal') { // 作废 handleRepeal(row.id) + } else if (val == 'export_statement_detail') { + // 导出对账单明细 + exportStatementDetail(row.id) + } +} +const exportStatementDetail = async (masterId) => { + try { + + // 导出的二次确认 + await message.exportConfirm() + debugger + // 发起导出导出明细 + tableObject.loading = true + let params = { + masterId: masterId + } + const excelTitle = ref(route.meta.title) + const data = await SupplierinvoiceRequestMainApi.exportStatementDetail(params) + download.excel(data, `【${excelTitle.value}明细】【${formatDate(new Date())}】.xlsx`) + } catch { + } finally { + tableObject.loading = false } } // const procurementCreators = ref([]) diff --git a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts index f1aee184e..154913dfc 100644 --- a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts +++ b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts @@ -29,7 +29,7 @@ const requestsettingData = data?.list[0] || {} userDept.id = userDept.id.toString() const userDeptArray:any = [userDept] -// const procurementCreators = await SupplierinvoiceRequestMainApi.queryUserInfoByRoleCode({ roleCode: 'purchase',pageSize: 1000,pageNo: 1,sort: '',by: 'ASC' }) +const procurementCreators = await SupplierinvoiceRequestMainApi.queryUserInfoByRoleCode({ roleCode: 'purchase',pageSize: 1000,pageNo: 1,sort: '',by: 'ASC' }) /** * @returns {Array} 采购员列表 */ @@ -926,9 +926,10 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive( isForm: true, isTable:false, isDetail:false, + isSearch:true, form: { component: 'Select', - // api: () => procurementCreators.list, + api: () => procurementCreators.list, componentProps: { options:[], optionsAlias: { @@ -952,6 +953,17 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive( // isMainValue: false // 表示查询条件不是主表的字段的值 // }] // } + }, + search: { + component: 'Select', + api: () => procurementCreators.list, + componentProps: { + options:[], + optionsAlias: { + labelField: 'nickname', + valueField: 'id' + } + }, } }, { diff --git a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMainQuery/index.vue b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMainQuery/index.vue new file mode 100644 index 000000000..b8b995d4a --- /dev/null +++ b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMainQuery/index.vue @@ -0,0 +1,1788 @@ + + + + + + + + + + + + + + + {{ row.number }} + + + + {{ + Number(row.differencePrice).toFixed(5) + }} + + + + + + + + + + + + 系统未税金额:{{ + Number( + selections.reduce( + (prev, item) => + prev + + Number( + Number( + Number(Number(item['purchasePrice']).toFixed(5)) * item['invoicableQuantity'] + ).toFixed(2) + ), + 0 + ) + ).toFixed(2) + }} + + + + + + + + + + 索赔明细 + + + + + + + + + + + + + + + + + + {{ accountantFormartDetail(row['totalTaxDiffAmount']) + }} (含返利合计:{{ accountantFormartDetail(row['rebateTotal']) }}) + + + + {{ accountantFormartDetail(row['beforeTaxDiffAmount']) + }} (含返利未税:{{ accountantFormartDetail(row['discountAmount1']) }}) + + + + {{ accountantFormartDetail(row['taxAmountDiff']) + }} (含返利税额:{{ accountantFormartDetail(row['rebateTax']) }}) + + + {{ accountantFormartDetail(row.differencePrice) }} + + + + + + + + + diff --git a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMainQuery/supplierinvoiceRequestMain.data.ts b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMainQuery/supplierinvoiceRequestMain.data.ts new file mode 100644 index 000000000..765d8f206 --- /dev/null +++ b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMainQuery/supplierinvoiceRequestMain.data.ts @@ -0,0 +1,2701 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter,dateFormatter2 } from '@/utils/formatTime' +import { accountantFormart } from '@/utils/formatter' + +import * as SupplierApi from '@/api/wms/supplier' +import * as SupplierinvoiceRequestMainApi from '@/api/wms/supplierinvoiceRequestMain' +import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data' +const { t } = useI18n() // 国际化 + +import * as getRequestsettingApi from '@/api/wms/requestsetting/index' +import * as supplierinvoiceRequestDetailApi from '@/api/wms/supplierinvoiceRequestDetail' + +// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 +const queryParams = { + pageSize: 10, + pageNo: 1, + code: 'PurchaseInvoiceRequest' +} +console.log(34343) +const data = await getRequestsettingApi.getRequestsettingPage(queryParams) +const requestsettingData = data?.list[0] || {} + + // 获取当前操作人的部门 + import { useUserStore } from '@/store/modules/user' + import { TableColumn } from '@/types/table' + const userStore = useUserStore() + const userDept = userStore.userSelfInfo.dept + // id 转str 否则form回显匹配不到 + userDept.id = userDept.id.toString() + const userDeptArray:any = [userDept] + +const procurementCreators = await SupplierinvoiceRequestMainApi.queryUserInfoByRoleCode({ roleCode: 'purchase',pageSize: 1000,pageNo: 1,sort: '',by: 'ASC' }) +/** + * @returns {Array} 采购员列表 + */ +export const PurchaseMemberInfo = useCrudSchemas(reactive([ + { + label: '用户编号', + field: 'id', + table: { + width: 180, + }, + }, + { + label: '用户名称', + field: 'username', + table: { + width: 180, + }, + }, + { + label: '用户昵称', + field: 'nickname', + table: { + width: 180, + }, + } +])) + +/** + * @returns {Array} 采购订单或者采购退货单 + */ +export const PurchaseReceiptOrReturnRecordDetail = useCrudSchemas(reactive([ + { + label: '单据类型', + field: 'billType' + }, + { + label: '收货日期', + field: 'deliveryDate', + sort: 'custom', + isDetail:false, + isTable: true, + isForm:false, + isTableForm:false, + isSearch:true, + formatter: dateFormatter2, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD', + type: 'daterange', + defaultTime: [new Date('1 '), new Date('1 ')] + } + }, + }, + { + label: '待开票单据号', + field: 'recvBillNum', + table: { + width: 180, + }, + }, + { + label: '供应商发货单号', + field: 'asnBillNum', + table: { + width: 180, + }, + }, + { + label: '供应商代码', + field: 'supplierCode' + }, + { + label: '订单号', + field: 'poNumber' + }, + { + label: '订单行', + field: 'poLine' + }, + { + label: '采购价格', + field: 'purchasePrice' + }, + { + label: '可开票数量', + field: 'invoicableQuantity' + }, + { + label: '货币', + field: 'currency', + }, + { + label: '品番', + field: 'itemCode' + }, + { + label: '背番', + field: 'backNumber' + }, + { + label: '创建时间', + field: 'createTime', + isTable: true, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + isTableForm: false, + isForm: false + } +])) + + +/** + * @returns {Array} 供应商发票申请主表 + */ +export const SupplierinvoiceRequestMain = useCrudSchemas(reactive([ + { + label: '单据号', + field: 'number', + sort: 'custom', + table: { + width: 180, + fixed: 'left' + }, + isSearch: true, + isForm: false + }, + + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + table: { + width: 150 + }, + sortTableDefault:1, + isSearch: true, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + enterSearch:true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择供应商代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '供应商信息', // 查询弹窗标题 + searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类 + searchPage: SupplierApi.getSupplierPageSCP, // 查询弹窗所需分页方法 + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: 'true', + isFormModel: true + }], // 失去焦点校验参数 + } + } + }, + { + label: '订单类型', + field: 'orderType', + dictType: DICT_TYPE.PURCHASE_INVOICE_ORDER_TYPE, + dictClass: 'string', + isTable: false, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '供应商名称', + field: 'supplierName', + sort: 'custom', + isSearch:true, + table: { + width: 180, + }, + sortTableDefault:2, + isForm: false + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.SUPPLIERINVOICE_REQUEST_STATUS, + dictClass: 'string', + isTable: true, + isForm:false, + sort: 'custom', + table: { + width: 150 + }, + sortTableDefault:9, + isSearch: true, + search: { + componentProps: { + multiple: true, + collapseTags: true, + collapseTagsTooltip: true, + } + }, + form: { + value: '1', + componentProps: { + disabled: true + } + } + }, + //子表数据,仅是查询条件 + { + label: '货运单号', + field: 'asnBillNum', + sort: 'custom', + table: { + width: 180, + fixed: 'left' + }, + isTableForm:false, + isTable:false, + isDetail:false, + isSearch: true, + isForm: false, + }, + + { + label: '材料款未税金额', // 供应商维护未税金额 + field: 'amount', + formatter: accountantFormart, + table: { + width: 160 + }, + sortTableDefault:8, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + }, + tableForm: { + type: 'InputNumber', + precision: 2, + } + }, + // { + // label: '发票总额', + // field: 'invoiceAmountMain', + // formatter: accountantFormart, + // sortTableDefault: 3, + // table: { + // width: 160 + // }, + // form: { + // component: 'InputNumber', + // componentProps: { + // precision: 2, + // disabled: true, + // } + // }, + // tableForm: { + // type: 'InputNumber', + // precision: 2, + // }, + // }, + { + label: '模具未税金额', + field: 'moldUntaxedAmount', + formatter: accountantFormart, + table: { + width: 160 + }, + sortTableDefault:8, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + }, + tableForm: { + type: 'InputNumber', + precision: 2, + } + }, + { + label: '模具税额', + field: 'moldTaxAmount', + formatter: accountantFormart, + table: { + width: 160 + }, + sortTableDefault:8, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + }, + tableForm: { + type: 'InputNumber', + precision: 2, + } + }, + { + label: '模具价税合计', + field: 'moldTaxTotal', + formatter: accountantFormart, + table: { + width: 160 + }, + sortTableDefault:8, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + }, + tableForm: { + type: 'InputNumber', + precision: 2, + } + }, + { + label: '税率(%)', + field: 'taxRate', + dictType: DICT_TYPE.TAX_RATE_DICT, + dictClass: 'string', + sortTableDefault:3, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '价差合计', + field: 'differencePriceTotalMain', + formatter: accountantFormart, + table: { + width: 100 + }, + sortTableDefault: 3, + isForm: false, + isTable: true, + isSearch: false, + isDetail: true, + }, + // { + // label: '未税金额', + // field: 'beforeTaxAmount', + // formatter: accountantFormart, + // table: { + // width: 150 + // }, + // sortTableDefault:3, + // isForm:false, + // isTableForm:false + // }, + // { + // label: '税额', + // field: 'totalTaxAmount', + // formatter: accountantFormart, + // table: { + // width: 150 + // }, + // sortTableDefault:3, + // isForm:false, + // isTableForm:false + // }, + // { + // label: '发票价税合计', + // field: 'adTaxAmount', + // formatter: accountantFormart, + // table: { + // width: 150 + // }, + // sortTableDefault:3, + // isForm:false, + // isTableForm:false + // }, + { + label: '材料款税额',//'供应商维护税额', + field: 'taxAmount', + formatter: accountantFormart, + table: { + width: 150 + }, + sortTableDefault:6, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + }, + tableForm: { + type: 'InputNumber', + precision: 2, + } + }, + { + label: '材料款价税合计',//'供应商维护价税合计', + field: 'afterTaxAmount', + formatter: accountantFormart, + table: { + width: 160 + }, + sortTableDefault:7, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + }, + tableForm: { + type: 'InputNumber', + min: 0, + precision: 2, + disabled: true, + } + }, + + // { + // label: '调整价差', + // field: 'discountAmount', + // formatter: accountantFormart, + // table: { + // width: 150 + // }, + // isTable:false, + // form: { + // component: 'InputNumber', + // componentProps: { + // precision: 2, + // } + // }, + // tableForm: { + // type: 'InputNumber', + // min: 0, + // precision: 2, + // } + // }, + // { + // label: '调整税额', + // field: 'adjustingTaxAmount', + // table: { + // width: 150 + // }, + // isTable:false, + // form: { + // component: 'InputNumber', + // componentProps: { + // precision: 2, + // } + // }, + // tableForm: { + // type: 'InputNumber', + // min: 0, + // precision: 2, + // } + // }, + { + label: '返利未税金额', + field: 'discountAmount1', + formatter: accountantFormart, + table: { + width: 150 + }, + isTable:false, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + } + }, + tableForm: { + type: 'InputNumber', + min: 0, + precision: 2, + } + }, + { + label: '发票未税金额', + field: 'beforeTaxAmount', + formatter: accountantFormart, + table: { + width: 150 + }, + sortTableDefault:3, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + }, + isTableForm:false, + }, + { + label: '返利税额', + field: 'rebateTax', + formatter: accountantFormart, + table: { + width: 150 + }, + sortTableDefault:4, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + }, + isTableForm:false, + }, + { + label: '返利价税合计', + field: 'rebateTotal', + formatter: accountantFormart, + table: { + width: 150 + }, + sortTableDefault:4, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + }, + isTableForm:false, + }, + { + label: '发票税额', + field: 'totalTaxAmount', + formatter: accountantFormart, + table: { + width: 150 + }, + sortTableDefault:4, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + }, + isTableForm:false, + }, + { + label: '发票价税合计', + field: 'adTaxAmount', + formatter: accountantFormart, + table: { + width: 150 + }, + sortTableDefault:5, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + }, + isTableForm:false, + }, + { + label: '是否有价差', + field: 'balanceStatementStatus', + dictType: DICT_TYPE.INVOICE_BALANCE_STATEMENT_STATUS, + dictClass: 'string', + isTable: true, + isForm:false, + isSearch:false, + sort: 'custom', + table: { + width: 150 + }, + sortTableDefault:5, + }, + { + label: '价差说明', + field: 'balanceStatement', + isTable: false, + isForm:false, + isSearch:false, + sort: 'custom', + table: { + width: 150 + }, + sortTableDefault:5, + }, + { + label: '未税尾差', + field: 'beforeTaxDiffAmount', + formatter: accountantFormart, + table: { + width: 150 + }, + sortTableDefault:5, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + }, + isTableForm:false, + }, + { + label: '税额尾差', + field: 'taxAmountDiff', + formatter: accountantFormart, + table: { + width: 150 + }, + sortTableDefault:5, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + }, + isTableForm:false, + }, + { + label: '价税合计尾差', + field: 'totalTaxDiffAmount', + formatter: accountantFormart, + table: { + width: 150 + }, + sortTableDefault:5, + isTableForm:false, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + } + }, + + // { + // label: '总差额', + // field: 'totalDifference', + // formatter: accountantFormart, + // table: { + // width: 150 + // }, + // isTable:false, + // form: { + // component: 'InputNumber', + // componentProps: { + // precision: 2, + // } + // }, + // tableForm: { + // type: 'InputNumber', + // min: 0, + // precision: 2, + // } + // }, + { + label: '金税票号', + field: 'goldenTaxInvoiceNumber', + isTable:true, + isDetail:true, + table: { + width: 200, + }, + sortTableDefault:10, + form:{ + componentProps: { + maxlength:20, + showWordLimit:true + } + } + }, + { + label: '快递单号', + field: 'expressTrackingNumber', + isTable:false, + isForm:false, + table: { + width: 150 + }, + }, + { + label: '开票日期', + field: 'invoiceTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + sortTableDefault:11, + form: { + component: 'DatePicker', + componentProps: { + style: {width:'100%'}, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + // { + // label: '采购审批人', + // field: 'procurementCreatorName', + // sort: 'custom', + // table: { + // width: 180 + // }, + // isTable:true, + // isDetail: true, + // isTableForm: false, + // isForm:false, + // isSearch:false, + // sortTableDefault:12 + // }, + { + label: '过账日期', + field: 'postingDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + isTable:false, + isDetail:false, + form: { + component: 'DatePicker', + componentProps: { + disabled: true, + style: {width:'100%'}, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + + { + label: '申请时间', + field: 'requestTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + isTable:false, + isForm:false, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '部门', + field: 'departmentCode', + sort: 'custom', + table: { + width: 150 + }, + isTable:false, + isTableForm:false, + isForm:false, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return userDeptArray.find((account) => account.id == cellValue)?.name + }, + form: { + value: userDept.id, + component: 'Select', + api: () => userDeptArray, + componentProps: { + disabled: true, + optionsAlias: { + labelField: 'name', + valueField: 'id' + } + } + } + }, + { + label: '创建者', + field: 'creator', + table: { + width: 150 + }, + isTable:false, + sortTableDefault:1001, + isForm: false, + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + isForm: false, + isDetail: false, + isTableForm: false, + isTable: true, + isSearch: true, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + }, + { + label: '供应商创建时间', + field: 'requestTime', + isTable:true, + formatter: dateFormatter, + sortTableDefault:1000, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + isForm: false, + }, + { + label: '最后更新者', + field: 'updater', + sort: 'custom', + table: { + width: 150 + }, + isTable:false, + isForm: false, + }, + { + label: '最后更新时间', + field: 'updateTime', + isTable: false, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + isForm: false, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '采购价格审批人', + field: 'procurementCreator', + table: { + width: 150 + }, + sortTableDefault:14, + isForm: true, + isTable:false, + isDetail:false, + isSearch:true, + form: { + component: 'Select', + api: () => procurementCreators.list, + componentProps: { + options:[], + optionsAlias: { + labelField: 'nickname', + valueField: 'id' + } + }, + // labelMessage: '信息提示说明!!!', + // componentProps: { + // isSearchList: true, // 开启查询弹窗 + // hiddenFilterButton:true,//是否隐藏筛选按钮 + // dialogWidth:'665px',//搜索出来弹窗的宽度 + // searchListPlaceholder: '请选择采购员', // 输入框占位文本 + // searchField: 'id', // 查询弹窗赋值字段 + // searchTitle: '采购员信息', // 查询弹窗标题 + // searchAllSchemas: PurchaseMemberInfo.allSchemas, // 查询弹窗所需类 + // searchPage: SupplierinvoiceRequestMainApi.queryUserInfoByRoleCode, // 查询弹窗所需分页方法 + // searchCondition: [{ + // key: 'roleCode', // 查询列表中字段 + // value: 'purchase', // 指查询具体值 + // isMainValue: false // 表示查询条件不是主表的字段的值 + // }] + // } + }, + search: { + component: 'Select', + api: () => procurementCreators.list, + componentProps: { + options:[], + optionsAlias: { + labelField: 'nickname', + valueField: 'id' + } + }, + } + }, + { + label: '采购价格审批人', + field: 'procurementCreatorName', + table: { + width: 150 + }, + sortTableDefault:14, + isForm: false, + isTable:true, + isDetail:false, + form: { + component: 'Select', + api: () => procurementCreators.list, + componentProps: { + optionsAlias: { + labelField: 'nickname', + valueField: 'id' + } + }, + } + }, + { + label: '索赔未税金额',//'索赔总额', + field: 'claimAmount', + sort: 'custom', + table: { + width: 180 + }, + isTable:true, + isDetail: true, + isTableForm: false, + isForm: true, + isSearch:false, + sortTableDefault: 12, + form: { + component: 'InputNumber', + componentProps: { + precision: 5, + disabled: true, + } + }, + + }, + { + label: '索赔税额', + field: 'claimTaxAmount', + formatter: accountantFormart, + table: { + width: 160 + }, + sortTableDefault:8, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + }, + tableForm: { + type: 'InputNumber', + precision: 2, + } + }, + { + label: '索赔价税合计', + field: 'claimTaxTotal', + formatter: accountantFormart, + table: { + width: 160 + }, + sortTableDefault:8, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + }, + tableForm: { + type: 'InputNumber', + precision: 2, + } + }, + { + label: '采购审批时间', + field: 'procurementCreateTime', + isTable: true, + sortTableDefault:13, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form:{ + component: 'DatePicker', + componentProps: { + style: {width:'100%'}, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss',//YYYY-MM-DD + valueFormat: 'x',//数据转成时间戳 + } + }, + sort: 'custom', + table: { + width: 180 + }, + isForm: false, + }, + { + label: '财务审批人', + field: 'financialCreatorName', + sort: 'custom', + table: { + width: 150 + }, + sortTableDefault:14, + isForm: false, + }, + { + label: '采购驳回原因', + field: 'purchaseRejectCause', + table: { + width: 180 + }, + sortTableDefault:16, + isTable: true, + isSearch: false, + isForm: false, + isDetail:false, + }, + { + label: '财务驳回原因', + field: 'financeRejectCause', + table: { + width: 180 + }, + sortTableDefault:17, + isTable: true, + isSearch: false, + isForm: false, + isDetail:false, + }, + { + label: '财务审批时间', + field: 'financialCreateTime', + isTable: true, + sortTableDefault:15, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form:{ + component: 'DatePicker', + componentProps: { + style: {width:'100%'}, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss',//YYYY-MM-DD + valueFormat: 'x',//数据转成时间戳 + } + }, + sort: 'custom', + table: { + width: 180 + }, + isForm: false, + }, + { + label: '供应商审批人', + field: 'supplierCreator', + sort: 'custom', + isTable:false, + isDetail:false, + sortTableDefault:1006, + table: { + width: 180 + }, + isForm: false, + }, + { + label: '供应商审批人', + field: 'supplierCreatorName', + sort: 'custom', + isTable:false, + isDetail:true, + sortTableDefault:1006, + table: { + width: 180 + }, + isForm: false, + }, + { + label: '供应商审批时间', + field: 'supplierCreateTime', + isTable:false, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form:{ + component: 'DatePicker', + componentProps: { + style: {width:'100%'}, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss',//YYYY-MM-DD + valueFormat: 'x',//数据转成时间戳 + } + }, + sort: 'custom', + table: { + width: 180 + }, + isForm: false, + }, + { + label: '参考凭证描述', + field: 'voucherNumberRemark', + sort: 'custom', + table: { + width: 150 + }, + isForm:false, + isTable: false, + }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: false, + isForm:false, + isTableForm:false, + isDetail:false, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: requestsettingData.autoCommit, + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE', + disabled: true, + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: false, + isForm:false, + isTableForm:false, + isDetail:false, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: requestsettingData.autoAgree, + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE', + disabled: true, + } + } + }, + { + label: '自动执行', + field: 'autoExecute', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: false, + isForm:false, + isTableForm:false, + isDetail:false, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: requestsettingData.autoExecute, + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE', + disabled: true, + } + } + }, + { + label: '跳过任务生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: false, + isForm:false, + isTableForm:false, + isDetail:false, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: requestsettingData.directCreateRecord, + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE', + disabled: true, + } + } + }, + // { + // label: '操作', + // field: 'action', + // isDetail: false, + // isForm: false, + // table: { + // width: 300, + // fixed: 'right' + // }, + // } +])) +export const accountantFormartDetail = ( cellValue) => { + if(cellValue == 0){ + return cellValue + } + if(!cellValue){ + return '' + } + cellValue = cellValue + '' || '' + cellValue = Number(cellValue).toFixed(2) + let x = cellValue.split('.') + let x1 = x[0] + let x2 = x.length > 1 ? '.' + x[1] : '' + const reg = /(\d+)(\d{3})/ + while(reg.test(x1)){ + x1 = x1.replace(reg, '$1,$2') + } + return x1+x2 +} +/** + * @returns {Array} 供应商发票在详情展示的主表字段 + */ +export const SupplierinvoiceRequestDetailMain = useCrudSchemas(reactive([ + { + label: '汇总信息', + field: '', + sort: 'custom', + isForm: false, + isSearch: false, + isTable: false, + isDetail: true, + }, + { + label: '供应商信息', + field: '', + sort: 'custom', + isForm: false, + isSearch: false, + isTable: false, + isDetail: true, + }, + { + label: '价差', + field: '', + sort: 'custom', + isForm: false, + isSearch: false, + isTable: false, + isDetail: true, + }, + { + label: 'SCP系统数据', + field: '', + sort: 'custom', + isForm: false, + isSearch: false, + isTable: false, + isDetail: false, + }, + + { + label: '单据号', + field: 'number', + sort: 'custom', + + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + }, + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + }, + { + label: '待开发票未税金额', + field: 'purchaseAmountTotalMain', + formatter: accountantFormart, + detail: { + formatter: accountantFormartDetail, + }, + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + }, + { + label: '财务凭证号', + field: 'voucherNumber', + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + }, + { + label: '供应商名称', + field: 'supplierName', + sort: 'custom', + + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + }, + { + label: '价差合计', + field: 'differencePriceTotalMain', + formatter: accountantFormart, + detail: { + formatter: accountantFormartDetail, + }, + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + }, + { + label: '供应商创建时间', + field: 'requestTime', + sort: 'custom', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + }, + { + label: '订单类型', + field: 'orderType', + dictType: DICT_TYPE.PURCHASE_INVOICE_ORDER_TYPE, + dictClass: 'string', + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + }, + { + label: '', + field: '', + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + }, + { + label: '状态', + field: 'status', + dictType: DICT_TYPE.SUPPLIERINVOICE_REQUEST_STATUS, + dictClass: 'string', + sort: 'custom', + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + }, + { + label: '发票号码', + field: 'goldenTaxInvoiceNumber', + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + }, + { + label: '尾差', + field: '', + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + }, + // { + // label: '尾差', + // field: 'totalDifference', + // sortTableDefault: 6, + // isForm: false, + // isTable: false, + // isSearch: false, + // isDetail: false, + // }, + { + label: '采购价格审批人', + field: 'procurementCreatorName', + sortTableDefault: 1003, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + }, + { + label: '开票日期', + field: 'invoiceTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + }, + { + label: '材料款价税合计',//'供应商维护价税合计', + field: 'afterTaxAmount', + formatter: accountantFormart, + detail: { + formatter: accountantFormartDetail, + }, + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + }, + { + label: '采购价格审批时间', + field: 'procurementCreateTime', + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sortTableDefault: 1003, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + }, + { + label: '税率(%)', + field: 'taxRate', + dictType: DICT_TYPE.TAX_RATE_DICT, + dictClass: 'string', + sortTableDefault: 3, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + }, + { + label: '材料款未税金额', //供应商维护未税金额 + field: 'amount', + formatter: accountantFormart, + detail: { + formatter: accountantFormartDetail, + }, + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + }, + { + label: '价差通过说明', + field: 'balanceStatement', + sort: 'custom', + + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + }, + { + label: '发票价税合计', + field: 'adTaxAmount', + formatter: accountantFormart, + detail: { + formatter: accountantFormartDetail, + }, + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + + }, + { + label: '材料款税额',//'供应商维护税额', + field: 'taxAmount', + formatter: accountantFormart, + detail: { + formatter: accountantFormartDetail, + }, + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + + }, + { + label: '财务审批人', + field: 'financialCreatorName', + sort: 'custom', + + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + }, + { + label: '发票未税金额', + field: 'beforeTaxAmount', + formatter: accountantFormart, + detail: { + formatter: accountantFormartDetail, + }, + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + }, + { + label: '', + field: '', + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + }, + { + label: '财务审批时间', + field: 'financialCreateTime', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + }, + { + label: '发票税额', + field: 'totalTaxAmount', + formatter: accountantFormart, + detail: { + formatter: accountantFormartDetail, + }, + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + }, + { + label: '价税合计尾差', + field: 'totalTaxDiffAmount', + formatter: accountantFormart, + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + detail:{ + slotFilter: true + } + }, + { + label: '财务过账日期', + field: 'postingDate', + isTable: true, + sortTableDefault: 15, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + + }, + { + label: '返利未税金额', + field: 'discountAmount1', + formatter: accountantFormart, + detail: { + formatter: accountantFormartDetail, + }, + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + }, + { + label: '未税尾差', + field: 'beforeTaxDiffAmount', + formatter: accountantFormart, + + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + detail:{ + slotFilter: true + } + }, + + { + label: '参考凭证描述', + field: 'voucherNumberRemark', + sort: 'custom', + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + // detail:{ + // span:2 + // } + }, + { + label: '工厂地点', + field: 'siteId', + sort: 'custom', + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + }, + { + label: '税额尾差', + field: 'taxAmountDiff', + formatter: accountantFormart, + + sortTableDefault: 6, + isForm: false, + isTable: false, + isSearch: false, + isDetail: true, + detail:{ + slotFilter: true + } + }, + { + label: '索赔未税金额',//'索赔总额', + field: 'claimAmount', + sort: 'custom', + table: { + width: 180 + }, + isTable: true, + isDetail: true, + isTableForm: false, + isForm: true, + isSearch: false, + sortTableDefault: 12, + form: { + component: 'InputNumber', + componentProps: { + precision: 5, + disabled: true, + } + }, + formatter: accountantFormart, + detail: { + formatter: accountantFormartDetail, + }, + + }, + { + label: '索赔税额', + field: 'claimTaxAmount', + sort: 'custom', + table: { + width: 180 + }, + isTable: true, + isDetail: true, + isTableForm: false, + isForm: true, + isSearch: false, + sortTableDefault: 12, + form: { + component: 'InputNumber', + componentProps: { + precision: 5, + disabled: true, + } + }, + formatter: accountantFormart, + detail: { + formatter: accountantFormartDetail, + }, + + }, + { + label: '索赔价税合计', + field: 'claimTaxTotal', + sort: 'custom', + table: { + width: 180 + }, + isTable: true, + isDetail: true, + isTableForm: false, + isForm: true, + isSearch: false, + sortTableDefault: 12, + form: { + component: 'InputNumber', + componentProps: { + precision: 5, + disabled: true, + } + }, + formatter: accountantFormart, + detail: { + formatter: accountantFormartDetail, + }, + + }, + // { + // label: '发票总额', + // field: 'invoiceAmountMain', + // formatter: accountantFormart, + // table: { + // width: 160 + // }, + // sortTableDefault: 8, + // form: { + // component: 'InputNumber', + // componentProps: { + // precision: 2, + // disabled: true, + // } + // }, + // tableForm: { + // type: 'InputNumber', + // precision: 2, + // }, + // formatter: accountantFormart, + // detail: { + // formatter: accountantFormartDetail, + // }, + // }, + { + label: '金税票号', + field: 'goldenTaxInvoiceNumber', + isTable:true, + isDetail:true, + table: { + width: 200, + }, + sortTableDefault:10, + form:{ + componentProps: { + maxlength:20, + showWordLimit:true + } + } + }, + { + label: '模具未税金额', + field: 'moldUntaxedAmount', + formatter: accountantFormart, + detail: { + formatter: accountantFormartDetail, + }, + table: { + width: 160 + }, + sortTableDefault:8, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + }, + tableForm: { + type: 'InputNumber', + precision: 2, + } + }, + { + label: '模具税额', + field: 'moldTaxAmount', + formatter: accountantFormart, + detail: { + formatter: accountantFormartDetail, + }, + table: { + width: 160 + }, + sortTableDefault:8, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + }, + tableForm: { + type: 'InputNumber', + precision: 2, + } + }, + { + label: '模具价税合计', + field: 'moldTaxTotal', + formatter: accountantFormart, + detail: { + formatter: accountantFormartDetail, + }, + table: { + width: 160 + }, + sortTableDefault:8, + form: { + component: 'InputNumber', + componentProps: { + precision: 2, + disabled: true, + } + }, + tableForm: { + type: 'InputNumber', + precision: 2, + } + }, +])) + +const singlePriceFormart = (row, column, cellValue) => { + cellValue= Number(cellValue).toFixed(5) + cellValue = cellValue + '' || '' + + let x = cellValue.split('.') + let x1 = x[0] + let x2 = x.length > 1 ? '.' + x[1] : '' + const reg = /(\d+)(\d{3})/ + while(reg.test(x1)){ + x1 = x1.replace(reg, '$1,$2') + } + return x1+x2 +} + +function validateTaxRate(rule, value, callback) { + if (value>0) { + callback() + }else{ + callback(new Error('税率必须大于0')) + } +} + +const validateGoldenTaxInvoiceNumber = (rule, value, callback) => { + console.log('金税票号',value) + const reg = /^[0-9]*$/ + if (value==null||value==''||reg.test(value)) { + callback() + }else{ + callback(new Error('只能是数字')) + } +} + + +//表单校验 +export const SupplierinvoiceRequestMainRules = reactive({ + taxRate: [ + required, + // { validator:validateTaxRate, message: '税率必须大于0', trigger: 'blur'} + ], + supplierCode: [ + { required: true, message: '请选择供应商代码', trigger: 'change' } + ], + invoiceTime:[ + { required: false, message: '请选择发票日期', trigger: 'blur' } + ], + goldenTaxInvoiceNumber:[ + { required: false, message: '请输入金税票号', trigger: 'blur' }, + // { validator:validateGoldenTaxInvoiceNumber, message: '金税票号只能是数字', trigger: 'blur'} + ], + departmentCode: [ + { required: true, message: '请输入部门', trigger: 'blur' } + ], + autoCommit: [ + { required: true, message: '请选择是否自动提交', trigger: 'change' } + ], + autoAgree: [ + { required: true, message: '请选择是否自动通过', trigger: 'change' } + ], + autoExecute: [ + { required: true, message: '请选择是否自动执行', trigger: 'change' } + ], + directCreateRecord: [ + { required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' } + ], + businessType: [ + { required: true, message: '请输入业务类型', trigger: 'blur' } + ], + remark: [ + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + procurementCreator: [ + { required: true, message: '请选择采购员', trigger: 'change' } + ], + beforeTaxAmount: [ + { required: true, message: '请输入未税金额', trigger: 'change' } + ], + totalTaxAmount: [ + { required: true, message: '请输入税额', trigger: 'change' } + ], +}) + +export const SupplierinvoiceRequestFinance = useCrudSchemas(reactive([ + { + label: '过账日期', + field: 'postingDate', + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + sort: 'custom', + table: { + width: 180 + }, + isTable:false, + form: { + component: 'DatePicker', + componentProps: { + style: {width:'100%'}, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + }, + }, + { + label: '凭证描述', + field: 'voucherNumberRemark', + sort: 'custom', + isTable:false, + form: { + component: 'Input', + componentProps:{ + type: 'textarea' + } + }, + }, +])) + +export const SupplierinvoiceRequestFinanceRules = reactive({ + postingDate: [ + { required: true, message: '请选择过账日期', trigger: 'change' } + ], + // voucherNumberRemark: [ + // { max: 50, message: '不得超过40个字符', trigger: 'blur' } + // ], +}) +/** + * @returns {Array} 供应商发票申请子表 + */ +export const SupplierinvoiceRequestDetail = useCrudSchemas(reactive([ + { + label: '品番', + field: 'itemCode', + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + }, + tableForm:{ + disabled: true + } + }, + { + label: '品名', + field: 'itemName', + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + }, + tableForm:{ + disabled: true + } + }, + { + label: '背番', + field: 'backNumber', + sort: 'custom', + isSearch: true, + hiddenSearchHigh:true, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + }, + tableForm:{ + disabled: true + } + }, + { + label: '描述', + field: 'itemDesc', + table: { + width: 150 + }, + isForm:false, + isTableForm:false, + isDetail: false, + isTable: true, + }, + + //仅是主列表页面的筛选搜索条件 + { + label: '收货日期', + field: 'deliveryDate', + sort: 'custom', + isDetail:false, + isTable: false, + isForm:false, + isTableForm:false, + isSearch:true, + formatter: dateFormatter, + search: { + value:[], + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD', + type: 'daterange', + defaultTime: [new Date('1 '), new Date('1 ')] + } + }, + }, + { + label: '收货日期', + field: 'deliveryDate', + table: { + width: 150 + }, + formatter: dateFormatter2, + isForm:false, + isTableForm:true, + isDetail: false, + isTable: true, + tableForm:{ + disabled:true + } + }, + { + label: '可开票数量', + field: 'invoicableQuantity', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + componentProps: { + disabled: false, + precision: 5, + } + }, + tableForm:{ + type: 'InputNumber', + disabled: false, + precision: 5, + } + }, + { + label: '合同价格', + field: 'singlePrice', + formatter: singlePriceFormart, + table: { + width: 150 + }, + form: { + component: 'InputNumber', + componentProps: { + min: 0, + precision: 5, + } + }, + tableForm: { + type: 'InputNumber', + min: 0, + precision: 5, + } + }, + { + label: '采购价格', + field: 'purchasePrice', + formatter: singlePriceFormart, + table: { + width: 150 + }, + form: { + component: 'InputNumber', + componentProps: { + disabled: true, + min: 0, + precision: 5, + } + }, + tableForm:{ + type: 'InputNumber', + disabled: true, + min: 0, + precision: 5, + } + }, + { + label: '合同金额', + field: 'contractAmountTotal', + table: { + width: 150 + }, + isForm:false, + tableForm:{ + disabled: true + } + }, + { + label: '采购金额', + field: 'purchaseAmontTotal', + table: { + width: 150 + }, + isForm:false, + tableForm:{ + disabled: true + } + }, + { + label: '总差额', + field: 'differencePriceTotal', + table: { + width: 150 + }, + isForm:false, + tableForm:{ + disabled: true + } + }, + { + label: '单价差额', + field: 'differencePrice', + formatter: singlePriceFormart, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true, + min: 0, + precision: 5, + } + }, + tableForm:{ + type: 'slot', + disabled: true, + min: 0, + precision: 5, + } + }, + { + label: '模具分摊单价', + field: 'allocationPrice', + formatter: singlePriceFormart, + table: { + width: 150 + }, + isForm:false, + form: { + componentProps: { + disabled: true, + precision: 5, + } + }, + tableForm: { + disabled: true, + type: 'InputNumber', + precision: 5, + } + }, + { + label: '到货数量', + field: 'arrivalQty', + table: { + width: 150 + }, + isForm:false, + isTableForm:true, + isDetail: false, + isTable: true, + tableForm:{ + disabled:true + } + }, + { + label: '采购计量单位', + field: 'purchaseStdUom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + table: { + width: 150 + }, + isForm:false, + isTableForm:true, + isDetail: false, + isTable: true, + tableForm:{ + disabled:true + } + }, + { + label: '订单号', + field: 'poNumber', + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 150 + }, + tableForm:{ + disabled: true + } + }, + { + label: '订单行', + field: 'poLine', + table: { + width: 150 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + multiple:true,//多选 + isSearchList: true, + searchListPlaceholder: '请选择订单行', + searchField: 'poLine', + searchTitle: '待开票列表', + searchAllSchemas: PurchaseReceiptOrReturnRecordDetail.allSchemas, + searchPage: supplierinvoiceRequestDetailApi.getPoNumberPoLineInfo, + searchCondition: [ + { + key: 'supplierCode', + value: 'supplierCode', + message: '请填供应商信息!', + isMainValue: true + },{ + key: 'orderType', + value: 'orderType', + message: '请填订单类型!', + isMainValue: true + } + ] + } + }, + tableForm: { + multiple:true,//多选 + isInpuFocusShow: true, + searchListPlaceholder: '请选择订单行', + searchField: 'poLine', + searchTitle: '待开票列表', + searchAllSchemas: PurchaseReceiptOrReturnRecordDetail.allSchemas, + searchPage: supplierinvoiceRequestDetailApi.getPoNumberPoLineInfo, + searchCondition: [ + { + key: 'supplierCode', + value: 'supplierCode', + message: '请填供应商信息!', + isMainValue: true + }, + { + key: 'orderType', + value: 'orderType', + message: '请填订单类型!', + isMainValue: true + } + ], + // verificationPage: supplierinvoiceRequestDetailApi.getSupplierinvoiceRequestDetailByCodes, // tableForm下方输入框校验失去焦点之后是否正确的方法 + // isShowTableFormSearch: true, //tableForm下方是否出现输入框 + // isRepeat: true,//tableForm下方输入框是否可以重复添加该条数据 + // // 失去焦点校验参数 + // verificationParams: [{ + // key: 'recvBillNum', + // action: '==', + // value: '', + // isMainValue: false, + // isSearch: 'true', + // isFormModel: true, + // }] + } + }, + { + label: '待开票单据号', + field: 'recvBillNum', + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + }, + tableForm:{ + disabled: true + } + }, + { + label: '单据类型', + field: 'billType', + dictType: DICT_TYPE.BILL_TYPE, + dictClass: 'string', + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + }, + tableForm:{ + disabled: true + } + }, + { + label: '供应商发货单号', + field: 'asnBillNum', + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + }, + tableForm:{ + disabled: true + } + }, + { + label: '供应商代码', + field: 'supplierCode', + hiddenInMain:true, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + }, + tableForm:{ + disabled: true + } + }, + + // { + // label: '未税差额',//子表数据 + // field: 'untaxedDifference', + // formatter: accountantFormart, + // table: { + // width: 150 + // }, + // form: { + // component: 'InputNumber', + // componentProps: { + // precision: 2, + // } + // }, + // tableForm: { + // type: 'InputNumber', + // min: 0, + // precision: 2, + // } + // }, + // { + // label: '含税差额', + // field: 'taxInclusiveDifference', + // formatter: accountantFormart, + // table: { + // width: 150 + // }, + // form: { + // component: 'InputNumber', + // componentProps: { + // precision: 2, + // } + // }, + // tableForm: { + // type: 'InputNumber', + // min: 0, + // precision: 2, + // } + // }, + + + //仅是主列表页面的筛选搜索条件 + { + label: '供应商创建时间', + field: 'requestTime', + sort: 'custom', + isDetail:false, + isTable: false, + isForm:false, + isTableForm:false, + isSearch:true, + formatter: dateFormatter, + search: { + value:[], + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'datetimerange', + defaultTime: [new Date('1 '), new Date('1 ')] + } + }, + + }, + { + label: '货币', + field: 'currency', + dictType: DICT_TYPE.CURRENCY, + dictClass: 'string', + isTableForm:true, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + }, + tableForm:{ + type:'Select', + disabled: true + } + }, + { + label: '备注', + field: 'remark', + hiddenInMain:true, + }, + { + label: '供应商创建时间', + field: 'requestTime', + hiddenInMain:true, + isTable: false, + table: { + width: 150 + }, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + isTableForm: false, + isForm: false + }, + { + label: '创建者', + field: 'creator', + hiddenInMain:true, + isTableForm: false, + isTable:false, + isForm: false, + table: { + width: 150 + }, + }, + + + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 250, + fixed: 'right' + }, + hiddenInMain:true, + isTableForm: false, + } +])) + +// 批次校验 +const validateSinglePrice = (rule: any, value: any, callback: any) => { + if (Number(value)>0) { + callback(); + } else { + callback(new Error('请输入合同价格')); + } +} +//表单校验 +export const SupplierinvoiceRequestDetailRules = reactive({ + singlePrice: [ + { required: true, message: '请输入合同价格', trigger: 'change' }, + { validator: validateSinglePrice, trigger: 'change' } + ], +}) +// 采购通过 +export const PurchasePass = useCrudSchemas(reactive([ + { + label: '价差通过说明', + field: 'balanceStatement', + sort: 'custom', + table: { + width: 180 + }, + isTable:false, + form: { + componentProps:{ + type:'textarea' + } + }, + }, +])) +//表单校验 +export const PurchasePassRules = reactive({ + balanceStatement: [ + { required: true, message: '请输入价差通过说明', trigger: 'blur'}, + { max: 100, message: '最多100字符', trigger: 'blur'} + ], +}) +/** + * @returns {Array} 索赔明细 + */ +export const ClaimDetails = useCrudSchemas(reactive([ + { + label: '索赔申请单单号', + field: 'number', + table: { + width: 150 + }, + tableForm: { + disabled:true + } + }, + { + label: '品番', + field: 'itemCode', + table: { + width: 150 + }, + tableForm: { + disabled: true + } + }, + { + label: '背番', + field: 'backNumber', + table: { + width: 150 + }, + tableForm: { + disabled: true + } + }, + { + label: '索赔数量', + field: 'claimQty', + table: { + width: 150 + }, + tableForm: { + disabled: true + } + }, + { + label: '索赔金额', + field: 'claimAmount', + table: { + width: 150 + }, + tableForm: { + disabled: true + } + }, + +]))