|
|
@ -82,6 +82,8 @@ |
|
|
|
v-model:sort="detatableDataBom.sort" |
|
|
|
/> |
|
|
|
</Dialog> |
|
|
|
<!-- 标签打印 --> |
|
|
|
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccessLabel" /> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
@ -92,6 +94,12 @@ import * as ProductreceiptRecordDetailApi from '@/api/wms/productreceiptRecordDe |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import * as BackflushRecordDetailbApi from '@/api/wms/backflushRecordDetailb' |
|
|
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|
|
|
import * as PackageApi from '@/api/wms/package' |
|
|
|
import { |
|
|
|
SupplierdeliverRequestPackage |
|
|
|
} from '../../../purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts' |
|
|
|
import * as ProductreceiptRequestDetailApi from '@/api/wms/productreceiptRequestDetail' |
|
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
|
|
|
|
|
// 制品收货记录主 |
|
|
|
// 预生产收货记录主 |
|
|
@ -169,6 +177,14 @@ const buttonBaseClick = (val, item) => { |
|
|
|
console.log('其他按钮', item) |
|
|
|
} |
|
|
|
} |
|
|
|
// 根据状态返回该按钮是否显示 |
|
|
|
const isShowMainButton = (row,val) => { |
|
|
|
if (val.indexOf(row.status) > -1) { |
|
|
|
return false |
|
|
|
} else { |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = (row,$index) => { |
|
|
@ -179,6 +195,7 @@ const butttondata = (row,$index) => { |
|
|
|
return [ |
|
|
|
// defaultButtons.mainInspectRequestBtn({hasPermi:'wms:productreceipt-record-main:createInspectRequest',hide:row.inspectRequestFlag == "FALSE" }),// 生成到货检验申请 |
|
|
|
defaultButtons.mainInspectRequestBtn({hide:row.inspectRequestFlag == "FALSE" }),// 生成到货检验申请 |
|
|
|
defaultButtons.mainListPointBtn(null), // 标签打印 |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
@ -186,7 +203,63 @@ const butttondata = (row,$index) => { |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if(val == 'inspectRequest'){//生成到货检验申请 |
|
|
|
handleCreateInspectRequest(row.number) |
|
|
|
} else if (val == 'point') { // 标签打印 |
|
|
|
labelPrint(row) |
|
|
|
} |
|
|
|
} |
|
|
|
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL |
|
|
|
// 标签打印 |
|
|
|
const searchTableRef = ref() |
|
|
|
const labelType = ref('') // 标签类别 采购还是制造等 |
|
|
|
const labelPrint = async (row) => { |
|
|
|
tableObject.loading = true |
|
|
|
//获取类型 |
|
|
|
let resType = await PackageApi.getPackagePage({ |
|
|
|
requestNumber: row.requestNumber |
|
|
|
}) |
|
|
|
if(resType.list.length > 0){ |
|
|
|
if (resType.list[0].productionLineCode != null) { |
|
|
|
labelType.value = 'zz' |
|
|
|
} else { |
|
|
|
labelType.value = 'cg' |
|
|
|
} |
|
|
|
} |
|
|
|
const defaultParams = {'moduleName':'productreceipt_predict','recordNumber':row.requestNumber} |
|
|
|
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 searchTableSuccessLabel = 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) |
|
|
|
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('创建标签失败') |
|
|
|
}) |
|
|
|
} |
|
|
|
// 获取部门 用于详情 部门回显 |
|
|
|
const { wsCache } = useCache() |
|
|
|