Browse Source

模具分摊前端

syhx
zhang_li 1 month ago
parent
commit
525e7bfc78
  1. 31
      src/components/Detail/src/Detail.vue
  2. 5
      src/locales/en-US.ts
  3. 4
      src/locales/zh-CN.ts
  4. 121
      src/views/wms/deliversettlementManage/customerStatement/customerStatement/customerSaleInvoiceDetail.data.ts
  5. 301
      src/views/wms/deliversettlementManage/customerStatement/customerStatement/customerStatementMain.data.ts
  6. 168
      src/views/wms/deliversettlementManage/customerStatement/customerStatement/index.vue

31
src/components/Detail/src/Detail.vue

@ -12,7 +12,7 @@
{{ titleValueRef }} <span class="ml-20px font-size-16px">{{ t(`ts.${titleNameRef}`).replace('ts.','') }}</span>
</div>
</template>
<Tabs ref="tabRef" :tabsList="tabsList" :current="current" @change="change" />
<Tabs ref="tabRef" :tabsList="tabsList" :current="current" @change="change"/>
<ContentWrap v-if="!isBasic" v-show="tabsList[current].label=='主数据'">
<Descriptions
:data="detailData"
@ -31,7 +31,8 @@
</ContentWrap>
<div class="flex">
<!-- 详情 -->
<ContentWrap class="w-[100%]" v-show="tabsList[current].label!=annexAlias.label&&tabsList[current].label!='备注'&&tabsList[current].label!='变更记录'&&tabsList[current].label!='主数据'&&!annexTableData.some(item=>item.label==tabsList[current].label)"> <!-- 列表头部 -->
<ContentWrap class="w-[100%]" v-show="tabsList[current].label!=annexAlias.label&&tabsList[current].label!='备注'&&tabsList[current].label!='变更记录'&&tabsList[current].label!='主数据'&&!annexTableData.some(item=>item.label==tabsList[current].label)">
<!-- 列表头部 -->
<TableHead
v-if="!isBasic&&!slotDetailTabList.some(item=>item.label==tabsList[current].label)"
:HeadButttondata="HeadButttondata"
@ -452,7 +453,7 @@ const props = defineProps({
type: Number,
required: false,
default: 8
}
},
})
const filterPermissionAnnexTable = ()=>{
return props.annexTable.filter(item=>{
@ -679,6 +680,7 @@ const change = (item, index) => {
scrollbar.value?.scrollTo({ top: 0});
}
}
const changeTabCurrent = ({label,index})=>{
if(label){
@ -704,6 +706,7 @@ const masterParmas = ref({
//
const HeadButttondata = ref()
const HeadButttondataBackups = ref()//
// -
const buttondata = ref()
@ -787,7 +790,8 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
})
]
}
HeadButttondata.value = [...detailButtonFilter,...detailButtonAdd]
HeadButttondata.value = [...detailButtonFilter, ...detailButtonAdd]
HeadButttondataBackups.value = [...detailButtonFilter, ...detailButtonAdd]
//
if (routeName.value.indexOf('Job') > -1) {
@ -796,6 +800,7 @@ const openDetail = async (row: any, titleName: any, titleValue: any, tableName:
]
}
HeadButttondata.value = [...HeadButttondata.value,...props.otherHeadButttonData]
HeadButttondataBackups.value = [...HeadButttondata.value,...props.otherHeadButttonData]
let detailButtonEdit: any = []
let detailButtonDelete: any = []
if (props.detailButtonIsShowEdit) {
@ -907,12 +912,6 @@ const buttonBaseClick = (val, item) => {
}else{
openForm('create')
}
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') {
//
getList()
@ -1147,7 +1146,7 @@ const formFormDateChange = (field, val,row, index) => {
//
watch(
() => props.apiPage,
() => {
async () => {
const { tableObject, tableMethods } = useTable({
getListApi: props.apiPage //
})
@ -1161,10 +1160,16 @@ watch(
tableObjectRef.value = tableObject
tableMethodsRef.value = tableMethods
const { getList } = tableMethods
getList()
await getList()
}
)
defineExpose({ openDetail, formRef ,updateList,submitUpdateList,changeTabCurrent}) // open
watch(
() => props.otherHeadButttonData,
(val) => {
HeadButttondata.value = [...HeadButttondataBackups.value, ...props.otherHeadButttonData]
}
)
defineExpose({ openDetail, formRef ,updateList,submitUpdateList,changeTabCurrent,openForm}) // open
</script>
<style lang="scss">

5
src/locales/en-US.ts

@ -1297,7 +1297,10 @@ export default {
:'Return of invoice',
: 'The invoice has been successfully forwarded',
: 'Last Updated By',
:'The range of invoices is'
: 'The range of invoices is',
: 'Re compare',
: 'Confirm the comparison results',
: 'Confirm the shared amount'
},

4
src/locales/zh-CN.ts

@ -1295,7 +1295,9 @@ export default {
:'发票回转',
: '发票回转成功',
:'最后更新人',
:'可开票数量范围是'
: '可开票数量范围是',
: '确认对比结果',
: '确认分摊金额'
},
}

121
src/views/wms/deliversettlementManage/customerStatement/customerStatement/customerSaleInvoiceDetail.data.ts

@ -1,121 +0,0 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const CustomerSaleInvoiceDetailRules = reactive({
itemCode: [required],
articleNumber: [required],
qty: [required],
price: [required],
allocationPrice: [required],
sumPrice: [required],
afterTaxAmount: [required],
beforeTaxAmount: [required],
taxAmount: [required],
})
export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isTable: false,
isForm: false,
},
{
label: '单据号',
field: 'number',
sort: 'custom',
},
{
label: '主id',
field: 'masterId',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '品番即物料代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
},
{
label: '品号即品番2',
field: 'articleNumber',
sort: 'custom',
isSearch: true,
},
{
label: '数量',
field: 'qty',
sort: 'custom',
},
{
label: '单价',
field: 'price',
sort: 'custom',
},
{
label: '模具分摊单价',
field: 'allocationPrice',
sort: 'custom',
},
{
label: '合计单价',
field: 'sumPrice',
sort: 'custom',
},
{
label: '含税金额',
field: 'afterTaxAmount',
sort: 'custom',
},
{
label: '未税金额',
field: 'beforeTaxAmount',
sort: 'custom',
},
{
label: '税额',
field: 'taxAmount',
sort: 'custom',
},
{
label: '备注',
field: 'remark',
sort: 'custom',
},
{
label: '是否可用默认TRUE',
field: 'available',
sort: 'custom',
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
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')]
}
},
isForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

301
src/views/wms/deliversettlementManage/customerStatement/customerStatement/customerStatementMain.data.ts

@ -273,3 +273,304 @@ export const CustomerStatementDetailRules = reactive({
price: [required],
amount: [required],
})
export const CustomerStatementDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '开票种类',
field: 'invoiceType',
sort: 'custom',
form: {
component: 'SelectV2'
},
isForm: false,
},
{
label: '发行NO',
field: 'releaseNumber',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '受入',
field: 'ingress',
sort: 'custom',
isForm: false,
},
{
label: '受入2',
field: 'ingress2',
sort: 'custom',
isForm: false,
},
{
label: '品番',
field: 'itemCode',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '品番2',
field: 'articleNumber',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '品名',
field: 'articleName',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '验收年月日',
field: 'checkTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
isForm: false,
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '单位',
field: 'uom',
sort: 'custom',
isForm: false,
},
{
label: '数量',
field: 'qty',
sort: 'custom',
isForm: false,
},
{
label: '单价',
field: 'price',
sort: 'custom',
isForm: false,
},
{
label: '金额',
field: 'amount',
sort: 'custom',
},
{
label: '操作',
field: 'action',
isForm: false,
isTable: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// 对账差异
export const CustomerStatementReconciliation = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '品番',
field: 'itemCode',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '背番',
field: 'articleName',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '出荷日期',
field: 'checkTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
isForm: false,
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '验收日期',
field: 'uom',
sort: 'custom',
isForm: false,
},
{
label: '订单号',
field: 'qty',
sort: 'custom',
isForm: false,
},
{
label: '数量-INTEX',
field: 'price',
sort: 'custom',
isForm: false,
},
{
label: '数量-TFTM',
field: 'amount',
sort: 'custom',
},
{
label: '数量差异',
field: 'amount',
sort: 'custom',
},
{
label: '单价-INTEX',
field: 'amount',
sort: 'custom',
},
{
label: '单价-TFTM',
field: 'amount',
sort: 'custom',
},
{
label: '单价差异',
field: 'amount',
sort: 'custom',
},
{
label: '金额-INTEX',
field: 'amount',
sort: 'custom',
},
{
label: '金额-TFTM',
field: 'amount',
sort: 'custom',
},
{
label: '金额差异',
field: 'amount',
sort: 'custom',
},
{
label: '操作',
field: 'action',
isForm: false,
isTable: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// 模具分摊对账单
export const CustomerStatementShareReconciliation = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '厂家编号',
field: 'itemCode',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '厂家名称',
field: 'articleName',
sort: 'custom',
isSearch: true,
isForm: false,
},
{
label: '帐票号',
field: 'checkTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
isForm: false,
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '品号',
field: 'uom',
sort: 'custom',
isForm: false,
},
{
label: '车型',
field: 'qty',
sort: 'custom',
isForm: false,
},
{
label: '数量',
field: 'price',
sort: 'custom',
isForm: false,
},
{
label: '模具分摊金额',
field: 'amount',
sort: 'custom',
},
{
label: '模具分摊单价',
field: 'amount',
sort: 'custom',
},
{
label: '调整金额',
field: 'amount',
sort: 'custom',
},
]))

168
src/views/wms/deliversettlementManage/customerStatement/customerStatement/index.vue

@ -34,18 +34,50 @@
:isBusiness="false" />
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="CustomerStatementMain.allSchemas" />
<!-- <Detail ref="detailRef" :isBasic="true" :allSchemas="CustomerStatementMain.allSchemas" /> -->
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="CustomerStatementMain.allSchemas"
:detailAllSchemas="DetailAllSchemas"
:apiPage="apiPage"
:tabsExtend="tabsExtend"
:tabs="[{
label: '明细',
prop: 'Detail'
},{
label: '对账差异',
prop: 'Reconciliation'
},{
label: '模具分摊对账单',
prop: 'ShareReconciliation'
}]"
:otherHeadButttonData="otherHeadButttonData"
:detailButtonIsShowAdd="false"
:detailButtonIsShowEdit="false"
:detailButtonIsShowDelete="false"
@changeTabs="changeTabs"
:tableObjectExtend="tableObjectExtend"
@buttonBaseClick="detailButtonBaseClick"
>
<template #qty="{row}">
<span :style="{color:row.qty>0?'red':row.qty<0?'#409eff':'#000'}">{{ row.qty }}</span>
</template>
<template #amount="{row}" v-if="tabCurrent.prop == 'ShareReconciliation'">
<div style="display: flex;align-items: center;">
<span style="margin-right:6px">{{ row.amount }}</span>
<Icon icon="ep:edit" color="#409eff" @click="openDetailForm(row)"/>
</div>
</template>
</Detail>
<!-- 导入 -->
<!-- <ImportForm ref="importFormRef" url="/wms/customer-statement-main/import" :importTemplateData="importTemplateData" @success="importSuccess" /> -->
<ImportCustomerStatementForm ref="importFormRef" url="/wms/customer-statement-main/import"
:importTemplateData="importTemplateData" @success="importSuccess" />
<ImportCustomerStatementForm ref="importFormRef" url="/wms/customer-statement-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { CustomerStatementMain, CustomerStatementMainRules } from './customerStatementMain.data'
import { CustomerStatementDetail, CustomerStatementDetailRules } from './customerStatementDetail.data'
import { CustomerStatementMain, CustomerStatementMainRules,CustomerStatementDetail,CustomerStatementDetailRules,CustomerStatementReconciliation,CustomerStatementShareReconciliation} from './customerStatementMain.data'
import * as CustomerStatementMainApi from '@/api/wms/customerStatementMain'
import * as CustomerStatementDetailApi from '@/api/wms/customerStatementDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
@ -63,6 +95,13 @@ const routeName = ref()
routeName.value = route.name
const tableColumns = ref(CustomerStatementMain.allSchemas.tableColumns)
const apiPage = ref(CustomerStatementDetailApi.getCustomerStatementDetailPage)
const DetailAllSchemas = ref(CustomerStatementDetail.allSchemas)
const tabsExtend = ref(false)
const tableObjectExtend = ref()
const otherHeadButttonData = ref()
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
@ -212,7 +251,9 @@ const formsSuccess = async (formType, data) => {
/** 详情操作 */
const detailRef = ref()
const chooseRow = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
chooseRow.value = row
detailRef.value.openDetail(row, titleName, titleValue, 'basicCustomerStatementMain')
}
@ -342,5 +383,118 @@ const tapCancel = async (id:number) => {
} else {
return true
}
}
const tabCurrent = ref({})
const changeTabs = async (item) => {
tabCurrent.value = item
if (item.prop == 'Detail') {
//
tabsExtend.value = true
//
tableObjectExtend.value = [{
key: 'masterId',
value: chooseRow.value.id
}]
apiPage.value = CustomerStatementDetailApi.getCustomerStatementDetailPage
DetailAllSchemas.value = CustomerStatementDetail.allSchemas
otherHeadButttonData.value = [{
label: t(`ts.导出`).replace('ts.', ''),
name: 'exportDetail',
hide: false,
type: 'success',
icon: 'ep:download',
color: '',
hasPermi: ''
}]
} else if (item.prop == 'Reconciliation') {
//
tabsExtend.value = true
//
tableObjectExtend.value = [{
key: 'masterId',
value: chooseRow.value.id
}]
DetailAllSchemas.value = CustomerStatementReconciliation.allSchemas
apiPage.value = CustomerStatementMainApi.getCustomerStatementMainPage
otherHeadButttonData.value = [
{
label: t(`ts.导出`).replace('ts.', ''),
name: 'exportReconciliation',
hide: false,
type: 'success',
icon: 'ep:download',
color: '',
hasPermi: ''
},
{
label:'重新对比',
name: 'againContrast',
hide: false,
type: 'primary',
color: '',
float:'left',
hasPermi: ''
},{
label: t('ts.确认对比结果'),
name: 'confirmResults',
hide: false,
type: 'primary',
color: '',
float:'left',
hasPermi: ''
}]
} else if (item.prop == 'ShareReconciliation') {
//
tabsExtend.value = true
//
tableObjectExtend.value = [{
key: 'masterId',
value: chooseRow.value.id
}]
apiPage.value = CustomerStatementDetailApi.getCustomerStatementDetailPage
DetailAllSchemas.value = CustomerStatementShareReconciliation.allSchemas
otherHeadButttonData.value = [
{
label: t(`ts.导出`).replace('ts.', ''),
name: 'exportConfirmShareMoney',
hide: false,
type: 'success',
icon: 'ep:download',
color: '',
hasPermi: ''
},
{
label: t('ts.确认分摊金额'),
name: 'confirmShareMoney',
hide: false,
type: 'primary',
color: '',
float:'left',
hasPermi: ''
}]
} else{
tableObjectExtend.value = []
tabsExtend.value = false
apiPage.value = ''
otherHeadButttonData.value = []
}
}
//
const detailButtonBaseClick = (val, item) => {
if (val == 'exportReconciliation') {
//
}else if (val == 'againContrast') {
//
}else if (val == 'confirmResults') {
//
}else if (val == 'exportConfirmShareMoney') {
//
}else if (val == 'confirmShareMoney') {
//
}
}
//
const openDetailForm = (row) => {
detailRef.value.openForm('update', row)
}
</script>

Loading…
Cancel
Save