|
@@ -44,12 +44,12 @@
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="产品状态">
|
|
|
- <v-select code="ENABLED_FLAG" id="productInfoList-state" v-model="queryParam.state" allowClear placeholder="请选择产品状态"></v-select>
|
|
|
+ <v-select code="PRODUCT_STATUS" id="productInfoList-state" v-model="queryParam.state" allowClear placeholder="请选择产品状态"></v-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="定价状态">
|
|
|
- <v-select code="ENABLED_FLAG" id="productInfoList-pricingState" v-model="queryParam.pricingState" allowClear placeholder="请选择定价状态"></v-select>
|
|
|
+ <v-select code="PRICING_STATUS" id="productInfoList-pricingState" v-model="queryParam.pricingState" allowClear placeholder="请选择定价状态"></v-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
</template>
|
|
@@ -101,7 +101,7 @@
|
|
|
:rowKey="(record) => record.id"
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
|
- :scroll="{ x: 2140, y: tableHeight }"
|
|
|
+ :scroll="{ x: 2090, y: tableHeight }"
|
|
|
bordered>
|
|
|
<!-- 自定义表头 -->
|
|
|
<template slot="arrowFalgTitle">
|
|
@@ -127,12 +127,36 @@
|
|
|
</template>
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
|
- <a-button size="small" type="link" class="button-warning" @click="handleAudit(record)" id="productInfoList-audit-btn">审核</a-button>
|
|
|
- <a-button size="small" type="link" class="button-primary" @click="handleLaunch(record)" id="productInfoList-launch-btn">上线</a-button>
|
|
|
- <a-button size="small" type="link" class="button-grey" @click="handleDownline(record)" id="productInfoList-downline-btn">下线</a-button>
|
|
|
+ <a-button
|
|
|
+ size="small"
|
|
|
+ type="link"
|
|
|
+ v-if="record.state=='WAIT'"
|
|
|
+ class="button-warning"
|
|
|
+ @click="handleAudit(record)"
|
|
|
+ id="productInfoList-audit-btn">审核</a-button>
|
|
|
+ <a-button
|
|
|
+ size="small"
|
|
|
+ type="link"
|
|
|
+ v-if="record.state=='WAIT_ONLINE'||record.state=='OFFLINE'"
|
|
|
+ class="button-primary"
|
|
|
+ @click="handleLaunch(record)"
|
|
|
+ id="productInfoList-launch-btn">上线</a-button>
|
|
|
+ <a-button
|
|
|
+ size="small"
|
|
|
+ type="link"
|
|
|
+ v-if="record.state=='ONLINE'"
|
|
|
+ class="button-grey"
|
|
|
+ @click="handleDownline(record)"
|
|
|
+ id="productInfoList-downline-btn">下线</a-button>
|
|
|
<a-button size="small" type="link" class="button-info" @click="handleEdit(record)" id="productInfoList-edit-btn">编辑</a-button>
|
|
|
<a-button size="small" type="link" class="button-success" @click="handleDetail(record)" id="productInfoList-detail-btn">详情</a-button>
|
|
|
- <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="productInfoList-del-btn">删除</a-button>
|
|
|
+ <a-button
|
|
|
+ size="small"
|
|
|
+ type="link"
|
|
|
+ v-if="record.state=='WAIT'"
|
|
|
+ class="button-error"
|
|
|
+ @click="handleDel(record)"
|
|
|
+ id="productInfoList-del-btn">删除</a-button>
|
|
|
</template>
|
|
|
</s-table>
|
|
|
<!-- 产品详情 -->
|
|
@@ -175,9 +199,10 @@ export default {
|
|
|
{ title: '最近修改时间', dataIndex: 'updateDate', width: 160, align: 'center' },
|
|
|
{ title: '产品状态', dataIndex: 'stateDictValue', width: 140, align: 'center' },
|
|
|
{ title: '定价状态', scopedSlots: { customRender: 'pricingState' }, width: 140, align: 'center' },
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: 300, align: 'center', fixed: 'right' }
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: 250, align: 'center', fixed: 'right' }
|
|
|
],
|
|
|
selectedRowKeys: [], // Check here to configure the default column
|
|
|
+ selectedRows: [],
|
|
|
loading: false,
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
@@ -207,28 +232,57 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- onSelectChange (selectedRowKeys) {
|
|
|
- console.log('selectedRowKeys changed: ', selectedRowKeys)
|
|
|
+ onSelectChange (selectedRowKeys, selectedRows) {
|
|
|
this.selectedRowKeys = selectedRowKeys
|
|
|
+ this.selectedRows = selectedRows
|
|
|
+ },
|
|
|
+ // 审核
|
|
|
+ handleAudit (row) {
|
|
|
+ const _this = this
|
|
|
+ this.$confirm({
|
|
|
+ title: '提示',
|
|
|
+ content: '确认要审核吗?',
|
|
|
+ centered: true,
|
|
|
+ onOk () {
|
|
|
+ productAudit({ sn: row.productSn }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.$message.success(res.message)
|
|
|
+ _this.$refs.table.refresh()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 批量审核
|
|
|
handleBatchAudit () {
|
|
|
- if (this.selectedRowKeys.length < 1) {
|
|
|
- this.$message.warning('请在列表勾选后再进行批量操作!')
|
|
|
+ const _this = this
|
|
|
+ if (_this.selectedRowKeys.length < 1) {
|
|
|
+ _this.$message.warning('请在列表勾选后再进行批量操作!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let num = 0
|
|
|
+ const obj = []
|
|
|
+ _this.selectedRows.map(item => {
|
|
|
+ if (item.state == 'WAIT') {
|
|
|
+ num++
|
|
|
+ obj.push(item.productSn)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (num < 1) {
|
|
|
+ _this.$message.warning('当前数据不可操作!')
|
|
|
return
|
|
|
}
|
|
|
- const _this = this
|
|
|
this.$confirm({
|
|
|
title: '提示',
|
|
|
- content: '确认要批量审核吗?',
|
|
|
+ content: '已选有效数据' + num + '条,确认要批量审核吗?',
|
|
|
centered: true,
|
|
|
onOk () {
|
|
|
- // productBatchAudit({ sn: row.productSn }).then(res => {
|
|
|
- // if (res.status == 200) {
|
|
|
- // _this.$message.success(res.message)
|
|
|
- // _this.$refs.table.refresh()
|
|
|
- // }
|
|
|
- // })
|
|
|
+ productBatchAudit({ snList: obj }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.$message.success(res.message)
|
|
|
+ _this.$refs.table.refresh()
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -275,23 +329,6 @@ export default {
|
|
|
this.$router.push({ path: '/productManagement/productInfo/add' })
|
|
|
}
|
|
|
},
|
|
|
- // 审核
|
|
|
- handleAudit (row) {
|
|
|
- const _this = this
|
|
|
- this.$confirm({
|
|
|
- title: '提示',
|
|
|
- content: '确认要审核吗?',
|
|
|
- centered: true,
|
|
|
- onOk () {
|
|
|
- productAudit({ sn: row.productSn }).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- _this.$message.success(res.message)
|
|
|
- _this.$refs.table.refresh()
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
// 上线
|
|
|
handleLaunch (row) {
|
|
|
const _this = this
|