Browse Source

盘点计划

master_hella_20240701
yufei0306 5 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 <el-option
v-for="item in row.initOptions" v-for="item in currentList(row.initOptions)"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :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-select>
<el-input <el-input
v-model="row.value" v-model="row.value"
@ -162,6 +167,7 @@ const selectChange = (field, val) => {
} }
const tableFormChange = (field, val, row) => { const tableFormChange = (field, val, row) => {
pageCount.value = 1
emit('tableFormChange', field, val, row) emit('tableFormChange', field, val, row)
} }
// //
@ -172,6 +178,21 @@ const handleAddTable = () => {
const handleDeleteTable = (row, index) => { const handleDeleteTable = (row, index) => {
emit('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 // setup
defineExpose({ defineExpose({
TableBaseComponents_Ref, 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) formRef.value.open(type, row)
Promise.all([getOwnerAllList(), // Promise.all([getOwnerAllList(),
getSupplierAllList(), // getSupplierAllList(),
getCustomerAllList(), // getCustomerAllList(),
getItembasicAllList(), // getItembasicAllList(),
getWarehouseAllList(), // getWarehouseAllList(),
getAreaAllList(), // getAreaAllList(),
getLocationgroupAllList(), // getLocationgroupAllList(),
getLocationAllList()]) // getLocationAllList()])
} }
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
getOwnerAllList() // getOwnerAllList()
getSupplierAllList() // getSupplierAllList()
getCustomerAllList() // getCustomerAllList()
getItembasicAllList() // getItembasicAllList()
getWarehouseAllList() // getWarehouseAllList()
getAreaAllList() // getAreaAllList()
getLocationgroupAllList() // getLocationgroupAllList()
getLocationAllList() // getLocationAllList()
detailRef.value.openDetail(row, titleName, titleValue) detailRef.value.openDetail(row, titleName, titleValue)
} }
// //
@ -417,13 +417,13 @@ const detailOpenForm = (type, row) => {
formTypeDetail.value = 'Select' formTypeDetail.value = 'Select'
switch (row.type) { switch (row.type) {
case 'OWNER': case 'OWNER':
countPlanAllList.value = allList.value.ownerAllList getOwnerAllList(null,true)
break break
case 'SUPPLIER': case 'SUPPLIER':
countPlanAllList.value = allList.value.supplierAllList getSupplierAllList(null,true)
break break
case 'CUSTOMER': case 'CUSTOMER':
countPlanAllList.value = allList.value.customerAllList getCustomerAllList(null,true)
break break
case 'ABC': case 'ABC':
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ABC_CLASS) countPlanAllList.value = getStrDictOptions(DICT_TYPE.ABC_CLASS)
@ -435,19 +435,19 @@ const detailOpenForm = (type, row) => {
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ITEM_GROUP) countPlanAllList.value = getStrDictOptions(DICT_TYPE.ITEM_GROUP)
break break
case 'ITEMS_CODE': case 'ITEMS_CODE':
countPlanAllList.value = allList.value.itembasicAllList getItembasicAllList(null,true)
break break
case 'WAREHOUSE_CODE': case 'WAREHOUSE_CODE':
countPlanAllList.value = allList.value.warehouseAllList getWarehouseAllList(null,true)
break break
case 'AREABASIC_CODE': case 'AREABASIC_CODE':
countPlanAllList.value = allList.value.areaAllList getAreaAllList(null,true)
break break
case 'LOCATIONGROUP_CODE': case 'LOCATIONGROUP_CODE':
countPlanAllList.value = allList.value.locationgroupAllList getLocationgroupAllList(null,true)
break break
case 'LOCATION_CODE': case 'LOCATION_CODE':
countPlanAllList.value = allList.value.locationAllList getLocationAllList(null,true)
break break
} }
} else if (val == 'PROJECT') { } else if (val == 'PROJECT') {
@ -606,13 +606,13 @@ const selectChangeDetail = (field, val) => {
formTypeDetail.value = 'Select' formTypeDetail.value = 'Select'
switch (val) { switch (val) {
case 'OWNER': case 'OWNER':
countPlanAllList.value = allList.value.ownerAllList getOwnerAllList(null,true)
break break
case 'SUPPLIER': case 'SUPPLIER':
countPlanAllList.value = allList.value.supplierAllList getSupplierAllList(null,true)
break break
case 'CUSTOMER': case 'CUSTOMER':
countPlanAllList.value = allList.value.customerAllList getCustomerAllList(null,true)
break break
case 'ABC': case 'ABC':
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ABC_CLASS) countPlanAllList.value = getStrDictOptions(DICT_TYPE.ABC_CLASS)
@ -624,19 +624,19 @@ const selectChangeDetail = (field, val) => {
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ITEM_GROUP) countPlanAllList.value = getStrDictOptions(DICT_TYPE.ITEM_GROUP)
break break
case 'ITEMS_CODE': case 'ITEMS_CODE':
countPlanAllList.value = allList.value.itembasicAllList getItembasicAllList(null,true)
break break
case 'WAREHOUSE_CODE': case 'WAREHOUSE_CODE':
countPlanAllList.value = allList.value.warehouseAllList getWarehouseAllList(null,true)
break break
case 'AREABASIC_CODE': case 'AREABASIC_CODE':
countPlanAllList.value = allList.value.areaAllList getAreaAllList(null,true)
break break
case 'LOCATIONGROUP_CODE': case 'LOCATIONGROUP_CODE':
countPlanAllList.value = allList.value.locationgroupAllList getLocationgroupAllList(null,true)
break break
case 'LOCATION_CODE': case 'LOCATION_CODE':
countPlanAllList.value = allList.value.locationAllList getLocationAllList(null,true)
break break
} }
} else if (val == 'PROJECT') { } else if (val == 'PROJECT') {
@ -664,13 +664,13 @@ const tableFormChange = async (field, val, row) => {
row.formType = 'Select' row.formType = 'Select'
switch (row.type) { switch (row.type) {
case 'OWNER': case 'OWNER':
row.initOptions = allList.value.ownerAllList getOwnerAllList(row)
break break
case 'SUPPLIER': case 'SUPPLIER':
row.initOptions = allList.value.supplierAllList getSupplierAllList(row)
break break
case 'CUSTOMER': case 'CUSTOMER':
row.initOptions = allList.value.customerAllList getCustomerAllList(row)
break break
case 'ABC': case 'ABC':
row.initOptions = getStrDictOptions(DICT_TYPE.ABC_CLASS) row.initOptions = getStrDictOptions(DICT_TYPE.ABC_CLASS)
@ -682,19 +682,19 @@ const tableFormChange = async (field, val, row) => {
row.initOptions = getStrDictOptions(DICT_TYPE.ITEM_GROUP) row.initOptions = getStrDictOptions(DICT_TYPE.ITEM_GROUP)
break break
case 'ITEMS_CODE': case 'ITEMS_CODE':
row.initOptions = allList.value.itembasicAllList getItembasicAllList(row)
break break
case 'WAREHOUSE_CODE': case 'WAREHOUSE_CODE':
row.initOptions = allList.value.warehouseAllList getWarehouseAllList(row)
break break
case 'AREABASIC_CODE': case 'AREABASIC_CODE':
row.initOptions = allList.value.areaAllList getAreaAllList(row)
break break
case 'LOCATIONGROUP_CODE': case 'LOCATIONGROUP_CODE':
row.initOptions = allList.value.locationgroupAllList getLocationgroupAllList(row)
break break
case 'LOCATION_CODE': case 'LOCATION_CODE':
row.initOptions = allList.value.locationAllList getLocationAllList(row)
break break
} }
} else if (row.type == 'PROJECT') { } else if (row.type == 'PROJECT') {
@ -717,91 +717,254 @@ const allList = ref({
itemGroupList: getStrDictOptions(DICT_TYPE.ITEM_GROUP) itemGroupList: getStrDictOptions(DICT_TYPE.ITEM_GROUP)
}) })
// //
const getOwnerAllList = async () => { const getOwnerAllList = async (row,update_countPlanAllList=false) => {
OwnerApi.getOwnerList().then((res) => {
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) => { allList.value.ownerAllList = res.map((element) => {
return { return {
value: element.code, value: element.code,
label: element.name label: element.name
} }
}) })
}) }
if(row){
row.initOptions = allList.value.ownerAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.ownerAllList
}
} }
// //
const getSupplierAllList = async () => { const getSupplierAllList = async (row,update_countPlanAllList=false) => {
SupplierApi.getSupplierList().then((res) => { 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) => { allList.value.supplierAllList = res.map((element) => {
return { return {
value: element.code, value: element.code,
label: element.name label: element.name
} }
}) })
}) }
if(row){
row.initOptions = allList.value.supplierAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.supplierAllList
}
} }
// //
const getCustomerAllList = async () => { const getCustomerAllList = async (row,update_countPlanAllList=false) => {
CustomerApi.getCustomerList().then((res) => { 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) => { allList.value.customerAllList = res.map((element) => {
return { return {
value: element.code, value: element.code,
label: element.name label: element.name
} }
}) })
}) }
if(row){
row.initOptions = allList.value.customerAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.customerAllList
}
} }
// //
const getItembasicAllList = async () => { const getItembasicAllList = async (row,update_countPlanAllList=false) => {
ItembasicApi.getItembasicList().then((res) => { 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) => { allList.value.itembasicAllList = res.map((element) => {
return { return {
value: element.code, value: element.code,
label: element.name + '-'+ 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 () => { const getWarehouseAllList = async (row,update_countPlanAllList=false) => {
WarehouseApi.getWarehouseList({ available: 'TRUE' }).then((res) => { 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) => { allList.value.warehouseAllList = res.map((element) => {
return { return {
value: element.code, value: element.code,
label: element.name label: element.name
} }
}) })
}) }
if(row){
row.initOptions = allList.value.warehouseAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.warehouseAllList
}
} }
// //
const getAreaAllList = async () => { const getAreaAllList = async (row,update_countPlanAllList=false) => {
AreaApi.getAreaList({ available: 'TRUE' }).then((res) => { 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) => { allList.value.areaAllList = res.map((element) => {
return { return {
value: element.code, value: element.code,
label: element.name + '-'+ 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 () => { const getLocationgroupAllList = async (row,update_countPlanAllList=false) => {
LocationgroupApi.getLocationgroupList({ available: 'TRUE' }).then((res) => { 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) => { allList.value.locationgroupAllList = res.map((element) => {
return { return {
value: element.code, value: element.code,
label: element.name label: element.name
} }
}) })
}) }
if(row){
row.initOptions = allList.value.locationgroupAllList
}
if(update_countPlanAllList){
countPlanAllList.value = allList.value.locationgroupAllList
}
} }
// //
const getLocationAllList = async () => { const getLocationAllList = async (row,update_countPlanAllList=false) => {
LocationpApi.getLocationList({ available: 'TRUE' }).then((res) => { 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) => { allList.value.locationAllList = res.map((element) => {
return { return {
value: element.code, value: element.code,
label: element.name + '-'+ 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