出入库 编辑画面

出入库 编辑画面
pull/1/head
siontion 9 months ago
parent 29b674fb41
commit 0cd6621ada

@ -278,16 +278,19 @@
</el-card>
</el-form>
<div class="text-center hl-footer">
<el-button @click="() => router.back()" size="large"> </el-button>
<el-button @click="submitForm" type="success" :disabled="formLoading" size="large"> </el-button>
<el-button @click="submitForm" v-if="isShow" type="primary" :disabled="formLoading" size="large"> </el-button>
<el-button @click="submitForm" v-if="isShow" type="danger" :disabled="formLoading" size="large"> </el-button>
<el-button @click="() => router.go(-1)" size="large"> </el-button>
<el-button @click="submitForm" v-if="isShowBtnGroup" type="success" :disabled="formLoading" size="large">
</el-button>
<el-button @click="handleStatus(2)" v-if="isShowBtnGroup" type="primary" :disabled="formLoading" size="large">
</el-button>
<el-button @click="handleStatus(3)" v-if="isShowBtnCancel" type="danger" :disabled="formLoading" size="large">
</el-button>
</div>
</el-card>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { useRoute } from "vue-router"
import { dateFormatter, formatDate } from "@/utils/formatTime"
import type { UploadUserFile } from 'element-plus'
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
@ -308,7 +311,8 @@ const reload = inject('reload')
const { t } = useI18n() //
const message = useMessage() //
const router = useRoute();
const { query } = useRoute()
const router = useRouter();
const isShow = ref(false)
const dialogTitle = ref('') //
@ -350,7 +354,33 @@ const subFormRules = reactive({
rgId: [{ required: true, message: '库区不能为空', trigger: 'blur' }],
pnId: [{ required: true, message: '库位不能为空', trigger: 'blur' }],
})
const handleStatus = (async (num) => {
formData.value.status = num
const dataUpdate = formData.value as unknown as StorageApi.StorageVO
await StorageApi.updateStorage(dataUpdate)
message.success(t('common.updateSuccess'))
switch (num) {
case 1:
isShowBtnGroup.value = true;
isShowBtnCancel.value = false;
break
case 2:
isShowBtnGroup.value = false;
isShowBtnCancel.value = true;
break
case 3:
isShowBtnGroup.value = false;
isShowBtnCancel.value = false;
break;
default:
break
}
})
const userList = ref<UserApi.UserVO[]>([]) //
// ==================== =======================================
@ -417,7 +447,7 @@ const submitForm = async () => {
formLoading.value = true
try {
const data = formData.value as unknown as StorageApi.StorageVO
if (router.query.type === 'create') {
if (query.type === 'create') {
//
storageid.value = await StorageApi.createStorage(data)
@ -445,7 +475,6 @@ const submitForm = async () => {
//
reload();
//router.query.id = storageid.value.id;
} finally {
formLoading.value = false
}
@ -554,13 +583,13 @@ const handleRg = (async (scope) => {
const matList = ref<MaterialApi.MaterialVO[]>([]) //
const matSelectLoading = ref(false);
const remoteMatCodeSearch = async (query) => {
const remoteMatCodeSearch = async (code) => {
matSelectLoading.value = true
//
let matParams = {
pageNo: 1,
pageSize: 10,
code: query,
code: code,
status: "1"
}
const dataMat = await MaterialApi.getMaterialPage(matParams)
@ -589,8 +618,8 @@ const handleMatCode = async (scope, matid) => {
}
}
const isShowBtnStatus = false
const isShowBtnCancel = false
const isShowBtnGroup = ref(true)
const isShowBtnCancel = ref(false)
/** 初始化 **/
onMounted(async () => {
@ -605,17 +634,34 @@ onMounted(async () => {
matList.value = dataMat.list
dialogTitle.value = t('action.' + router.query.type)
dialogTitle.value = t('action.' + query.type)
isShow.value = router.query.type == "create" ? false : true
isShow.value = query.type == "create" ? false : true
//-------------------
const data = await WarehouseApi.getWarehouseSimpList()
warehouseList.value = data
//-------------------
if (router.query.id) {
if (query.id) {
//
formData.value = await StorageApi.getStorage(router.query.id)
formData.value = await StorageApi.getStorage(query.id)
switch (formData.value.status) {
case 1:
isShowBtnGroup.value = true;
isShowBtnCancel.value = false;
break
case 2:
isShowBtnGroup.value = false;
isShowBtnCancel.value = true;
break
case 3:
isShowBtnGroup.value = false;
isShowBtnCancel.value = false;
break;
default:
break
}
//
const queryParamsRg = reactive({
@ -642,7 +688,7 @@ onMounted(async () => {
const queryParamsMat = reactive({
pageNo: 1,
pageSize: 99,
stockId: router.query.id
stockId: query.id
})
const dataMats = await StorageMatApi.getStorageMatPage(queryParamsMat)
formData.value.matItemDOList = dataMats.list
@ -672,7 +718,7 @@ onMounted(async () => {
let attParams = {
pageNo: 1,
pageSize: 99,
businessId: router.query.id,
businessId: query.id,
businessType: 'STORAGE'
}
formData.value.attachments = (await getFilePage(attParams)).list;
@ -687,5 +733,4 @@ onMounted(async () => {
a {
color: #409eff;
text-decoration: none;
}
</style>
}</style>

Loading…
Cancel
Save