|
@@ -6,12 +6,12 @@
|
|
<a-row :gutter="15">
|
|
<a-row :gutter="15">
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
<a-form-item label="品牌名称">
|
|
<a-form-item label="品牌名称">
|
|
- <a-input id="productBrandList-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="请输入品牌名称"/>
|
|
|
|
|
|
+ <a-input id="productBrandList-productBrandName" v-model.trim="queryParam.productBrandName" allowClear placeholder="请输入品牌名称"/>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
<a-form-item label="状态">
|
|
<a-form-item label="状态">
|
|
- <v-select code="CHECK_ENABLE_STATE" id="productBrandList-state" v-model="queryParam.state" allowClear placeholder="请选择状态"></v-select>
|
|
|
|
|
|
+ <v-select code="ENABLED_FLAG" id="productBrandList-enabledFlag" v-model="queryParam.enabledFlag" allowClear placeholder="请选择状态"></v-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
@@ -36,14 +36,14 @@
|
|
:data="loadData"
|
|
:data="loadData"
|
|
bordered>
|
|
bordered>
|
|
<!-- 状态 -->
|
|
<!-- 状态 -->
|
|
- <template slot="status" slot-scope="text, record">
|
|
|
|
|
|
+ <template slot="enabledFlag" slot-scope="text, record">
|
|
<a-switch
|
|
<a-switch
|
|
id="productBrandList-enable"
|
|
id="productBrandList-enable"
|
|
checkedChildren="启用"
|
|
checkedChildren="启用"
|
|
unCheckedChildren="禁用"
|
|
unCheckedChildren="禁用"
|
|
@change="changeStatus(record)"
|
|
@change="changeStatus(record)"
|
|
- v-model="record.status" />
|
|
|
|
- <!-- <span :class="record.status==1?'green':'red'" v-else> {{ record.status==1? '已启用': '已禁用' }} </span> -->
|
|
|
|
|
|
+ :checked="record.enabledFlag == 1 ? true : false" />
|
|
|
|
+ <!-- <span :class="record.enabledFlag==1?'green':'red'" v-else> {{ record.enabledFlag==1? '已启用': '已禁用' }} </span> -->
|
|
</template>
|
|
</template>
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
<template slot="action" slot-scope="text, record">
|
|
<template slot="action" slot-scope="text, record">
|
|
@@ -51,13 +51,13 @@
|
|
</template>
|
|
</template>
|
|
</s-table>
|
|
</s-table>
|
|
<!-- 新增/编辑产品品牌 -->
|
|
<!-- 新增/编辑产品品牌 -->
|
|
- <product-brand-edit-modal :openModal="openModal" :itemId="itemId" @close="closeModal" />
|
|
|
|
|
|
+ <product-brand-edit-modal :openModal="openModal" :nowData="nowData" :itemId="itemId" @ok="handleOk" @close="closeModal" />
|
|
</a-card>
|
|
</a-card>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import moment from 'moment'
|
|
import moment from 'moment'
|
|
-// import { customerBundleDelayList, customerBundleExportDelay } from '@/api/FinancialManagement'
|
|
|
|
|
|
+import { dealerProductBrandList, dealerProductBrandUpdate } from '@/api/dealerProductBrand'
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
import productBrandEditModal from './editModal.vue'
|
|
import productBrandEditModal from './editModal.vue'
|
|
export default {
|
|
export default {
|
|
@@ -65,85 +65,74 @@ export default {
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
queryParam: { // 查询条件
|
|
queryParam: { // 查询条件
|
|
- bundleName: '', // 品牌名称
|
|
|
|
- state: undefined, // 状态
|
|
|
|
|
|
+ productBrandName: '', // 品牌名称
|
|
|
|
+ enabledFlag: undefined, // 状态
|
|
},
|
|
},
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
columns: [
|
|
columns: [
|
|
{ title: '序号', dataIndex: 'no', width: 70, align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: 70, align: 'center' },
|
|
- { title: '产品品牌名称', dataIndex: 'productName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '首字母', dataIndex: 'productOldNum', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '创建时间', dataIndex: 'inventoryMoney', width: 180, align: 'center' },
|
|
|
|
- { title: '状态', scopedSlots: { customRender: 'status' }, width: 180, align: 'center' },
|
|
|
|
|
|
+ { title: '产品品牌名称', dataIndex: 'productBrandName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '首字母', dataIndex: 'firstChar', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '创建时间', dataIndex: 'createDate', width: 180, align: 'center' },
|
|
|
|
+ { title: '状态', scopedSlots: { customRender: 'enabledFlag' }, width: 180, align: 'center' },
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 240, align: 'center' }
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 240, align: 'center' }
|
|
],
|
|
],
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
this.disabled = true
|
|
this.disabled = true
|
|
- // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
|
|
|
|
- // const data = res.data
|
|
|
|
- // const no = (data.pageNo - 1) * data.pageSize
|
|
|
|
- // for (var i = 0; i < data.list.length; i++) {
|
|
|
|
- // data.list[i].no = no + i + 1
|
|
|
|
- // }
|
|
|
|
- // this.disabled = false
|
|
|
|
- // return data
|
|
|
|
- // })
|
|
|
|
- const _this = this
|
|
|
|
- return new Promise(function(resolve, reject){
|
|
|
|
- const data = {
|
|
|
|
- pageNo: 1,
|
|
|
|
- pageSize: 10,
|
|
|
|
- list: [
|
|
|
|
- { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', productType: '产品分类1', inventoryNum: '5', inventoryMoney: '122' }
|
|
|
|
- ]
|
|
|
|
- }
|
|
|
|
|
|
+ return dealerProductBrandList( Object.assign(parameter, this.queryParam) ).then(res => {
|
|
|
|
+ const data = res.data
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
data.list[i].no = no + i + 1
|
|
data.list[i].no = no + i + 1
|
|
}
|
|
}
|
|
- _this.disabled = false
|
|
|
|
- resolve(data)
|
|
|
|
|
|
+ this.disabled = false
|
|
|
|
+ return data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- openModal: false, // 新增编辑产品品牌 弹框
|
|
|
|
- itemId: '' // 当前品牌id
|
|
|
|
|
|
+ openModal: false, // 新增编辑 弹框
|
|
|
|
+ itemId: '', // 当前id
|
|
|
|
+ nowData: null // 当前记录数据
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// 重置
|
|
// 重置
|
|
resetSearchForm () {
|
|
resetSearchForm () {
|
|
- this.queryParam.orderBundleNo = ''
|
|
|
|
- this.queryParam.orderBundle.custMobile = ''
|
|
|
|
- this.queryParam.bundleName = ''
|
|
|
|
- this.queryParam.itemName = ''
|
|
|
|
- this.oldTime = undefined
|
|
|
|
- this.newTime = undefined
|
|
|
|
|
|
+ this.queryParam.productBrandName = ''
|
|
|
|
+ this.queryParam.enabledFlag = undefined
|
|
this.$refs.table.refresh(true)
|
|
this.$refs.table.refresh(true)
|
|
},
|
|
},
|
|
// 新增/编辑
|
|
// 新增/编辑
|
|
handleEdit(row){
|
|
handleEdit(row){
|
|
this.itemId = row ? row.id : null
|
|
this.itemId = row ? row.id : null
|
|
|
|
+ this.nowData = row ? row : null
|
|
this.openModal = true
|
|
this.openModal = true
|
|
},
|
|
},
|
|
|
|
+ // 新增/编辑 成功
|
|
|
|
+ handleOk(){
|
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
|
+ },
|
|
// 关闭弹框
|
|
// 关闭弹框
|
|
closeModal(){
|
|
closeModal(){
|
|
this.itemId = ''
|
|
this.itemId = ''
|
|
|
|
+ this.nowData = null
|
|
this.openModal = false
|
|
this.openModal = false
|
|
},
|
|
},
|
|
// 启用 禁用
|
|
// 启用 禁用
|
|
changeStatus (record) {
|
|
changeStatus (record) {
|
|
|
|
+ const _this = this
|
|
const _data = {
|
|
const _data = {
|
|
id: record.id,
|
|
id: record.id,
|
|
- flag: record.loginFlag ? '1' : '0'
|
|
|
|
|
|
+ enabledFlag: record.enabledFlag == 1 ? '0' : '1'
|
|
}
|
|
}
|
|
- // updateEnableStatus(_data).then(res => {
|
|
|
|
- // if (res.status === 200) {
|
|
|
|
- // this.$message.success(res.message)
|
|
|
|
- // } else {
|
|
|
|
- // record.loginFlag = !record.loginFlag
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
|
|
+ dealerProductBrandUpdate(_data).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ _this.$message.success(res.message)
|
|
|
|
+ _this.$refs.table.refresh()
|
|
|
|
+ } else {
|
|
|
|
+ record.enabledFlag = !record.enabledFlag
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 导入
|
|
// 导入
|
|
handleImport(){},
|
|
handleImport(){},
|
|
@@ -151,8 +140,4 @@ export default {
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style lang="less">
|
|
|
|
- .productBrandList-wrap{
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-</style>
|
|
|
|
|
|
+<style lang="less"></style>
|