| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447 |
- <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"></input>
- <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42"
- v-if="form.keHuLianXiRen != ''" @click="form.keHuLianXiRen = ''"></u-icon>
- </view>
- <view class="cu-form-group">
- <view class="title">委托单号:</view>
- <!-- <input placeholder="请输入委托单号" v-model="form.weiTuoDanHao" name="input"></input>
- <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42"
- v-if="form.weiTuoDanHao != ''" @click="form.weiTuoDanHao = ''"></u-icon> -->
- <text style="width: 100%;" @click="getShow">{{getWeiTuo(form.weiTuoDanHao)}}</text>
- <u-button type="success" size="mini" @click="getShow" v-if="form.weiTuoDanHao == ''">选择
- </u-button>
- <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42"
- v-if="form.weiTuoDanHao != ''" @click="form.weiTuoDanHao = ''"></u-icon>
- </view>
- <view class="cu-form-group">
- <view class="title">联系电话:</view>
- <input placeholder="请输入联系电话" v-model="form.lianXiDianHua" name="input"></input>
- <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42"
- v-if="form.lianXiDianHua != ''" @click="form.lianXiDianHua = ''"></u-icon>
- </view>
- <view class="cu-form-group">
- <view class="title">样品名称:</view>
- <input placeholder="请输入样品名称" v-model="form.yangPinMingCheng" name="input"></input>
- <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42"
- v-if="form.yangPinMingCheng != ''" @click="form.yangPinMingCheng = ''"></u-icon>
- </view>
- <view class="cu-form-group">
- <view class="title">样品编号:</view>
- <input placeholder="请输入样品编号" v-model="form.yangPinBianHao" name="input"></input>
- <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42"
- v-if="form.yangPinBianHao != ''" @click="form.yangPinBianHao = ''"></u-icon>
- </view>
- <view class="cu-form-group">
- <view class="title">样品类型:</view>
- <input placeholder="请输入样品类型" v-model="form.yangPinLeiXing" name="input"></input>
- <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42"
- v-if="form.yangPinLeiXing != ''" @click="form.yangPinLeiXing = ''"></u-icon>
- </view>
- <view class="cu-form-group">
- <view class="title">报告编号:</view>
- <input placeholder="请输入报告编号" v-model="form.baoGaoBianHao" name="input"></input>
- <u-icon class="uni-icon" name="close-circle-fill" color="rgb(192, 196, 204)" size="42"
- v-if="form.baoGaoBianHao != ''" @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">选择</u-button>
- </view>
- <uni-section title="沟通内容" type="line" padding>
- <textarea maxlength="-1" v-model="form.gouTongNeiRong" placeholder="意见和建议"></textarea>
- </uni-section>
- <!-- <uni-section title="上传附件" type="line">
- <view class="example-body">
- <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>
- </uni-section> -->
- <uni-section title="签名" type="line" padding>
- <view style="width: 100%;">
- <view style="text-align: right;width: 100%;">
- <view>
- <u-button type="primary" size="mini" @click="qianming(0)">
- 签名</u-button>
- <u-button type="primary" size="mini" @click="deqianming(0)" style="margin-left: 15rpx;"
- v-if="form.keHu != ''">
- 取消</u-button>
- </view>
- </view>
- <view style="width: 100%;" v-if="form.keHu != ''">
- <image :src="form.keHu" style="width: 100%;height: 500rpx;border: 1px #eee solid;">
- </image>
- </view>
- </view>
- </uni-section>
- <view class="padding flex flex-direction">
- <button class="cu-btn bg-blue lg" @click="onSubmit">提交</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 {
- sheetShow: false,
- form: {
- xuanZeKeHu: '',
- biaoDanBianHao: '',
- buMenName: '',
- keHuDanWeiMingChe: '',
- keHuLianXiRen: '',
- weiTuoDanHao: '',
- lianXiDianHua: '',
- yangPinMingCheng: '',
- yangPinBianHao: '',
- yangPinLeiXing: '',
- baoGaoBianHao: '',
- gouTongLeiXing: '',
- gouTongNeiRong: '',
- keHu: ''
- },
- fuJianShangChuanArray: [],
- popupShow: false,
- list: [{
- text: '投诉'
- }, {
- text: '委托单'
- }, {
- text: '检测项目'
- }, {
- text: '样品信息修改'
- }, {
- text: '检测结果'
- }, {
- text: '检测报告退回'
- }, {
- text: '其它'
- }],
- kehuXinXinList: [],
- weiTuoList: []
- }
- },
- created() {
- this.getGtbh()
- this.getKehu()
- },
- 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 false;
- }
- let that = this
- for (let e in file.tempFilePaths) {
- console.log("000", file.tempFiles[e].file)
- 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
- })
- }
- });
- }
- return true;
- console.log('选择文件:')
- },
- // 删除
- deleteMe(file) {
- for (let e in this.fuJianShangChuanArray) {
- if (this.fuJianShangChuanArray[e].fileid == file.tempFile.uuid) {
- this.fuJianShangChuanArray.splice(e, 1)
- }
- }
- },
- // 获取上传进度
- progress(e) {
- console.log('上传进度:', e)
- },
- // 上传成功
- success(file) {
- console.log('上传成功', file)
- },
- // 上传失败
- fail(e) {
- console.log('上传失败:', e)
- },
- //弹出框显示
- qianming(index) {
- this.qianshow = true
- this.qianIndex = index
- this.popupShow = true
- },
- //清除签名
- deqianming(index) {
- if (index == 0) {
- this.form.keHu = ''
- }
- },
- //保存签名
- save(val) {
- if (this.qianIndex == 0) {
- this.form.keHu = val
- }
- this.qianshow = false
- this.popupShow = false
- },
- //清除签名
- clear(val) {
- if (this.qianIndex == 0) {
- 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.wcAccount
- 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()
- },
- onSubmit() {
- 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.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.$tip.success("提交成功!")
- this.$Router.replace({
- name: 'index'
- })
- }
- }).catch((err) => {
- let msg = ((err.response || {}).data || {}).message || err.data.message || "请求出现错误,请稍后再试"
- this.$tip.error(msg);
- });
- },
- //委托信息
- 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() {
- 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)
- return itemData.wei_tuo_bian_hao_
- } else {
- return ''
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .cu-form-group .title {
- min-width: 180rpx;
- }
- </style>
|