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: ''
})
}
// 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表单-保存按钮
export function formSaveBtn(option: any) {
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
@ -103,8 +119,10 @@ import { getJmreportBaseUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading'
import {
SupplierdeliverRequestPackage
SupplierdeliverRequestPackage,
SupplierdeliverRequestPackageRules
} from '@/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data'
console.log(222,SupplierdeliverRequestPackage)
const { loadStart, loadDone } = usePageLoading()
//
defineOptions({ name: 'Balance' })
@ -309,23 +327,21 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
const BASE_URL = getJmreportBaseUrl()
const labelType = ref('') //
const labelPointFormRef = ref()
const detatableData1 = ref([])
const handlePoint = async (row) => {
console.log(2333)
tableObject.loading = true
//
// await getLabelType(row,false)
await getLabelDetailPage(row, false)
await getLabelDetailPage(row,false)
labelPointFormRef.value.open('create', row, null, 'createLabel') // createLabel
}
const searchTableRef = ref()
const getLabelDetailPage = async (row, useToPackingNumber) => {
////
let defaultParams = {
moduleName: 'move',
recordNumber: '',
itemCode: row.itemCode,
packQty: row.packQty,
batch: row.batch
}
const { tableObject: tableObjectPrint, tableMethods } = useTable({
@ -335,13 +351,21 @@ const getLabelDetailPage = async (row, useToPackingNumber) => {
//
const { getList: getListPrint } = tableMethods
await getListPrint()
console.log('tableObjectPrint', tableObjectPrint)
tableObject.loading = false
const tableColumns = SupplierdeliverRequestPackage.allSchemas.tableFormColumns
tableColumns.forEach((item) => {
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 = ''
}
}
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 () => {
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[]>([
{
label: '包装号',
field: 'number',
sort: 'custom',
isSearch: true,
table: {
fixed: 'left'
},
},
// {
// label: '包装号',
// field: 'number',
// sort: 'custom',
// isSearch: true,
// table: {
// },
// tableForm: {
// disabled: true
// }
// },
{
label: '物料代码',
field: 'itemCode',
@ -1792,21 +1808,48 @@ export const SupplierdeliverRequestPackage = useCrudSchemas(reactive<CrudSchema[
isSearch: true,
table: {
},
tableForm: {
disabled: true
}
},
{
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true,
table: {
},
tableForm: {
type: 'FormDate',
format: 'YYYYMMDD',
valueFormat: 'YYYYMMDD',
}
},
{
label: '数量',
field: 'qty',
label: '打印数量',
field: 'printQty',
sort: 'custom',
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: '计量单位',
@ -1815,10 +1858,14 @@ export const SupplierdeliverRequestPackage = useCrudSchemas(reactive<CrudSchema[
dictType: DICT_TYPE.UOM,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'SelectV2'
component: 'Select'
},
table: {
},
tableForm: {
type: 'Select',
disabled: true
}
},
]))

Loading…
Cancel
Save