details.blade.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
  1. @extends('layouts.base')
  2. @section('title', '工单详情')
  3. @section('content')
  4. <style>
  5. .content{
  6. background: #eff3f6;
  7. padding: 10px!important;
  8. }
  9. .el-textarea__inner {
  10. height: 218px;
  11. }
  12. .el-upload__input {
  13. opacity: 0;
  14. width: 0;
  15. }
  16. .bigJian{
  17. }
  18. #textarea{
  19. border: 1px solid #ccc;
  20. padding: 10px;
  21. width:1113px;
  22. min-height: 218px;
  23. height:100%;
  24. overflow: hidden;
  25. }
  26. .img_grop{
  27. /* position: absolute; */
  28. /* top: 50%; */
  29. /* left: 50%; */
  30. /* transform: translate(-50%,-50%); */
  31. }
  32. .img_grop img{
  33. width: 100%;
  34. height: 100%;
  35. }
  36. .el-dialog{
  37. background: rgba(255,255,255,.1);
  38. }
  39. .vue-crumbs a {
  40. color: #333;
  41. }
  42. .vue-crumbs a:hover {
  43. color: #29ba9c;
  44. }
  45. .vue-crumbs {
  46. margin: 0 20px;
  47. font-size: 14px;
  48. color: #333;
  49. font-weight: 400;
  50. padding-bottom: 10px;
  51. line-height: 32px;
  52. }
  53. .workOrder-detail .block{
  54. padding:10px;
  55. background-color:#fff;
  56. border-radius: 8px;
  57. }
  58. .workOrder-detail .title{
  59. font-size:18px;
  60. display:flex;
  61. align-items:center;
  62. }
  63. .confirm-btn{
  64. width: calc(100% - 266px);
  65. position:fixed;
  66. bottom:0;
  67. right:0;
  68. margin-right:10px;
  69. line-height:63px;
  70. background-color: #ffffff;
  71. box-shadow: 0px 8px 23px 1px
  72. rgba(51, 51, 51, 0.3);
  73. background-color:#fff;
  74. text-align:center;
  75. }
  76. b{
  77. font-size:14px;
  78. }
  79. .el-form-item{
  80. margin-bottom:0;
  81. }
  82. </style>
  83. <!-- <div style="margin-left:20px;">我的工单</div> -->
  84. <div id="app">
  85. <div class="vue-crumbs">
  86. <a @click="goBack">系统</a> > 工单管理 > 工单详情
  87. </div>
  88. <template>
  89. <div class="workOrder-detail" style="background-color:#fff;">
  90. <div class="block">
  91. <div class="title"><span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>基本信息</b></div>
  92. <el-form ref="first_list" :model="first_list" label-width="15%" >
  93. <el-form-item label="工单状态:" v-if="!isempty(first_list.work_order_sn)">
  94. <span v-text="first_list.status_name"></span>
  95. </el-form-item>
  96. <el-form-item label="工单编号:" v-if="!isempty(first_list.work_order_sn)">
  97. <span v-text="first_list.work_order_sn"></span>
  98. </el-form-item>
  99. <el-form-item label="工单分类: " v-if="!isempty(first_list.status)">
  100. <span v-if="first_list.category_id==1">bug提交</span>
  101. <span v-if="first_list.category_id==2">优化建议</span>
  102. <span v-if="first_list.category_id==3">开发需求</span>
  103. <span v-if="first_list.category_id==4">其他</span>
  104. </el-form-item>
  105. <el-form-item label="提交时间:" v-if="!isempty(first_list.created_at)">
  106. <span v-text="first_list.created_at"></span>
  107. </el-form-item>
  108. <el-form-item label="受理时间:" v-if="!isempty(first_list.completion_time)">
  109. <span v-text="first_list.completion_time"></span>
  110. </el-form-item>
  111. <el-form-item label="完成时间:" v-if="!isempty(first_list.updated_at)">
  112. <span v-text="first_list.updated_at"></span>
  113. </el-form-item>
  114. <el-form-item label="处理时长:" v-if="!isempty(first_list.difference)">
  115. <span v-text="first_list.difference"></span>
  116. </el-form-item>
  117. </el-form>
  118. </div>
  119. <div style="background: #eff3f6;width:100%;height:15px;"></div>
  120. <div class="block">
  121. <div class="title"><span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>工单信息</b></div>
  122. <el-form ref="first_list" :model="first_list" label-width="15%" >
  123. <el-form-item label="站点:">
  124. <span v-text="first_list.domain"></span>
  125. </el-form-item>
  126. <el-form-item label="问题标题:" >
  127. <span v-text="first_list.question_title">
  128. </el-form-item>
  129. <!-- <el-form-item label="问题描述:" >
  130. 清晰的描述问题产生的操作流程,问题结果,期望的正确结果;
  131. 如果是涉及到分销佣金、分红、返现等模式计算,要清晰的讲解设置、会员关系、正确的结算结果、错误的计算结果等;<br>
  132. 如果您觉得下方编辑框操作麻烦可使用附件上传按钮 直接上传Word、excel等说明文档。
  133. </el-form-item> -->
  134. <el-form-item label="问题描述:" >
  135. <el-input show-word-limit style="overflow:hidden;width:60%;" type="textarea" disabled v-html="first_list.question_describe" placeholder=""></el-input>
  136. </el-form-item>
  137. <el-form-item label=" " >
  138. <div class="imgInfo" style="border:1px solid rgba(187, 187, 187, 1);width:989px;display:flex;align-items:center;flex-wrap:wrap;">
  139. <div v-for="(item,index) in first_list.thumb_url" style="padding: 10px;display: inline-block;width: 200px;display:flex;align-items:center;justify-content:center;flex-direction:column;">
  140. <img v-if="item.indexOf('xlsx')!=-1" style="width:50px;height:50px;" src="{!! resource_get('static/images/icon/xlsx.png') !!}" alt="">
  141. <img v-if="item.indexOf('docx')!=-1||item.indexOf('doc')!=-1" style="width:50px;height:50px;" src="{!! resource_get('static/images/icon/word.png') !!}" alt="">
  142. <img v-if="item.indexOf('mp4')!=-1" style="width:50px;height:50px;" src="{!! resource_get('static/images/icon/mp4.png') !!}" alt="">
  143. <img v-if="item.indexOf('mp3')!=-1" style="width:50px;height:50px;" src="{!! resource_get('static/images/icon/mp3.png') !!}" alt="">
  144. <img v-if="item.indexOf('zip')!=-1" style="width:50px;height:50px;" src="{!! resource_get('static/images/icon/zip.png') !!}" alt="">
  145. <img v-if="item.indexOf('txt')!=-1" style="width:50px;height:50px;" src="{!! resource_get('static/images/icon/txt.png') !!}" alt="">
  146. <img v-if="item.indexOf('png')!=-1||item.indexOf('jpeg')!=-1||item.indexOf('jpg')!=-1" @click="tapFimg(item)" :src="item" alt="" style="width:146px;height:129px;margin:12px 8px 24px 15px;">
  147. <div v-if="!item.show" v-text="" style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis;" ></div>
  148. <img v-if="item.indexOf('png') == -1 || item.indexOf('jpeg') == -1 ||item.indexOf('jpg') == -1 " style="width:20px;height:20px;cursor:pointer;margin-top:20px;" src="{!! resource_get('static/images/icon/down.png') !!}" @click="gotoTxt(item)" alt="">
  149. </div>
  150. </div>
  151. </el-form-item>
  152. </el-form>
  153. </div>
  154. <div style="background: #eff3f6;width:100%;height:15px;"></div>
  155. <div class="block">
  156. <div class="title"><span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>沟通记录</b></div>
  157. <div class="info" v-if="first_list.has_many_comment.length>0" >
  158. <div class="imgBox" style="padding-left:15%;" >
  159. <div style="margin-bottom:10px;" v-for="(item,index) in first_list.has_many_comment ">
  160. <div v-text="item.created_at" style="margin-right:20px;vertical-align: top;"></div>
  161. <div v-if="item.user_id!=0" style="font-weight:800;margin: 20px 0;vertical-align: top;">
  162. 售后人员:
  163. </div>
  164. <div style="font-weight:800;margin: 20px 0;vertical-align: top;" v-if="item.user_id==0">
  165. 用户回复:
  166. </div>
  167. <!-- <span v-text="item.content"></span> -->
  168. <el-input v-model="item.content" type="textarea" style="width:989px;margin:10px 0" readonly="readonly"></el-input>
  169. <div v-if="item.imgData.length>0" class="imgInfo" style="border:1px solid rgba(187, 187, 187, 1);width:989px;display:flex;align-items:center;flex-wrap:wrap;">
  170. <div v-for="(item,index) in item.imgData" style="padding: 10px;width: 200px;height:200px;display:flex;align-items:center;justify-content:center;flex-direction:column;">
  171. <img v-if="!item.imgShow&&item.val.indexOf('xlsx')!=-1" style="width:50px;height:50px;" src="{!! resource_get('static/images/icon/xlsx.png') !!}" alt="">
  172. <img v-if="item.val.indexOf('docx')!=-1||item.val.indexOf('doc')!=-1" style="width:50px;height:50px;" src="{!! resource_get('static/images/icon/word.png') !!}" alt="">
  173. <img v-if="item.val.indexOf('mp4')!=-1" style="width:50px;height:50px;" src="{!! resource_get('static/images/icon/mp4.png') !!}" alt="">
  174. <img v-if="item.val.indexOf('mp3')!=-1" style="width:50px;height:50px;" src="{!! resource_get('static/images/icon/mp3.png') !!}" alt="">
  175. <img v-if="item.val.indexOf('zip')!=-1" style="width:50px;height:50px;" src="{!! resource_get('static/images/icon/zip.png') !!}" alt="">
  176. <img v-if="item.val.indexOf('txt')!=-1" style="width:50px;height:50px;" src="{!! resource_get('static/images/icon/txt.png') !!}" alt="">
  177. <img v-if="item.defaultshow" style="width:50px;height:50px;" src="{!! resource_get('static/images/icon/defailt.png') !!}" alt="">
  178. <div v-if="!item.show" v-text="" style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis;" ></div>
  179. <!-- <div v-if="!item.show" style="margin-left: 20px;" class="txt_title" >( 下载 )</div> -->
  180. <img v-if="!item.show" style="width:20px;height:20px;cursor:pointer;margin-top:20px;" src="{!! resource_get('static/images/icon/down.png') !!}" @click="gotoTxt(item.val)" alt="">
  181. <img v-if="item.show" @click="tapFimg(item.val)" :src="item.val" alt="" style="width:146px;height:129px;margin:12px 8px 24px 15px;">
  182. </div>
  183. </div>
  184. <br>
  185. </div>
  186. </div>
  187. </div>
  188. </div>
  189. <!-- 弹出大的图片 -->
  190. <el-dialog
  191. :visible.sync="dialogVisible"
  192. :show-close="false"
  193. top="20%"
  194. >
  195. <div style="" class="img_grop" v-if="dialogVisible">
  196. <img :src="thumb_url" id="thumb_url" alt="" @load="onLoad">
  197. </div>
  198. </el-dialog>
  199. <div style="background: #eff3f6;width:100%;height:15px;"></div>
  200. <!-- 弹出大的图片 -->
  201. <div class="block" style="padding-bottom:70px;">
  202. <div class="title"><span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>追加说明</b></div>
  203. <div>
  204. <div class="bigJian" style="padding-left:15%;">
  205. <div contentEditable="true" ref="textarea" id="textarea" >
  206. </div>
  207. </div>
  208. <!-- <p style="margin-top:10px;padding-left:10%;">点击上传图片 选中输入框可直接粘贴QQ截图</p> -->
  209. <div class="upImg" style="width: 989px;height:152px;padding-left:15%;">
  210. <el-upload
  211. class="upload-demo"
  212. action="{!!yzWebFullUrl('setting.work-order.upload-file')!!}"
  213. :on-success="onSuccess"
  214. :before-upload="beforeUpload"
  215. :on-remove="handleRemove"
  216. :auto-upload="true"
  217. multiple
  218. :limit="6"
  219. :on-exceed="exceed"
  220. >
  221. <el-button size="small" type="primary" style="margin-top:20px;">点击上传文件/图片</el-button>
  222. <!-- <P class="text" style="margin-top:10px;padding-left:10%;">文件大小不能超过20M</P> -->
  223. </el-upload>
  224. </div>
  225. <br/>
  226. <div >
  227. </div>
  228. </div>
  229. </div>
  230. </div>
  231. <div class="confirm-btn">
  232. <el-button type="primary" @click="detailCate">提交</el-button>
  233. </div>
  234. </div>
  235. </template>
  236. </div>
  237. <script src="{{resource_get('static/yunshop/tinymce4.7.5/tinymce.min.js')}}"></script>
  238. <script src="{{resource_get('static/yunshop/tinymceTemplate.js')}}"></script>
  239. <script>
  240. var vm = new Vue({
  241. el: "#app",
  242. data() {
  243. let data={!! $data !!};
  244. console.log(data,'详情数据');
  245. if ( data.has_many_comment.length>0) {
  246. data.has_many_comment.map(item=>{
  247. let data=[];
  248. for(key in item.thumb_url){
  249. if (item.thumb_url[key]!=null) {
  250. data.push(item.thumb_url[key])
  251. }
  252. }
  253. item.imgData=data;
  254. item.imgData.map((val,i)=>{
  255. if(item.imgData[i].indexOf('png')!=-1||item.imgData[i].indexOf('jpg')!=-1){
  256. let json={}
  257. json.val=item.imgData[i];
  258. json.show=true;
  259. item.imgData[i]=json
  260. }else if(item.imgData[i].indexOf('png')==-1&&item.imgData[i].indexOf('jpg')==-1&&item.imgData[i].indexOf('mp4')==-1&&item.imgData[i].indexOf('txt')==-1&&item.imgData[i].indexOf('zip')==-1&&item.imgData[i].indexOf('xlsx')==-1&&item.imgData[i].indexOf('docx')==-1){
  261. let json={}
  262. json.val=item.imgData[i];
  263. json.defaultshow=true;
  264. item.imgData[i]=json
  265. }
  266. else{
  267. let json={}
  268. json.val=item.imgData[i];
  269. json.show=false;
  270. item.imgData[i]=json
  271. }
  272. })
  273. })
  274. }
  275. return {
  276. site_url: 'www.wq.com',
  277. question_title: '',
  278. question_describe: '',
  279. first_list: data,
  280. dialogImageUrl: '',
  281. dialogVisible: false,
  282. disabled: false,
  283. domin: 'http://gy18465381.imwork.net',
  284. detailInfo: '', //留意信息
  285. category_id:'',//分类id
  286. work_order_id:'',//工单id
  287. fileList:[],//上传图片数组
  288. thumb_url:'',//放大的图片1
  289. thumb_urltwo:'',//放大的图片2
  290. fileListShop:[],//截图数组
  291. dialogVisible:false,//弹框
  292. }
  293. },
  294. computed: {
  295. },
  296. created() {
  297. },
  298. mounted() {
  299. this.paseImg()
  300. },
  301. methods: {
  302. onLoad(e){
  303. const img = e.target;
  304. let width = 0;
  305. if (img.fileSize > 0 || (img.width > 1 && img.height > 1)) {
  306. width = img.width + 40;
  307. }
  308. this.width = width + 'px';
  309. },
  310. goBack() {
  311. window.location.href = `{!! yzWebFullUrl('setting.shop.index1') !!}`;
  312. },
  313. // paseTra(e){
  314. // this.fileListShop.splice(this.fileListShop.length-1,1);
  315. // },
  316. isempty(str){
  317. if ((str == null) || (str == '') || (str == undefined)) {
  318. return true
  319. } else {
  320. return false
  321. }
  322. },
  323. // 点击图片放大
  324. tapFimg(item){
  325. this.dialogVisible=true;
  326. this.thumb_url=item;
  327. },
  328. // 超出个数函数
  329. exceed(files, fileList){
  330. this.$message.error('上传个数已超出')
  331. console.log('超出了');
  332. },
  333. // 上传成功的
  334. onSuccess(res, file, fileList) {
  335. console.log(res, file, fileList, '东西啊啊');
  336. if (res.result == 1) {
  337. this.fileList.push(res.data.thumb_url);
  338. this.$message.success('上传成功')
  339. } else {
  340. this.$message.error(res.msg)
  341. }
  342. },
  343. // 添加说明
  344. detailCate() {
  345. this.detailInfo=this.$refs.textarea.innerText;
  346. if (this.detailInfo == ''&&this.fileListShop.length==0) {
  347. this.$message.error('请输入追加信息')
  348. return;
  349. }
  350. this.fileListShop.map(key=>{
  351. this.fileList.push(key)
  352. })
  353. let url = window.location.href;
  354. url = url.split('?')
  355. url = url[url.length - 1].split('&')
  356. let id;
  357. url.map((item, index) => {
  358. if (index == url.length - 1) {
  359. id = item.split('=')
  360. }
  361. })
  362. id = id[1]
  363. this.work_order_id=id;
  364. let data={
  365. work_order_id:this.work_order_id,
  366. content:this.detailInfo,
  367. thumb_url:this.fileList,
  368. work_order:1
  369. }
  370. this.$http.post('{!!yzWebFullUrl('setting.work-order.comment')!!}',data).then(res=>{
  371. res=res.body;
  372. if (res.result==1) {
  373. this.$message.success(res.msg);
  374. window.location.href = "{!! yzWebFullUrl('setting.work-order.index') !!}";
  375. }else{
  376. this.$message.error(res.msg);
  377. }
  378. })
  379. },
  380. handleRemove(file, fileList) {
  381. console.log(file, fileList);
  382. this.fileList.map((item,index)=>{
  383. if (item==file.response.data.thumb_url) {
  384. delete this.fileList[index]
  385. }
  386. })
  387. console.log(this.fileList,'上传的数组');
  388. },
  389. beforeUpload(file){
  390. console.log(file,'上传之前的操作');
  391. const isLt20M = file.size / 1024 / 1024 < 20;
  392. if (!isLt20M) {
  393. this.$message({
  394. message: '上传文件大小不能超过 20MB!',
  395. type: 'warning'
  396. });
  397. return false
  398. }
  399. },
  400. paseImg() {
  401. let that=this;
  402. var imgReader = function(item) {
  403. var blob = item.getAsFile(),
  404. reader = new FileReader();
  405. // 读取文件后将其显示在网页中
  406. reader.onload = function(e) {
  407. let data=new FormData();
  408. data.append('file',e.target.result)
  409. that.$http.post('{!!yzWebFullUrl('setting.work-order.base64Upload')!!}',data,{headers: { "Content-Type": "multipart/form-data" }}).then(res=>{
  410. res=res.body;
  411. if (res.result==1) {
  412. that.$message.success('上传成功');
  413. var img = new Image();
  414. img.width=146;
  415. img.height=129;
  416. img.src = res.data.thumb_url;
  417. that.fileListShop.push(res.data.thumb_url)
  418. console.log(that.fileListShop)
  419. var box=document.getElementById('textarea')
  420. box.appendChild(img);
  421. }else{
  422. that.$message.error(res.msg);
  423. }
  424. })
  425. };
  426. // 读取文件
  427. reader.readAsDataURL(blob);
  428. };
  429. document.getElementById('textarea').addEventListener('paste', function(e) {
  430. // 添加到事件对象中的访问系统剪贴板的接口
  431. var clipboardData = e.clipboardData,
  432. i = 0,
  433. items, item, types;
  434. if (clipboardData) {
  435. items = clipboardData.items;
  436. if (!items) {
  437. return;
  438. }
  439. item = items[0];
  440. // 保存在剪贴板中的数据类型
  441. types = clipboardData.types || [];
  442. for (; i < types.length; i++) {
  443. if (types[i] === 'Files') {
  444. item = items[i];
  445. break;
  446. }
  447. }
  448. // 判断是否为图片数据
  449. if (item && item.kind === 'file' && item.type.match(/^image\//i)) {
  450. imgReader(item);
  451. }
  452. }
  453. });
  454. },
  455. // 跳转txt文件
  456. gotoTxt(filename) {
  457. let text ="hello word!"
  458. var pom = document.createElement("a");
  459. pom.setAttribute(
  460. "href",
  461. filename
  462. );
  463. pom.setAttribute("download", filename);
  464. if (document.createEvent) {
  465. var event = document.createEvent("MouseEvents");
  466. event.initEvent("click", true, true);
  467. pom.dispatchEvent(event);
  468. } else {
  469. pom.click();
  470. }
  471. },
  472. },
  473. })
  474. </script>
  475. @endsection