|
@ -85,6 +85,21 @@ |
|
|
:detailValidate="detailValidate" |
|
|
:detailValidate="detailValidate" |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 创建标签 --> |
|
|
|
|
|
<BasicForm |
|
|
|
|
|
ref="formLabelRef" |
|
|
|
|
|
@success="getList" |
|
|
|
|
|
:tableAllSchemas="PurchasereReturnRequestDetailLabel.allSchemas" |
|
|
|
|
|
:tableFormRules="PurchasereturnRequestDetailRules" |
|
|
|
|
|
:tableData="detatableData.tableList" |
|
|
|
|
|
:isBusiness="true" |
|
|
|
|
|
:isShowButton="false" |
|
|
|
|
|
:isShowReduceButton="false" |
|
|
|
|
|
@submitForm="submitFormLabel" |
|
|
|
|
|
@searchTableSuccess="searchTableSuccessLabel" |
|
|
|
|
|
/> |
|
|
|
|
|
<!-- 标签打印 --> |
|
|
|
|
|
<SearchTable style="width:905px" ref="showLabelRef" @searchTableSuccess="showLabelSuccess" /> |
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
|
<ImportForm |
|
|
<ImportForm |
|
|
ref="importFormRef" |
|
|
ref="importFormRef" |
|
@ -104,20 +119,25 @@ import { |
|
|
PurchasereturnRequestMain, |
|
|
PurchasereturnRequestMain, |
|
|
PurchasereturnRequestMainRules, |
|
|
PurchasereturnRequestMainRules, |
|
|
PurchasereturnRequestDetail, |
|
|
PurchasereturnRequestDetail, |
|
|
PurchasereturnRequestDetailRules |
|
|
PurchasereturnRequestDetailRules, |
|
|
|
|
|
PurchasereReturnRequestDetailLabel |
|
|
} from './purchasereturnRequestMain.data' |
|
|
} 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 { |
|
|
|
|
|
SupplierdeliverRequestPackage |
|
|
|
|
|
} from '../../supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data' |
|
|
|
|
|
import * as PackageApi from '@/api/wms/package' |
|
|
|
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
|
|
|
|
|
|
// 采购退货申请 |
|
|
// 采购退货申请 |
|
|
defineOptions({ name: 'PurchasereturnRequestMain' }) |
|
|
defineOptions({ name: 'PurchasereturnRequestMain' }) |
|
|
|
|
|
|
|
|
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 |
|
@ -138,6 +158,45 @@ const onEnter = async (field,value)=>{ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 生成标签 |
|
|
|
|
|
const isCreateLabel = ref(false) |
|
|
|
|
|
const formLabelRef = ref() |
|
|
|
|
|
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({ |
|
|
|
|
|
getListApi: PurchasereturnRequestDetailApi.getPurchasereturnRequestDetailPage |
|
|
|
|
|
}) |
|
|
|
|
|
const { getList:getDetailList } = detatableMethods |
|
|
|
|
|
|
|
|
|
|
|
// 生成标签按钮操作 |
|
|
|
|
|
const submitFormLabel = async (formType, data) => { |
|
|
|
|
|
try { |
|
|
|
|
|
console.log("formType==",formType) |
|
|
|
|
|
console.log("data==",data) |
|
|
|
|
|
data.subList = detatableData.tableList |
|
|
|
|
|
console.log("detatableData",detatableData) |
|
|
|
|
|
await message.confirm(t('ts.是否为此数据生成标签?')) |
|
|
|
|
|
await PurchasereturnRequestMainApi.genLabel(data) //genLabelId.value |
|
|
|
|
|
isCreateLabel.value = true |
|
|
|
|
|
message.success('创建标签成功') |
|
|
|
|
|
} finally { |
|
|
|
|
|
formLabelRef.value.formLoading = false |
|
|
|
|
|
formLabelRef.value.dialogVisible = false |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
|
|
|
const searchTableSuccessLabel = (formField, searchField, val, formRef, type, row) => { |
|
|
|
|
|
nextTick(() => { |
|
|
|
|
|
if (type == 'tableForm') { |
|
|
|
|
|
// 明细查询页赋值 |
|
|
|
|
|
row[formField] = val[0][searchField] |
|
|
|
|
|
if (formField == 'packUnit' || formField == 'packQty') { |
|
|
|
|
|
row['packUnit'] = val[0]['packUnit'] |
|
|
|
|
|
row['packQty'] = val[0]['packQty'] |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
// 查询页面返回 |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
@ -195,8 +254,6 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
if(formField == 'purchaseReceiptRecordNumber'){ |
|
|
if(formField == 'purchaseReceiptRecordNumber'){ |
|
|
// isShowButton.value = false |
|
|
// isShowButton.value = false |
|
|
setV[formField] = val[0][searchField] |
|
|
setV[formField] = val[0][searchField] |
|
|
console.log(333333,val[0]); |
|
|
|
|
|
|
|
|
|
|
|
setV['purchaseReceiptRecordNumber'] = val[0]['number'] |
|
|
setV['purchaseReceiptRecordNumber'] = val[0]['number'] |
|
|
setV['supplierCode'] = val[0]['supplierCode'] |
|
|
setV['supplierCode'] = val[0]['supplierCode'] |
|
|
setV['asnNumber'] = val[0]['asnNumber'] |
|
|
setV['asnNumber'] = val[0]['asnNumber'] |
|
@ -209,7 +266,6 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => |
|
|
if (res) tableData.value = res |
|
|
if (res) tableData.value = res |
|
|
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 |
|
|
item.receiptQty = item.qty |
|
|
item.receiptQty = item.qty |
|
@ -413,7 +469,18 @@ const butttondata = (row,$index) => { |
|
|
defaultButtons.mainListEditBtn({ |
|
|
defaultButtons.mainListEditBtn({ |
|
|
hide: isShowMainButton(row, ['1']), |
|
|
hide: isShowMainButton(row, ['1']), |
|
|
hasPermi: 'wms:purchasereceipt-request-main:update' |
|
|
hasPermi: 'wms:purchasereceipt-request-main:update' |
|
|
}) // 编辑 |
|
|
}), // 编辑 |
|
|
|
|
|
{ |
|
|
|
|
|
label: '生成标签', |
|
|
|
|
|
name: 'ssbq', |
|
|
|
|
|
hide: isShowMainButton(row, ['3']), |
|
|
|
|
|
type: 'primary', |
|
|
|
|
|
icon: '', |
|
|
|
|
|
color: '', |
|
|
|
|
|
hasPermi: '', |
|
|
|
|
|
link: true // 文本展现按钮 |
|
|
|
|
|
}, |
|
|
|
|
|
defaultButtons.mainListPointBtn({ hide: isShowMainButton(row, ['3','8']) }), // 标签打印 |
|
|
] |
|
|
] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -440,6 +507,17 @@ const buttonTableClick = async (val, row) => { |
|
|
} else if (val == 'edit') { |
|
|
} else if (val == 'edit') { |
|
|
// 编辑 |
|
|
// 编辑 |
|
|
openForm('update', row) |
|
|
openForm('update', row) |
|
|
|
|
|
} else if(val == 'ssbq'){ |
|
|
|
|
|
// 生成标签 |
|
|
|
|
|
detatableData.params = { |
|
|
|
|
|
masterId:row.masterId |
|
|
|
|
|
} |
|
|
|
|
|
genLabelId.value = row.masterId |
|
|
|
|
|
await getDetailList() |
|
|
|
|
|
formLabelRef.value.open('create', row, null,'createLabel')//创建标签页面 createLabel 标题 |
|
|
|
|
|
} else if (val == 'point') { |
|
|
|
|
|
// 标签打印 |
|
|
|
|
|
labelPrint(row) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -814,6 +892,48 @@ const detailOpenForm = (type, row) =>{ |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL |
|
|
|
|
|
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) |
|
|
|
|
|
|
|
|
|
|
|
// 标签打印 |
|
|
|
|
|
const showLabelRef = ref() |
|
|
|
|
|
const labelPrint = async (row) => { |
|
|
|
|
|
tableObject.loading = true |
|
|
|
|
|
const defaultParams = {'moduleName':'supplier','recordNumber':row.number} |
|
|
|
|
|
const {tableObject:tableObjectPrint ,tableMethods} = useTable({ |
|
|
|
|
|
defaultParams, |
|
|
|
|
|
getListApi: PackageApi.getLabelDetailPage // 分页接口 |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// 获得表格的各种操作 |
|
|
|
|
|
const { getList:getListPrint } = tableMethods |
|
|
|
|
|
getListPrint() |
|
|
|
|
|
tableObject.loading = false |
|
|
|
|
|
const tableColumns = SupplierdeliverRequestPackage.allSchemas.tableFormColumns |
|
|
|
|
|
tableColumns.forEach((item) => { |
|
|
|
|
|
item.width = item.table?.width || 150 |
|
|
|
|
|
}) |
|
|
|
|
|
showLabelRef.value.openData("标签信息",tableObjectPrint,{tableColumns},true) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 批量打印---采购收货申请 |
|
|
|
|
|
const showLabelSuccess = async (formField, searchField, val, formRef, type, row) => { |
|
|
|
|
|
console.log('批量打印',val) |
|
|
|
|
|
|
|
|
|
|
|
if(val.length == 0){ |
|
|
|
|
|
message.warning("请先选择要打印的数据!") |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
await PackageApi.batchPrintingLable(val.map(item1=>item1.number).join(',')).then(res => { |
|
|
|
|
|
console.log(res) |
|
|
|
|
|
window.open(src.value + '&asn_number=' + res) |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
message.error('创建标签失败') |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
/** 初始化 **/ |
|
|
onMounted(async () => { |
|
|
onMounted(async () => { |
|
|
getList() |
|
|
getList() |
|
|