Browse Source

Implement handleDispose method for processing warning results, enhance UI with improved HTML structure, and update styles for better readability.

master
lizhuang 1 month ago
parent
commit
44087d0fc5
1 changed files with 92 additions and 25 deletions
  1. 92
    25
      src/views/system/operationWarnresult/index.vue

+ 92
- 25
src/views/system/operationWarnresult/index.vue View File

> >
{{ scope.row.goodsSkuName }} {{ scope.row.goodsSkuName }}
</el-link> </el-link>
<em style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;" :title="scope.row.remark">{{ scope.row.remark }}</em>
<em
style="
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
"
:title="scope.row.remark"
>{{ scope.row.remark }}</em>
<em>{{ scope.row.goodsSkuSn }}</em> <em>{{ scope.row.goodsSkuSn }}</em>
<em>¥{{ scope.row.initPrice }}</em> <em>¥{{ scope.row.initPrice }}</em>
</div> </div>
prop="initPrice" prop="initPrice"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.curPrice" class="price--info" style="text-align: left; display: flex;">

<span style="display: inline-flex; align-items: center; justify-content: center; text-align: center; width: 30px; padding: 2px;">
<div
v-if="scope.row.curPrice"
class="price--info"
style="text-align: left; display: flex"
>
<span
style="
display: inline-flex;
align-items: center;
justify-content: center;
text-align: center;
width: 30px;
padding: 2px;
"
>
<i <i
v-if=" v-if="
parseFloat(scope.row.curPrice) > parseFloat(scope.row.initPrice)
"
class="el-icon-top"
style="color: green; font-size: 16px"
/>
<i
v-else-if="
parseFloat(scope.row.curPrice) ===
parseFloat(scope.row.initPrice)
"
class="el-icon-minus"
style="color: #999; font-size: 16px"
/>
parseFloat(scope.row.curPrice) >
parseFloat(scope.row.initPrice)
"
class="el-icon-top"
style="color: green; font-size: 16px"
/>
<i
v-else-if="
parseFloat(scope.row.curPrice) ===
parseFloat(scope.row.initPrice)
"
class="el-icon-minus"
style="color: #999; font-size: 16px"
/>
<i <i
v-else v-else
class="el-icon-bottom" class="el-icon-bottom"
</span> </span>


<span <span
style="color: #303133; font-size: 14px;"
style="color: #303133; font-size: 14px"
>¥{{ scope.row.curPrice }}</span> >¥{{ scope.row.curPrice }}</span>
</div> </div>
</template> </template>
class-name="small-padding fixed-width" class-name="small-padding fixed-width"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button
<el-button
v-if="scope.row.status == 0" v-if="scope.row.status == 0"
v-hasPermi="['system:operationWarnresult:edit']" v-hasPermi="['system:operationWarnresult:edit']"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-circle-check" icon="el-icon-circle-check"
@click="handleUpdate(scope.row)"
@click="handleDispose(scope.row)"
>处理</el-button> >处理</el-button>


<span <span
v-else v-else
class="text-info" class="text-info"
style="margin-right: 10px" style="margin-right: 10px"
>已处理</span> -->
>已处理</span>


<el-button <el-button
size="mini" size="mini"
} }
this.resetForm('form') this.resetForm('form')
}, },
/** 处理按钮操作 */
handleDispose(row) {
const _html = `
<p class="warn-result-text">预警商品:<a href="${row.goodsSkuUrl}" target="_blank">${row.goodsSkuName}</a></p>
<p class="warn-result-text">预警价格:${row.curPrice}</p>
<p class="warn-result-text">预警时间:${row.warnTime}</p>
<p class="warn-result-text">预警平台:${row.platform}</p>
<p class="warn-result-text">预警备注:${row.remark}</p>
<p class="warn-result-text">预警快照:<a href="${row.snapshotUrl}" target="_blank">点击查看</a></p>
<p class="warn-result-tips">注:如果点击“稍后处理”,则预警结果将不会被处理,预警状态将不会被修改。如果点击“立即处理”,则当前商品基准价格将会被修改为预警价格,价格监控按照新的基准价格进行监控。</p>
`
this.$confirm(_html, '提示', {
confirmButtonText: '立即处理',
cancelButtonText: '稍后处理',
dangerouslyUseHTMLString: true,
closeOnClickModal: false,
closeOnPressEscape: false,
showClose: false,
customClass: 'warn-result-message'
}).then(() => {
this.loading = true
row.status = 1
updateOperationWarnresult(row)
.then((response) => {
this.$modal.msgSuccess('处理成功')
this.open = false
this.getList()
})
.finally(() => {
this.loading = false
})
})
},
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
} }
} }
</script> </script>
<style>
.warn-result table{
<style lang="scss">
.warn-result table {
width: 100% !important; width: 100% !important;
} }
.warn-result table td a { .warn-result table td a {
display: none; display: none;
} }
.warn-result table img{
.warn-result table img {
width: 100% !important; width: 100% !important;
} }
.warn-result-message {
.warn-result-text {
font-size: 14px;
color: #303133;
a {
color: #409eff;
text-decoration: underline;
}
}
.warn-result-tips {
font-size: 12px;
color: #999;
margin-top: 10px;
}
}
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.goods--info { .goods--info {

Loading…
Cancel
Save