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. 215
      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) => {
emit('handleDeleteTable', row)
emit('handleDeleteTable', row, index,formRef.value)
}
//
const handleAddTable = () => {

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

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

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

@ -1,7 +1,11 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="PurchasereturnRequestMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="PurchasereturnRequestMain.allSchemas.searchSchema"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
@ -27,13 +31,16 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #number="{row}">
<template #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
<ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
@ -50,7 +57,7 @@
:apiUpdate="PurchasereturnRequestMainApi.updatePurchasereturnRequestMain"
:apiCreate="PurchasereturnRequestMainApi.createPurchasereturnRequestMain"
:isBusiness="true"
:isShowButton="false"
:isShowButton="isShowButton"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@ -73,18 +80,29 @@
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/purchasereturn-request-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
<ImportForm
ref="importFormRef"
url="/wms/purchasereturn-request-main/import"
:importTemplateData="importTemplateData"
@success="importSuccess"
:updateIsDisable="true"
:coverIsDisable="true"
:mode="2"
/>
</template>
<script setup lang="ts">
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 PurchasereturnRequestDetailApi from '@/api/wms/purchasereturnRequestDetail'
import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { Console } from 'console'
// 退
defineOptions({ name: 'PurchasereturnRequestMain' })
@ -97,19 +115,53 @@ const routeName = ref()
routeName.value = route.name
const tableColumns = ref(PurchasereturnRequestMain.allSchemas.tableColumns)
const isShowButton = ref(true)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => {
if (type == 'tableForm') {
//
console.log(row['batch'])
console.log(val[0]['toBatch'])
console.log(val[0])
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 {
const setV = {}
setV[formField] = val[0][searchField]
@ -118,10 +170,12 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
// getBomDisassemble
PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailList({
masterId: val[0]['id']}).then(res => {
if (res) tableData.value = res;
masterId: val[0]['id']
})
.then((res) => {
if (res) tableData.value = res
console.log(PurchasereturnRequestDetail.allSchemas.tableFormColumns)
tableData.value.forEach(item=>{
tableData.value.forEach((item) => {
item.batch = item.toBatch
item.packingNumber = item.toPackingNumber
item.containerNumber = item.toContainerNumber
@ -129,15 +183,21 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
item.fromLocationCode = item.toLocationCode
item.toLocationCode = fromLocationCode
})
PurchasereturnRequestDetail.allSchemas.tableFormColumns.map(item => {
if(item.field == 'remark') {
isShowButton.value = false
PurchasereturnRequestDetail.allSchemas.tableFormColumns.map((item) => {
item.tableForm.disabled = true
if (item.field == 'remark') {
item.tableForm.disabled = false
}
if(item.field == 'failedReason') {
if (item.field == 'failedReason') {
item.tableForm.disabled = false
}
if (item.field == 'itemCode') {
item.tableForm.isInpuFocusShow = false
}
})
})
}).catch(err => {
.catch((err) => {
console.log(err)
})
formRef.setValues(setV)
@ -145,7 +205,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
@ -174,27 +234,33 @@ const HeadButttondata = [
defaultButtons.defaultExportBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
if (val == 'add') {
//
openForm('create')
} else if (val == 'import') { //
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') { //
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') { //
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') { //
} else { //
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
//
const isShowMainButton = (row,val) => {
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
@ -205,38 +271,66 @@ const isShowMainButton = (row,val) => {
// -
const butttondata = (row) => {
return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']),hasPermi:'wms:purchasereceipt-request-main:close'}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['5']),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'}), //
defaultButtons.mainListCloseBtn({
hide: isShowMainButton(row, ['1', '2', '3', '4', '6']),
hasPermi: 'wms:purchasereceipt-request-main:close'
}), //
defaultButtons.mainListReAddBtn({
hide: isShowMainButton(row, ['5']),
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) => {
if (val == 'mainClose') { //
if (val == 'mainClose') {
//
handleClose(row.id)
} else if (val == 'mainReAdd') { //
} else if (val == 'mainReAdd') {
//
handleReAdd(row.id)
} else if (val == 'mainSubmit') { //
} else if (val == 'mainSubmit') {
//
handleSubmit(row.id)
} else if (val == 'mainTurnDown') { //
} else if (val == 'mainTurnDown') {
//
handleRefused(row.id)
} else if (val == 'mainApprove') { //
} else if (val == 'mainApprove') {
//
handleAgree(row.id)
} else if (val == 'mainHandle') { //
} else if (val == 'mainHandle') {
//
handleHandle(row.id)
} else if (val == 'edit') { //
} else if (val == 'edit') {
//
openForm('update', row)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm =async (type: string, row?: number) => {
const openForm = async (type: string, row?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
}
@ -325,9 +419,9 @@ const handleExport = async () => {
/**
* tableForm方法
*/
*/
const tableFormKeys = {}
PurchasereturnRequestDetail.allSchemas.tableFormColumns.forEach(item => {
PurchasereturnRequestDetail.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
@ -335,10 +429,41 @@ const tableData = ref([])
//
const handleAddTable = () => {
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)
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 PurchasereceiptRecordMainApi from '@/api/wms/purchasereceiptRecordMain'
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 = {
@ -498,8 +500,23 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
width: 150
},
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: '物品名称',
@ -1068,21 +1085,21 @@ export const PurchasereturnRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
//表单校验
export const PurchasereturnRequestDetailRules = reactive({
packingNumber: [
{ required: true, message: '请输入包装号', trigger: 'blur' }
],
batch: [
{ required: true, message: '请输入批次', trigger: 'blur' }
],
inventoryStatus: [
{ required: true, message: '请选择库存状态', trigger: 'change' }
],
poNumber: [
{ required: true, message: '请输入订单号', trigger: 'blur' }
],
poLine: [
{ required: true, message: '请输入订单行', trigger: 'blur' }
],
// packingNumber: [
// { required: true, message: '请输入包装号', trigger: 'blur' }
// ],
// batch: [
// { required: true, message: '请输入批次', trigger: 'blur' }
// ],
// inventoryStatus: [
// { required: true, message: '请选择库存状态', trigger: 'change' }
// ],
// poNumber: [
// { required: true, message: '请输入订单号', trigger: 'blur' }
// ],
// poLine: [
// { required: true, message: '请输入订单行', trigger: 'blur' }
// ],
reason: [
{ required: true, message: '请选择原因', trigger: 'change' }
],

Loading…
Cancel
Save