Commit 6043b1c5 by zhangquan

代码优化

1 parent 03f8e2e5
...@@ -213,7 +213,7 @@ export default { ...@@ -213,7 +213,7 @@ export default {
.container { .container {
background-color: #fff; background-color: #fff;
padding: 32px 30px; padding: 32px 30px;
min-height: 500px; min-height: 600px;
position: relative; position: relative;
.good_name { .good_name {
img { img {
......
<template> <template>
<div class="container"> <GLDialog bigTitle="选择商品优惠券" mode="big" :visible.sync="isVisible" :show-close="true" :before-close="handleClose" :close-on-click-modal="false" @onOk="onOk" @onCancel="onCancel">
<GLDialog bigTitle="选择商品优惠券" mode="big" :visible.sync="isVisible" :show-close="true" :before-close="handleClose" :close-on-click-modal="false" @onOk="onOk" @onCancel="onCancel"> <div class="dialog_body">
<div class="dialog_body"> <GLCombiForm :rowNumber="1" class="dialog_search" ref="searchRef" :formObj="dialogSearchForm" :formData="dialogFormData" @handleOk="handleOk" @handleRest="handleRest"></GLCombiForm>
<GLCombiForm :rowNumber="1" class="dialog_search" ref="searchRef" :formObj="dialogSearchForm" :formData="dialogFormData" @handleOk="handleOk" @handleRest="handleRest"></GLCombiForm> <div class="conpon_type">
<div class="conpon_type"> <span :class="['type', { active_type: curType == '1' }]" @click="changeConponType(1)">卡券</span>
<span :class="['type', { active_type: curType == '1' }]" @click="changeConponType(1)">卡券</span> <span :class="['type', { active_type: curType == '2' }]" @click="changeConponType(2)">直充</span>
<span :class="['type', { active_type: curType == '2' }]" @click="changeConponType(2)">直充</span>
</div>
<div class="dialog_table">
<GLTable v-if="showTable" :pageSizes="pageSizes" ref="tableRef" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun" :searchForm="dialogSearchForm" :tableParams="tableParams" :getListApi="getListApi">
<div class="good_name" slot="goodName" slot-scope="scope">
<img v-if="scope.scope.appearance == 1" src="@/assets/conpon.png" alt="" />
<img v-else src="@/assets/directCharge.png" alt="" />
<!-- {{ scope.scope.appearance == 2 ? scope.scope.productName + (scope.scope.denomination || '') : scope.scope.productName }} -->
{{ scope.scope.productName }}
</div>
<div slot="spreadPrice" slot-scope="scope">
<span :style="{ color: Number(scope.scope.lineationPrice - scope.scope.costPrice) <= 0 ? '#eb4e4e' : '#666666' }">{{ Number(Number(scope.scope.lineationPrice - scope.scope.costPrice).toFixed(2)) }}</span>
</div>
</GLTable>
</div>
</div> </div>
</GLDialog> <div class="dialog_table">
</div> <GLTable v-if="showTable" :pageSizes="pageSizes" ref="tableRef" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun" :searchForm="dialogSearchForm" :tableParams="tableParams" :getListApi="getListApi">
<div class="good_name" slot="goodName" slot-scope="scope">
<img v-if="scope.scope.appearance == 1" src="@/assets/conpon.png" alt="" />
<img v-else src="@/assets/directCharge.png" alt="" />
<!-- {{ scope.scope.appearance == 2 ? scope.scope.productName + (scope.scope.denomination || '') : scope.scope.productName }} -->
{{ scope.scope.productName }}
</div>
<div slot="spreadPrice" slot-scope="scope">
<span :style="{ color: Number(scope.scope.lineationPrice - scope.scope.costPrice) <= 0 ? '#eb4e4e' : '#666666' }">{{ Number(Number(scope.scope.lineationPrice - scope.scope.costPrice).toFixed(2)) }}</span>
</div>
</GLTable>
</div>
</div>
</GLDialog>
</template> </template>
<script> <script>
...@@ -41,15 +39,15 @@ const dialogColumns = [ ...@@ -41,15 +39,15 @@ const dialogColumns = [
label: '差价/元', label: '差价/元',
width: 110, width: 110,
align: 'right', align: 'right',
addHtml: 'spreadPrice', addHtml: 'spreadPrice'
renderHeader: h => { // renderHeader: h => {
return h('div', { class: 'table-header specHeader' }, [ // return h('div', { class: 'table-header specHeader' }, [
h('span', '差价/元'), // h('span', '差价/元'),
h('table-tooltip', { // h('table-tooltip', {
props: { content: '差价=官方价-成本价' } // props: { content: '差价=官方价-成本价' }
}) // })
]) // ])
} // }
}, },
{ {
label: '官方价/元', label: '官方价/元',
...@@ -90,14 +88,14 @@ const dialogColumns1 = [ ...@@ -90,14 +88,14 @@ const dialogColumns1 = [
label: '差价/元', label: '差价/元',
width: 110, width: 110,
align: 'right', align: 'right',
renderHeader: h => { // renderHeader: h => {
return h('div', { class: 'table-header specHeader' }, [ // return h('div', { class: 'table-header specHeader' }, [
h('span', '差价/元'), // h('span', '差价/元'),
h('table-tooltip', { // h('table-tooltip', {
props: { content: '差价=官方价-成本价' } // props: { content: '差价=官方价-成本价' }
}) // })
]) // ])
}, // },
addHtml: 'spreadPrice' addHtml: 'spreadPrice'
}, },
{ {
......
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
fn: '删除' fn: '删除'
}, },
condition: row => { condition: row => {
return row.status == '1' || row.status == '3' return row.status == '3'
}, },
listeners: { listeners: {
click: this.del click: this.del
...@@ -149,7 +149,7 @@ export default { ...@@ -149,7 +149,7 @@ export default {
width: 180, width: 180,
prop: 'createdDate', prop: 'createdDate',
formatter: cell => { formatter: cell => {
return this.dateFormat(cell.createdDate, 'YYYY-MM-DD HH:mm:ss') return cell.createdDate ? this.dateFormat(cell.createdDate, 'YYYY-MM-DD HH:mm:ss') : '--'
} }
} }
] ]
......
...@@ -167,13 +167,13 @@ export default { ...@@ -167,13 +167,13 @@ export default {
{ {
label: '领取日期', label: '领取日期',
formatter: cell => { formatter: cell => {
return this.dateFormat(cell.receiveTime, 'YYYY-MM-DD HH:mm:ss') return cell.receiveTime ? this.dateFormat(cell.receiveTime, 'YYYY-MM-DD HH:mm:ss') : '--'
} }
}, },
{ {
label: '使用日期', label: '使用日期',
formatter: cell => { formatter: cell => {
return this.dateFormat(cell.verificationTime, 'YYYY-MM-DD HH:mm:ss') return cell.verificationTime ? this.dateFormat(cell.verificationTime, 'YYYY-MM-DD HH:mm:ss') : '--'
} }
} }
] ]
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!