123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756 |
- <template>
- <view class="detail-page white-wrap">
- <view>
- <!-- 基础信息模块 -->
- <view class="section white-wrap base-info-wrap" v-if="info">
- <view class="title">
- {{ info.CompanyApprovalDetail.CompanyName }}
- <van-tag
- color="#ECF5FF"
- text-color="#4A83F1"
- style="margin-bottom:0;margin-left: 10rpx;"
- v-if="info.CompanyApprovalDetail.ApprovalCount>0"
- >
- 第{{ info.CompanyApprovalDetail.ApprovalCount }}次申请
- </van-tag>
- <van-tag
- type="warning"
- color="#f59a23"
- plain
- style="margin-left: 24rpx;font-weight: normal;"
- v-if="info.CompanyApprovalDetail.ContractSourceTag"
- >
- {{ info.CompanyApprovalDetail.ContractSourceTag }}
- </van-tag>
- </view>
- <view class="base-info-list">
- <block v-for="item in baseInfo">
- <view :key="item.key">
- <text class="lable">{{ item.key }}:</text>
- <text :style="{ color: item.color }" v-if="item.key==='合同期限'">{{showTermHandelr(item)}}</text>
- <text :style="{ color: item.color }" v-else>{{ item.val }}</text>
- <van-tag v-if="item.tag" color="#ECF5FF" text-color="#4A83F1" style="margin-left:5px">
- {{ item.tag }}
- </van-tag>
- </view>
- <view style="padding-left:140rpx;margin-top:-10px" v-if="item.key==='合同期限'">({{item.val|formateYear}})</view>
- </block>
-
- <view v-if="info && info.CompanyApprovalDetail.ApproveStatus === '驳回'">
- <text class="lable" style="color:#FE6B7C">驳回理由:</text>
- <text style="color:#FE6B7C">{{ info.CompanyApprovalDetail.ApproveRemark }}</text>
- </view>
- </view>
- <image :src="info.CompanyApprovalDetail.statusImg" mode="aspectFill" class="status-img"></image>
- <!-- view class="status-img pass-img" v-if="info.CompanyApprovalDetail.ApproveStatus==='已审批'"></view>
- <view class="status-img fail-img" v-if="info.CompanyApprovalDetail.ApproveStatus==='驳回'"></view> -->
- </view>
- <!-- 套餐模块 -->
- <view class="section white-wrap variety-wrap package-type" v-if="packageType">
- <view class="title setmeal">套餐类型</view>
- <van-tag color="#ECF5FF" text-color="#4A83F1" custom-class="package-tag">{{ packageType == 1 ? '大套餐' : '小套餐' }}</van-tag>
- </view>
- <!-- 品种模块 -->
- <view class="section white-wrap variety-wrap" v-if="varietyInfo">
- <view class="title">{{ varietyInfo.title }}</view>
- <view class="variety-list">
- <view class="variety-item flex" v-for="item in varietyInfo.list" :key="item.ClassifyName">
- <view class="lable">{{ item.ClassifyName }}:</view>
- <view class="content">
- <van-tag color="#ECF5FF" text-color="#4A83F1" v-for="tag in item.Items"
- :key="tag.ChartPermissionId" custom-class="tag">{{ tag.PermissionName }}</van-tag>
- </view>
- </view>
- </view>
- </view>
- <!-- 合同模块 -->
- <view class="section white-wrap contract-wrap" v-if="constractFiles.length !== 0">
- <view class="title">查看合同附件</view>
- <view class="contract-list">
- <view class="contract-item" v-for="item in constractFiles" :key="item.url"
- @click="preViewContract(item)">
- <image class="contract-img" mode="aspectFill" :src="item.img"></image>
- </view>
- </view>
- </view>
- <!-- 客户信息模块 -->
- <view class="section white-wrap customer-wrap" v-if="showCustomerInfo && info">
- <view class="title">客户信息</view>
- <view class="customer-main-info">
- <view class="customer-info-item">
- <text>客户名称:</text>
- <text>{{ info.CompanyApprovalDetail.CompanyName }}</text>
- </view>
- <view class="customer-info-item">
- <text>社会信用码:</text>
- <text>{{ info.CompanyApprovalDetail.CreditCode }}</text>
- </view>
- <view class="customer-info-item">
- <text>地址:</text>
- <text>{{ info.CompanyApprovalDetail.Address }}</text>
- </view>
- </view>
- <view class="customer-info-list flex">
- <view class="customer-info-item flex" style="width:50%">
- <text style="flexShrink:0">客户类型:</text>
- <text>{{ info.CompanyApprovalDetail.CompanyType }}</text>
- </view>
- <view class="customer-info-item flex" style="width:50%">
- <text style="flexShrink:0">客户状态:</text>
- <text>{{ info.CompanyApprovalDetail.Status }}</text>
- </view>
- <view class="customer-info-item flex" style="width:50%">
- <text style="flexShrink:0">客户来源:</text>
- <text>{{ info.CompanyApprovalDetail.Source }}</text>
- </view>
- <view class="customer-info-item flex" style="width:50%">
- <text style="flexShrink:0">行业:</text>
- <text>{{ info.CompanyApprovalDetail.IndustryName }}</text>
- </view>
- <view class="customer-info-item flex" style="width:50%">
- <text style="flexShrink:0">申请销售:</text>
- <text>{{ info.CompanyApprovalDetail.SellerName }}</text>
- </view>
- </view>
- </view>
-
- <!-- 流程模块 -->
- <view class="section process-wrap">
- <view class="title" style="font-size: 16px;font-weight: bold;">审批流程</view>
- <steps :data="info.FlowNodeList"></steps>
- </view>
- </view>
-
-
-
- <!-- 审批按钮 -->
- <view class="fix-bottom-wrap btns-wrap flex" v-if="info &&info.CompanyApprovalDetail.OpButton&& info.CompanyApprovalDetail.ApproveStatus === '待审批'">
- <button class="pass-btn" @click="handlePass">通过</button>
- <button class="refuse-btn" @click="handleRefuse">驳回</button>
- </view>
- <van-dialog id="van-dialog" />
- </view>
- </template>
- <script>
- import {apiCustomeDetail,apiCustomeContractDetail,apiCustomeApprove} from '@/api/approve/custome.js'
- import {preViewFile} from '../utils/util.js'
- import steps from '../components/steps.vue'
- import {CalculationDate} from '@/utils/calculationDate.js'
- export default {
- components:{
- steps
- },
- filters:{
- formateYear(time){
- let s=time.replace(/\./g, '-').split('~')[0]
- let e=time.replace(/\./g, '-').split('~')[1]
- return `有效期为 ${CalculationDate(s,e)} `;
- }
- },
- computed: {
- //是否显示客户信息模块
- showCustomerInfo() {
- if (this.info && (this.info.CompanyApprovalDetail.ApplyMethod === 2 || this.info.CompanyApprovalDetail
- .ApplyMethod === 4)) {
- return false;
- } else {
- return true;
- }
- },
- },
- data() {
- return {
- id: null,
- info: null,
- baseInfo: null, //顶部基础信息
- varietyInfo: null, //品种信息
- constractFiles: [], //合同文件
- packageType:'',//套餐类型
- };
- },
- onLoad(options) {
- this.id = options.id||0
- },
- onShow() {
- this.getDetail()
- },
- onPullDownRefresh() {
- this.getDetail()
- setTimeout(() => {
- uni.stopPullDownRefresh()
- }, 1000)
- },
- methods: {
- // 同意
- async handlePass() {
- const res = await apiCustomeApprove({
- CompanyApprovalId: Number(this.info.CompanyApprovalDetail.CompanyApprovalId),
- CompanyContractId: Number(this.info.CompanyApprovalDetail.CompanyContractId),
- CompanyId: Number(this.info.CompanyApprovalDetail.CompanyId),
- Remark: "",
- Status: 1,
- })
- if (res.code === 200) {
- this.$dialog.alert({
- title: "处理成功",
- confirmButtonColor: "#5890FB",
- }).then(() => {
- // on close
- this.getDetail()
- // 更新列表
- uni.$emit('customeApproveListUpdate',{CompanyApprovalId:this.id})
- });
- }
- },
-
- //拒绝
- handleRefuse(){
- const data=this.info.CompanyApprovalDetail
- uni.navigateTo({
- url:`./reason?CompanyApprovalId=${data.CompanyApprovalId}&CompanyContractId=${data.CompanyContractId}&CompanyId=${data.CompanyId}`
- })
- },
-
- // 获取审批单详情
- async getDetail() {
- const res = await apiCustomeDetail({
- ApprovalId: this.id
- })
- if (res.code === 200) {
- this.info = res.data
- console.log(this.info);
- // 初始化状态
- let statusImg=''
- switch(res.data.CompanyApprovalDetail.ApproveStatus){
- case '已审批':
- statusImg=require('../static/pass-icon.png')
- break;
- case '驳回':
- statusImg=require('../static/fail-icon.png')
- break;
- }
- this.info.CompanyApprovalDetail.statusImg=statusImg
-
- let contractInfo = null
- // 如果有合同id 则获取合同数据
- if (res.data.CompanyApprovalDetail.CompanyContractId != 0) {
- const contractRes = await apiCustomeContractDetail({
- CompanyId: res.data.CompanyApprovalDetail.CompanyId,
- CompanyContractId: res.data.CompanyApprovalDetail.CompanyContractId
- })
- if (contractRes.code === 200) {
- contractInfo = contractRes.data
- this.packageType = contractRes.data.PackageType
- }
- }
- this.initTopInfo(res.data, contractInfo)
- this.initVarietyInfo(res.data, contractInfo)
- this.initContractFiles(res.data, contractInfo)
- }
- },
- // 预览合同文件
- preViewContract(e) {
- if (e.type === "pdf") {
- preViewFile(e.url)
- } else {
- uni.previewImage({
- urls: [e.url]
- })
- }
- },
- // 初始化合同文件数据
- initContractFiles(info, contractInfo) {
- let arr = [];
- if (info && contractInfo && (info.CompanyApprovalDetail.ApplyMethod === 1 || info
- .CompanyApprovalDetail.ApplyMethod === 5||info
- .CompanyApprovalDetail.ApplyMethod === 6)) {
- const reg = /\.(pdf)|\.doc|\.docx$/;
- arr = contractInfo.ImgUrl.split("#").map((item) => {
- if (reg.test(item)) {
- return {
- type: "pdf",
- url: item,
- img: require("@/pages-approve/static/pdf.png"),
- };
- } else {
- return {
- type: "img",
- url: item,
- img: item,
- };
- }
- });
- }
- this.constractFiles = arr
- },
- // 初始化顶部数据
- initTopInfo(info, contractInfo) {
- let arr = [];
- //试用转正式
- if (info && contractInfo && info.CompanyApprovalDetail.ApplyMethod === 1) {
- uni.setNavigationBarTitle({
- title:'试用转正式'
- })
- arr = [{
- key: "合同编号",
- val: contractInfo.ContractCode,
- tag: contractInfo.ContractType,
- },
- {
- key: "合同期限",
- val: `${contractInfo.StartDate}~${contractInfo.EndDate}`.replace(/-/g, '.'),
- quarter:contractInfo.Quarter ||''
- },
- {
- key: "合同金额",
- val: contractInfo.Money+'元',
- color: "#FE6B7C",
- },
- {
- key: "付款方式",
- val: contractInfo.PayMethod,
- },
- {
- key: "付款渠道",
- val: contractInfo.PayChannel,
- },
- {
- key: "申请时间",
- val: info.CompanyApprovalDetail.ApprovalTime.replace(/-/g, '.'),
- },
- // {
- // key: "申请理由",
- // val: info.CompanyApprovalDetail.ApplyReasons || "无",
- // },
- ];
- }
- //冻结转试用
- if (info && info.CompanyApprovalDetail.ApplyMethod === 2) {
- uni.setNavigationBarTitle({
- title:'冻结转试用'
- })
- arr = [{
- key: "客户状态",
- val: info.CompanyApprovalDetail.Status,
- },
- {
- key: "冻结期限",
- val: `${info.CompanyApprovalDetail.FreezeStartDate}~${info.CompanyApprovalDetail.FreezeEndDate}`
- .replace(/-/g, '.'),
- },
- {
- key: "到期天数",
- val: info.CompanyApprovalDetail.FreezeExpireDays,
- },
- {
- key: "申请销售",
- val: info.CompanyApprovalDetail.ApplyRealName,
- },
- {
- key: "申请时间",
- val: info.CompanyApprovalDetail.ApprovalTime.replace(/-/g, '.'),
- },
- {
- key: "解冻理由",
- val: info.CompanyApprovalDetail.ApplyReasons,
- },
- ];
- }
- //试用延期
- if (info && info.CompanyApprovalDetail.ApplyMethod === 3) {
- uni.setNavigationBarTitle({
- title:'试用延期'
- })
- arr = [{
- key: "地址",
- val: info.CompanyApprovalDetail.Address,
- },
- {
- key: "申请时间",
- val: info.CompanyApprovalDetail.ApprovalTime.replace(/-/g, '.'),
- },
- {
- key: "申请理由",
- val: info.CompanyApprovalDetail.ApplyReasons,
- },
- ];
- }
- //原销售申请领取
- if (info && info.CompanyApprovalDetail.ApplyMethod === 4) {
- uni.setNavigationBarTitle({
- title:'原销售申请领取'
- })
- arr = [{
- key: "客户状态",
- val: info.CompanyApprovalDetail.Status,
- },
- {
- key: "原销售",
- val: info.CompanyApprovalDetail.SellerName,
- },
- {
- key: "申请销售",
- val: info.CompanyApprovalDetail.ApplyRealName,
- },
- {
- key: "申请时间",
- val: info.CompanyApprovalDetail.ApprovalTime.replace(/-/g, '.'),
- },
- {
- key: "申请理由",
- val: info.CompanyApprovalDetail.ApplyReasons,
- },
- ];
- }
- //续约申请/补充协议
- if (info && contractInfo && (info.CompanyApprovalDetail.ApplyMethod === 5||info.CompanyApprovalDetail.ApplyMethod===6)) {
- uni.setNavigationBarTitle({
- title:info.CompanyApprovalDetail.ApplyMethod === 5?'续约申请':'补充协议'
- })
- arr = [{
- key: "合同编号",
- val: contractInfo.ContractCode,
- tag: contractInfo.ContractType,
- },
- {
- key: "合同期限",
- val: `${contractInfo.StartDate}~${contractInfo.EndDate}`.replace(/-/g, '.'),
- quarter:contractInfo.Quarter||''
- },
- {
- key: "合同金额",
- val: contractInfo.Money+'元',
- color: "#FE6B7C",
- },
- {
- key: "付款方式",
- val: contractInfo.PayMethod,
- },
- {
- key: "付款渠道",
- val: contractInfo.PayChannel,
- },
- {
- key: "申请时间",
- val: info.CompanyApprovalDetail.ApprovalTime.replace(/-/g, '.'),
- },
- // {
- // key: "申请理由",
- // val: info.CompanyApprovalDetail.ApplyReasons || "无",
- // },
- ];
- }
- this.baseInfo = arr
- },
- // 初始化品种信息
- initVarietyInfo(info, contractInfo) {
- let usertype = this.$store.state.userInfo.ProductName; //用户身份类型admin,ficc,权益
- let arr = [];
- let obj = {
- title: "",
- list: [],
- };
- //试用转正式
- if (info && contractInfo && info.CompanyApprovalDetail.ApplyMethod === 1) {
- obj.title = "购买品种";
- arr = contractInfo.PermissionList;
- if (!arr) return obj;
- arr.forEach((item) => {
- let temarr = item.Items.filter((e) => {
- let flag = item.CheckList.includes(e.ChartPermissionId);
- if (flag) return e;
- });
- if (temarr.length !== 0) {
- obj.list.push({
- ClassifyName: item.ClassifyName,
- Items: temarr,
- });
- }
- });
- }
- //冻结转试用
- if (info && info.CompanyApprovalDetail.ApplyMethod === 2) {
- obj.title = "申请品种";
- if (usertype === "ficc") {
- arr = info.FiccPermissionList;
- } else if (usertype === "权益") {
- arr = info.PermissionList;
- } else if (usertype === "admin") {
- if (info.FiccPermissionList) {
- arr = [...info.FiccPermissionList];
- }
- if (info.PermissionList) {
- arr = [...info.PermissionList];
- }
- }
- if (!arr) return obj;
- arr.forEach((item) => {
- let temarr = item.Items.filter((e) => {
- let flag = item.CheckList.includes(e.ChartPermissionId);
- if (flag) return e;
- });
- if (temarr.length !== 0) {
- obj.list.push({
- ClassifyName: item.ClassifyName,
- Items: temarr,
- });
- }
- });
- }
- //试用延期
- if (info && info.CompanyApprovalDetail.ApplyMethod === 3) {
- obj.title = "申请品种";
- if (usertype === "ficc") {
- arr = info.FiccPermissionList;
- } else if (usertype === "权益") {
- arr = info.PermissionList;
- } else if (usertype === "admin") {
- if (info.FiccPermissionList) {
- arr = [...info.FiccPermissionList];
- }
- if (info.PermissionList) {
- arr = [...info.PermissionList];
- }
- }
- if (!arr) return obj;
- arr.forEach((item) => {
- let temarr = item.Items.filter((e) => {
- let flag = item.CheckList.includes(e.ChartPermissionId);
- if (flag) return e;
- });
- if (temarr.length !== 0) {
- obj.list.push({
- ClassifyName: item.ClassifyName,
- Items: temarr,
- });
- }
- });
- }
- //原销售申请领取
- if (info && info.CompanyApprovalDetail.ApplyMethod === 4) {
- obj.title = "申请品种";
- if (usertype === "ficc") {
- arr = info.FiccPermissionList;
- } else if (usertype === "权益") {
- arr = info.PermissionList;
- } else if (usertype === "admin") {
- if (info.FiccPermissionList) {
- arr = [...info.FiccPermissionList];
- }
- if (info.PermissionList) {
- arr = [...info.PermissionList];
- }
- }
- if (!arr) return obj;
- arr.forEach((item) => {
- let temarr = item.Items.filter((e) => {
- let flag = item.CheckList.includes(e.ChartPermissionId);
- if (flag) return e;
- });
- if (temarr.length !== 0) {
- obj.list.push({
- ClassifyName: item.ClassifyName,
- Items: temarr,
- });
- }
- });
- }
- //续约申请/补充协议
- if (info && contractInfo && (info.CompanyApprovalDetail.ApplyMethod === 5||info.CompanyApprovalDetail.ApplyMethod===6)) {
- obj.title = "购买品种";
- arr = contractInfo.PermissionList;
- if (!arr) return obj;
- arr.forEach((item) => {
- let temarr = item.Items.filter((e) => {
- let flag = item.CheckList.includes(e.ChartPermissionId);
- if (flag) return e;
- });
- if (temarr.length !== 0) {
- obj.list.push({
- ClassifyName: item.ClassifyName,
- Items: temarr,
- });
- }
- });
- }
- this.varietyInfo = obj
- },
- // 合同期限
- showTermHandelr(item) {
- let str = item.quarter? `${item.quarter}(${item.val})` : item.val
- return str
- }
- },
- }
- </script>
- <style lang="scss">
- .detail-page {
- width: 100%;
- min-height: 100vh;
- padding-bottom: calc(150rpx + constant(safe-area-inset-bottom));
- padding-bottom: calc(150rpx + env(safe-area-inset-bottom));
- }
- .section {
- padding: 30rpx 34rpx;
- border-bottom: 14rpx solid #f5f5f5;
- &:last-child {
- margin-bottom: 0;
- border: none;
- }
- .title {
- font-size: 16px;
- font-weight: bold;
- margin: 0 0 40rpx 0;
- }
- .setmeal {
- margin: 0;
- }
- .lable {
- color: #666;
- flex-shrink: 0;
- font-size: 14px;
- }
- }
- .base-info-wrap {
- position: relative;
- .title {
- margin: 0 0 40rpx 0;
- &::before {
- content: "";
- display: inline-block;
- width: 15px;
- height: 17px;
- background-image: url("@/static/man.png");
- background-size: cover;
- background-repeat: no-repeat;
- margin-right: 10rpx;
- position: relative;
- top: 4rpx;
- }
- }
- .base-info-list {
- font-size: 14px;
- color: #000;
- view {
- margin-bottom: 10px;
- display: flex;
- }
- }
-
- .status-img{
- position: absolute;
- width: 220rpx;
- height: 220rpx;
- right: 0;
- top: 100rpx;
- }
- }
- .package-type {
- display: flex !important;
- align-items: center;
- .package-tag {
- margin-left: 15rpx;
- }
- }
- .variety-wrap {
- .variety-item {
- padding-top: 24rpx;
- padding-bottom: 24rpx;
- border-bottom: 1px dashed rgba(112, 112, 112, 0.2);
- }
- .variety-item:first-child {
- padding-top: 0;
- }
- .variety-item:last-child {
- border-bottom: none;
- }
- .tag {
- margin-right: 10rpx;
- margin-bottom: 10rpx;
- }
- }
- .contract-list {
- display: flex;
- flex-wrap: wrap;
- .contract-img {
- width: 102rpx;
- height: 120rpx;
- }
- }
- .customer-main-info {
- padding-bottom: 40rpx;
- border-bottom: 1px dashed rgba(112, 112, 112, 0.2);
- }
- .customer-info-item {
- font-size: 14px;
- color: #999;
- margin-bottom: 20rpx;
- }
- .customer-info-list {
- flex-wrap: wrap;
- padding-top: 20rpx;
- }
- .btns-wrap {
- justify-content: center;
- button {
- width: 260rpx;
- height: 70rpx;
- border-radius: 28px;
- border: none;
- margin: 0 15px;
- font-size: 15px;
- color: #fff;
- line-height: 70rpx;
- }
- .pass-btn {
- background-color: #5890fb;
- }
- .refuse-btn {
- background-color: #f55768;
- }
- }
- </style>
|