|
@@ -17,10 +17,11 @@
|
|
|
size="50%"
|
|
size="50%"
|
|
|
append-to-body>
|
|
append-to-body>
|
|
|
<div class="detail__panel container">
|
|
<div class="detail__panel container">
|
|
|
- <p class="normal-title" style="margin-bottom:16px">{{$t(`选择模板`)}}</p>
|
|
|
|
|
|
|
+ <p class="normal-title" style="margin-bottom:16px">{{$t(drawerTitle)}}</p>
|
|
|
<el-table
|
|
<el-table
|
|
|
|
|
+ v-loading="loading"
|
|
|
:data="list"
|
|
:data="list"
|
|
|
- height="250"
|
|
|
|
|
|
|
+ :height="heightTable"
|
|
|
border
|
|
border
|
|
|
style="width: 100%">
|
|
style="width: 100%">
|
|
|
<el-table-column
|
|
<el-table-column
|
|
@@ -36,6 +37,18 @@
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
+ <div style="margin-top:10px;text-align:right" v-if="nowSelect == '检验报告'">
|
|
|
|
|
+ <el-pagination
|
|
|
|
|
+ background
|
|
|
|
|
+ @size-change="handleSizeChange"
|
|
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
|
|
+ :current-page="param.content.pageNumber"
|
|
|
|
|
+ :page-sizes="[20, 50, 100, 200]"
|
|
|
|
|
+ :page-size="20"
|
|
|
|
|
+ layout="total,sizes, prev, pager, next, jumper"
|
|
|
|
|
+ :total="total">
|
|
|
|
|
+ </el-pagination>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</el-drawer>
|
|
</el-drawer>
|
|
|
</div>
|
|
</div>
|
|
@@ -50,7 +63,23 @@ export default {
|
|
|
list:[],
|
|
list:[],
|
|
|
nowSelect:"",
|
|
nowSelect:"",
|
|
|
sys_reportid:'',
|
|
sys_reportid:'',
|
|
|
- idName:''
|
|
|
|
|
|
|
+ idName:'',
|
|
|
|
|
+ drawerTitle:'',
|
|
|
|
|
+ param:{
|
|
|
|
|
+ "id": 20221115104703,
|
|
|
|
|
+ "content": {
|
|
|
|
|
+ "sa_orderid": 0,
|
|
|
|
|
+ "pageNumber": 1,
|
|
|
|
|
+ "pageSize": 20,
|
|
|
|
|
+ "where": {
|
|
|
|
|
+ "condition": ""
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ total:0,
|
|
|
|
|
+ currentPage:0,
|
|
|
|
|
+ heightTable:260 + 'px',
|
|
|
|
|
+ loading:false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods:{
|
|
methods:{
|
|
@@ -58,19 +87,70 @@ export default {
|
|
|
if (type == '质保书'){
|
|
if (type == '质保书'){
|
|
|
this.list = [
|
|
this.list = [
|
|
|
{
|
|
{
|
|
|
- name:'质保书打印'
|
|
|
|
|
|
|
+ name:'质保书'
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
this.nowSelect = type
|
|
this.nowSelect = type
|
|
|
- this.sys_reportid = 163
|
|
|
|
|
- this.idName = 'sa_dispatch'
|
|
|
|
|
|
|
+ this.idName = 'sa_dispatchid'
|
|
|
this.dataid = this.$route.query.id
|
|
this.dataid = this.$route.query.id
|
|
|
|
|
+ this.drawerTitle = '打印质保书'
|
|
|
|
|
+ this.drawer = true
|
|
|
|
|
+ }else if (type == '检验报告'){
|
|
|
|
|
+ this.nowSelect = type
|
|
|
|
|
+ this.idName = 'sa_dispatch_itemsid'
|
|
|
|
|
+ this.drawerTitle = '打印检验报告'
|
|
|
|
|
+ this.param.content.pageNUmber = 1
|
|
|
this.drawer = true
|
|
this.drawer = true
|
|
|
|
|
+ this.loading = true
|
|
|
|
|
+ this.heightTable = 'calc(100vh - 160px)'
|
|
|
|
|
+ this.listData()
|
|
|
}
|
|
}
|
|
|
|
|
+ this.queryReportId(type)
|
|
|
|
|
+ },
|
|
|
|
|
+ async queryReportId(type){
|
|
|
|
|
+ const res = await this.$api.requested({
|
|
|
|
|
+ "id": "2025101715070202",
|
|
|
|
|
+ "content": {
|
|
|
|
|
+ },
|
|
|
|
|
+ })
|
|
|
|
|
+ if (res.code == 0){
|
|
|
|
|
+ this.tool.showMessage(res,()=>{})
|
|
|
|
|
+ }else {
|
|
|
|
|
+ res.data.forEach(item=>{
|
|
|
|
|
+ if (item.name == type){
|
|
|
|
|
+ this.sys_reportid = item.sys_reportid
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ async listData(){
|
|
|
|
|
+ this.param.content.sa_dispatchid = this.$route.query.id
|
|
|
|
|
+ const res = await this.$api.requested(this.param)
|
|
|
|
|
+ let tableData = res.data.map(item=>{
|
|
|
|
|
+ return {
|
|
|
|
|
+ name:item.itemname + '检验报告',
|
|
|
|
|
+ sa_dispatch_itemsid:item.sa_dispatch_itemsid
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ this.list = tableData
|
|
|
|
|
+ this.total = res.total
|
|
|
|
|
+ this.currentPage = res.pageNumber
|
|
|
|
|
+ this.loading = false
|
|
|
|
|
+ },
|
|
|
|
|
+ handleSizeChange(val) {
|
|
|
|
|
+ // console.log(`每页 ${val} 条`);
|
|
|
|
|
+ this.param.content.pageSize = val
|
|
|
|
|
+ this.listData()
|
|
|
|
|
+ },
|
|
|
|
|
+ handleCurrentChange(val) {
|
|
|
|
|
+ // console.log(`当前页: ${val}`);
|
|
|
|
|
+ this.param.content.pageNumber = val
|
|
|
|
|
+ this.listData()
|
|
|
},
|
|
},
|
|
|
async printBtn (data) {
|
|
async printBtn (data) {
|
|
|
- console.log(data,'2222')
|
|
|
|
|
- /* 报表类型 type = datainfo */
|
|
|
|
|
|
|
+ if (this.nowSelect == '检验报告'){
|
|
|
|
|
+ this.dataid = data.sa_dispatch_itemsid
|
|
|
|
|
+ }
|
|
|
let res = await this.$api.requested({
|
|
let res = await this.$api.requested({
|
|
|
"id":20221213094501,
|
|
"id":20221213094501,
|
|
|
"content": {
|
|
"content": {
|
|
@@ -79,8 +159,8 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
this.tool.showMessage(res,() => {
|
|
this.tool.showMessage(res,() => {
|
|
|
- window.open(this.tool.getBaseUrl() + res.data + `&${this.idName}=${this.dataid}`)
|
|
|
|
|
- // window.open('http://61.164.207.46:8000' + res.data + `&${this.idName}=${this.dataid}`)
|
|
|
|
|
|
|
+ // window.open(this.tool.getBaseUrl() + res.data + `&${this.idName}=${this.dataid}`)
|
|
|
|
|
+ window.open('http://61.164.207.46:8000' + res.data + `&${this.idName}=${this.dataid}`)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|