Browse Source

Merge remote-tracking branch 'remotes/origin/intex_20250617_panDian' into intex

intex
songguoqiang 15 hours ago
parent
commit
f3000b8ac8
  1. 31
      src/api/wms/countCompare/index.ts
  2. 64
      src/api/wms/countCompareDetail/index.ts
  3. 956
      src/views/wms/countManage/count/countCompare/countCompare.data.ts
  4. 261
      src/views/wms/countManage/count/countCompare/index.vue
  5. 242
      src/views/wms/countManage/count/countCompareDetail/countCompareDetail.data.ts
  6. 265
      src/views/wms/countManage/count/countCompareDetail/index.vue
  7. 17
      src/views/wms/inventoryManage/differenceRecord/differenceRecord.data.ts
  8. 9
      src/views/wms/inventoryManage/differenceRequest/differenceRequest.data.ts
  9. 5
      src/views/wms/inventoryManage/differenceRequest/index.vue

31
src/api/wms/countCompare/index.ts

@ -0,0 +1,31 @@
import request from '@/config/axios'
export const getCountComparePlanPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/count-compare/senior', data })
} else {
return await request.get({ url: `/wms/count-compare/planPage`, params })
}
}
export const getCountComparePage = async (params) => {
return await request.get({ url: `/wms/count-compare/comparePage`, params })
}
// 导出盘点对比主 Excel
export const exportCountComparePlan = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.downloadPost({ url: '/wms/count-compare/export-excel-senior', data })
} else {
return await request.download({ url: `/wms/count-compare/export-excel`, params })
}
}
export const exportCountCompareDetail = async (params) => {
return await request.download({ url: `/wms/count-compare/export-compare-excel`, params })
}

64
src/api/wms/countCompareDetail/index.ts

@ -0,0 +1,64 @@
import request from '@/config/axios'
export interface CountCompareDetailVO {
planNumber: string
batch: string
inventoryStatus: string
itemCode: string
itemName: string
locationCode: string
packingNumber: string
initalQty: number
initalDiffQty: number
reQty: number
reQiffQty: number
auditQty: number
auditDiffQty: number
qty: number
countQty: number
remark: string
inventoryTypes:string
stocktakingMode:string
planCountRemark:string
type:string}
// 查询采购订单主列表
export const getDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/count-compare-detail/senior', data })
} else {
return await request.get({ url: `/wms/count-compare-detail/page`, params })
}
}
// 查询采购订单主详情
export const getDetail = async (id: number) => {
return await request.get({ url: `/wms/count-compare-detail/get?id=` + id })
}
// 新增采购订单主
export const createDetail = async (data: CountCompareDetailVO) => {
return await request.post({ url: `/wms/count-compare-detail/create`, data })
}
// 修改采购订单主
export const updateDetail = async (data: CountCompareDetailVO) => {
return await request.put({ url: `/wms/count-compare-detail/update`, data })
}
// 删除采购订单主
export const deleteDetail = async (id: number) => {
return await request.delete({ url: `/wms/count-compare-detail/delete?id=` + id })
}
// 导出采购订单主 Excel
export const exportDetail = async (params) => {
return await request.download({ url: `/wms/count-compare-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/count-compare-detail/get-import-template' })
}

956
src/views/wms/countManage/count/countCompare/countCompare.data.ts

@ -0,0 +1,956 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import {Itembasic} from "@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data";
import * as ItembasicApi from "@/api/wms/itembasic";
import * as LocationApi from '@/api/wms/location'
import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data'
import * as getPlansettingApi from '@/api/wms/plansetting/index'
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
const queryParams = {
pageSize:10,
pageNo:1,
code:'CountPlan'
}
const data = await getPlansettingApi.getPlansettingPage(queryParams)
const plansettingData =data?.list[0]||{}
export const CountCompareMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.PLAN_STATUS,
dictClass: 'string',
isSearch: false,
isForm: false,
isTable: false,
sort: 'custom',
table: {
width: 150
},
},
{
label: '',//执行周期
field: 'crontab',
sort: 'custom',
table: {
width: 150
},
isDetail:false,
isTable:false,
form:{
componentProps:{
disabled:true
}
}
},
{
label: '冻结盘点',
field: 'isFreeze',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
form: {
component: 'Switch',
value: 'FALSE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
sort: 'custom',
table: {
width: 150
},
},
{
label: '盘点空库位',
field: 'isCountEmptyLocation',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
form: {
component: 'Switch',
value: 'FALSE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
sort: 'custom',
table: {
width: 150
},
},
{
label: '盘点零库存',
field: 'isCountZeroInventory',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
form: {
component: 'Switch',
value: 'FALSE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
sort: 'custom',
table: {
width: 150
},
},
{
label: '盘点负库存',
field: 'isCountNegativeInventory',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
form: {
component: 'Switch',
value: 'FALSE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
sort: 'custom',
table: {
width: 150
},
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
table: {
width: 150
},
isTable:false,
isForm: false,
form: {
value: 'Count',
componentProps: {
disabled: true
}
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isTable:false,
isForm: false,
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isTable:false,
isForm: false,
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: 'beginTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
isTable: false,
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '结束时间',
field: 'endTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
isTable: false,
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: false,
isTable: false,
isForm: false,
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
},
{
label: '自动提交',
field: 'autoCommit',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
isForm: false,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: plansettingData.autoCommit,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '自动通过',
field: 'autoAgree',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
isForm: false,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: plansettingData.autoAgree,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '自动执行',
field: 'autoExecute',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
isForm: false,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: plansettingData.autoExecute,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '最后更新时间',
field: 'updateTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isForm: false,
isTable: false,
},
{
label: '最后更新者',
field: 'updater',
sort: 'custom',
table: {
width: 150
},
isTable:false,
isForm: false,
},{
label: '物料忽略名单',
field: 'ignoreListOfItem',
sort: 'custom',
table: {
width: 150
},
isForm:false,
isTable: false,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
multiple:true,//是否可以多选
searchListPlaceholder: '请选择物料忽略名单', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '物料信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage // 查询弹窗所需分页方法
}
}
},
{
label: '库位忽略名单',
field: 'ignoreListOfLocation',
sort: 'custom',
table: {
width: 150
},
isForm: false,
isTable: false,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
multiple:true,//是否可以多选
searchListPlaceholder: '请选择库位忽略名单', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '库位信息', // 查询弹窗标题
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
searchPage: LocationApi.getLocationPage // 查询弹窗所需分页方法
}
}
},
{
label: '快照盘点',
field: 'isSnapshot',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
isForm:false,
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
sort: 'custom',
table: {
width: 150
},
},
{
label: '计划单号',
field: 'planNumber',
sort: 'custom',
isSearch: true,
// table: {
// width: 150
// },
},
// {
// label: '盘点类型',
// field: 'type',
// dictType: DICT_TYPE.COUNT_TYPE,
// dictClass: 'string',
// isTable: true,
// sort: 'custom',
// table: {
// width: 150
// },
// form: {
// value:'MANUAL',
// },
// isSearch: true
// },
{
label: '任务拆分方式',
field: 'countSplitType',
dictType: DICT_TYPE.COUNT_SPLIT_TYPE,
dictClass: 'string',
sort: 'custom',
// table: {
// width: 150
// },
isTable:true,
isForm: true,
form: {
value: 'locationCode'
}
},
{
label: '阶段',
field: 'stage',
dictType: DICT_TYPE.COUNT_STAGE,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
// table: {
// width: 150
// },
},
{
label: '申请时间',
field: 'requestTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
// table: {
// width: 180
// },
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
// },
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
// table: {
// width: 150
// },
},
{
label: '明盘',
field: 'isOpenCount',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
form: {
component: 'Switch',
value: 'FALSE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
sort: 'custom',
// table: {
// width: 150
// },
},
{
label: '维度',
field: 'dimension',
dictType: DICT_TYPE.COUNT_DIMENSION,
dictClass: 'string',
isTable: true,
sort: 'custom',
// table: {
// width: 150
// },
form: {
value: 'BY_INEVNEOTY'
}
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 180,
fixed: 'right'
},
}
]))
/**
* @returns {Array}
*/
/*export const CountCompareDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '库位代码',
field: 'locationCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
},
{
label: '包装号',
field: 'packingNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
}
},
{
label: '盘点数量',
field: 'countQty',
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: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
label: '物料描述',
field: 'itemDesc1',
sort: 'custom',
table: {
width: 150
},
},
{
label: '物料描述2',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
},
{
label: '盘点明细号',
field: 'countDetailNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180
},
},
{
label: '盘点时间',
field: 'countTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '盘点人',
field: 'countUser',
sort: 'custom',
table: {
width: 150
},
},
{
label: '库位组代码',
field: 'locationGroupCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '库区代码',
field: 'areaCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '货主代码',
field: 'ownerCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '项目代码',
field: 'projectCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
}
]))*/
export const CountCompareDetail = useCrudSchemas(<CrudSchema[]>([
{
label: '盘点范围类型',
field: 'type',
dictType: DICT_TYPE.COUNT_SCOPE_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 400
},
tableForm: {
type: 'Select',
width: '300'
}
},
{
label: '盘点范围值',
field: 'value',
isTable: true,
sort: 'custom',
table: {
width: 300
},
tableForm: {
width: 400,
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择盘点范围类型',
searchField: 'type',
multiple:true,//是否可以多选
searchTitle: '物料信息',
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法
verificationPage: ItembasicApi.getItemListByCodes, // tableForm下方输入框校验失去焦点之后是否正确的方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: 'true',
isFormModel: true
}], // 失去焦点校验参数
},
form: {
componentProps: {
disable:true,
isSearchList: true, // 开启查询弹窗
multiple:true,//是否可以多选
searchListPlaceholder: '请选择盘点范围类型', // 输入框占位文本
searchField: 'type', // 查询弹窗赋值字段
searchTitle: '物料信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage // 查询弹窗所需分页方法
}
}
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false ,
table: {
width: 150,
fixed: 'right'
},
hiddenInMain:true,
isTableForm:false,
}
]))
export const CountCompareDiffDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '计划单号',
field: 'planNumber',
sort: 'custom',
table: {
width: 180,
fixed: 'left'
}
},
{
label: '库位代码',
field: 'locationCode',
sort: 'custom',
table: {
width: 120
},
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 120
},
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 100
},
},
{
label: '包装号',
field: 'packingNumber',
sort: 'custom',
table: {
width: 150
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 140
},
form: {
component: 'InputNumber',
}
},
{
label: '初盘数量',
field: 'initalQty',
sort: 'custom',
table: {
width: 140
},
form: {
component: 'InputNumber',
}
},
{
label: '复盘数量',
field: 'reQty',
sort: 'custom',
table: {
width: 140
},
form: {
component: 'InputNumber',
}
},
{
label: '差异数量',
field: 'diffQty',
sort: 'custom',
table: {
width: 140
},
form: {
component: 'InputNumber',
}
},
{
label: '监盘数量',
field: 'auditQty',
sort: 'custom',
table: {
width: 140
},
form: {
component: 'InputNumber',
}
}
]))

261
src/views/wms/countManage/count/countCompare/index.vue

@ -0,0 +1,261 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="CountCompareMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="CountCompareMain.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 #planNumber="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.planNumber)">
<span>{{ row.planNumber }}</span>
</el-button>
</template>
<template #action="{ row,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="CountCompareMain.allSchemas"
:detailAllSchemas="CountCompareDetail.allSchemas"
:apiPage="CountPlanDetailApi.getCountPlanDetailPage"
:detailButtonIsShowFilter="false"
fromeWhere="countPlan"
:allList="allList"
:countScopeType="getStrDictOptions(DICT_TYPE.COUNT_SCOPE_TYPE)"
:countPlanAllList="countPlanAllList"
/>
<!-- 盘点对比列表 -->
<Dialog
:title="DialogTitle"
v-model="diffModelVisible"
width="80%"
:scroll="false"
max-height="450px"
>
<CountCompareDetailTable ref="compareTable"/>
<!-- <Table
:columns="CountCompareDiffDetail.allSchemas.tableColumns"
:data="diffTableData.tableList"
:loading="diffTableData.loading"
:pagination="{
total: diffTableData.total
}"
v-model:pageSize="diffTableData.pageSize"
v-model:currentPage="diffTableData.currentPage"
v-model:sort="diffTableData.sort"
>
<template #diffQty="{row}">
<span style="color:#f56c6c">{{ row.diffQty }}</span>
</template>
</Table> -->
<template #footer>
<div class="flex">
<div style="flex:1"></div>
<div class="tableNavRightBtns">
<!-- <el-button @click="handleExportDetail" type="primary">导出</el-button> -->
<!-- <el-button @click="diffModelVisible = false"> </el-button> -->
</div>
</div>
</template>
</Dialog>
</template>
<script setup lang="ts">
import {CountCompareMain, CountCompareDetail, CountCompareDiffDetail} from "@/views/wms/countManage/count/countCompare/countCompare.data";
import * as CountCompareApi from '@/api/wms/countCompare'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import * as CountPlanDetailApi from "@/api/wms/countPlanDetail";
import {DICT_TYPE, getStrDictOptions} from "@/utils/dict";
import download from "@/utils/download";
import {formatDate} from "@/utils/formatTime";
import CountCompareDetailTable from '@/views/wms/countManage/count/countCompareDetail/index.vue'
import { usePageLoading } from '@/hooks/web/usePageLoading'
const { loadStart, loadDone } = usePageLoading()
const message = useMessage() //
// const { t } = useI18n() //
const countPlanAllList = ref([])
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const DialogTitle = ref('盘点对比列表')
const diffModelVisible = ref(false)
const { tableObject: diffTableData, tableMethods: diffTableMethods } = useTable({
getListApi: CountCompareApi.getCountComparePage
})
const { getList: getDiffList } = diffTableMethods
const tableColumns = ref(CountCompareMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: CountCompareApi.getCountComparePlanPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultExportBtn({hasPermi:'wms:count-record-main:export'}), //
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 { //
console.log('其他按钮', item)
}
}
// -
const butttondata = (row,$index) => {
return [
defaultButtons.mainCountAdjustRequesttBtn({
hasPermi: 'wms:count-record-main:generate'
}), //
{
label: '盘点对比',
name: 'countCompare',
type: 'primary',
color: '',
link: true, //
hasPermi: '' // wms:count-job-main:exportCountJob
}
]
}
const compareTable = ref()
// -
const buttonTableClick = async (val, row) => {
if(val == 'countCompare'){
diffModelVisible.value = true
DialogTitle.value = '盘点计划 ' + row.planNumber + ' 盘点对比列表'
// diffTableData.params = {
// planNumber: row.planNumber
// }
// await getDiffList()
nextTick(()=>{
compareTable.value.open(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,"recordCountMain")
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
loadStart()
const excelTitle = ref(route.meta.title)
const data = await CountCompareApi.exportCountComparePlan(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
loadDone()
}
}
const handleExportDetail = async () => {
compareTable.value.handleExport()
// try {
// //
// await message.exportConfirm()
// //
// loadStart()
// const excelTitle = ref(route.meta.title)
// const data = await CountCompareApi.exportCountCompareDetail(diffTableData.params)
// download.excel(data, `${excelTitle.value}${formatDate(new Date())}.xlsx`)
// } catch {
// } finally {
// loadDone()
// }
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
const allList = ref({
ownerAllList: [],
supplierAllList: [],
customerAllList: [],
itembasicAllList: [],
warehouseAllList: [],
areaAllList: [],
locationgroupAllList: [],
locationAllList: [],
abcList: getStrDictOptions(DICT_TYPE.ABC_CLASS),
itemTypeList: getStrDictOptions(DICT_TYPE.ITEM_TYPE),
itemGroupList: getStrDictOptions(DICT_TYPE.ITEM_GROUP)
})
/** 初始化 **/
onMounted(async () => {
getList()
})
</script>

242
src/views/wms/countManage/count/countCompareDetail/countCompareDetail.data.ts

@ -0,0 +1,242 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
// 表单校验
export const CountCompareDetailRules = reactive({
available: [required],
concurrencyStamp: [required]
})
export const CountCompareDetail = useCrudSchemas(
reactive<CrudSchema[]>([
// {
// label: 'id',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
{
label: '计划单号',
field: 'planNumber',
sort: 'custom',
isSearch: false,
hiddenSearchHigh: true,
table:{
width:150
}
},
// {
// label: '盘点计划种类',
// field: 'inventoryTypes',
// isTable: true,
// sort: 'custom',
// dictType: DICT_TYPE.INVENTORY_TYPES,
// dictClass: 'string',
// table: {
// width: 150
// },
// form: {
// component: 'Radio',
// value: '1',
// componentProps: {
// options: getDictOptions(DICT_TYPE.INVENTORY_TYPES),
// },
// colProps: {
// span: 24
// }
// }
// },
// {
// label: '盘点计划描述',
// field: 'planCountRemark',
// sort: 'custom',
// table: {
// width: 150
// },
// isForm: true,
// form: {
// componentProps: {
// maxlength:20,
// },
// colProps: {
// span: 24
// }
// }
// },
// {
// label: '盘点计划方式',
// field: 'stocktakingMode',
// isTable: true,
// sort: 'custom',
// table: {
// width: 150
// },
// dictType: DICT_TYPE.STOCKTAKING_MODE,
// dictClass: 'string',
// form: {
// component: 'Radio',
// value: '1',
// componentProps: {
// options: getDictOptions(DICT_TYPE.STOCKTAKING_MODE),
// },
// colProps: {
// span: 24
// }
// }
// },
{
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
sort: 'custom',
isSearch: true,
form: {
component: 'Radio'
},
table:{
width:150
}
},
{
label: '品番',
field: 'itemCode',
sort: 'custom',
isSearch: true,
table:{
width:150
}
},
{
label: '品名',
field: 'itemName',
sort: 'custom',
isSearch: true,
table:{
width:150
}
},
{
label: '背番',
field: 'backNumber',
sort: 'custom',
hiddenSearchHigh:false,
isSearch: true,
table:{
width:150
}
},
{
label: '车型',
field: 'project',
hiddenSearchHigh:false,
sort: 'custom',
isSearch: false,
table:{
width:150
}
},
{
label: '库位代码',
field: 'locationCode',
sort: 'custom',
isSearch: true,
table:{
width:150
}
},
{
label: '包装号',
field: 'packingNumber',
sort: 'custom',
isSearch: true
},
{
label: '账面数量',
field: 'qty',
sort: 'custom',
},
{
label: '盘点数量',
field: 'initalQty',
sort: 'custom',
table:{
width:150
}
},
{
label: '盘点差异数量',
field: 'initalDiffQty',
sort: 'custom',
table:{
width:150
}
},
// {
// label: '抽盘数量',
// field: 'auditQty',
// sort: 'custom',
// },
// {
// label: '抽盘差异数量',
// field: 'auditDiffQty',
// sort: 'custom',
// },
// {
// label: '复盘数量',
// field: 'reQty',
// sort: 'custom',
// table:{
// width:150
// }
// },
// {
// label: '复盘差异数量',
// field: 'reQiffQty',
// sort: 'custom',
// table:{
// width:150
// }
// },
// {
// label: '备注',
// field: 'remark',
// sort: 'custom',
// },
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
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')]
}
},
table:{
width:150
}
// isForm: false
// },
// {
// label: '操作',
// field: 'action',
// isForm: false,
// isDetail: false,
// table: {
// width: 150,
// fixed: 'right'
// }
}
])
)

265
src/views/wms/countManage/count/countCompareDetail/index.vue

@ -0,0 +1,265 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="CountCompareDetail.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="CountCompareDetail.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:scrollbarAlwaysOn="true"
: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 #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</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="submitForm"
:rules="CountCompareDetailRules"
:formAllSchemas="CountCompareDetail.allSchemas"
:apiUpdate="CountCompareDetailApi.updateDetail"
:apiCreate="CountCompareDetailApi.createDetail"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<CountCompareDetailVO ref="detailRef" :isBasic="true" :allSchemas="CountCompareDetail.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/countCompare/detail/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import {CountCompareDetail, CountCompareDetailRules} from './countCompareDetail.data'
import * as CountCompareDetailApi from '@/api/wms/countCompareDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
const { loadStart, loadDone } = usePageLoading()
defineOptions({ name: 'CountCompareDetail' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(CountCompareDetail.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => {
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
} else {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: CountCompareDetailApi.getDetailPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:detail:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:detail:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:count-compare-detail:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
// defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
//
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row,$index) => {
return [
defaultButtons.mainListEditBtn({ hide: isShowMainButton(row, ['1']),hasPermi:'wms:detail:update'}), //
defaultButtons.mainListDeleteBtn({ hide: isShowMainButton(row, ['1']),hasPermi:'wms:detail:delete'}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, row?: any) => {
formRef.value.open(type, row)
}
// form
const submitForm = async (formType,submitData) => {
let data = {...submitData}
try {
if (formType === 'create') {
await CountCompareDetailApi.createDetail(data)
message.success(t('common.createSuccess'))
} else {
await CountCompareDetailApi.updateDetail(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
getList()
}finally {
formRef.value.formLoading = false
}
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicDetail')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await CountCompareDetailApi.deleteDetail(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const excelTitle = ref(route.meta.title)
const data = await CountCompareDetailApi.exportDetail(tableObject.params)
const time = formatDate(new Date())
download.excel(data, `${excelTitle.value}】【${time}】.xlsx`)
} catch {
} finally {
loadDone()
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '采购订单主导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
const open = ({planNumber})=>{
tableObject.params.planNumber = planNumber
getList()
}
defineExpose({
open,handleExport
})
/** 初始化 **/
onMounted(async () => {
importTemplateData.templateUrl = await CountCompareDetailApi.importTemplate()
})
</script>

17
src/views/wms/inventoryManage/differenceRecord/differenceRecord.data.ts

@ -189,7 +189,20 @@ export const DifferenceRecordDetail = useCrudSchemas(
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false
}
isTableForm: false,
isForm: false,
tableForm: {
disabled: true
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
])
)

9
src/views/wms/inventoryManage/differenceRequest/differenceRequest.data.ts

@ -312,8 +312,17 @@ export const DifferenceRequestDetail = useCrudSchemas(
isForm: false,
tableForm: {
disabled: true
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '创建人',
field: 'creator',

5
src/views/wms/inventoryManage/differenceRequest/index.vue

@ -315,6 +315,11 @@ const submitForm = async (formType,submitData) => {
data.subList = tableData.value
try {
if (formType === 'create') {
for (const item of data.subList) {
if (item.requestQty <= 0) {
message.warning('数量必须大于0')
return // submitForm
}}
await DifferenceRequestMainApi.createMain(data)
message.success(t('common.createSuccess'))
} else {

Loading…
Cancel
Save