list1.blade.php 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. @extends('layouts.base')
  2. @section('title', '工单列表')
  3. @section('content')
  4. <style>
  5. .content{
  6. background: #eff3f6;
  7. padding: 10px!important;
  8. }
  9. .workOrder{
  10. min-height:100vh;
  11. background-color:#fff;
  12. padding:10px;
  13. }
  14. .title{
  15. font-size:18px;
  16. margin-bottom:15px;
  17. display:flex;
  18. align-items:center;
  19. }
  20. b{
  21. font-size:14px;
  22. }
  23. </style>
  24. <div id="app">
  25. <template>
  26. <div class="workOrder" >
  27. <div class="title"><span style="width: 4px;height: 18px;background-color: #29ba9c;margin-right:15px;display:inline-block;"></span><b>我的工单</b></div>
  28. <div class="search_box">
  29. <el-select v-model="value" placeholder="问题分类">
  30. <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
  31. </el-option>
  32. </el-select>
  33. <el-select v-model="valuetwo" placeholder="处理状态" style="margin-left:5px;">
  34. <el-option v-for="item in optionstwo" :key="item.value" :label="item.label" :value="item.value">
  35. </el-option>
  36. </el-select>
  37. <el-input v-model="woker_sn" placeholder="工单编号/问题标题" style="width:200px;height:30px;margin-left:5px;"></el-input>
  38. <el-select v-model="valuethree" @change="cateChange"placeholder="请选择" style="margin-left:5px;">
  39. <el-option v-for="item in optionsthree" :key="item.value" :label="item.label" :value="item.value">
  40. </el-option>
  41. </el-select>
  42. <el-date-picker
  43. v-if="timeshow"
  44. v-model="value1"
  45. type="datetimerange"
  46. value-format="yyyy-MM-dd HH:mm:ss"
  47. range-separator="至"
  48. start-placeholder="开始日期"
  49. end-placeholder="结束日期"
  50. style="margin-left:5px;"
  51. align="right">
  52. </el-date-picker>
  53. <!-- <el-date-picker v-model="value1" type="datetime" placeholder="选择日期时间" > -->
  54. </el-date-picker>
  55. <el-button type="primary" style="backgroud:#83c785;color:#fff;margin-left:5px;" icon="el-icon-search" @click="searchAll">搜索</el-button>
  56. <el-button @click="submit">提交工单</el-button>
  57. </div>
  58. <div style="background: #eff3f6;width:100%;height:15px;"></div>
  59. <div class="table_box" style="margin-top:20px;">
  60. <el-table :data="tableData" align="center">
  61. <el-table-column prop="work_order_sn" label="工单编号" align="center" >
  62. </el-table-column>
  63. <el-table-column prop="question_title" label="问题标题" align="center">
  64. </el-table-column>
  65. <el-table-column prop="created_at" label="提交时间" align="center">
  66. </el-table-column>
  67. <el-table-column prop="completion_time" label="完成时间" align="center">
  68. </el-table-column>
  69. <el-table-column prop="difference" label="处理时长" align="center">
  70. </el-table-column>
  71. <el-table-column prop="status_name" label="处理状态" align="center">
  72. </el-table-column>
  73. <el-table-column prop="has_one_admin_user.name" label="售后人员" align="center">
  74. </el-table-column>
  75. <el-table-column prop="address" label="操作">
  76. <template slot-scope="scope">
  77. <el-button size="mini" @click="catchInfo(scope.row)">查看详情</el-button>
  78. </template>
  79. </el-table-column>
  80. </el-table>
  81. </div>
  82. <div class="pageclass" style="margin-top: 20px;">
  83. <el-pagination
  84. align="center"
  85. @current-change="handleCurrentChange"
  86. :current-page.sync="currentPage"
  87. :page-size="PageSize"
  88. layout="total, prev, pager, next,jumper"
  89. :total="total">
  90. </el-pagination>
  91. </div>
  92. </div>
  93. </template>
  94. </div>
  95. <script>
  96. var vm = new Vue({
  97. el: "#app",
  98. data() {
  99. let category_list={!! $category_list !!};
  100. let data={!! $data !!};
  101. let status_list={!! $status_list !!};
  102. category_list.map(item=>{
  103. item.label=item.name;
  104. item.value=item.id;
  105. })
  106. status_list.map(val=>{
  107. val.value=val.id;
  108. val.label=val.name;
  109. })
  110. console.log(data,'列表数据');
  111. console.log(status_list,'状态列表');
  112. console.log(category_list,'分类列表');
  113. return {
  114. options:category_list ,
  115. value: 0,
  116. valuetwo: 0,
  117. optionstwo:status_list,
  118. woker_sn: '',
  119. optionsthree: [{
  120. value: '1',
  121. label: '搜索工单时间'
  122. }, {
  123. value: '0',
  124. label: '工单时间不限'
  125. }],
  126. valuethree: '0',
  127. value1: '',
  128. tableData: data.data,
  129. url:'http://gy18465381.imwork.net',
  130. domin:'127.0.0.1',
  131. category_id:'0',//分类id
  132. currentPage:data.current_page,//当前页
  133. total:data.total,//总条数
  134. PageSize:15,//每页显示多少条
  135. timeshow:false,//默认显示时间选择器
  136. }
  137. },
  138. created() {
  139. },
  140. methods: {
  141. goBack() {
  142. window.location.href = `{!! yzWebFullUrl('setting.shop.index1') !!}`;
  143. },
  144. // 分类改变
  145. cateChange(val){
  146. if (val==0) {
  147. this.timeshow=false;
  148. }else{
  149. this.timeshow=true;
  150. }
  151. },
  152. getTable(){
  153. let starttime=new Date(this.value1[0]).getTime();
  154. let endtime=new Date(this.value1[1]).getTime();
  155. let data={
  156. category_id:this.value,
  157. status:this.valuetwo,
  158. work_order_sn:this.woker_sn,
  159. has_time_limit:this.valuethree,
  160. start_time:starttime,
  161. end_time:endtime,
  162. page:this.currentPage
  163. }
  164. this.$http.post('{!!yzWebFullUrl('setting.work-order.search')!!}',{data}).then(res=>{
  165. res=res.body;
  166. if (res.result==1) {
  167. console.log(res.data,'数据');
  168. this.tableData=res.data.data;
  169. this.total=res.data.total;
  170. this.currentPage=res.data.current_page;
  171. }else{
  172. this.$message.error(res.msg)
  173. }
  174. })
  175. },
  176. submit() {
  177. console.log(this.input, '輸入框');
  178. console.log('提交工彈');
  179. window.location.href = "{!! yzWebFullUrl('setting.work-order.store-page') !!}";
  180. },
  181. handleCurrentChange(val) {
  182. this.currentPage=val;
  183. this.getTable()
  184. },
  185. // 搜索
  186. searchAll(){
  187. this.currentPage=1;
  188. this.getTable();
  189. },
  190. catchInfo(row){
  191. console.log(row,'行');
  192. window.location.href = "{!! yzWebFullUrl('setting.work-order.details') !!}"+'&id='+row.id;
  193. }
  194. },
  195. })
  196. </script>
  197. @endsection