Commit 5c0d308c by 张立顺

fix bug提交

1 parent 8c3f9041
...@@ -83,6 +83,7 @@ ...@@ -83,6 +83,7 @@
<!-- @click="exportFile({ contractNo: item.contractNo })" --> <!-- @click="exportFile({ contractNo: item.contractNo })" -->
</baseDialog> </baseDialog>
<!-- 新增 --> <!-- 新增 -->
<!-- v-if="fileVisible" -->
<d2-dialog <d2-dialog
:title="'新建任务'" :title="'新建任务'"
:is-visible="fileVisible" :is-visible="fileVisible"
...@@ -156,6 +157,7 @@ ...@@ -156,6 +157,7 @@
<!-- 重新导入 --> <!-- 重新导入 -->
<d2-dialog <d2-dialog
:title="'导入'" :title="'导入'"
v-if="fileVisibleRest"
:is-visible="fileVisibleRest" :is-visible="fileVisibleRest"
@closeDialog="handleImportRest" @closeDialog="handleImportRest"
@confirmDialog="handleConfirmImportRest" @confirmDialog="handleConfirmImportRest"
...@@ -177,7 +179,7 @@ ...@@ -177,7 +179,7 @@
导入文件 导入文件
<input <input
type="file" type="file"
id="fileUpload" id="fileUploadRest"
class="import-input" class="import-input"
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
@change="importFileRest($event)" @change="importFileRest($event)"
...@@ -508,6 +510,13 @@ export default { ...@@ -508,6 +510,13 @@ export default {
}, },
// 上传文件,转码为base64 // 上传文件,转码为base64
importFile(e) { importFile(e) {
// var node = document.createElement("LI")
// var textnode = document.createTextNode("Water")
// node.appendChild(textnode)
// // document.getElementById("fileUpload").appendChild(node)
// // console.log("this.$refs.fileRuleForm", this.$refs.fileRuleForm)
// // this.$refs.fileRuleForm.appendChild(node)
// document.getElementsByClassName("el-dialog__body")[0].appendChild(node)
// console.log(e) // console.log(e)
const size = e.target.files[0].size / 1024 / 1024 const size = e.target.files[0].size / 1024 / 1024
if (size < 9) { if (size < 9) {
...@@ -519,15 +528,16 @@ export default { ...@@ -519,15 +528,16 @@ export default {
}) })
return false return false
} }
this.$set(this.fileForm, "fileName", e.target.files[0].name) // this.$forceUpdate()
// 转码base64
// // 转码base64
const reader = new FileReader() const reader = new FileReader()
reader.readAsDataURL(e.target.files[0]) reader.readAsDataURL(e.target.files[0])
reader.onload = (event) => { reader.onload = (event) => {
const imgFile = event.target.result const imgFile = event.target.result
const arrBase64 = imgFile.split(",") const arrBase64 = imgFile.split(",")
this.fileInfo = "xlsx" + "@" + arrBase64[1] this.fileInfo = "xlsx" + "@" + arrBase64[1]
console.log("fileName", fileName)
this.$set(this.fileForm, "fileName", fileName)
document.getElementById("fileUpload").value = "" document.getElementById("fileUpload").value = ""
} }
} else { } else {
...@@ -548,8 +558,8 @@ export default { ...@@ -548,8 +558,8 @@ export default {
return false return false
} }
this.$set(this.fileFormRest, "fileName", e.target.files[0].name) this.$set(this.fileFormRest, "fileName", e.target.files[0].name)
// this.$forceUpdate()
// // 转码base64 // 转码base64
const reader = new FileReader() const reader = new FileReader()
reader.readAsDataURL(e.target.files[0]) reader.readAsDataURL(e.target.files[0])
reader.onload = (event) => { reader.onload = (event) => {
...@@ -659,6 +669,7 @@ export default { ...@@ -659,6 +669,7 @@ export default {
handleImport() { handleImport() {
this.fileVisible = !this.fileVisible this.fileVisible = !this.fileVisible
this.$refs.fileRuleForm && this.$refs.fileRuleForm.resetFields() this.$refs.fileRuleForm && this.$refs.fileRuleForm.resetFields()
}, },
handleImportRest(row) { handleImportRest(row) {
......
...@@ -43,11 +43,11 @@ export default { ...@@ -43,11 +43,11 @@ export default {
}, },
{ {
label: "支付时间", label: "支付时间",
prop: "payTime", prop: "payTime"
// width: "100px", // width: "100px",
formatter: (cellValue) => { // formatter: (cellValue) => {
return Util.dateFormate(cellValue.payTime, "YYYY-MM-DD HH:mm:ss") // return Util.dateFormate(cellValue.payTime, "YYYY-MM-DD HH:mm:ss")
} // }
}, },
{ {
label: "交易参考号", label: "交易参考号",
...@@ -95,13 +95,13 @@ export default { ...@@ -95,13 +95,13 @@ export default {
// }, // },
{ {
label: "更新时间", label: "更新时间",
prop: "updateTime", prop: "updateTime"
formatter: (cellValue) => { // formatter: (cellValue) => {
return Util.dateFormate( // return Util.dateFormate(
cellValue.updatedTime, // cellValue.updatedTime,
"YYYY-MM-DD HH:mm:ss" // "YYYY-MM-DD HH:mm:ss"
) // )
} // }
}, },
{ {
label: "任务状态描述", label: "任务状态描述",
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!