Browse Source

标签修改

master_hella_20240701
zhaoxuebing 6 months ago
parent
commit
665cc23f2b
  1. 1
      src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRecordMain/productreceiptscrapRecordMain.data.ts
  2. 63
      src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRequestMain/index.vue

1
src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRecordMain/productreceiptscrapRecordMain.data.ts

@ -509,6 +509,7 @@ export const ProductreceiptRecordDetail = useCrudSchemas(reactive<CrudSchema[]>(
label: '单据号',
field: 'number',
sort: 'custom',
hiddenInMain:true,
table: {
width: 180
},

63
src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRequestMain/index.vue

@ -113,6 +113,8 @@
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/productreceipt-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">
@ -129,6 +131,9 @@ import * as ItembasicApi from '@/api/wms/itembasic'
import * as PackageApi from '@/api/wms/package'
import { formatTime } from '@/utils/index'
import { getAccessToken } from '@/utils/auth'
import {
SupplierdeliverRequestPackage
} from '../../../purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts'
//
defineOptions({ name: 'ProductreceiptRequestMain' })
@ -636,6 +641,7 @@ const detailValidate = (data) => {
}
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
//
const handlePoint = async (row) => {
//
@ -658,18 +664,61 @@ 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 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/922734157577715712?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res)
}
}).catch(err => {
console.log(err)
message.error('创建标签失败')
})
}
/** 初始化 **/
onMounted(async () => {
getList()

Loading…
Cancel
Save