Browse Source

盘点

master
zhang_li 11 months ago
parent
commit
45a4d41f25
  1. 59
      src/components/BasicForm/src/BasicForm.vue
  2. 27
      src/components/Detail/src/Detail.vue
  3. 14
      src/components/DetailTable/src/DetailTable.vue
  4. 64
      src/views/wms/countManage/count/countPlanMain/index.vue

59
src/components/BasicForm/src/BasicForm.vue

@ -21,6 +21,7 @@
v-model="formSchema.type"
placeholder="选择盘点类型"
@change="selectChange('type', $event)"
v-if="!isDetail"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.COUNT_TYPE)"
@ -29,6 +30,34 @@
:value="dict.value"
/>
</el-select>
<el-select
v-model="formSchema.type"
placeholder="选择盘点范围类型"
@change="selectChangeDetail('type', $event,formSchema)"
v-if="isDetail"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.COUNT_SCOPE_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</template>
<template #value="formSchema" v-if="fromeWhere == 'countPlan'">
<el-select
v-model="formSchema.value"
placeholder="选择盘点范围值"
v-if="isDetail&& formTypeDetail =='Select'"
>
<el-option
v-for="dict in countPlanAllList"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<el-input v-model="formSchema.value" v-if="isDetail && formTypeDetail =='InputString'"/>
</template>
</Form>
<div class="table" v-if="isBusiness && formType == 'create' && fromeWhere != 'countPlan'">
@ -165,11 +194,30 @@ const props = defineProps({
required: false,
default: ''
},
//
countScopeType: {
type: Array,
required: false,
default: null
}
},
//
isDetail: {
type: Boolean,
required: false,
default: false
},
//
formTypeDetail: {
type: String,
required: false,
default: 'InputString'
},
//
countPlanAllList: {
type: Array,
required: false,
default: null
},
})
const { t } = useI18n() //
@ -184,7 +232,7 @@ const formRef = ref() // 表单 Ref
const formSchema = ref(props.formAllSchemas?.formSchema)
const tableAllSchemas = ref(props.tableAllSchemas)
const tableFormRules = ref(props.tableFormRules)
console.log('tableAllSchemas', tableAllSchemas.value)
console.log('fromeWhere', props.fromeWhere)
/** 弹层操作 */
// formField form
@ -377,6 +425,7 @@ const emit = defineEmits([
'opensearchTable',
'submitForm',
'selectChange',
'selectChangeDetail',
'tableFormChange'
])
//
@ -431,6 +480,12 @@ const inpuFocus = (headerItem, row, index) => {
const selectChange = (field, val) => {
emit('selectChange', field, val)
}
//
const selectChangeDetail = (field, val,formSchema) => {
formSchema.value = ''
emit('selectChangeDetail', field, val)
}
const tableFormChange = (field, val, row) => {
emit('tableFormChange', field, val, row)

27
src/components/Detail/src/Detail.vue

@ -104,9 +104,14 @@
:isBusiness="false"
:apiUpdate="apiUpdate"
:apiCreate="apiCreate"
:fromeWhere="fromeWhere"
:isDetail="true"
@searchTableSuccess="searchTableSuccess"
:detailData="detailData"
@submitForm="submitForm"
@selectChangeDetail="selectChangeDetail"
:formTypeDetail="formTypeDetail"
:countPlanAllList="countPlanAllList"
/>
</div>
</template>
@ -208,11 +213,24 @@ const props = defineProps({
required: true,
default: null
},
//
countScopeType: {
type: Array,
required: false,
default: null
}
},
//
formTypeDetail: {
type: String,
required: false,
default: 'InputString'
},
//
countPlanAllList: {
type: Array,
required: false,
default: null
},
})
const isShowDrawer = ref(false)
const detailLoading = ref(false)
@ -465,7 +483,7 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
emit('searchTableSuccessDetail', formField, searchField, val, formRef)
}
//
const emit = defineEmits(['searchTableSuccessDetail', 'changeTabs'])
const emit = defineEmits(['searchTableSuccessDetail', 'changeTabs','selectChangeDetail'])
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
@ -503,7 +521,10 @@ const searchFormClick = (searchData) => {
// }
// getList() //
}
//
const selectChangeDetail = (field, val) => {
emit('selectChangeDetail', field, val)
}
//
watch(
() =>props.apiPage,

14
src/components/DetailTable/src/DetailTable.vue

@ -13,6 +13,9 @@
<div v-else> {{ forrmatter1(scope.row) }}</div>
</template>
</el-table-column>
<el-table-column prop="" label="操作" align="center">
<slot name="action" v-if="columns[2].field == 'action'"></slot>
</el-table-column>
</el-table>
</div>
</template>
@ -80,9 +83,14 @@ const forrmatter1 = (item) => {
return ''
}
}
onMounted(async () => {
console.log('props.data',props.data)
})
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
</script>
<style lang="scss">
</style>

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

@ -83,7 +83,10 @@
:allList="allList"
:countScopeType="getStrDictOptions(DICT_TYPE.COUNT_SCOPE_TYPE)"
:Echo="Echo"
@selectChangeDetail="selectChangeDetail"
fromeWhere="countPlan"
:formTypeDetail="formTypeDetail"
:countPlanAllList="countPlanAllList"
/>
<!-- 导入 -->
@ -451,6 +454,67 @@ const selectChange = (field, val) => {
}
}
}
const formTypeDetail = ref('InputString')//
const countPlanAllList = ref([])//
//
const selectChangeDetail= (field, val) => {
console.log('888',CountPlanDetail.allSchemas.formSchema)
if (field == 'type') {
// CountPlanDetail.allSchemas.formSchema[1].value = ''
if (
val == 'OWNER' ||
val == 'SUPPLIER' ||
val == 'CUSTOMER' ||
val == 'ABC' ||
val == 'ITEMS_TYPE' ||
val == 'ITEMS_GROUP' ||
val == 'ITEMS_CODE' ||
val == 'WAREHOUSE_CODE' ||
val == 'AREABASIC_CODE' ||
val == 'LOCATIONGROUP_CODE' ||
val== 'LOCATION_CODE'
) {
formTypeDetail.value = 'Select'
switch (val) {
case 'OWNER':
countPlanAllList.value = allList.value.ownerAllList
break
case 'SUPPLIER':
countPlanAllList.value= allList.value.supplierAllList
break
case 'CUSTOMER':
countPlanAllList.value = allList.value.customerAllList
break
case 'ABC':
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ABC_CLASS)
break
case 'ITEMS_TYPE':
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ITEM_TYPE)
break
case 'ITEMS_GROUP':
countPlanAllList.value = getStrDictOptions(DICT_TYPE.ITEM_GROUP)
break
case 'ITEMS_CODE':
countPlanAllList.value = allList.value.itembasicAllList
break
case 'WAREHOUSE_CODE':
countPlanAllList.value = allList.value.warehouseAllList
break
case 'AREABASIC_CODE':
countPlanAllList.value = allList.value.areaAllList
break
case 'LOCATIONGROUP_CODE':
countPlanAllList.value = allList.value.locationgroupAllList
break
case 'LOCATION_CODE':
countPlanAllList.value= allList.value.locationAllList
break
}
} else if (val == 'PROJECT') {
formTypeDetail.value = 'InputString'
}
}
}
//
const tableFormChange = async (field, val, row) => {
if (field == 'type') {

Loading…
Cancel
Save