index.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport"
  6. content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  7. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  8. <link rel="Shortcut Icon" href="/public/images/logo.png" type="image/x-icon" />
  9. <title>国天云医院后勤保障服务支持系统</title>
  10. <script src="/public/js/jquery-1.11.3.min.js"></script>
  11. <script src="/public/layer/layer.js"></script>
  12. <link rel="stylesheet" href="/public/elementui/index.min.css" integrity="sha512-UaTBkNLFJFC1jgQBIvKrIbM64pw5QfcjH3tGQcBaPhHh69rqyc2R6UIoV16lVo53PKHIQfdPXs8lBtG7xMsctQ==" crossorigin="anonymous" />
  13. <script src="/public/elementui/vue.min.js"></script>
  14. <script src="/public/elementui/index.min.js" integrity="sha512-KhiFHhXUBBvO9P5Io/ITsjbu069pjGudMqhpgv57pWDJ3UG51y/YDd4VtGlt/GXhwf36dHgGsTp0Alu48bvk9g==" crossorigin="anonymous"></script>
  15. <style>
  16. html,body{
  17. padding: 0;
  18. margin: 0;
  19. background-color: #CCCCCC;
  20. }
  21. .pull-right{
  22. float: right !important;
  23. }
  24. #vueapp{
  25. width: 80%;
  26. margin: 0 auto;
  27. background-color: #ffffff;
  28. }
  29. .main{
  30. padding: 15px;
  31. }
  32. .add-btns{
  33. padding: 10px 0;
  34. }
  35. .page{
  36. text-align: center;
  37. padding: 20px 0;
  38. }
  39. td{
  40. padding: 5px;
  41. }
  42. </style>
  43. </head>
  44. <body>
  45. <div id="vueapp">
  46. <el-menu
  47. class="el-menu-demo"
  48. mode="horizontal"
  49. >
  50. <el-menu-item index="1"><?=$this->session->userinfo['orgName']?></el-menu-item>
  51. <el-submenu index="2" class="pull-right">
  52. <template slot="title">欢迎,<?=$this->session->userinfo['realName']?></template>
  53. <el-menu-item index="2-1" @click="handleLogin">退出</el-menu-item>
  54. </el-submenu>
  55. </el-menu>
  56. <el-card class="box-card">
  57. <div slot="header" class="clearfix">
  58. <el-row>
  59. <el-col :span="4">
  60. <el-button size="small" @click="addOrder">
  61. 创建{{btnTitle}}订单
  62. </el-button>
  63. </el-col>
  64. <el-col :span="20" style="text-align: right;">
  65. </el-col>
  66. </el-row>
  67. </div>
  68. <el-tabs v-model="activeName" @tab-click="handleClick">
  69. <el-tab-pane v-for="(item,index) in menus" :label="item.title" :name="item.id"></el-tab-pane>
  70. <!-- <el-tab-pane label="报修订单" name="first"></el-tab-pane>-->
  71. <!-- <el-tab-pane label="保洁订单" name="second"></el-tab-pane>-->
  72. <!-- <el-tab-pane label="运送订单" name="third"></el-tab-pane>-->
  73. <!-- <el-tab-pane label="隐患预警订单" name="fourth"></el-tab-pane>-->
  74. </el-tabs>
  75. <el-table
  76. v-loading="loading"
  77. :data="tableData"
  78. style="width: 100%"
  79. >
  80. <el-table-column prop="orderId" label="编号"></el-table-column>
  81. <el-table-column prop="workTypeMode" label="订单类型">
  82. <template slot-scope="scope">
  83. <span v-if="scope.row.workTypeMode == 1">报修</span>
  84. <span v-if="scope.row.workTypeMode == 2">保洁</span>
  85. <span v-if="scope.row.workTypeMode == 3">运送</span>
  86. <span v-if="scope.row.workTypeMode == 4">隐患预警</span>
  87. </template>
  88. </el-table-column>
  89. <el-table-column prop="createTime" label="申请时间"></el-table-column>
  90. <el-table-column prop="content" label="内容"></el-table-column>
  91. <el-table-column prop="outContent" label="状态"></el-table-column>
  92. <el-table-column label="操作">
  93. <template slot-scope="scope">
  94. <el-link :underline="false" type="success" @click="handleInfo(scope.row.orderId)">
  95. 详情
  96. </el-link>
  97. &nbsp;
  98. <el-link v-if="scope.row.currOrderMode == 1" :underline="false" type="danger" @click="cancelClick(scope.row.orderId)">
  99. 取消
  100. </el-link>
  101. </template>
  102. </el-table-column>
  103. </el-table>
  104. <div class="page">
  105. <el-pagination
  106. class="page-position"
  107. background
  108. layout="prev, pager, next, sizes, total, jumper"
  109. :current-page="page"
  110. :page-sizes="[10,15,25,50,100]"
  111. :page-size="size"
  112. :total="total"
  113. @size-change="handleSizeChange"
  114. @current-change="handleCurrentChange"
  115. >
  116. </el-pagination>
  117. </div>
  118. </el-card>
  119. <el-dialog
  120. :title="title"
  121. :visible.sync="dialogVisible"
  122. center
  123. width="800px"
  124. @close="handleCancelModal"
  125. >
  126. <el-form v-if="dialogVisible" ref="myForm" :model="form" :rules="rules" label-width="100px">
  127. <el-form-item v-if="activeName != 'third'" label="任务内容" prop="content">
  128. <el-input v-model="form.content" type="textarea" row="4" maxlength="200" show-word-limit placeholder="请输入" />
  129. </el-form-item>
  130. <div v-if="activeName == 'third'">
  131. <el-row>
  132. <el-col :span="12">
  133. <el-form-item label="始发空间" prop="start">
  134. <el-select v-if="addrLoading" v-model="form.start" filterable clearable placeholder="请选择" style="width:100%;">
  135. <el-option
  136. v-for="item in addrs"
  137. :key="item.conveyAddrId"
  138. :label="item.title"
  139. :value="item.conveyAddrId">
  140. </el-option>
  141. </el-select>
  142. </el-form-item>
  143. </el-col>
  144. <el-col :span="12">
  145. <el-form-item label="运送类型" prop="cate">
  146. <el-select v-if="cateLoading" v-model="form.cate" filterable clearable placeholder="请选择" style="width:100%;" @change="changeCate">
  147. <el-option
  148. v-for="item in cates"
  149. :key="item.id"
  150. :label="item.name"
  151. :value="item.id">
  152. </el-option>
  153. </el-select>
  154. </el-form-item>
  155. </el-col>
  156. <el-col :span="12">
  157. <el-form-item label="目的空间" prop="end">
  158. <el-select v-if="addrLoading" v-model="form.end" filterable clearable placeholder="请选择" style="width:100%;">
  159. <el-option
  160. v-for="item in addrs"
  161. :key="item.conveyAddrId"
  162. :label="item.title"
  163. :value="item.conveyAddrId">
  164. </el-option>
  165. </el-select>
  166. </el-form-item>
  167. </el-col>
  168. <el-col :span="12">
  169. <el-form-item label="优先级" prop="priority">
  170. <el-select v-model="form.priority" filterable clearable placeholder="请选择" style="width:100%;">
  171. <el-option
  172. v-for="item in prioritys"
  173. :key="item.id"
  174. :label="item.name"
  175. :value="item.id">
  176. </el-option>
  177. </el-select>
  178. </el-form-item>
  179. </el-col>
  180. <el-col :span="24">
  181. <el-form-item label="运送设备" prop="device">
  182. <el-select v-model="form.device" filterable clearable placeholder="请选择" style="width:100%;">
  183. <el-option
  184. v-for="item in devices"
  185. :key="item.id"
  186. :label="item.name"
  187. :value="item.id">
  188. </el-option>
  189. </el-select>
  190. </el-form-item>
  191. </el-col>
  192. <el-col :span="12">
  193. <el-form-item label="需求时间" prop="xqTime">
  194. <el-date-picker
  195. style="width: 100%"
  196. v-model="form.xqTime"
  197. type="datetime"
  198. :editable="false"
  199. value-format="yyyy-MM-dd HH:mm"
  200. :clearable="true"
  201. placeholder="选择日期时间">
  202. </el-date-picker>
  203. </el-form-item>
  204. </el-col>
  205. <el-col :span="12">
  206. <el-form-item label="应完成时间" prop="ywcTime">
  207. <el-date-picker
  208. style="width: 100%"
  209. v-model="form.ywcTime"
  210. type="datetime"
  211. :editable="false"
  212. value-format="yyyy-MM-dd HH:mm"
  213. :clearable="true"
  214. placeholder="选择日期时间">
  215. </el-date-picker>
  216. </el-form-item>
  217. </el-col>
  218. <el-col :span="12">
  219. <el-form-item label="联系人" prop="name">
  220. <el-input v-model="form.name" maxlength="50" show-word-limit placeholder="请输入" />
  221. </el-form-item>
  222. </el-col>
  223. <el-col :span="12">
  224. <el-form-item label="联系电话" prop="phone">
  225. <el-input v-model="form.phone" maxlength="50" show-word-limit placeholder="请输入" />
  226. </el-form-item>
  227. </el-col>
  228. <el-col :span="24">
  229. <el-form-item label="任务内容" prop="content">
  230. <el-input v-model="form.content" type="textarea" row="4" maxlength="200" show-word-limit placeholder="请输入" />
  231. </el-form-item>
  232. </el-col>
  233. <el-col v-if="brShow" :span="8">
  234. <el-form-item label="床号" prop="bedNumber">
  235. <el-input v-model="form.bedNumber" maxlength="100" show-word-limit placeholder="请输入" />
  236. </el-form-item>
  237. </el-col>
  238. <el-col v-if="brShow" :span="8">
  239. <el-form-item label="姓名" prop="pName">
  240. <el-input v-model="form.pName" maxlength="100" show-word-limit placeholder="请输入" />
  241. </el-form-item>
  242. </el-col>
  243. <el-col v-if="brShow" :span="8">
  244. <el-form-item label="病案号" prop="baNumber">
  245. <el-input v-model="form.baNumber" maxlength="100" show-word-limit placeholder="请输入" />
  246. </el-form-item>
  247. </el-col>
  248. <el-col v-if="brShow" :span="8">
  249. <el-form-item label="性别" prop="gender">
  250. <el-select v-model="form.gender" filterable clearable placeholder="请选择" style="width:100%;">
  251. <el-option value="0" label="未知"></el-option>
  252. <el-option value="1" label="男"></el-option>
  253. <el-option value="2" label="女"></el-option>
  254. </el-select>
  255. </el-form-item>
  256. </el-col>
  257. <el-col v-if="brShow" :span="8">
  258. <el-form-item label="是否往返" prop="back">
  259. <el-select v-model="form.back" filterable clearable placeholder="请选择" style="width:100%;">
  260. <el-option value="0" label="否"></el-option>
  261. <el-option value="1" label="是"></el-option>
  262. </el-select>
  263. </el-form-item>
  264. </el-col>
  265. </el-row>
  266. </div>
  267. </el-form>
  268. <span slot="footer" class="dialog-footer">
  269. <el-button type="primary" :loading="flag" @click="submitbtn">确 定</el-button>
  270. <el-button @click="handleCancelModal">取 消</el-button>
  271. </span>
  272. </el-dialog>
  273. <el-dialog
  274. title="订单详情"
  275. :visible.sync="dialogVisible2"
  276. center
  277. width="800px"
  278. @close="handleCancelModal2"
  279. >
  280. <table v-if="info">
  281. <tr>
  282. <td style="width: 120px">订单类型</td>
  283. <td>{{info.workTypeModeName}}</td>
  284. </tr>
  285. <tr>
  286. <td>申请人</td>
  287. <td>{{info.realName}}</td>
  288. </tr>
  289. <tr>
  290. <td>申请科室</td>
  291. <td>{{info.depName}}</td>
  292. </tr>
  293. <tr>
  294. <td>申请时间</td>
  295. <td>{{info.creatteTime}}</td>
  296. </tr>
  297. <tr>
  298. <td>状态</td>
  299. <td>
  300. <span v-if="info.currOrderMode == 1">待处理</span>
  301. <span v-if="info.currOrderMode == 2||info.currOrderMode == 3">已取消</span>
  302. <span v-if="info.currOrderMode == 5">已派发</span>
  303. <span v-if="info.currOrderMode == 9">已完成</span>
  304. <span v-if="info.currOrderMode == 11">已评价</span>
  305. <span v-if="info.currOrderMode == 12">已作废</span>
  306. </td>
  307. </tr>
  308. <tr>
  309. <td>联系电话</td>
  310. <td>{{info.mobile}}</td>
  311. </tr>
  312. <tr>
  313. <td>任务内容</td>
  314. <td>{{info.content}}</td>
  315. </tr>
  316. <tr v-if="info.workTypeMode == 3">
  317. <td>始发空间</td><td>{{info.startConveyAddrTitle}}</td>
  318. </tr>
  319. <tr v-if="info.workTypeMode == 3">
  320. <td>运送类型</td>
  321. <td>
  322. {{info.conveyTypeName}}
  323. </td>
  324. </tr>
  325. <tr v-if="info.workTypeMode == 3">
  326. <td>目的空间</td><td>{{info.endConveyAddrTitle}}</td>
  327. </tr>
  328. <tr v-if="info.workTypeMode == 3">
  329. <td>优先级</td>
  330. <td>
  331. {{info.priority}}
  332. </td>
  333. </tr>
  334. <tr v-if="info.workTypeMode == 3">
  335. <td>运送设备</td><td>{{info.device}}</td>
  336. </tr>
  337. <tr v-if="info.workTypeMode == 3">
  338. <td>需求时间</td><td>{{info.xqTime}}</td>
  339. </tr>
  340. <tr v-if="info.workTypeMode == 3">
  341. <td>应完成时间</td><td>{{info.ywcTime}}</td>
  342. </tr>
  343. <tr v-if="info.workTypeMode == 3">
  344. <td>联系人</td><td>{{info.pName}}</td>
  345. </tr>
  346. <tr v-if="info.workTypeMode == 3">
  347. <td>联系电话</td><td>{{info.phone}}</td>
  348. </tr>
  349. <tr v-if="info.workTypeMode == 3">
  350. <td>床号</td><td>{{info.bedNumber}}</td>
  351. </tr>
  352. <tr v-if="info.workTypeMode == 3">
  353. <td>姓名</td><td>{{info.pName}}</td>
  354. </tr>
  355. <tr v-if="info.workTypeMode == 3">
  356. <td>病案号</td><td>{{info.baNumber}}</td>
  357. </tr>
  358. <tr v-if="info.workTypeMode == 3">
  359. <td>性别</td>
  360. <td>
  361. <span v-if="info.gender == 0">未知</span>
  362. <span v-if="info.gender == 1">男</span>
  363. <span v-if="info.gender == 2">女</span>
  364. </td>
  365. </tr>
  366. <tr v-if="info.workTypeMode == 3">
  367. <td>往返</td>
  368. <td>
  369. <span v-if="info.back == 0">否</span>
  370. <span v-if="info.back == 1">是</span>
  371. </td>
  372. </tr>
  373. <tr v-if="info.currOrderMode == 11">
  374. <td>评论</td>
  375. <td>
  376. <el-rate v-model="info.score" disabled></el-rate>
  377. <div>
  378. {{info.commentContent}}
  379. </div>
  380. </td>
  381. </tr>
  382. <tr v-if="info.currOrderMode == 9">
  383. <td>评论</td>
  384. <td>
  385. <el-rate v-model="commentform.score"></el-rate>
  386. <div style="padding: 5px 0">
  387. <el-input v-model="commentform.content" placeholder="请输入内容"></el-input>
  388. </div>
  389. <el-button @click="comment">评价</el-button>
  390. </td>
  391. </tr>
  392. <tr v-if="info.sample">
  393. <td>已扫描标本</td>
  394. <td>
  395. {{info.sample}}
  396. </td>
  397. </tr>
  398. </table>
  399. </el-dialog>
  400. </div>
  401. <script>
  402. new Vue({
  403. el: '#vueapp',
  404. data: function() {
  405. return {
  406. page: 1,
  407. size: 10,
  408. total: 100,
  409. btnTitle: '报修',
  410. title: '',
  411. activeName: 'first',
  412. dialogVisible: false,
  413. flag: false,
  414. commonparam:{
  415. userId: <?=$this->session->userinfo['userId']?>,
  416. token: '<?=$this->session->userinfo['token']?>',
  417. orgId: <?=$this->session->userinfo['orgId']?>
  418. },
  419. initstart: <?=$this->session->userinfo['user']['addrId']?>,
  420. form : {
  421. content: '',
  422. start: '',
  423. end: '',
  424. cate: '',
  425. priority: '',
  426. device: '',
  427. name: '',
  428. phone: '',
  429. xqTime: '',
  430. ywcTime: '',
  431. bedNumber: '',
  432. pName: '',
  433. baNumber: '',
  434. gender: '',
  435. back: '',
  436. },
  437. commentform : {
  438. score: 0,
  439. content: ''
  440. },
  441. rules : {
  442. // name: [
  443. // { required: true, message: '请输入名称', trigger: 'blur' },
  444. // ],
  445. },
  446. brShow: false, //是否显示病人信息
  447. tableData:[],
  448. addrs: [],
  449. addrLoading: false,
  450. cates: [],
  451. cateLoading: false,
  452. prioritys: [
  453. {id: 1,name: '可延缓的'},
  454. {id: 2,name: '常规'},
  455. {id: 3,name: '紧急'},
  456. {id: 4,name: '预约'}
  457. ],
  458. devices: [],
  459. alldevices: [],
  460. deviceLoading: false,
  461. loading: false,
  462. dialogVisible2: false,
  463. info: null,
  464. infoLoading: false,
  465. commentform:{
  466. score: 5,
  467. content: ''
  468. },
  469. menus: [
  470. {id:'first',title:'报修订单',url:'/Order/addshow?mode=1'},
  471. {id:'second',title:'保洁订单',url:'/Order/addshow?mode=2'},
  472. {id:'third',title:'运送订单',url:'/Order/addshow?mode=3'},
  473. {id:'forth',title:'隐患预警订单',url:'/Order/addshow?mode=4'},
  474. ],
  475. urules: <?=json_encode($this->session->userinfo['rules'])?>
  476. }
  477. },
  478. watch: {
  479. },
  480. created(){
  481. const newmenus = this.menus;
  482. this.menus = [];
  483. newmenus.forEach((item) => {
  484. let ff = false;
  485. this.urules.forEach((item2) => {
  486. if(item.url == item2.url){
  487. ff = true;
  488. }
  489. });
  490. if(ff){
  491. this.menus.push(item);
  492. }
  493. });
  494. this.activeName = '';
  495. if(this.menus.length > 0){
  496. this.activeName = this.menus[0].id;
  497. }
  498. if(this.activeName == 'first'){
  499. this.btnTitle = '报修';
  500. }else if(this.activeName == 'second'){
  501. this.btnTitle = '保洁';
  502. }else if(this.activeName == 'third'){
  503. this.btnTitle = '运送';
  504. }else{
  505. this.btnTitle = '隐患预警';
  506. }
  507. this.getAddrData();
  508. this.getCateData();
  509. this.getDeviceData(0);
  510. this.getListData();
  511. },
  512. methods: {
  513. handleClick(){
  514. if(this.activeName == 'first'){
  515. this.btnTitle = '报修';
  516. }else if(this.activeName == 'second'){
  517. this.btnTitle = '保洁';
  518. }else if(this.activeName == 'third'){
  519. this.btnTitle = '运送';
  520. }else{
  521. this.btnTitle = '隐患预警';
  522. }
  523. this.page = 1;
  524. this.getListData();
  525. },
  526. changeCate(){
  527. var that = this;
  528. this.cates.forEach((item) => {
  529. if(item.id.toString() == this.form.cate.toString()){
  530. this.form.end = item.ends.length == 1?item.ends[0].id:'';
  531. var pp = that.commonparam;
  532. pp.cateId= item.id;
  533. $.ajax({
  534. url: '/home/conveyXqTime',
  535. type: 'POST',
  536. data: pp,
  537. success: function(res){
  538. if(res.code==0){
  539. that.form.xqTime = res.data.xqTime;
  540. that.form.ywcTime = res.data.wcTime;
  541. }else if(data.code == -100){
  542. that.checkLogin(res);
  543. }else {
  544. that.form.xqTime = '';
  545. that.form.ywcTime = '';
  546. layer.msg(data.message);
  547. }
  548. },
  549. error: function (){
  550. }
  551. });
  552. this.form.priority = item.priority > 0?item.priority:'';
  553. if(item.cate == 1){
  554. this.brShow = true;
  555. }else{
  556. this.brShow = false;
  557. }
  558. this.form.device = '';
  559. this.devices = [];
  560. this.getDeviceData(this.form.cate);
  561. }
  562. });
  563. },
  564. handleLogin(){
  565. window.location.href = '/Account/logout';
  566. },
  567. handleSizeChange(val) {
  568. this.size = val;
  569. this.getListData();
  570. },
  571. handleCurrentChange(val) {
  572. this.page = val;
  573. this.getListData();
  574. },
  575. addOrder(){
  576. if(this.activeName == 'first'){
  577. this.title = '创建报修订单';
  578. }else if(this.activeName == 'second'){
  579. this.title = '创建保洁订单';
  580. }else if(this.activeName == 'third'){
  581. this.title = '创建运送订单';
  582. }else{
  583. this.title = '创建隐患预警订单';
  584. }
  585. this.form = {
  586. content: '',
  587. start: this.initstart > 0?this.initstart:'',
  588. end: '',
  589. cate: '',
  590. priority: '',
  591. device: '',
  592. name: '',
  593. phone: '',
  594. xqTime: '',
  595. ywcTime: '',
  596. bedNumber: '',
  597. pName: '',
  598. baNumber: '',
  599. gender: '',
  600. back: '',
  601. };
  602. this.dialogVisible = true;
  603. },
  604. handleCancelModal(){
  605. this.dialogVisible = false;
  606. },
  607. handleInfo(id){
  608. console.log(id);
  609. this.getInfo(id);
  610. this.commentform = {
  611. score : 5,
  612. content : ''
  613. };
  614. this.dialogVisible2 = true;
  615. },
  616. handleCancelModal2(){
  617. this.dialogVisible2 = false;
  618. },
  619. getInfo(id){
  620. let that = this;
  621. that.infoLoading = true;
  622. const param = this.commonparam;
  623. param.orderId = id;
  624. $.ajax({
  625. url: '/home/orderQueryDetail',
  626. type: 'POST',
  627. data: param,
  628. success: function(data){
  629. console.log(data);
  630. if(data.code == 0){
  631. that.info = data.data;
  632. }else if(data.code == -100){
  633. that.checkLogin(data);
  634. }else{
  635. layer.msg(data.message)
  636. }
  637. that.infoLoading = false;
  638. },
  639. error: function (){
  640. that.infoLoading = false;
  641. }
  642. });
  643. },
  644. cancelClick(id) {
  645. let that = this;
  646. if (this.flag === false) {
  647. this.$confirm('确定要取消此订单吗?', '提示', {
  648. confirmButtonText: '确定',
  649. cancelButtonText: '取消',
  650. type: 'warning',
  651. }).then(() => {
  652. const param = this.commonparam;
  653. param.orderId = id;
  654. that.flag = true;
  655. $.ajax({
  656. url: '/home/updateOrderModeByUser',
  657. type: 'POST',
  658. data: param,
  659. success: function(data){
  660. console.log(data);
  661. if(data.code == 0){
  662. that.page = 1;
  663. that.getListData();
  664. }else if(data.code == -100){
  665. that.checkLogin(data);
  666. }else{
  667. layer.msg(data.message)
  668. }
  669. that.flag = false;
  670. },
  671. error: function (){
  672. that.flag = false;
  673. }
  674. });
  675. }).catch(() => {});
  676. }
  677. },
  678. getCateData(){
  679. let that = this;
  680. $.ajax({
  681. url: '/home/conveyCateLists',
  682. type: 'POST',
  683. data: this.commonparam,
  684. success: function(data){
  685. console.log(data);
  686. if(data.code == 0){
  687. that.cates = data.data;
  688. }else if(data.code == -100){
  689. that.checkLogin(data);
  690. }else{
  691. layer.msg(data.message)
  692. }
  693. that.cateLoading = true;
  694. },
  695. error: function (){
  696. that.cateLoading = true;
  697. }
  698. });
  699. },
  700. getAddrData(){
  701. let that = this;
  702. $.ajax({
  703. url: '/home/queryConveyAddrList',
  704. type: 'POST',
  705. data: this.commonparam,
  706. success: function(data){
  707. console.log(data);
  708. if(data.code == 0){
  709. that.addrs = data.data;
  710. console.log(that.addrs);
  711. }else if(data.code == -100){
  712. that.checkLogin(data);
  713. }else{
  714. layer.msg(data.message)
  715. }
  716. that.addrLoading = true;
  717. },
  718. error: function (){
  719. that.addrLoading = true;
  720. }
  721. });
  722. },
  723. getDeviceData(cateId){
  724. let that = this;
  725. const param = this.commonparam;
  726. param.cateId = cateId;
  727. $.ajax({
  728. url: '/home/ConveyDeviceLists',
  729. type: 'POST',
  730. data: param,
  731. success: function(data){
  732. console.log(data);
  733. if(data.code == 0){
  734. that.devices = data.data;
  735. }else if(data.code == -100){
  736. that.checkLogin(data);
  737. }else{
  738. layer.msg(data.message)
  739. }
  740. that.deviceLoading = true;
  741. },
  742. error: function (){
  743. that.deviceLoading = true;
  744. }
  745. });
  746. },
  747. getListData(){
  748. let that = this;
  749. const param = this.commonparam;
  750. param.page = this.page;
  751. param.size = this.size;
  752. if(this.activeName == 'first'){
  753. param.mode = 1;
  754. }else if(this.activeName == 'second'){
  755. param.mode = 2;
  756. }else if(this.activeName == 'third'){
  757. param.mode = 3;
  758. }else{
  759. param.mode = 4;
  760. }
  761. that.loading = true;
  762. $.ajax({
  763. url: '/home/queryUserOrdersByMode',
  764. type: 'POST',
  765. data: param,
  766. success: function(data){
  767. if(data.code == 0){
  768. that.tableData = data.data.lists;
  769. that.total = data.data.total;
  770. }else if(data.code == -100){
  771. that.checkLogin(data);
  772. }else{
  773. layer.msg(data.message)
  774. }
  775. that.loading = false;
  776. },
  777. error: function (){
  778. that.loading = false;
  779. }
  780. });
  781. },
  782. submitbtn(){
  783. let that = this;
  784. const param = this.commonparam;
  785. param.content = this.form.content;
  786. param.depId = "<?=isset($this->session->userinfo['deptList'][0]['orgId'])?$this->session->userinfo['deptList'][0]['orgId']:""?>";
  787. if(this.activeName == 'first'){
  788. param.workTypeMode = 1;
  789. }else if(this.activeName == 'second'){
  790. param.workTypeMode = 2;
  791. }else if(this.activeName == 'third'){
  792. param.workTypeMode = 3;
  793. }else{
  794. param.workTypeMode = 4;
  795. }
  796. if(this.activeName == 'third'){
  797. param.start = this.form.start;
  798. param.end = this.form.end;
  799. param.cate = this.form.cate;
  800. param.priority = this.form.priority;
  801. param.device = this.form.device;
  802. param.name = this.form.name;
  803. param.phone = this.form.phone;
  804. param.xqTime = this.form.xqTime;
  805. param.ywcTime = this.form.ywcTime;
  806. param.bedNumber = this.form.bedNumber;
  807. param.pName = this.form.pName;
  808. param.baNumber = this.form.baNumber;
  809. param.gender = this.form.gender;
  810. param.back = this.form.back;
  811. }
  812. $.ajax({
  813. url: '/home/orderYhadd',
  814. type: 'POST',
  815. data: param,
  816. success: function(data){
  817. if(data.code == 0){
  818. layer.msg('操作成功');
  819. that.dialogVisible = false;
  820. this.page = 1;
  821. that.getListData();
  822. }else if(data.code == -100){
  823. that.checkLogin(data);
  824. }else{
  825. layer.msg(data.message);
  826. }
  827. },
  828. error: function (){
  829. }
  830. });
  831. },
  832. comment(){
  833. let that = this;
  834. const param2 = this.commonparam;
  835. param2.content = this.commentform.content;
  836. param2.score = this.commentform.score;
  837. param2.fromId = this.info['orderId'];
  838. param2.type = this.info['workTypeMode'];
  839. $.ajax({
  840. url: '/home/commentYhadd',
  841. type: 'POST',
  842. data: param2,
  843. success: function(data){
  844. if(data.code == 0){
  845. layer.msg('操作成功');
  846. that.dialogVisible2 = false;
  847. that.getListData();
  848. }else if(data.code == -100){
  849. that.checkLogin(data);
  850. }else{
  851. layer.msg(data.message);
  852. }
  853. },
  854. error: function (){
  855. }
  856. });
  857. },
  858. checkLogin(res){
  859. if(res.code == -100){
  860. layer.msg(res.message);
  861. setTimeout(function () {
  862. window.location.href = '/Account/logout';
  863. },1500);
  864. }
  865. }
  866. }
  867. })
  868. </script>
  869. </body>
  870. </html>