Commit 6043b1c5 by zhangquan

代码优化

1 parent 03f8e2e5
......@@ -213,7 +213,7 @@ export default {
.container {
background-color: #fff;
padding: 32px 30px;
min-height: 500px;
min-height: 600px;
position: relative;
.good_name {
img {
......
<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">
<div class="dialog_body">
<GLCombiForm :rowNumber="1" class="dialog_search" ref="searchRef" :formObj="dialogSearchForm" :formData="dialogFormData" @handleOk="handleOk" @handleRest="handleRest"></GLCombiForm>
<div class="conpon_type">
<span :class="['type', { active_type: curType == '1' }]" @click="changeConponType(1)">卡券</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>
<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">
<GLCombiForm :rowNumber="1" class="dialog_search" ref="searchRef" :formObj="dialogSearchForm" :formData="dialogFormData" @handleOk="handleOk" @handleRest="handleRest"></GLCombiForm>
<div class="conpon_type">
<span :class="['type', { active_type: curType == '1' }]" @click="changeConponType(1)">卡券</span>
<span :class="['type', { active_type: curType == '2' }]" @click="changeConponType(2)">直充</span>
</div>
</GLDialog>
</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>
</GLDialog>
</template>
<script>
......@@ -41,15 +39,15 @@ const dialogColumns = [
label: '差价/元',
width: 110,
align: 'right',
addHtml: 'spreadPrice',
renderHeader: h => {
return h('div', { class: 'table-header specHeader' }, [
h('span', '差价/元'),
h('table-tooltip', {
props: { content: '差价=官方价-成本价' }
})
])
}
addHtml: 'spreadPrice'
// renderHeader: h => {
// return h('div', { class: 'table-header specHeader' }, [
// h('span', '差价/元'),
// h('table-tooltip', {
// props: { content: '差价=官方价-成本价' }
// })
// ])
// }
},
{
label: '官方价/元',
......@@ -90,14 +88,14 @@ const dialogColumns1 = [
label: '差价/元',
width: 110,
align: 'right',
renderHeader: h => {
return h('div', { class: 'table-header specHeader' }, [
h('span', '差价/元'),
h('table-tooltip', {
props: { content: '差价=官方价-成本价' }
})
])
},
// renderHeader: h => {
// return h('div', { class: 'table-header specHeader' }, [
// h('span', '差价/元'),
// h('table-tooltip', {
// props: { content: '差价=官方价-成本价' }
// })
// ])
// },
addHtml: 'spreadPrice'
},
{
......
......@@ -81,7 +81,7 @@ export default {
fn: '删除'
},
condition: row => {
return row.status == '1' || row.status == '3'
return row.status == '3'
},
listeners: {
click: this.del
......@@ -149,7 +149,7 @@ export default {
width: 180,
prop: 'createdDate',
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 {
{
label: '领取日期',
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: '使用日期',
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!