| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609 |
- <template>
- <view>
- <cu-custom bgColor="bg-luohu" :isBack="true">
- <block slot="backText">返回</block>
- <block slot="content">沟通记录</block>
- </cu-custom>
- <view>
- <view class="cu-form-group">
- <view class="title">表单编号:</view>
- <input placeholder="请输入表单编号" v-model="form.biaoDanBianHao" name="input" :disabled="true"></input>
- </view>
- <view class="cu-form-group">
- <view class="title">客户单位名称:</view>
- <input placeholder="请输入客户单位名称" v-model="form.xuanZeKeHu" name="input" disabled></input>
- <!-- <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42"
- v-if="form.keHuDanWeiMingChe != ''" @click="form.keHuDanWeiMingChe = ''"></u-icon> -->
- </view>
- <view class="cu-form-group">
- <view class="title">客户联系人:</view>
- <input placeholder="请输入客户联系人" v-model="form.keHuLianXiRen" name="input" :disabled="id && id != '' ? true: false"></input>
- <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42" v-if="form.keHuLianXiRen != '' && id == ''" @click="form.keHuLianXiRen = ''"></u-icon>
- </view>
- <view class="cu-form-group">
- <view class="title">委托单号:</view>
- <text style="width: 100%;" @click="getShow">{{getWeiTuo(form.weiTuoDanHao)}}</text>
- <u-button type="success" size="mini" @click="getShow" v-if="form.weiTuoDanHao == '' && id == ''">选择
- </u-button>
- <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42" v-if="form.weiTuoDanHao != '' && id == ''" @click="form.weiTuoDanHao = ''"></u-icon>
- </view>
- <view class="cu-form-group">
- <view class="title">联系电话:</view>
- <input placeholder="请输入联系电话" v-model="form.lianXiDianHua" name="input" :disabled="id && id != '' ? true: false"></input>
- <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42" v-if="form.lianXiDianHua != '' && id == ''" @click="form.lianXiDianHua = ''"></u-icon>
- </view>
- <view class="cu-form-group">
- <view class="title">样品名称:</view>
- <textarea maxlength="-1" v-model="form.yangPinMingCheng" placeholder="请输入样品名称" auto-height="true" :disabled="id && id != '' ? true: false"></textarea>
- <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42" v-if="form.yangPinMingCheng != '' && id == ''" @click="form.yangPinMingCheng = ''"></u-icon>
- </view>
- <view class="cu-form-group">
- <view class="title">样品编号:</view>
- <textarea maxlength="-1" v-model="form.yangPinBianHao" placeholder="请输入样品编号" auto-height="true" :disabled="id && id != '' ? true: false"></textarea>
- <!-- <input placeholder="请输入样品编号" v-model="form.yangPinBianHao" name="input"
- :disabled="id && id != '' ? true: false"></input> -->
- <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42" v-if="form.yangPinBianHao != '' && id == ''" @click="form.yangPinBianHao = '' && id == ''"></u-icon>
- </view>
- <view class="cu-form-group">
- <view class="title">样品类型:</view>
- <textarea maxlength="-1" v-model="form.yangPinLeiXing" placeholder="请输入样品类型" auto-height="true" :disabled="id && id != '' ? true: false"></textarea>
- <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42" v-if="form.yangPinLeiXing != '' && id == ''" @click="form.yangPinLeiXing = ''"></u-icon>
- </view>
- <view class="cu-form-group">
- <view class="title">报告编号:</view>
- <textarea maxlength="-1" v-model="form.baoGaoBianHao" placeholder="请输入报告编号" auto-height="true" :disabled="id && id != '' ? true: false"></textarea>
- <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42" v-if="form.baoGaoBianHao != '' && id == ''" @click="form.baoGaoBianHao = ''"></u-icon>
- </view>
- <view class="cu-form-group">
- <view class="title">沟通类型:</view>
- <input placeholder="请选择沟通类型" v-model="form.gouTongLeiXing" name="input" disabled></input>
- <u-button type="success" size="mini" @click="sheetShow = true" v-if="id == ''">选择</u-button>
- </view>
- <uni-section title="沟通内容" type="line" padding>
- <textarea maxlength="-1" v-model="form.gouTongNeiRong" placeholder="意见和建议" :disabled="id && id != '' ? true: false"></textarea>
- </uni-section>
- <uni-section title="上传附件" type="line">
- <view class="example-body" v-if="id == ''">
- <uni-file-picker limit="5" file-mediatype="all" @select="select" @progress="progress" @success="success" @fail="fail" @delete="deleteMe" :auto-upload="false" ref="uploadMe">
- </uni-file-picker>
- </view>
- <view v-else>
- <view v-for="(item,index) in fuJianShangChuanArray" :key="index" style="margin: 0 10rpx;">
- <view style="line-height: 50rpx;" @click="uploadClick(item.id,item.fileName,item.ext)">{{item.fileName + '.' + item.ext}}</view>
- </view>
- </view>
- </uni-section>
- <uni-section title="签名" type="line" padding>
- <view style="width: 100%;">
- <view style="text-align: right;width: 100%;" v-if="typeValue != '1'">
- <view>
- <u-button type="primary" size="mini" @click="qianming()" class="btn-back-color">
- 签名</u-button>
- <u-button type="error" size="mini" @click="deqianming()" style="margin-left: 15rpx;" v-if="form.keHu != ''">
- 取消</u-button>
- </view>
- </view>
- <view style="width: 100%;margin-top: 10rpx;" v-if="form.keHu != ''">
- <image :src="form.keHu" style="width: 100%;height: 500rpx;border: 1px #eee solid;">
- </image>
- </view>
- </view>
- </uni-section>
- <uni-section title="沟通内容确定" type="line" padding v-if="id != '' && form.leiXing != '2'">
- <textarea maxlength="-1" v-model="form.gouTongQueDingNei" placeholder="意见和建议" :disabled="true"></textarea>
- </uni-section>
- <view class="padding flex flex-direction" v-if="typeValue == '3'">
- <u-button type="success" class="btn btn-back-color" @click="onSubmit">提交
- </u-button>
- </view>
- <view class="padding flex flex-direction" v-if="typeValue == '2'">
- <u-button type="success" class="btn btn-back-color" @click="onAgree">同意
- </u-button>
- </view>
- </view>
- <u-action-sheet :list="list" v-model="sheetShow" @click="actionSheetCallback"></u-action-sheet>
- <u-popup mode="center" v-model="popupShow">
- <view style="padding: 30rpx;background: #FFFFFF;width: 100%;">
- <view class="cu-form-group ">
- <view class="title">签名</view>
- </view>
- <autograph @save="save" @clear="clear" @close="close"></autograph>
- </view>
- </u-popup>
- <lin-popup ref="picker" :title="'委托单选择'" :list="weiTuoList" @onConfirm="onConfirm"></lin-popup>
- </view>
- </template>
- <script>
- import {
- ACCESS_TOKEN,
- USER_NAME,
- USER_INFO
- } from "@/common/util/constants" // 拉取登录token,userName,userInfo
- import http from '@/common/service/http.js'
- import autograph from '@/components/autograph/autograph'
- export default {
- components: {
- autograph
- },
- data() {
- return {
- typeValue: '3',
- id: '',
- sheetShow: false,
- taskId: '',
- form: {
- xuanZeKeHu: '',
- biaoDanBianHao: '',
- buMenName: '',
- keHuDanWeiMingChe: '',
- keHuLianXiRen: '',
- weiTuoDanHao: '',
- lianXiDianHua: '',
- yangPinMingCheng: '',
- yangPinBianHao: '',
- yangPinLeiXing: '',
- baoGaoBianHao: '',
- gouTongLeiXing: '',
- gouTongNeiRong: '',
- keHu: '',
- gouTongQueDingNei: '',
- leiXing: '1'
- },
- fuJianShangChuanArray: [],
- popupShow: false,
- list: [{
- text: '委托单'
- }, {
- text: '检测项目'
- }, {
- text: '样品信息修改'
- }, {
- text: '检测结果'
- }, {
- text: '检测报告退回'
- }, {
- text: '其它'
- }],
- kehuXinXinList: [],
- weiTuoList: []
- }
- },
- onLoad(options) {
- this.getKehu()
- if (options.id) {
- this.id = options.id
- this.getDe(options.id)
- } else {
- this.getGtbh()
- }
- if (options.id) {
- this.typeValue = options.typeValue
- }
- },
- methods: {
- actionSheetCallback(e) {
- this.form.gouTongLeiXing = this.list[e].text
- },
- // 获取上传状态
- select(file) {
- //读取文件大小
- var fileSize = file.size;
- let token = uni.getStorageSync(ACCESS_TOKEN)
- if (fileSize > 1048576) {
- that.$message({
- type: 'error',
- showClose: true,
- duration: 3000,
- message: '文件大于1M!'
- });
- return
- }
- let that = this
- uni.showToast({
- title: '上传中',
- mask: true
- })
- for (let e in file.tempFilePaths) {
- var extName = file.tempFiles[e].file.name.substring(file.tempFiles[e].file.name.lastIndexOf(
- '.'));
- const path = file.tempFilePaths[e];
- uni.uploadFile({
- // url: http.apiHosp + 'ibps/platform/v3/file/upload/mobile', //仅为示例,非真实的接口地址
- url: http.apiHosp + '/ibps/platform/v3/file/upload', //仅为示例,非真实的接口地址
- filePath: path,
- name: 'file',
- formData: {
- 'ext': '.jpg'
- },
- header: {
- 'X-Authorization-access_token': token,
- 'X-Authorization-systemid': ''
- },
- success: (uploadFileRes) => {
- let data = JSON.parse(uploadFileRes.data)
- that.fuJianShangChuanArray.push({
- fileid: file.tempFiles[e].file.uuid,
- uploadid: data.data.id
- })
- uni.hideLoading()
- }
- });
- }
- },
- // 删除
- deleteMe(file) {
- for (let e in this.fuJianShangChuanArray) {
- if (this.fuJianShangChuanArray[e].fileid == file.tempFile.uuid) {
- this.fuJianShangChuanArray.splice(e, 1)
- }
- }
- },
- // 获取上传进度
- progress(e) {},
- // 上传成功
- success(file) {},
- // 上传失败
- fail(e) {},
- //弹出框显示
- qianming(index) {
- this.popupShow = true
- },
- //清除签名
- deqianming(index) {
- this.form.keHu = ''
- },
- //保存签名
- save(val) {
- this.form.keHu = val
- this.popupShow = false
- },
- //清除签名
- clear(val) {
- this.form.keHu = ''
- },
- /**
- * 关闭签名弹窗
- */
- close() {
- this.popupShow = false
- },
- //获取样品编号
- getGtbh(callback) {
- let smsParams = {
- alias: "gtbh"
- };
- let this_ = this
- this.$http.post("/ibps/business/v3/jc/sys/getNextIdByAlias", smsParams).then(res => {
- if (res.data.state == 200) {
- const data = res.data.data
- this.form.biaoDanBianHao = data
- }
- });
- },
- getKehu() {
- let info = uni.getStorageSync(USER_INFO);
- if (info) {
- this.form.xuanZeKeHu = info.user.qq
- this.form.lianXiDianHua = info.user.mobile
- this.form.keHuDanWeiMingChe = info.user.id
- this.form.keHuLianXiRen = info.user.fullname
- this.form.keHuDanWeiMingChe = info.user.id
- }
- this.getWeiTuoList()
- },
- getDe(id) {
- uni.showLoading({
- mask: true,
- title: 'loading'
- });
- let sql =
- `select * from t_khgtjlb where id_ = ${id}`
- let requestData = this.$sig(sql)
- this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
- if (res.data.state == 200) {
- const data = res.data.variables.data[0]
- this.form = {
- id: data.id_,
- xuanZeKeHu: data.xuan_ze_ke_hu_,
- biaoDanBianHao: data.biao_dan_bian_hao,
- buMenName: data.xuan_ze_ke_hu_,
- keHuDanWeiMingChe: data.ke_hu_dan_wei_min,
- keHuLianXiRen: data.ke_hu_lian_xi_ren,
- weiTuoDanHao: data.wei_tuo_dan_hao_,
- lianXiDianHua: data.lian_xi_dian_hua_,
- yangPinMingCheng: data.yang_pin_ming_che,
- yangPinBianHao: data.yang_pin_bian_hao,
- yangPinLeiXing: data.yang_pin_lei_xing,
- baoGaoBianHao: data.bao_gao_bian_hao_,
- gouTongLeiXing: data.gou_tong_lei_xing,
- gouTongNeiRong: data.gou_tong_nei_rong,
- keHu: data.ke_hu_,
- gouTongQueDingNei: data.gou_tong_que_ding,
- leiXing: data.lei_xing_
- }
- if (data.fu_jian_ && data.fu_jian_ != '') {
- this.getFileList(data.fu_jian_)
- }
- if (data.lei_xing_ == '2' && data.shi_fou_guo_shen_ == '已编制') {
- this.getTaskId(data.id_)
- }
- uni.hideLoading()
- }
- })
- },
- getFileList(ids) {
- let lists = ids.split(",")
- let params = {}
- params.ids = lists
- this.$http.post("/ibps/platform/v3/file/attachment/transfer", params).then(res => {
- if (res.data.state == 200) {
- const data = res.data.data
- lists.forEach(item => {
- let obj = {
- id: item,
- fileName: data[item].fileName,
- ext: data[item].ext
- }
- this.fuJianShangChuanArray.push(obj)
- })
- }
- })
- },
- onSubmit() {
- uni.showLoading({
- title: '加载中',
- mask: true
- })
- let tmpArray = []
- for (let e in this.fuJianShangChuanArray) {
- tmpArray.push(this.fuJianShangChuanArray[e].uploadid)
- }
- let info = uni.getStorageSync(USER_INFO);
- let useId = info.user.id
- let detpId = info.org.id
- var nowDate = new Date((new Date).getTime() + 8 * 60 * 60 * 1000)
- var time = nowDate.toJSON().split('T').join(' ').substr(0, 10);
- let para = {
- "parameters": [{
- "key": "defId",
- "value": "1056942070293331968"
- },
- {
- "key": "version",
- "value": "0"
- },
- {
- "key": "data",
- "value": ""
- }
- ]
- }
- this.form.fuJian = tmpArray.join(",")
- this.form.bianZhiRen = useId
- this.form.bianZhiShiJian = time
- this.form.bianZhiBuMen = detpId
- this.form.shiFouGuoShen = "已编制"
- para.parameters[2].value = JSON.stringify(this.form);
- let that = this;
- this.$http.post("ibps/business/v3/bpm/instance/start", para).then(res => {
- if (res.data.state == 200) {
- this.$methCommon.getPrompt('提交成功!')
- uni.hideLoading();
- this.getPageA()
- }
- }).catch((err) => {
- });
- },
- onAgree() {
- uni.showLoading({
- title: '加载中',
- mask: true
- })
- let info = uni.getStorageSync(USER_INFO);
- let useId = info.user.id
- let detpId = info.org.id
- this.form.gouTongRenYuan = useId
- this.form.gouTongRiQi = this.$methCommon.time(10)
- this.form.gouTongBuMen = detpId
- this.form.shiFouGuoShen = "1"
- let editData = {
- data: JSON.stringify(this.form),
- opinion: '同意',
- taskId: this.taskId
- }
- this.$http.post("/ibps/business/v3/bpm/task/agree", editData).then(res => {
- if (res.data.state == 200) {
- this.$methCommon.getPrompt('同意成功!')
- uni.hideLoading();
- this.getPageA()
- } else {
- this.$methCommon.getPrompt('同意异常!', 'fail')
- uni.hideLoading()
- }
- });
- },
- //根据委托单id查询 taskId
- getTaskId(id) {
- let sql =
- `select TASK_ID_ from ibps_bpm_tasks where NAME_ = '确认' and NODE_ID_ = 'Activity_1vrp3i4' and PROC_DEF_KEY_ = 'Process_183pepd' and EXEC_ID_ = (select PROC_INST_ID_ from act_ru_execution where ACT_ID_ = 'Activity_1vrp3i4' and BUSINESS_KEY_ = '${id}') ORDER BY CREATE_TIME_ desc`
- let requestData = this.$sig(sql)
- this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
- if (res.data.state == 200) {
- let result = res.data.variables.data[0]
- this.taskId = result.TASK_ID_
- }
- })
- },
- //委托信息
- getWeiTuoList() {
- let info = uni.getStorageSync(USER_INFO);
- let useId = info.user.id
- let sql =
- `select id_,wei_tuo_bian_hao_ from t_lhwtsqb where create_by_ = '${useId}' order by create_time_ desc`
- let requestData = this.$sig(sql)
- this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
- if (res.data.state == 200) {
- const datas = res.data.variables.data
- if (datas.length > 0) {
- datas.forEach((item, index) => {
- this.$set(item, 'name', item.wei_tuo_bian_hao_)
- })
- this.weiTuoList = datas
- }
- }
- })
- },
- // 拉取样品列表数据
- getData(id) {
- let info = uni.getStorageSync(USER_INFO);
- let useId = info.user.id
- let sql =
- `select id_,yang_pin_bian_hao,yang_pin_ming_che,yang_pin_lei_xing,yang_pin_lei_er_,yang_pin_lei_san_,yang_pin_lei_si_ from t_lhypb where parent_id_ = '${id}' order by create_time_ desc`
- let requestData = this.$sig(sql)
- this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
- if (res.data.state == 200) {
- const datas = res.data.variables.data
- if (datas.length > 0) {
- let list = []
- let list1 = []
- let list3 = []
- datas.forEach(item => {
- if (item.yang_pin_lei_xing) {
- list.push(item.yang_pin_lei_xing)
- }
- if (item.yang_pin_lei_er_) {
- list.push(item.yang_pin_lei_er_)
- }
- if (item.yang_pin_lei_san_) {
- list.push(item.yang_pin_lei_san_)
- }
- if (item.yang_pin_lei_si_) {
- list.push(item.yang_pin_lei_si_)
- }
- list1.push(item.yang_pin_bian_hao)
- list3.push(item.yang_pin_ming_che)
- })
- var list2 = [...new Set(list)]
- this.form.yangPinLeiXing = list2.join(",")
- this.form.yangPinBianHao = list1.join(",")
- this.form.yangPinMingCheng = list3.join(",")
- }
- }
- })
- },
- getBaoGaoList(id) {
- let info = uni.getStorageSync(USER_INFO);
- let useId = info.user.id
- let sql =
- `select id_,bao_gao_bian_hao_ from t_lhjcbgb where wei_tuo_id_ = '${id}'`
- let requestData = this.$sig(sql)
- this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
- if (res.data.state == 200) {
- const datas = res.data.variables.data
- if (datas.length > 0) {
- let list = []
- datas.forEach((item, index) => {
- list.push(item.bao_gao_bian_hao_)
- })
- this.form.baoGaoBianHao = list.join(",")
- }
- }
- })
- },
- getShow() {
- if (this.id != '') {
- return
- }
- this.$refs['picker'].show();
- },
- onConfirm(index, item) {
- this.form.weiTuoDanHao = item.id_
- this.getData(item.id_)
- this.getBaoGaoList(item.id_)
- },
- getWeiTuo(id) {
- if (id) {
- let itemData = this.weiTuoList.find(item => item.id_ == id)
- if (itemData) {
- return itemData.wei_tuo_bian_hao_
- } else {
- return ''
- }
- } else {
- return ''
- }
- },
- getPageA() {
- let pages = getCurrentPages()
- let prevPage = pages[pages.length - 2]
- prevPage.$vm.getValue()
- uni.navigateBack({
- dalta: 1
- })
- },
- uploadClick(id, item, type) {
- uni.showLoading({
- title: '下载中',
- mask: true
- })
- let requestData = {
- attachmentId: id
- }
- this.$http.get(`/ibps/platform/v3/file/download?attachmentId=${id}`, {
- responseType: 'arraybuffer'
- }).then(res => {
- const blob = new Blob([
- res.data
- ], {
- type: 'application/octet-stream'
- })
- const url = window.URL.createObjectURL(blob)
- const link = document.createElement('a')
- link.style.display = 'none'
- link.href = url
- link.setAttribute('download', item + '.' + type)
- document.body.appendChild(link)
- link.click()
- window.URL.revokeObjectURL(link.href)
- document.body.removeChild(link)
- uni.hideLoading()
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .cu-form-group .title {
- min-width: 180rpx;
- }
- .btn {
- margin: 15rpx
- }
- </style>
|