| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <template>
- <view>
- <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="转派巡点检工单" @clickLeft="back"></uni-nav-bar>
- <view class="page-bottom-padding">
- <template>
- <CellTip title="转派信息"> </CellTip>
- <TurnSendList :executorInfo="executorInfo" :code="code" @change="getRedeployCause"></TurnSendList>
- </template>
- <template v-if="worksheetInfo">
- <CellTip title="基本信息"> </CellTip>
- <DetailMain :detailsInfo="tourTallyDetailFn(worksheetInfo)"></DetailMain>
- </template>
- </view>
- <button class="btn-submit" @click="bindSubmit" :loading="loading">
- 提交
- </button>
- </view>
- </template>
- <script>
- import {
- get,postJ
- } from "@/utils/api.js"
- import {
- tourTallyDetailFn
- } from '@/utils/common.js'
- import DetailMain from '@/components/DetailMain.vue'
- import TurnSendList from '@/components/TurnSendList.vue'
- import CellTip from '@/components/CellTip.vue'
- import CellInfo from '@/components/CellInfo.vue'
- export default {
- components: {
- DetailMain,
- TurnSendList,
- CellTip,
- CellInfo
- },
- data() {
- return {
- pageId:'',
- loading:false,
- worksheetInfo: null,
- tourTallyDetailFn,
- executorInfo: null,
- redeployCause:'',
- code:""
- }
- },
- onLoad(options) {
- this.pageId = options.id;
- this.getInfo();
- },
- onShow() {
- //转派人员信息
- this.executorInfo = this.$store.state.tour_tally.executorInfo;
- },
- methods: {
- getInfo(){
- get(this.apiUrl + "/patrol/order/getDetail/"+this.pageId).then(res=>{
- this.worksheetInfo = res.data;
- this.code = this.worksheetInfo.plan.executeDeptCode
- })
- },
- getRedeployCause(e){
- this.redeployCause = e.detail.value;
- },
- bindSubmit(){
-
- if(!this.executorInfo || !this.executorInfo.executorId){
- uni.showToast({
- title:'请选择转派人员',
- icon:'none'
- })
- return
- }
- if(!this.redeployCause){
- uni.showToast({
- title:'请输入转派原因',
- icon:'none'
- })
- return
- }
- let data = {
- userId: this.executorInfo.executorId,
- userName: this.executorInfo.executorName,
- woId: this.pageId,
- }
- this.loading=true
- postJ(this.apiUrl+ "/patrol/order/transfer",data).then(res=>{
- this.loading=false
- setTimeout(()=>{
- this.back(2)
- },2000)
- uni.showToast({
- title:'转派成功',
- })
- }).catch(err=>{
- uni.showToast({
- title:err.message || '转派失败',
- icon:'none'
- })
- })
- },
-
- }
- }
- </script>
- <style lang="scss" scoped>
- input{
- text-align: right;
- color: $uni-text-color-grey;
- font-size: $uni-font-size-base;
- }
- </style>
|