<template>
|
<div class="app-container">
|
<div class="filter-container">
|
<div class="carrier_search">
|
<span>运输证编号:</span>
|
<el-input v-model="listQuery.filter.code" class="carrier_search_input"></el-input>
|
</div>
|
<div class="carrier_search">
|
<span>企业名称:</span>
|
<el-input v-model="listQuery.filter.enterprisename" class="carrier_search_input"></el-input>
|
</div>
|
<el-button style="margin-left: 10px;" type="primary" @click="openCarrierForm('新增','')">添加</el-button>
|
<el-button style="margin-left: 10px;" type="primary" @click="searchData()">查询</el-button>
|
</div>
|
<div class="table_content">
|
<el-table
|
v-loading="listLoading"
|
:key="tableKey"
|
:data="certificateList"
|
border
|
fit
|
highlight-current-row
|
style="width: 100%;"
|
>
|
<el-table-column label="序号" type="index" align="center" width="60"/>
|
<el-table-column label="运输证编码" prop="code" align="center">
|
</el-table-column>
|
<el-table-column label="托运人" prop="shippercompanyname" align="center">
|
</el-table-column>
|
<el-table-column label="收货人" prop="receivercompanyname" align="center">
|
</el-table-column>
|
<el-table-column label="运输时间" prop="amount" align="center">
|
<template slot-scope="scope">
|
<span>
|
{{scope.row.othershipstarttime}}
|
</span>
|
<span>-</span>
|
<span>
|
{{scope.row.othershipendtime}}
|
</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="运输状态" prop="status" align="center"></el-table-column>
|
<el-table-column label="入库状态" prop="certstatus" align="center"></el-table-column>
|
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
|
<template slot-scope="scope">
|
<el-button type="text" @click="openCarrierForm('查看',scope.row)">查看</el-button>
|
<el-button type="text" @click="exportApply(scope.row)">导出申请表</el-button>
|
<el-button type="text" @click="commit(scope.row)" v-if="scope.row.status === '待提交' ? true : false">提交</el-button>
|
<el-button type="text" @click="openCarrierForm('修改',scope.row)" v-if="scope.row.status === '待提交' ? true : false">修改</el-button>
|
<el-button type="text" @click="deleteCarrierLicense('删除',scope.row)" style="color: red" v-if="scope.row.status === '待提交' ? true : false">删除</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
<br>
|
<el-pagination
|
v-show="recordTotal>0"
|
:current-page="currentPage"
|
:page-sizes="[10, 20, 30, 50]"
|
:page-size="pageSize"
|
:total="recordTotal"
|
layout="total, sizes, prev, pager, next, jumper"
|
background
|
style="float:right;"
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange"
|
/>
|
<br>
|
</div>
|
<transportListForm ref="transportList" @getinfo="getCertificateListData"></transportListForm>
|
</div>
|
</template>
|
|
<script>
|
import transportListForm from "./components/transportListForm";
|
import { computePageCount } from '@/utils'
|
import { getCertificateList , deleteCertificate ,commitTransport,exportCertificateApply} from "../../api/tranportList";
|
import { parseError } from '@/utils/messageDialog'
|
import {submitApply} from "../../api/contract";
|
|
export default {
|
name: "carrier",
|
data(){
|
return{
|
baseUrl: process.env.IMG_API,
|
tableKey:0,
|
listLoading:false,
|
pageSize: 10,
|
recordTotal: 0,
|
currentPage: 1,
|
pageTotal: 0,
|
listQuery:{
|
filter:{
|
code:"",
|
},
|
pageIndex:1,
|
pageSize:10,
|
},
|
searchContent:'',
|
certificateList:[],
|
}
|
},
|
components:{
|
transportListForm
|
},
|
created(){
|
this.getCertificateListData()
|
},
|
methods:{
|
async getCertificateListData(){
|
this.listLoading = true
|
let res = await getCertificateList(this.listQuery)
|
if(res.data.code === "200"){
|
this.recordTotal = res.data.result.total
|
this.pageSize = res.data.result.size
|
this.pageTotal = computePageCount(res.data.result.total, res.data.result.size)
|
this.currentPage = res.data.result.current
|
this.certificateList = res.data.result.records
|
}
|
this.listLoading = false
|
},
|
openCarrierForm(title,value){
|
this.$refs.transportList.showCarrierLicense(title,value)
|
},
|
deleteCarrierLicense(title,row){
|
this.$confirm('删除此条信息,是否继续','提示',{
|
confirmButtonText:'确定',
|
cancelButtonText:'取消',
|
type:'warning',
|
}).then(()=> {
|
deleteCertificate(row.id).then( ()=>{
|
this.approveVisible = false
|
this.getCertificateListData()
|
this.$notify({
|
title:'成功',
|
message:'删除成功',
|
type:'success',
|
duration:2000,
|
})
|
}).catch(error => {
|
parseError({error: error, vm: this})
|
})
|
})
|
},
|
searchData(){
|
this.getCertificateListData()
|
},
|
handleSizeChange: function(val) {
|
this.listQuery.pageSize = val
|
this.getCertificateListData()
|
},
|
handleCurrentChange: function(val) {
|
this.listQuery.pageIndex = val
|
this.getCertificateListData()
|
},
|
commit(row){
|
this.$confirm('提交此条信息,是否继续','提示',{
|
confirmButtonText:'确定',
|
cancelButtonText:'取消',
|
type:'warning',
|
}).then(()=> {
|
commitTransport(row.id).then( ()=>{
|
this.getCertificateListData()
|
this.$notify({
|
title:'成功',
|
message:'提交成功',
|
type:'success',
|
duration:2000,
|
})
|
}).catch(error => {
|
parseError({error: error, vm: this})
|
})
|
})
|
},
|
exportApply(row){
|
exportCertificateApply(row.id).then(response => {
|
const res = response.data
|
if (res.code == 200) {
|
window.open(this.baseUrl+res.result, '_blank');
|
} else {
|
parseError({error: res.message, vm: this})
|
}
|
}).catch(error => {
|
parseError({error: error, vm: this})
|
})
|
},
|
}
|
}
|
</script>
|
|
<style scoped>
|
.carrier_search{
|
display: inline-block;
|
}
|
.carrier_search_input{
|
width:200px;
|
}
|
</style>
|