优化bug

This commit is contained in:
24kycj
2024-11-14 20:32:21 +08:00
parent 5e0c2dfc1a
commit e65967829f
3 changed files with 20 additions and 124 deletions
+8 -120
View File
@@ -163,10 +163,10 @@
<div v-for="(item, index) in soonList" :key="index" class="flex_box wook_soon_item">
<div class="wook_soon_label">{{ item.name }}</div>
<div class="wook_soon_input">
<div v-if="scope.row.type == 1">
<div v-if="item.type == 1">
<input type="file" accept="image/*" :ref="item.name" :data-name="item.name" />
</div>
<div v-if="scope.row.type == 3 || scope.row.type == 4 || scope.row.type == 5">
<div v-if="item.type == 3 || item.type == 4 || item.type == 5">
<el-input clearable :disabled="csvIsExist" v-model="item.val" placeholder="请输入"></el-input>
</div>
</div>
@@ -411,122 +411,7 @@ export default {
this.totalSize = size
},
async upload_over() {
// //左侧内容上传结束
// if (!this.upload_flag) {
// return
// }
// this.upload_flag = false
// if (this.flag_cont_up) {
// //如果是点击按钮开启的上传,则进行上传右侧
// if ((!this.isNew && this.fileData) || (this.isNew && this.fileLists[0])) {
// //开启了标签则检测并上传
// let files_n_incr = 1
// let data1 = new FormData()
// if (this.isNew) {
// if (this.fileLists[0]) {
// data1.append(`file${files_n_incr}`, this.fileLists[0]) //标签cs文件
// files_n_incr++
// } else {
// this.$message({
// offset: 100,
// message: this.$t('work.pleaseUploadTag'),
// type: 'warning'
// })
// return
// }
// } else {
// if (this.fileData && !this.fileLists[0]) {
// //纯打开,需要上传的是as文件
// let _file = new File([JSON.stringify(this.fileData)], this.saveWorkList.taskName, { type: 'text/plain' })
// data1.append(`file${files_n_incr}`, _file) //标签cs文件
// files_n_incr++
// } else if (this.fileData && this.fileLists[0]) {
// //打开后,又重新选择了soon文件
// data1.append(`file${files_n_incr}`, this.fileLists[0]) //标签cs文件
// files_n_incr++
// } else {
// this.$message({
// offset: 100,
// message: this.$t('work.pleaseUploadTag'),
// type: 'warning'
// })
// return
// }
// }
// if (this.$refs.refFile2.files.length != 0) {
// // 有csv合并文件
// data1.append(`file${files_n_incr}`, this.$refs.refFile2.files[0]) //csv文件
// data1.append(`csv`, true) //csv文件flag
// //console.log(this.$refs.refFile2.files);
// files_n_incr++
// } else {
// data1.append(`csv`, false) //csv文件flag
// }
// for (let item of this.soonList) {
// if (item.type == 1 && this.$refs[item.origin_name].files[0] != undefined && this.$refs.refFile2.files.length != 0) {
// //有合并文件
// //data1.append(item.origin_name, this.$refs[item.origin_name].files[0]);//图片文件
// data1.append(`file${files_n_incr}`, this.$refs[item.origin_name].files[0]) //图片文件
// files_n_incr++
// } else if (item.type == 1 && this.$refs[item.origin_name].files[0] != undefined && this.$refs.refFile2.files.length == 0) {
// //无合并文件
// data1.append(item.origin_name, this.$refs[item.origin_name].files[0]) //图片文件
// //data1.append(`file${files_n_incr}`, this.$refs[item.origin_name].files[0]);//图片文件
// files_n_incr++
// } else if ((item.type == 3 || item.type == 5) && this.$refs.refFile2.files.length == 0) {
// //无合并文件
// let data = this.form[item.origin_name]
// if (data == '' || data == undefined || data == null) {
// data = item.default
// }
// data1.append(item.origin_name, data) //合成文字与条形码 有默认值的
// } else if (item.type == 4 && this.$refs.refFile2.files.length == 0) {
// //二维码
// data1.append(item.origin_name, this.form[item.origin_name])
// }
// }
// this.$message({ offset: 100, message: this.$t('work.uploadingTag') })
// let pathName
// if (this.high_setting_form.localfiles) {
// //打开本地选项
// let rootFile = this.$refs.uploader.uploader.getRoot()
// if (rootFile.fileList.length != 1) {
// this.$message({
// offset: 100,
// message: this.$t('work.oneFolder'),
// type: 'warning'
// })
// return
// }
// let filePath = rootFile.fileList[0]
// if (!filePath.isFolder) {
// this.$message({
// offset: 100,
// message: this.$t('work.notFolder'),
// type: 'warning'
// })
// return
// }
// pathName = filePath.name
// } else {
// pathName = this.upload_disk
// }
// this.$axios({
// method: 'post',
// url: '/upload/' + pathName,
// headers: {
// 'Content-Type': 'multipart/form-data;boundary=' + new Date().getTime()
// },
// data: data1
// }).then((res) => {
// this.submit() //调用提交函数
// })
// } else {
// //未开启标签则直接提交
// this.submit()
// }
// }
// this.flag_cont_up = false
},
// 保存
workSave() {
@@ -634,8 +519,11 @@ export default {
this.form.ass_task.push(task)
}
that.submitLoading = true
that.testForm.req_info = that.form
console.log(that.form, that.testForm)
if (that.form.json_file) that.form.has_print_task = true
if (fileList.length) that.form.has_copy_task = true
let theForm = {...that.form}
if (!theForm.udf_file) delete theForm.udf_file
that.testForm.req_info = theForm
that.$store.dispatch('chat/websocketsend', that.testForm)
setTimeout(() => {
that.$message({