list.blade.php 9.0 KB

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