Commit 7a990755 authored by yaya's avatar yaya

feat: 优化货品售出功能

parent a252c961
......@@ -23,7 +23,7 @@ export function identifyImage(params) {
}
export function finishValue(params) {
return request({
url: '/consignSaleManage/finish',
url: '/consignSaleManage/finishSale',
method: 'post',
data: params
})
......
<template>
<el-dialog
v-if="finishDialogShow"
:visible.sync="finishDialogShow"
:before-close="handleCancelFinishDialog"
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" type="number" 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>
</template>
<script>
import { MessageBox } from 'element-ui'
import { finishValue } from '@/api/business/consign'
export default {
name: 'SaleConsignDialog',
props: {
finishDialogShow: {
type: Boolean,
default: false
},
saleId: {
type: String,
default: ''
}
},
data() {
return {
// 货品售出
finishForm: {
dealPrice: '',
remark: ''
},
finishRules: {
dealPrice: [
{ required: true, message: '成交金额不能为空', trigger: 'blur' },
{
pattern: /^[1-9]\d*$/,
message:
'格式不正确,请输入正整数!'
}
],
remark: [
{ required: true, message: '原因不能为空', trigger: 'blur' }
]
}
}
},
methods: {
handleCancelFinishDialog() {
this.$emit('cancelDialog')
},
/**
* 实物评估
*/
handleFinishValue() {
if (this.saleId) {
const params = { ...this.finishForm, saleId: this.saleId }
this.$refs.finish.validate((valid) => {
if (valid) {
finishValue(params)
.then(response => {
this.$notify.success({
message: '货品售出成功'
})
this.$emit('refreshList')
this.$emit('cancelDialog')
})
.catch(response => {
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
confirmButtonText: '确定',
type: 'error'
})
})
}
})
}
}
}
}
</script>
<style lang="scss" scoped>
.content {
width: 100%;
text-align: center;
}
.image {
width: 400px;
height: auto;
}
</style>
......@@ -100,27 +100,13 @@
:sale-id="saleId"
@cancelIdentifyDialog="identifyValueDialogShow = false"
@refreshList="handleGetDetail"/>
<el-dialog
<SaleConsignDialog
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" type="number" 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>
:finish-dialog-show="finishDialogShow"
:sale-id="saleId"
@cancelDialog="finishDialogShow = false"
@refreshList="handleGetDetail"
/>
<el-dialog
v-if="cancelConsignDialogShow"
:visible.sync="cancelConsignDialogShow"
......@@ -146,7 +132,7 @@
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancelFinishDialog"> </el-button>
<el-button @click="cancelConsignDialogShow = false"> </el-button>
<el-button type="primary" @click="handleCancelValue"> </el-button>
</div>
</el-dialog>
......@@ -163,16 +149,17 @@
</template>
<script>
import { findDetail, confirmReceive, finishValue, cancelValue } from '@/api/business/consign'
import { findDetail, confirmReceive, cancelValue } from '@/api/business/consign'
import { MessageBox } from 'element-ui'
import CheckLargeImageDialog from '../goods/components/CheckLargeImageDialog'
import CheckVideoDialog from '../goods/components/CheckVideoDialog'
import IdentifyValueDialog from './components/IdentifyValueDialog'
import ImageValueDialog from './components/ImageValueDialog'
import SaleConsignDialog from './components/SaleConsignDialog'
export default {
name: 'ConsignDetail',
components: { ImageValueDialog, IdentifyValueDialog, CheckVideoDialog, CheckLargeImageDialog },
components: { SaleConsignDialog, ImageValueDialog, IdentifyValueDialog, CheckVideoDialog, CheckLargeImageDialog },
data() {
return {
saleId: '',
......@@ -192,24 +179,7 @@ export default {
identifyValueDialogShow: false,
// 货品售出
finishForm: {
dealPrice: '',
remark: ''
},
finishDialogShow: false,
finishRules: {
dealPrice: [
{ required: true, message: '成交金额不能为空', trigger: 'blur' },
{
pattern: /^[1-9]\d*$/,
message:
'格式不正确,请输入正整数!'
}
],
remark: [
{ required: true, message: '原因不能为空', trigger: 'blur' }
]
},
// 取消
cancelForm: {
content: '',
......@@ -314,37 +284,6 @@ export default {
})
})
},
// 取消完成寄售
handleCancelFinishDialog() {
this.finishDialogShow = false
},
/**
* 完成寄售
*/
handleFinishValue() {
if (this.saleId) {
const params = { ...this.finishForm, saleId: this.saleId }
this.$refs.finish.validate((valid) => {
if (valid) {
finishValue(params)
.then(response => {
this.finishDialogShow = false
this.finishForm = {}
this.$notify.success({
message: '完成寄售成功'
})
this.handleGetDetail()
})
.catch(response => {
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
confirmButtonText: '确定',
type: 'error'
})
})
}
})
}
},
/**
* 取消寄售
*/
......
......@@ -132,25 +132,13 @@
@cancelIdentifyDialog="identifyValueDialogShow = false"
@refreshList="getList"
/>
<el-dialog
<SaleConsignDialog
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" type="number" 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>
:sale-id="currentSaleId"
:finish-dialog-show="finishDialogShow"
@cancelDialog="finishDialogShow = false"
@refreshList="getList"
/>
<el-dialog
v-if="cancelConsignDialogShow"
:visible.sync="cancelConsignDialogShow"
......@@ -186,14 +174,16 @@
<script>
import Line2Hidden from '@/components/line2Hidden'
import Pagination from '@/components/Pagination'
import { findConsignList, confirmReceive, identifyImage, finishValue, cancelValue } from '@/api/business/consign'
import { findConsignList, confirmReceive, identifyImage, cancelValue } from '@/api/business/consign'
import { MessageBox } from 'element-ui'
import IdentifyValueDialog from './components/IdentifyValueDialog'
import ImageValueDialog from './components/ImageValueDialog'
import SaleConsignDialog from './components/SaleConsignDialog'
export default {
name: 'ConsignList',
components: {
SaleConsignDialog,
ImageValueDialog,
IdentifyValueDialog,
Pagination,
......@@ -242,27 +232,10 @@ export default {
imageValueDialogShow: false,
// 建议寄售价
identifyValueDialogShow: false,
currentSaleId: '',
// 货品售出
finishForm: {
dealPrice: '',
remark: ''
},
finishDialogShow: false,
finishRules: {
dealPrice: [
{ required: true, message: '成交金额不能为空', trigger: 'blur' },
{
pattern: /^[1-9]\d*$/,
message:
'格式不正确,请输入正整数!'
}
],
remark: [
{ required: true, message: '原因不能为空', trigger: 'blur' }
]
},
currentSaleId: '',
// 取消
cancelForm: {
content: '',
......@@ -397,6 +370,7 @@ export default {
handleFinishDialogShow(item) {
this.finishDialogShow = true
this.itemContent = item
this.currentSaleId = item.saleId
},
/**
* 待用户结款
......@@ -405,34 +379,6 @@ export default {
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'
})
})
}
})
}
},
/**
* 取消寄售
*/
......
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