Browse Source

库存余额显示批次问题

intex
zhang_li 2 weeks ago
parent
commit
42cdff7e87
  1. 14
      src/utils/disposition/defaultButtons.ts
  2. 84
      src/views/wms/inventoryManage/balance/index.vue
  3. 75
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts

14
src/utils/disposition/defaultButtons.ts

@ -235,6 +235,20 @@ export function defaultDeselectAllBtn(option: any) {
hasPermi: '' hasPermi: ''
}) })
} }
// form表单-保存按钮
export function formSureBtn(option: any) {
return __defaultBtnOption(option, {
label: t(`ts.确定`).replace('ts.', ''),
name: 'sure',
hide: false,
type: 'primary',
icon: 'ep:select',
color: '',
float: 'right',
hasPermi: ''
})
}
// form表单-保存按钮 // form表单-保存按钮
export function formSaveBtn(option: any) { export function formSaveBtn(option: any) {
return __defaultBtnOption(option, { return __defaultBtnOption(option, {

84
src/views/wms/inventoryManage/balance/index.vue

@ -76,7 +76,23 @@
/> />
<!-- 标签打印 --> <!-- 标签打印 -->
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccessLabel" /> // <SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccessLabel" />
<BasicForm
ref="labelPointFormRef"
@success="getList"
:tableAllSchemas="SupplierdeliverRequestPackage.allSchemas"
:tableFormRules="SupplierdeliverRequestPackageRules"
:tableData="detatableData1"
:isBusiness="true"
:isShowButton="false"
@searchTableSuccess="searchTableSuccessLabel"
:isShowReduceButton="false"
@clearInput="clearInput"
:footButttondata="footButttondata"
@footButtonClick="footButtonClick"
/>
<!-- 导入 --> <!-- 导入 -->
<ImportForm <ImportForm
@ -103,8 +119,10 @@ import { getJmreportBaseUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading' import { usePageLoading } from '@/hooks/web/usePageLoading'
import { import {
SupplierdeliverRequestPackage SupplierdeliverRequestPackage,
SupplierdeliverRequestPackageRules
} from '@/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data' } from '@/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data'
console.log(222,SupplierdeliverRequestPackage)
const { loadStart, loadDone } = usePageLoading() const { loadStart, loadDone } = usePageLoading()
// //
defineOptions({ name: 'Balance' }) defineOptions({ name: 'Balance' })
@ -309,23 +327,21 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
const BASE_URL = getJmreportBaseUrl() const BASE_URL = getJmreportBaseUrl()
const labelType = ref('') // const labelType = ref('') //
const labelPointFormRef = ref()
const detatableData1 = ref([])
const handlePoint = async (row) => { const handlePoint = async (row) => {
console.log(2333) await getLabelDetailPage(row,false)
tableObject.loading = true labelPointFormRef.value.open('create', row, null, 'createLabel') // createLabel
//
// await getLabelType(row,false)
await getLabelDetailPage(row, false)
} }
const searchTableRef = ref() const searchTableRef = ref()
const getLabelDetailPage = async (row, useToPackingNumber) => { const getLabelDetailPage = async (row, useToPackingNumber) => {
//// ////
let defaultParams = { let defaultParams = {
moduleName: 'move', moduleName: 'move',
recordNumber: '', recordNumber: '',
itemCode: row.itemCode, itemCode: row.itemCode,
packQty: row.packQty,
batch: row.batch batch: row.batch
} }
const { tableObject: tableObjectPrint, tableMethods } = useTable({ const { tableObject: tableObjectPrint, tableMethods } = useTable({
@ -335,13 +351,21 @@ const getLabelDetailPage = async (row, useToPackingNumber) => {
// //
const { getList: getListPrint } = tableMethods const { getList: getListPrint } = tableMethods
await getListPrint() await getListPrint()
console.log('tableObjectPrint', tableObjectPrint)
tableObject.loading = false tableObject.loading = false
const tableColumns = SupplierdeliverRequestPackage.allSchemas.tableFormColumns const tableColumns = SupplierdeliverRequestPackage.allSchemas.tableFormColumns
tableColumns.forEach((item) => { tableColumns.forEach((item) => {
item.width = item.table?.width || 150 item.width = item.table?.width || 150
}) })
searchTableRef.value.openData('标签信息', tableObjectPrint, { tableColumns }, true) detatableData1.value = tableObjectPrint.tableList
detatableData1.value.forEach(item => {
if (!item.batch) {
item.batch = formatDate(new Date(),'YYYYMMDD')
item['disabled_batch'] = false
} else {
item['disabled_batch'] = true
}
})
// searchTableRef.value.openData('', tableObjectPrint, { tableColumns }, true)
} }
// -- // --
@ -440,6 +464,44 @@ const changeTabs = (item) => {
apiPage.value = '' apiPage.value = ''
} }
} }
const footButttondata = ref([
defaultButtons.formSureBtn(null), //
defaultButtons.formCloseBtn(null) // BOM
])
const footButtonClick = async (val) => {
if (val == 'sure') {
const validateForm = await labelPointFormRef.value.tableFormRef.validateForm()
// console.log(11,detatableData1.value)
if (!validateForm) {
return
}
pointLabel()
} else if (val == 'close') {
labelPointFormRef.value.dialogVisible = false
}
}
const pointLabel = async () => {
const array =detatableData1.value.map(item=>{
return {
packingNumber:item.number,
batch: item.batch,
printQty:item.printQty,
}
})
console.log(array)
const isHave = detatableData1.value.find(item => parseFloat(item.printQty) <= 0)
if(isHave){
message.error(`物料号${isHave.itemCode}打印数量不可以为0`)
return;
}
await PackageApi.batchPrintingLable({pointParams:array}).then(res => {
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res)
}).catch(err => {
console.log(err)
message.error('创建标签失败')
})
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

75
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts

@ -1775,16 +1775,32 @@ export const SupplierdeliverRequestDetailLabel = useCrudSchemas(reactive<CrudSch
}, },
])) ]))
//表单校验
export const SupplierdeliverRequestPackageRules = reactive({
batch: [
{ required: true, message: '请输入批次', trigger: 'change' },
{ max: 50, message: '不得超过50个字符', trigger: 'change' },
{ validator: validateBatch, trigger: 'change' }
],
printQty: [
{ required: true, message: '请输入打印数量', trigger: 'blur' },
{ validator: validateInteger, message: '请输入正确的整数', trigger: 'blur' }
],
})
export const SupplierdeliverRequestPackage = useCrudSchemas(reactive<CrudSchema[]>([ export const SupplierdeliverRequestPackage = useCrudSchemas(reactive<CrudSchema[]>([
{ // {
label: '包装号', // label: '包装号',
field: 'number', // field: 'number',
sort: 'custom', // sort: 'custom',
isSearch: true, // isSearch: true,
table: { // table: {
fixed: 'left' // },
}, // tableForm: {
}, // disabled: true
// }
// },
{ {
label: '物料代码', label: '物料代码',
field: 'itemCode', field: 'itemCode',
@ -1792,21 +1808,48 @@ export const SupplierdeliverRequestPackage = useCrudSchemas(reactive<CrudSchema[
isSearch: true, isSearch: true,
table: { table: {
}, },
tableForm: {
disabled: true
}
}, },
{ {
label: '批次', label: '批次',
field: 'batch', field: 'batch',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: { tableForm: {
}, type: 'FormDate',
format: 'YYYYMMDD',
valueFormat: 'YYYYMMDD',
}
}, },
{ {
label: '数量', label: '打印数量',
field: 'qty', field: 'printQty',
sort: 'custom', sort: 'custom',
table: { table: {
}, },
tableForm: {
type: 'InputNumber',
precision: 0,
min:0
}
},
{
label: '包装规格',
field: 'packUnit',
sort: 'custom',
tableForm: {
disabled: true
}
},
{
label: '标包数量',
field: 'packQty',
sort: 'custom',
tableForm: {
disabled: true
}
}, },
{ {
label: '计量单位', label: '计量单位',
@ -1815,10 +1858,14 @@ export const SupplierdeliverRequestPackage = useCrudSchemas(reactive<CrudSchema[
dictType: DICT_TYPE.UOM, dictType: DICT_TYPE.UOM,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑 dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: { form: {
component: 'SelectV2' component: 'Select'
}, },
table: { table: {
}, },
tableForm: {
type: 'Select',
disabled: true
}
}, },
])) ]))

Loading…
Cancel
Save