|
@ -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) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 主子数据 提交 |
|
|
// 主子数据 提交 |
|
|