|
|
@@ -841,45 +841,38 @@ export default {
|
|
|
if (val) {
|
|
|
this.$store.commit('setLoading',true)
|
|
|
/* 居间新建 */
|
|
|
- if (this.$route.query.type == '居间' && this.centerEnterpriseList) {
|
|
|
- let is = this.centerEnterpriseList.some(item => item.sys_enterpriseid == this.form.sys_enterpriseid)
|
|
|
- if (is) {
|
|
|
- this.$confirm('该项目商机已存在居间服务商,不可创建','提示',{
|
|
|
- cancelButtonText:'取消',
|
|
|
- showConfirmButton:false
|
|
|
- }).then(() => {
|
|
|
- this.$store.commit('setLoading',false)
|
|
|
- })
|
|
|
+ if (this.$route.query.type == '居间') {
|
|
|
+
|
|
|
+ if (this.$route.query.type == '直销项目') {
|
|
|
+ this.form.type = '项目'
|
|
|
+ this.form.typemx = '直销'
|
|
|
+ } else if (this.$route.query.type == '经销项目') {
|
|
|
+ this.form.type = '项目'
|
|
|
+ this.form.typemx = '经销'
|
|
|
} else {
|
|
|
- if (this.$route.query.type == '直销项目') {
|
|
|
- this.form.type = '项目'
|
|
|
- this.form.typemx = '直销'
|
|
|
- } else if (this.$route.query.type == '经销项目') {
|
|
|
- this.form.type = '项目'
|
|
|
- this.form.typemx = '经销'
|
|
|
- } else {
|
|
|
- this.form.type = this.$route.query.type
|
|
|
- }
|
|
|
+ this.form.type = this.$route.query.type
|
|
|
+ }
|
|
|
|
|
|
- this.form.discountrate ? this.form.discountrate = (this.form.discountrate / 100).toFixed(4) : ''
|
|
|
- this.form.productdiscount ? this.form.productdiscount = (this.form.productdiscount / 100).toFixed(4) : ''
|
|
|
- this.form.orderratio ? this.form.orderratio = (this.form.orderratio / 100).toFixed(4) : ''
|
|
|
- let res = await this.$api.requested({
|
|
|
- "id":20221121185302,
|
|
|
- "content": this.form
|
|
|
- })
|
|
|
- if (res.code == 0){
|
|
|
- this.form.discountrate = this.form.discountrate * 100
|
|
|
- this.form.productdiscount = this.form.productdiscount * 100
|
|
|
- this.form.orderratio = this.form.orderratio * 100
|
|
|
- }
|
|
|
- this.tool.showMessage(res,() => {
|
|
|
- this.$store.commit('setLoading',false)
|
|
|
- this.$store.dispatch('DrawerShowChange',false)
|
|
|
- this.$store.dispatch('changeDetailDrawer',true)
|
|
|
- this.$router.push({path:'/contractDetail',query:{type:this.$route.query.type,id:res.data.sa_contractid,rowindex:res.data.rowindex}})
|
|
|
- })
|
|
|
+ this.form.discountrate ? this.form.discountrate = (this.form.discountrate / 100).toFixed(4) : ''
|
|
|
+ this.form.productdiscount ? this.form.productdiscount = (this.form.productdiscount / 100).toFixed(4) : ''
|
|
|
+ this.form.orderratio ? this.form.orderratio = (this.form.orderratio / 100).toFixed(4) : ''
|
|
|
+ let res = await this.$api.requested({
|
|
|
+ "id":20221121185302,
|
|
|
+ "content": this.form
|
|
|
+ })
|
|
|
+ if (res.code == 0){
|
|
|
+ this.form.discountrate = this.form.discountrate * 100
|
|
|
+ this.form.productdiscount = this.form.productdiscount * 100
|
|
|
+ this.form.orderratio = this.form.orderratio * 100
|
|
|
+ this.$store.commit('setLoading',false)
|
|
|
}
|
|
|
+ this.tool.showMessage(res,() => {
|
|
|
+ this.$store.commit('setLoading',false)
|
|
|
+ this.$store.dispatch('DrawerShowChange',false)
|
|
|
+ this.$store.dispatch('changeDetailDrawer',true)
|
|
|
+ this.$router.push({path:'/contractDetail',query:{type:this.$route.query.type,id:res.data.sa_contractid,rowindex:res.data.rowindex}})
|
|
|
+ })
|
|
|
+
|
|
|
} else {
|
|
|
/* 其它新建 */
|
|
|
if (this.$route.query.type == '直销项目') {
|