Commit bed4a43c authored by yaya's avatar yaya

添加寄售功能

parent 4df67a3e
import request from '@/utils/request'
export function findConsignList(params) {
return request({
url: '/consignSaleManage/findList',
method: 'post',
data: params
})
}
export function imgValuate(params) {
return request({
url: '/consignSaleManage/imgValuate',
method: 'post',
data: params
})
}
export function identifyImage(params) {
return request({
url: '/consignSaleManage/identify',
method: 'post',
data: params
})
}
export function finishValue(params) {
return request({
url: '/consignSaleManage/finish',
method: 'post',
data: params
})
}
export function cancelValue(params) {
return request({
url: '/consignSaleManage/cancel',
method: 'post',
data: params
})
}
<template>
<div>
详情
</div>
</template>
<script>
export default {
name: 'ConsignDetail'
}
</script>
<style scoped>
</style>
<template>
<div class="page_consignList">
<el-tabs v-model="listQuery.systemState" @tab-click="handleClick">
<el-tab-pane v-for="item in tabList" :label="item.label" :name="item.name" :key="item.label" />
</el-tabs>
<div class="filter-item" style="margin-bottom: 20px">
<el-input
v-model="listQuery.saleId"
clearable
size="mini"
class="filter-item"
style="width: 200px;margin-right: 10px"
placeholder="请输入寄售单号进行搜索" />
<el-button size="mini" class="filter-item" type="primary" @click="handlerGetList">查询</el-button>
</div>
<el-table
v-loading="listLoading"
:data="list"
size="small"
element-loading-text="正在查询中..."
border
fit
highlight-current-row>
<!-- <el-table-column align="center" label="排行" width="100px" type="index" />-->
<el-table-column align="center" min-width="100px" prop="saleId" label="寄售单号" />
<el-table-column align="center" label="图片" prop="itemImg">
<template slot-scope="scope">
<img v-if="scope.row.itemImg" :src="scope.row.itemImg" width="60px" height="60px">
</template>
</el-table-column>
<el-table-column align="center" label="名称" prop="itemName" />
<el-table-column align="center" label="状态" prop="systemStateName" />
<el-table-column align="center" label="下单时间" prop="saleTime" />
<el-table-column align="center" label="操作" width="300">
<template slot-scope="scope">
<el-button
type="primary"
size="mini"
@click="handleToDetail(scope.row)">详情
</el-button>
<el-button
v-if="scope.row.systemState === 1"
type="primary"
size="mini"
@click="handleImageValueDialogShow(scope.row)">图文评估
</el-button>
<el-button
v-if="scope.row.systemState === 8"
type="primary"
size="mini"
@click="handleIdentifyValueDialogShow(scope.row)">实物估价
</el-button>
<el-button
v-if="scope.row.systemState === 10"
type="primary"
size="mini"
@click="handleFinishDialogShow(scope.row)">完成寄售
</el-button>
<el-button
v-if="scope.row.systemState < 20"
type="danger"
size="mini"
@click="handleCancelDialogShow(scope.row)">取消寄售
</el-button>
</template>
</el-table-column>
</el-table>
<Pagination
v-show="total>0"
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.size"
@pagination="getList" />
<el-dialog
v-if="imageValueDialogShow"
:visible.sync="imageValueDialogShow"
width="600px"
height="800px"
title="图文评估">
<el-form ref="imageValue" :model="imageValueForm" :rules="imageValueRules">
<el-form-item label="估价" label-width="60px" prop="imgValuation">
<el-input v-model="imageValueForm.imgValuation" maxlength="10" style="width: 400px" placeholder="请输入估价金额" />
</el-form-item>
<el-form-item label="理由" label-width="60px" prop="remark">
<el-input
v-model="imageValueForm.remark"
:autosize="{ minRows: 8, maxRows: 8}"
maxlength="100"
type="textarea"
show-word-limit
placeholder="请输入理由"
style="width: 400px" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancelImageValueDialog">取 消</el-button>
<el-button type="primary" @click="handleImageValue">确 定</el-button>
</div>
</el-dialog>
<el-dialog
v-if="identifyValueDialogShow"
:visible.sync="identifyValueDialogShow"
width="600px"
height="800px"
title="实物估价">
<el-form ref="identifyValue" :model="identifyValueForm" :rules="identifyValueRules">
<el-form-item label="估价" label-width="60px" prop="valuation">
<el-input v-model="identifyValueForm.valuation" style="width: 400px" maxlength="10" placeholder="请输入估价金额" ><template slot="append"></template></el-input>
</el-form-item>
<el-form-item label="理由" label-width="60px" prop="remark">
<el-input
v-model="identifyValueForm.remark"
:autosize="{ minRows: 8, maxRows: 8}"
maxlength="100"
type="textarea"
show-word-limit
placeholder="请输入理由(最多不超过100个字)"
style="width: 400px" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancelIdentifyDialog">取 消</el-button>
<el-button type="primary" @click="handleIdentifyValue">确 定</el-button>
</div>
</el-dialog>
<el-dialog
v-if="finishDialogShow"
:visible.sync="finishDialogShow"
width="600px"
height="800px"
title="完成寄售">
<el-form ref="finish" :model="finishForm" :rules="finishRules">
<el-form-item label="成交金额" label-width="80px" prop="dealPrice">
<el-input v-model="finishForm.dealPrice" style="width: 400px" maxlength="10" placeholder="请输入成交金额" ><template slot="append"></template></el-input>
</el-form-item>
<el-form-item label="成交平台" label-width="80px" prop="remark">
<el-input v-model="finishForm.remark" style="width: 400px" maxlength="10" placeholder="请输入成交平台" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancelFinishDialog">取 消</el-button>
<el-button type="primary" @click="handleFinishValue">确 定</el-button>
</div>
</el-dialog>
<el-dialog
v-if="cancelConsignDialogShow"
:visible.sync="cancelConsignDialogShow"
width="600px"
height="800px"
title="取消寄售">
<el-form ref="cancel" :model="cancelForm" :rules="cancelRules">
<el-form-item label="拒绝类型" label-width="80px" prop="content">
<el-select v-model="cancelForm.content" placeholder="请选择拒绝类型">
<el-option label="平台取消寄售" value="平台取消寄售"/>
<el-option label="用户取消寄售" value="用户取消寄售"/>
</el-select>
</el-form-item>
<el-form-item label="理由" label-width="80px" prop="remark">
<el-input
v-model="cancelForm.remark"
:autosize="{ minRows: 8, maxRows: 8}"
style="width: 400px"
maxlength="100"
type="textarea"
show-word-limit
placeholder="请输入理由(最多不超过100个字)" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancelFinishDialog">取 消</el-button>
<el-button type="primary" @click="handleCancelValue">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
import { findConsignList, imgValuate, identifyImage, finishValue, cancelValue } from '@/api/business/consign'
import { MessageBox } from 'element-ui'
export default {
name: 'ConsignList',
components: {
Pagination
},
data() {
return {
tabList: [
{
label: '待图文估价',
name: '1'
}, {
label: '实物鉴定',
name: '8'
}, {
label: '寄售中',
name: '10'
}, {
label: '已完成',
name: '20'
}, {
label: '已取消',
name: '30'
}
],
listLoading: true,
listQuery: {
page: 1,
size: 20,
saleId: '',
systemState: '1'
},
list: [],
total: 0,
imageValueForm: {
imgValuation: '',
remark: ''
},
imageValueDialogShow: false,
imageValueRules: {
imgValuation: [
{ required: true, message: '估价金额不能为空', trigger: 'blur' }
],
remark: [
{ required: true, message: '原因不能为空', trigger: 'blur' }
]
},
// 实物估价
identifyValueForm: {
valuation: '',
remark: ''
},
identifyValueDialogShow: false,
identifyValueRules: {
valuation: [
{ required: true, message: '估价金额不能为空', trigger: 'blur' }
],
remark: [
{ required: true, message: '原因不能为空', trigger: 'blur' }
]
},
// 完成寄售
finishForm: {
dealPrice: '',
remark: ''
},
finishDialogShow: false,
finishRules: {
dealPrice: [
{ required: true, message: '成交金额不能为空', trigger: 'blur' }
],
remark: [
{ required: true, message: '原因不能为空', trigger: 'blur' }
]
},
// 取消
cancelForm: {
content: '',
remark: ''
},
cancelConsignDialogShow: false,
cancelRules: {
content: [
{ required: true, message: '请选择取消类型', trigger: 'blur' }
],
remark: [
{ required: true, message: '原因不能为空', trigger: 'blur' }
]
},
itemContent: {}
}
},
created() {
this.getList()
},
methods: {
handlerGetList() {
this.listQuery.page = 1
this.getList()
},
handleClick(tab, event) {
this.listQuery.page = 1
this.getList()
},
getList() {
this.listLoading = true
findConsignList(this.listQuery).then(response => {
this.list = response.data.data.dataList
this.total = response.data.data.total
this.listLoading = false
}).catch((e) => {
this.list = []
this.total = 0
this.listLoading = false
})
},
/**
* 详情
*/
handleToDetail() {
},
/**
* 图文评估
*/
handleImageValueDialogShow(item) {
this.imageValueDialogShow = true
this.itemContent = item
},
/**
* 图文评估
*/
handleImageValue() {
if (this.itemContent) {
const params = { ...this.imageValueForm, saleId: this.itemContent.saleId }
this.$refs.imageValue.validate((valid) => {
if (valid) {
imgValuate(params)
.then(response => {
this.itemContent = {}
this.imageValueDialogShow = false
this.imageValueForm = {}
this.$notify.success({
message: '图文估价成功'
})
this.getList()
})
.catch(response => {
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
confirmButtonText: '确定',
type: 'error'
})
})
}
})
}
},
// 取消图文估价
handleCancelImageValueDialog() {
this.imageValueDialogShow = false
this.itemContent = {}
this.imageValueForm = {}
},
// 取消实物评估
handleCancelIdentifyDialog() {
this.identifyValueDialogShow = false
this.itemContent = {}
this.identifyValueForm = {}
},
// 取消完成寄售
handleCancelFinishDialog() {
this.finishDialogShow = false
this.itemContent = {}
this.finishForm = {}
},
/**
* 实物评估
*/
handleIdentifyValueDialogShow(item) {
this.identifyValueDialogShow = true
this.itemContent = item
},
/**
* 实物评估
*/
handleIdentifyValue() {
if (this.itemContent) {
const params = { ...this.identifyValueForm, saleId: this.itemContent.saleId }
this.$refs.identifyValue.validate((valid) => {
if (valid) {
identifyImage(params)
.then(response => {
this.itemContent = {}
this.identifyValueDialogShow = false
this.identifyValueForm = {}
this.$notify.success({
message: '实物评估成功'
})
this.getList()
})
.catch(response => {
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
confirmButtonText: '确定',
type: 'error'
})
})
}
})
}
},
/**
* 完成寄售
*/
handleFinishDialogShow(item) {
this.finishDialogShow = true
this.itemContent = item
},
/**
* 完成寄售
*/
handleFinishValue() {
if (this.itemContent) {
const params = { ...this.finishForm, saleId: this.itemContent.saleId }
this.$refs.finish.validate((valid) => {
if (valid) {
finishValue(params)
.then(response => {
this.itemContent = {}
this.finishDialogShow = false
this.finishForm = {}
this.$notify.success({
message: '完成寄售成功'
})
this.getList()
})
.catch(response => {
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
confirmButtonText: '确定',
type: 'error'
})
})
}
})
}
},
/**
* 取消寄售
*/
handleCancelDialogShow(item) {
this.cancelConsignDialogShow = true
this.itemContent = item
},
/**
* 取消寄售
*/
handleCancelValue() {
if (this.itemContent) {
const params = { ...this.cancelForm, saleId: this.itemContent.saleId }
this.$refs.cancel.validate((valid) => {
if (valid) {
cancelValue(params)
.then(response => {
this.itemContent = {}
this.cancelConsignDialogShow = false
this.cancelForm = {}
this.$notify.success({
message: '取消寄售成功'
})
this.getList()
})
.catch(response => {
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
confirmButtonText: '确定',
type: 'error'
})
})
}
})
}
}
}
}
</script>
<style scoped>
.page_consignList {
padding: 0 20px 20px;
}
</style>
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