工单开发-WEB

一、工单注册

1.填写信息/地址

2.配置节点-【功能按钮/人员/岗位/消息提醒】


二、引入 pai-sp-ui

安装 插件库

npm install @flyriselink/pai-sp-ui -S

import Vue from 'vue'
import paispui from '@flyriselink/pai-sp-ui'
import Cookies from 'js-cookie'

// 引入样式文件
import '@flyriselink/pai-sp-ui/dist/paispui.css'

export default ({ store }) => {
    // 初始化
    Vue.use(paispui, {
        // 接口地址
        baseURL: process.env.REQUEST_BASE_URL,
        // 获取token方法
        token: () => {
            return Cookies.get(process.env.TOKEN_KEY)
        },
    })
}

三、工单上报


1、注意:上报的前提:
  • ①、先注册工单,复制 orderKey
  • ②、业务执行保存后,返回id
  • ③、中台 entId != 档案 enterprise,需先转换

2、调用档案匹配组件
第3点的 enterprise 可以使用组件 <sp-enterprise-match /> 获取中台入驻企业的entId 在企业档案里的id

<sp-enterprise-match v-model="enterprise" :entId="entId" :parkId="parkId"/>

3、执行上报
// 上报
this.$paispui.workOrder.report({
  "bizId": "1234566666666666",
  "orderKey": "1494203921034514432",
  "parkId": "1433617920071446528",
  "title": "SP-UI上报工单标题",
  "enterprise": "1433617920071446529",
  "priority": 1
}) .then((res) => {
    console.log('上报成功')
})
参数 说明 类型 必填
bizId 业务ID String
orderKey 工单编号 String
parkId 园区ID String
title 工单上报标题 String
serialId 流水号 String
enterprise 企业ID,企业档案的ID String
priority 优先级,1一般,2紧急,3非常紧急 Number / String

四、工单处理

1.一般在【受理中心】、【我的工单】应用里处理
- 受理中心:

- 我的工单:


2.单独执行处理时:

使用【工单引擎组件】<sp-work-order />

<template>
    <sp-work-order
    :dialog.sync="handleDialog"
    :readOnly="false"
    :entId="'1433617920071446529'"
    @update="updateList"
    ></sp-work-order>
</template>

<script>
export default {
  data() {
      return {
        handleDialog: {
            visible: false,
            id: '1507195874022633474',
        },
    }
  },
  methods: {
    updateList() {
      console.log('更新列表')
    },
  },
}
</script>
办理时需传入:
  • id: 工单流程实例ID
  • visible: true, 打开显示弹窗,办理/处理页面

pai-sp-ui 文档链接:https://pai.flyrise.cn/pai-sp-ui/#/docs/work-order


五、工单评价

使用【工单引擎组件】<sp-work-order-evaluation />
<template>
    <div>
        <sp-work-order-evaluation
        :dialog.sync="evaDialog"
        :bizUrl="evaDialog.bizUrl"
        @update="updateList"
        ></sp-work-order-evaluation>

        <el-button @click="clickHandle">评价</el-button>
        <el-button @click="clickViewEva">已评价</el-button>
    </div>
</template>

<script>
export default {
  data() {
      return {
        evaDialog: {
          visible: false,
          parkId: '1433617920071446528',
          bizUrl: '/service-property-repairs-api/repairs/v1/customer/evaluate'
        },
    }
  },
  methods: {
      clickHandle() {
          this.evaDialog.type = 'add'
          this.evaDialog.title = '物业报修工单 xxx'
          this.evaDialog.id = '1497402882945126402'
          this.evaDialog.visible = true
      },
      clickViewEva() {
          this.evaDialog.type = 'view'
          this.evaDialog.title = '物业报修工单 xxx'
          this.evaDialog.id = '1497402882945126402'
          this.evaDialog.visible = true
      },
  },
}
</script>
一般情况:需要判断状态为已验收后,进行评价

parkId: 需传入当前园区id
bizUrl: 为业务评价的接口后端 api
type: add 为新增评价,需传入业务id
type: view 为查看评价,需传入业务id


文档更新时间: 2022-07-01 10:29   作者:戴均豪