123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690 |
- <template>
- <view class="list-content">
- <pageHead pageTitle="合同审批" :showBack="true" :showHistory="true" @jumpHistory="jumpPage" style="margin-bottom: 10px;"></pageHead>
- <view class="list-card">
- <u--form ref="form" :model="contractInfo" labelPosition="left" labelWidth="80" :labelStyle="{'color': '#6B7688','fontSize':'16px'}" >
- <u-form-item label="合同名称" prop="contractName">
- <view class="val-posi">{{contractInfo.contractName}}</view>
- </u-form-item>
- <u-form-item label="合同编号" prop="contractNo">
- <view class="val-posi">{{contractInfo.contractNo}}</view>
- </u-form-item>
-
- <u-form-item label="地区" prop="nickName" >
- <view class="val-posi">{{contractInfo.countryName+'/'+contractInfo.city}}</view>
- </u-form-item>
- <u-form-item label="业务员" prop="salesmanName">
- <view class="val-posi">{{contractInfo.salesmanName}}</view>
- </u-form-item>
- <!-- <u-form-item label="销售" prop="saler" >
- <view class="val-posi">{{contractInfo.saler}}</view>
- </u-form-item> -->
- <u-form-item label="代理商" prop="agentId" >
- <view class="val-posi">{{contractInfo.agentName}}</view>
- </u-form-item>
-
- <u-form-item label="合同金额" prop="amount" >
- <view class="val-posi">{{stateFormatLow(contractInfo.amount,0)}}</view>
- </u-form-item>
- <u-form-item label="装船期限" prop="shipmentDeadline" >
- <view class="val-posi">{{contractInfo.shipmentDeadline}}</view>
- </u-form-item>
- <u-form-item label="贸易条款" prop="tradeTerms" >
- <view class="val-posi">{{contractInfo.tradeTermsName}}</view>
- </u-form-item>
- <u-form-item label="付款方式" prop="paymentMethod" >
- <view class="val-posi">{{contractInfo.paymentMethodName}}</view>
- </u-form-item>
- <u-form-item label="付款比例" prop="paymentRatio" >
- <view class="val-posi">{{contractInfo.paymentRadioName}}</view>
- </u-form-item>
- <u-form-item label="销售模式" prop="salesModel" >
- <view class="val-posi">{{contractInfo.salesModelName}}</view>
- </u-form-item>
- </u--form>
- </view>
- <view class="list-card" >
- <view class="card-title">电梯列表</view>
- <view v-for="(item, index) in contractInfo.elevatorList">
- <u--form ref="form" :model="item" labelPosition="left" labelWidth="80" :labelStyle="{'color': '#6B7688','fontSize':'16px'}" >
- <u-form-item label="产品类型" prop="elevatorType">
- <view class="val-posi">{{item.elevatorTypeName}}</view>
- </u-form-item>
- <u-form-item label="型号" prop="elevatorModel">
- <view class="val-posi">{{item.elevatorModel}}</view>
- </u-form-item>
- <u-form-item label="编号" prop="elevatorCode">
- <!-- <uni-tooltip :content="item.elevatorCode" placement="bottom">
- <view class="val-posi" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">{{item.elevatorCode}}</view>
- </uni-tooltip> -->
- <view class="val-posi">{{item.elevatorCode}}</view>
- </u-form-item>
- <u-form-item label="规格" prop="specification" >
- <view class="val-posi">{{item.specification}}</view>
- </u-form-item>
- <u-form-item label="数量" prop="count" >
- <view class="val-posi">{{item.count}}</view>
- </u-form-item>
- <u-form-item label="单价" prop="unitPrice" >
- <view class="val-posi">{{stateFormatLow(item.unitPrice,0)}}</view>
- </u-form-item>
- <u-form-item label="附加费用" prop="additionalCost" >
- <view class="val-posi">{{stateFormatLow(item.additionalCost,0)}}</view>
- </u-form-item>
- </u--form>
- <u-divider class="divider"></u-divider>
- </view>
- <view class="val-posi">
- <view>总价</view>
- <view>{{stateFormatLow(totalPrice,0)}}</view>
- </view>
- </view>
- <view class="list-card" style="padding: 16px 10px;">
- <view class="card-title">备注</view>
- <view>{{contractInfo.remark}}</view>
- <view class="card-title">附件信息</view>
- <!-- <view @click="getFile(contractInfo.file)">{{contractInfo.file}}</view> -->
- <view v-if="contractInfo.file" style="width: 100%;word-wrap: break-word;">
- <u-link ref="myLink" :href='getFile(contractInfo.file)' class="Links"
- :text='getFileName(contractInfo.file)' target="_blank" ></u-link></view>
- <view v-else>暂无附件</view>
- </view>
- <view style="height: 75px;"></view>
- <view class="card_bottom ">
- <view class="flex-center" style="width: 100%;">
- <view class="flex-center" style="width:100%;padding: 0px 8px;">
- <view class="button-left flex-center-middle" @click="toggle('02')">
- <img class="button-icon" src="@/static/img/approve/reject.png" alt="" />
- <view class="reject-text">驳回</view>
- </view>
- <view class="button-right flex-center-middle" @click="toggle('01')">
- <img class="button-icon" src="@/static/img/approve/pass.png" alt="" />
- <view class="pass-text">通过</view>
- </view>
- </view>
- </view>
- </view>
- <!-- 弹窗 -->
- <view>
- <!-- 驳回弹窗 -->
- <uni-popup ref="popup" type="bottom" background-color="#fff" style="border-radius: 8rpx;">
- <view class="popup-content" >
- <view class="return_title">
- <text style="color: rgba(0, 0, 0, 0.85);">驳回原因:</text>
- </view>
- <view class="uni-textarea">
- <textarea v-model.trim="returnMsg" placeholder-style="color:#6B7688" placeholder="请输入驳回原因…" class="return_content" maxlength="200"/>
- </view>
- <view class="flex-center mt32">
- <view class="button-left flex-center-middle" @click="closePup()">
- <img class="button-icon" src="@/static/img/approve/reject.png" alt="" />
- <view class="reject-text">取消</view>
- </view>
- <view class="button-right flex-center-middle" @click="handleApprove('02')">
- <img class="button-icon" src="@/static/img/approve/pass.png" alt="" />
- <view class="pass-text">提交</view>
- </view>
- </view>
- </view>
- </uni-popup>
- <!-- 通过弹窗 -->
- <uni-popup ref="popupPass" background-color="#fff" borderRadius="10px 10px 10px 10px" style="width: 90%;">
- <view class="popup-content" style="padding: 20rpx 40rpx" >
- <view class="flex-center" style="justify-content: center;margin-bottom: 20rpx 0 30rpx">
- <view><img style="height: 100%;width: 300rpx;" src="@/static/img/approve/nomessage.png" alt="" /></view>
- </view>
- <view style="text-align: center;margin-bottom: 30rpx">
- <img class="button-icon" src="@/static/img/approve/warning.png" alt="" />
- <text style="color: rgba(0, 0, 0, 0.85);">确认无误并通过审核?</text>
- </view>
- <view class="flex-center mt32" style="margin-bottom: 30rpx;">
- <view class="button-left-one flex-center-middle" @click="closePup()">
- <img class="button-icon" src="@/static/img/approve/reject.png" alt="" />
- <view class="reject-text">取消</view>
- </view>
- <view style="width: 50rpx;"></view>
- <view class="button-right-one flex-center-middle" @click="handleApprove('01')">
- <img class="button-icon" src="@/static/img/approve/pass.png" alt="" />
- <view class="pass-text">通过</view>
- </view>
- </view>
- </view>
- </uni-popup>
- <!-- 确认弹窗 -->
- <uni-popup ref="popupConfirm" background-color="#fff" borderRadius="10px 10px 10px 10px" style="width: 90%;">
- <view class="popup-content" style="padding: 20rpx 40rpx" >
- <view style="text-align: center;margin: 50rpx 0 30rpx">
- <img class="button-icon" src="@/static/img/approve/warning.png" alt="" />
- <text style="color: rgba(0, 0, 0, 0.85);">该报价单的折扣超出您的折扣范围</text>
- </view>
- <view style="text-align: center;margin: 30rpx 0">
- <text style="color: rgba(0, 0, 0, 0.85);">是否确认?</text>
- </view>
- <view class="flex-center mt32" style="margin-bottom: 30rpx;">
- <view class="button-left-one flex-center-middle" @click="closePup()">
- <img class="button-icon" src="@/static/img/approve/reject.png" alt="" />
- <view class="reject-text">取消</view>
- </view>
- <view style="width: 50rpx;"></view>
- <view class="button-right-one flex-center-middle" @click="handleApprove('01')">
- <img class="button-icon" src="@/static/img/approve/pass.png" alt="" />
- <view class="pass-text">确定</view>
- </view>
- </view>
- </view>
- </uni-popup>
- </view>
- </view>
- </template>
- <script>
- import * as ApproveApi from '@/api/work/approve'
- import {editFlow,updateContract} from '@/api/work/contract/contract.js'
- import { stateFormat,stateFormatLow } from '@/utils/common.js'
- const { environment } = require('../../../config/environment.js')
- export default {
- data() {
- return {
- projectPageParam: {
- pageNum: 1,
- pageSize: 5
- },
- contractInfo:{},
- returnMsg:"",
- contractId:'',
- totalPrice:0,
- jumpUrl:"/pages/work/approve/contractAduit?businessId="
- }
- },
- onLoad (params) {
- this.contractId = params.contractId
- this.jumpUrl = this.jumpUrl+this.contractId
- this.getBargainInfo()
- },
- methods: {
- jumpPage(){
- uni.navigateTo({
- url: this.jumpUrl
- })
- },
- getFile(url){
- // uni.downloadFile({
- // url: environment.baseURL + url, //仅为示例,并非真实的资源
- // success: function (res) {
- // if (res.statusCode === 200) {
- // console.log('下载成功');
- // }
- // }
- // });
- return environment.baseURL + url;
- },
- getFileName(url){
- let file = url.split('/');
- return file[file.length-1]
- },
- closePup(){
- this.returnMsg = "";
- this.$refs.popup.close()
- this.$refs.popupPass.close()
- this.$refs.popupConfirm.close()
- },
- toggle(status) {
- // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
- if(status == '02'){
- this.$refs.popup.open()
- }else{
- this.$refs.popupPass.open()
- }
- },
- handleApprove(status){
- if(status == '02' && this.returnMsg == ""){
- uni.showToast({
- icon: 'error',
- mask: true,
- title: '请输入驳回原因..',
- })
- return
- }
- //设置实体
- let bargainObj = {}
- let auditForm = {}
- if (status == '02') {
- //驳回
- bargainObj = {}
- auditForm = {
- // 审批流
- auditFlow: this.contractInfo.paymentMethod === '1' || this.contractInfo.paymentRatio !=='1' ? 3 :4,
- // 业务id 合同id
- businessId: this.contractId,
- // 审批结果
- status: 30,
- // 备注
- remark: '合同审批打回',
- // 业务参数
- businessObj: bargainObj
- }
- }else{
- //通过
- bargainObj = {
- paymentMethod:this.contractInfo.paymentMethod,
- paymentRatio:this.contractInfo.paymentRatio
- }
- auditForm = {
- // 审批流
- auditFlow: this.contractInfo.paymentMethod === '1' || this.contractInfo.paymentRatio !=='1' ? 3 :4,
- // 业务id 报价id
- businessId: this.contractId,
- // 审批结果
- status: 200,
- // 备注
- remark: '合同审批通过',
- // 业务参数
- businessObj: bargainObj
- }
- }
- if (status == '02') {
- auditForm.remark += ',驳回原因:'+ this.returnMsg
- }
- ApproveApi.audit(auditForm).then(res => {
- let nowTitle = ''
- if (res.code == 200){
- if (status == '02') {
- console.log("还是合同打回的操作")
- this.$set(this.contractInfo,"approveStatus","1")
- updateContract({...this.contractInfo}).then(res1=>{
- if(res1 && res1.code == 200){
- nowTitle = "合同打回成功"
- this.approveOpen = false
- }else{
- nowTitle = "合同打回失败"
- }
- })
- }else{
- console.log("开始合同审批的操作")
- this.$set(this.contractInfo,"approveStatus","2")
- editFlow({...this.contractInfo}).then(res2=>{
- if(res2 && res2.code == 200){
- nowTitle = "合同审批成功"
- }else{
- nowTitle = "合同审批失败"
- }
- })
- }
- setTimeout(() => {
- uni.showToast({
- icon: 'none',
- mask: true,
- title: nowTitle,
- })
-
- }, 500)
- //调回上一页
- this.goBack()
- }
- })
- },
- changeRate(item){
- if(item.discountRate < 1){
- item.discountRate = 1
- }
- if(item.discountRate > 100){
- item.discountRate = 100
- }
- //格式化
- item.discountRate = Number(item.discountRate).toFixed(4)
- //重新计算该梯形的折后价
- item.discountPrice = ((item.originalBasicPrice * item.discountRate) / 100 ) + item.originalOptionalPrice
- //重新计算同意价格
- let sum = 0
- //计算折扣前后的基价
- let basicPricePre = 0
- let basicPriceAft = 0
- let elevators = this.contractInfo.elevatorList
- elevators.some(it=>{
- sum += it.discountPrice * it.elevatorNumber
- basicPricePre += it.originalBasicPrice * it.elevatorNumber
- basicPriceAft += ((it.originalBasicPrice * it.discountRate * it.elevatorNumber) / 100 )
- })
- //重新计算折扣率
- let discountRate = (basicPriceAft / basicPricePre) * 100
- //重新设置接受价格
- this.contractInfo.acceptPrice = sum
- //折扣率格式化
- this.contractInfo.discountRate = Number(discountRate).toFixed(4)
- },
- stateFormat,
- stateFormatLow,
- getBargainInfo() {
- ApproveApi.contractById(this.contractId).then(res => {
- if (res.code == 200) {
- this.contractInfo = res.data
- //再次查询电梯信息
- this.getBargainLift();
- }
- })
- },
-
- getBargainLift() {
- ApproveApi.contractLiftByNo(this.contractInfo.contractNo).then(res => {
- if (res.code == 200) {
- this.$set(this.contractInfo,'elevatorList',res.rows)
- //计算总价
- if(res.rows){
- res.rows.some(item=>{
- this.totalPrice += ((item.unitPrice + item.additionalCost) * item.count)
- })
- }
- }
- })
- },
- goBack () {
- //uni.navigateBack({ delta: 1});
- uni.navigateTo({
- url: '/pages/work/approve/list'
- })
- }
- }
- }
- </script>
- <style>
- page {
- background-color: #EFF2F6;
- }
- </style>
- <style lang="scss" scoped>
- ::v-deep .Links {
- span {
- width: 100%;
- }
- }
- .list-card__price {
- width: 40%;
- }
- .card_bottom{
- display:flex;
- width: 100%;
- align-items: center;
- height: 75px;
- position:fixed;
- bottom: 0px;
- margin-left: 0px;
- background: #FFFFFF;
- .button-left {
- width: 48%;
- height: 84rpx;
- background: #FFF8F8;
- border-radius: 200rpx 0rpx 0rpx 200rpx;
- box-shadow: 0px 5px 6px 0px #EADEDF;
- .reject-text {
- font-size: 32rpx;
- color: #E60114;
- line-height: 44rpx;
- }
- }
- .button-right {
- width: 48%;
- height: 84rpx;
- background: linear-gradient(90deg, #DC0736 0%, #E60114 100%);
- box-shadow: 0px 5px 6px 0px #EADEDF;
- border-radius: 0rpx 200rpx 200rpx 0rpx;
- .pass-text {
- font-size: 32rpx;
- color: #FFFFFF;
- line-height: 44rpx;
- }
- }
- }
- .card-title{
- font-weight: 600;
- font-size: 16px;
- margin-bottom: 10px;
- }
- .txt-label {
- color: #3C485B;
- font-weight: 400;
- font-size: 12px;
- text-align: center;
- margin-bottom: 5px;
- }
- .txt-value {
- color: #000000;
- text-align: center;
- font-size: 16px;
- font-weight: 600;
- }
- .txt-value2 {
- color: #E60012;
- text-align: center;
- font-size: 16px;
- font-weight: 600;
- }
- .card__price{
- text-align: center;
- width: 90%;
- background-color: #FFF5F6;
- border-radius: 4px;
- padding:7px 5px;
- }
- .val-posi{
- width: 100%;
- text-align: right;
- font-size: 16px;
- }
- ::v-deep .u-badge--error {
- background-color: #E60114;
- }
- .flex-center {
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .flex-center-between {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 10px;
- }
- .flex-center-middle {
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .ml40 {
- margin-left: 40rpx
- }
- .mt32 {
- margin-top: 32rpx;
- }
- .list-content {
- // padding: 20rpx 24rpx;
- .button-icon {
- width: 28rpx;
- height: 28rpx;
- margin-right: 8rpx;
- }
- .divider {
- margin: 32rpx 0;
- border: 2rpx solid #E9EEF3;
- }
- .list-card {
- margin: 0px 24rpx;
- background: #FFFFFF;
- border-radius: 8rpx;
- padding: 32rpx;
- margin-bottom: 20rpx;
- &__title {
- font-weight: 600;
- font-size: 34rpx;
- color: #000000;
- line-height: 48rpx;
- width: 480rpx;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- &__area {
- font-size: 32rpx;
- color: rgba(0, 0, 0, 0.85);
- line-height: 32rpx;
- }
- &__text {
- font-size: 32rpx;
- color: #6B7688;
- line-height: 40rpx;
- }
- .developer {
- color: rgba(0, 0, 0, 0.85);
- width: 490rpx;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .button-icon {
- width: 28rpx;
- height: 28rpx;
- margin-right: 8rpx;
- }
- .button-left {
- width: 350rpx;
- height: 84rpx;
- background: #FFF8F8;
- border-radius: 200rpx 0rpx 0rpx 200rpx;
- box-shadow: 0rpx 4rpx 16rpx 0rpx #DFDFDF;
- .reject-text {
- font-size: 32rpx;
- color: #E60114;
- line-height: 44rpx;
- }
- }
- .button-right {
- width: 350rpx;
- height: 84rpx;
- background: linear-gradient(90deg, #DC0736 0%, #E60114 100%);
- box-shadow: 0rpx 4rpx 16rpx 0rpx #DFDFDF;
- border-radius: 0rpx 200rpx 200rpx 0rpx;
- .pass-text {
- font-size: 32rpx;
- color: #FFFFFF;
- line-height: 44rpx;
- }
- }
- }
- .popup-content {
- padding: 20rpx 20rpx;
- .return_content{
- width: 92%;
- padding: 20rpx 28rpx;
- background: #EFF2F6;
- border-radius: 4px;
- }
- .return_title{
- font-family: PingFangSC, PingFang SC;
- font-weight: 600;
- font-size: 16px;
- color: rgba(0,0,0,0.85);
- margin-bottom: 10rpx;
- }
- .button-icon {
- width: 28rpx;
- height: 28rpx;
- margin-right: 8rpx;
- }
- .button-left {
- width: 350rpx;
- height: 84rpx;
- background: #FFF8F8;
- border-radius: 200rpx 0rpx 0rpx 200rpx;
- box-shadow: 0px 2px 8px 0px #DFDFDF;
- .reject-text {
- font-size: 32rpx;
- color: #E60114;
- line-height: 44rpx;
- }
- }
- .button-right {
- width: 350rpx;
- height: 84rpx;
- background: linear-gradient(90deg, #DC0736 0%, #E60114 100%);
- border-radius: 0rpx 200rpx 200rpx 0rpx;
- box-shadow: 0px 2px 8px 0px #DFDFDF;
- .pass-text {
- font-size: 32rpx;
- color: #FFFFFF;
- line-height: 44rpx;
- }
- }
- .button-left-one {
- width: 220rpx;
- height: 84rpx;
- background: #FFF8F8;
- border-radius: 200rpx;
- box-shadow: 0px 2px 8px 0px #DFDFDF;
- .reject-text {
- font-size: 32rpx;
- color: #E60114;
- line-height: 44rpx;
- }
- }
- .button-right-one {
- width: 220rpx;
- height: 84rpx;
- background: linear-gradient(90deg, #DC0736 0%, #E60114 100%);
- border-radius: 200rpx;
- box-shadow: 0px 2px 8px 0px #DFDFDF;
- .pass-text {
- font-size: 32rpx;
- color: #FFFFFF;
- line-height: 44rpx;
- }
- }
- }
- }
- </style>
|