| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- <template>
- <div>
- <el-main ref="elMain" style="padding: 0px;">
- <!-- 工具区域Start -->
- <el-form class="queryForm" ref="queryFormRef" :model="queryForm" label-width="80px">
- <el-row style="margin-bottom: 15px;">
- <el-col :span="8">
- <el-form-item label="录入时间">
- <el-date-picker value-format="yyyy-MM-dd" v-model="queryForm.date" style="margin-left: 20px;" size="mini"
- type="daterange" align="left" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item label="订单状态">
- <el-select v-model="queryForm.orderStatus" disabled class="widths" size="mini" clearable>
- <el-option v-for="val in optionsStatus" :key='val.dictValue' :label="val.dictTag" :value="val.dictValue" ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <kt-button label="导出Excel" :perms="permsDelete" size="small" type="danger" @click="handlePrint()"
- style="float: left;margin-left: 50px;" />
- </el-main>
- </div>
- </template>
- <script>
- import KtButton from "@/views/Core/KtButton";
- export default {
- components: {
- KtButton,
- },
- data() {
- return {
- queryForm:{},
- permsDelete:"sys:user:delete",
- optionsStatus:[],
- };
- },
- created() {
- this.$api.insCompany.dicType('insOrderStatus').then(res=>{
- this.optionsStatus=res.data.ddList
- let filterArr = res.data.ddList.filter(item=>{
- return item.dictTag == '已承保'
- })
- if(filterArr.length){
- this.queryForm.orderStatus = filterArr[0].dictValue
- }
- })
- },
- mounted() {
-
- },
- methods: {
- // 导出excel
- handlePrint(){
- if(this.queryForm.date!=null){
- this.queryForm.startDate=this.queryForm.date[0]
- this.queryForm.endDate=this.queryForm.date[1]
- }else{
- this.$message.error('请选择录入时间!')
- return
- }
- let params = {
- endDate:this.queryForm.endDate,
- orderstatus:this.queryForm.orderStatus,
- startDate:this.queryForm.startDate
- }
- this.$api.letter.orderExportExcel(params).then(res=>{
- if(res.code==200){
- let url = process.env.BASE_URL+'/upload/'+res.data // 3.创建一个临时的url指向blob对象
- // 4.创建url之后可以模拟对此文件对象的一系列操作,例如:预览、下载
- let a = document.createElement("a");
- a.href = url;
- a.download = "导出订单.xlsx";
- a.click();
- // 5.释放这个临时的对象url
- window.URL.revokeObjectURL(url);
- }else{
- this.$message.error(res.msg)
- }
- })
- },
- },
- };
- </script>
- <style scoped lang="scss">
- .el-divider {
- margin: 10px 0px 15px !important;
- }
-
- .queryForm .el-row {
- margin: 0px;
- }
-
- .queryForm .el-form-item {
- margin-bottom: 0px;
- }
-
- .products {
-
- // margin: 20px;
- .productCosts {
- text-align: center;
-
- span {
- font-weight: bold;
- }
- }
- }
-
- .ruleStyle{
- /deep/ .el-divider__text{
- color: red;
- }
- }
-
- .products>div {
- margin: 5px;
- }
-
- .productstitle {
- width: 100%;
- border-bottom: 2px solid #409eff;
- text-align: center;
-
- }
-
- .productstitle>div {
- width: 100px;
- height: 26px;
- line-height: 30px;
- background: #409eff;
- color: #fff;
- border-top-right-radius: 15px;
- padding: 2px;
- font-size: 12px;
- }
-
- /deep/ {
- .el-button--warning {
- color: #fff;
- background-color: #ee7000;
- border-color: #ee7000;
-
- &:hover {
- color: #fff;
- background-color: #ee6f00ce;
- border-color: #ee6f00ce;
- }
- }
- }
- .apistyle /deep/ .el-form-item__label{
- min-width: 180px;
- }
- </style>
-
|