|
|
@ -70,6 +70,7 @@ |
|
|
|
:apiDelete="ProductionreturnRequestDetailApi.deleteProductionreturnRequestDetail" |
|
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
|
@detailOpenForm="detailOpenForm" |
|
|
|
:detailValidate="detailValidate" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 创建标签 --> |
|
|
@ -90,13 +91,14 @@ |
|
|
|
<!-- 导入 --> |
|
|
|
<ImportForm ref="importFormRef" url="/wms/productionreturn-request-main/import" :importTemplateData="importTemplateData" |
|
|
|
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" /> |
|
|
|
|
|
|
|
<!-- 标签打印 --> |
|
|
|
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" /> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
import download from '@/utils/download' |
|
|
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|
|
|
import { ProductionreturnRequestMain,ProductionreturnRequestMainRules,ProductionreturnRequestDetail,ProductionreturnRequestDetailRules,ProductionreturnRequestDetailLabel,ProductionreturnRequestDetailLabelRules } from './productionreturnRequestMain.data' |
|
|
|
import { ProductionreturnRequestMain,ProductionreturnRequestMainRules,ProductionreturnRequestDetail,ProductionreturnRequestDetailRules,ProductionreturnRequestDetailLabel,ProductionreturnRequestDetailLabelRules, SupplierdeliverRequestPackage } from './productionreturnRequestMain.data' |
|
|
|
import * as ProductionreturnRequestMainApi from '@/api/wms/productionreturnRequestMain' |
|
|
|
import * as ProductionreturnRequestDetailApi from '@/api/wms/productionreturnRequestDetail' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
@ -130,6 +132,19 @@ const updataTableColumns = (val) => { |
|
|
|
tableColumns.value = val |
|
|
|
} |
|
|
|
|
|
|
|
// 子表新增/编辑校验 |
|
|
|
const detailValidate = (data) => { |
|
|
|
let tag = false; |
|
|
|
if(data.qty <= 0){ |
|
|
|
message.warning('数量必须大于0') |
|
|
|
tag = false; |
|
|
|
return tag; |
|
|
|
}else { |
|
|
|
tag = true; |
|
|
|
return tag; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 判断 物料类型是否与其他物料类型一致 |
|
|
|
const isItemType = async (itemCode, labelTypeParams) => { |
|
|
|
let isType = false |
|
|
@ -509,6 +524,34 @@ const openForm =async (type: string, row?: number) => { |
|
|
|
formRef.value.open(type, row) |
|
|
|
} |
|
|
|
|
|
|
|
// 批量打印--生产退料 |
|
|
|
const searchTableSuccess1 = async (formField, searchField, val, formRef, type, row) => { |
|
|
|
console.log('批量打印',val) |
|
|
|
// let rows:any = [] |
|
|
|
// val.forEach(item=>{ |
|
|
|
// rows = [...rows,...item.selectionRows.map(item1=>item1.number)] |
|
|
|
// }) |
|
|
|
if(val.length == 0){ |
|
|
|
message.warning("请先选择要打印的数据!") |
|
|
|
return |
|
|
|
} |
|
|
|
// window.open(src.value + '&asn_number=' + val.map(item1=>item1.number).join(',')) |
|
|
|
|
|
|
|
await PackageApi.batchPrintingLable(val.map(item1=>item1.number).join(',')).then(res => { |
|
|
|
console.log(res) |
|
|
|
if (labelType.value == 'cg') { |
|
|
|
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) |
|
|
|
window.open(src.value+'&asn_number='+res) |
|
|
|
} else { |
|
|
|
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) |
|
|
|
window.open(src.value+'&asn_number='+res) |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
message.error('创建标签失败') |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// 获取部门 用于详情 部门回显 |
|
|
|
const { wsCache } = useCache() |
|
|
|
/** 详情操作 */ |
|
|
@ -657,18 +700,32 @@ const handlePoint = async (row) => { |
|
|
|
}) |
|
|
|
// 判断是采购还是制造 |
|
|
|
if (isCreateLabel.value) { |
|
|
|
if (labelType.value == 'cg') { |
|
|
|
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) |
|
|
|
window.open(src.value+'&request_number='+row.number) |
|
|
|
} else { |
|
|
|
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken()) |
|
|
|
window.open(src.value+'&request_number='+row.number) |
|
|
|
} |
|
|
|
labelPrint(row) |
|
|
|
} else { |
|
|
|
message.warning('请先创建标签') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const searchTableRef = ref() |
|
|
|
const labelPrint = async (row) => { |
|
|
|
tableObject.loading = true |
|
|
|
const defaultParams = {'moduleName':'productreceipt_predict','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 |
|
|
|
}) |
|
|
|
searchTableRef.value.openData("标签信息",tableObjectPrint,{tableColumns},true) |
|
|
|
} |
|
|
|
|
|
|
|
/** 导入 */ |
|
|
|
const importFormRef = ref() |
|
|
|
const handleImport = () => { |
|
|
|