|
@@ -99,7 +99,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table> -->
|
|
|
- <el-table ref="singleTable" :data="switchList" highlight-current-row @current-change="rowChange"
|
|
|
+ <el-table ref="singleTable" :key='timestamp' :data="switchList" highlight-current-row @current-change="rowChange"
|
|
|
style="width: 100%; overflow-y: scroll !important; height: calc(100vh - 54vh);margin-top:14px">
|
|
|
<el-table-column property="number" label="业务编号">
|
|
|
<span slot-scope="scope">{{scope.row.weighingManagement?scope.row.weighingManagement.number:""}}</span>
|
|
@@ -163,7 +163,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <el-dialog width="70%" class="table-content" center :visible.sync="isShowPrint" title="粮食质检单" @close="closeDialog">
|
|
|
+ <el-dialog width="70%" class="table-content" center :visible.sync="isShowPrint" title="粮食质检单" @opened="opendBtn" @close="closeDialog">
|
|
|
<!-- <inspectInfoPrint :printData="printData"></inspectInfoPrint> -->
|
|
|
<outInspectPrint :printData="printData" ref="saveImg"></outInspectPrint>
|
|
|
<div style="text-align:center">
|
|
@@ -205,6 +205,7 @@
|
|
|
inspectList: [],
|
|
|
noinspectList:[],
|
|
|
switchList:[],
|
|
|
+ timestamp:'',
|
|
|
//分页
|
|
|
currentPage: 1,
|
|
|
pageSize: 10,
|
|
@@ -373,6 +374,29 @@
|
|
|
}
|
|
|
return year + '' + mouth + datetime
|
|
|
},
|
|
|
+ opendBtn() {
|
|
|
+ html2canvas(this.$refs.saveImg.$el).then((canvas) => {
|
|
|
+ let dataURL = canvas.toDataURL('image/png')
|
|
|
+ this.imgUrl = dataURL
|
|
|
+ if (this.imgUrl !== '') {
|
|
|
+ let b = this.dataURLtoFile(this.imgUrl, 'printImage')
|
|
|
+ let formdata = new FormData()
|
|
|
+ formdata.append('file', b)
|
|
|
+ axios({
|
|
|
+ method: 'post',
|
|
|
+ url: 'https://www.zthymaoyi.com/upload/admin',
|
|
|
+ data: formdata,
|
|
|
+ }).then((response) => {
|
|
|
+ //编辑接口
|
|
|
+ this.inspect.pictureAddress = response.data.url
|
|
|
+ addOut(this.inspect)
|
|
|
+ .toPromise()
|
|
|
+ .then((response) => {
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
closeDialog() {
|
|
|
html2canvas(this.$refs.saveImg.$el).then((canvas) => {
|
|
|
let dataURL = canvas.toDataURL('image/png')
|
|
@@ -568,7 +592,7 @@
|
|
|
})
|
|
|
},
|
|
|
getList() {
|
|
|
-
|
|
|
+ this.timestamp=new Date().valueOf()
|
|
|
getinspectList({
|
|
|
compId: localStorage.getItem('ws-pf_compId'),
|
|
|
currentPage: this.currentPage,
|
|
@@ -580,17 +604,19 @@
|
|
|
.toPromise()
|
|
|
.then((response) => {
|
|
|
this.noinspectList = response.records
|
|
|
+ console.log(this.inspectbtn,this.noinspectList.length )
|
|
|
if(this.inspectbtn == 1 && this.noinspectList.length > 0){
|
|
|
this.switchList = this.noinspectList
|
|
|
this.inspect = this.noinspectList[0]
|
|
|
if(!this.inspect.weighingManagement){
|
|
|
this.inspect.weighingManagement = {}
|
|
|
}
|
|
|
- }else{
|
|
|
+ }else if(this.inspectbtn == 1){
|
|
|
this.switchList = []
|
|
|
this.inspect = {}
|
|
|
this.inspect.weighingManagement = {}
|
|
|
}
|
|
|
+ console.log(this.switchList )
|
|
|
this.deptBudgetTotal1 = response.total
|
|
|
this.nosuccess = response.total
|
|
|
})
|
|
@@ -605,13 +631,14 @@
|
|
|
.toPromise()
|
|
|
.then((response) => {
|
|
|
this.inspectList = response.records
|
|
|
+ console.log(this.inspectbtn,this.inspectList.length )
|
|
|
if(this.inspectbtn == 2 && this.inspectList.length > 0){
|
|
|
this.switchList = this.inspectList
|
|
|
this.inspect = this.inspectList[0]
|
|
|
if(!this.inspect.weighingManagement){
|
|
|
this.inspect.weighingManagement = {}
|
|
|
}
|
|
|
- }else{
|
|
|
+ }else if(this.inspectbtn == 2){
|
|
|
this.switchList = []
|
|
|
this.inspect = {}
|
|
|
this.inspect.weighingManagement = {}
|