|
|
|
@ -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>
|
|
|
|
|