提交 9c31ac2c authored 作者: 黄旭新's avatar 黄旭新

xin

......@@ -57,7 +57,7 @@
<!-- 邮箱 -->
<view class="item_common">
<view class="title">邮箱</view>
<input type="number" v-model="phone" placeholder="请输入" />
<input type="number" v-model="email" placeholder="请输入" />
<view class="border_bottom"></view>
</view>
<!-- 所属行业 -->
......@@ -81,7 +81,7 @@
<!-- 委托人/法人姓名 -->
<view class="item_common" v-if="typeValue">
<view class="title"><text>*</text>{{typeValue == '法人认证' ? '法人': '授权委托人'}}姓名</view>
<input type="number" v-model="entrustName" placeholder="请输入" disabled />
<input type="number" v-model="entrustName" placeholder="请输入" />
<view class="border_bottom"></view>
</view>
<!-- 上传身份证照片 -->
......@@ -176,11 +176,12 @@
<view class="border_bottom"></view>
</view>
<!-- 电费通知单 -->
<view class="img_common">
<view class="img_common_img">
<view class="title"><text>*</text>电费通知单</view>
<view class="uploadImg" @click="chooseImg(4)">
<image v-if="electricityBill" :src="electricityBill" mode=""></image>
<image v-else src="../../static/images/upload_bg.png" mode=""></image>
<view class="uploadImg_box" @click="chooseImg(4)">
<!-- <image v-if="electricityBill" :src="electricityBill" mode="" ></image> -->
<image v-for="(item,index) in imgList" :key="index" :src="item" mode=""></image>
<image v-if="!hide" src="../../static/images/upload_bg.png" mode=""></image>
</view>
<view class="border_bottom"></view>
</view>
......@@ -348,7 +349,7 @@
<view class="border_bottom"></view>
</view>
<!-- 电费通知单 -->
<view class="img_common">
<view class="img_common_img">
<view class="title"><text>*</text>电费通知单</view>
<view class="uploadImg">
<image v-if="electricityBill" :src="electricityBill" mode=""></image>
......@@ -420,6 +421,8 @@
imgUrlNegative: '', //反面照
isClick: true, //避免重复点击
isEdit: false, //是否编辑
imgList: [], // 电费通知单(最多六张)
hide: false, // 是否隐藏上传按钮
}
},
......@@ -517,6 +520,10 @@
} else if (index == 3) {
that.businessLicense = url
} else {
that.imgList.push(url)
if (that.imgList.length > 5) {
that.hide = true
}
that.electricityBill = url
}
},
......@@ -993,11 +1000,10 @@
}
}
// 上传照片公共样式
// 上传照片
.img_common {
display: flex;
justify-content: space-between;
position: relative;
padding: 32rpx;
background-color: #fff;
border-bottom: 1px solid #f4f5f7;
......@@ -1018,6 +1024,36 @@
}
}
// 电费通知单
.img_common_img {
padding: 32rpx;
background-color: #fff;
border-bottom: 1px solid #f4f5f7;
.title {
margin-bottom: 32rpx;
font-size: 34rpx;
font-weight: 400;
color: #333;
text {
color: #ec6045;
}
}
.uploadImg_box {
display: flex;
flex-wrap: wrap;
image {
width: 180rpx;
height: 180rpx;
margin-right: 10rpx;
margin-bottom: 10rpx;
}
}
}
// 下横线样式
.border_bottom {
position: absolute;
......
......@@ -57,7 +57,7 @@
<view :class="['LssueContracts_btn',{'active_btn': onSubmint},{'btn_marginTop': !onTemplate}]">
<view v-if="onSubmint">保存合同中</view>
<view v-if="!onTemplate" @click="openContract">下载合同</view>
<view v-if="!onTemplate" @click="openContract">预览并下载</view>
<view v-else @click="submit">保存</view>
</view>
......@@ -147,34 +147,34 @@
datashow() {
let that = this
// 编辑合同的数据回显
get(api.issueContract, {
id: that.contractId
get(api.contractDetail, {
contractId: that.contractId
}).then(res => {
console.log('获取合同信息')
console.log(res.data)
if (res.code == 200) {
that.contractA = res.data.contractA
that.companyValue = res.data.ename
// console.log(that.companys)
for (let i = 0; i < that.companys.length; i++) {
if (that.companys[i].eName == that.companyValue) {
console.log(that.companys[i].userId)
that.userId = that.companys[i].userId
}
}
console.log(that.userId)
that.electricity = res.data.electricity
that.contractStartTime = res.data.contractStartTime.replace(new RegExp('-', 'g'), '/')
that.contractEndTime = res.data.contractEndTime.replace(new RegExp('-', 'g'), '/')
that.contractType = res.data.contractType
if (that.contractType == 1) {
that.typeValue = '固定价差'
that.fixedSpread = res.data.fixedSpread
} else {
that.typeValue = '月竞分成'
that.shareRatio = res.data.shareRatio
}
}
// if (res.code == 200) {
// that.contractA = res.data.contractA
// that.companyValue = res.data.ename
// // console.log(that.companys)
// for (let i = 0; i < that.companys.length; i++) {
// if (that.companys[i].eName == that.companyValue) {
// console.log(that.companys[i].userId)
// that.userId = that.companys[i].userId
// }
// }
// console.log(that.userId)
// that.electricity = res.data.electricity
// that.contractStartTime = res.data.contractStartTime.replace(new RegExp('-', 'g'), '/')
// that.contractEndTime = res.data.contractEndTime.replace(new RegExp('-', 'g'), '/')
// that.contractType = res.data.contractType
// if (that.contractType == 1) {
// that.typeValue = '固定价差'
// that.fixedSpread = res.data.fixedSpread
// } else {
// that.typeValue = '月竞分成'
// that.shareRatio = res.data.shareRatio
// }
// }
})
},
//选择合同类型
......@@ -206,8 +206,7 @@
//选择合同开始时间
bindStartDateChange(e) {
let str = e.detail.value
str = str.replace('-', '/')
this.contractStartTime = str + '/01'
this.contractStartTime = str + '-01'
},
//选择合同结束时间
bindEndDateChange(e) {
......@@ -217,12 +216,55 @@
icon: 'none'
})
} else {
this.contractEndTime = e.detail.value + '/12/31'
this.contractEndTime = e.detail.value + '-12-31'
}
},
// 下载合同
openContract(){
openContract() {
console.log('下载合同')
let title = this.checkout()
if (!title) {
let params = {
contractType: this.contractType,
contractA: this.contractA,
userId: this.userId,
electricity: this.electricity,
fixedSpread: this.fixedSpread,
shareRatio: this.shareRatio,
contractStartTime: this.contractStartTime,
contractEndTime: this.contractEndTime,
electricId: this.electricId
}
get(api.previewContract, params).then(res => {
console.log(res)
if (res.code == 200) {
let url = res.msg.replace('http', 'https')
uni.downloadFile({
url: res.msg,
filePath: wx.env.USER_DATA_PATH + '/huoshitou.docx',
success: (result) => {
console.log(result)
if (result.statusCode == 200) {
uni.openDocument({
filePath: result.filePath,
// fileType: "pdf",
showMenu: true,
success: function() {
console.log('打开文档成功');
},
})
}
}
})
}
})
} else {
uni.showToast({
title: title,
icon: 'none'
})
}
},
// 上传合同附件
slectImage() {
......@@ -263,98 +305,54 @@
}
});
},
// 保存合同
// 上传合同
submit() {
let {
contractType, //合同类型 1-固定价差, 3-月竞分成
contractA, //合同甲方
userId, //售电公司id
electricity, //合同电量
fixedSpread, //固定价差(厘) contractType为 1 必传
shareRatio, //分成比例(%) contractType为 2 必传
contractStartTime, //合同开始时间
contractEndTime, //合同结束时间
electricId, //电客id
} = this.$data
let title = this.checkout(contractType, contractA, userId, electricity, contractStartTime, contractEndTime)
console.log('上传合同')
let title = this.checkout()
if (!title) {
if (contractType == 1) {
if (fixedSpread == '') {
let contractAnnex = null
if (this.pdFurl) {
contractAnnex = this.pdFurl
} else {
contractAnnex = this.imgList
}
this.onSubmint = true
post(api.uploadContract, {
id: this.contractId,
contractType: this.contractType,
contractA: this.contractA,
userId: this.userId,
electricity: this.electricity,
fixedSpread: this.fixedSpread,
shareRatio: this.shareRatio,
contractStartTime: this.contractStartTime,
contractEndTime: this.contractEndTime,
electricId: this.electricId,
contractAnnex: JSON.stringify(contractAnnex)
}).then(res => {
if (res.code == 200) {
uni.showToast({
title: '请输入固定的价差',
icon: 'none'
title: '保存成功'
})
return
}
} else if (contractType == 3) {
if (shareRatio == '') {
setTimeout(() => {
uni.navigateBack({
delta: 1
})
}, 500)
} else {
uni.showToast({
title: '请输入分成的比例',
title: res.msg,
icon: 'none'
})
return
setTimeout(() => {
this.onSubmint = false
}, 1000)
}
}
this.onSubmint = true
if (this.contractId) {
// 如果有合同id就是编辑合同
get(api.exitContract, {
id: this.contractId,
contractType,
contractA,
userId,
electricity,
fixedSpread,
shareRatio,
contractStartTime,
contractEndTime,
electricId,
}).then(res => {
if (res.code == 200) {
uni.showToast({
title: '保存成功'
})
setTimeout(() => {
uni.navigateBack({
delta: 1
})
}, 500)
}
})
} else {
// 没有就是开具新合同
get(api.issueContract, {
contractType,
contractA,
userId,
electricity,
fixedSpread,
shareRatio,
contractStartTime,
contractEndTime,
electricId,
}).then(res => {
if (res.code == 200) {
uni.showToast({
title: '保存成功'
})
setTimeout(() => {
uni.navigateBack({
delta: 1
});
}, 500)
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
this.flag = true
}
})
}
})
} else {
uni.showToast({
title,
title: title,
icon: 'none'
})
}
......@@ -362,19 +360,24 @@
//校验信息
checkout() {
let arr = arguments
if (arr[0] == '') {
if (this.contractType == '') {
return '请选择合同类型'
} else if (arr[1] == '') {
} else if (this.contractA == '') {
return '请输入合同的甲方'
} else if (arr[2] == '') {
} else if (this.userId == null) {
return '请选择合同的乙方'
} else if (arr[3] == '' || isNaN(arr[3])) {
} else if (this.electricity == '' || isNaN(this.electricity)) {
return '请输入合同的电量'
} else if (arr[4] == '') {
} else if (this.contractType == 1 && this.fixedSpread == '') {
return '请输入固定的价差'
} else if (this.contractType == 3 && this.shareRatio == '') {
return '请输入分成的比例'
} else if (this.contractStartTime == '') {
return '请选择合同的开始时间'
} else if (arr[5] == '') {
} else if (this.contractEndTime == '') {
return '请选择合同的结束时间'
} else if (this.pdFurl == '' && this.imgList.length == 0) {
return '请上传合同附件'
} else {
return false
}
......
const erp = erp || {}; //wxb21370ac25ee51b0,//wx45bb68de16ddddb7
// const DOMAIN = 'http://192.168.1.107:9099/'; // 峰煜
const DOMAIN = 'https://dev.diaosaas.com/diaoyun/' //测试
// const DOMAIN = 'http://192.168.1.178:9099/' // 国禄
// const DOMAIN = 'https://dev.diaosaas.com/diaoyun/' //测试
const DOMAIN = 'http://192.168.1.178:9099/' // 国禄
// const DOMAIN = 'http://192.168.1.197:9099/' // 志就
// const DOMAIN = 'https://fire.huoshitou.net/diaoyun/' // 正式
const HOST = DOMAIN + 'api/'
......@@ -52,23 +52,25 @@ erp.getEnterpriseContractDetail = HOST + 'electric/getEnterpriseContractDetail'
erp.bonusAndWithdraw = HOST + 'promotionCenter/bonusAndWithdraw' //推广中心
erp.withdraw = HOST + 'promotionCenter/withdraw' //提现
erp.viewRewardDetails = HOST + 'promotionCenter/viewRewardDetails' //奖励明细
erp.myContract = HOST + 'common/myContract' // 合同管理-我的合同列表
erp.refuseContract = HOST + 'common/refuseContract' //合同管理-我的合同-拒绝合同
erp.confirmContract = HOST + 'common/confirmContract' //合同管理-我的合同-确认合同
erp.downloadContractTemplate = HOST + 'electronicSeal/downloadContractTemplate' //合同管理-我的合同-下载合同模板
erp.contractShippingAddress = HOST + 'common/contractShippingAddress' //合同管理-快递寄送地址
// 我的合同
erp.myContract = HOST + 'common/myContract' // 我的合同列表
erp.refuseContract = HOST + 'common/refuseContract' //我的合同-拒绝合同
erp.confirmContract = HOST + 'common/confirmContract' //我的合同-确认合同
erp.downloadContractTemplate = HOST + 'electronicSeal/downloadContractTemplate' //我的合同-下载合同模板
erp.contractShippingAddress = HOST + 'common/contractShippingAddress' //快递寄送地址
erp.uploadCourier = HOST + 'common/uploadCourier' //上传快递单
erp.issueEntrustedService = HOST + 'orderCenter/issueEntrustedService' // 发布委托服务单 接口
erp.getLogistics = HOST + 'common/getLogistics' //查看物流信息
erp.exitContract = HOST + 'electric/exitContract' //合同管理-企业购售电合同-编辑线下合同
erp.issueContract = HOST + 'electric/issueContract' //合同管理-企业购售电合同-开具线下合同
erp.offlineContract = HOST + 'electric/offlineContract' //合同管理-企业购售电合同-线下合同列表(未生效/已生效)
erp.offlineCheckPassContract = HOST + 'electric/offlineCheckPassContract' //合同管理-企业购售电合同-线下合同审核通过列表
// 企业合同
erp.contractDetail = HOST + 'electric/contractDetail' //企业合同-合同数据回显
erp.uploadContract = HOST + 'electric/uploadContract' //企业合同-上传合同
erp.previewContract = HOST + 'electric/previewContract' // 企业合同-预览并下载合同
erp.electricContractList = HOST + 'electric/electricContractList' // 企业合同列表
erp.uploadStampContract = HOST + 'electric/uploadStampContract' //合同管理-企业购售电合同-线下合同上传盖章合同
erp.submitReview = HOST + 'electric/submitReview' //合同管理-企业购售电合同-线下合同(未生效)-提交审核
erp.platformContract = HOST + 'electric/platformContract' //合同管理-企业购售电合同-平台合同
erp.stockContract = HOST + 'electric/stockContract' //合同管理-企业购售电合同-存量合同
erp.chooseABusiness = HOST + 'orderCenter/chooseABusiness' // 我的服务单---发布委托服务单---选择企业
erp.issueEntrustedService = HOST + 'orderCenter/issueEntrustedService' // 发布委托服务单 接口
erp.myPostedEntrustedServiceList = HOST + 'orderCenter/myPostedEntrustedServiceList' // 我的---我的服务单---我发布的 接口
erp.entrustedServiceDetails = HOST + 'orderCenter/entrustedServiceDetails' // 我的---我的服务单---查看详情 接口
erp.entrustedServiceChangeStatus = HOST + 'orderCenter/entrustedServiceChangeStatus' // 我的---我的服务单---撤销委托 接口
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论