+
+
+ 查看附件
请上传.png、.jpg,、.jpeg类型文件,且文件个数不可超过5个
-
+ -->
+
+
+
+
+ 点击上传
+
+
+ 请上传jpg、jpeg、png、.pdf
+ 、.doc、.docx格式的文件,单个文件大小不可超过1M,最多可上传5个文件
+
+
+
-
+ -->
+
+
+
+
+ 点击上传
+
+
+ 请上传jpg、jpeg、png、.pdf
+ 、.doc、.docx格式的文件,单个文件大小不可超过1M,最多可上传5个文件
+
+
+
@@ -539,6 +597,9 @@ import {
delNoticeUser,
} from '@/api/store/newBuy'
import { imgUpLoad, fileUpLoad } from '@/api/system/upload'
+import Upload from './upload.vue'
+import FileView from '../../component/fileView.vue'
+import DialogModal from '@/components/DialogModel'
export default {
name: 'NewDevicesAccept',
@@ -557,6 +618,11 @@ export default {
},
},
},
+ components: {
+ Upload,
+ FileView,
+ DialogModal,
+ },
data() {
return {
//任务ID
@@ -616,7 +682,9 @@ export default {
dialogVisible: false,
//--------------
// 表单参数
- form: {},
+ form: {
+ fileListNew: [],
+ },
// 表单校验
rules: {
checkResult: [
@@ -633,16 +701,18 @@ export default {
trigger: 'blur',
},
],
- checkUrl: [
+ fileListNew: [
{
required: true,
- message: '验收图片不能为空',
+ message: '请上传验收材料',
trigger: 'blur',
},
],
},
// 表单参数
- aform: {},
+ aform: {
+ fileListNew: [],
+ },
// 表单校验
arules: {
checkResult: [
@@ -652,10 +722,10 @@ export default {
trigger: 'blur',
},
],
- checkUrl: [
+ fileListNew: [
{
required: true,
- message: '验收图片不能为空',
+ message: '请上传验收材料',
trigger: 'blur',
},
],
@@ -675,6 +745,14 @@ export default {
],
},
deptName: undefined,
+ actionUrl: process.env.VUE_APP_BASE_API + '/system/sys/file/upload',
+ fileUrlView: '',
+ fileNameView: '',
+ dialogConfig: {
+ outerWidth: '30%',
+ outerTitle: '附件详情',
+ outerVisible: false,
+ },
}
},
computed: {
@@ -886,7 +964,8 @@ export default {
this.$set(this.form, 'checkNum', row.purchaseNum)
this.$set(this.form, 'checkUrl', '')
this.$set(this.form, 'checkUrlName', '')
- this.fileList = []
+ this.$set(this.form, 'fileListNew', [])
+ // this.fileList = []
this.checkUrlList = []
this.checkUrlNameList = []
this.open = true
@@ -902,6 +981,7 @@ export default {
checkResult: '通过',
checkUrl: '',
checkUrlName: '',
+ fileListNew: [],
}
this.imageUrl = ''
this.openAll = true
@@ -909,8 +989,16 @@ export default {
},
/** 提交按钮 */
submitForm: function () {
- this.form.checkUrl = this.checkUrlList.join(',')
- this.form.checkUrlName = this.checkUrlNameList.join(',')
+ let fileUrl = ''
+ let fileName = ''
+
+ this.form.fileListNew.map((e) => {
+ fileUrl += e.url + ','
+ fileName += e.name + ','
+ })
+ this.form.checkUrl = fileUrl.substring(fileUrl.length - 1, 1)
+ this.form.checkUrlName = fileName.substring(fileName.length - 1, 1)
+
// console.log(this.form)
// console.log(equipments)
this.$refs['form'].validate((valid) => {
@@ -923,9 +1011,10 @@ export default {
type: 'success',
})
this.open = false
- this.fileList = []
- this.checkUrlList = []
- this.checkUrlNameList = []
+ this.form.fileListNew = []
+ // this.fileList = []
+ // this.checkUrlList = []
+ // this.checkUrlNameList = []
this.getTaskInfo()
}
})
@@ -933,10 +1022,17 @@ export default {
})
},
submitListForm: function () {
- this.aform.checkUrl = this.checkUrlList1.join(',')
- this.aform.checkUrlName = this.checkUrlNameList1.join(',')
- // console.log(this.aform)
- // console.log(equipments)
+ // this.aform.checkUrl = this.checkUrlList1.join(',')
+ // this.aform.checkUrlName = this.checkUrlNameList1.join(',')
+ let fileUrl = ''
+ let fileName = ''
+ this.aform.fileListNew.map((e) => {
+ fileUrl += e.url + ','
+ fileName += e.name + ','
+ })
+ this.aform.checkUrl = fileUrl.substring(fileUrl.length - 1, 1)
+ this.aform.checkUrlName = fileName.substring(fileName.length - 1, 1)
+
this.$refs['aform'].validate((valid) => {
if (valid) {
this.ids.forEach((item) => {
@@ -955,9 +1051,10 @@ export default {
})
this.openAll = false
this.open = false
- this.fileList1 = []
- this.checkUrlList1 = []
- this.checkUrlNameList1 = []
+ // this.fileList1 = []
+ // this.checkUrlList1 = []
+ // this.checkUrlNameList1 = []
+ this.aform.fileListNew = []
this.getTaskInfo()
}
})
@@ -994,28 +1091,28 @@ export default {
handleAvatarSuccess(res, file) {
// console.log("success")
},
- handleRemove(file, fileList) {
- if (this.open) {
- let sum = 0
- this.checkUrlNameList.forEach((item, index) => {
- if (item == file.name) {
- sum = index
- }
- })
- this.checkUrlNameList.splice(sum, 1)
- this.checkUrlList.splice(sum, 1)
- }
- if (this.openAll) {
- let sum1 = 0
- this.checkUrlNameList1.forEach((item, index) => {
- if (item == file.name) {
- sum1 = index
- }
- })
- this.checkUrlNameList1.splice(sum1, 1)
- this.checkUrlList1.splice(sum1, 1)
- }
- },
+ // handleRemove(file, fileList) {
+ // if (this.open) {
+ // let sum = 0
+ // this.checkUrlNameList.forEach((item, index) => {
+ // if (item == file.name) {
+ // sum = index
+ // }
+ // })
+ // this.checkUrlNameList.splice(sum, 1)
+ // this.checkUrlList.splice(sum, 1)
+ // }
+ // if (this.openAll) {
+ // let sum1 = 0
+ // this.checkUrlNameList1.forEach((item, index) => {
+ // if (item == file.name) {
+ // sum1 = index
+ // }
+ // })
+ // this.checkUrlNameList1.splice(sum1, 1)
+ // this.checkUrlList1.splice(sum1, 1)
+ // }
+ // },
//图片点击查看
handlePictureCardPreview(file) {
// console.log(file)
@@ -1053,6 +1150,49 @@ export default {
this.$store.dispatch('dict/cleanDict')
})
},
+ // 移除文件
+ handleRemove(file) {
+ if (this.openAll) {
+ this.aform.fileListNew = this.aform.fileListNew.filter(
+ (e) => e.uid !== file.uid,
+ )
+ }
+ if (this.open) {
+ this.form.fileListNew = this.form.fileListNew.filter(
+ (e) => e.uid !== file.uid,
+ )
+ }
+
+ console.log(this.aform, '移除后--')
+ },
+ // 文件上传成功
+ handleSuccess(res) {
+ if (res.code == 200) {
+ const fileObj = {
+ name: res.data.fileName,
+ url: res.data.fileUrl,
+ }
+ if (this.openAll) {
+ this.aform.fileListNew.push(fileObj)
+ this.$refs.aform.clearValidate('fileListNew')
+ }
+ if (this.open) {
+ this.form.fileListNew.push(fileObj)
+ this.$refs.form.clearValidate('fileListNew')
+ }
+ }
+ },
+ // 查看附件
+ handleQueryFile(row) {
+ console.log(row, '当前行数据')
+ this.fileUrlView = row.checkUrl
+ this.fileNameView = row.checkUrlName
+ this.dialogConfig.outerVisible = true
+ },
+ // 关闭附件弹框
+ closeDialogOuter(val) {
+ this.dialogConfig.outerVisible = val
+ },
},
}
@@ -1078,4 +1218,22 @@ export default {
font-size: 14px;
color: red;
}
+
+.upload-box {
+ display: flex;
+
+ .Upload-tip {
+ text-align: left;
+ }
+}
+
+.upload-tip {
+ text-align: left;
+
+ .tip-text {
+ font-size: 13px;
+ color: red;
+ letter-spacing: 1px;
+ }
+}
diff --git a/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/upload.vue b/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/upload.vue
new file mode 100644
index 00000000..cb6ad4ee
--- /dev/null
+++ b/sgzb-ui/src/views/warehouseManage/newPurchase/toolsAcceptance/component/upload.vue
@@ -0,0 +1,117 @@
+