Commit be1ebc61 authored by 黄卓's avatar 黄卓

品牌图片上传和分页

parent 1a9aad01
......@@ -73,7 +73,7 @@ export default {
number: 0,
uploadList: [],
baseUrl: process.env.VUE_APP_BASE_API,
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
uploadFileUrl: process.env.VUE_APP_BASE_API + "/app-api/file/upload", // 上传的文件服务器地址
headers: {
Authorization: "Bearer " + getToken(),
},
......@@ -152,7 +152,8 @@ export default {
},
// 上传成功回调
handleUploadSuccess(res) {
this.uploadList.push({ name: res.fileName, url: res.fileName });
// todo 接口返回值没有文件名
this.uploadList.push({ name: res.data, url: res.data });
if (this.uploadList.length === this.number) {
this.fileList = this.fileList.concat(this.uploadList);
this.uploadList = [];
......
......@@ -10,7 +10,7 @@
<el-tab-pane label="未授权客户" name="first">
<el-form :inline="true" class="demo-form-inline">
<el-form-item label="关键字">
<el-input v-model="customerKey" placeholder="审批人"></el-input>
<el-input v-model="list1QueryParams.customerKey" placeholder="请填入关键字"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="filterCustomer">查询</el-button>
......@@ -36,6 +36,9 @@
</template>
</el-table-column>
</el-table>
<pagination v-show="total1 > 0" :total="total1" :page.sync="list1QueryParams.pageNo" :limit.sync="list1QueryParams.pageSize"
@pagination="getList1" style="height: 40px"/>
</el-tab-pane>
<el-tab-pane label="已授权客户" name="second">
<el-table
......@@ -57,10 +60,14 @@
</template>
</el-table-column>
</el-table>
<pagination v-show="total2 > 0" :total="total2" :page.sync="list2QueryParams.pageNo" :limit.sync="list2QueryParams.pageSize"
@pagination="getList2" style="height: 40px"/>
</el-tab-pane>
</el-tabs>
</el-dialog>
<!-- 添加弹窗 -->
<el-dialog
title="添加"
:visible.sync="addDialog.dialogVisible"
......@@ -81,7 +88,9 @@
<el-form-item label="收费模式">
<dict-selector v-model="addDialog.form.feeScale" :type="DICT_TYPE.BRAND_CUSTOMER_CHARGING_MODEL"></dict-selector>
</el-form-item>
<el-form-item label="授权证明"></el-form-item>
<el-form-item label="授权证明">
<file-upload v-model="addDialog.form.fileUrl"></file-upload>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="addDialog.dialogVisible = false">取 消</el-button>
......@@ -100,11 +109,13 @@ import {
} from "@/api/ecw/productBrandEmpower"
import DictSelector from "@/components/DictSelector"
import {DICT_TYPE} from "@/utils/dict"
import FileUpload from '@/components/FileUpload'
export default {
name: "Empower",
components: {
DictSelector
DictSelector,
FileUpload
},
props: {
id: {
......@@ -122,9 +133,19 @@ export default {
DICT_TYPE,
dialogVisible: false,
activeName: 'first',
customerKey: '',
total1: 0,
total2: 0,
list1: [],
list2: [],
list1QueryParams: {
pageNo: 2,
pageSize: 10,
customerKey: undefined
},
list2QueryParams: {
pageNo: 1,
pageSize: 10,
},
addDialog: {
dialogVisible: false,
......@@ -153,13 +174,18 @@ export default {
this.addDialog.dialogVisible = false
this.getList1()
this.getList2()
this.resetForm("form");
})
},
handleDatePick(e){
console.log(e)
},
handleClose() {},
filterCustomer() {},
filterCustomer() {
this.list1QueryParams.pageNo = 1
this.getList1()
},
handleAdd(row) {
this.addDialog.form.customerId = row.customerId
this.addDialog.form.customerName = row.customerName
......@@ -171,12 +197,13 @@ export default {
})
},
getList1(){
getProductBrandEmpowerPageUnauth({productBrandId: this.id}).then(r => {
getProductBrandEmpowerPageUnauth({...this.list1QueryParams, productBrandId: this.id}).then(r => {
this.list1 = r.data.list
this.total1 = r.data.total
})
},
getList2() {
getProductBrandEmpowerPageAuth({productBrandId: this.id}).then(r => {
getProductBrandEmpowerPageAuth({...this.list2QueryParams, productBrandId: this.id}).then(r => {
this.list2 = r.data.list
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment