Browse Source

盘点计划

master_hella_20240701
yufei0306 4 months ago
parent
commit
91e0287e84
  1. 23
      src/components/TableFormCountPlan/src/TableFormCountPlan.vue
  2. 289
      src/views/wms/countManage/count/countPlanMain/index.vue

23
src/components/TableFormCountPlan/src/TableFormCountPlan.vue

@ -72,11 +72,16 @@
"
>
<el-option
v-for="item in row.initOptions"
v-for="item in currentList(row.initOptions)"
:key="item.value"
:label="item.label"
:value="item.value"
/>
<div style="display: flex;align-items: center">
<span style="padding: 10px;">{{ pageCount }} </span>
<el-button text bg size="small" :disabled="pageCount<=1" @click="prexPage">上一页</el-button>
<el-button text bg size="small" :disabled="row.initOptions&&pageCount*15>=row.initOptions.length" @click="nextPage">下一页</el-button>
</div>
</el-select>
<el-input
v-model="row.value"
@ -162,6 +167,7 @@ const selectChange = (field, val) => {
}
const tableFormChange = (field, val, row) => {
pageCount.value = 1
emit('tableFormChange', field, val, row)
}
//
@ -172,6 +178,21 @@ const handleAddTable = () => {
const handleDeleteTable = (row, index) => {
emit('handleDeleteTable', row, index)
}
const pageCount = ref(1)
const currentList = (options)=>{
if(options&&options.length>0){
return options.slice((pageCount.value-1)*15,pageCount.value*15)
}else{
return []
}
}
const nextPage = ()=>{
pageCount.value++
}
const prexPage = ()=>{
pageCount.value--
}
// setup
defineExpose({
TableBaseComponents_Ref,

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

@ -374,27 +374,27 @@ const openForm = async (type: string, row?: number) => {
] //
formRef.value.open(type, row)
Promise.all([getOwnerAllList(),
getSupplierAllList(),
getCustomerAllList(),
getItembasicAllList(),
getWarehouseAllList(),
getAreaAllList(),
getLocationgroupAllList(),
getLocationAllList()])
// Promise.all([getOwnerAllList(),
// getSupplierAllList(),
// getCustomerAllList(),
// getItembasicAllList(),
// getWarehouseAllList(),
// getAreaAllList(),
// getLocationgroupAllList(),
// getLocationAllList()])
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
getOwnerAllList()
getSupplierAllList()
getCustomerAllList()
getItembasicAllList()
getWarehouseAllList()
getAreaAllList()
getLocationgroupAllList()
getLocationAllList()
// getOwnerAllList()
// getSupplierAllList()
// getCustomerAllList()
// getItembasicAllList()
// getWarehouseAllList()
// getAreaAllList()
// getLocationgroupAllList()
// getLocationAllList()
detailRef.value.openDetail(row, titleName, titleValue)
}
//
@ -417,13 +417,13 @@ const detailOpenForm = (type, row) => {
formTypeDetail.value = 'Select'
switch (row.type) {
case 'OWNER':
countPlanAllList.value = allList.value.ownerAllList
getOwnerAllList(null,true)
break
case 'SUPPLIER':
countPlanAllList.value = allList.value.supplierAllList
getSupplierAllList(null,true)
break
case 'CUSTOMER':
countPlanAllList.value = allList.value.customerAllList
getCustomerAllList(null,true)
break
case 'ABC':
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ABC_CLASS)
@ -435,19 +435,19 @@ const detailOpenForm = (type, row) => {
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ITEM_GROUP)
break
case 'ITEMS_CODE':
countPlanAllList.value = allList.value.itembasicAllList
getItembasicAllList(null,true)
break
case 'WAREHOUSE_CODE':
countPlanAllList.value = allList.value.warehouseAllList
getWarehouseAllList(null,true)
break
case 'AREABASIC_CODE':
countPlanAllList.value = allList.value.areaAllList
getAreaAllList(null,true)
break
case 'LOCATIONGROUP_CODE':
countPlanAllList.value = allList.value.locationgroupAllList
getLocationgroupAllList(null,true)
break
case 'LOCATION_CODE':
countPlanAllList.value = allList.value.locationAllList
getLocationAllList(null,true)
break
}
} else if (val == 'PROJECT') {
@ -606,13 +606,13 @@ const selectChangeDetail = (field, val) => {
formTypeDetail.value = 'Select'
switch (val) {
case 'OWNER':
countPlanAllList.value = allList.value.ownerAllList
getOwnerAllList(null,true)
break
case 'SUPPLIER':
countPlanAllList.value = allList.value.supplierAllList
getSupplierAllList(null,true)
break
case 'CUSTOMER':
countPlanAllList.value = allList.value.customerAllList
getCustomerAllList(null,true)
break
case 'ABC':
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ABC_CLASS)
@ -624,19 +624,19 @@ const selectChangeDetail = (field, val) => {
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ITEM_GROUP)
break
case 'ITEMS_CODE':
countPlanAllList.value = allList.value.itembasicAllList
getItembasicAllList(null,true)
break
case 'WAREHOUSE_CODE':
countPlanAllList.value = allList.value.warehouseAllList
getWarehouseAllList(null,true)
break
case 'AREABASIC_CODE':
countPlanAllList.value = allList.value.areaAllList
getAreaAllList(null,true)
break
case 'LOCATIONGROUP_CODE':
countPlanAllList.value = allList.value.locationgroupAllList
getLocationgroupAllList(null,true)
break
case 'LOCATION_CODE':
countPlanAllList.value = allList.value.locationAllList
getLocationAllList(null,true)
break
}
} else if (val == 'PROJECT') {
@ -664,13 +664,13 @@ const tableFormChange = async (field, val, row) => {
row.formType = 'Select'
switch (row.type) {
case 'OWNER':
row.initOptions = allList.value.ownerAllList
getOwnerAllList(row)
break
case 'SUPPLIER':
row.initOptions = allList.value.supplierAllList
getSupplierAllList(row)
break
case 'CUSTOMER':
row.initOptions = allList.value.customerAllList
getCustomerAllList(row)
break
case 'ABC':
row.initOptions = getStrDictOptions(DICT_TYPE.ABC_CLASS)
@ -682,19 +682,19 @@ const tableFormChange = async (field, val, row) => {
row.initOptions = getStrDictOptions(DICT_TYPE.ITEM_GROUP)
break
case 'ITEMS_CODE':
row.initOptions = allList.value.itembasicAllList
getItembasicAllList(row)
break
case 'WAREHOUSE_CODE':
row.initOptions = allList.value.warehouseAllList
getWarehouseAllList(row)
break
case 'AREABASIC_CODE':
row.initOptions = allList.value.areaAllList
getAreaAllList(row)
break
case 'LOCATIONGROUP_CODE':
row.initOptions = allList.value.locationgroupAllList
getLocationgroupAllList(row)
break
case 'LOCATION_CODE':
row.initOptions = allList.value.locationAllList
getLocationAllList(row)
break
}
} else if (row.type == 'PROJECT') {
@ -717,91 +717,254 @@ const allList = ref({
itemGroupList: getStrDictOptions(DICT_TYPE.ITEM_GROUP)
})
//
const getOwnerAllList = async () => {
OwnerApi.getOwnerList().then((res) => {
const getOwnerAllList = async (row,update_countPlanAllList=false) => {
let getLoading = null
let res = null
if(!allList.value.ownerAllList||allList.value.ownerAllList.length==0){
try {
getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
res = await OwnerApi.getOwnerList()
} finally {
getLoading?.close()
}
}
if(res){
allList.value.ownerAllList = res.map((element) => {
return {
value: element.code,
label: element.name
}
})
})
}
if(row){
row.initOptions = allList.value.ownerAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.ownerAllList
}
}
//
const getSupplierAllList = async () => {
SupplierApi.getSupplierList().then((res) => {
const getSupplierAllList = async (row,update_countPlanAllList=false) => {
let getLoading = null
let res = null
if(!allList.value.supplierAllList||allList.value.supplierAllList.length==0){
try {
getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
res = await SupplierApi.getSupplierList()
} finally {
getLoading?.close()
}
}
if(res){
allList.value.supplierAllList = res.map((element) => {
return {
value: element.code,
label: element.name
}
})
})
}
if(row){
row.initOptions = allList.value.supplierAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.supplierAllList
}
}
//
const getCustomerAllList = async () => {
CustomerApi.getCustomerList().then((res) => {
const getCustomerAllList = async (row,update_countPlanAllList=false) => {
let getLoading = null
let res = null
if(!allList.value.customerAllList||allList.value.customerAllList.length==0){
try {
getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
res = await CustomerApi.getCustomerList()
} finally {
getLoading?.close()
}
}
if(res){
allList.value.customerAllList = res.map((element) => {
return {
value: element.code,
label: element.name
}
})
})
}
if(row){
row.initOptions = allList.value.customerAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.customerAllList
}
}
//
const getItembasicAllList = async () => {
ItembasicApi.getItembasicList().then((res) => {
const getItembasicAllList = async (row,update_countPlanAllList=false) => {
let getLoading = null
let res = null
if(!allList.value.itembasicAllList||allList.value.itembasicAllList.length==0){
try {
getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
res = await ItembasicApi.getItembasicList()
} finally {
getLoading?.close()
}
}
if(res){
allList.value.itembasicAllList = res.map((element) => {
return {
value: element.code,
label: element.name + '-'+ element.code
}
})
})
}
if(row){
row.initOptions = allList.value.itembasicAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.itembasicAllList
}
}
//
const getWarehouseAllList = async () => {
WarehouseApi.getWarehouseList({ available: 'TRUE' }).then((res) => {
const getWarehouseAllList = async (row,update_countPlanAllList=false) => {
let getLoading = null
let res = null
if(!allList.value.warehouseAllList||allList.value.warehouseAllList.length==0){
try {
getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
res = await WarehouseApi.getWarehouseList({ available: 'TRUE' })
} finally {
getLoading?.close()
}
}
if(res){
allList.value.warehouseAllList = res.map((element) => {
return {
value: element.code,
label: element.name
}
})
})
}
if(row){
row.initOptions = allList.value.warehouseAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.warehouseAllList
}
}
//
const getAreaAllList = async () => {
AreaApi.getAreaList({ available: 'TRUE' }).then((res) => {
const getAreaAllList = async (row,update_countPlanAllList=false) => {
let getLoading = null
let res = null
if(!allList.value.areaAllList||allList.value.areaAllList.length==0){
try {
getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
res = await AreaApi.getAreaList({ available: 'TRUE' })
} finally {
getLoading?.close()
}
}
if(res){
allList.value.areaAllList = res.map((element) => {
return {
value: element.code,
label: element.name + '-'+ element.code
}
})
})
}
if(row){
row.initOptions = allList.value.areaAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.areaAllList
}
}
//
const getLocationgroupAllList = async () => {
LocationgroupApi.getLocationgroupList({ available: 'TRUE' }).then((res) => {
const getLocationgroupAllList = async (row,update_countPlanAllList=false) => {
let getLoading = null
let res = null
if(!allList.value.locationgroupAllList||allList.value.locationgroupAllList.length==0){
try {
getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
res = await LocationgroupApi.getLocationgroupList({ available: 'TRUE' })
} finally {
getLoading?.close()
}
}
if(res){
allList.value.locationgroupAllList = res.map((element) => {
return {
value: element.code,
label: element.name
}
})
})
}
if(row){
row.initOptions = allList.value.locationgroupAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.locationgroupAllList
}
}
//
const getLocationAllList = async () => {
LocationpApi.getLocationList({ available: 'TRUE' }).then((res) => {
const getLocationAllList = async (row,update_countPlanAllList=false) => {
let getLoading = null
let res = null
if(!allList.value.locationAllList||allList.value.locationAllList.length==0){
getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
res = await LocationpApi.getLocationList({ available: 'TRUE' })
console.log('res',res)
}
if(res){
allList.value.locationAllList = res.map((element) => {
return {
value: element.code,
label: element.name + '-'+ element.code
}
})
}
if(row){
row.initOptions = allList.value.locationAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.locationAllList
}
nextTick(()=>{
getLoading?.close()
})
}
/** 初始化 **/

Loading…
Cancel
Save