dev
张同海 2 years ago
parent b630afc4a3
commit 2d459db541

@ -27,8 +27,8 @@ import VueContextMenu from 'vue-contextmenu'
import vcolorpicker from 'vcolorpicker' import vcolorpicker from 'vcolorpicker'
import VXETable from 'vxe-table' import VXETable from 'vxe-table'
import 'vxe-table/lib/style.css' import 'vxe-table/lib/style.css'
import 'vue-easytable/libs/theme-default/index.css'; import 'vue-easytable/libs/theme-default/index.css'
import VueEasytable from 'vue-easytable'; import VueEasytable from 'vue-easytable'
Vue.use(VXETable) Vue.use(VXETable)
Vue.use(VueContextMenu) Vue.use(VueContextMenu)
@ -38,9 +38,10 @@ Vue.use(socket, '/hubs/chatHub')
Vue.use(VueAxios) Vue.use(VueAxios)
Vue.use(Dialog) Vue.use(Dialog)
Vue.use(dataV) Vue.use(dataV)
Vue.use(VueEasytable); Vue.use(VueEasytable)
Vue.prototype.hasPerm = hasBtnPermission Vue.prototype.hasPerm = hasBtnPermission
Vue.prototype.applocation = sysApplication Vue.prototype.applocation = sysApplication
Vue.prototype.$bus = new Vue()
Vue.config.productionTip = false Vue.config.productionTip = false
new Vue({ new Vue({

@ -45,7 +45,7 @@
<button @click="TxxpLink"><span class="iconfont icon-dayinxiaopiao"></span>提箱小票</button> <button @click="TxxpLink"><span class="iconfont icon-dayinxiaopiao"></span>提箱小票</button>
</div> </div>
<div class="btn-list single-view-4"> <div class="btn-list single-view-4">
<a-upload :file-list="fileList" name="file" :customRequest="uploadFile"> <a-upload :file-list="fileList" :before-upload="beforeUpload" name="file" :customRequest="uploadFile">
<button @click="ShowOCR"><span class="iconfont icon-OCR"></span>OCR</button> <button @click="ShowOCR"><span class="iconfont icon-OCR"></span>OCR</button>
</a-upload> </a-upload>
@ -690,6 +690,10 @@ export default {
}) })
} }
}, },
beforeUpload(file) {
console.log(this.details, 'this.details')
this.$bus.$emit('WebTest001', { upFileList: file, attachCode: 'other', attachName: '其他' })
},
uploadFile(file) { uploadFile(file) {
const formData = new FormData() const formData = new FormData()
formData.append('file', file.file) formData.append('file', file.file)

@ -17,13 +17,13 @@
</div> </div>
</div> </div>
<div class="tip" v-else-if="excuteRulesType === 'fail'"> <div class="tip" v-else-if="excuteRulesType === 'fail'">
<div class="rules-label"> <div class="rules-label"><i class="iconfont icon-shibai Warning"></i><span>校验失败</span></div>
<i class="iconfont icon-shibai Warning"></i><span>校验失败</span>
</div>
</div> </div>
<div class="tip no-data" v-else> <div class="tip no-data" v-else>
<i class="iconfont icon-meiyoudingdan"></i> <i class="iconfont icon-meiyoudingdan"></i>
<div class="text">暂无校验, <a-button size="small" type="link" class="btn" @click="checkFun"> </a-button></div> <div class="text">
暂无校验, <a-button size="small" type="link" class="btn" @click="checkFun"> </a-button>
</div>
</div> </div>
</div> </div>
</a-card> </a-card>
@ -285,7 +285,11 @@ export default {
locaService: [] locaService: []
} }
}, },
created() {}, created() {
this.$bus.$on('WebTest001', val => {
this.WebTest001(val)
})
},
watch: { watch: {
'$route.query': { '$route.query': {
immediate: true, immediate: true,
@ -392,6 +396,7 @@ export default {
.then(res => { .then(res => {
if (res.success) { if (res.success) {
this.fileList = res.data this.fileList = res.data
console.log(this.fileList)
} }
}) })
.catch(err => { .catch(err => {
@ -421,12 +426,20 @@ export default {
this.upFileList = newFileList this.upFileList = newFileList
}, },
beforeUpload(file) { beforeUpload(file) {
debugger
this.upFileList = [...this.upFileList, file] this.upFileList = [...this.upFileList, file]
return false return false
}, },
WebTest001(val) {
console.log(val.upFileList)
this.beforeUpload(val.upFileList)
// this.upFileList = this.upFileList.unshift(val.upFileList)
this.attachCode = val.attachCode
this.attachName = val.attachName
this.handleUpload()
},
handleUpload() { handleUpload() {
const { upFileList, attachCode, attachName } = this const { upFileList, attachCode, attachName } = this
console.log(upFileList, attachCode, attachName)
if (upFileList.length === 0) { if (upFileList.length === 0) {
this.$message.error('请上传文件') this.$message.error('请上传文件')
return false return false
@ -869,7 +882,6 @@ export default {
line-height: 30px; line-height: 30px;
.text { .text {
display: inline-block; display: inline-block;
} }
} }
} }

Loading…
Cancel
Save