edit.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833
  1. <template>
  2. <div class="box">
  3. <div style="position: fixed;z-index:-15;background-color: #eeeeef;top: 0;bottom: 0;right: 0;left: 0;"></div>
  4. <title class="order-body-title">预约信息<span @click="back"></span></title>
  5. <div class="order-body">
  6. <div class="my-order-body">
  7. <div><span class="title">创建:</span>{{order.time_str}}</div>
  8. <div><span class="title">姓名:</span>{{order.user_name}}</div>
  9. <div><span class="title">手机:</span><a id='tel' class="edit"
  10. v-bind:href='`tel:${order.mobile}`'>{{order.mobile}}</a>
  11. </div>
  12. <div><span class="title">地址:</span>{{order.address}}</div>
  13. <!--
  14. <div class="stroe"><span class="title"
  15. style="display: flex;align-items: center;"><span>门店:</span></span><span>
  16. {{store.name }}({{store.address}})<br>门店电话:<a id='tel' class="edit"
  17. v-bind:href='`tel:${store.mobile}`'>{{store.mobile}}</a>
  18. </span></div>
  19. -->
  20. <div class="stroe"><span class="title"
  21. style="display: flex;align-items: center;"><span>门店:</span></span><span>{{store.name }}</span>
  22. </div>
  23. <div><span class="title">服务:</span>{{order.type_str}}</div>
  24. <div v-if='order.type -1 == 0'><span
  25. class="title">时间:</span>{{time.start}} ~ {{time.end}}
  26. </div>
  27. <div v-if='order.type -1 == 0'><span class="title">形式:</span>{{order.cart_str}}</div>
  28. <div v-if='order.type -1 == 0'><span class="title">技能:</span>{{skillStr}}</div>
  29. <div v-if='order.type - 1 != 0'><span class="title">{{order.type > 2?'日期':'预产'}}:</span>{{order.yc_time}}
  30. </div>
  31. <div v-if='order.type -1 == 2'><span class="title">童龄:</span>{{order.age}}岁</div>
  32. <div><span class="title">备注:</span>{{order.desc}}</div>
  33. <!--<div v-if="showContract"><span class="title">状态:</span><span @click='btnContract'>{{contractStr}}</span></div>-->
  34. <div v-if="order.contract != 2"
  35. style="width: 100%;border-bottom: 1px solid #afafaf;height: 1px;margin:20px 0;"></div>
  36. <div v-if='!showTech && order.status != 4 '><span class="title edit_title">人员:</span>{{order.tech}}</div>
  37. <div v-if="order.status === 3 && order.status != 4 "><span class="title edit_title">手机:</span><span>{{order.tech_mobile}}</span>
  38. </div>
  39. <div v-if="order.status > 2 && order.status != 4"><span class="title edit_title">面试:</span>{{order.status_time
  40. == '1970-01-01 08:00:00'?'未设置面试时间':order.status_time}}
  41. </div>
  42. <div v-if="order.status == 4"><span class="title edit_title ">原因:</span>{{order.cancel_cause}}</div>
  43. <!--showContract btnContract-->
  44. <div v-if="order.status === 3 && order.contract === 2"><span class="title">状态:</span>{{order.contract_str}}
  45. </div>
  46. <!--家政员-->
  47. <div v-if="showTech && order.status != 4 && tech == ''">
  48. <span class="title edit_title">人员:</span><span class="edit" style="display:inline-block;"
  49. @click="selectF">自动筛选家政员</span>
  50. </div>
  51. <div v-if="showTech && order.status != 4 && tech != ''">
  52. <span class="title edit_title">人员:</span><span class="edit" @click="selectF">{{tech}}</span>
  53. </div>
  54. <div v-if="order.status !== 3 && order.contract !== 2 && order.status != 4 && techMobile != ''">
  55. <span class="title edit_title">手机:</span><span class="edit" @click="selectF">{{techMobile}}</span>
  56. </div>
  57. <!--
  58. 家政员
  59. <div v-if="showTech && order.status != 4">
  60. <span class="title">人员:</span><span><input v-model="tech" class="tech edit" type="text"
  61. placeholder='请输入家政员'></span>
  62. </div>
  63. <div v-if="order.status !== 3 && order.contract !== 2 && order.status != 4 ">
  64. <span class="title">手机:</span><span><input v-model="techMobile" class="tech edit" type="text"
  65. placeholder='请输入人员电话'></span>
  66. </div>
  67. -->
  68. <!--预约日期-->
  69. <div v-if="showStatus && order.status != 4">
  70. <!--选择时间-->
  71. <!--<span>预约日期:</span>
  72. <span class="edit" @click="getTimes">{{bookingTime}}</span>-->
  73. <datetime v-model="bookingTime" format="YYYY-MM-DD HH:00"
  74. @on-change="change" :title="('面试:')" year-row="{value}年" month-row="{value}月"
  75. day-row="{value}日"
  76. hour-row="{value}点" minute-row="{value}分" confirm-text="完成" cancel-text="取消"
  77. :start-date='startDate'
  78. placeholder="请选择日期"
  79. :end-date='endDate' :min-hour=9 :max-hour=18></datetime>
  80. </div>
  81. <!--预约状态-->
  82. <div v-if="order.status === 1 && order.contract !== 2">
  83. <span class="title edit_title">状态:</span><span class="edit" @click='btnAppointmentStatus'>{{appointmentStatusStr.label}}</span>
  84. </div>
  85. <!--取消原因-->
  86. <div v-if="showTechAppointmentStatus" style="margin-top: 5px;">
  87. <span class="title edit_title">原因:</span><span><input v-model="showTechAppointmentStatusStr" class="tech edit"
  88. type="text"
  89. style="font-size: 15px"
  90. placeholder='请输入取消原因'></span>
  91. </div>
  92. <!--面试状态-->
  93. <!--<div class="weui-cell" v-if="order.status == 2">-->
  94. <!--<div class="weui-cell__hd"><label class="weui-label">面试状态</label></div>-->
  95. <!--<div class="weui-cell__bd" @click='btnServiceForm'>-->
  96. <!--<input class="weui-input select-time" type="button" required=""-->
  97. <!--:value="serviceForm">-->
  98. <!--</div>-->
  99. <!--<div class="weui-cell__ft"><i class="weui-icon-warn"></i></div>-->
  100. <!--</div>-->
  101. <div v-if="order.status == 2">
  102. <span class="title edit_title">状态:</span>
  103. <span style="margin-left: -4px;" @click="btnServiceForm" class="edit">{{serviceForm}}</span>
  104. </div>
  105. <div v-if="order.status == 3 && order.contract != 2">
  106. <span class="title edit_title">状态:</span>
  107. <span style="margin-left: -4px;" @click="btnContractFrom" class="edit">{{contractFrom}}</span>
  108. </div>
  109. </div>
  110. </div>
  111. <div v-if="btnSubmintStrShow && order.status != 4" class="m-btn" @click="btnSubmint">
  112. {{btnSubmintStr}}
  113. <!--<x-button type="primary" @click.native='btnSubmint'>{{btnSubmintStr}}</x-button>-->
  114. </div>
  115. </div>
  116. </template>
  117. <script>
  118. import _ from "@/config";
  119. import selectTime from "@/config/selectTime";
  120. import axios from "axios";
  121. import {Group, Datetime, XButton} from "vux";
  122. export default {
  123. name: "orderInfo",
  124. data() {
  125. return {
  126. type: {
  127. 0: "钟点工",
  128. 1: "月嫂",
  129. 2: "育婴师",
  130. 3: "护理老人",
  131. 4: "全套家务"
  132. },
  133. serviceArr: [
  134. {label: "未面试", value: 1},
  135. {label: "已面试", value: 2}
  136. ],
  137. contractArr: [
  138. {label: "未签约", value: 1},
  139. {label: "已签约", value: 2}
  140. ],
  141. appointmentStatus: [
  142. {
  143. label: "已预约",
  144. value: 0
  145. },
  146. {
  147. label: "已取消",
  148. value: 1
  149. }
  150. ],
  151. appointmentStatusStr: "", // 预约状态
  152. showTechAppointmentStatus: false, // 取消原因
  153. showTechAppointmentStatusStr: "",
  154. serviceForm: "未面试",
  155. resServiceArr: 1,
  156. contractFrom: "未签约",
  157. resContract: 1,
  158. order: {},
  159. eAppointmentDate: false,
  160. monthArr: {},
  161. skillStr: "", // 服务技能
  162. bookingTime: "请选择日期", // 服务时间
  163. time: {
  164. start: "",
  165. end: ""
  166. },
  167. value: ["2017-06-24", "03", "05"], // 设定日期格式
  168. startDate: selectTime.startDate, // 限定最小日期
  169. endDate: "", // 限定最大日期
  170. tech: "",
  171. techMobile: "",
  172. store: {
  173. name: "",
  174. address: "",
  175. mobile: ""
  176. },
  177. showTech: false, // 家政员
  178. showContract: false, // 签约状态
  179. contractStr: "未签约",
  180. contractStrArr: [],
  181. btnSubmintStr: "提交",
  182. // btnSubmintStr: '已预约',
  183. btnSubmintStrShow: true,
  184. showStatus: false, // 预约状态
  185. homeClerkDetails: {} // 家政员信息
  186. };
  187. },
  188. created() {
  189. let self = this;
  190. // 初始化订单状态 => 已预约
  191. self.appointmentStatusStr = self.appointmentStatus[0];
  192. // 设置订单中门店信息
  193. if (_.orderInfo.store.name == undefined) {
  194. _.$http(
  195. "/j/HouseKeeping/GetStore", {
  196. user_id: _.user_id
  197. }, res => {
  198. for (let i in res.data) {
  199. // 筛选出订单中的门店信息
  200. if (res.data[i].store_id == _.oldOrderInfo.store_id) {
  201. self.store.name = res.data[i].store_name;
  202. self.store.address = res.data[i].address;
  203. self.store.mobile = res.data[i].mobile;
  204. // 初始化门店信息
  205. _.orderInfo.store.name = self.store.name;
  206. _.orderInfo.store.address = self.store.address;
  207. _.orderInfo.store.mobile = self.store.mobile;
  208. return;
  209. }
  210. }
  211. }
  212. );
  213. } else {
  214. // 首次进入该界面前
  215. self.store.name = _.orderInfo.store.name;
  216. self.store.address = _.orderInfo.store.address;
  217. self.store.mobile = _.orderInfo.store.mobile;
  218. }
  219. if (_.oldOrderInfo === undefined) {
  220. self.$router.push({path: "/managementList"});
  221. return;
  222. }
  223. // 编辑界面
  224. /*setTimeout(() => {
  225. let $clientHeight = document.documentElement.clientHeight,
  226. $time = document.getElementsByClassName('order-body-title'),
  227. $orderBody = document.getElementsByClassName('order-body'),
  228. $mBtn = document.getElementsByClassName('m-btn'),
  229. $mBtnHeight = $mBtn[0] != undefined ? $mBtn[0].clientHeight : 0;
  230. $orderBody[0].style.height = $clientHeight - $time[0].clientHeight - $mBtnHeight + 15 + 'px';
  231. }, 200);*/
  232. self.order = _.oldOrderInfo;
  233. // 状态编辑
  234. // 时间
  235. self.order.time_str = _.timetrans(self.order.time);
  236. // 已面试
  237. if (self.order.contract === 1 && self.order.status === 2) {
  238. self.btnSubmintStr = "提交";
  239. }
  240. // 已签约
  241. if (self.order.contract === 1 && self.order.status === 3) {
  242. self.btnSubmintStr = "提交";
  243. // self.btnSubmintStr = '已签约'
  244. }
  245. // 已完成
  246. if (self.order.contract === 2 && self.order.status === 3) {
  247. self.btnSubmintStrShow = false;
  248. }
  249. // 预约时间
  250. // console.log(self.order.status_time);
  251. // console.log(self.bookingTime);
  252. // console.log(_.oldOrderInfo.bookingTime);
  253. if (self.order.status_time != 0) {
  254. self.bookingTime = self.order.status_time;
  255. if (_.oldOrderInfo.bookingTime == undefined) {
  256. _.oldOrderInfo.bookingTime = self.bookingTime;
  257. }
  258. }
  259. if (_.oldOrderInfo.bookingTime != undefined) {
  260. self.bookingTime = _.oldOrderInfo.bookingTime;
  261. }
  262. // 家政员
  263. if (self.order.tech.length > 0) {
  264. self.tech = self.order.tech;
  265. }
  266. // 家政员电话
  267. if (self.order.tech_mobile !== "") {
  268. self.techMobile = self.order.tech_mobile;
  269. }
  270. // 家政员信息赋值
  271. if (_.oldOrderInfo != undefined && _.oldOrderInfo.homeClerkDetails != undefined) {
  272. self.homeClerkDetails = _.oldOrderInfo.homeClerkDetails;
  273. self.tech = self.homeClerkDetails.name;
  274. // self.order.tech = self.homeClerkDetails.name;
  275. // _.oldOrderInfo.tech = self.homeClerkDetails.name;
  276. // _.oldOrderInfo.tech_mobile = self.homeClerkDetails.phone;
  277. self.techMobile = self.homeClerkDetails.phone;
  278. // self.order.tech_mobile = self.homeClerkDetails.phone;
  279. // console.log(205)
  280. }
  281. if (_.oldOrderInfo.homeClerkDetails == undefined) {
  282. // console.log(207)
  283. self.tech = self.order.tech;
  284. self.techMobile = self.order.tech_mobile;
  285. }
  286. // 转化时间格式
  287. // this.order.yc_time = _.timetrans(this.order.yc_time); // 预产期
  288. this.order.yc_time = this.order.yc_time.substring(0, 10); // 预产期
  289. this.time.start = _.timetrans(this.order.server_start_time);
  290. this.time.start = this.time.start.substring(11, 16);
  291. this.time.end = _.timetrans(this.order.server_end_time);
  292. this.time.end = this.time.end.substring(11, 16);
  293. if (this.order.status - 1 == 0) {
  294. this.eAppointmentDate = true;
  295. }
  296. if (this.order.status !== 3) {
  297. this.showStatus = true;
  298. this.showTech = true;
  299. }
  300. if (this.order.contract == 1 && this.order.status == 2) {
  301. this.showContract = true;
  302. }
  303. for (let i in this.order.skill_str) {
  304. this.skillStr = `${this.skillStr} ${this.order.skill_str[i]}`;
  305. }
  306. },
  307. components: {
  308. Group,
  309. Datetime,
  310. XButton
  311. },
  312. methods: {
  313. // 给家政员发送短信
  314. btnServer() {
  315. let self = this;
  316. _.$http("/j/HouseKeeping/Server", {
  317. user_name: self.tech,
  318. servers: self.order.type_str,
  319. status_time: ycTime(self.bookingTime),
  320. store: self.store.name,
  321. address: self.store.address,
  322. mobile: self.store.mobile,
  323. phone: self.techMobile
  324. }, res => {
  325. console.log(res.data)
  326. })
  327. },
  328. // 选择家政员
  329. selectF() {
  330. /*if (this.bookingTime === '请选择日期') {
  331. weui.alert('请先选择预约日期,再选择家政员');
  332. return
  333. } else {
  334. this.$router.push({path: '/managementEmployee'})
  335. }*/
  336. this.$router.push({path: "/managementEmployee"});
  337. },
  338. // 预约状态
  339. btnAppointmentStatus() {
  340. let self = this;
  341. weui.picker(self.appointmentStatus, {
  342. className: "custom-classname",
  343. container: "body",
  344. defaultValue: [0],
  345. onChange: function (result) {
  346. // console.log(result)
  347. },
  348. onConfirm: function (result) {
  349. // console.log(result)
  350. self.appointmentStatusStr = result[0];
  351. if (self.appointmentStatusStr.value === 1) {
  352. self.btnSubmintStr = "提交";
  353. // self.btnSubmintStr = '已取消';
  354. self.showTechAppointmentStatus = true;
  355. // console.log('123')
  356. } else {
  357. self.btnSubmintStr = "提交";
  358. // self.btnSubmintStr = '已预约';
  359. self.showTechAppointmentStatus = false;
  360. }
  361. },
  362. id: "singleLinePicker"
  363. });
  364. },
  365. btnSubmint() {
  366. let self = this;
  367. if (self.appointmentStatusStr.value != 1) {
  368. // 家政员不为空判断
  369. if (self.tech.length == "" && !self.appointmentStatusStr.value) {
  370. weui.alert("请筛选家政员");
  371. return;
  372. }
  373. // 预约日期判断
  374. if (self.bookingTime == '请选择日期' || self.bookingTime == "" && !self.appointmentStatusStr.value) {
  375. weui.alert("请选择预约日期");
  376. return;
  377. }
  378. }
  379. // 预约中
  380. if (self.order.contract == 1 && self.order.status == 1) {
  381. // 已预约
  382. if (!self.appointmentStatusStr.value) {
  383. _.$http(
  384. "/j/HouseKeeping/Edit",
  385. {
  386. id: _.oldOrderInfo.id,
  387. status: 2,
  388. flag: 1,
  389. status_time: ycTime(self.bookingTime),
  390. tech: self.tech,
  391. tech_mobile: self.techMobile
  392. },
  393. res => {
  394. if (res.data.success) {
  395. self.btnServer();
  396. weui.alert("提交成功", function () {
  397. self.$router.push({path: "/managementList"});
  398. });
  399. return;
  400. } else {
  401. weui.alert("提交失败");
  402. return;
  403. }
  404. }
  405. );
  406. return;
  407. } else {
  408. // 已取消
  409. // 取消原因不为空
  410. if (self.showTechAppointmentStatusStr == "") {
  411. weui.alert("请输入取消原因!");
  412. return;
  413. }
  414. self.$vux.confirm.show({
  415. title: "提示",
  416. content: "请确定,是否取消该预约?",
  417. // 组件除show外的属性
  418. onCancel() {
  419. },
  420. onConfirm() {
  421. _.$http(
  422. "/j/HouseKeeping/Edit",
  423. {
  424. id: _.oldOrderInfo.id,
  425. status: 4,
  426. cancel_cause: self.showTechAppointmentStatusStr
  427. },
  428. res => {
  429. if (res.data.success) {
  430. weui.alert("提交成功", function () {
  431. self.$router.push({path: "/managementList"});
  432. });
  433. return;
  434. } else {
  435. weui.alert("提交失败");
  436. return;
  437. }
  438. }
  439. );
  440. return;
  441. }
  442. });
  443. }
  444. }
  445. // 已面试
  446. if (self.order.contract == 1 && self.order.status == 2) {
  447. // 用户不想进入已面试阶段
  448. if (self.resServiceArr === 1) {
  449. // 时间未发生变化 || 家政员未发生变化
  450. if (
  451. _.oldOrder.tech == self.tech &&
  452. ycTime(self.bookingTime) == ycTime(self.order.status_time)
  453. ) {
  454. self.$vux.alert.show({
  455. // title:'提示',
  456. content: "请勿重复提交"
  457. });
  458. } else if (
  459. // 时间发生变化,但是家政员不变
  460. ycTime(self.bookingTime) != ycTime(self.order.status_time)) {
  461. self.$vux.confirm.show({
  462. // title: '提示',
  463. content: "提交后将给客户发送预约短信,确认提交吗?",
  464. onCancel() {
  465. },
  466. onConfirm() {
  467. _.$http(
  468. "/j/HouseKeeping/Edit",
  469. {
  470. id: _.oldOrderInfo.id,
  471. contract: 1,
  472. status: 2,
  473. flag: 1,
  474. status_time: ycTime(self.bookingTime),
  475. tech: self.tech,
  476. tech_mobile: self.techMobile
  477. },
  478. res => {
  479. if (_.oldOrder.tech != self.tech) {
  480. self.btnServer();
  481. }
  482. statusF(res.data.success);
  483. return;
  484. }
  485. );
  486. }
  487. });
  488. } else if (
  489. // 时间发生变化,但是家政员不变
  490. ycTime(self.bookingTime) == ycTime(self.order.status_time) &&
  491. _.oldOrder.tech != self.tech
  492. ) {
  493. _.$http(
  494. "/j/HouseKeeping/Edit",
  495. {
  496. id: _.oldOrderInfo.id,
  497. contract: 1,
  498. status: 2,
  499. status_time: ycTime(self.bookingTime),
  500. tech: self.tech,
  501. tech_mobile: self.techMobile
  502. },
  503. res => {
  504. self.btnServer();
  505. statusF(res.data.success);
  506. return;
  507. }
  508. );
  509. }
  510. // 用户想进入已面试阶段
  511. } else {
  512. // 已面试,但编辑过家政员或面试日期,进行拦截
  513. if (
  514. self.tech != _.oldOrder.tech ||
  515. ycTime(self.order.status_time) != ycTime(self.bookingTime)
  516. ) {
  517. self.$vux.alert.show({
  518. content: "提交失败!",
  519. })
  520. return
  521. }
  522. self.$vux.confirm.show({
  523. title: "提示",
  524. content: "请确定,家政员是否已面试",
  525. // 组件除show外的属性
  526. onCancel() {
  527. },
  528. onConfirm() {
  529. _.$http(
  530. "/j/HouseKeeping/Edit",
  531. {
  532. id: _.oldOrderInfo.id,
  533. contract: 1,
  534. status: 3,
  535. status_time: ycTime(self.bookingTime),
  536. tech: self.tech
  537. },
  538. res => {
  539. statusF(res.data.success);
  540. return;
  541. }
  542. );
  543. }
  544. });
  545. }
  546. }
  547. // 已签约
  548. if (self.order.contract == 1 && self.order.status == 3) {
  549. if (self.resContract == 2) {
  550. self.$vux.confirm.show({
  551. title: "提示",
  552. content: "请确定,家政员是否已签约",
  553. // 组件除show外的属性
  554. onCancel() {
  555. },
  556. onConfirm() {
  557. _.$http(
  558. "/j/HouseKeeping/Edit",
  559. {
  560. id: _.oldOrderInfo.id,
  561. contract: 2
  562. },
  563. res => {
  564. statusF(res.data.success);
  565. return;
  566. }
  567. );
  568. }
  569. });
  570. } else {
  571. self.$vux.alert.show({
  572. title: "提示",
  573. content: "请先选择签约状态,然后提交!"
  574. });
  575. }
  576. }
  577. // 提交返回状态
  578. function statusF(s) {
  579. if (s) {
  580. self.$vux.alert.show({
  581. title: "提示",
  582. content: "提交成功!",
  583. onShow() {
  584. // console.log('Plugin: I\'m showing')
  585. },
  586. onHide() {
  587. self.$router.push({path: "/managementList"});
  588. return;
  589. }
  590. });
  591. } else {
  592. self.$vux.alert.show({
  593. title: "提示",
  594. content: "提交失败!请稍后再试。",
  595. onShow() {
  596. },
  597. onHide() {
  598. self.$router.push({path: "/managementList"});
  599. }
  600. });
  601. }
  602. }
  603. },
  604. change(val) {
  605. this.bookingTime = val;
  606. // console.log(this.bookingTime)
  607. _.oldOrderInfo.bookingTime = this.bookingTime;
  608. },
  609. // 预约日期
  610. getTime() {
  611. let self = this;
  612. // 组件内使用
  613. this.$vux.datetime.show({
  614. value: "", // 其他参数同 props
  615. format: "YYYY-MM-DD HH:00",
  616. yearRow: "{value}年",
  617. monthRow: "{value}月",
  618. dayRow: "{value}日",
  619. hourRow: "{value}点",
  620. confirmText: "完成",
  621. cancelText: "取消",
  622. onHide() {
  623. const _this = this;
  624. self.bookingTime = _this.value;
  625. },
  626. onShow() {
  627. const _this = this;
  628. // console.log(_this)
  629. }
  630. });
  631. },
  632. btnServiceForm() {
  633. let self = this;
  634. weui.picker(self.serviceArr, {
  635. className: "custom-classname",
  636. container: "body",
  637. defaultValue: [1],
  638. onChange: function (result) {
  639. },
  640. onConfirm: function (result) {
  641. self.serviceForm = result[0].label;
  642. self.resServiceArr = result[0].value;
  643. },
  644. id: "singleLinePicker"
  645. });
  646. },
  647. btnContractFrom() {
  648. let self = this;
  649. weui.picker(self.contractArr, {
  650. className: "custom-classname",
  651. container: "body",
  652. defaultValue: [1],
  653. onChange: function (result) {
  654. },
  655. onConfirm: function (result) {
  656. self.contractFrom = result[0].label;
  657. self.resContract = result[0].value;
  658. },
  659. id: "singleLinePicker"
  660. });
  661. },
  662. back() {
  663. this.$router.push("/managementList");
  664. // this.$router ? this.$router.back() : window.history.back()
  665. }
  666. },
  667. watch: {
  668. order: function (val, oldVal) {
  669. if (val == undefined) {
  670. this.$router.push({path: "/order"});
  671. }
  672. }
  673. }
  674. };
  675. // 日期转时间戳 2014-07-10
  676. function ycTime(t) {
  677. let stringTime = t + ":00";
  678. let timestamp = Date.parse(new Date(stringTime));
  679. timestamp = timestamp / 1000;
  680. return timestamp;
  681. }
  682. </script>
  683. <style scoped lang="less">
  684. .weui-cell {
  685. padding: 0 15px 0 0 !important;
  686. }
  687. title {
  688. background-color: white;
  689. margin-bottom: 5px;
  690. display: block;
  691. padding-top: 0.8rem;
  692. font-size: 1rem;
  693. text-align: center;
  694. position: fixed;
  695. top: 0;
  696. left: 0;
  697. right: 0;
  698. border-bottom: 1px solid #eeeeef;
  699. span {
  700. content: "";
  701. width: 20px;
  702. height: 20px;
  703. position: absolute;
  704. left: 15px;
  705. bottom: 10px;
  706. background-image: url("http://oduj3utzz.bkt.clouddn.com/arrow_left_2.svg");
  707. background-repeat: no-repeat;
  708. background-size: 100%;
  709. background-position: center;
  710. }
  711. }
  712. .order-body {
  713. padding: 15px;
  714. background-color: #eeeeef;
  715. display: flex;
  716. /*@media (width: 375px) and (height: 812px) {
  717. height: 89.5vh;
  718. }*/
  719. .my-order-body {
  720. background-color: #fff;
  721. padding: 10px;
  722. /*padding-left: 30px;*/
  723. margin-top: 45px;
  724. @media (max-width: 320px) {
  725. /*padding: 0;*/
  726. /*padding-left: .5rem;*/
  727. /*margin-bottom: 20%;*/
  728. }
  729. flex: 1;
  730. & > div {
  731. color: #afafaf;
  732. background-color: white;
  733. font-size: 17px;
  734. padding: 3px 0;
  735. @media (max-width: 320px) {
  736. padding: 1px 0;
  737. font-size: 14.5px;
  738. }
  739. & > span:nth-child(1) {
  740. /*width: 25%;
  741. padding-left: 15px;
  742. display: inline-block;
  743. margin-right: 20px;
  744. */
  745. min-width: 65px;
  746. @media (max-width: 320px) {
  747. /*min-width: 80px;*/
  748. }
  749. /*flex: 2;*/
  750. color: #6a696a;
  751. font-weight: bold;
  752. text-align: left;
  753. /*padding-left: 15px;*/
  754. display: inline-block;
  755. }
  756. & > span:nth-child(2) {
  757. /*width: 60%;*/
  758. /*flex: 7;*/
  759. display: inline-block;
  760. }
  761. }
  762. }
  763. }
  764. .edit {
  765. color: #f4bf69;
  766. }
  767. .edit_title {
  768. color: #208bb7 !important;
  769. font-weight: 100 !important;
  770. }
  771. .stroe {
  772. display: flex;
  773. flex-direction: row;
  774. }
  775. .tech,
  776. .tech:focus {
  777. border: 0;
  778. outline: none;
  779. }
  780. .m-btn {
  781. width: 100%;
  782. /*margin: 10% auto 0;*/
  783. bottom: 0;
  784. /*position: fixed;*/
  785. color: white;
  786. font-size: 1.2rem;
  787. padding: 0.5rem 0;
  788. text-align: center;
  789. /*min-height: 10vh;*/
  790. background-color: #ffb433;
  791. }
  792. /* .weui-cell_access p {
  793. color: #afafaf !important;
  794. font-weight: bold !important;
  795. font-size: 0.7rem !important;
  796. }*/
  797. </style>