diff --git a/src/api/wms/purchasereturnRequestMain/index.ts b/src/api/wms/purchasereturnRequestMain/index.ts index d6b4a3b7c..10be8d9e6 100644 --- a/src/api/wms/purchasereturnRequestMain/index.ts +++ b/src/api/wms/purchasereturnRequestMain/index.ts @@ -107,3 +107,8 @@ export const refusedPurchasereturnRequestMain = async (id) => { export const handlePurchasereturnRequestMain = async (id) => { return await request.put({ url: `/wms/purchasereturn-request-main/handle?id=` + id }) } + +// 生成标签 +export const genLabel = async (data) => { + return await request.post({ url: `/wms/purchasereturn-request-main/genLabel`, data }) +} diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 2e762d638..4271318da 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -1060,7 +1060,8 @@ export default { 提示:'Tip', 凭证号:'voucher number', 采购价格审批人:'Purchasing price approver', - 供应商发货单号:'Supplier\'s invoice number' + 供应商发货单号:'Supplier\'s invoice number', + 加载中:'loading', }, diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 3e38361f5..f97feb5a9 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -1060,7 +1060,8 @@ export default { 提示:'提示', 凭证号:'凭证号', 采购价格审批人:'采购价格审批人', - 供应商发货单号:'供应商发货单号' + 供应商发货单号:'供应商发货单号', + 加载中:'加载中', }, diff --git a/src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue b/src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue index 1151aaf81..75e35be3e 100644 --- a/src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue +++ b/src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue @@ -15,7 +15,7 @@ - - + - + - + - + - -
-
规则条件
- - +
+
规则条件
+ + - - + - - - - + - - - - - - - - + - - - + - - - + - - - + - -
-
规则配置
- +
+
规则配置
+ - - - + + - - + @@ -335,12 +339,15 @@ v-model="formData.configuration.AreaCode" v-if="warehouseType == 'AreaCode'" placeholder="请选择库区" + key="请选择库区" clearable style="flex: 1" + filterable + :filter-method="filterMethodWarehouseList" > @@ -349,12 +356,15 @@ v-model="formData.configuration.LocationGroupCode" v-if="warehouseType == 'LocationGroupCode'" placeholder="请选择库位组" + key="请选择库位组" clearable style="flex: 1" + filterable + :filter-method="filterMethodWarehouseList" > @@ -364,12 +374,15 @@ v-model="formData.configuration.LocationCode" v-if="warehouseType == 'LocationCode'" placeholder="请选择库位" + key="请选择库位" clearable style="flex: 1" + filterable + :filter-method="filterMethodWarehouseList" > @@ -377,9 +390,9 @@ - - - + + - - - + + - - - + + - - - + + - - + + - - + +
- + {{ cur.label }} @@ -442,29 +455,29 @@ - - + +
- + {{ cur.label }}
- - - + + +
- + {{ cur.label }} @@ -472,14 +485,14 @@ - - + +
- + {{ cur.label }} @@ -518,9 +531,9 @@ const dialogTitle = ref('') // 弹窗的标题 const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 const formType = ref('') // 表单的类型:create - 新增;update - 修改 const formRef = ref() // 表单 Ref - const formStrategyCode = ref('') + // 仓库类型 const warehouseType = ref('WarehouseCode') @@ -615,6 +628,7 @@ const options = reactive({ ], //供应商列表 supplierList: [], + orignSupplierList: [], // 物料类型列表 itemTypeOptions: [ { value: 'ItemType', label: '物料类型' }, @@ -638,7 +652,8 @@ const options = reactive({ { value: 'LocationCode', label: '库位' } ], //仓库列表 - warehouseList: [] + warehouseList: [], + originWarehouseList: [] }) // 弹窗按钮 const Butttondata = ref([ @@ -658,12 +673,24 @@ const buttonBaseClick = (val, item) => { } // 获取供应商列表 const getFormSupplierList = async () => { - options.supplierList = await getSupplierList() + options.orignSupplierList = await getSupplierList() + options.supplierList = [...options.orignSupplierList] } // 获取客户列表 const getFormCustomerList = async () => { options.supplierList = await getCustomerList() + options.supplierList = [...options.orignSupplierList] } +const filterMethod = (query: string) => { + if (query) { + options.supplierList = options.orignSupplierList.filter((item) => { + return item.name.includes(query) + }) + } else { + options.supplierList = [] + } +} + // 选择客户还是承运商 const changeSupplierCustomer = (e) => { formData.value.condition[0].Value = '' @@ -684,21 +711,42 @@ const changeCalculation = () => { } // 获取仓库列表 const getFormWarehouseList = async () => { - options.warehouseList = await getWarehouseList() + options.originWarehouseList = await getWarehouseList() + options.warehouseList = [...options.originWarehouseList] + } // 获取库区列表 const getFormAreaList = async () => { - options.warehouseList = await getAreaList() + options.originWarehouseList = await getAreaList() + options.warehouseList = [...options.originWarehouseList] } // 获取库位组列表 const getFormLocationgrouList = async () => { - options.warehouseList = await getLocationgroupList() + options.originWarehouseList = await getLocationgroupList() + options.warehouseList = [...options.originWarehouseList] } // 获取库位列表 const getFormLocationList = async () => { - options.warehouseList = await getLocationList() + const loading = ElLoading.service({ + lock: true, + text: t('ts.加载中'), + background: 'rgba(0, 0, 0, 0.7)', + }) + options.originWarehouseList = await getLocationList() + options.warehouseList = [...options.originWarehouseList] + nextTick(()=>{ + loading.close() + }) +} +const filterMethodWarehouseList = (query: string) => { + if (query) { + options.warehouseList = options.originWarehouseList.filter((item) => { + return item.code.includes(query) + }) + } else { + options.warehouseList = [] + } } -getFormLocationList() // 选择仓库/库位/库位组/库区 const changeWarehouse = (e) => { formData.value.configuration.WarehouseCode = '' @@ -717,11 +765,14 @@ const changeWarehouse = (e) => { } /** 打开弹窗 */ const open = async (type: string, strategyCode: string, id?: number) => { + formStrategyCode.value = strategyCode dialogVisible.value = true dialogTitle.value = t('action.' + type) formType.value = type warehouseType.value = 'WarehouseCode' + getFormWarehouseList() + resetForm() // 修改时,设置数据 if (id) { @@ -798,6 +849,8 @@ const open = async (type: string, strategyCode: string, id?: number) => { defaultButtons.formCloseBtn(null) // 关闭 ] } + + } defineExpose({ open }) // 提供 open 方法,用于打开弹窗 diff --git a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue index ded71312d..16b361438 100644 --- a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue @@ -110,7 +110,6 @@ :isShowReduceButton="false" @submitForm="submitFormLabel" @searchTableSuccess="searchTableSuccessLabel" - /> diff --git a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue index 84486e1c7..ef9f8f0e2 100644 --- a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue @@ -85,6 +85,21 @@ :detailValidate="detailValidate" /> + + + + { } } +// 生成标签 +const isCreateLabel = ref(false) +const formLabelRef = ref() +const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({ + getListApi: PurchasereturnRequestDetailApi.getPurchasereturnRequestDetailPage +}) +const { getList:getDetailList } = detatableMethods + +// 生成标签按钮操作 +const submitFormLabel = async (formType, data) => { + try { + console.log("formType==",formType) + console.log("data==",data) + data.subList = detatableData.tableList + console.log("detatableData",detatableData) + await message.confirm(t('ts.是否为此数据生成标签?')) + await PurchasereturnRequestMainApi.genLabel(data) //genLabelId.value + isCreateLabel.value = true + message.success('创建标签成功') + } finally { + formLabelRef.value.formLoading = false + formLabelRef.value.dialogVisible = false + } +} + +// 查询页面返回 +const searchTableSuccessLabel = (formField, searchField, val, formRef, type, row) => { + nextTick(() => { + if (type == 'tableForm') { + // 明细查询页赋值 + row[formField] = val[0][searchField] + if (formField == 'packUnit' || formField == 'packQty') { + row['packUnit'] = val[0]['packUnit'] + row['packQty'] = val[0]['packQty'] + } + } + }) +} + // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { nextTick(() => { @@ -195,8 +254,6 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => if(formField == 'purchaseReceiptRecordNumber'){ // isShowButton.value = false setV[formField] = val[0][searchField] - console.log(333333,val[0]); - setV['purchaseReceiptRecordNumber'] = val[0]['number'] setV['supplierCode'] = val[0]['supplierCode'] setV['asnNumber'] = val[0]['asnNumber'] @@ -209,7 +266,6 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => if (res) tableData.value = res tableData.value.forEach((item) => { item.batch = item.toBatch - item.packingNumber = item.toPackingNumber item.containerNumber = item.toContainerNumber item.receiptQty = item.qty @@ -413,7 +469,18 @@ const butttondata = (row,$index) => { defaultButtons.mainListEditBtn({ hide: isShowMainButton(row, ['1']), hasPermi: 'wms:purchasereceipt-request-main:update' - }) // 编辑 + }), // 编辑 + { + label: '生成标签', + name: 'ssbq', + hide: isShowMainButton(row, ['3']), + type: 'primary', + icon: '', + color: '', + hasPermi: '', + link: true // 文本展现按钮 + }, + defaultButtons.mainListPointBtn({ hide: isShowMainButton(row, ['3','6']) }), // 标签打印 ] } @@ -440,7 +507,18 @@ const buttonTableClick = async (val, row) => { } else if (val == 'edit') { // 编辑 openForm('update', row) - } + } else if(val == 'ssbq'){ + // 生成标签 + detatableData.params = { + masterId:row.masterId + } + genLabelId.value = row.masterId + await getDetailList() + formLabelRef.value.open('create', row, null,'createLabel')//创建标签页面 createLabel 标题 + } else if (val == 'point') { + // 标签打印 + labelPrint(row) + } } /** 添加/修改操作 */ @@ -814,6 +892,48 @@ const detailOpenForm = (type, row) =>{ }) } + +const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL +const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) + +// 标签打印 +const showLabelRef = ref() +const labelPrint = async (row) => { + tableObject.loading = true + const defaultParams = {'moduleName':'supplier','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 + }) + showLabelRef.value.openData("标签信息",tableObjectPrint,{tableColumns},true) +} + +// 批量打印---采购收货申请 +const showLabelSuccess = 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) + window.open(src.value + '&asn_number=' + res) + }).catch(err => { + console.log(err) + message.error('创建标签失败') + }) +} + /** 初始化 **/ onMounted(async () => { getList() diff --git a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts index 805c58a68..fedad8d98 100644 --- a/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts +++ b/src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/purchasereturnRequestMain.data.ts @@ -2,14 +2,12 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter,dateFormatter2 } from '@/utils/formatTime' const { t } = useI18n() // 国际化 import * as getRequestsettingApi from '@/api/wms/requestsetting/index' -import * as PurchasereceiptRecordMainApi from '@/api/wms/purchasereceiptRecordMain' -import { - PurchasereceiptRecordDetail, - PurchasereceiptRecordMain -} from '../../purchasereceipt/purchasereceiptRecordMain/purchasereceiptRecordMain.data' +import { PurchasereceiptRecordDetail,PurchasereceiptRecordMain } from '../../purchasereceipt/purchasereceiptRecordMain/purchasereceiptRecordMain.data' import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecordDetail' import { Supplier } from "@/views/wms/basicDataManage/supplierManage/supplier/supplier.data"; import * as SupplierApi from "@/api/wms/supplier"; +import { Itempackaging } from '@/views/wms/basicDataManage/itemManage/itempackage/itempackage.data' +import * as ItemPackageApi from '@/api/wms/itempackage/index' // 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 @@ -1202,3 +1200,262 @@ export const PurchasereturnRequestDetailRules = reactive({ { max: 50, message: '不得超过50个字符', trigger: 'blur' } ], }) + +export const PurchasereReturnRequestDetailLabel = useCrudSchemas(reactive([ + { + label: '物料代码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + tableForm:{ + disabled: true + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '物料名称', + field: 'itemName', + sort: 'custom', + table: { + width: 150 + }, + tableForm:{ + disabled:true + }, + isTableForm: true, + }, + { + label: '物料描述1', + field: 'itemDesc1', + sort: 'custom', + table: { + width: 150 + }, + tableForm:{ + disabled:true + }, + isTableForm: true, + }, + { + label: '物料描述2', + field: 'itemDesc2', + sort: 'custom', + table: { + width: 150 + }, + isTableForm: false, + isForm: false + }, + { + label: '包装号', + field: 'packingNumber', + sort: 'custom', + table: { + width: 150 + }, + isTableForm: false, + isForm: false + }, + { + label: '器具号', + field: 'containerNumber', + sort: 'custom', + table: { + width: 150 + }, + isTableForm: false, + isForm: false + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + componentProps: { + disabled:true, + min: 1, + precision: 6 + }, + }, + tableForm: { + disabled:true, + type: 'InputNumber', + min: 1, + precision: 6 + } + }, + { + label: '计量单位', + field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + tableForm: { + type: 'Select', + disabled: true + } + }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + isTableForm: false, + isForm: false + }, + { + label: '生产日期', + field: 'produceDate', + formatter: dateFormatter2, + detail: { + dateFormat: 'YYYY-MM-DD' + }, + sort: 'custom', + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + disabled:true, + style: {width: '100%'}, + type: 'date', + dateFormat: 'YYYY-MM-DD', + valueFormat: 'x', + } + }, + tableForm:{ + disabled:true, + type:'FormDate', + placeholder: '请选择生产日期', + valueFormat: 'x', + }, + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + table: { + width: 150 + }, + tableForm:{ + disabled: true + } + }, + { + label: '替代批次', + field: 'altBatch', + sort: 'custom', + table: { + width: 150 + }, + isTableForm: false, + isForm: false + }, + { + label: '库存状态', + field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + isTableForm: false, + isForm: false, + tableForm: { + type: 'Select' + } + }, + { + label: '包装数量', + field: 'packQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true, + isSearchList: true, + searchListPlaceholder: '请选择包装', + searchField: 'packQty', + searchTitle: '物品包装信息', + searchAllSchemas: Itempackaging.allSchemas, + searchPage: ItemPackageApi.getItempackagingPageBySupplierdeliver, + searchCondition: [ + { + key: 'itemCode', + value: 'itemCode', + message: '请选择订单行', + isMainValue: true + }, + { + key: 'available', + value: 'TRUE', + isMainValue: false + } + + ] + } + }, + tableForm: { + disabled: true, + isInpuFocusShow: true, + searchListPlaceholder: '请选择包装', + searchField: 'packQty', + searchTitle: '物品包装信息', + searchAllSchemas: Itempackaging.allSchemas, + searchPage: ItemPackageApi.getItempackagingPageBySupplierdeliver, + searchCondition: [ + { + key: 'itemCode', + value: 'itemCode', + message: '请选择订单行', + isMainValue: true + }, + { + key: 'available', + value: 'TRUE', + isMainValue: false + }] + }, + isTableForm: true, + isForm: true + }, + { + label: '包装规格', + field: 'packUnit', + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150, + componentProps: { + disabled: true + } + }, + tableForm:{ + disabled:true + }, + isTableForm: true, + isForm: true + }, +])) \ No newline at end of file