|
@ -74,6 +74,8 @@ |
|
|
<!-- 导入 --> |
|
|
<!-- 导入 --> |
|
|
<ImportForm ref="importFormRef" url="/wms/packageover-request-main/import" :importTemplateData="importTemplateData" @success="importSuccess" |
|
|
<ImportForm ref="importFormRef" url="/wms/packageover-request-main/import" :importTemplateData="importTemplateData" @success="importSuccess" |
|
|
:updateIsDisable="true" :coverIsDisable="true" :mode="2"/> |
|
|
:updateIsDisable="true" :coverIsDisable="true" :mode="2"/> |
|
|
|
|
|
<!-- 标签打印 --> |
|
|
|
|
|
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" /> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
@ -83,6 +85,8 @@ import { PackageoverRequestMain,PackageoverRequestMainRules, PackageoverRequestD |
|
|
import * as PackageoverRequestMainApi from '@/api/wms/packageoverRequestMain' |
|
|
import * as PackageoverRequestMainApi from '@/api/wms/packageoverRequestMain' |
|
|
import * as PackageoverRequestDetailApi from '@/api/wms/packageoverRequestDetail' |
|
|
import * as PackageoverRequestDetailApi from '@/api/wms/packageoverRequestDetail' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
|
|
import * as PackageApi from '@/api/wms/package' |
|
|
|
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
|
|
|
|
|
|
defineOptions({ name: 'PackageoverRequestMain' }) |
|
|
defineOptions({ name: 'PackageoverRequestMain' }) |
|
|
|
|
|
|
|
@ -93,7 +97,7 @@ const route = useRoute() // 路由信息 |
|
|
const routeName = ref() |
|
|
const routeName = ref() |
|
|
routeName.value = route.name |
|
|
routeName.value = route.name |
|
|
const tableColumns = ref([...PackageoverRequestMain.allSchemas.tableColumns,...PackageoverRequestDetail.allSchemas.tableMainColumns]) |
|
|
const tableColumns = ref([...PackageoverRequestMain.allSchemas.tableColumns,...PackageoverRequestDetail.allSchemas.tableMainColumns]) |
|
|
|
|
|
const isCreateLabel = ref(false) |
|
|
// 字段设置 更新主列表字段 |
|
|
// 字段设置 更新主列表字段 |
|
|
const updataTableColumns = (val) => { |
|
|
const updataTableColumns = (val) => { |
|
|
tableColumns.value = val |
|
|
tableColumns.value = val |
|
@ -188,6 +192,8 @@ const HeadButttondata = [ |
|
|
// }, |
|
|
// }, |
|
|
] |
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
const labelType = ref('') // 标签类别 采购还是制造等 |
|
|
|
|
|
|
|
|
// 头部按钮事件 |
|
|
// 头部按钮事件 |
|
|
const buttonBaseClick = (val, item) => { |
|
|
const buttonBaseClick = (val, item) => { |
|
|
if (val == 'add') { // 新增 |
|
|
if (val == 'add') { // 新增 |
|
@ -311,6 +317,8 @@ const buttonTableClick = async (val, row) => { |
|
|
openForm('update', row) |
|
|
openForm('update', row) |
|
|
} else if (val == 'delete') { // 删除 |
|
|
} else if (val == 'delete') { // 删除 |
|
|
handleDelete(row.masterId) |
|
|
handleDelete(row.masterId) |
|
|
|
|
|
}else if (val == 'point') { // 标签打印 |
|
|
|
|
|
handlePoint(row) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -321,6 +329,34 @@ const openForm =async (type: string, row?: number) => { |
|
|
formRef.value.open(type, row) |
|
|
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() |
|
|
const { wsCache } = useCache() |
|
|
/** 详情操作 */ |
|
|
/** 详情操作 */ |
|
@ -410,6 +446,55 @@ const submitForm = async (formType, data) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL |
|
|
|
|
|
// 标签打印 |
|
|
|
|
|
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) { |
|
|
|
|
|
labelPrint(row) |
|
|
|
|
|
} else { |
|
|
|
|
|
message.warning('请先创建标签') |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const searchTableRef = ref() |
|
|
|
|
|
const labelPrint = async (row) => { |
|
|
|
|
|
tableObject.loading = true |
|
|
|
|
|
const defaultParams = {'moduleName':'productreturn_predict','recordNumber':row.number} |
|
|
|
|
|
const {tableObject:tableObjectPrint ,tableMethods} = useTable({ |
|
|
|
|
|
defaultParams, |
|
|
|
|
|
getListApi: PackageApi.getLabelDetailPage // 分页接口 |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// 获得表格的各种操作 |
|
|
|
|
|
const { getList:getListPrint } = tableMethods |
|
|
|
|
|
getListPrint() |
|
|
|
|
|
tableObject.loading = false |
|
|
|
|
|
const tableColumns = PackageoverRequestMain.allSchemas.tableFormColumns |
|
|
|
|
|
tableColumns.forEach((item) => { |
|
|
|
|
|
item.width = item.table?.width || 150 |
|
|
|
|
|
}) |
|
|
|
|
|
searchTableRef.value.openData("标签信息",tableObjectPrint,{tableColumns},true) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** 导入 */ |
|
|
/** 导入 */ |
|
|
const importFormRef = ref() |
|
|
const importFormRef = ref() |
|
|
const handleImport = () => { |
|
|
const handleImport = () => { |
|
|