Browse Source

隔离退料 打印修改

master_hella_20240701
陈薪名 5 months ago
parent
commit
ef3889d894
  1. 95
      src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/index.vue
  2. 55
      src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/productionreturnRequestMainNo.data.ts

95
src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/index.vue

@ -90,12 +90,15 @@
<ImportForm ref="importFormRef" url="/wms/productionreturn-request-main/hold-import" :importTemplateData="importTemplateData" <ImportForm ref="importFormRef" url="/wms/productionreturn-request-main/hold-import" :importTemplateData="importTemplateData"
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" /> @success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
<!-- 标签打印 -->
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { ProductionreturnRequestMain,ProductionreturnRequestMainRules } from '../productionreturnRequestMain/productionreturnRequestMain.data' import { ProductionreturnRequestMain,ProductionreturnRequestMainRules } from '../productionreturnRequestMain/productionreturnRequestMain.data'
import { ProductionreturnRequestDetail,ProductionreturnRequestDetailRules, ProductionreturnRequestDetailNoLabel, ProductionreturnRequestDetailNoLabelRules } from './productionreturnRequestMainNo.data' import { ProductionreturnRequestDetail,ProductionreturnRequestDetailRules, ProductionreturnRequestDetailNoLabel, ProductionreturnRequestDetailNoLabelRules,SupplierdeliverRequestPackage } from './productionreturnRequestMainNo.data'
import * as ProductionreturnRequestMainNoApi from '@/api/wms/productionreturnRequestMainNo' import * as ProductionreturnRequestMainNoApi from '@/api/wms/productionreturnRequestMainNo'
import * as ProductionreturnRequestDetailNoApi from '@/api/wms/productionreturnRequestDetailNo' import * as ProductionreturnRequestDetailNoApi from '@/api/wms/productionreturnRequestDetailNo'
@ -473,7 +476,8 @@ const buttonTableClick = async (val, row) => {
} else if (val == 'delete') { // } else if (val == 'delete') { //
handleDelete(row.masterId) handleDelete(row.masterId)
} else if (val == 'point') { // } else if (val == 'point') { //
handlePoint(row) // handlePoint(row)
labelPrint(row)
} }
} }
@ -607,7 +611,42 @@ const submitFormLabel = async (formType, data) => {
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
// //
const handlePoint = async (row) => { // const handlePoint = async (row) => {
// //
// await PackageApi.getPackagePage({
// requestNumber: row.number
// }).then((res) => {
// if(res.list.length > 0) {
// isCreateLabel.value = true
// if (res.list[0].productionLineCode != null) {
// labelType.value = 'zz'
// } else {
// labelType.value = 'cg'
// }
// } else {
// isCreateLabel.value = false
// }
// }).catch(err => {
// isCreateLabel.value = false
// console.log(err)
// })
// //
// if (isCreateLabel.value) {
// if (labelType.value == 'cg') {
// const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken())
// window.open(src.value+'&asn_number='+row.number)
// } else {
// const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
// window.open(src.value+'&asn_number='+row.number)
// }
// } else {
// message.warning('')
// }
// }
const searchTableRef = ref()
const labelPrint = async (row) => {
tableObject.loading = true
// //
await PackageApi.getPackagePage({ await PackageApi.getPackagePage({
requestNumber: row.number requestNumber: row.number
@ -624,20 +663,58 @@ const handlePoint = async (row) => {
} }
}).catch(err => { }).catch(err => {
isCreateLabel.value = false isCreateLabel.value = false
tableObject.loading = false
console.log(err) console.log(err)
}) })
// //
if (isCreateLabel.value) { if (isCreateLabel.value) {
if (labelType.value == 'cg') { const defaultParams = {'moduleName':'productreceipt_predict','recordNumber':row.number}
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken()) const {tableObject:tableObjectPrint ,tableMethods} = useTable({
window.open(src.value+'&asn_number='+row.number) 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)
} else { } else {
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) tableObject.loading = false
window.open(src.value+'&asn_number='+row.number) message.warning('请先创建标签')
}
} }
// --退
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 { } else {
message.warning('请先创建标签') const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res)
} }
}).catch(err => {
console.log(err)
message.error('创建标签失败')
})
} }
/** 导入 */ /** 导入 */

55
src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/productionreturnRequestMainNo.data.ts

@ -847,3 +847,58 @@ export const ProductionreturnRequestDetailNoLabelRules = reactive({
{ required: true, message: '请输入批次', trigger: 'blur' } { required: true, message: '请输入批次', trigger: 'blur' }
] ]
}) })
export const SupplierdeliverRequestPackage = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '包装号',
field: 'number',
sort: 'custom',
isSearch: true,
table: {
width: 180,
fixed: 'left'
},
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
table: {
width: 150,
},
},
{
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true,
table: {
width: 150,
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'SelectV2'
},
table: {
width: 150,
},
},
]))

Loading…
Cancel
Save