Browse Source

盘点计划子表

master
zhang_li 11 months ago
parent
commit
4823f9731d
  1. 5
      src/api/wms/itembasic/index.ts
  2. 5
      src/api/wms/owner/index.ts
  3. 9
      src/components/BasicForm/src/BasicForm.vue
  4. 38
      src/components/TableForm/src/TableForm.vue
  5. 351
      src/views/wms/countManage/count/countPlanMain/countPlanMain.data.ts
  6. 370
      src/views/wms/countManage/count/countPlanMain/index.vue

5
src/api/wms/itembasic/index.ts

@ -38,7 +38,10 @@ export const getItembasicPage = async (params) => {
return await request.get({ url: `/wms/itembasic/page`, params })
}
}
// 查询物品基本信息列表
export const getItembasicList = async (params) => {
return await request.get({ url: `/wms/itembasic/list`, params })
}
// 查询物品基本信息详情
export const getItembasic = async (id: number) => {
return await request.get({ url: `/wms/itembasic/get?id=` + id })

5
src/api/wms/owner/index.ts

@ -31,7 +31,10 @@ export const getOwnerPage = async (params) => {
return await request.get({ url: `/wms/owner/page`, params })
}
}
// 查询所有货主列表
export const getOwnerList = async (params) => {
return await request.get({ url: `/wms/owner/list`, params })
}
// 查询货主详情
export const getOwner = async (id: number) => {
return await request.get({ url: `/wms/owner/get?id=` + id })

9
src/components/BasicForm/src/BasicForm.vue

@ -35,6 +35,7 @@
@tableSelectionChange="tableSelectionChange"
@extendedButtonsClick="extendedButtonsClick"
@formSelectChange="formSelectChange"
@formSelectvVisibleChange = 'formSelectvVisibleChange'
@tableSortChange="tableSortChange"
@selectCallback="selectCallback"
@handleTableSelect="handleTableSelect"
@ -337,6 +338,7 @@ const emit = defineEmits([
'tableSelectionChange',
'extendedButtonsClick',
'formSelectChange',
'formSelectvVisibleChange',
'tableSortChange',
'selectCallback',
'handleTableSelect',
@ -349,8 +351,11 @@ const emit = defineEmits([
'selectChange'
])
//
const formSelectChange = (field, val) => {
emit('formSelectChange', field, val)
const formSelectChange = (field, val,row) => {
emit('formSelectChange', field, val,row)
}
const formSelectvVisibleChange = (field, val,row) => {
emit('formSelectvVisibleChange', field, val,row)
}
// selection
const tableSelectionChange = (val) => {

38
src/components/TableForm/src/TableForm.vue

@ -97,7 +97,7 @@
</el-form-item>
<!-- 下拉框 -->
<el-form-item
v-if="headerItem?.tableForm?.type == 'Select'"
v-if="row.formType == 'Select'"
:prop="headerItem.field">
<el-select
v-model="row[headerItem.field]"
@ -112,7 +112,8 @@
:allow-create="headerItem?.tableForm.allowCreate"
style="width: 100%"
:placeholder="headerItem?.tableForm?.placeholder || '请选择' + headerItem.label"
@change="formSelectChange(headerItem.field, $event)">
@change="formSelectChange(headerItem.field, $event,row)"
@visible-change="formSelectvVisibleChange(headerItem.field, $event,row)">
<el-option
v-for="op in initSelectOptions(headerItem)"
:label="op.label"
@ -120,6 +121,31 @@
:key="op.value" />
</el-select>
</el-form-item>
<!-- <el-form-item
v-if="headerItem?.tableForm?.type == 'Select'"
:prop="headerItem.field">
<el-select
v-model="row[headerItem.field]"
:clearable="headerItem?.tableForm.clearable || true"
:multiple="headerItem?.tableForm.multiple"
:size="headerItem?.tableForm.size"
:collapse-tags ="headerItem?.tableForm.collapseTags"
:collapse-tags-tooltip ="headerItem?.tableForm.collapseTagsTooltip"
:multiple-limit ="headerItem?.tableForm.multipleLimit"
:disabled="itemIsDisabled(headerItem, row)"
:filterable="headerItem?.tableForm.filterable"
:allow-create="headerItem?.tableForm.allowCreate"
style="width: 100%"
:placeholder="headerItem?.tableForm?.placeholder || '请选择' + headerItem.label"
@change="formSelectChange(headerItem.field, $event,row)"
@visible-change="formSelectvVisibleChange(headerItem.field, $event,row)">
<el-option
v-for="op in initSelectOptions(headerItem)"
:label="op.label"
:value="op.value"
:key="op.value" />
</el-select>
</el-form-item> -->
<!-- 时间选择器 -->
<el-form-item
v-if="headerItem?.tableForm?.type == 'FormTime'"
@ -325,6 +351,7 @@ const emit = defineEmits([
'tableSelectionChange',
'extendedButtonsClick',
'formSelectChange',
'formSelectvVisibleChange',
'tableSortChange',
'selectCallback',
'handleTableSelect',
@ -337,8 +364,11 @@ const initSelectOptions = (item) => {
return item.dictType ? getStrDictOptions(item.dictType) : item.tableForm.initOptions
}
//
const formSelectChange = (field, val) => {
emit('formSelectChange', field, val)
const formSelectChange = (field, val,row) => {
emit('formSelectChange', field, val,row)
}
const formSelectvVisibleChange = (field, val,row) => {
emit('formSelectvVisibleChange', field, val,row)
}
// selection
const tableSelectionChange = (val) => {

351
src/views/wms/countManage/count/countPlanMain/countPlanMain.data.ts

@ -434,179 +434,222 @@ export const CountPlanMainRules = reactive({
/**
* @returns {Array}
*/
// export const CountPlanDetail = useCrudSchemas(<CrudSchema[]>([
// {
// label: '盘点范围类型',
// field: 'type',
// dictType: DICT_TYPE.COUNT_TYPE,
// dictClass: 'string',
// isTable: true,
// sort: 'custom',
// table: {
// width: 150
// },
// tableForm: {
// type: 'Select'
// }
// },
// {
// label: '盘点范围值',
// field: 'value',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '单据号',
// field: 'number',
// sort: 'custom',
// table: {
// width: 150,
// },
// isTableForm: false,
// form: {
// componentProps: {
// disabled: true
// }
// }
// },
// {
// label: '物品代码',
// field: 'itemCode',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '备注',
// field: 'remark',
// sort: 'custom',
// table: {
// width: 150
// },
// },
// {
// label: '创建者',
// field: 'creator',
// sort: 'custom',
// table: {
// width: 150
// },
// isTableForm: false,
// isForm: false,
// },
// {
// label: '创建时间',
// field: 'createTime',
// formatter: dateFormatter,
// detail: {
// dateFormat: 'YYYY-MM-DD HH:mm:ss'
// },
// sort: 'custom',
// table: {
// width: 180
// },
// form: {
// component: 'DatePicker',
// componentProps: {
// style: {width:'100%'},
// type: 'datetime',
// dateFormat: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'x',
// }
// },
// isTableForm: false,
// isForm: false,
// },
// {
// label: '最后更新时间',
// field: 'updateTime',
// formatter: dateFormatter,
// detail: {
// dateFormat: 'YYYY-MM-DD HH:mm:ss'
// },
// sort: 'custom',
// table: {
// width: 180
// },
// form: {
// component: 'DatePicker',
// componentProps: {
// style: {width:'100%'},
// type: 'datetime',
// dateFormat: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'x',
// }
// },
// isTableForm: false,
// isForm: false,
// },
// {
// label: '最后更新者',
// field: 'updater',
// sort: 'custom',
// table: {
// width: 150
// },
// isTableForm: false,
// isForm: false,
// },
// {
// label: '计划数量',
// field: 'planQty',
// sort: 'custom',
// table: {
// width: 150
// },
// form: {
// component: 'InputNumber',
// componentProps: {
// min: 1,
// precision: 6
// }
// },
// tableForm: {
// 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'
// }
// },
// {
// label: '是否可用',
// field: 'available',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string',
// isTable: true,
// form: {
// component: 'Switch',
// value: 'TRUE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE'
// }
// },
// sort: 'custom',
// table: {
// width: 150
// },
// tableForm: {
// type: 'Select'
// }
// },
// {
// label: '操作',
// field: 'action',
// isDetail: false,
// isForm: false ,
// table: {
// width: 150,
// fixed: 'right'
// },
// isTableForm:false,
// }
// ]))
//表单校验
export const CountPlanDetail = useCrudSchemas(<CrudSchema[]>([
{
label: '盘点范围类型',
field: 'type',
dictType: DICT_TYPE.COUNT_TYPE,
dictType: DICT_TYPE.COUNT_SCOPE_TYPE,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150
width: 300
},
tableForm: {
type: 'Select'
type: 'Select',
width: '300'
}
},
{
label: '盘点范围值',
field: 'value',
sort: 'custom',
table: {
width: 150
},
},
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 150,
},
isTableForm: false,
form: {
componentProps: {
disabled: true
}
}
},
{
label: '物品代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isTableForm: false,
isForm: false,
},
{
label: '最后更新时间',
field: 'updateTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isTableForm: false,
isForm: false,
},
{
label: '最后更新者',
field: 'updater',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false,
},
{
label: '计划数量',
field: 'planQty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 1,
precision: 6
}
},
tableForm: {
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'
}
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
sort: 'custom',
table: {
width: 150
width: 300
},
tableForm: {
type: 'Select'
type: 'InputString',
width: '300',
}
},
{
@ -621,8 +664,6 @@ export const CountPlanDetail = useCrudSchemas(<CrudSchema[]>([
isTableForm:false,
}
]))
//表单校验
export const CountPlanDetailRules = reactive({
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }

370
src/views/wms/countManage/count/countPlanMain/index.vue

@ -37,7 +37,10 @@
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event, row)" />
<ButtonBase
:Butttondata="butttondata(row)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
@ -53,13 +56,13 @@
:tableData="tableData"
:apiUpdate="CountPlanMainApi.updateCountPlanMain"
:apiCreate="CountPlanMainApi.createCountPlanMain"
:isBusiness="false"
fromeWhere="countPlan"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
@formSelectChange="formSelectChange"
@formSelectvVisibleChange="formSelectvVisibleChange"
@selectChange="selectChange"
/>
@ -89,12 +92,26 @@
<script setup lang="ts">
import download from '@/utils/download'
import { CountPlanMain,CountPlanMainRules,CountPlanDetail,CountPlanDetailRules } from './countPlanMain.data'
import {
CountPlanMain,
CountPlanMainRules,
CountPlanDetail,
CountPlanDetailRules
} from './countPlanMain.data'
import * as CountPlanMainApi from '@/api/wms/countPlanMain'
import * as CountPlanDetailApi from '@/api/wms/countPlanDetail'
import * as OwnerApi from '@/api/wms/owner'
import * as SupplierApi from '@/api/wms/supplier'
import * as CustomerApi from '@/api/wms/customer'
import * as WarehouseApi from '@/api/wms/warehouse'
import * as AreaApi from '@/api/wms/areabasic'
import * as LocationgroupApi from '@/api/wms/locationgroup'
import * as LocationpApi from '@/api/wms/location'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
//
defineOptions({ name: 'CountPlanMain' })
@ -114,18 +131,17 @@ const updataTableColumns = (val) => {
//
const searchTableParams = ref([
{
formField: 'productItemCode',
searchTableTitle: '物料信息',
searchTableAllSchemas: Itembasic.allSchemas,
searchTablePage: ItembasicApi.getItembasicPage
}
{
formField: 'productItemCode',
searchTableTitle: '物料信息',
searchTableAllSchemas: Itembasic.allSchemas,
searchTablePage: ItembasicApi.getItembasicPage
}
])
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(() => {
if (type == 'tableForm') {
//
//row[formField] = val[0][searchField]
@ -142,14 +158,14 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
} else {
const setV = {}
// setV[formField] = val[0][searchField]
setV[formField] = val.map(item=>item.code).join(',')
setV[formField] = val.map((item) => item.code).join(',')
formRef.setValues(setV)
}
})
}
//
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = []
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: CountPlanMainApi.getCountPlanMainPage //
@ -160,12 +176,12 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:count-plan-main:create'}), //
defaultButtons.defaultAddBtn({ hasPermi: 'wms:count-plan-main:create' }), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:count-plan-main:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:count-plan-main:export'}), //
defaultButtons.defaultExportBtn({ hasPermi: 'wms:count-plan-main:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -178,22 +194,28 @@ const HeadButttondata = [
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
if (val == 'add') {
//
openForm('create')
} else if (val == 'import') { //
} else if (val == 'import') {
//
handleImport()
} else if (val == 'export') { //
} else if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') { //
} else if (val == 'refresh') {
//
getList()
} else if (val == 'filtrate') { //
} else { //
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
//
const isShowMainButton = (row,val) => {
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
@ -203,89 +225,82 @@ const isShowMainButton = (row,val) => {
// -
const butttondata = (row) => {
return [
defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:count-plan-main:open'}), //
defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4']),hasPermi:'wms:count-plan-main:close'}), //
defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:count-plan-main:submit'}), //
defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:count-plan-main:reject'}), //
defaultButtons.mainListPlanAppBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:count-plan-main:agree'}), //
defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:count-plan-main:publish'}), //
defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4']),hasPermi:'wms:count-plan-main:resetting'}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:count-plan-main:update'}), //
]
return [
defaultButtons.mainListPlanOpeBtn({
hide: isShowMainButton(row, ['5']),
hasPermi: 'wms:count-plan-main:open'
}), //
defaultButtons.mainListPlanCloBtn({
hide: isShowMainButton(row, ['1', '2', '3', '4']),
hasPermi: 'wms:count-plan-main:close'
}), //
defaultButtons.mainListPlanSubBtn({
hide: isShowMainButton(row, ['1']),
hasPermi: 'wms:count-plan-main:submit'
}), //
defaultButtons.mainListPlanTurBtn({
hide: isShowMainButton(row, ['2']),
hasPermi: 'wms:count-plan-main:reject'
}), //
defaultButtons.mainListPlanAppBtn({
hide: isShowMainButton(row, ['2']),
hasPermi: 'wms:count-plan-main:agree'
}), //
defaultButtons.mainListPlanPubBtn({
hide: isShowMainButton(row, ['3']),
hasPermi: 'wms:count-plan-main:publish'
}), //
defaultButtons.mainListPlanResBtn({
hide: isShowMainButton(row, ['4']),
hasPermi: 'wms:count-plan-main:resetting'
}), //
defaultButtons.mainListEditBtn({
hide: isShowMainButton(row, ['1']),
hasPermi: 'wms:count-plan-main:update'
}) //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'mainPlanOpe') { //
CountPlanMainApi.open(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainPlanClo') { //
await message.confirm('确认要关闭吗?')
CountPlanMainApi.close(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainPlanSub') { //
await message.confirm('确认要提交审批吗?')
CountPlanMainApi.submit(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainPlanTur') { //
await message.confirm('确认要驳回吗?')
CountPlanMainApi.reject(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainPlanApp') { //
await message.confirm('确认要审批通过吗?')
CountPlanMainApi.agree(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainPlanPub') { //
await message.confirm('确认要发布吗?')
CountPlanMainApi.publish(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'mainPlanRes') { //
await message.confirm('确认要重置吗?')
CountPlanMainApi.resetting(row.id).then(() => {
message.success(t('common.updateSuccess'))
getList()
}).catch(err => {
console.log(err)
})
} else if (val == 'edit') { //
if (val == 'mainClose') {
//
console.log('列表-操作按钮事件-关闭')
} else if (val == 'mainReAdd') {
//
console.log('列表-操作按钮事件-重新添加')
} else if (val == 'mainSubmit') {
//
console.log('列表-操作按钮事件-提交审批')
} else if (val == 'mainTurnDown') {
//
console.log('列表-操作按钮事件-驳回')
} else if (val == 'mainApprove') {
//
console.log('列表-操作按钮事件-审批通过')
} else if (val == 'edit') {
//
openForm('update', row)
} else if (val == 'delete') { //
} else if (val == 'delete') {
//
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const formRef = ref()
const openForm =async (type: string, row?: number) => {
const openForm = async (type: string, row?: number) => {
tableData.value = [] //
formRef.value.open(type, row)
getOwnerAllList()
getSupplierAllList()
getCustomerAllList()
getItembasicAllList()
getWarehouseAllList()
getAreaAllList()
getLocationgroupAllList()
getLocationAllList()
}
/** 详情操作 */
@ -324,16 +339,18 @@ const handleExport = async () => {
}
/**
* tableForm方法
*/
* tableForm方法
*/
const tableFormKeys = {}
CountPlanDetail.allSchemas.tableFormColumns.forEach(item => {
CountPlanDetail.allSchemas.tableFormColumns.forEach((item) => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
const tableData = ref([])
//
const handleAddTable = () => {
console.log(tableFormKeys)
tableFormKeys.formType = 'Select'
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
@ -386,25 +403,176 @@ const searchFormClick = (searchData) => {
getList() //
}
//
const selectChange = (field,val)=>{
const selectChange = (field, val) => {
console.log(val)
if(field == 'type'){
if(val =='DYNAMIC'){
if (field == 'type') {
if (val == 'DYNAMIC') {
CountPlanMain.allSchemas.formSchema[3].label = '限值(%)'
CountPlanMain.allSchemas.formSchema[3].componentProps.min = 0
CountPlanMain.allSchemas.formSchema[3].componentProps.max = 100
CountPlanMain.allSchemas.formSchema[3].componentProps.disabled = false
}else if(val =='LOW' || val =='RANDOM'){
} else if (val == 'LOW' || val == 'RANDOM') {
CountPlanMain.allSchemas.formSchema[3].label = '限值'
CountPlanMain.allSchemas.formSchema[3].componentProps.min = 0
CountPlanMain.allSchemas.formSchema[3].componentProps.max = Infinity
CountPlanMain.allSchemas.formSchema[3].componentProps.disabled = false
}else{
} else {
CountPlanMain.allSchemas.formSchema[3].componentProps.disabled = true
}
}
}
let valueList = []
//
const formSelectChange = async (field, val, row) => {
console.log(row[field])
console.log(field)
console.log(val)
if (field == 'type') {
row.value = ''
if (row.type == 'OWNER' || row.type == 'SUPPLIER'|| row.type == 'CUSTOMER'|| row.type == 'ABC'|| row.type == 'ITEMS_TYPE'|| row.type == 'ITEMS_GROUP'||row.type == 'ITEMS_CODE'||row.type == 'WAREHOUSE_CODE'||row.type == 'AREABASIC_CODE'||row.type == 'LOCATIONGROUP_CODE'||row.type == 'LOCATION_CODE') {
row.formType = 'InputString'
// row.initOptions = valueList
}else if(row.type == 'PROJECT'){
// row = {
// type: 'InputString',
// width: '300',
// initOptions: valueList
// }
}
}
}
const formSelectvVisibleChange = async (field, val, row) => {
console.log(getStrDictOptions(DICT_TYPE.ABC_CLASS))
switch (row.type) {
case 'OWNER':
valueList = ownerAllList.value
break;
case 'SUPPLIER':
valueList = supplierAllList.value
break;
case 'CUSTOMER':
valueList = customerAllList.value
break;
case 'ABC':
valueList = getStrDictOptions(DICT_TYPE.ABC_CLASS)
break;
case 'ITEMS_TYPE':
valueList = getStrDictOptions(DICT_TYPE.ITEM_TYPE)
break;
case 'ITEMS_GROUP':
valueList = getStrDictOptions(DICT_TYPE.ITEM_GROUP)
break;
case 'ITEMS_CODE':
valueList = itembasicAllList.value
break;
case 'WAREHOUSE_CODE':
valueList = warehouseAllList.value
break
case 'AREABASIC_CODE':
valueList = areaAllList.value
break
case 'LOCATIONGROUP_CODE':
valueList = locationgroupAllList.value
break
case 'LOCATION_CODE':
valueList = locationAllList.value
break
}
CountPlanDetail.allSchemas.tableFormColumns[1].tableForm = {
type: 'Select',
width: '300',
initOptions: valueList
}
}
const ownerAllList = ref()
const supplierAllList = ref()
const customerAllList = ref()
const itembasicAllList = ref()
const warehouseAllList = ref()
const areaAllList = ref()
const locationgroupAllList = ref()
const locationAllList = ref()
//
const getOwnerAllList = async () => {
await OwnerApi.getOwnerList().then((res) => {
res.forEach((element) => {
element.value = element.code
element.label = element.name
})
ownerAllList.value = res
})
}
//
const getSupplierAllList = async () => {
await SupplierApi.getSupplierList().then((res) => {
res.forEach((element) => {
element.value = element.code
element.label = element.name
})
supplierAllList.value = res
})
}
//
const getCustomerAllList = async () => {
await CustomerApi.getCustomerList().then((res) => {
res.forEach((element) => {
element.value = element.code
element.label = element.name
})
customerAllList.value = res
})
}
//
const getItembasicAllList = async () => {
await ItembasicApi.getItembasicList().then((res) => {
res.forEach((element) => {
element.value = element.code
element.label = element.name
})
itembasicAllList.value = res
})
}
//
const getWarehouseAllList = async () => {
await WarehouseApi.getWarehouseList({available:'TRUE'}).then((res) => {
res.forEach((element) => {
element.value = element.code
element.label = element.name
})
warehouseAllList.value = res
})
}
//
const getAreaAllList = async () => {
await AreaApi.getAreaList({available:'TRUE'}).then((res) => {
res.forEach((element) => {
element.value = element.code
element.label = element.name
})
areaAllList.value = res
})
}
//
const getLocationgroupAllList = async () => {
await LocationgroupApi.getLocationgroupList({available:'TRUE'}).then((res) => {
res.forEach((element) => {
element.value = element.code
element.label = element.name
})
locationgroupAllList.value = res
})
}
//
const getLocationAllList = async () => {
await LocationpApi.getLocationList({available:'TRUE'}).then((res) => {
res.forEach((element) => {
element.value = element.code
element.label = element.name
})
locationAllList.value = res
})
}
/** 初始化 **/
onMounted(async () => {
getList()

Loading…
Cancel
Save