|
@@ -215,6 +215,7 @@ export default {
|
|
|
wrapperCol: { span: 16 }
|
|
|
},
|
|
|
buyerSnBak: '', // 更改前客户sn备份
|
|
|
+ priceTypeBak: '', // 更改前客户价格类型备份
|
|
|
form: {
|
|
|
buyerName: '', // 客户名称
|
|
|
buyerSn: undefined, // 客户sn
|
|
@@ -340,6 +341,7 @@ export default {
|
|
|
if (data.shippingAddressCitySn) { this.getArea('district', data.shippingAddressCitySn) }
|
|
|
this.form = Object.assign(this.form, data)
|
|
|
this.buyerSnBak = this.form.buyerSn
|
|
|
+ this.priceTypeBak = this.form.priceType
|
|
|
},
|
|
|
// 获取详情
|
|
|
getDetail () {
|
|
@@ -366,6 +368,8 @@ export default {
|
|
|
priceType: data.priceType, // 价格类型
|
|
|
settleStyleSn: data.settleStyleSn // 收款方式
|
|
|
})
|
|
|
+ // this.buyerSnBak = this.form.buyerSn
|
|
|
+ // this.priceTypeBak = this.form.priceType
|
|
|
} else {
|
|
|
this.$message.error('获取客户信息失败')
|
|
|
this.$refs.ruleForm.resetFields()
|
|
@@ -403,11 +407,29 @@ export default {
|
|
|
const _this = this
|
|
|
this.$refs.ruleForm.validate(valid => {
|
|
|
if (valid) {
|
|
|
- // 保存客户信息
|
|
|
- _this.handleSaveCust()
|
|
|
- // 保存销售单
|
|
|
- if (_this.form.buyerSn) {
|
|
|
- _this.salesSaveFun()
|
|
|
+ console.log(_this.priceTypeBak, _this.form.priceType)
|
|
|
+ // 如果价格类型改变,提示
|
|
|
+ if (_this.priceTypeBak != _this.form.priceType) {
|
|
|
+ this.$confirm({
|
|
|
+ title: '提示',
|
|
|
+ content: '价格类型变更,确认提交吗?',
|
|
|
+ centered: true,
|
|
|
+ onOk () {
|
|
|
+ // 保存客户信息
|
|
|
+ _this.handleSaveCust()
|
|
|
+ // 保存销售单
|
|
|
+ if (_this.form.buyerSn) {
|
|
|
+ _this.salesSaveFun()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ // 保存客户信息
|
|
|
+ _this.handleSaveCust()
|
|
|
+ // 保存销售单
|
|
|
+ if (_this.form.buyerSn) {
|
|
|
+ _this.salesSaveFun()
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
console.log('error submit!!')
|
|
@@ -425,7 +447,7 @@ export default {
|
|
|
_this.$message.success(res.message)
|
|
|
_this.$emit('ok', res.data)
|
|
|
if (_this.form.id) {
|
|
|
- _this.$emit('updateData')
|
|
|
+ _this.$emit('updateData', form.priceType)
|
|
|
}
|
|
|
_this.cancel()
|
|
|
}
|
|
@@ -433,8 +455,8 @@ export default {
|
|
|
},
|
|
|
cancel () {
|
|
|
this.opened = false
|
|
|
- this.$refs.ruleForm.resetFields()
|
|
|
this.$emit('cancel')
|
|
|
+ this.$refs.ruleForm.resetFields()
|
|
|
},
|
|
|
// 客户无分页列表数据
|
|
|
getCustAllList () {
|