| | |
| | | <view> |
| | | <!-- 输入框示例 --> |
| | | <uni-popup ref="inputDialog" type="dialog"> |
| | | <uni-popup-dialog ref="inputClose" mode="input" title="添加跟进人" value="对话框预置提示内容!" |
| | | <uni-popup-dialog ref="inputClose" mode="input" title="选择规划员" |
| | | placeholder="请输入内容" @confirm="confirm"> |
| | | <uni-combox :candidates="addFollower.followers" placeholder="请选择" |
| | | v-model="addFollower.follower" @input="autoLoad('follower',addFollower.follower)"></uni-combox> |
| | | <uni-combox :candidates="planners" placeholder="请选择" |
| | | v-model="planner" @input="autoLoad('planner',planner)"></uni-combox> |
| | | </uni-popup-dialog> |
| | | </uni-popup> |
| | | </view> |
| | | |
| | | <view class="foot"> |
| | | <button size="mini" type="primary" @click="edite(id)">修改</button> |
| | | <button v-show="((((detl.settle == 2 || detl.settle == 3) && detl.settleSize==4) || detl.settle == 1) && user.id == detl.director)" |
| | | size="mini" type="primary" @click="approval(id)">审批</button> |
| | | <button v-show="(((detl.settle == 2 || detl.settle == 3)&& detl.settleSize==4) && user.id == detl.director)" |
| | | size="mini" type="primary" @click="approvalEnd(id)">回退审批</button> |
| | | <button v-show="(detl.settle == 1 && user.id == detl.userId)" |
| | | size="mini" type="primary" @click="edite(id)">修改</button> |
| | | <!-- <button size="mini" type="warn" @click="del(id)">删除</button> --> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import user from '@/pages/api/user/user.js' |
| | | export default { |
| | | data() { |
| | | return { |
| | | planner: '', |
| | | plannerId: '', |
| | | planners: [], |
| | | plannerList: [], |
| | | nowUserId: '', // 当前登录人员 user.userId |
| | | director: '', // 当前节点审核 dire |
| | | userId: '', // 当前任务业务员 userid |
| | | user: { |
| | | username: '', |
| | | id: 0, |
| | | type: '' |
| | | }, |
| | | current: 1, |
| | | id: 0, |
| | | detl: { |
| | |
| | | } |
| | | }, |
| | | onLoad(option) { |
| | | console.log(option); |
| | | this.current = 1 |
| | | if (JSON.stringify(option) != "{}") { |
| | | this.id = option.id |
| | | this.init() |
| | |
| | | let _this = this |
| | | const eventChannel = this.getOpenerEventChannel(); |
| | | eventChannel.on('saleManage', function(data) { |
| | | console.log(data); |
| | | _this.id = data.data |
| | | _this.init() |
| | | }) |
| | | } |
| | | }, |
| | | onShow() { |
| | | this.getDetail() |
| | | }, |
| | | methods: { |
| | | // 获取用户信息 |
| | | async getDetail() { |
| | | let res = await user.getDetail() |
| | | if (res.code === 200) { |
| | | this.user.username = res.data.username |
| | | this.user.id = res.data.id |
| | | } else if (res.code === 403) { |
| | | this.backLogin(res) |
| | | } |
| | | }, |
| | | // 初始化 |
| | | init() { |
| | | let that = this |
| | | that.info = [] |
| | |
| | | } |
| | | }) |
| | | }, |
| | | // 删除 |
| | | del(e) { |
| | | let that = this |
| | | e = Number(e) |
| | |
| | | addPerson() { |
| | | this.$refs.inputDialog.open() |
| | | }, |
| | | // 确认选择工作人 |
| | | confirm() { |
| | | let that = this |
| | | var followerId |
| | | var followerList = that.addFollower.followerList |
| | | for (var i = 0;i < followerList.length; i++) { |
| | | if (followerList[i].name == this.addFollower.follower) { |
| | | followerId =followerList[i].value |
| | | } |
| | | } |
| | | uni.request({ |
| | | url: that.baseUrl + '/detl/followers/add/json', |
| | | header:{'token':uni.getStorageSync('token'), |
| | | // 'content-type':'application/x-www-form-urlencoded', |
| | | }, |
| | | data: { |
| | | cstmrId: that.cstmrId, |
| | | followerIds:followerId}, |
| | | method: 'POST', |
| | | success(result) { |
| | | var res = result.data |
| | | that.getFollowers() |
| | | } |
| | | }) |
| | | this.addFollower.follower = '' |
| | | }, |
| | | // 工作人列表 |
| | | autoLoad(type,condition) { |
| | | let that = this |
| | | that.addFollower.followers = [] |
| | | that.addFollower.followerList = [] |
| | | uni.request({ |
| | | url: that.baseUrl + '/user/all/get/kv', |
| | | header:{'token':uni.getStorageSync('token')}, |
| | | data: {condition:condition}, |
| | | url: that.baseUrl + '/plan/planner/list/auth', |
| | | header:{ |
| | | 'token':uni.getStorageSync('token'), |
| | | 'content-type': 'application/x-www-form-urlencoded;charset=UTF-8' |
| | | }, |
| | | sslVerify: false, |
| | | data: {planId:condition}, |
| | | method: 'POST', |
| | | success(result) { |
| | | var res = result.data |
| | | if (res.code === 200) { |
| | | var element; |
| | | if (type == 'follower') { |
| | | for(element of res.data) { |
| | | that.addFollower.followers.push(element.name) |
| | | that.addFollower.followerList.push(element) |
| | | if (res.data) { |
| | | for (let k of res.data) { |
| | | that.planners.push(k.name) |
| | | that.plannerList.push(k) |
| | | } |
| | | return |
| | | } |
| | | } |
| | | } |
| | |
| | | url: url |
| | | }) |
| | | }, |
| | | // 审批 |
| | | approval() { |
| | | let _this = this |
| | | this.$refs.inputDialog.open() |
| | | this.autoLoad("type",this.detl.id) |
| | | }, |
| | | // 规划员审批 |
| | | confirm() { |
| | | for (let element of this.plannerList) { |
| | | if(element.value == this.planner) { |
| | | this.plannerId = element.value |
| | | } |
| | | } |
| | | let _this = this |
| | | uni.request({ |
| | | url: `${_this.baseUrl}/plan/approval/auth`, |
| | | header: { |
| | | 'token':uni.getStorageSync('token'), |
| | | 'content-type': 'application/x-www-form-urlencoded;charset=UTF-8' |
| | | }, |
| | | sslVerify: false, |
| | | data: { |
| | | planId: _this.detl.id, |
| | | plannerId: _this.plannerId |
| | | }, |
| | | method: 'POST', |
| | | success(res) { |
| | | res = res.data |
| | | uni.showToast({title: res.msg, icon: "none", position: 'top'}) |
| | | uni.navigateBack() |
| | | } |
| | | }) |
| | | }, |
| | | approvalEnd() { |
| | | let _this = this |
| | | uni.request({ |
| | | url: `${_this.baseUrl}/plan/approvalEnd/auth`, |
| | | header: { |
| | | 'token':uni.getStorageSync('token'), |
| | | 'content-type': 'application/x-www-form-urlencoded;charset=UTF-8' |
| | | }, |
| | | sslVerify: false, |
| | | data: { planId: _this.detl.id }, |
| | | method: 'POST', |
| | | success(res) { |
| | | res = res.data |
| | | uni.showToast({title: res.msg, icon: "none", position: 'top'}) |
| | | uni.navigateBack() |
| | | } |
| | | }) |
| | | }, |
| | | backLogin(res) { |
| | | uni.showToast({title: res.msg, icon: "none", position: 'top'}) |
| | | setTimeout(() => { |
| | | uni.reLaunch({ |
| | | url: '../../login/login' |
| | | }); |
| | | }, 1000); |
| | | }, |
| | | } |
| | | } |
| | | </script> |