diff --git a/src/api/wms/supplieritem/index.ts b/src/api/wms/supplieritem/index.ts index 3c31a8d25..448b6b108 100644 --- a/src/api/wms/supplieritem/index.ts +++ b/src/api/wms/supplieritem/index.ts @@ -73,5 +73,9 @@ export const selectItembasicTypeToSupplieritem = async (params) => { return await request.post({ url: `/wms/supplieritem/pageItembasicTypeToSupplieritemSenior`, data }) } else { return await request.get({ url: `/wms/supplieritem/pageItembasicTypeToSupplieritem`, params }) + } } + +export const getDefaultLocationCode = async(data: SupplieritemVO)=> { + return await request.post({ url: `/wms/supplieritem/getDefaultLocationCode`, data }) } \ No newline at end of file diff --git a/src/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data.ts b/src/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data.ts index 1a14f2639..2395499b8 100644 --- a/src/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data.ts +++ b/src/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data.ts @@ -7,11 +7,11 @@ import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/item import * as SupplierApi from '@/api/wms/supplier' import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data' -// import * as WarehouseApi from '@/api/wms/warehouse' -// import { Warehouse } from '@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data' +import * as WarehouseApi from '@/api/wms/warehouse' +import { Warehouse } from '@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data' -// import * as LocationApi from '@/api/wms/location' -// import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data' +import * as LocationApi from '@/api/wms/location' +import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data' import {validateYS} from '@/utils/validator' @@ -156,35 +156,30 @@ export const Supplieritem = useCrudSchemas(reactive([ // } // } // }, - // { - // label: '默认收货库位', - // field: 'defaultLocationCode', - // sort: 'custom', - // table: { - // width: 150 - // }, - // form: { - // // labelMessage: '信息提示说明!!!', - // componentProps: { - // isSearchList: true, // 开启查询弹窗 - // searchListPlaceholder: '请选择库位代码', // 输入框占位文本 - // searchField: 'code', // 查询弹窗赋值字段 - // searchTitle: '库位信息', // 查询弹窗标题 - // searchAllSchemas: Location.allSchemas, // 查询弹窗所需类 - // searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法 - // searchCondition: [{ - // key: 'available', - // value: 'TRUE', - // isMainValue: false - // },{ - // key: 'warehouseCode', - // value: 'defaultWarehouseCode', - // message: '请填写默认收货仓库!', - // isMainValue: true - // }] - // } - // } - // }, + { + label: '默认收货库位', + field: 'defaultLocationCode', + sort: 'custom', + table: { + width: 150 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择库位代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '库位信息', // 查询弹窗标题 + searchAllSchemas: Location.allSchemas, // 查询弹窗所需类 + searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + } + }, // { // label: '结算方式', // field: 'settlementType', diff --git a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptJobMain/purchasereceiptJobMain.data.ts b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptJobMain/purchasereceiptJobMain.data.ts index 7f28fa4b3..75cfd7d43 100644 --- a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptJobMain/purchasereceiptJobMain.data.ts +++ b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptJobMain/purchasereceiptJobMain.data.ts @@ -775,7 +775,6 @@ export const PurchasereceiptJobDetail = useCrudSchemas(reactive([ { label: '包装规格', field: 'packUnit', - dictType: DICT_TYPE.PACK_UNIT, dictClass: 'string', isTable: true, sort: 'custom', diff --git a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/purchasereceiptRecordMain.data.ts b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/purchasereceiptRecordMain.data.ts index 397a6a4ed..128b9623e 100644 --- a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/purchasereceiptRecordMain.data.ts +++ b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/purchasereceiptRecordMain.data.ts @@ -550,7 +550,6 @@ export const PurchasereceiptRecordDetail = useCrudSchemas(reactive { label: '包装规格', field: 'packUnit', - dictType: DICT_TYPE.PACK_UNIT, dictClass: 'string', isSearch: true, isTable: true, diff --git a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue index c30144b35..210125dd0 100644 --- a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue @@ -54,6 +54,7 @@ @handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess" @submitForm="submitForm" + @formFormDateChange="formFormDateChange" /> @@ -83,6 +84,8 @@ import { PurchasereceiptRequestMain,PurchasereceiptRequestMainRules,Purchaserece import * as PurchasereceiptRequestMainApi from '@/api/wms/purchasereceiptRequestMain' import * as PurchasereceiptRequestDetailApi from '@/api/wms/purchasereceiptRequestDetail' import * as defaultButtons from '@/utils/disposition/defaultButtons' +import { formatDate } from '@/utils/formatTime' +import * as SupplieritemApi from '@/api/wms/supplieritem' // 采购收货申请 defineOptions({ name: 'PurchasereceiptRequestMain' }) @@ -107,6 +110,8 @@ const updataTableColumns = (val) => { // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { + //console.log("formRef",formRef) + //console.log("supplierCode",formRef.value.formRef.formModel.supplierCode) nextTick(() => { if (type == 'tableForm') { // 明细查询页赋值 @@ -115,9 +120,22 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => row['itemCode'] = val[0]['code'] } else if(formField == 'poNumber') { row['poNumber'] = val[0]['number'] - } else { - // row['poNumber'] = val[0]['number'] + } else if(formField == 'poLine'){ row['poLine'] = val[0]['lineNumber'] + row['itemCode'] = val[0]['itemCode'] + row['uom'] = val[0]['uom'] + let supplierCode = formRef.formModel.supplierCode; + let itemCode = val[0]['itemCode'] + let queryData:SupplieritemApi.SupplieritemVO={ + supplierCode:supplierCode, + itemCode:itemCode + } + SupplieritemApi.getDefaultLocationCode(queryData).then(res =>{ + row['defaultToLocationCode'] = res + }) + }else if (formField == 'packQty'){ + row['packQty'] = val[0]['packQty'] + row['packUnit'] = val[0]['packUnit'] } } else { const setV = {} @@ -151,6 +169,8 @@ const { getList, setSearchParams } = tableMethods // 列表头部按钮 const HeadButttondata = [ + defaultButtons.defaultAddBtn(null), // 新增 + defaultButtons.defaultImportBtn(null), // 导入 defaultButtons.defaultExportBtn({hasPermi:'wms:purchasereceipt-request-main:export'}), // 导出 defaultButtons.defaultFreshBtn(null), // 刷新 defaultButtons.defaultFilterBtn(null), // 筛选 @@ -159,7 +179,11 @@ const HeadButttondata = [ // 头部按钮事件 const buttonBaseClick = (val, item) => { - if (val == 'export') { // 导出 + if (val == 'add') {// 新增 + openForm('create') + } else if (val == 'import') {// 导入 + handleImport() + }else if (val == 'export') { // 导出 handleExport() } else if (val == 'refresh') { // 刷新 if (tableObject.params.filters && tableObject.params.filters.length > 0 ) { @@ -386,6 +410,13 @@ const searchFormClick = (searchData) => { // } // } +const formFormDateChange = (field, val,row, index) => { + if(field == 'produceDate'){ + let produceDateStr = formatDate(val,'YYYYMMDD'); + row.batch = produceDateStr + } +} + /** 初始化 **/ onMounted(async () => { getList() diff --git a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/purchasereceiptRequestMain.data.ts b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/purchasereceiptRequestMain.data.ts index aa2b15226..6755f673f 100644 --- a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/purchasereceiptRequestMain.data.ts +++ b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/purchasereceiptRequestMain.data.ts @@ -7,6 +7,12 @@ import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/su import * as ItembasicApi from '@/api/wms/itembasic' import * as PurchaseMainApi from '@/api/wms/purchaseMain' import * as PurchaseDetailApi from '@/api/wms/purchaseDetail' +import * as PurchasePlanMainApi from '@/api/wms/purchasePlanMain' +import * as LocationApi from '@/api/wms/location' +import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data' +import { PurchasePlanDetail, PurchasePlanMain } from '../../supplierdeliver/purchasePlanMain/purchasePlanMain.data' +import { Itempackaging } from '@/views/wms/basicDataManage/itemManage/itempackage/itempackage.data' +import * as ItemPackageApi from '@/api/wms/itempackage/index' // 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 const queryParams = { @@ -46,42 +52,70 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive( isSearch: true, }, { - label: '发货单号', - field: 'asnNumber', + label: '供应商代码', + field: 'supplierCode', sort: 'custom', table: { - width: 180 + width: 150 }, - isForm: false, + isSearch: true, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择供应商代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '供应商信息', // 查询弹窗标题 + searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类 + searchPage: SupplierApi.getSupplierPage // 查询弹窗所需分页方法 + } + } }, { - label: '要货计划单号', - field: 'ppNumber', + label: '发货单号', + field: 'asnNumber', sort: 'custom', table: { width: 180 }, - isForm: false, + isForm: true, }, { - label: '供应商代码', - field: 'supplierCode', + label: '要货计划单号', + field: 'ppNumber', sort: 'custom', table: { - width: 150 + width: 180 }, - isSearch: true, form: { // labelMessage: '信息提示说明!!!', componentProps: { isSearchList: true, // 开启查询弹窗 - searchListPlaceholder: '请选择供应商代码', // 输入框占位文本 - searchField: 'code', // 查询弹窗赋值字段 - searchTitle: '供应商信息', // 查询弹窗标题 - searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类 - searchPage: SupplierApi.getSupplierPage // 查询弹窗所需分页方法 + searchListPlaceholder: '请选择要货计划单号', // 输入框占位文本 + searchField: 'number', // 查询弹窗赋值字段 + searchTitle: '要货计划信息', // 查询弹窗标题 + searchAllSchemas: PurchasePlanMain.allSchemas, // 查询弹窗所需类 + searchPage: PurchasePlanMainApi.getPurchasePlanMainPage, // 查询弹窗所需分页方法 + searchCondition: [ + { + key: 'supplierCode', + value: 'supplierCode', + message: '请填写供应商代码!', + isMainValue: true + }, + { + key: 'status', + value: 4, + isMainValue: false + }, + { + key: 'available', + value: "TRUE", + isMainValue: false + }] } - } + }, + isForm: true, }, { label: '承运商', @@ -94,6 +128,7 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive( { label: '运输方式', field: 'transferMode', + dictType: DICT_TYPE.TRANSFER_MODE, sort: 'custom', table: { width: 150 @@ -328,7 +363,7 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive( }, form: { component: 'Switch', - value: requestsettingData.autoCommit, + value: 'FALSE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE', @@ -348,7 +383,7 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive( }, form: { component: 'Switch', - value: requestsettingData.autoAgree, + value: 'FALSE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE', @@ -368,7 +403,7 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive( }, form: { component: 'Switch', - value: requestsettingData.autoExecute, + value: 'FALSE', componentProps: { inactiveValue: 'FALSE', activeValue: 'TRUE', @@ -456,7 +491,13 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive