linwenxin 5 månader sedan
förälder
incheckning
3d1901395f

+ 25 - 0
src/api/cloudCall.js

@@ -0,0 +1,25 @@
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+
+export function commonUnicomeCall(params) {
+  return request({
+    url: '/unCall/unicome/call',
+    method: 'post',
+    params
+  })
+}
+
+export function commonUnicomeConfigSave(params) {
+  return request({
+    url: '/unCall/unicome/config/save',
+    method: 'post',
+    params
+  })
+}
+
+export function unCallListOrder(data) {
+  return request({
+    url: `/unCall/listOrder?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}

+ 5 - 1
src/views/workOrder/workOrderPool/detail.vue

@@ -3,6 +3,7 @@
     <el-tabs v-model="activeName" type="card" :lazy="true" @tab-click="handleClick">
       <el-tab-pane label="工单信息" name="workOrderInfo" key="workOrderInfo"> </el-tab-pane>
       <el-tab-pane v-if="!isThreeOrder" label="操作明细" name="operationDetails" key="operationDetails"> </el-tab-pane>
+      <el-tab-pane v-if="!isThreeOrder" label="通话记录" name="CallLog" key="CallLog"> </el-tab-pane>
       <el-tab-pane v-if="!isThreeOrder" label="完工明细" name="detailsCompletion" key="detailsCompletion"></el-tab-pane>
       <el-tab-pane v-if="!isThreeOrder" label="支付费用" name="payFee" key="payFee"></el-tab-pane>
       <el-tab-pane v-if="!isThreeOrder && EvaluationShow" label="评价信息" name="Evaluation" key="Evaluation">
@@ -32,6 +33,7 @@
         <workOrderInfo :id="id" ref="workOrderInfo" :workOrderType="workOrderType" />
       </div>
       <OperationDetail v-if="activeName == 'operationDetails'" :id="id" ref="operationDetails" />
+      <CallLog v-if="activeName == 'CallLog'" :id="id" ref="CallLog" />
       <CompletionDetails v-if="activeName == 'detailsCompletion'" :id="id" ref="detailsCompletion" />
       <Payment v-if="activeName == 'payFee'" :id="id" ref="payFee" :workOrderType="workOrderType" />
       <Evaluation v-if="activeName == 'Evaluation' && EvaluationShow" :id="id" ref="Evaluation" />
@@ -53,6 +55,7 @@ import Payment from './detailModule/Payment/index.vue'
 import Evaluation from './detailModule/Evaluation/index.vue'
 import SettleAccounts from './detailModule/SettleAccounts/index.vue'
 import PartsApplication from './detailModule/PartsApplication/index.vue'
+import CallLog from './detailModule/CallLog/index.vue'
 import { orderBaseDetail } from '@/api/workOrderPool.js'
 export default {
   components: {
@@ -62,7 +65,8 @@ export default {
     Payment,
     Evaluation,
     SettleAccounts,
-    PartsApplication
+    PartsApplication,
+    CallLog
   },
   props: {
     id: {

+ 129 - 0
src/views/workOrder/workOrderPool/detailModule/CallLog/index.vue

@@ -0,0 +1,129 @@
+<template>
+  <zj-form-container>
+    <zj-form-module title="通话记录">
+      <zj-table
+        ref="tableEl"
+        :is-drop="true"
+        :columns="callLogColumns"
+        :table-data="callLogData"
+        :table-attributes="{
+          border: true
+        }"
+      />
+    </zj-form-module>
+  </zj-form-container>
+</template>
+
+<script>
+import { unCallListOrder } from '@/api/cloudCall.js'
+export default {
+  props: {
+    id: {
+      type: [String, Number],
+      default: null
+    }
+  },
+  data() {
+    return {
+      callLogData: []
+    }
+  },
+  computed: {
+    callLogColumns() {
+      return [
+        {
+          columnAttributes: {
+            label: '呼叫方式',
+            prop: 'callDirection'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '通话类型',
+            prop: 'callType'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '通话发起时间',
+            prop: 'callStartTime',
+            'min-width': 130
+          }
+        },
+        {
+          columnAttributes: {
+            label: '客户手机号',
+            prop: 'userMobile',
+            'min-width': 130
+          }
+        },
+
+        {
+          columnAttributes: {
+            label: '后台云呼信息',
+            width: 170,
+            prop: 'backTel'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '通话时长(秒)',
+            prop: 'callHoldTime',
+            width: 130
+          }
+        },
+        {
+          columnAttributes: {
+            label: '振铃时长(秒)',
+            prop: 'callWaitTime',
+            width: 130
+          },
+          render: (_h, { row, column, $index }) => {
+            const { callWaitTime } = row
+            return <div style="margin:13px  0 0  0">{callWaitTime ? Number(callWaitTime) / 1000 : 0}</div>
+          }
+        },
+        {
+          columnAttributes: {
+            label: '通话录音',
+            prop: 'fileUrl',
+            'min-width': 300
+          },
+          render: (_h, { row, column, $index }) => {
+            const { fileUrl } = row
+            return (
+              <div style="margin:13px  0 0  0">
+                <audio controls>
+                  <source src={fileUrl} type="audio/ogg" contentEditable="true" />
+                  <source src={fileUrl} type="audio/mpeg" contentEditable="true" />
+                </audio>
+              </div>
+            )
+          }
+        }
+      ]
+    }
+  },
+  mounted() {
+    this.getOrderQualityLis2()
+  },
+  methods: {
+    getOrderQualityLis2() {
+      let params = {
+        pageNum: 1,
+        pageSize: -1,
+        params: [{ param: 'a.order_base_id', compare: 'like', value: this.id }]
+      }
+      unCallListOrder(params).then(res => {
+        this.callLogData = res.data.records
+      })
+    }
+  }
+}
+</script>
+
+<style>
+a {
+  justify-content: space-between;
+}
+</style>

+ 138 - 0
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/buttons/cloudCall.vue

@@ -0,0 +1,138 @@
+<template>
+  <div class="withinLine_cloud_call">
+    <i class="el-icon-phone" @click="letClick" @contextmenu.prevent.stop="rigClick"></i>
+    <el-dialog
+      :modal="true"
+      title="设置联通云呼登入名"
+      :visible.sync="dialogbol"
+      width="700px"
+      :show-close="false"
+      :close-on-click-modal="false"
+      :modal-append-to-body="true"
+      :append-to-body="true"
+    >
+      <el-form :model="form" :rules="formRules" ref="ruleForm" label-width="130px" label-position="top">
+        <el-form-item label="联通云呼登录名" prop="unicomIntegratedId">
+          <el-input style="width: 300px" v-model="form.unicomIntegratedId"></el-input>
+        </el-form-item>
+        <el-form-item label="联通云呼-接听方式" prop="unicomIntegratedType">
+          <el-radio-group v-model="form.unicomIntegratedType">
+            <el-radio label="ExtenType">支持三种方式</el-radio>
+            <el-radio label="Local">直线方式</el-radio>
+            <el-radio label="sip">软电话</el-radio>
+            <el-radio label="gateway">语音网关/IP话机</el-radio>
+          </el-radio-group>
+          <div>
+            (<span style="color: red">选择任意一种成功即可,不成功就换个方式试试</span
+            >)对应云呼平台登录界面选择的接听方式。
+          </div>
+          <div>(按对方平台说的两个地方都选择IP话机,可以不需要每天都登录)</div>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button size="mini" @click="Cancel">取 消</el-button>
+        <el-button size="mini" @click="Confirm" type="primary">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { commonUnicomeCall, commonUnicomeConfigSave } from '@/api/cloudCall.js'
+import buttonMixin from './button_mixin.js'
+export default {
+  mixins: [buttonMixin],
+
+  props: {
+    phone: {
+      type: [String, Number],
+      default: ''
+    }
+  },
+
+  data() {
+    return {
+      dialogbol: false,
+      form: {
+        unicomIntegratedId: '',
+        unicomIntegratedType: ''
+      },
+      formRules: {
+        unicomIntegratedId: [{ required: true, message: '请输入', trigger: 'blur' }],
+        unicomIntegratedType: [{ required: true, message: '请选择', trigger: 'change' }]
+      }
+    }
+  },
+  methods: {
+    letClick() {
+      if (this.phone) {
+        commonUnicomeCall({
+          orderBaseId: this?.orderInfo?.id,
+          phone: this.phone
+        }).then(res => {
+          this.$message({
+            type: 'success',
+            message: '成功'
+          })
+        })
+      } else {
+        this.$message({
+          type: 'warning',
+          message: '请先选择工程师'
+        })
+        return
+      }
+    },
+    rigClick() {
+      var { unicomIntegratedId, unicomIntegratedType } = JSON.parse(localStorage.getItem('supply_user'))
+      this.form.unicomIntegratedId = unicomIntegratedId || ''
+      this.form.unicomIntegratedType = unicomIntegratedType || ''
+      this.dialogbol = true
+    },
+    Cancel() {
+      this.dialogbol = false
+    },
+    Confirm() {
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          commonUnicomeConfigSave(this.form).then(res => {
+            this.$store.dispatch('user/getInfo')
+            this.$message({
+              type: 'success',
+              message: '设置成功'
+            })
+            this.dialogbol = false
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+.el-input-group__append {
+  position: relative !important;
+}
+.withinLine_cloud_call {
+  position: absolute !important;
+  top: 0;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  width: 100%;
+  height: 100%;
+  .el-icon-phone {
+    width: 100%;
+    height: 100%;
+    display: inline-block;
+    text-align: center;
+    line-height: 26px;
+    background-color: #409eff !important;
+    color: #fff !important;
+  }
+}
+</style>

+ 80 - 4
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/basicInfo.js

@@ -3,6 +3,7 @@ import { listPageV2, getDetail } from '@/api/engineeringMaintenance/basicData'
 import { orderEnginbaseList } from '@/api/basicEngineeringData'
 import { orderBaseUpdate } from '@/api/workOrderPool'
 import geographicalPosi from '@/components/geographicalPosi/index.vue'
+import cloudCall from '../buttons/cloudCall.vue'
 export default {
   data() {
     return {
@@ -199,26 +200,101 @@ export default {
             rules: this.formOptions.linkName.isRules
           }
         },
+        // {
+        //   isShow: this.formOptions.userMobile.isShow,
+        //   name: 'el-input',
+        //   md: 6,
+        //   attributes: { disabled: !this.formOptions.userMobile.isEdit, placeholder: '请输入', maxlength: 11 },
+        //   formItemAttributes: {
+        //     label: '客户电话',
+        //     prop: 'userMobile',
+        //     rules: this.formOptions.userMobile.isRules
+        //   }
+        // },
         {
           isShow: this.formOptions.userMobile.isShow,
-          name: 'el-input',
+          name: 'slot-component',
           md: 6,
-          attributes: { disabled: !this.formOptions.userMobile.isEdit, placeholder: '请输入', maxlength: 11 },
           formItemAttributes: {
             label: '客户电话',
             prop: 'userMobile',
             rules: this.formOptions.userMobile.isRules
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <div>
+                <el-input
+                  value={value}
+                  onInput={v => {
+                    // 限制最多为11位有效数字
+                    if (v && v.length > 11) {
+                      v = v.slice(0, 11)
+                    }
+                    onInput(v)
+                  }}
+                  disabled={!this.formOptions.userMobile.isEdit}
+                  type="number"
+                  size="mini"
+                  placeholder="请输入"
+                >
+                  {
+                    /* 创建区别:创建的时候不要拨打 */ this.id ? (
+                      <cloudCall phone={value} orderInfo={this.orderInfo} slot="append"></cloudCall>
+                    ) : null
+                  }
+                </el-input>
+              </div>
+            )
           }
         },
+        // ------------------------
+        // {
+        //   isShow: this.formOptions.userMobile2.isShow,
+        //   name: 'el-input',
+        //   md: 6,
+        //   attributes: { disabled: !this.formOptions.userMobile2.isEdit, placeholder: '请输入', maxlength: 11 },
+        //   formItemAttributes: {
+        //     label: '客户电话2',
+        //     prop: 'userMobile2',
+        //     rules: this.formOptions.userMobile2.isRules
+        //   }
+        // },
         {
           isShow: this.formOptions.userMobile2.isShow,
-          name: 'el-input',
+          name: 'slot-component',
           md: 6,
-          attributes: { disabled: !this.formOptions.userMobile2.isEdit, placeholder: '请输入', maxlength: 11 },
           formItemAttributes: {
             label: '客户电话2',
             prop: 'userMobile2',
             rules: this.formOptions.userMobile2.isRules
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return (
+              <div>
+                <el-input
+                  value={value}
+                  onInput={v => {
+                    // 限制最多为11位有效数字
+                    if (v && v.length > 11) {
+                      v = v.slice(0, 11)
+                    }
+                    onInput(v)
+                  }}
+                  disabled={!this.formOptions.userMobile2.isEdit}
+                  type="number"
+                  size="mini"
+                  placeholder="请输入"
+                >
+                  {
+                    /* 创建区别:创建的时候不要拨打 */ this.id ? (
+                      <cloudCall phone={value} orderInfo={this.orderInfo} slot="append"></cloudCall>
+                    ) : null
+                  }
+                </el-input>
+              </div>
+            )
           }
         },
         {

+ 10 - 1
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/dispatchInfo.js

@@ -1,6 +1,7 @@
 import { orderBaseLogList } from '@/api/workOrderPool.js'
 import copyInfo from '../buttons/copyInfo.vue'
 import ImageUpload from '@/components/file-upload'
+import cloudCall from '../buttons/cloudCall.vue'
 export default {
   data() {
     return {
@@ -158,7 +159,15 @@ export default {
                 md: 12,
                 formItemAttributes: { label: '工程师手机号', prop: '' },
                 render: (h, { props, onInput }) => {
-                  return <el-input value={item.workerMobile} disabled={true} size="mini"></el-input>
+                  return (
+                    <el-input value={item.workerMobile} disabled={true} size="mini">
+                      {
+                        /* 创建区别:创建的时候不要拨打 */ this.id ? (
+                          <cloudCall phone={item.workerMobile} orderInfo={this.orderInfo} slot="append"></cloudCall>
+                        ) : null
+                      }
+                    </el-input>
+                  )
                 },
                 getValue: () => {
                   return item.workerMobile

+ 0 - 1
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/serviceInfo.js

@@ -529,7 +529,6 @@ export default {
         value: item.websitId,
         label: item.name
       }))
-      console.log(this.createWebsitList)
     })
   }
 }