|
|
@ -75,24 +75,44 @@ |
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
|
<ImportForm ref="importFormRef" url="/wms/purchasereceipt-request-main/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|
|
|
|
|
|
|
<!-- 创建标签 --> |
|
|
|
<BasicForm |
|
|
|
ref="formLabelRef" |
|
|
|
@success="getList" |
|
|
|
:tableAllSchemas="PurchasereceiptRequestDetailLabel.allSchemas" |
|
|
|
:tableFormRules="PurchasereceiptRequestDetailRules" |
|
|
|
:tableData="detatableData.tableList" |
|
|
|
:isBusiness="true" |
|
|
|
:isShowButton="false" |
|
|
|
@submitForm="submitFormLabel" |
|
|
|
/> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
import download from '@/utils/download' |
|
|
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|
|
|
import { PurchasereceiptRequestMain,PurchasereceiptRequestMainRules,PurchasereceiptRequestDetail,PurchasereceiptRequestDetailRules } from './purchasereceiptRequestMain.data' |
|
|
|
import { |
|
|
|
PurchasereceiptRequestMain, |
|
|
|
PurchasereceiptRequestMainRules, |
|
|
|
PurchasereceiptRequestDetail, |
|
|
|
PurchasereceiptRequestDetailRules, |
|
|
|
PurchasereceiptRequestDetailLabel, |
|
|
|
} from './purchasereceiptRequestMain.data' |
|
|
|
import * as PurchasereceiptRequestMainApi from '@/api/wms/purchasereceiptRequestMain' |
|
|
|
import * as PurchasereceiptRequestDetailApi from '@/api/wms/purchasereceiptRequestDetail' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
|
import * as SupplieritemApi from '@/api/wms/supplieritem' |
|
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
|
|
|
|
|
// 采购收货申请 |
|
|
|
defineOptions({ name: 'PurchasereceiptRequestMain' }) |
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
|
const { t } = useI18n() // 国际化 |
|
|
|
|
|
|
|
const genLabelId = ref(); //主表ID |
|
|
|
const route = useRoute() // 路由信息 |
|
|
|
const routeName = ref() |
|
|
|
routeName.value = route.name |
|
|
@ -102,7 +122,6 @@ const apiPage = ref(PurchasereceiptRequestDetailApi.getPurchasereceiptRequestDet |
|
|
|
const detailAllSchemas = ref(PurchasereceiptRequestDetail.allSchemas) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 字段设置 更新主列表字段 |
|
|
|
const updataTableColumns = (val) => { |
|
|
|
tableColumns.value = val |
|
|
@ -126,11 +145,11 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
row['uom'] = val[0]['uom'] |
|
|
|
let supplierCode = formRef.formModel.supplierCode; |
|
|
|
let itemCode = val[0]['itemCode'] |
|
|
|
let queryData:SupplieritemApi.SupplieritemVO={ |
|
|
|
let queryData = { |
|
|
|
supplierCode:supplierCode, |
|
|
|
itemCode:itemCode |
|
|
|
} |
|
|
|
SupplieritemApi.getDefaultLocationCode(queryData).then(res =>{ |
|
|
|
SupplieritemApi.getDefaultLocationCode(queryData as SupplieritemApi.SupplieritemVO).then(res =>{ |
|
|
|
row['defaultToLocationCode'] = res |
|
|
|
}) |
|
|
|
}else if (formField == 'packQty'){ |
|
|
@ -208,16 +227,38 @@ const isShowMainButton = (row,val) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 根据状态返回该按钮是否显示 |
|
|
|
const isASNShowMainButton = (row,val) => { |
|
|
|
if (val.indexOf(row.status) > -1) { |
|
|
|
if(row.sourceType == 'ASN_ExternalReceipt'){ |
|
|
|
return false |
|
|
|
} |
|
|
|
} else { |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
|
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'}), // 编辑 |
|
|
|
{ |
|
|
|
label: '生成标签', |
|
|
|
name: 'ssbq', |
|
|
|
hide: isASNShowMainButton(row, ['3']), |
|
|
|
type: 'primary', |
|
|
|
icon: '', |
|
|
|
color: '', |
|
|
|
hasPermi: '', |
|
|
|
link: true // 文本展现按钮 |
|
|
|
}, |
|
|
|
defaultButtons.mainListPointBtn({ hide: isASNShowMainButton(row, ['3','8']) }), // 标签打印 |
|
|
|
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:purchasereceipt-request-main:handle'}), // 处理 |
|
|
|
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']),hasPermi:'wms:purchasereceipt-request-main:close'}), // 关闭 |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
@ -237,9 +278,51 @@ const buttonTableClick = async (val, row) => { |
|
|
|
handleHandle(row.id) |
|
|
|
} else if (val == 'edit') { // 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} else if(val == 'ssbq'){ // 生成标签 |
|
|
|
// 生成标签 |
|
|
|
detatableData.params = { |
|
|
|
masterId:row.id |
|
|
|
} |
|
|
|
genLabelId.value = row.id |
|
|
|
await getDetailList() |
|
|
|
formLabelRef.value.open('create', row, null,'createLabel')//创建标签页面 createLabel 标题 |
|
|
|
}else if (val == 'point') { |
|
|
|
// 标签打印 |
|
|
|
labelPrint(row) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 生成标签 |
|
|
|
const isCreateLabel = ref(false) |
|
|
|
const formLabelRef = ref() |
|
|
|
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({ |
|
|
|
getListApi: PurchasereceiptRequestDetailApi.getPurchasereceiptRequestDetailPage |
|
|
|
}) |
|
|
|
const { getList:getDetailList } = detatableMethods |
|
|
|
|
|
|
|
// 生成标签按钮操作 |
|
|
|
const submitFormLabel = async (formType, data) => { |
|
|
|
try { |
|
|
|
await message.confirm('是否为此数据生成标签?') |
|
|
|
await PurchasereceiptRequestMainApi.genLabel(genLabelId.value) |
|
|
|
isCreateLabel.value = true |
|
|
|
message.success('创建标签成功') |
|
|
|
} finally { |
|
|
|
formLabelRef.value.formLoading = false |
|
|
|
formLabelRef.value.dialogVisible = false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL |
|
|
|
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) |
|
|
|
|
|
|
|
// 标签打印 |
|
|
|
const labelPrint = async (row) => { |
|
|
|
window.open(src.value + '&asn_number=' + row.asnNumber) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
|
const formRef = ref() |
|
|
|
const openForm =async (type: string, row?: number) => { |
|
|
|