Browse Source

YT-303:ss客户订单导入开发

intex_online20241111
ljlong_2630 3 weeks ago
parent
commit
700ec35e4a
  1. 20
      src/components/ImportForm/src/ImportFormOnlyAdd.vue
  2. 6
      src/views/wms/deliversettlementManage/ftSuppliesRecordMain/deliverRecordMain/deliverRecordMain.data.ts
  3. 100
      src/views/wms/deliversettlementManage/ftSuppliesRecordMain/deliverRecordMain/index.vue
  4. 872
      src/views/wms/deliversettlementManage/ssSuppliesRecordMain/deliverRecordMain/deliverRecordMain.data.ts
  5. 265
      src/views/wms/deliversettlementManage/ssSuppliesRecordMain/deliverRecordMain/index.vue
  6. 872
      src/views/wms/deliversettlementManage/tjdtSuppliesRecordMain/deliverRecordMain/deliverRecordMain.data.ts
  7. 265
      src/views/wms/deliversettlementManage/tjdtSuppliesRecordMain/deliverRecordMain/index.vue
  8. 2
      src/views/wms/deliversettlementManage/unfinishedShipmentMain/index.vue

20
src/components/ImportForm/src/ImportFormOnlyAdd.vue

@ -252,10 +252,22 @@ const submitFormSuccess = (response: any) => {
// const downloadElement = document.createElement('a')
// console.log(172, getBaseUrl() + import.meta.env.VITE_API_URL + '/' + response.data.errorFile)
// console.log(172, getBaseUrl() + '/admin-api/opt/profile/' + response.data.errorFile)
window.open(
getBaseUrl() + '/admin-api' + response.data.errorFile,
'222'
)
// window.open(
// getBaseUrl() + '/admin-api' + response.data.errorFile,
// '222'
// )
fetch(getBaseUrl() + '/admin-api' + response.data.errorFile)
.then(res => res.blob())
.then(blob => {
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.style.display = 'none';
a.href = url;
a.download = 'error_file.txt'; //
document.body.appendChild(a);
a.click();
window.URL.revokeObjectURL(url);
});
// downloadElement.setAttribute('href', getBaseUrl() + import.meta.env.VITE_API_URL + response.data.errorFile )
//
// downloadElement.click()

6
src/views/wms/deliversettlementManage/ftSuppliesRecordMain/deliverRecordMain/deliverRecordMain.data.ts

@ -70,13 +70,11 @@ export const DeliverRecordMain = useCrudSchemas(
table: {
width: 180
},
isSearch: true,
isTable: true,
isForm: true,
form: {
search: {
component: 'Input',
componentProps: {
}
}
},
{

100
src/views/wms/deliversettlementManage/ftSuppliesRecordMain/deliverRecordMain/index.vue

@ -3,7 +3,6 @@
<!-- 搜索工作栏 -->
<Search :schema="[...DeliverRecordMain.allSchemas.searchSchema,...DeliverRecordDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@ -14,7 +13,6 @@
:allSchemas="DeliverRecordMain.allSchemas"
:detailAllSchemas="DeliverRecordDetail.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
@ -38,7 +36,6 @@
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@ -49,7 +46,6 @@
:tableFormRules="DeliverRecordDetailRules"
:isBusiness="true"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
@ -59,13 +55,10 @@
:detailAllSchemasRules="DeliverRecordDetailRules"
:apiPage="DeliverRecordDetailApi.getDeliverRecordDetailPage"
/>
<!-- 导入 -->
<ImportFormOnlyAdd ref="importFormRef" url="/wms/deliver-record-main/import-toyota_supplies" @success="importSuccess" :isShowDownloadBtn="false"/>
<ImportFormOnlyAdd ref="importFormRef" :url="importUrl" @success="importSuccess" :isShowDownloadBtn="false" :extend="importExtend"/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { getAccessToken } from '@/utils/auth'
@ -77,59 +70,65 @@ import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { getJmreportBaseUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
const { loadStart, loadDone } = usePageLoading()
//
defineOptions({ name: 'FtSuppliesRecordMain' })
defineOptions({ name: 'ToyotaSupplies' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const businessType = ref()
const importFileName = ref()
const importUrl = ref('')
const importExtend = ref('')
console.log(99 , routeName.value)
const tableColumns = ref([...DeliverRecordMain.allSchemas.tableColumns,...DeliverRecordDetail.allSchemas.tableMainColumns])
const { tableObject, tableMethods } = useTable({
getListApi: DeliverRecordDetailApi.getDeliverRecordDetailPage //
})
importUrl.value = '/wms/deliver-record-main/import-shipment'
//
/**
* OktoholdRequestMain 合格转隔离
*/
if ( routeName.value == 'FtSuppliesRecordMain') {
if (routeName.value == 'ToyotaSupplies') {
tableObject.params = {
businessType: 'FtSuppliesRecord'
businessType: 'ToyotaSupplies'
}
businessType.value = 'FtSuppliesRecord'
businessType.value = 'ToyotaSupplies'
importFileName.value = '丰田补给品发货记录'
}
importExtend.value = 'ToyotaSupplies'
} else if (routeName.value == 'SSProduct') {
tableObject.params = {
businessType: 'SSProduct'
}
businessType.value = 'SSProduct'
importFileName.value = 'SS品发货记录'
importExtend.value = 'SSProduct'
} else if (routeName.value == 'SkylightCarpet') {
tableObject.params = {
businessType: 'SkylightCarpet'
}
businessType.value = 'SkylightCarpet'
importFileName.value = '天井地毯发货记录'
importExtend.value = 'SkylightCarpet'
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultImportBtn({hasPermi:`wms:${routeName.value}:import`}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
@ -168,8 +167,10 @@ const buttonTableClick = async (val, row) => {
handlePoint(row)
}
}
//
const { wsCache } = useCache()
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
@ -196,6 +197,7 @@ const handleExport = async () => {
const BASE_URL = getJmreportBaseUrl()
const src = ref(BASE_URL + '/jmreport/view/929209659733770240?token=' + getAccessToken())
//
const handlePoint = async (row) => {
window.open(src.value+'&id='+row.masterId)
@ -209,12 +211,30 @@ const searchFormClick = (searchData) => {
searchData.filters = []
}
let filters = [...searchData.filters]
if(!filters.find(item=>item.column=='business_type')){
filters = [...filters,{
action:'==',
column:'business_type',
value:'FtSuppliesRecordMain',
}]
if (routeName.value == 'ToyotaSupplies') {
if(!filters.find(item=>item.column=='business_type')){
filters = [...filters,{
action:'==',
column:'business_type',
value:'ToyotaSupplies',
}]
}
} else if (routeName.value == 'SSProduct') {
if(!filters.find(item=>item.column=='business_type')){
filters = [...filters,{
action:'==',
column:'business_type',
value:'SSProduct',
}]
}
} else if (routeName.value == 'SkylightCarpet') {
if(!filters.find(item=>item.column=='business_type')){
filters = [...filters,{
action:'==',
column:'business_type',
value:'SkylightCarpet',
}]
}
}
tableObject.params.filters = filters
getList() //
@ -231,11 +251,15 @@ const importSuccess = () => {
getList()
}
/** 初始化 **/
onMounted(async () => {
tableObject.params.businessType = 'FtSuppliesRecordMain'
if (routeName.value == 'ToyotaSupplies') {
tableObject.params.businessType = 'ToyotaSupplies'
} else if (routeName.value == 'SSProduct') {
tableObject.params.businessType = 'SSProduct'
} else if (routeName.value == 'SkylightCarpet') {
tableObject.params.businessType = 'SkylightCarpet'
}
getList()
})
</script>
</script>

872
src/views/wms/deliversettlementManage/ssSuppliesRecordMain/deliverRecordMain/deliverRecordMain.data.ts

@ -0,0 +1,872 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
/**
* @returns {Array}
*/
export const DeliverRecordMain = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180,
fixed: 'left'
},
isSearch: true
},
{
label: '申请单号',
field: 'requestNumber',
sort: 'custom',
table: {
width: 180
},
isSearch: true
},
{
label: '任务单号',
field: 'jobNumber',
sort: 'custom',
table: {
width: 180
}
},
{
label: '发货记录单号',
field: 'deliverRecordNumber',
sort: 'custom',
table: {
width: 150
},
isSearch: false,
isTable: false,
isForm: false,
isDetail: false
},
{
label: '发货计划单号',
field: 'deliverPlanNumber',
sort: 'custom',
table: {
width: 180
},
isTable: true,
isDetail: true
},
// {
// label: '客户发货单号',
// field: 'customerDeliverNumber',
// sort: 'custom',
// table: {
// width: 150
// },
// },
{
label: '客户订单号',
field: 'customerOrderNumber',
sort: 'custom',
table: {
width: 180
},
isSearch: true,
isTable: true,
isForm: true,
search: {
component: 'Input',
}
},
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
isSearch: false,
isTable: false,
isForm: false,
isDetail: false,
sort: 'custom',
table: {
width: 150
}
},
{
label: '客户代码',
field: 'customerCode',
sort: 'custom',
table: {
width: 150
},
isSearch: true
},
{
label: '发货类型',
field: 'deliverType',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.DELIVER_TYPE,
dictClass: 'string',
table: {
width: 150
}
},
{
label: '客户月台代码',
field: 'customerDockCode',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '承运商',
field: 'carrierCode',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '运输方式',
field: 'transferMode',
dictType: DICT_TYPE.TRANSFER_MODE,
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '车牌号',
field: 'vehiclePlateNumber',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '申请时间',
field: 'requestTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
},
{
label: '截止时间',
field: 'dueTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
},
{
label: '执行时间',
field: 'executeTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
},
{
label: '生效日期',
field: 'activeDate',
formatter: dateFormatter2,
detail: {
dateFormat: 'YYYY-MM-DD'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x'
}
}
},
{
label: '从仓库代码',
field: 'fromWarehouseCode',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '到仓库代码',
field: 'toWarehouseCode',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '从库区类型范围',
field: 'fromAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
isTable: false,
sort: 'custom',
table: {
width: 150
}
},
{
label: '到库区类型范围',
field: 'toAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
isTable: false,
sort: 'custom',
table: {
width: 150
}
},
{
label: '从库区代码范围',
field: 'fromAreaCodes',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '到库区代码范围',
field: 'toAreaCodes',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '从月台代码',
field: 'fromDockCode',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '出库事务类型',
field: 'outTransactionType',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '入库事务类型',
field: 'inTransactionType',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '接口类型',
field: 'interfaceType',
dictType: DICT_TYPE.INTERFACE_TYPE,
dictClass: 'string',
isTable: false,
sort: 'custom',
table: {
width: 150
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
},
isSearch: 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')]
},
},
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
// {
// label: '代码',
// field: 'code',
// sort: 'custom',
// table: {
// width: 150
// },
// },
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: false,
isTable: false,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
}
])
)
//表单校验
export const DeliverRecordMainRules = reactive({
requestNumber: [
{ required: true, message: '请选择申请单号', trigger: 'change' }
],
customerCode: [
{ required: true, message: '请选择客户代码', trigger: 'change' }
],
customerDockCode: [
{ required: true, message: '请选择客户月台代码', trigger: 'change' }
],
fromWarehouseCode: [
{ required: true, message: '请选择从仓库代码', trigger: 'change' }
],
fromAreaTypes: [
{ required: true, message: '请选择从库区类型范围', trigger: 'change' }
],
fromAreaCodes: [
{ required: true, message: '请选择从库区代码范围', trigger: 'change' }
],
toWarehouseCode: [
{ required: true, message: '请选择到仓库代码', trigger: 'change' }
],
toAreaTypes: [
{ required: true, message: '请选择到库区类型范围', trigger: 'change' }
],
outTransaction: [
{ required: true, message: '请输入出库事务类型', trigger: 'blur' }
],
inTransaction: [
{ required: true, message: '请输入入库事务类型', trigger: 'blur' }
],
executeTime: [
{ required: true, message: '请输入执行时间', trigger: 'change' }
],
activeDate: [
{ required: true, message: '请输入生效日期', trigger: 'change' }
],
available: [
{ required: true, message: '请输入是否可用', trigger: 'blur' }
],
departmentCode: [
{ required: true, message: '请输入部门', trigger: 'blur' }
],
interfaceType: [
{ required: true, message: '请选择接口类型', trigger: 'change' }
],
number: [
{ required: true, message: '请输入单据号', trigger: 'blur' }
],
businessType: [
{ required: true, message: '请输入业务类型', trigger: 'blur' }
],
createTime: [
{ required: true, message: '请输入创建时间', trigger: 'blur' }
],
creator: [
{ required: true, message: '请输入创建者', trigger: 'blur' }
],
})
/**
* @returns {Array}
*/
export const DeliverRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180
},
isTable: false
},
// {
// label: '销售订单号',
// field: 'soNumber',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '销售订单行',
// field: 'soLine',
// sort: 'custom',
// table: {
// width: 150
// },
// },
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物料描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true
},
{
label: '物料描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
},
{
label: '包装号',
field: 'packingNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '父包装号',
field: 'parentPackingNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '包装规格',
field: 'packUnit',
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
sort: 'custom',
table: {
width: 150
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '单价',
field: 'singlePrice',
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true,
form: {
component: 'InputNumber',
}
},
{
label: '金额',
field: 'amount',
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true,
form: {
component: 'InputNumber',
}
},
{
label: '在途库库位',
field: 'onTheWayLocationCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从库位',
field: 'fromLocationCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到库位',
field: 'toLocationCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从库位组',
field: 'fromLocationGroupCode',
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true,
},
{
label: '到库位组',
field: 'toLocationGroupCode',
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true,
},
{
label: '从库区',
field: 'fromAreaCode',
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true,
},
{
label: '到库区',
field: 'toAreaCode',
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true,
},
// {
// label: '从器具号',
// field: 'fromContainerNumber',
// sort: 'custom',
// table: {
// width: 150
// },
// isTable: false,
// },
// {
// label: '到器具号',
// field: 'toContainerNumber',
// sort: 'custom',
// table: {
// width: 150
// },
// isTable: false,
// },
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: false,
sort: 'custom',
table: {
width: 150
},
},
{
label: '从货主代码',
field: 'fromOwnerCode',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
{
label: '到货主代码',
field: 'toOwnerCode',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
{
label: '项目代码',
field: 'projectCode',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
{
label: '接口类型',
field: 'interfaceType',
dictType: DICT_TYPE.INTERFACE_TYPE,
dictClass: 'string',
isTable: false,
sort: 'custom',
table: {
width: 150
},
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: true,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
},
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: 'creator',
sort: 'custom',
table: {
width: 150
},
isTable: true,
},
// {
// label: '任务明细ID',
// field: 'jobDetailId',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '代码',
// field: 'code',
// sort: 'custom',
// table: {
// width: 150
// },
// },
]))
//表单校验
export const DeliverRecordDetailRules = reactive({
// soNumber: [
// { required: true, message: '请选择销售订单号', trigger: 'change' }
// ],
packingNumber: [
{ required: true, message: '请选择包装号', trigger: 'change' }
],
batch: [
{ required: true, message: '请输入批次', trigger: 'blur' }
],
inventoryStatus: [
{ required: true, message: '请选择库存状态', trigger: 'change' }
],
fromLocationCode: [
{ required: true, message: '请选择从库位代码', trigger: 'change' }
],
fromLocationGroupCode: [
{ required: true, message: '请选择从库位组代码', trigger: 'change' }
],
fromAreaCode: [
{ required: true, message: '请选择从库区代码', trigger: 'change' }
],
toLocationCode: [
{ required: true, message: '请选择到库位代码', trigger: 'change' }
],
toLocationGroupCode: [
{ required: true, message: '请选择到库位组代码', trigger: 'change' }
],
toAreaCode: [
{ required: true, message: '请选择到库区代码', trigger: 'change' }
],
number: [
{ required: true, message: '请输入单据号', trigger: 'blur' }
],
itemCode: [
{ required: true, message: '请选择物料代码', trigger: 'change' }
],
createTime: [
{ required: true, message: '请输入创建时间', trigger: 'blur' }
],
creator: [
{ required: true, message: '请输入创建者', trigger: 'blur' }
],
})

265
src/views/wms/deliversettlementManage/ssSuppliesRecordMain/deliverRecordMain/index.vue

@ -0,0 +1,265 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="[...DeliverRecordMain.allSchemas.searchSchema,...DeliverRecordDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="DeliverRecordMain.allSchemas"
:detailAllSchemas="DeliverRecordDetail.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #number="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="getList"
:rules="DeliverRecordMainRules"
:formAllSchemas="DeliverRecordMain.allSchemas"
:tableAllSchemas="DeliverRecordDetail.allSchemas"
:tableFormRules="DeliverRecordDetailRules"
:isBusiness="true"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="DeliverRecordMain.allSchemas"
:detailAllSchemas="DeliverRecordDetail.allSchemas"
:detailAllSchemasRules="DeliverRecordDetailRules"
:apiPage="DeliverRecordDetailApi.getDeliverRecordDetailPage"
/>
<!-- 导入 -->
<ImportFormOnlyAdd ref="importFormRef" :url="importUrl" @success="importSuccess" :isShowDownloadBtn="false" :extend="importExtend"/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { getAccessToken } from '@/utils/auth'
import { DeliverRecordMain,DeliverRecordMainRules,DeliverRecordDetail,DeliverRecordDetailRules } from './deliverRecordMain.data'
import * as DeliverRecordMainApi from '@/api/wms/deliverRecordMain'
import * as DeliverRecordDetailApi from '@/api/wms/deliverRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { getJmreportBaseUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
const { loadStart, loadDone } = usePageLoading()
//
defineOptions({ name: 'SSProduct' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const businessType = ref()
const importFileName = ref()
const importUrl = ref('')
const importExtend = ref('')
console.log(99 , routeName.value)
const tableColumns = ref([...DeliverRecordMain.allSchemas.tableColumns,...DeliverRecordDetail.allSchemas.tableMainColumns])
const { tableObject, tableMethods } = useTable({
getListApi: DeliverRecordDetailApi.getDeliverRecordDetailPage //
})
importUrl.value = '/wms/deliver-record-main/import-shipment'
//
if (routeName.value == 'ToyotaSupplies') {
tableObject.params = {
businessType: 'ToyotaSupplies'
}
businessType.value = 'ToyotaSupplies'
importFileName.value = '丰田补给品发货记录'
importExtend.value = 'ToyotaSupplies'
} else if (routeName.value == 'SSProduct') {
tableObject.params = {
businessType: 'SSProduct'
}
businessType.value = 'SSProduct'
importFileName.value = 'SS品发货记录'
importExtend.value = 'SSProduct'
} else if (routeName.value == 'SkylightCarpet') {
tableObject.params = {
businessType: 'SkylightCarpet'
}
businessType.value = 'SkylightCarpet'
importFileName.value = '天井地毯发货记录'
importExtend.value = 'SkylightCarpet'
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultImportBtn({hasPermi:`wms:${routeName.value}:import`}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
]
//
const buttonBaseClick = (val, item) => {
if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
searchFormClick({
filters: tableObject.params.filters
})
} else {
getList()
}
} else if (val == 'filtrate') { //
} else if (val == 'import') { //
handleImport()
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if(findIndex>-1&&findIndex<$index){
return []
}else{
return [defaultButtons.mainListDocumentPrintBtn(null),] //
}
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'documentPrint') { //
handlePoint(row)
}
}
//
const { wsCache } = useCache()
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode))
detailRef.value.openDetail(row, titleName, titleValue,'recordDeliverMain')
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
loadStart()
const excelTitle = ref(route.meta.title)
const data = await DeliverRecordMainApi.exportDeliverRecordMain(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
loadDone()
}
}
const BASE_URL = getJmreportBaseUrl()
const src = ref(BASE_URL + '/jmreport/view/929209659733770240?token=' + getAccessToken())
//
const handlePoint = async (row) => {
window.open(src.value+'&id='+row.masterId)
}
//
const searchFormClick = (searchData) => {
tableObject.params.isSearch = true
console.log('searchData',searchData.filters);
if(!searchData.filters){//
searchData.filters = []
}
let filters = [...searchData.filters]
if (routeName.value == 'ToyotaSupplies') {
if(!filters.find(item=>item.column=='business_type')){
filters = [...filters,{
action:'==',
column:'business_type',
value:'ToyotaSupplies',
}]
}
} else if (routeName.value == 'SSProduct') {
if(!filters.find(item=>item.column=='business_type')){
filters = [...filters,{
action:'==',
column:'business_type',
value:'SSProduct',
}]
}
} else if (routeName.value == 'SkylightCarpet') {
if(!filters.find(item=>item.column=='business_type')){
filters = [...filters,{
action:'==',
column:'business_type',
value:'SkylightCarpet',
}]
}
}
tableObject.params.filters = filters
getList() //
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importSuccess = () => {
getList()
}
/** 初始化 **/
onMounted(async () => {
if (routeName.value == 'ToyotaSupplies') {
tableObject.params.businessType = 'ToyotaSupplies'
} else if (routeName.value == 'SSProduct') {
tableObject.params.businessType = 'SSProduct'
} else if (routeName.value == 'SkylightCarpet') {
tableObject.params.businessType = 'SkylightCarpet'
}
getList()
})
</script>

872
src/views/wms/deliversettlementManage/tjdtSuppliesRecordMain/deliverRecordMain/deliverRecordMain.data.ts

@ -0,0 +1,872 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
/**
* @returns {Array}
*/
export const DeliverRecordMain = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180,
fixed: 'left'
},
isSearch: true
},
{
label: '申请单号',
field: 'requestNumber',
sort: 'custom',
table: {
width: 180
},
isSearch: true
},
{
label: '任务单号',
field: 'jobNumber',
sort: 'custom',
table: {
width: 180
}
},
{
label: '发货记录单号',
field: 'deliverRecordNumber',
sort: 'custom',
table: {
width: 150
},
isSearch: false,
isTable: false,
isForm: false,
isDetail: false
},
{
label: '发货计划单号',
field: 'deliverPlanNumber',
sort: 'custom',
table: {
width: 180
},
isTable: true,
isDetail: true
},
// {
// label: '客户发货单号',
// field: 'customerDeliverNumber',
// sort: 'custom',
// table: {
// width: 150
// },
// },
{
label: '客户订单号',
field: 'customerOrderNumber',
sort: 'custom',
table: {
width: 180
},
isSearch: true,
isTable: true,
isForm: true,
search: {
component: 'Input',
}
},
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
isSearch: false,
isTable: false,
isForm: false,
isDetail: false,
sort: 'custom',
table: {
width: 150
}
},
{
label: '客户代码',
field: 'customerCode',
sort: 'custom',
table: {
width: 150
},
isSearch: true
},
{
label: '发货类型',
field: 'deliverType',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.DELIVER_TYPE,
dictClass: 'string',
table: {
width: 150
}
},
{
label: '客户月台代码',
field: 'customerDockCode',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '承运商',
field: 'carrierCode',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '运输方式',
field: 'transferMode',
dictType: DICT_TYPE.TRANSFER_MODE,
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '车牌号',
field: 'vehiclePlateNumber',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '申请时间',
field: 'requestTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
},
{
label: '截止时间',
field: 'dueTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
},
{
label: '执行时间',
field: 'executeTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
},
{
label: '生效日期',
field: 'activeDate',
formatter: dateFormatter2,
detail: {
dateFormat: 'YYYY-MM-DD'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x'
}
}
},
{
label: '从仓库代码',
field: 'fromWarehouseCode',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '到仓库代码',
field: 'toWarehouseCode',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '从库区类型范围',
field: 'fromAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
isTable: false,
sort: 'custom',
table: {
width: 150
}
},
{
label: '到库区类型范围',
field: 'toAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
isTable: false,
sort: 'custom',
table: {
width: 150
}
},
{
label: '从库区代码范围',
field: 'fromAreaCodes',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '到库区代码范围',
field: 'toAreaCodes',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '从月台代码',
field: 'fromDockCode',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '出库事务类型',
field: 'outTransactionType',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '入库事务类型',
field: 'inTransactionType',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '接口类型',
field: 'interfaceType',
dictType: DICT_TYPE.INTERFACE_TYPE,
dictClass: 'string',
isTable: false,
sort: 'custom',
table: {
width: 150
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
},
isSearch: 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')]
},
},
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
// {
// label: '代码',
// field: 'code',
// sort: 'custom',
// table: {
// width: 150
// },
// },
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: false,
isTable: false,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
}
])
)
//表单校验
export const DeliverRecordMainRules = reactive({
requestNumber: [
{ required: true, message: '请选择申请单号', trigger: 'change' }
],
customerCode: [
{ required: true, message: '请选择客户代码', trigger: 'change' }
],
customerDockCode: [
{ required: true, message: '请选择客户月台代码', trigger: 'change' }
],
fromWarehouseCode: [
{ required: true, message: '请选择从仓库代码', trigger: 'change' }
],
fromAreaTypes: [
{ required: true, message: '请选择从库区类型范围', trigger: 'change' }
],
fromAreaCodes: [
{ required: true, message: '请选择从库区代码范围', trigger: 'change' }
],
toWarehouseCode: [
{ required: true, message: '请选择到仓库代码', trigger: 'change' }
],
toAreaTypes: [
{ required: true, message: '请选择到库区类型范围', trigger: 'change' }
],
outTransaction: [
{ required: true, message: '请输入出库事务类型', trigger: 'blur' }
],
inTransaction: [
{ required: true, message: '请输入入库事务类型', trigger: 'blur' }
],
executeTime: [
{ required: true, message: '请输入执行时间', trigger: 'change' }
],
activeDate: [
{ required: true, message: '请输入生效日期', trigger: 'change' }
],
available: [
{ required: true, message: '请输入是否可用', trigger: 'blur' }
],
departmentCode: [
{ required: true, message: '请输入部门', trigger: 'blur' }
],
interfaceType: [
{ required: true, message: '请选择接口类型', trigger: 'change' }
],
number: [
{ required: true, message: '请输入单据号', trigger: 'blur' }
],
businessType: [
{ required: true, message: '请输入业务类型', trigger: 'blur' }
],
createTime: [
{ required: true, message: '请输入创建时间', trigger: 'blur' }
],
creator: [
{ required: true, message: '请输入创建者', trigger: 'blur' }
],
})
/**
* @returns {Array}
*/
export const DeliverRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180
},
isTable: false
},
// {
// label: '销售订单号',
// field: 'soNumber',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '销售订单行',
// field: 'soLine',
// sort: 'custom',
// table: {
// width: 150
// },
// },
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物料描述1',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true
},
{
label: '物料描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
},
{
label: '包装号',
field: 'packingNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '父包装号',
field: 'parentPackingNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '包装规格',
field: 'packUnit',
isSearch: false,
isTable: false,
isForm:false,
isDetail:false,
sort: 'custom',
table: {
width: 150
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '单价',
field: 'singlePrice',
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true,
form: {
component: 'InputNumber',
}
},
{
label: '金额',
field: 'amount',
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true,
form: {
component: 'InputNumber',
}
},
{
label: '在途库库位',
field: 'onTheWayLocationCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从库位',
field: 'fromLocationCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '到库位',
field: 'toLocationCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '从库位组',
field: 'fromLocationGroupCode',
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true,
},
{
label: '到库位组',
field: 'toLocationGroupCode',
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true,
},
{
label: '从库区',
field: 'fromAreaCode',
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true,
},
{
label: '到库区',
field: 'toAreaCode',
sort: 'custom',
table: {
width: 150
},
hiddenInMain: true,
},
// {
// label: '从器具号',
// field: 'fromContainerNumber',
// sort: 'custom',
// table: {
// width: 150
// },
// isTable: false,
// },
// {
// label: '到器具号',
// field: 'toContainerNumber',
// sort: 'custom',
// table: {
// width: 150
// },
// isTable: false,
// },
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: false,
sort: 'custom',
table: {
width: 150
},
},
{
label: '从货主代码',
field: 'fromOwnerCode',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
{
label: '到货主代码',
field: 'toOwnerCode',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
{
label: '项目代码',
field: 'projectCode',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
isTable: false,
},
{
label: '接口类型',
field: 'interfaceType',
dictType: DICT_TYPE.INTERFACE_TYPE,
dictClass: 'string',
isTable: false,
sort: 'custom',
table: {
width: 150
},
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: true,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
},
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: 'creator',
sort: 'custom',
table: {
width: 150
},
isTable: true,
},
// {
// label: '任务明细ID',
// field: 'jobDetailId',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '代码',
// field: 'code',
// sort: 'custom',
// table: {
// width: 150
// },
// },
]))
//表单校验
export const DeliverRecordDetailRules = reactive({
// soNumber: [
// { required: true, message: '请选择销售订单号', trigger: 'change' }
// ],
packingNumber: [
{ required: true, message: '请选择包装号', trigger: 'change' }
],
batch: [
{ required: true, message: '请输入批次', trigger: 'blur' }
],
inventoryStatus: [
{ required: true, message: '请选择库存状态', trigger: 'change' }
],
fromLocationCode: [
{ required: true, message: '请选择从库位代码', trigger: 'change' }
],
fromLocationGroupCode: [
{ required: true, message: '请选择从库位组代码', trigger: 'change' }
],
fromAreaCode: [
{ required: true, message: '请选择从库区代码', trigger: 'change' }
],
toLocationCode: [
{ required: true, message: '请选择到库位代码', trigger: 'change' }
],
toLocationGroupCode: [
{ required: true, message: '请选择到库位组代码', trigger: 'change' }
],
toAreaCode: [
{ required: true, message: '请选择到库区代码', trigger: 'change' }
],
number: [
{ required: true, message: '请输入单据号', trigger: 'blur' }
],
itemCode: [
{ required: true, message: '请选择物料代码', trigger: 'change' }
],
createTime: [
{ required: true, message: '请输入创建时间', trigger: 'blur' }
],
creator: [
{ required: true, message: '请输入创建者', trigger: 'blur' }
],
})

265
src/views/wms/deliversettlementManage/tjdtSuppliesRecordMain/deliverRecordMain/index.vue

@ -0,0 +1,265 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="[...DeliverRecordMain.allSchemas.searchSchema,...DeliverRecordDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="DeliverRecordMain.allSchemas"
:detailAllSchemas="DeliverRecordDetail.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #number="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
@success="getList"
:rules="DeliverRecordMainRules"
:formAllSchemas="DeliverRecordMain.allSchemas"
:tableAllSchemas="DeliverRecordDetail.allSchemas"
:tableFormRules="DeliverRecordDetailRules"
:isBusiness="true"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="DeliverRecordMain.allSchemas"
:detailAllSchemas="DeliverRecordDetail.allSchemas"
:detailAllSchemasRules="DeliverRecordDetailRules"
:apiPage="DeliverRecordDetailApi.getDeliverRecordDetailPage"
/>
<!-- 导入 -->
<ImportFormOnlyAdd ref="importFormRef" :url="importUrl" @success="importSuccess" :isShowDownloadBtn="false" :extend="importExtend"/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { getAccessToken } from '@/utils/auth'
import { DeliverRecordMain,DeliverRecordMainRules,DeliverRecordDetail,DeliverRecordDetailRules } from './deliverRecordMain.data'
import * as DeliverRecordMainApi from '@/api/wms/deliverRecordMain'
import * as DeliverRecordDetailApi from '@/api/wms/deliverRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { getJmreportBaseUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
const { loadStart, loadDone } = usePageLoading()
//
defineOptions({ name: 'SkylightCarpet' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const businessType = ref()
const importFileName = ref()
const importUrl = ref('')
const importExtend = ref('')
console.log(99 , routeName.value)
const tableColumns = ref([...DeliverRecordMain.allSchemas.tableColumns,...DeliverRecordDetail.allSchemas.tableMainColumns])
const { tableObject, tableMethods } = useTable({
getListApi: DeliverRecordDetailApi.getDeliverRecordDetailPage //
})
importUrl.value = '/wms/deliver-record-main/import-shipment'
//
if (routeName.value == 'ToyotaSupplies') {
tableObject.params = {
businessType: 'ToyotaSupplies'
}
businessType.value = 'ToyotaSupplies'
importFileName.value = '丰田补给品发货记录'
importExtend.value = 'ToyotaSupplies'
} else if (routeName.value == 'SSProduct') {
tableObject.params = {
businessType: 'SSProduct'
}
businessType.value = 'SSProduct'
importFileName.value = 'SS品发货记录'
importExtend.value = 'SSProduct'
} else if (routeName.value == 'SkylightCarpet') {
tableObject.params = {
businessType: 'SkylightCarpet'
}
businessType.value = 'SkylightCarpet'
importFileName.value = '天井地毯发货记录'
importExtend.value = 'SkylightCarpet'
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultImportBtn({hasPermi:`wms:${routeName.value}:import`}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
]
//
const buttonBaseClick = (val, item) => {
if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
searchFormClick({
filters: tableObject.params.filters
})
} else {
getList()
}
} else if (val == 'filtrate') { //
} else if (val == 'import') { //
handleImport()
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if(findIndex>-1&&findIndex<$index){
return []
}else{
return [defaultButtons.mainListDocumentPrintBtn(null),] //
}
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'documentPrint') { //
handlePoint(row)
}
}
//
const { wsCache } = useCache()
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode))
detailRef.value.openDetail(row, titleName, titleValue,'recordDeliverMain')
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
loadStart()
const excelTitle = ref(route.meta.title)
const data = await DeliverRecordMainApi.exportDeliverRecordMain(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
loadDone()
}
}
const BASE_URL = getJmreportBaseUrl()
const src = ref(BASE_URL + '/jmreport/view/929209659733770240?token=' + getAccessToken())
//
const handlePoint = async (row) => {
window.open(src.value+'&id='+row.masterId)
}
//
const searchFormClick = (searchData) => {
tableObject.params.isSearch = true
console.log('searchData',searchData.filters);
if(!searchData.filters){//
searchData.filters = []
}
let filters = [...searchData.filters]
if (routeName.value == 'ToyotaSupplies') {
if(!filters.find(item=>item.column=='business_type')){
filters = [...filters,{
action:'==',
column:'business_type',
value:'ToyotaSupplies',
}]
}
} else if (routeName.value == 'SSProduct') {
if(!filters.find(item=>item.column=='business_type')){
filters = [...filters,{
action:'==',
column:'business_type',
value:'SSProduct',
}]
}
} else if (routeName.value == 'SkylightCarpet') {
if(!filters.find(item=>item.column=='business_type')){
filters = [...filters,{
action:'==',
column:'business_type',
value:'SkylightCarpet',
}]
}
}
tableObject.params.filters = filters
getList() //
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importSuccess = () => {
getList()
}
/** 初始化 **/
onMounted(async () => {
if (routeName.value == 'ToyotaSupplies') {
tableObject.params.businessType = 'ToyotaSupplies'
} else if (routeName.value == 'SSProduct') {
tableObject.params.businessType = 'SSProduct'
} else if (routeName.value == 'SkylightCarpet') {
tableObject.params.businessType = 'SkylightCarpet'
}
getList()
})
</script>

2
src/views/wms/deliversettlementManage/unfinishedShipmentMain/index.vue

@ -60,7 +60,7 @@
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/unfinished-shipment-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
<ImportForm ref="importFormRef" url="/wms/unfinished-shipment-main/import" :importTemplateData="importTemplateData" @success="importSuccess"/>
</template>
<script setup lang="ts">

Loading…
Cancel
Save