fix:工单修改
This commit is contained in:
parent
6ca3f7092c
commit
0ee4408b55
@ -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",
|
||||
|
||||
@ -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()
|
||||
}
|
||||
|
||||
// 查询
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user