Browse Source

修改采购退货

master
zhaoxuebing 10 months ago
parent
commit
a83ccefe63
  1. 12
      src/api/wms/purchasereceiptRecordDetail/index.ts
  2. 31
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue
  3. 63
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts

12
src/api/wms/purchasereceiptRecordDetail/index.ts

@ -58,6 +58,18 @@ export const getPurchasereceiptRecordDetailPage = async (params) => {
return await request.get({ url: `/wms/purchasereceipt-record-detail/page`, params }) return await request.get({ url: `/wms/purchasereceipt-record-detail/page`, params })
} }
} }
// 查询采购收货记录子列表
export const getPurchasereceiptRecordDetailPageBySupplierCode = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/purchasereceipt-record-detail/seniorBySupplierCode', data })
} else {
return await request.get({ url: `/wms/purchasereceipt-record-detail/pageBySupplierCode`, params })
}
}
// 查询采购收货记录子列表 // 查询采购收货记录子列表
export const getPurchasereceiptRecordDetailList = async (params) => { export const getPurchasereceiptRecordDetailList = async (params) => {
return await request.get({ url: `/wms/purchasereceipt-record-detail/list`, params }) return await request.get({ url: `/wms/purchasereceipt-record-detail/list`, params })

31
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue

@ -167,6 +167,8 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
row['projectCode'] = val[0]['projectCode'] row['projectCode'] = val[0]['projectCode']
} else { } else {
const setV = {} const setV = {}
if(formField == 'purchaseReceiptRecordNumber'){
isShowButton.value = false
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
setV['purchaseReceiptRecordNumber'] = val[0]['number'] setV['purchaseReceiptRecordNumber'] = val[0]['number']
setV['supplierCode'] = val[0]['supplierCode'] setV['supplierCode'] = val[0]['supplierCode']
@ -176,8 +178,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
// getBomDisassemble // getBomDisassemble
PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailList({ PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailList({
masterId: val[0]['id'] masterId: val[0]['id']
}) }).then((res) => {
.then((res) => {
if (res) tableData.value = res if (res) tableData.value = res
tableData.value.forEach((item) => { tableData.value.forEach((item) => {
item.batch = item.toBatch item.batch = item.toBatch
@ -191,7 +192,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
// item.fromLocationCode = item.fromLocationCode // item.fromLocationCode = item.fromLocationCode
// item.fromLocationGroupCode = item.fromLocationGroupCode // item.fromLocationGroupCode = item.fromLocationGroupCode
}) })
isShowButton.value = false
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => { PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => {
if (item.field == 'supplierCode') { if (item.field == 'supplierCode') {
item.componentProps.disabled = true item.componentProps.disabled = true
@ -212,10 +213,16 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
item.tableForm.isInpuFocusShow = false item.tableForm.isInpuFocusShow = false
} }
}) })
}) }).catch((err) => {
.catch((err) => {
console.log(err) console.log(err)
}) })
}
if(formField == 'supplierCode'){
isShowButton.value = true
setV['supplierCode'] = val[0]['code']
setV['purchaseReceiptRecordNumber'] = ''
tableData.value = []
}
formRef.setValues(setV) formRef.setValues(setV)
} }
}) })
@ -513,6 +520,7 @@ const tableData = ref([])
// //
const handleAddTable = () => { const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
let purchaseReceiptRecordNumber = formRef.value.formRef.formModel.purchaseReceiptRecordNumber
PurchasereturnRequestDetail.allSchemas.tableFormColumns.map((item) => { PurchasereturnRequestDetail.allSchemas.tableFormColumns.map((item) => {
item.tableForm.disabled = true item.tableForm.disabled = true
if (item.field == 'remark') { if (item.field == 'remark') {
@ -524,9 +532,21 @@ const handleAddTable = () => {
if (item.field == 'qty') { if (item.field == 'qty') {
item.tableForm.disabled = false item.tableForm.disabled = false
} }
if(purchaseReceiptRecordNumber == ''){
if (item.field == 'itemCode') { if (item.field == 'itemCode') {
item.tableForm.isInpuFocusShow = true 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
}
}
}) })
} }
// //
@ -541,7 +561,6 @@ const handleDeleteTable = (item, index, formRef) => {
}) })
nextTick(() => { nextTick(() => {
const setV = {} const setV = {}
setV['purchaseReceiptRecordNumber'] = '' setV['purchaseReceiptRecordNumber'] = ''
setV['supplierCode'] = '' setV['supplierCode'] = ''
formRef.setValues(setV) formRef.setValues(setV)

63
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts

@ -10,7 +10,8 @@ import {
import * as BalanceApi from '@/api/wms/balance' import * as BalanceApi from '@/api/wms/balance'
import { Balance } from '@/views/wms/inventoryManage/balance/balance.data' import { Balance } from '@/views/wms/inventoryManage/balance/balance.data'
import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail' import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail'
import { Supplier } from "@/views/wms/basicDataManage/supplierManage/supplier/supplier.data";
import * as SupplierApi from "@/api/wms/supplier";
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 // 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
@ -99,7 +100,12 @@ export const PurchasereturnRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
form:{ form:{
componentProps:{ componentProps:{
disabled:false isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择供应商代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '供应商信息', // 查询弹窗标题
searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类
searchPage: SupplierApi.getSupplierPage // 查询弹窗所需分页方法
} }
} }
}, },
@ -491,7 +497,22 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
width: 150 width: 150
}, },
tableForm:{ tableForm:{
disabled:true isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择订单行',
searchField: 'poLine',
searchTitle: '采购收货记录信息',
searchAllSchemas: PurchasereceiptRecordDetail.allSchemas,
searchPage: PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPage,
searchCondition: [{
key: 'number',
value: 'purchaseReceiptRecordNumber',
message: '请填写采购收货记录号!',
isMainValue: true
},{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}, },
form: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
@ -523,11 +544,43 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
width: 150 width: 150
}, },
tableForm:{ tableForm:{
disabled:true // labelMessage: '信息提示说明!!!',
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择订单行',
searchField: 'poLine',
searchTitle: '采购收货记录信息',
searchAllSchemas: PurchasereceiptRecordDetail.allSchemas,
searchPage: PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageBySupplierCode,
searchCondition: [{
key: 'supplierCode',
value: 'supplierCode',
message: '请填写采购收货记录号!',
isMainValue: true
},{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}, },
form: { form: {
// labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
disabled:true isSearchList: true,
searchListPlaceholder: '请选择订单行',
searchField: 'poLine',
searchTitle: '采购收货记录信息',
searchAllSchemas: PurchasereceiptRecordDetail.allSchemas,
searchPage: PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailPageBySupplierCode,
searchCondition: [{
key: 'supplierCode',
value: 'supplierCode',
message: '请填写采购收货记录号!',
isMainValue: true
},{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
} }
} }
}, },

Loading…
Cancel
Save