Browse Source

采购收货

master
zhang_li 12 months ago
parent
commit
af99b20d36
  1. 2
      src/components/BasicForm/src/BasicForm.vue
  2. 2
      src/components/TableForm/src/TableForm.vue
  3. 199
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue
  4. 51
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts

2
src/components/BasicForm/src/BasicForm.vue

@ -472,7 +472,7 @@ const handleTableSelect = (row, column, event) => {
// //
const handleDeleteTable = (row, index) => { const handleDeleteTable = (row, index) => {
emit('handleDeleteTable', row) emit('handleDeleteTable', row, index,formRef.value)
} }
// //
const handleAddTable = () => { const handleAddTable = () => {

2
src/components/TableForm/src/TableForm.vue

@ -399,7 +399,7 @@ const validateForm = () => {
} }
// //
const handleDeleteTable = (row, index) => { const handleDeleteTable = (row, index) => {
emit('handleDeleteTable', row) emit('handleDeleteTable', row, index)
} }
// //
const handleAddTable = () => { const handleAddTable = () => {

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

@ -1,7 +1,11 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="PurchasereturnRequestMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <Search
:schema="PurchasereturnRequestMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
@ -33,7 +37,10 @@
</el-button> </el-button>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> <ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -50,7 +57,7 @@
:apiUpdate="PurchasereturnRequestMainApi.updatePurchasereturnRequestMain" :apiUpdate="PurchasereturnRequestMainApi.updatePurchasereturnRequestMain"
:apiCreate="PurchasereturnRequestMainApi.createPurchasereturnRequestMain" :apiCreate="PurchasereturnRequestMainApi.createPurchasereturnRequestMain"
:isBusiness="true" :isBusiness="true"
:isShowButton="false" :isShowButton="isShowButton"
@handleAddTable="handleAddTable" @handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable" @handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
@ -73,18 +80,29 @@
/> />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/purchasereturn-request-main/import" :importTemplateData="importTemplateData" <ImportForm
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" /> ref="importFormRef"
url="/wms/purchasereturn-request-main/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
:updateIsDisable="true"
:coverIsDisable="true"
:mode="2"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { PurchasereturnRequestMain,PurchasereturnRequestMainRules,PurchasereturnRequestDetail,PurchasereturnRequestDetailRules } from './purchasereturnRequestMain.data' import {
PurchasereturnRequestMain,
PurchasereturnRequestMainRules,
PurchasereturnRequestDetail,
PurchasereturnRequestDetailRules
} from './purchasereturnRequestMain.data'
import * as PurchasereturnRequestMainApi from '@/api/wms/purchasereturnRequestMain' import * as PurchasereturnRequestMainApi from '@/api/wms/purchasereturnRequestMain'
import * as PurchasereturnRequestDetailApi from '@/api/wms/purchasereturnRequestDetail' import * as PurchasereturnRequestDetailApi from '@/api/wms/purchasereturnRequestDetail'
import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail' import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { Console } from 'console'
// 退 // 退
defineOptions({ name: 'PurchasereturnRequestMain' }) defineOptions({ name: 'PurchasereturnRequestMain' })
@ -97,6 +115,8 @@ const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(PurchasereturnRequestMain.allSchemas.tableColumns) const tableColumns = ref(PurchasereturnRequestMain.allSchemas.tableColumns)
const isShowButton = ref(true)
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val
@ -107,9 +127,41 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
nextTick(() => { nextTick(() => {
if (type == 'tableForm') { if (type == 'tableForm') {
// //
console.log(row['batch']) console.log(val[0])
console.log(val[0]['toBatch'])
row[formField] = val[0][searchField] row[formField] = val[0][searchField]
row['poNumber'] = val[0]['poNumber']
row['poLine'] = val[0]['poLine']
row['itemCode'] = val[0]['itemCode']
row['itemName'] = val[0]['itemName']
row['itemDesc1'] = val[0]['itemDesc1']
row['itemDesc2'] = val[0]['itemDesc2']
row['batch'] = val[0]['batch']
row['altBatch'] = val[0]['altBatch']
row['packingNumber'] = val[0]['packingNumber']
row['containerNumber'] = val[0]['containerNumber']
row['qty'] = val[0]['qty']
row['uom'] = val[0]['uom']
row['supplierQty'] = val[0]['supplierQty']
row['supplierUom'] = val[0]['supplierUom']
row['inventoryStatus'] = val[0]['inventoryStatus']
row['fromLocationCode'] = val[0]['locationCode']
row['toLocationCode'] = val[0]['toLocationCode']
row['fromLocationGroupCode'] = val[0]['locationGroupCode']
row['toLocationGroupCode'] = val[0]['toLocationGroupCode']
row['fromAreaCode'] = val[0]['areaCode']
row['toAreaCode'] = val[0]['toAreaCode']
row['fromQwnerCode'] = val[0]['fromQwnerCode']
row['toOwnerCode'] = val[0]['toOwnerCode']
row['arriveDate'] = val[0]['arriveDate']
row['produceDate'] = val[0]['produceDate']
row['expireDate'] = val[0]['expireDate']
row['convertRate'] = val[0]['convertRate']
row['visualInspectResult'] = val[0]['visualInspectResult']
row['visualInspectPhotos'] = val[0]['visualInspectPhotos']
row['failedReason'] = val[0]['failedReason']
row['singlePrice'] = val[0]['singlePrice']
row['amount'] = val[0]['amount']
row['projectCode'] = val[0]['projectCode']
} else { } else {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
@ -118,10 +170,12 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
// getBomDisassemble // getBomDisassemble
PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailList({ PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailList({
masterId: val[0]['id']}).then(res => { masterId: val[0]['id']
if (res) tableData.value = res; })
.then((res) => {
if (res) tableData.value = res
console.log(PurchasereturnRequestDetail.allSchemas.tableFormColumns) console.log(PurchasereturnRequestDetail.allSchemas.tableFormColumns)
tableData.value.forEach(item=>{ tableData.value.forEach((item) => {
item.batch = item.toBatch item.batch = item.toBatch
item.packingNumber = item.toPackingNumber item.packingNumber = item.toPackingNumber
item.containerNumber = item.toContainerNumber item.containerNumber = item.toContainerNumber
@ -129,15 +183,21 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
item.fromLocationCode = item.toLocationCode item.fromLocationCode = item.toLocationCode
item.toLocationCode = fromLocationCode item.toLocationCode = fromLocationCode
}) })
PurchasereturnRequestDetail.allSchemas.tableFormColumns.map(item => { isShowButton.value = false
PurchasereturnRequestDetail.allSchemas.tableFormColumns.map((item) => {
item.tableForm.disabled = true
if (item.field == 'remark') { if (item.field == 'remark') {
item.tableForm.disabled = false item.tableForm.disabled = false
} }
if (item.field == 'failedReason') { if (item.field == 'failedReason') {
item.tableForm.disabled = false item.tableForm.disabled = false
} }
if (item.field == 'itemCode') {
item.tableForm.isInpuFocusShow = false
}
})
}) })
}).catch(err => { .catch((err) => {
console.log(err) console.log(err)
}) })
formRef.setValues(setV) formRef.setValues(setV)
@ -174,21 +234,27 @@ const HeadButttondata = [
defaultButtons.defaultExportBtn(null), // defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null) //
] ]
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') {
//
openForm('create') openForm('create')
} else if (val == 'import') { // } else if (val == 'import') {
//
handleImport() handleImport()
} else if (val == 'export') { // } else if (val == 'export') {
//
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') {
//
getList() getList()
} else if (val == 'filtrate') { // } else if (val == 'filtrate') {
} else { // //
} else {
//
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
@ -205,31 +271,59 @@ const isShowMainButton = (row,val) => {
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']),hasPermi:'wms:purchasereceipt-request-main:close'}), // defaultButtons.mainListCloseBtn({
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:purchasereceipt-request-main:reAdd'}), // hide: isShowMainButton(row, ['1', '2', '3', '4', '6']),
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-request-main:submit'}), // hasPermi: 'wms:purchasereceipt-request-main:close'
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:purchasereceipt-request-main:refused'}), // }), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:purchasereceipt-request-main:agree'}), // defaultButtons.mainListReAddBtn({
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:purchasereceipt-request-main:handle'}), // hide: isShowMainButton(row, ['5']),
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-request-main:update'}), // hasPermi: 'wms:purchasereceipt-request-main:reAdd'
}), //
defaultButtons.mainListSubmitBtn({
hide: isShowMainButton(row, ['1']),
hasPermi: 'wms:purchasereceipt-request-main:submit'
}), //
defaultButtons.mainListTurnDownBtn({
hide: isShowMainButton(row, ['2']),
hasPermi: 'wms:purchasereceipt-request-main:refused'
}), //
defaultButtons.mainListApproveBtn({
hide: isShowMainButton(row, ['2']),
hasPermi: 'wms:purchasereceipt-request-main:agree'
}), //
defaultButtons.mainListHandleBtn({
hide: isShowMainButton(row, ['3']),
hasPermi: 'wms:purchasereceipt-request-main:handle'
}), //
defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, ['1']),
hasPermi: 'wms:purchasereceipt-request-main:update'
}) //
] ]
} }
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'mainClose') { // if (val == 'mainClose') {
//
handleClose(row.id) handleClose(row.id)
} else if (val == 'mainReAdd') { // } else if (val == 'mainReAdd') {
//
handleReAdd(row.id) handleReAdd(row.id)
} else if (val == 'mainSubmit') { // } else if (val == 'mainSubmit') {
//
handleSubmit(row.id) handleSubmit(row.id)
} else if (val == 'mainTurnDown') { // } else if (val == 'mainTurnDown') {
//
handleRefused(row.id) handleRefused(row.id)
} else if (val == 'mainApprove') { // } else if (val == 'mainApprove') {
//
handleAgree(row.id) handleAgree(row.id)
} else if (val == 'mainHandle') { // } else if (val == 'mainHandle') {
//
handleHandle(row.id) handleHandle(row.id)
} else if (val == 'edit') { // } else if (val == 'edit') {
//
openForm('update', row) openForm('update', row)
} }
} }
@ -327,7 +421,7 @@ const handleExport = async () => {
* tableForm方法 * tableForm方法
*/ */
const tableFormKeys = {} const tableFormKeys = {}
PurchasereturnRequestDetail.allSchemas.tableFormColumns.forEach(item => { PurchasereturnRequestDetail.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : '' tableFormKeys[item.field] = item.default ? item.default : ''
}) })
const tableData = ref([]) const tableData = ref([])
@ -335,10 +429,41 @@ const tableData = ref([])
// //
const handleAddTable = () => { const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
PurchasereturnRequestDetail.allSchemas.tableFormColumns.map((item) => {
item.tableForm.disabled = true
if (item.field == 'remark') {
item.tableForm.disabled = false
}
if (item.field == 'failedReason') {
item.tableForm.disabled = false
}
if (item.field == 'qty') {
item.tableForm.disabled = false
}
if (item.field == 'reason') {
item.tableForm.disabled = false
}
if (item.field == 'itemCode') {
item.tableForm.isInpuFocusShow = true
}
})
} }
// //
const handleDeleteTable = (item, index) => { const handleDeleteTable = (item, index,formRef) => {
tableData.value.splice(index, 1) tableData.value.splice(index, 1)
console.log(item)
if (tableData.value.length == 0) {
isShowButton.value = true
nextTick(() => {
const setV = {}
setV['purchaseReceiptRecordNumber'] = ''
setV['supplierCode'] = ''
formRef.setValues(setV)
})
}
} }
// //

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

@ -4,6 +4,8 @@ const { t } = useI18n() // 国际化
import * as getRequestsettingApi from '@/api/wms/requestsetting/index' import * as getRequestsettingApi from '@/api/wms/requestsetting/index'
import * as PurchasereceiptRecordMainApi from '@/api/wms/purchasereceiptRecordMain' import * as PurchasereceiptRecordMainApi from '@/api/wms/purchasereceiptRecordMain'
import { PurchasereceiptRecordMain } from '../../purchasereceipt/purchasereceiptRecordMain/purchasereceiptRecordMain.data' import { PurchasereceiptRecordMain } from '../../purchasereceipt/purchasereceiptRecordMain/purchasereceiptRecordMain.data'
import * as BalanceApi from '@/api/wms/balance'
import { Balance } from '@/views/wms/inventoryManage/balance/balance.data'
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 // 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
const queryParams = { const queryParams = {
@ -498,8 +500,23 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
width: 150 width: 150
}, },
tableForm:{ tableForm:{
disabled:true disabled:true,
} isInpuFocusShow: true,
earchListPlaceholder: '请选择包装号',
searchField: 'packingNumber',
searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.getBalancePage,
searchCondition:[{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'workshopCode',
value: 'workshopCode',
isMainValue: true
}]
},
}, },
{ {
label: '物品名称', label: '物品名称',
@ -1068,21 +1085,21 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
//表单校验 //表单校验
export const PurchasereturnRequestDetailRules = reactive({ export const PurchasereturnRequestDetailRules = reactive({
packingNumber: [ // packingNumber: [
{ required: true, message: '请输入包装号', trigger: 'blur' } // { required: true, message: '请输入包装号', trigger: 'blur' }
], // ],
batch: [ // batch: [
{ required: true, message: '请输入批次', trigger: 'blur' } // { required: true, message: '请输入批次', trigger: 'blur' }
], // ],
inventoryStatus: [ // inventoryStatus: [
{ required: true, message: '请选择库存状态', trigger: 'change' } // { required: true, message: '请选择库存状态', trigger: 'change' }
], // ],
poNumber: [ // poNumber: [
{ required: true, message: '请输入订单号', trigger: 'blur' } // { required: true, message: '请输入订单号', trigger: 'blur' }
], // ],
poLine: [ // poLine: [
{ required: true, message: '请输入订单行', trigger: 'blur' } // { required: true, message: '请输入订单行', trigger: 'blur' }
], // ],
reason: [ reason: [
{ required: true, message: '请选择原因', trigger: 'change' } { required: true, message: '请选择原因', trigger: 'change' }
], ],

Loading…
Cancel
Save