fix:工单修改

This commit is contained in:
17630416519 2025-09-16 13:08:29 +08:00
parent 6ca3f7092c
commit 0ee4408b55
2 changed files with 52 additions and 7 deletions

View File

@ -39,6 +39,7 @@
"highlight.js": "^11.5.1",
"js-cookie": "3.0.1",
"jsencrypt": "3.2.1",
"lodash": "^4.17.21",
"md-editor-v3": "^1.11.11",
"nprogress": "0.2.0",
"pinia": "^2.1.6",

View File

@ -36,7 +36,7 @@
<!-- 导入对话框 -->
<el-dialog :title="upload.title" v-model="upload.open" width="400px" append-to-body draggable
:close-on-click-modal="false">
:close-on-click-modal="false"> <span v-if="show">数据正在导入中请稍等</span>
<el-upload name="file" ref="uploadRef" :limit="1" accept=".xlsx,.xls" :headers="upload.headers"
:action="`${upload.url}?updateSupport=${upload.updateSupport}$uploadType=${upload.uploadType}`"
:disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess"
@ -51,6 +51,7 @@
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline"
@click="importTemplate">下载模板</el-link>
</div>
</template>
</el-upload>
<template #footer>
@ -267,12 +268,12 @@
<!-- 实际装配数更新弹窗 -->
<el-dialog v-model="dialogVisibleActualAssembly" :close-on-click-modal="false" title="您确定要装配数更新吗?" draggable
width="500" :before-close="handleClose">
<el-form label-width="100px">
</el-form>
<div v-if="actualAssembly">{{ actualAssemblyNum }}</div>
<template #footer>
<el-button text @click="dialogVisibleActualAssembly = false">{{ $t('btn.cancel') }}</el-button>
<el-button type="primary" @click="handleSubmitActualAssembly">确定</el-button>
<el-button type="primary" @click="confirmSubmitActualAssembly">确定</el-button>
</template>
</el-dialog>
<!-- 计划异常检测弹窗 -->
@ -465,6 +466,7 @@ import {
import { getOneDict } from '@/utils/dict.js'
import { downFile } from '@/utils/request.js'
import dayjs from 'dayjs';
import _ from "lodash"
// Edit
import { Edit } from '@element-plus/icons-vue';
import { getCurrentInstance, ref, reactive, toRefs, watch } from 'vue';
@ -473,6 +475,8 @@ import { ElMessage } from 'element-plus'
const { proxy } = getCurrentInstance()
const ids = ref([])
const loading = ref(false)
const actualAssembly = ref(false)
const actualAssemblyNum = ref('正在更新装配数……')
const showSearch = ref(true)
const queryParams = reactive({
pageNum: 1,
@ -482,6 +486,7 @@ const queryParams = reactive({
sort: 'sort',
sortType: 'asc'
})
const show = ref(false)
const handleOpen = ref(false)
const dialogTitle = ref('')
const selectAllId = ref([])
@ -498,7 +503,40 @@ const year = ref(new Date().getFullYear().toString());
const week = ref(getCurrentWeek().toString());
const partnumber = ref('')
const debouncedSubmitActualAssembly = _.debounce(function () {
actualAssembly.value = true
let data = {
year: year.value,
week: week.value,
}
Getupdateactualassemblyprogress(data).then(res => {
if (res.data == 0) {
ElMessage.warning('没有需要更新的数据')
actualAssembly.value = false
queryWeeklyProductionScheduleData()
dialogVisibleActualAssembly.value = false;
return
}
if (res.code == 200) {
ElMessage.success('更新成功');
actualAssembly.value = false
queryWeeklyProductionScheduleData()
dialogVisibleActualAssembly.value = false;
} else {
ElMessage.error(res.msg)
}
})
}, 1000 * 60, { leading: true, trailing: false })
//
// function handleSubmitActualAssembly() {
// dialogVisibleActualAssembly.value = true;
// }
//
function confirmSubmitActualAssembly() {
debouncedSubmitActualAssembly();
}
//
function getCurrentWeek() {
const now = new Date();
@ -717,7 +755,7 @@ watch(
const upload = reactive({
open: false,
title: '',
isUploading: false,
// isUploading: false,
updateSupport: 0,
uploadType: 1,
headers: { Authorization: 'Bearer ' + getToken() },
@ -817,6 +855,7 @@ function handleActualAssembly() {
dialogVisibleActualAssembly.value = true;
}
function handleSubmitActualAssembly() {
actualAssembly
let data = {
year: year.value,
week: week.value,
@ -861,6 +900,7 @@ const handleFileSuccess = (response, file, fileList) => {
}
upload.open = false
show.value = false
upload.isUploading = false
proxy.$refs['uploadRef'].clearFiles()
// dialogVisibleActualAssembly.value = true
@ -877,7 +917,8 @@ const handleFileSuccess = (response, file, fileList) => {
}
const handleFileUploadProgress = (event, file, fileList) => {
upload.isUploading = true
upload.isUploading = true,
show.value = true
}
//
function handleYearInput(value) {
@ -1080,9 +1121,12 @@ function getWeekNumber(date) {
//
return Math.ceil((pastDays + firstDayWeek) / 7);
}
const debouncedSubmitFileForm = _.debounce(function () {
proxy.$refs['uploadRef'].submit()
}, 1000 * 60, { leading: true, trailing: false })
/** 提交上传文件 */
function submitFileForm() {
proxy.$refs['uploadRef'].submit()
debouncedSubmitFileForm()
}
//