|
@ -75,24 +75,44 @@ |
|
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
|
<ImportForm ref="importFormRef" url="/wms/purchasereceipt-request-main/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|
|
<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> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import download from '@/utils/download' |
|
|
import download from '@/utils/download' |
|
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|
|
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 PurchasereceiptRequestMainApi from '@/api/wms/purchasereceiptRequestMain' |
|
|
import * as PurchasereceiptRequestDetailApi from '@/api/wms/purchasereceiptRequestDetail' |
|
|
import * as PurchasereceiptRequestDetailApi from '@/api/wms/purchasereceiptRequestDetail' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
import * as SupplieritemApi from '@/api/wms/supplieritem' |
|
|
import * as SupplieritemApi from '@/api/wms/supplieritem' |
|
|
|
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
|
|
|
|
|
|
// 采购收货申请 |
|
|
// 采购收货申请 |
|
|
defineOptions({ name: 'PurchasereceiptRequestMain' }) |
|
|
defineOptions({ name: 'PurchasereceiptRequestMain' }) |
|
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
const message = useMessage() // 消息弹窗 |
|
|
const { t } = useI18n() // 国际化 |
|
|
const { t } = useI18n() // 国际化 |
|
|
|
|
|
const genLabelId = ref(); //主表ID |
|
|
const route = useRoute() // 路由信息 |
|
|
const route = useRoute() // 路由信息 |
|
|
const routeName = ref() |
|
|
const routeName = ref() |
|
|
routeName.value = route.name |
|
|
routeName.value = route.name |
|
@ -102,7 +122,6 @@ const apiPage = ref(PurchasereceiptRequestDetailApi.getPurchasereceiptRequestDet |
|
|
const detailAllSchemas = ref(PurchasereceiptRequestDetail.allSchemas) |
|
|
const detailAllSchemas = ref(PurchasereceiptRequestDetail.allSchemas) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 字段设置 更新主列表字段 |
|
|
// 字段设置 更新主列表字段 |
|
|
const updataTableColumns = (val) => { |
|
|
const updataTableColumns = (val) => { |
|
|
tableColumns.value = val |
|
|
tableColumns.value = val |
|
@ -126,11 +145,11 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
row['uom'] = val[0]['uom'] |
|
|
row['uom'] = val[0]['uom'] |
|
|
let supplierCode = formRef.formModel.supplierCode; |
|
|
let supplierCode = formRef.formModel.supplierCode; |
|
|
let itemCode = val[0]['itemCode'] |
|
|
let itemCode = val[0]['itemCode'] |
|
|
let queryData:SupplieritemApi.SupplieritemVO={ |
|
|
let queryData = { |
|
|
supplierCode:supplierCode, |
|
|
supplierCode:supplierCode, |
|
|
itemCode:itemCode |
|
|
itemCode:itemCode |
|
|
} |
|
|
} |
|
|
SupplieritemApi.getDefaultLocationCode(queryData).then(res =>{ |
|
|
SupplieritemApi.getDefaultLocationCode(queryData as SupplieritemApi.SupplieritemVO).then(res =>{ |
|
|
row['defaultToLocationCode'] = res |
|
|
row['defaultToLocationCode'] = res |
|
|
}) |
|
|
}) |
|
|
}else if (formField == 'packQty'){ |
|
|
}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) => { |
|
|
const butttondata = (row) => { |
|
|
return [ |
|
|
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.mainListReAddBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:purchasereceipt-request-main:reAdd'}), //重新添加 |
|
|
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-request-main:submit'}), // 提交审批 |
|
|
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.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:purchasereceipt-request-main:refused'}), // 驳回 |
|
|
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:purchasereceipt-request-main:agree'}), // 审批通过 |
|
|
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.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) |
|
|
handleHandle(row.id) |
|
|
} else if (val == 'edit') { // 编辑 |
|
|
} else if (val == 'edit') { // 编辑 |
|
|
openForm('update', row) |
|
|
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 formRef = ref() |
|
|
const openForm =async (type: string, row?: number) => { |
|
|
const openForm =async (type: string, row?: number) => { |
|
|