|
|
@ -2,7 +2,7 @@ |
|
|
|
<div class="app-container"> |
|
|
|
<div> |
|
|
|
<div class="tab-header webtop"> |
|
|
|
<div>{{viewTitle}}</div> |
|
|
|
<div>{{ viewTitle }}</div> |
|
|
|
<div> |
|
|
|
<el-button type="primary" size="small" :disabled="FormLoading" @click="handleCreate()">保存</el-button> |
|
|
|
<el-button type="primary" size="small" :disabled="disabled" @click="handleSubmit()">提交</el-button> |
|
|
@ -21,12 +21,7 @@ |
|
|
|
<el-col :span="8" class="trightb"> |
|
|
|
<el-form-item> |
|
|
|
<el-select v-model="temp.salesPolicy" placeholder="请选择" @change="salesPolicyChange"> |
|
|
|
<el-option |
|
|
|
v-for="item in salesPolicy_list" |
|
|
|
:key="item.dictKey" |
|
|
|
:label="item.dictValue" |
|
|
|
:value="item.dictKey"> |
|
|
|
</el-option> |
|
|
|
<el-option v-for="item in salesPolicy_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
@ -36,12 +31,7 @@ |
|
|
|
<el-col :span="8" class="trightb"> |
|
|
|
<el-form-item> |
|
|
|
<el-select v-model="temp.discountType" placeholder="请选择" @change="discountTypeChange"> |
|
|
|
<el-option |
|
|
|
v-for="item in discountType_list" |
|
|
|
:key="item.dictKey" |
|
|
|
:label="item.dictValue" |
|
|
|
:value="item.dictKey"> |
|
|
|
</el-option> |
|
|
|
<el-option v-for="item in discountType_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
@ -50,19 +40,27 @@ |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<el-form-item><span slot="label">优惠包名称</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="20" class="trightb"> |
|
|
|
<el-form-item> |
|
|
|
<el-input v-model="temp.projectName" class="addinputw" placeholder="" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<el-form-item><span slot="label">优惠包成本(元)</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8" class="trightb"> |
|
|
|
<el-form-item> |
|
|
|
<el-input v-model="temp.projectName" class="addinputw" placeholder="" |
|
|
|
clearable/> |
|
|
|
<el-input v-model="temp.projectCost" class="addinputw" placeholder="" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
|
<el-form-item><span slot="label">优惠包价值</span></el-form-item> |
|
|
|
<el-form-item><span slot="label">优惠包价值(元)</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8" class="trightb"> |
|
|
|
<el-form-item> |
|
|
|
<el-input v-model="temp.amount" class="addinputw" placeholder="" |
|
|
|
clearable/> |
|
|
|
<el-input v-model="temp.discountMoney" class="addinputw" placeholder="" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
@ -72,8 +70,7 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="20" class="trightb"> |
|
|
|
<el-form-item> |
|
|
|
<el-input v-model="temp.detail" class="addinputw" placeholder="" |
|
|
|
clearable/> |
|
|
|
<el-input v-model="temp.discountExplain" class="addinputw" placeholder="" clearable/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
@ -83,13 +80,7 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="8" class="trightb"> |
|
|
|
<el-form-item> |
|
|
|
<el-date-picker |
|
|
|
v-model="temp.effectiveDate" |
|
|
|
type="date" |
|
|
|
placeholder="选择日期" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
format="yyyy-MM-dd"> |
|
|
|
</el-date-picker> |
|
|
|
<el-date-picker v-model="temp.effectiveDate" type="date" placeholder="选择日期" value-format="yyyy-MM-dd" format="yyyy-MM-dd"></el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" class="tleftb"> |
|
|
@ -97,8 +88,8 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="8" class="trightb"> |
|
|
|
<el-form-item> |
|
|
|
<el-radio v-model="temp.isEmploy" label="0">是</el-radio> |
|
|
|
<el-radio v-model="temp.isEmploy" label="1">否</el-radio> |
|
|
|
<el-radio v-model="temp.isEmploy" label="1">是</el-radio> |
|
|
|
<el-radio v-model="temp.isEmploy" label="0">否</el-radio> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
@ -109,350 +100,331 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import {mapGetters} from 'vuex' |
|
|
|
import {save, update, fetchSid, typeValues, submitVehicleApprove} from '@/api/jichuxinxi/salepolicy' |
|
|
|
import {loginDetails} from '@/api/dictcommons/basemanufacturer' |
|
|
|
import {getStorage} from '@/utils/auth' |
|
|
|
import { save, update, fetchSid, typeValues, submitVehicleApprove } from '@/api/jichuxinxi/salepolicy' |
|
|
|
import { loginDetails } from '@/api/dictcommons/basemanufacturer' |
|
|
|
import { getStorage } from '@/utils/auth' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: "xiaoshouzhengceAdd", |
|
|
|
data() { |
|
|
|
return { |
|
|
|
viewTitle: '', |
|
|
|
index: 0, |
|
|
|
disabled: false, // 提交按钮状态 |
|
|
|
// --按钮菜单------- |
|
|
|
YongHuid: [], |
|
|
|
stateId: '0', |
|
|
|
FormLoading: false, |
|
|
|
listLoading: false, |
|
|
|
list: [], |
|
|
|
salesPolicy_list: [], //政策类别 |
|
|
|
discountType_list: [], // 优惠包类别 |
|
|
|
temp: { |
|
|
|
amount: '', //优惠包价值 |
|
|
|
detail: '', //优惠项目说明 |
|
|
|
discountName: '', //优惠包名称 |
|
|
|
discountType: '', //优惠类型(赠送套餐 等,数据字典) |
|
|
|
discountTypeKey: '', //优惠类型key |
|
|
|
effectiveDate: '', //有效期 |
|
|
|
isEmploy: '', //1 是 0 否有效 |
|
|
|
orderSid: '', //销售订单单据sid |
|
|
|
salesPolicy: '', //政策类别 |
|
|
|
salesPolicyKey: '', //政策类别key |
|
|
|
sid: '', //优惠情况sid |
|
|
|
useOrg: window.sessionStorage.getItem('Orgname'), //使用组织 |
|
|
|
userSid: window.sessionStorage.getItem('userSid') |
|
|
|
}, // 添加和修改 |
|
|
|
textMap: { |
|
|
|
update: '修改', |
|
|
|
create: '创建', |
|
|
|
}, |
|
|
|
submitDto: { |
|
|
|
businessSid: '', |
|
|
|
userSid: window.sessionStorage.getItem('userSid') |
|
|
|
}, |
|
|
|
xuniSid: '', |
|
|
|
mobile: '', |
|
|
|
orgName: '', |
|
|
|
staffName: '', |
|
|
|
_userSid: '', |
|
|
|
deposit_list: [], |
|
|
|
customerName: [], |
|
|
|
tificateT: [], |
|
|
|
dnumbDate: [], |
|
|
|
dialogStatus: '', // 对话框状态 |
|
|
|
rules: {}, |
|
|
|
// ------------------------------------ |
|
|
|
} |
|
|
|
export default { |
|
|
|
name: 'xiaoshouzhengceAdd', |
|
|
|
data() { |
|
|
|
return { |
|
|
|
viewTitle: '', |
|
|
|
index: 0, |
|
|
|
disabled: false, // 提交按钮状态 |
|
|
|
// --按钮菜单------- |
|
|
|
YongHuid: [], |
|
|
|
stateId: '0', |
|
|
|
FormLoading: false, |
|
|
|
listLoading: false, |
|
|
|
list: [], |
|
|
|
salesPolicy_list: [], // 政策类别 |
|
|
|
discountType_list: [], // 优惠包类别 |
|
|
|
temp: { |
|
|
|
projectName: '', |
|
|
|
discountMoney: '', // 优惠包价值 |
|
|
|
discountType: '', // 优惠类型(赠送套餐 等,数据字典) |
|
|
|
discountTypeKey: '', // 优惠类型key |
|
|
|
effectiveDate: '', // 有效期 |
|
|
|
isEmploy: '', // 1 是 0 否有效 |
|
|
|
orderSid: '', // 销售订单单据sid |
|
|
|
salesPolicy: '', // 政策类别 |
|
|
|
salesPolicyKey: '', // 政策类别key |
|
|
|
sid: '', // 优惠情况sid |
|
|
|
discountExplain: '', |
|
|
|
userSid: window.sessionStorage.getItem('userSid') |
|
|
|
}, // 添加和修改 |
|
|
|
textMap: { |
|
|
|
update: '修改', |
|
|
|
create: '创建' |
|
|
|
}, |
|
|
|
submitDto: { |
|
|
|
businessSid: '', |
|
|
|
userSid: window.sessionStorage.getItem('userSid') |
|
|
|
}, |
|
|
|
xuniSid: '', |
|
|
|
mobile: '', |
|
|
|
orgName: '', |
|
|
|
staffName: '', |
|
|
|
_userSid: '', |
|
|
|
deposit_list: [], |
|
|
|
customerName: [], |
|
|
|
tificateT: [], |
|
|
|
dnumbDate: [], |
|
|
|
dialogStatus: '', // 对话框状态 |
|
|
|
rules: {} |
|
|
|
// ------------------------------------ |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
// 初始化变量 |
|
|
|
this.init() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
init() { |
|
|
|
var token = getStorage() |
|
|
|
loginDetails(token).then((response) => { |
|
|
|
if (response.code === '200') { |
|
|
|
this.YongHuid = response.data |
|
|
|
this.orgName = this.YongHuid.departmentName |
|
|
|
this.staffName = this.YongHuid.name |
|
|
|
this._userSid = this.YongHuid.sid |
|
|
|
console.log('8888', this.YongHuid) |
|
|
|
} |
|
|
|
}) |
|
|
|
this.getType() |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
...mapGetters([ |
|
|
|
'id', |
|
|
|
'roles', |
|
|
|
'rolesIds', |
|
|
|
'departmentId', |
|
|
|
'departmentCode', |
|
|
|
]), |
|
|
|
showAdd() { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['dataForm'].clearValidate() |
|
|
|
}) |
|
|
|
this.dialogStatus = 'add' |
|
|
|
this.viewTitle = '【新增】销售政策管理' |
|
|
|
}, |
|
|
|
created() { |
|
|
|
// 初始化变量 |
|
|
|
this.init() |
|
|
|
showEdit(sid) { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['dataForm'].clearValidate() |
|
|
|
}) |
|
|
|
this.temp.sid = sid |
|
|
|
this.dialogStatus = 'edit' |
|
|
|
this.viewTitle = '【编辑】销售政策管理' |
|
|
|
console.log('编辑页面', sid) |
|
|
|
fetchSid(sid).then((response) => { |
|
|
|
if (response.code) { |
|
|
|
this.temp = response.data |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// ------------ 页面初始化 ------------ |
|
|
|
// 添加前数据初始化 |
|
|
|
resetTemp() { |
|
|
|
this.temp = {}; |
|
|
|
this.list = [] |
|
|
|
}, |
|
|
|
init() { |
|
|
|
var token = getStorage(); |
|
|
|
loginDetails(token).then((response) => { |
|
|
|
if (response.code === '200') { |
|
|
|
this.YongHuid = response.data; |
|
|
|
this.orgName = this.YongHuid.departmentName; |
|
|
|
this.staffName = this.YongHuid.name; |
|
|
|
this._userSid = this.YongHuid.sid; |
|
|
|
console.log('8888', this.YongHuid) |
|
|
|
} |
|
|
|
}); |
|
|
|
this.getType() |
|
|
|
}, |
|
|
|
showAdd() { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['dataForm'].clearValidate() |
|
|
|
}); |
|
|
|
this.dialogStatus = 'add'; |
|
|
|
this.viewTitle = '【新增】销售政策管理'; |
|
|
|
}, |
|
|
|
showEdit(sid) { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['dataForm'].clearValidate() |
|
|
|
}); |
|
|
|
this.temp.sid = sid |
|
|
|
this.dialogStatus = 'edit'; |
|
|
|
this.viewTitle = '【编辑】销售政策管理'; |
|
|
|
console.log('编辑页面', sid) |
|
|
|
fetchSid(sid).then((response) => { |
|
|
|
if (response.code) { |
|
|
|
this.temp = response.data |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 下拉框 |
|
|
|
getType() { |
|
|
|
typeValues({ |
|
|
|
type: 'discountPolicyType' |
|
|
|
}).then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
this.salesPolicy_list = res.data |
|
|
|
console.log('下拉框请求政策类别', this.salesPolicy_list) |
|
|
|
// 下拉框 |
|
|
|
getType() { |
|
|
|
typeValues({ |
|
|
|
type: 'discountPolicyType' |
|
|
|
}).then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
this.salesPolicy_list = res.data |
|
|
|
console.log('下拉框请求政策类别', this.salesPolicy_list) |
|
|
|
} |
|
|
|
}) |
|
|
|
typeValues({ |
|
|
|
type: 'discountPackageType' |
|
|
|
}).then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
this.discountType_list = res.data |
|
|
|
console.log('下拉框请求优惠包类别', this.discountType_list) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 政策类别 |
|
|
|
salesPolicyChange(value) { |
|
|
|
console.log('触发下拉框按钮') |
|
|
|
let bb = {} |
|
|
|
this.salesPolicy_list.forEach((e) => { |
|
|
|
if (e.dictKey === value) { |
|
|
|
bb = { |
|
|
|
type: e.dictType, |
|
|
|
name: e.dictValue, |
|
|
|
key: e.dictKey, |
|
|
|
sid: e.sid |
|
|
|
} |
|
|
|
}) |
|
|
|
typeValues({ |
|
|
|
type: 'discountPackageType' |
|
|
|
}).then((res) => { |
|
|
|
if (res.code === '200') { |
|
|
|
this.discountType_list = res.data |
|
|
|
console.log('下拉框请求优惠包类别', this.discountType_list) |
|
|
|
} |
|
|
|
}) |
|
|
|
this.temp.salesPolicy = bb.name |
|
|
|
this.temp.salesPolicyKey = bb.key |
|
|
|
console.log('name', this.temp.salesPolicy) |
|
|
|
}, |
|
|
|
|
|
|
|
// 优惠包类别 |
|
|
|
discountTypeChange(value) { |
|
|
|
console.log('触发下拉框按钮') |
|
|
|
let bb = {} |
|
|
|
this.discountType_list.forEach((e) => { |
|
|
|
if (e.dictKey === value) { |
|
|
|
bb = { |
|
|
|
type: e.dictType, |
|
|
|
name: e.dictValue, |
|
|
|
key: e.dictKey, |
|
|
|
sid: e.sid |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 政策类别 |
|
|
|
salesPolicyChange(value) { |
|
|
|
console.log('触发下拉框按钮') |
|
|
|
let bb = {} |
|
|
|
this.salesPolicy_list.forEach((e) => { |
|
|
|
if (e.dictKey === value) { |
|
|
|
bb = { |
|
|
|
type: e.dictType, |
|
|
|
name: e.dictValue, |
|
|
|
key: e.dictKey, |
|
|
|
sid: e.sid |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
this.temp.discountType = bb.name |
|
|
|
this.temp.discountTypeKey = bb.key |
|
|
|
console.log('name', this.temp.discountType) |
|
|
|
}, |
|
|
|
// ------------ 功能实现 ------------ |
|
|
|
// 添加数据 |
|
|
|
handleCreate() { |
|
|
|
this.$refs['dataForm'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
this.FormLoading = true |
|
|
|
if (this.dialogStatus === 'add') { |
|
|
|
this.temp.staffSid = this.YongHuid.staffSid |
|
|
|
this.temp.orgName = this.orgName |
|
|
|
this.temp.staffName = this.staffName |
|
|
|
this.temp.orgSid = this.YongHuid.organizationSid |
|
|
|
this.temp.userSid = window.sessionStorage.getItem('userSid') |
|
|
|
save(this.temp).then((response) => { |
|
|
|
this.FormLoading = false |
|
|
|
if (response.code === '200') { |
|
|
|
this.xuniSid = response.data |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '添加成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
// this.disabled = false |
|
|
|
this.handleReturn('true') |
|
|
|
// this.$emit('doback') |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '添加失败', |
|
|
|
type: 'error', |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.temp.staffSid = this.YongHuid.staffSid |
|
|
|
this.temp.orgSid = this.YongHuid.organizationSid |
|
|
|
this.temp.orgName = this.orgName |
|
|
|
this.temp.staffName = this.staffName |
|
|
|
this.temp.userSid = window.sessionStorage.getItem('userSid') |
|
|
|
update(this.temp).then((response) => { |
|
|
|
console.log('response', response) |
|
|
|
this.FormLoading = false |
|
|
|
if (response.code === '200') { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '修改成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
this.handleReturn('true') |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '失败', |
|
|
|
message: '修改失败', |
|
|
|
type: 'error' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
this.temp.salesPolicy = bb.name |
|
|
|
this.temp.salesPolicyKey = bb.key |
|
|
|
console.log('name', this.temp.salesPolicy) |
|
|
|
}, |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 优惠包类别 |
|
|
|
discountTypeChange(value) { |
|
|
|
console.log('触发下拉框按钮') |
|
|
|
let bb = {} |
|
|
|
this.discountType_list.forEach((e) => { |
|
|
|
if (e.dictKey === value) { |
|
|
|
bb = { |
|
|
|
type: e.dictType, |
|
|
|
name: e.dictValue, |
|
|
|
key: e.dictKey, |
|
|
|
sid: e.sid |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
this.temp.discountType = bb.name |
|
|
|
this.temp.discountTypeKey = bb.key |
|
|
|
console.log('name', this.temp.discountType) |
|
|
|
}, |
|
|
|
// ------------ 功能实现 ------------ |
|
|
|
// 添加数据 |
|
|
|
handleCreate() { |
|
|
|
// 提交 |
|
|
|
handleSubmit() { |
|
|
|
this.$confirm('是否确定提交该业务', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
this.$refs['dataForm'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
this.FormLoading = true; |
|
|
|
if (this.dialogStatus === 'add') { |
|
|
|
this.temp.staffSid = this.YongHuid.staffSid; |
|
|
|
this.temp.orgName = this.orgName; |
|
|
|
this.temp.staffName = this.staffName; |
|
|
|
this.temp.orgSid = this.YongHuid.organizationSid; |
|
|
|
this.FormLoading = true |
|
|
|
if (this.stateId === '0') { |
|
|
|
this.temp.staffSid = this.YongHuid.staffSid |
|
|
|
this.temp.orgName = this.orgName |
|
|
|
this.temp.staffName = this.staffName |
|
|
|
this.temp.orgSid = this.YongHuid.organizationSid |
|
|
|
this.temp.userSid = window.sessionStorage.getItem('userSid') |
|
|
|
save(this.temp).then((response) => { |
|
|
|
this.FormLoading = false; |
|
|
|
console.log('提交时sid', this.temp.sid) |
|
|
|
// 提交流程 |
|
|
|
submitVehicleApprove(this.temp).then((response) => { |
|
|
|
if (response.code === '200') { |
|
|
|
this.xuniSid = response.data; |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '添加成功', |
|
|
|
message: '提交成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000, |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
// this.disabled = false |
|
|
|
this.handleReturn('true') |
|
|
|
// this.$emit('doback') |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '添加失败', |
|
|
|
type: 'error', |
|
|
|
duration: 2000, |
|
|
|
title: '提交失败', |
|
|
|
message: response.msg, |
|
|
|
type: 'error' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.temp.staffSid = this.YongHuid.staffSid; |
|
|
|
this.temp.orgSid = this.YongHuid.organizationSid; |
|
|
|
this.temp.orgName = this.orgName; |
|
|
|
this.temp.staffName = this.staffName; |
|
|
|
this.temp.staffSid = this.YongHuid.staffSid |
|
|
|
this.temp.orgSid = this.YongHuid.organizationSid |
|
|
|
this.temp.orgName = this.orgName |
|
|
|
this.temp.staffName = this.staffName |
|
|
|
this.temp.userSid = window.sessionStorage.getItem('userSid') |
|
|
|
update(this.temp).then((response) => { |
|
|
|
console.log('response', response); |
|
|
|
this.FormLoading = false; |
|
|
|
// 提交流程 |
|
|
|
submitVehicleApprove(this.temp).then((response) => { |
|
|
|
if (response.code === '200') { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '修改成功', |
|
|
|
message: '提交成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000, |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
this.handleReturn('true') |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '失败', |
|
|
|
message: '修改失败', |
|
|
|
type: 'error', |
|
|
|
title: '提交失败', |
|
|
|
message: response.msg, |
|
|
|
type: 'error' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 提交 |
|
|
|
handleSubmit() { |
|
|
|
this.$confirm('是否确定提交该业务', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
this.$refs['dataForm'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
this.FormLoading = true; |
|
|
|
if (this.stateId === '0') { |
|
|
|
this.temp.staffSid = this.YongHuid.staffSid; |
|
|
|
this.temp.orgName = this.orgName; |
|
|
|
this.temp.staffName = this.staffName; |
|
|
|
this.temp.orgSid = this.YongHuid.organizationSid; |
|
|
|
this.temp.userSid = window.sessionStorage.getItem('userSid') |
|
|
|
console.log('提交时sid', this.temp.sid) |
|
|
|
// 提交流程 |
|
|
|
submitVehicleApprove(this.temp).then((response) => { |
|
|
|
if (response.code === '200') { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '提交成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000, |
|
|
|
}) |
|
|
|
this.handleReturn('true') |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '提交失败', |
|
|
|
message: response.msg, |
|
|
|
type: 'error', |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.temp.staffSid = this.YongHuid.staffSid; |
|
|
|
this.temp.orgSid = this.YongHuid.organizationSid; |
|
|
|
this.temp.orgName = this.orgName; |
|
|
|
this.temp.staffName = this.staffName; |
|
|
|
this.temp.userSid = window.sessionStorage.getItem('userSid') |
|
|
|
// 提交流程 |
|
|
|
submitVehicleApprove(this.temp).then((response) => { |
|
|
|
if (response.code === '200') { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '提交成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000, |
|
|
|
}) |
|
|
|
this.handleReturn('true') |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '提交失败', |
|
|
|
message: response.msg, |
|
|
|
type: 'error', |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 返回 |
|
|
|
handleReturn(isreload) { |
|
|
|
if (isreload === 'true') this.$emit('reloadlist'); |
|
|
|
this.temp.sid = ''; // SID |
|
|
|
this.temp = { |
|
|
|
amount: '', //优惠包价值 |
|
|
|
detail: '', //优惠项目说明 |
|
|
|
discountName: '', //优惠包名称 |
|
|
|
discountType: '', //优惠类型(赠送套餐 等,数据字典) |
|
|
|
discountTypeKey: '', //优惠类型key |
|
|
|
effectiveDate: '', //有效期 |
|
|
|
isEmploy: '', //1 是 0 否有效 |
|
|
|
orderSid: '', //销售订单单据sid |
|
|
|
salesPolicy: '', //政策类别 |
|
|
|
salesPolicyKey: '', //政策类别key |
|
|
|
sid: '', //优惠情况sid |
|
|
|
useOrg: '', |
|
|
|
userSid: '' |
|
|
|
} |
|
|
|
this.$refs['dataForm'].resetFields() |
|
|
|
this.$emit('doback') |
|
|
|
}, |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
// 返回 |
|
|
|
handleReturn(isreload) { |
|
|
|
if (isreload === 'true') this.$emit('reloadlist') |
|
|
|
this.temp.sid = '' // SID |
|
|
|
this.temp = { |
|
|
|
discountExplain: '', |
|
|
|
discountMoney: '', |
|
|
|
projectName: '', |
|
|
|
discountType: '', // 优惠类型(赠送套餐 等,数据字典) |
|
|
|
discountTypeKey: '', // 优惠类型key |
|
|
|
effectiveDate: '', // 有效期 |
|
|
|
isEmploy: '', // 1 是 0 否有效 |
|
|
|
orderSid: '', // 销售订单单据sid |
|
|
|
salesPolicy: '', // 政策类别 |
|
|
|
salesPolicyKey: '', // 政策类别key |
|
|
|
sid: '', // 优惠情况sid |
|
|
|
userSid: '' |
|
|
|
} |
|
|
|
this.$refs['dataForm'].resetFields() |
|
|
|
this.$emit('doback') |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped> |
|
|
|
.tit { |
|
|
|
margin: 20px 0 35px 0; |
|
|
|
padding: 10px 0 0 0; |
|
|
|
border-bottom: 0 !important; |
|
|
|
} |
|
|
|
.tit { |
|
|
|
margin: 20px 0 35px 0; |
|
|
|
padding: 10px 0 0 0; |
|
|
|
border-bottom: 0 !important; |
|
|
|
} |
|
|
|
|
|
|
|
.times { |
|
|
|
display: flex; |
|
|
|
flex-direction: row; |
|
|
|
justify-content: space-around; |
|
|
|
padding: 30px 0 10px 0; |
|
|
|
margin: 0 auto 0px auto; |
|
|
|
width: 70%; |
|
|
|
font-size: 14px; |
|
|
|
} |
|
|
|
.times { |
|
|
|
display: flex; |
|
|
|
flex-direction: row; |
|
|
|
justify-content: space-around; |
|
|
|
padding: 30px 0 10px 0; |
|
|
|
margin: 0 auto 0px auto; |
|
|
|
width: 70%; |
|
|
|
font-size: 14px; |
|
|
|
} |
|
|
|
|
|
|
|
/deep/ .el-select { |
|
|
|
width: 80%; |
|
|
|
} |
|
|
|
/deep/ .el-select { |
|
|
|
width: 80%; |
|
|
|
} |
|
|
|
|
|
|
|
/deep/ .el-form-item__content { |
|
|
|
margin-left: 0 !important; |
|
|
|
} |
|
|
|
/deep/ .el-form-item__content { |
|
|
|
margin-left: 0 !important; |
|
|
|
} |
|
|
|
</style> |
|
|
|