Commit 7a990755 authored by yaya's avatar yaya

feat: 优化货品售出功能

parent a252c961
...@@ -23,7 +23,7 @@ export function identifyImage(params) { ...@@ -23,7 +23,7 @@ export function identifyImage(params) {
} }
export function finishValue(params) { export function finishValue(params) {
return request({ return request({
url: '/consignSaleManage/finish', url: '/consignSaleManage/finishSale',
method: 'post', method: 'post',
data: params 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 @@ ...@@ -100,27 +100,13 @@
:sale-id="saleId" :sale-id="saleId"
@cancelIdentifyDialog="identifyValueDialogShow = false" @cancelIdentifyDialog="identifyValueDialogShow = false"
@refreshList="handleGetDetail"/> @refreshList="handleGetDetail"/>
<el-dialog <SaleConsignDialog
v-if="finishDialogShow" v-if="finishDialogShow"
:visible.sync="finishDialogShow" :finish-dialog-show="finishDialogShow"
width="600px" :sale-id="saleId"
height="800px" @cancelDialog="finishDialogShow = false"
title="货品售出"> @refreshList="handleGetDetail"
<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>
<el-dialog <el-dialog
v-if="cancelConsignDialogShow" v-if="cancelConsignDialogShow"
:visible.sync="cancelConsignDialogShow" :visible.sync="cancelConsignDialogShow"
...@@ -146,7 +132,7 @@ ...@@ -146,7 +132,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <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> <el-button type="primary" @click="handleCancelValue"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
...@@ -163,16 +149,17 @@ ...@@ -163,16 +149,17 @@
</template> </template>
<script> <script>
import { findDetail, confirmReceive, finishValue, cancelValue } from '@/api/business/consign' import { findDetail, confirmReceive, cancelValue } from '@/api/business/consign'
import { MessageBox } from 'element-ui' import { MessageBox } from 'element-ui'
import CheckLargeImageDialog from '../goods/components/CheckLargeImageDialog' import CheckLargeImageDialog from '../goods/components/CheckLargeImageDialog'
import CheckVideoDialog from '../goods/components/CheckVideoDialog' import CheckVideoDialog from '../goods/components/CheckVideoDialog'
import IdentifyValueDialog from './components/IdentifyValueDialog' import IdentifyValueDialog from './components/IdentifyValueDialog'
import ImageValueDialog from './components/ImageValueDialog' import ImageValueDialog from './components/ImageValueDialog'
import SaleConsignDialog from './components/SaleConsignDialog'
export default { export default {
name: 'ConsignDetail', name: 'ConsignDetail',
components: { ImageValueDialog, IdentifyValueDialog, CheckVideoDialog, CheckLargeImageDialog }, components: { SaleConsignDialog, ImageValueDialog, IdentifyValueDialog, CheckVideoDialog, CheckLargeImageDialog },
data() { data() {
return { return {
saleId: '', saleId: '',
...@@ -192,24 +179,7 @@ export default { ...@@ -192,24 +179,7 @@ export default {
identifyValueDialogShow: false, identifyValueDialogShow: false,
// 货品售出 // 货品售出
finishForm: {
dealPrice: '',
remark: ''
},
finishDialogShow: false, finishDialogShow: false,
finishRules: {
dealPrice: [
{ required: true, message: '成交金额不能为空', trigger: 'blur' },
{
pattern: /^[1-9]\d*$/,
message:
'格式不正确,请输入正整数!'
}
],
remark: [
{ required: true, message: '原因不能为空', trigger: 'blur' }
]
},
// 取消 // 取消
cancelForm: { cancelForm: {
content: '', content: '',
...@@ -314,37 +284,6 @@ export default { ...@@ -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 @@ ...@@ -132,25 +132,13 @@
@cancelIdentifyDialog="identifyValueDialogShow = false" @cancelIdentifyDialog="identifyValueDialogShow = false"
@refreshList="getList" @refreshList="getList"
/> />
<el-dialog <SaleConsignDialog
v-if="finishDialogShow" v-if="finishDialogShow"
:visible.sync="finishDialogShow" :sale-id="currentSaleId"
width="600px" :finish-dialog-show="finishDialogShow"
height="800px" @cancelDialog="finishDialogShow = false"
title="货品售出"> @refreshList="getList"
<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>
<el-dialog <el-dialog
v-if="cancelConsignDialogShow" v-if="cancelConsignDialogShow"
:visible.sync="cancelConsignDialogShow" :visible.sync="cancelConsignDialogShow"
...@@ -186,14 +174,16 @@ ...@@ -186,14 +174,16 @@
<script> <script>
import Line2Hidden from '@/components/line2Hidden' import Line2Hidden from '@/components/line2Hidden'
import Pagination from '@/components/Pagination' 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 { MessageBox } from 'element-ui'
import IdentifyValueDialog from './components/IdentifyValueDialog' import IdentifyValueDialog from './components/IdentifyValueDialog'
import ImageValueDialog from './components/ImageValueDialog' import ImageValueDialog from './components/ImageValueDialog'
import SaleConsignDialog from './components/SaleConsignDialog'
export default { export default {
name: 'ConsignList', name: 'ConsignList',
components: { components: {
SaleConsignDialog,
ImageValueDialog, ImageValueDialog,
IdentifyValueDialog, IdentifyValueDialog,
Pagination, Pagination,
...@@ -242,27 +232,10 @@ export default { ...@@ -242,27 +232,10 @@ export default {
imageValueDialogShow: false, imageValueDialogShow: false,
// 建议寄售价 // 建议寄售价
identifyValueDialogShow: false, identifyValueDialogShow: false,
currentSaleId: '',
// 货品售出 // 货品售出
finishForm: {
dealPrice: '',
remark: ''
},
finishDialogShow: false, finishDialogShow: false,
finishRules: { currentSaleId: '',
dealPrice: [
{ required: true, message: '成交金额不能为空', trigger: 'blur' },
{
pattern: /^[1-9]\d*$/,
message:
'格式不正确,请输入正整数!'
}
],
remark: [
{ required: true, message: '原因不能为空', trigger: 'blur' }
]
},
// 取消 // 取消
cancelForm: { cancelForm: {
content: '', content: '',
...@@ -397,6 +370,7 @@ export default { ...@@ -397,6 +370,7 @@ export default {
handleFinishDialogShow(item) { handleFinishDialogShow(item) {
this.finishDialogShow = true this.finishDialogShow = true
this.itemContent = item this.itemContent = item
this.currentSaleId = item.saleId
}, },
/** /**
* 待用户结款 * 待用户结款
...@@ -405,34 +379,6 @@ export default { ...@@ -405,34 +379,6 @@ export default {
this.finishDialogShow = true this.finishDialogShow = true
this.itemContent = item 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