|
|
@ -76,6 +76,21 @@ |
|
|
|
:detailButtonIsShowDelete="trueFalse" |
|
|
|
@detailOpenForm="detailOpenForm" |
|
|
|
/> |
|
|
|
<!-- 创建标签 --> |
|
|
|
<BasicForm |
|
|
|
ref="formLabelRef" |
|
|
|
@success="getList" |
|
|
|
:tableAllSchemas="CustomerReturnRequestDetailLabel.allSchemas" |
|
|
|
:tableFormRules="CustomerreturnRequestDetailRules" |
|
|
|
:tableData="detatableData.tableList" |
|
|
|
:isBusiness="true" |
|
|
|
:isShowButton="false" |
|
|
|
:isShowReduceButton="false" |
|
|
|
@submitForm="submitFormLabel" |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
/> |
|
|
|
<!-- 标签打印 --> |
|
|
|
<SearchTable style="width:905px" ref="showLabelRef" @searchTableSuccess="showLabelSuccess" /> |
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
|
<ImportForm ref="importFormRef" url="/wms/customerreturn-request-main/import" :importTemplateData="importTemplateData" |
|
|
@ -85,12 +100,16 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
import download from '@/utils/download' |
|
|
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|
|
|
import { CustomerreturnRequestMain,CustomerreturnRequestMainRules,CustomerreturnRequestDetail,CustomerreturnRequestDetailRules } from './customerreturnRequestMain.data' |
|
|
|
import { CustomerreturnRequestMain,CustomerreturnRequestMainRules,CustomerreturnRequestDetail,CustomerreturnRequestDetailRules,CustomerReturnRequestDetailLabel } from './customerreturnRequestMain.data' |
|
|
|
import * as CustomerreturnRequestMainApi from '@/api/wms/customerreturnRequestMain' |
|
|
|
import * as CustomerreturnRequestDetailApi from '@/api/wms/customerreturnRequestDetail' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import * as DeliverRecordDetailApi from '@/api/wms/deliverRecordDetail' |
|
|
|
|
|
|
|
import { |
|
|
|
SupplierdeliverRequestPackage |
|
|
|
} from '../../../purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data' |
|
|
|
import * as PackageApi from '@/api/wms/package' |
|
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
|
// 客户退货申请 |
|
|
|
defineOptions({ name: 'CustomerreturnRequestMain' }) |
|
|
|
|
|
|
@ -100,6 +119,7 @@ const { t } = useI18n() // 国际化 |
|
|
|
const route = useRoute() // 路由信息 |
|
|
|
const routeName = ref() |
|
|
|
const customerCode = ref() |
|
|
|
const genLabelId = ref(); //主表ID |
|
|
|
routeName.value = route.name |
|
|
|
const tableColumns = ref([...CustomerreturnRequestMain.allSchemas.tableColumns,...CustomerreturnRequestDetail.allSchemas.tableMainColumns]) |
|
|
|
|
|
|
@ -344,8 +364,65 @@ const buttonTableClick = async (val, row) => { |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
handleDelete(row.masterId) |
|
|
|
}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) |
|
|
|
} |
|
|
|
} |
|
|
|
// 生成标签 |
|
|
|
const isCreateLabel = ref(false) |
|
|
|
const formLabelRef = ref() |
|
|
|
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({ |
|
|
|
getListApi: CustomerreturnRequestDetailApi.getCustomerreturnRequestDetailPage |
|
|
|
}) |
|
|
|
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 CustomerreturnRequestMainApi.genLabel(data) //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 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 formRef = ref() |
|
|
@ -531,6 +608,23 @@ const searchFormClick = (searchData) => { |
|
|
|
getList() // 刷新当前列表 |
|
|
|
} |
|
|
|
|
|
|
|
// 批量打印---采购收货申请 |
|
|
|
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 () => { |
|
|
|
getList() |
|
|
|