123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219 |
- <template>
- <a-modal
- centered
- class="warrantyInfo-modal"
- :footer="null"
- :maskClosable="false"
- title="质保信息"
- v-model="isShow"
- @cancel="isShow=false"
- :width="600">
- <a-spin :spinning="spinning" tip="Loading...">
- <div v-if="detailsData">
- <div class="infoList">
- <div class="infoTopList">
- <div class="uniqueStyle">
- <div>轮胎名称:</div>
- <a-tooltip placement="topLeft">
- <template slot="title">
- <span>{{ detailsData.productName || '--' }}</span>
- </template>
- <div class="text-overflow">{{ detailsData.productName || '--' }}</div>
- </a-tooltip>
- </div>
- <a-descriptions :column="1">
- <a-descriptions-item label="产品编码">
- {{ productCode || '--' }}
- </a-descriptions-item>
- <a-descriptions-item label="轮胎唯一码">
- {{ detailsData.traceCode || '--' }}
- </a-descriptions-item>
- <a-descriptions-item label="质保时间" v-if="detailsData.warrantyStartDate">
- {{ detailsData.warrantyStartDate }}{{ detailsData.warrantyEndDate?'至'+detailsData.warrantyEndDate:'' }}
- </a-descriptions-item>
- <a-descriptions-item label="质保时间" v-else>
- --
- </a-descriptions-item>
- </a-descriptions>
- </div>
- <div class="imgBox">
- <img
- v-if="detailsData.productMsg"
- style="margin-bottom:6px;object-fit: cover;border:1px dashed #ccc;"
- :src="detailsData.productMsg"
- alt="图片走丢啦"
- width="86"
- height="55"
- align="middle"
- @click="viewLargeImg"/>
- <div style="text-align:right;">
- <img
- v-if="detailsData.state ==='END'"
- src="@/assets/img/outOfDateImg.png"
- alt=""
- width="50"
- height="50" />
- <img v-if="detailsData.state ==='RUN'" src="@/assets/img/ongoing.png" alt="" width="50" height="50" />
- </div>
- </div>
- </div>
- <div class="infoList">
- <a-descriptions title="门店信息" :column="1">
- <a-descriptions-item label="门店名称">
- {{ detailsData.storeName|| '--' }}
- </a-descriptions-item>
- <a-descriptions-item label="姓名">
- {{ detailsData.storeManager ||'--' }}
- </a-descriptions-item>
- <a-descriptions-item label="电话">
- {{ detailsData.storeMobile ||'--' }}
- </a-descriptions-item>
- <a-descriptions-item label="汽配经销商">
- {{ detailsData.dealerName ||'--' }}
- </a-descriptions-item>
- </a-descriptions>
- </div>
- <div class="infoList">
- <a-descriptions title="车辆信息" :column="1">
- <a-descriptions-item label="车辆品牌">
- {{ detailsData.carBrand ||'--' }}
- </a-descriptions-item>
- <a-descriptions-item label="车型">
- {{ detailsData.carModel ||'--' }}
- </a-descriptions-item>
- <a-descriptions-item label="里程数">
- {{ detailsData.mileage ||'--' }}
- </a-descriptions-item>
- <a-descriptions-item label="车牌号">
- {{ detailsData.vehicleNumber ||'--' }}
- </a-descriptions-item>
- <a-descriptions-item label="客户姓名">
- {{ detailsData.customName ||'--' }}
- </a-descriptions-item>
- <a-descriptions-item label="手机号码">
- {{ detailsData.customMobile ||'--' }}
- </a-descriptions-item>
- </a-descriptions>
- </div>
- </div>
- <div class="btn-cont">
- <a-button id="warrantyInfo-back" @click="isShow = false">关闭</a-button>
- </div>
- </a-spin>
- <!-- 查看图片 -->
- <a-modal v-model="openImgModal" :title="null" :footer="null" :width="600" centered>
- <div class="viewImg">
- <img
- :src="detailsData.productMsg"
- alt="图片走丢啦"
- width="100%"
- height="100%"
- align="middle"/>
- </div>
- </a-modal>
- </a-modal>
- </template>
- <script>
- import { getWarrantyInfo } from '@/api/reportData'
- export default {
- name: 'ProductPricingAuditModal',
- props: {
- openModal: { // 弹框显示状态
- type: Boolean,
- default: false
- },
- itemSn: {
- type: String,
- default: ''
- },
- productCode: {
- type: String,
- default: ''
- }
- },
- data () {
- return {
- isShow: this.openModal, // 是否打开弹框
- spinning: false,
- detailsData: null, // 详情数据
- openImgModal: false
- }
- },
- methods: {
- // 获取详情
- getDetail () {
- getWarrantyInfo({ id: this.itemSn }).then(res => {
- if (res.status == 200) {
- this.detailsData = res.data
- } else {
- this.detailsData = null
- }
- })
- },
- // 查看图片
- viewLargeImg () {
- this.openImgModal = true
- }
- },
- watch: {
- // 父页面传过来的弹框状态
- openModal (newValue, oldValue) {
- this.isShow = newValue
- },
- // 重定义的弹框状态
- isShow (newValue, oldValue) {
- if (!newValue) {
- this.$emit('close')
- } else {
- this.getDetail()
- }
- }
- }
- }
- </script>
- <style lang="less">
- .warrantyInfo-modal{
- .ant-modal-body {
- padding: 30px 40px 24px;
- }
- .infoList {
- margin-bottom:26px;
- .uniqueStyle{
- display:flex;
- algin-items:center;
- margin-bottom:5px;
- div:last-child{
- width:78%;
- }
- }
- .ant-descriptions-title{
- margin-bottom:10px !important;
- }
- .ant-descriptions-row > th, .ant-descriptions-row > td{
- padding-bottom: 5px !important;
- }
- .infoTopList{
- max-width:70%;
- position: relative;
- .ant-descriptions-row{
- font-weight: bold;
- }
- .ant-descriptions-row .ant-descriptions-item > span{
- font-weight: bold;
- }
- }
- .imgBox{
- position:absolute;
- top:0;
- left:71%;
- }
- }
- .btn-cont {
- text-align: center;
- margin: 35px 0 20px;
- }
- }
- </style>
|