songguoqiang 2 weeks ago
parent
commit
e30be5bb94
  1. 58
      src/api/infra/outerApiHis/index.ts
  2. 2
      src/api/wms/switch/index.ts
  3. 1
      src/components/Detail/src/Detail.vue
  4. 1
      src/utils/dict.ts
  5. 254
      src/views/infra/outerApiHis/index.vue
  6. 82
      src/views/infra/outerApiHis/outerApiHis.data.ts
  7. 22
      src/views/wms/basicDataManage/strategySetting/strategy/deliverStrategy/AddForm.vue
  8. 8
      src/views/wms/basicDataManage/strategySetting/strategy/downShelfStrategy/AddForm.vue
  9. 92
      src/views/wms/productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data.ts

58
src/api/infra/outerApiHis/index.ts

@ -0,0 +1,58 @@
import request from '@/config/axios'
export interface OuterApiHisVO {
id: number
number: string
type: string
times: number
content: string
result: string
}
// 查询第三方接口调用记录列表
export const getOuterApiHisPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/infra/outer-api-his/senior', data })
} else {
return await request.get({ url: `/infra/outer-api-his/page`, params })
}
}
// 查询第三方接口调用记录详情
export const getOuterApiHis = async (id: number) => {
return await request.get({ url: `/infra/outer-api-his/get?id=` + id })
}
// 新增第三方接口调用记录
export const createOuterApiHis = async (data: OuterApiHisVO) => {
return await request.post({ url: `/infra/outer-api-his/create`, data })
}
// 修改第三方接口调用记录
export const updateOuterApiHis = async (data: OuterApiHisVO) => {
return await request.put({ url: `/infra/outer-api-his/update`, data })
}
// 删除第三方接口调用记录
export const deleteOuterApiHis = async (id: number) => {
return await request.delete({ url: `/infra/outer-api-his/delete?id=` + id })
}
// 导出第三方接口调用记录 Excel
export const exportOuterApiHis = async (params) => {
return await request.download({ url: `/infra/outer-api-his/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/infra/outer-api-his/get-import-template' })
}
//重试
export const retry = (id: number) => {
return request.get({
url: '/wms/outer/retry?id=' + id
})
}

2
src/api/wms/switch/index.ts

@ -57,5 +57,5 @@ export const importTemplate = () => {
// 获取开关详情 // 获取开关详情
export const getSwitchByCode = async (code) => { export const getSwitchByCode = async (code) => {
// return await request.get({ url: '/wms/switch/getByCode?code=' + code }) return await request.get({ url: '/wms/switch/getByCode?code=' + code })
} }

1
src/components/Detail/src/Detail.vue

@ -480,6 +480,7 @@ const props = defineProps({
const allSchemas = ref(props.allSchemas) const allSchemas = ref(props.allSchemas)
const detailAllSchemasRef = ref(props.detailAllSchemas) const detailAllSchemasRef = ref(props.detailAllSchemas)
const detailAllSchemasRules = ref(props.detailAllSchemasRules) const detailAllSchemasRules = ref(props.detailAllSchemasRules)
console.log(222,wsCache.get('ShowPackingNumber'))
if (!wsCache.get('ShowPackingNumber')) { if (!wsCache.get('ShowPackingNumber')) {
if (allSchemas.value) { if (allSchemas.value) {
allSchemas.value.detailSchema = props.allSchemas.detailSchema.filter(item => item.field != 'packingNumber') allSchemas.value.detailSchema = props.allSchemas.detailSchema.filter(item => item.field != 'packingNumber')

1
src/utils/dict.ts

@ -127,6 +127,7 @@ export enum DICT_TYPE {
INFRA_CODEGEN_FRONT_TYPE = 'infra_codegen_front_type', INFRA_CODEGEN_FRONT_TYPE = 'infra_codegen_front_type',
INFRA_CODEGEN_SCENE = 'infra_codegen_scene', INFRA_CODEGEN_SCENE = 'infra_codegen_scene',
INFRA_FILE_STORAGE = 'infra_file_storage', INFRA_FILE_STORAGE = 'infra_file_storage',
INFRA_OUTER_API_TYPE = 'outer_api_type',
// ========== BPM 模块 ========== // ========== BPM 模块 ==========
BPM_MODEL_CATEGORY = 'bpm_model_category', BPM_MODEL_CATEGORY = 'bpm_model_category',

254
src/views/infra/outerApiHis/index.vue

@ -0,0 +1,254 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="OuterApiHis.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="OuterApiHis.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="OuterApiHisRules"
:formAllSchemas="OuterApiHis.allSchemas"
:apiUpdate="OuterApiHisApi.updateOuterApiHis"
:apiCreate="OuterApiHisApi.createOuterApiHis"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="OuterApiHis.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/infra/outer-api-his/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { OuterApiHis,OuterApiHisRules } from './outerApiHis.data'
import * as OuterApiHisApi from '@/api/infra/outerApiHis'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'OuterApiHis' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(OuterApiHis.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: OuterApiHisApi.getOuterApiHisPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:outerApiHis:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:outerApiHis:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'wms:outerApiHis:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = (row) =>{
return [
// defaultButtons.mainListEditBtn({hasPermi:'wms:outerApiHis:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:outerApiHis:delete'}), //
defaultButtons.retryBtn({hide: row.times >= 3}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if (val == 'retry') { //
handleRetry(row)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =OuterApiHis.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await OuterApiHisApi.createOuterApiHis(data)
message.success(t('common.createSuccess'))
} else {
await OuterApiHisApi.updateOuterApiHis(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicOuterApiHis')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await OuterApiHisApi.deleteOuterApiHis(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await OuterApiHisApi.exportOuterApiHis(tableObject.params)
download.excel(data, '第三方接口调用记录.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '第三方接口调用记录导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
//
const handleRetry = (row) => {
OuterApiHisApi.retry(row.id).then(res => {
if(res){
message.success(t('common.retrySuccess'))
}else{
message.success(t('common.retryFinish'))
}
getList()
}).catch(() => {
getList()
})
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await OuterApiHisApi.importTemplate()
})
</script>

82
src/views/infra/outerApiHis/outerApiHis.data.ts

@ -0,0 +1,82 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const OuterApiHisRules = reactive({
type: [required],
times: [required],
})
export const OuterApiHis = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'ID',
field: 'id',
sort: 'custom',
isForm: false,
},
{
label: '编号',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '类型',
field: 'type',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.INFRA_OUTER_API_TYPE,
dictClass: 'string',
form: {
component: 'SelectV2'
},
},
{
label: '执行次数',
field: 'times',
sort: 'custom',
form: {
component: 'InputNumber',
value: 1
},
search: {
component: 'InputNumber',
value: 1
}
},
{
label: '内容',
field: 'content',
sort: 'custom',
},
{
label: '结果',
field: 'result',
sort: 'custom',
isSearch: true,
},
{
label: '是否成功',
field: 'success',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

22
src/views/wms/basicDataManage/strategySetting/strategy/deliverStrategy/AddForm.vue

@ -530,8 +530,8 @@ const formData = ref({
{ ParamCode: 'InventoryStatus', Operator: 'IN', Value: [] }, { ParamCode: 'InventoryStatus', Operator: 'IN', Value: [] },
// //
{ ParamCode: 'StorageType', Operator: 'IN', Value: [] }, { ParamCode: 'StorageType', Operator: 'IN', Value: [] },
// // 线
{ ParamCode: 'TransactionType', Operator: 'IN', Value: '' } { ParamCode: 'Productionline', Operator: 'IN', Value: '' }
], ],
configuration: { configuration: {
// //
@ -626,10 +626,10 @@ const options = reactive({
], ],
// //
warehouseTypeOptions: [ warehouseTypeOptions: [
{ value: 'WarehouseCode', label: '仓库' }, { value: 'WarehouseCode', label: '仓库' },
{ value: 'AreaCode', label: '库区' }, { value: 'AreaCode', label: '库区' },
{ value: 'LocationGroupCode', label: '库位组' }, { value: 'LocationGroupCode', label: '库位组' },
{ value: 'LocationCode', label: '库位' } { value: 'LocationCode', label: '库位' }
], ],
warehouseList: [], warehouseList: [],
originWarehouseList: [], originWarehouseList: [],
@ -837,7 +837,7 @@ const searchTransactionType = ()=>{
'请选择生产线', '请选择生产线',
Productionline.allSchemas, Productionline.allSchemas,
ProductionlineApi.getProductionlinePage, ProductionlineApi.getProductionlinePage,
'TransactionType', 'Productionline',
'code', 'code',
true, true,
undefined, undefined,
@ -923,8 +923,8 @@ const searchWarehouse = ()=>{
} }
const searchTableSuccess = (formField, searchField, val, type, row) => { const searchTableSuccess = (formField, searchField, val, type, row) => {
if(formField=='TransactionType'){ if(formField=='Productionline'){
let transactionType = formData.value.condition.find(item=>item['ParamCode']=='TransactionType') let transactionType = formData.value.condition.find(item=>item['ParamCode']=='Productionline')
if(transactionType){ if(transactionType){
transactionType.Value = val.map(item=>(item['code'])).join(',') transactionType.Value = val.map(item=>(item['code'])).join(',')
} }
@ -1130,8 +1130,8 @@ const resetForm = () => {
{ ParamCode: 'InventoryStatus', Operator: 'IN', Value: [] }, { ParamCode: 'InventoryStatus', Operator: 'IN', Value: [] },
// //
{ ParamCode: 'StorageType', Operator: 'IN', Value: [] }, { ParamCode: 'StorageType', Operator: 'IN', Value: [] },
// // 线
{ ParamCode: 'TransactionType', Operator: 'IN', Value: '' } { ParamCode: 'Productionline', Operator: 'IN', Value: '' }
], ],
configuration: { configuration: {

8
src/views/wms/basicDataManage/strategySetting/strategy/downShelfStrategy/AddForm.vue

@ -804,10 +804,10 @@ const options = reactive({
], ],
// //
warehouseTypeOptions: [ warehouseTypeOptions: [
{ value: 'WarehouseCode', label: '仓库' }, { value: 'WarehouseCode', label: '仓库' },
{ value: 'AreaCode', label: '库区' }, { value: 'AreaCode', label: '库区' },
{ value: 'LocationGroupCode', label: '库位组' }, { value: 'LocationGroupCode', label: '库位组' },
{ value: 'LocationCode', label: '库位' } { value: 'LocationCode', label: '库位' }
], ],
warehouseList: [], warehouseList: [],
originWarehouseList: [], originWarehouseList: [],

92
src/views/wms/productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data.ts

@ -1834,53 +1834,53 @@ export const ProductreceiptRequestLabel = useCrudSchemas(reactive<CrudSchema[]>(
isTable: false, isTable: false,
tableForm: { tableForm: {
disabled: true, disabled: true,
isInpuFocusShow: true, // isInpuFocusShow: true,
searchListPlaceholder: '请选择生产线代码', // searchListPlaceholder: '请选择生产线代码',
searchField: 'code', // searchField: 'code',
searchTitle: '生产线信息', // searchTitle: '生产线信息',
searchAllSchemas: Productionline.allSchemas, // searchAllSchemas: Productionline.allSchemas,
searchPage: ProductionlineApi.getProductionlinePage, // searchPage: ProductionlineApi.getProductionlinePage,
searchCondition: [{ // searchCondition: [{
key: 'available', // key: 'available',
value: 'TRUE', // value: 'TRUE',
isMainValue: false // isMainValue: false
}, { // }, {
key: 'workshopCode', // key: 'workshopCode',
value: 'workshopCode', // value: 'workshopCode',
message: '请填写车间代码!', // message: '请填写车间代码!',
isMainValue: true // isMainValue: true
}] // }]
}, },
form: { // form: {
// labelMessage: '信息提示说明!!!', // // labelMessage: '信息提示说明!!!',
componentProps: { // componentProps: {
enterSearch: true, // enterSearch: true,
isSearchList: true, // isSearchList: true,
searchListPlaceholder: '请选择生产线代码', // searchListPlaceholder: '请选择生产线代码',
searchField: 'code', // searchField: 'code',
searchTitle: '生产线信息', // searchTitle: '生产线信息',
searchAllSchemas: Productionline.allSchemas, // searchAllSchemas: Productionline.allSchemas,
searchPage: ProductionlineApi.getProductionlinePage, // searchPage: ProductionlineApi.getProductionlinePage,
searchCondition: [{ // searchCondition: [{
key: 'available', // key: 'available',
value: 'TRUE', // value: 'TRUE',
isMainValue: false // isMainValue: false
}, { // }, {
key: 'workshopCode', // key: 'workshopCode',
value: 'workshopCode', // value: 'workshopCode',
message: '请填写车间代码!', // message: '请填写车间代码!',
isMainValue: true // isMainValue: true
}], // }],
verificationParams: [{ // verificationParams: [{
key: 'code', // key: 'code',
action: '==', // action: '==',
value: '', // value: '',
isMainValue: false, // isMainValue: false,
isSearch: true, // isSearch: true,
isFormModel: true, // isFormModel: true,
}], // 失去焦点校验参数 // }], // 失去焦点校验参数
} // }
} // }
}, },
{ {
label: '供应商代码', label: '供应商代码',

Loading…
Cancel
Save