| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- <!--
- * @Title:
- * @Description: 任务转派
- * @Author: swp
- * @Date: 2022-08-24 10:49:21
- * @LastEditors:
- * @LastEditTime: 2022-08-24 10:49:21
- -->
- <template>
- <view class="wrap">
- <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
- @clickLeft="toBack">
- <view class="nav-title">
- <text>{{title}}</text>
- </view>
- </uni-nav-bar>
- <view class="container">
- <uni-section title="当前负责人" type="circle">
- <uni-group>
- <view>{{contactUserName}}</view>
- </uni-group>
- </uni-section>
- <uni-section title="指派给" type="circle">
- <uni-group>
- <uni-data-select v-model="selectedPersonId" :localdata="servicePersonList" @change="selectChange"
- placeholder="请选择运维人员">
- </uni-data-select>
- </uni-group>
- </uni-section>
- <view class="view-btn">
- <button style="background-color: lightcoral;" type="default" @click="toOrderChange()">确认转派</button>
- </view>
- </view>
- </view>
- </template>
- <script>
- import http from '@/http/api.js';
- export default {
- components: {
- },
- onLoad(option) {
- this.orderId = option.orderId;
- this.contactUserName = option.contactUserName;
- this.getServicePersonList();
- },
- data() {
- return {
- orderId: '',
- contactUserName: '',
- selectedPersonId: '',
- servicePersonList: [],
- title: '维修任务转派',
- desc: '',
- }
- },
- computed: {
- },
- onShow() {
- },
- created() {
- },
- methods: {
- toBack() {
- uni.navigateBack({
- delta: 1
- })
- },
- selectChange(e) {
- },
- getServicePersonList() {
- let that = this;
- http.request({
- url: '/galaxy-business/serviceperson/list',
- method: 'GET',
- }).then(res => {
- //console.log("list " + JSON.stringify(res))
- if (res.success) {
- let persons = res.data.map(function(item) {
- let person = {};
- person['value'] = item.id;
- person['text'] = item.realName;
- return person;
- })
- that.servicePersonList = persons;
- }
- }).catch(err => {
- console.log(err)
- })
- },
- toOrderChange() {
- let that = this;
- var postData = {};
- postData['id'] = '' + this.orderId;
- postData['servicePersonId'] = '' + this.selectedPersonId;
- //console.log(postData)
- http.request({
- url: '/galaxy-business/rtu/check/order/change',
- method: 'POST',
- data: postData
- }).then(res => {
- if (res.success) {
- uni.showModal({
- content: '任务指派操作已成功!',
- showCancel: true,
- success(res) {
- if (res.confirm) {
- that.toBack();
- }
- }
- });
- } else {
- uni.showModal({
- content: '任务指派操作失败!',
- showCancel: true,
- success(res) {
- }
- });
- }
- }).catch(err => {
- console.log(err)
- })
- },
- }
- }
- </script>
- <style>
- /* page {
- background-color: rgb(240, 242, 244);
- } */
- </style>
- <style lang="scss" scoped>
- .view-btn {
- margin-top: 10px;
- margin-bottom: 10px;
- padding-left: 10px;
- padding-right: 10px;
- }
- </style>
|