Browse Source

新版采购退货申请功能

hella_online_20240816
wangyufei 3 months ago
parent
commit
55e8efb871
  1. 4
      src/api/wms/purchasereturnRequestDetail/index.ts
  2. 8
      src/components/BasicForm/src/BasicForm.vue
  3. 283
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue
  4. 60
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/purchasereturnRequestMainNew.data.ts

4
src/api/wms/purchasereturnRequestDetail/index.ts

@ -45,6 +45,10 @@ export const getPurchasereturnSupplierByCode = async (params) => {
export const getPurchasereturnPurchasereceiptRecordByItemCode = async (params) => { export const getPurchasereturnPurchasereceiptRecordByItemCode = async (params) => {
return await request.get({ url: `/wms/purchasereceipt-record-detail/queryPurchasereceiptRecordByItemCode`, params }) return await request.get({ url: `/wms/purchasereceipt-record-detail/queryPurchasereceiptRecordByItemCode`, params })
} }
// 选完退货库位 渲染子列表数据
export const getBalancePurchaseReceiptReturn = async (params) => {
return await request.get({ url: `/wms/balance/queryBalancePurchaseReceiptReturn`, params })
}
// 查询采购退货申请子列表 // 查询采购退货申请子列表
export const getPurchasereturnRequestDetailPageSpare = async (params) => { export const getPurchasereturnRequestDetailPageSpare = async (params) => {

8
src/components/BasicForm/src/BasicForm.vue

@ -78,7 +78,7 @@
<el-input v-model="formSchema.value" v-if="isDetail && formTypeDetail == 'InputString'" /> <el-input v-model="formSchema.value" v-if="isDetail && formTypeDetail == 'InputString'" />
</template> </template>
</Form> </Form>
<div class="table" v-if="isBusiness && formType == 'create' && fromeWhere != 'countPlan'"> <div class="table" v-if="(isBusiness && formType == 'create' && fromeWhere != 'countPlan')||(isBusiness && formType == 'update' && updateTypeEdiltSubList && fromeWhere != 'countPlan')">
<TableForm <TableForm
ref="tableFormRef" ref="tableFormRef"
class="w-[100%]" class="w-[100%]"
@ -261,6 +261,12 @@ const props = defineProps({
required: false, required: false,
default: '' default: ''
}, },
//
updateTypeEdiltSubList: {
type: String,
required: false,
default: false
},
// //
countScopeType: { countScopeType: {
type: Array, type: Array,

283
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/index.vue

@ -62,10 +62,12 @@
:apiUpdate="PurchasereturnRequestMainApi.updatePurchasereturnRequestMain" :apiUpdate="PurchasereturnRequestMainApi.updatePurchasereturnRequestMain"
:apiCreate="PurchasereturnRequestMainApi.createPurchasereturnRequestMain" :apiCreate="PurchasereturnRequestMainApi.createPurchasereturnRequestMain"
:isBusiness="true" :isBusiness="true"
:isShowButton="isShowButton" :isShowButton="false"
@handleAddTable="handleAddTable" @handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable" @handleDeleteTable="handleDeleteTable"
:isShowReduceButtonSelection="true" :isShowReduceButtonSelection="false"
:isShowReduceButton="false"
:updateTypeEdiltSubList="true"
@tableSelectionDelete="tableSelectionDelete" @tableSelectionDelete="tableSelectionDelete"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
@submitForm="submitForm" @submitForm="submitForm"
@ -73,7 +75,7 @@
@onChange="onChangeForm" @onChange="onChangeForm"
> >
<template #hahaha> <template #hahaha>
<el-button style="margin-left:90px;width:100%" type="primary" @click="chooseReceiptList">选择收货单明细</el-button> <el-button style="width:100%" type="primary" @click="chooseReceiptList">选择收货单明细</el-button>
</template> </template>
<template #hehehe> <template #hehehe>
@ -124,7 +126,7 @@
@searchTableSuccess="searchTableSuccessLabel" @searchTableSuccess="searchTableSuccessLabel"
/> />
<!-- 标签打印 --> <!-- 标签打印 -->
<SearchTable style="width: 905px" ref="showLabelRef" @searchTableSuccess="showLabelSuccess"/> <SearchTable style="width: 905px" ref="showLabelRef" @searchTableSuccess="showLabelSuccess" />
<!-- 导入 --> <!-- 导入 -->
<ImportForm <ImportForm
ref="importFormRef" ref="importFormRef"
@ -164,8 +166,6 @@ import * as BalanceApi from '@/api/wms/balance'
import { async } from '@antv/x6/lib/registry/marker/async' import { async } from '@antv/x6/lib/registry/marker/async'
import { getJmreportBaseUrl } from '@/utils/systemParam' import { getJmreportBaseUrl } from '@/utils/systemParam'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
// 退 // 退
defineOptions({ name: 'PurchasereturnRequestMainNew' }) defineOptions({ name: 'PurchasereturnRequestMainNew' })
@ -186,36 +186,27 @@ const isShowButton = ref(true)
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
} }
const onChangeForm = (field, cur, formRef)=>{
console.log('onChangeForm',field, cur, formRef)
if(field=='supplierCode'){
//
PurchasereturnRequestMain.allSchemas.formSchema.forEach(item=>{
//
if(item.field=='supplierCode'){
let setV = {}
setV['supplierName'] = item.componentProps.options?.find(el=>el.supplierCode==cur+'')['supplierName']
formRef.value.setValues(setV)
}
})
}else if(field == 'locationCode'){
// 退
tableData.value = [{
'batch':'20240908',
'status':'合格',
'inventoryBalance':300,
'qty':1,
'reason':'200',
'remark':'',
}]
}
}
const onEnter = async (field, value) => { const onEnter = async (field, value) => {
console.log(field, value) console.log(field, value)
if ('supplierCode' == field) {
//
formRef.value.opensearchTable(
'purchaseReceiptRecordNumber',
'number',
'采购收货记录',
PurchasereceiptRecordMain1.allSchemas,
PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageReturn,
[
{
key: 'supplierCode',
value: 'supplierCode',
isMainValue: true
}
]
)
} else if ('purchaseReceiptRecordNumber' == field) {
//
}
} }
// //
@ -260,7 +251,6 @@ const searchTableSuccessLabel = (formField, searchField, val, formRef, type, row
} }
}) })
} }
// //
const searchTableSuccess = async (formField, searchField, val, formRef, type, row) => { const searchTableSuccess = async (formField, searchField, val, formRef, type, row) => {
console.log('searchTableSuccess', formField, searchField, val, formRef, type, row) console.log('searchTableSuccess', formField, searchField, val, formRef, type, row)
@ -281,6 +271,15 @@ const searchTableSuccess = async (formField, searchField, val, formRef, type, ro
if(res&&res.length>0){ if(res&&res.length>0){
PurchasereturnRequestMainNew.allSchemas.formSchema.forEach(item=>{ PurchasereturnRequestMainNew.allSchemas.formSchema.forEach(item=>{
if(item.field == 'supplierCode'){ if(item.field == 'supplierCode'){
//
setV['supplierCode'] = ''
setV['supplierName'] = ''
setV['hahaha'] = ''
setV['poNumber'] = ''
setV['poLine'] = ''
setV['receiptNumber'] = ''
setV['asnNumber'] = ''
tableData.value = []
item.componentProps.options = res item.componentProps.options = res
} }
}) })
@ -295,8 +294,63 @@ const searchTableSuccess = async (formField, searchField, val, formRef, type, ro
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(() => { nextTick(() => {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] if (formField == 'poLine' || formField == 'itemCode') {
console.log(val)
setV['poLine'] = val[0]['poLine']
setV['poNumber'] = val[0]['poNumber']
setV['itemCode'] = val[0]['itemCode']
setV['itemName'] = val[0]['itemName']
setV['itemDesc1'] = val[0]['itemDesc1']
setV['itemDesc2'] = val[0]['itemDesc2']
setV['batch'] = val[0]['toBatch']
setV['altBatch'] = val[0]['altBatch']
setV['containerNumber'] = val[0]['toContainerNumber']
setV['receiptQty'] = val[0]['qty']
setV['qty'] = val[0]['qty']
setV['uom'] = val[0]['uom']
setV['supplierQty'] = val[0]['supplierQty']
setV['supplierUom'] = val[0]['supplierUom']
setV['inventoryStatus'] = val[0]['inventoryStatus']
// setV['fromLocationCode'] = val[0]['toLocationCode']
// setV['toLocationCode'] = val[0]['toLocationCode']
setV['fromLocationGroupCode'] = val[0]['locationGroupCode']
setV['toLocationGroupCode'] = null
setV['toWarehouseCode'] = null
setV['toAreaTypes'] = null
setV['fromAreaCode'] = val[0]['areaCode']
setV['toAreaCode'] = val[0]['toAreaCode']
setV['fromQwnerCode'] = val[0]['fromQwnerCode']
setV['toOwnerCode'] = val[0]['toOwnerCode']
setV['arriveDate'] = val[0]['arriveDate']
setV['produceDate'] = val[0]['produceDate']
setV['expireDate'] = val[0]['expireDate']
setV['convertRate'] = val[0]['convertRate']
setV['visualInspectResult'] = val[0]['visualInspectResult']
setV['visualInspectPhotos'] = val[0]['visualInspectPhotos']
setV['failedReason'] = val[0]['failedReason']
setV['singlePrice'] = val[0]['singlePrice']
setV['amount'] = val[0]['amount']
setV['projectCode'] = val[0]['projectCode']
// setV['packingNumber'] = val[0]['packingNumber']
// setV['inventoryBalance'] = val[0]['qty']
if (formField == 'itemCode') {
setV['batch'] = val[0]['toBatch']
setV['containerNumber'] = val[0]['toContainerNumber']
setV['containerNumber'] = val[0]['containerNumber']
setV['containerNumber'] = val[0]['containerNumber']
// setV['fromLocationCode'] = val[0]['fromLocationCode']
// setV['toLocationCode'] = val[0]['toLocationCode']
}
} else if (formField == 'packingNumber'){
setV[formField] = val[0][searchField]
setV['inventoryBalance'] = val[0]['qty']
setV['batch'] = val[0]['batch']
setV['fromLocationCode'] = val[0]['locationCode']
}
else {
setV[formField] = val[0][searchField]
}
formRef.setValues(setV) formRef.setValues(setV)
}) })
} }
@ -453,10 +507,37 @@ const buttonTableClick = async (val, row) => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm = async (type: string, row?: number) => { const openForm = async (type: string, row?: number) => {
originTableData.value = [] //
tableData.value = [] //
isShowButton.value = true isShowButton.value = true
if (type == 'create') {
originTableData.value = [] //
tableData.value = [] //
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => {
if (item.field == 'supplierCode') {
item.componentProps.disabled = true
item.componentProps.isSearchList = true
}
if (item.field == 'asnNumber') {
item.componentProps.disabled = true
item.componentProps.isSearchList = true
}
})
}
if (type == 'update') {
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => {
if (item.field == 'supplierCode') {
item.componentProps.disabled = true
item.componentProps.isSearchList = false
}
if (item.field == 'asnNumber') {
item.componentProps.disabled = true
item.componentProps.isSearchList = false
}
})
tableData.value = [{
}]
}
formRef.value.open(type, row) formRef.value.open(type, row)
} }
@ -594,7 +675,132 @@ const originTableData = ref([])
const searchTableRef = ref() const searchTableRef = ref()
// //
const handleAddTable = () => { const handleAddTable = () => {
const subTableDFata = originTableData.value.filter(
(item) => !tableData.value.find((item1) => item1.id == item.id)
)
if (subTableDFata.length == 0) {
message.warning('暂无可选择数据!')
return
}
const tableObject = {
//
currentPage: 1,
//
exportLoading: false,
//
loading: false,
//
pageSize: subTableDFata.length,
params: null,
//
sort: {
order: '', //
prop: '' //
},
//
total: subTableDFata.length,
//
tableList: subTableDFata,
currentRow: null
}
const tableColumns = PurchasereturnRequestDetail.allSchemas.tableFormColumns
tableColumns.forEach((item) => {
item.width = item.table?.width || 150
})
searchTableRef.value.openData('采购收货记录单号', tableObject, { tableColumns }, true)
// searchTableRef.value.open(
// ('',
// // _searchTableAllSchemas,
// // _searchTablePage, //
// // formField,
// // searchField,
// true,//
// // type,
// // row,
// _searchCondition
// )
// )
// console.log(subTableDFata)
// const {tableObject, tableMethods } = useTable({
// getListApi: getPage.value //
// })
// searchTableRef.value.open(
// ('',
// // _searchTableAllSchemas,
// // _searchTablePage, //
// // formField,
// // searchField,
// true,//
// // type,
// // row,
// _searchCondition
// )
// )
// tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
// let purchaseReceiptRecordNumber = formRef.value.formRef.formModel.purchaseReceiptRecordNumber
// PurchasereturnRequestDetail.allSchemas.tableFormColumns.map((item) => {
// item.tableForm.disabled = true
// if (item.field == 'remark') {
// item.tableForm.disabled = false
// }
// if (item.field == 'reason') {
// item.tableForm.disabled = false
// }
// if (item.field == 'qty') {
// item.tableForm.disabled = false
// }
// if(purchaseReceiptRecordNumber == ''){
// if (item.field == 'itemCode') {
// item.tableForm.isInpuFocusShow = true
// }
// if(item.field == 'poLine'){
// item.tableForm.isInpuFocusShow = false
// }
// }else{
// if (item.field == 'itemCode') {
// item.tableForm.isInpuFocusShow = false
// }
// if(item.field == 'poLine'){
// item.tableForm.isInpuFocusShow = true
// }
// }
// })
}
const onChangeForm = async (field, cur, formRef)=>{
console.log('onChangeForm',field, cur, formRef)
if(field=='supplierCode'){
//
PurchasereturnRequestMainNew.allSchemas.formSchema.forEach(item=>{
//
if(item.field=='supplierCode'){
let setV = {}
setV['supplierName'] = item.componentProps.options?.find(el=>el.supplierCode==cur+'')['supplierName']
formRef.value.setValues(setV)
}
})
}else if(field == 'locationCode'){
// 退
let subList = await PurchasereturnRequestDetailApi.getBalancePurchaseReceiptReturn({
itemCode:formRef.value.formModel.itemCode,
fromLocationCode:formRef.value.formModel.locationCode
})
console.log('subList',subList)
if(subList&&subList.length>0){
tableData.value = subList.map(item=>({
'batch':item['batch'],
'status':item['inventoryStatus'],
'inventoryBalance':item['qty'],
'qty':1,
'reason_type':'',
'reason':''
}))
}
}
} }
// //
const chooseReceiptList = ()=>{ const chooseReceiptList = ()=>{
@ -632,6 +838,7 @@ const searchTableSuccess1 = (formField, searchField, val, type, row) => {
if(formField=='hahaha'){ if(formField=='hahaha'){
// //
const setV = {} const setV = {}
setV['hahaha'] = val[0]['asnNumber']
setV['poNumber'] = val[0]['poNumber'] setV['poNumber'] = val[0]['poNumber']
setV['poLine'] = val[0]['poLine'] setV['poLine'] = val[0]['poLine']
setV['receiptNumber'] = val[0]['receiptNumber'] setV['receiptNumber'] = val[0]['receiptNumber']

60
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMainNew/purchasereturnRequestMainNew.data.ts

@ -134,7 +134,7 @@ export const PurchasereturnRequestMainNew = useCrudSchemas(
} }
}, },
{ {
label: '', label: ' ',
field: 'hahaha', field: 'hahaha',
table: { table: {
width: 180 width: 180
@ -228,7 +228,7 @@ export const PurchasereturnRequestMainNew = useCrudSchemas(
{ {
label: '状态', label: '状态',
field: 'status', field: 'status',
dictType: DICT_TYPE.REQUEST_STATUS, dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string', dictClass: 'string',
isSearch: true, isSearch: true,
isTable: true, isTable: true,
@ -323,48 +323,18 @@ export const PurchasereturnRequestMainNew = useCrudSchemas(
) )
//表单校验 //表单校验
export const PurchasereturnRequestMainRulesNew = reactive({ export const PurchasereturnRequestMainRulesNew = reactive({
supplierCode: [ itemCode: [
{ required: true, message: '请输入供应商代码', trigger: 'blur' } { required: true, message: '请输入供应商代码', trigger: 'blur' }
], ],
dueTime: [ supplierCode: [
{ required: true, message: '请选择截止时间', trigger: 'blur' } { required: true, message: '请输入供应商代码', trigger: 'blur' }
],
// purchaseReceiptRecordNumber: [
// { required: true, message: '请输入采购收货记录单号', trigger: 'blur' }
// ],
carrierCode: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' },
],
vehiclePlateNumber: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' },
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
fromWarehouseCode: [
{ required: true, message: '请输入从仓库代码', trigger: 'blur' }
],
fromAreaTypes: [
{ required: true, message: '请选择从库区类型范围', trigger: 'change' }
],
departmentCode: [
{ required: true, message: '请输入部门', trigger: 'blur' }
],
autoCommit: [
{ required: true, message: '请选择是否自动提交', trigger: 'change' }
],
autoAgree: [
{ required: true, message: '请选择是否自动通过', trigger: 'change' }
],
autoExecute: [
{ required: true, message: '请选择是否自动执行', trigger: 'change' }
],
directCreateRecord: [
{ required: true, message: '请选择是否跳过任务直接生成记录', trigger: 'change' }
], ],
businessType: [ hahaha: [
{ required: true, message: '请输入业务类型', trigger: 'blur' } required
], ],
locationCode: [
{ required: true, message: '请选择收货单明细', trigger: 'blur' }
]
}) })
export const PurchasereturnPurchasereceiptRecordNew = useCrudSchemas( export const PurchasereturnPurchasereceiptRecordNew = useCrudSchemas(
@ -395,9 +365,6 @@ export const PurchasereturnPurchasereceiptRecordNew = useCrudSchemas(
label: '收货单号', label: '收货单号',
field: 'receiptNumber', field: 'receiptNumber',
sort: 'custom', sort: 'custom',
table: {
width: 150
},
tableForm:{ tableForm:{
disabled:true disabled:true
}, },
@ -411,9 +378,6 @@ export const PurchasereturnPurchasereceiptRecordNew = useCrudSchemas(
label: '发货单号', label: '发货单号',
field: 'asnNumber', field: 'asnNumber',
sort: 'custom', sort: 'custom',
table: {
width: 150
},
tableForm:{ tableForm:{
disabled:true disabled:true
}, },
@ -579,7 +543,7 @@ export const PurchasereturnRequestDetailNew = useCrudSchemas(reactive<CrudSchema
}, },
{ {
label: '退货原因', label: '退货原因',
field: 'reason', field: 'reason_type',
dictType: DICT_TYPE.UOM, dictType: DICT_TYPE.UOM,
dictClass: 'string', dictClass: 'string',
// isSearch: true, // isSearch: true,
@ -599,7 +563,7 @@ export const PurchasereturnRequestDetailNew = useCrudSchemas(reactive<CrudSchema
}, },
{ {
label: '退货原因描述', label: '退货原因描述',
field: 'remark', field: 'reason',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150

Loading…
Cancel
Save