inquiryOrderDetails.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. "use strict";
  2. var common_vendor = require("../common/vendor.js");
  3. var store_index = require("../store/index.js");
  4. var api_inquiryOrder = require("../api/inquiryOrder.js");
  5. var api_common = require("../api/common.js");
  6. require("../store/modules.js");
  7. require("../store/modules/timStore.js");
  8. require("../common/request.js");
  9. const _sfc_main = {
  10. data() {
  11. return {
  12. report: null,
  13. patient: null,
  14. hospital: null,
  15. department: null,
  16. doctor: null,
  17. order: null,
  18. orderId: null,
  19. orderStatusOptions: [],
  20. orderTypeOptions: [],
  21. inquiryTypeOptions: [],
  22. reportImages: [],
  23. tongueImages: [],
  24. faceImages: [],
  25. forms: []
  26. };
  27. },
  28. onLoad(options) {
  29. this.orderId = options.orderId;
  30. this.getDictByKey("sys_inquiry_order_type");
  31. this.getDictByKey("sys_inquiry_type");
  32. this.getDictByKey("sys_inquiry_status");
  33. },
  34. onShow() {
  35. this.getCompanyUserInquiryOrderById();
  36. },
  37. methods: {
  38. cancel() {
  39. var that = this;
  40. common_vendor.index.showModal({
  41. title: "\u63D0\u793A",
  42. content: "\u786E\u8BA4\u53D6\u6D88\u8BA2\u5355\u5417?",
  43. showCancel: true,
  44. cancelText: "\u53D6\u6D88",
  45. confirmText: "\u786E\u5B9A",
  46. success: (res) => {
  47. if (res.confirm) {
  48. var data = { orderId: this.orderId };
  49. api_inquiryOrder.cancel(data).then((res2) => {
  50. if (res2.code == 200) {
  51. that.getMyInquiryOrderById();
  52. common_vendor.index.showToast({
  53. icon: "success",
  54. title: "\u64CD\u4F5C\u6210\u529F"
  55. });
  56. } else {
  57. common_vendor.index.showToast({
  58. icon: "none",
  59. title: res2.msg
  60. });
  61. }
  62. }, (rej) => {
  63. });
  64. }
  65. }
  66. });
  67. },
  68. ping() {
  69. common_vendor.index.navigateTo({
  70. url: "/pages_order/pingOrder?orderId=" + this.orderId + "&doctorId=" + this.order.doctorId
  71. });
  72. },
  73. pay() {
  74. common_vendor.index.navigateTo({
  75. url: "/pages_order/inquiryPay?orderId=" + this.orderId
  76. });
  77. },
  78. toIM() {
  79. var that = this;
  80. var id = "C2CD-" + this.doctor.doctorId;
  81. console.log(common_vendor.index.$TUIKit.TUIConversationServer);
  82. store_index.store.commit("timStore/setConversationID", id);
  83. common_vendor.index.$TUIKit.TUIConversationServer.setMessageRead(id);
  84. common_vendor.index.$TUIKit.TUIConversationServer.getConversationProfile(id).then((res) => {
  85. var _a;
  86. common_vendor.index.$TUIKit.TUIConversationServer.setConversationValue(id, that.orderId).then((res2) => {
  87. console.log("\u66F4\u65B0order");
  88. }).catch((err) => {
  89. });
  90. console.log(res);
  91. const { conversation } = res.data;
  92. store_index.store.commit("timStore/setImType", 1);
  93. store_index.store.commit("timStore/setConversation", conversation);
  94. let url = "/pages/TUIKit/TUIPages/TUIChat/index";
  95. conversation.userProfile;
  96. url = `${url}?conversationName=${((_a = conversation.userProfile.nick) == null ? void 0 : _a.nick) || conversation.userProfile.userID}`;
  97. common_vendor.index.redirectTo({ url });
  98. }).catch((err) => {
  99. console.warn("\u83B7\u53D6 group profile \u5F02\u5E38 = ", err);
  100. });
  101. },
  102. navTo(url) {
  103. common_vendor.index.navigateTo({
  104. url
  105. });
  106. },
  107. copyOrderSn() {
  108. common_vendor.index.setClipboardData({
  109. data: this.order.orderSn,
  110. success: function() {
  111. common_vendor.index.showToast({
  112. title: "\u590D\u5236\u6210\u529F",
  113. icon: "none"
  114. });
  115. }
  116. });
  117. },
  118. getCompanyUserInquiryOrderById() {
  119. var that = this;
  120. var data = { orderId: this.orderId };
  121. api_inquiryOrder.getCompanyUserInquiryOrderById(data).then((res) => {
  122. if (res.code == 200) {
  123. this.order = res.data.order;
  124. this.report = res.data.report;
  125. this.patient = JSON.parse(res.data.order.patientJson);
  126. if (this.report != null && this.report.formJson != null) {
  127. this.forms = JSON.parse(this.report.formJson);
  128. }
  129. if (that.patient.reportImages != null) {
  130. that.reportImages = that.patient.reportImages.split(",");
  131. }
  132. if (that.patient.tongueImages != null) {
  133. that.tongueImages = that.patient.tongueImages.split(",");
  134. }
  135. if (that.patient.faceImages != null) {
  136. that.faceImages = that.patient.faceImages.split(",");
  137. }
  138. this.doctor = res.data.doctor;
  139. this.department = res.data.department;
  140. this.hospital = res.data.hospital;
  141. }
  142. }, (err) => {
  143. });
  144. },
  145. getDictByKey(key) {
  146. var data = { key };
  147. api_common.getDictByKey(data).then((res) => {
  148. if (res.code == 200) {
  149. if (key == "sys_inquiry_order_type") {
  150. this.orderTypeOptions = res.data;
  151. }
  152. if (key == "sys_inquiry_type") {
  153. this.inquiryTypeOptions = res.data;
  154. }
  155. if (key == "sys_inquiry_status") {
  156. this.orderStatusOptions = res.data;
  157. }
  158. }
  159. }, (err) => {
  160. });
  161. },
  162. navTo(url) {
  163. common_vendor.index.navigateTo({
  164. url
  165. });
  166. }
  167. }
  168. };
  169. if (!Array) {
  170. const _easycom_u_rate2 = common_vendor.resolveComponent("u-rate");
  171. const _easycom_u_album2 = common_vendor.resolveComponent("u-album");
  172. const _easycom_u_tag2 = common_vendor.resolveComponent("u-tag");
  173. (_easycom_u_rate2 + _easycom_u_album2 + _easycom_u_tag2)();
  174. }
  175. const _easycom_u_rate = () => "../uni_modules/uview-plus/components/u-rate/u-rate.js";
  176. const _easycom_u_album = () => "../uni_modules/uview-plus/components/u-album/u-album.js";
  177. const _easycom_u_tag = () => "../uni_modules/uview-plus/components/u-tag/u-tag.js";
  178. if (!Math) {
  179. (_easycom_u_rate + _easycom_u_album + _easycom_u_tag)();
  180. }
  181. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  182. return common_vendor.e({
  183. a: $data.order != null
  184. }, $data.order != null ? common_vendor.e({
  185. b: common_vendor.t(_ctx.$getDictLabelName($data.inquiryTypeOptions, $data.order.inquiryType)),
  186. c: common_vendor.t(_ctx.$getDictLabelName($data.orderTypeOptions, $data.order.orderType)),
  187. d: $data.order.status == 1
  188. }, $data.order.status == 1 ? {
  189. e: common_vendor.t(_ctx.$getDictLabelName($data.orderStatusOptions, $data.order.status))
  190. } : {}, {
  191. f: $data.order.status == 2
  192. }, $data.order.status == 2 ? {
  193. g: common_vendor.t(_ctx.$getDictLabelName($data.orderStatusOptions, $data.order.status))
  194. } : {}, {
  195. h: $data.order.status == 3
  196. }, $data.order.status == 3 ? {
  197. i: common_vendor.t(_ctx.$getDictLabelName($data.orderStatusOptions, $data.order.status))
  198. } : {}, {
  199. j: $data.order.status == 4
  200. }, $data.order.status == 4 ? {
  201. k: common_vendor.t(_ctx.$getDictLabelName($data.orderStatusOptions, $data.order.status))
  202. } : {}, {
  203. l: $data.order.status < 0
  204. }, $data.order.status < 0 ? {
  205. m: common_vendor.t(_ctx.$getDictLabelName($data.orderStatusOptions, $data.order.status))
  206. } : {}) : {}, {
  207. n: $data.doctor != null
  208. }, $data.doctor != null ? {
  209. o: common_vendor.t($data.doctor.doctorName),
  210. p: common_vendor.o(($event) => $data.doctor.pingStar = $event),
  211. q: common_vendor.p({
  212. activeColor: "#ffc603",
  213. count: "5",
  214. readonly: true,
  215. modelValue: $data.doctor.pingStar
  216. }),
  217. r: common_vendor.t($data.department.deptName),
  218. s: common_vendor.t($data.doctor.position),
  219. t: common_vendor.t($data.hospital.hospitalName),
  220. v: common_vendor.t($data.doctor.speciality),
  221. w: common_vendor.o(($event) => $options.navTo("/pages/doctor/doctorDetails?doctorId=" + $data.doctor.doctorId))
  222. } : {}, {
  223. x: $data.patient != null && $data.order.inquiryType == 1
  224. }, $data.patient != null && $data.order.inquiryType == 1 ? {
  225. y: common_vendor.t($data.patient.patientName),
  226. z: common_vendor.t($data.patient.sex == 1 ? "\u7537" : "\u5973"),
  227. A: common_vendor.t($data.patient.age),
  228. B: common_vendor.t($data.patient.title),
  229. C: common_vendor.t($data.patient.duration),
  230. D: common_vendor.t($data.patient.isVisit)
  231. } : {}, {
  232. E: $data.patient != null && $data.order.inquiryType == 2
  233. }, $data.patient != null && $data.order.inquiryType == 2 ? {
  234. F: common_vendor.t($data.patient.patientName),
  235. G: common_vendor.t($data.patient.sex == 1 ? "\u7537" : "\u5973"),
  236. H: common_vendor.t($data.patient.age),
  237. I: common_vendor.t($data.patient.height),
  238. J: common_vendor.t($data.patient.weight),
  239. K: common_vendor.t($data.patient.mobile),
  240. L: common_vendor.t($data.patient.study),
  241. M: common_vendor.t($data.patient.usage),
  242. N: common_vendor.t($data.patient.title),
  243. O: common_vendor.t($data.patient.drugs),
  244. P: common_vendor.t($data.patient.duration),
  245. Q: common_vendor.t($data.patient.isVisit),
  246. R: common_vendor.p({
  247. urls: $data.tongueImages
  248. }),
  249. S: common_vendor.p({
  250. urls: $data.faceImages
  251. }),
  252. T: common_vendor.p({
  253. urls: $data.reportImages
  254. })
  255. } : {}, {
  256. U: $data.patient != null && $data.order.inquiryType == 3
  257. }, $data.patient != null && $data.order.inquiryType == 3 ? {
  258. V: common_vendor.t($data.patient.patientName),
  259. W: common_vendor.t($data.patient.sex == 1 ? "\u7537" : "\u5973"),
  260. X: common_vendor.t($data.patient.age),
  261. Y: common_vendor.t($data.patient.title),
  262. Z: common_vendor.t($data.patient.drugs),
  263. aa: common_vendor.t($data.patient.duration),
  264. ab: common_vendor.t($data.patient.isVisit),
  265. ac: common_vendor.p({
  266. urls: $data.reportImages
  267. }),
  268. ad: common_vendor.p({
  269. urls: $data.tongueImages
  270. }),
  271. ae: common_vendor.p({
  272. urls: $data.faceImages
  273. })
  274. } : {}, {
  275. af: $data.report != null && $data.order.status >= 3
  276. }, $data.report != null && $data.order.status >= 3 ? {
  277. ag: common_vendor.f($data.forms, (item, k0, i0) => {
  278. return {
  279. a: common_vendor.t(item.title),
  280. b: common_vendor.f(item.option, (tag, k1, i1) => {
  281. return {
  282. a: "50609d60-7-" + i0 + "-" + i1,
  283. b: common_vendor.p({
  284. size: "mini",
  285. plain: true,
  286. type: "success",
  287. text: tag
  288. })
  289. };
  290. })
  291. };
  292. })
  293. } : {}, {
  294. ah: $data.order != null
  295. }, $data.order != null ? {
  296. ai: common_vendor.t($data.order.orderSn),
  297. aj: common_vendor.o((...args) => $options.copyOrderSn && $options.copyOrderSn(...args)),
  298. ak: common_vendor.t($data.order.createTime),
  299. al: common_vendor.t($data.order.money.toFixed(2)),
  300. am: common_vendor.t($data.order.discountMoney.toFixed(2)),
  301. an: common_vendor.t($data.order.payMoney.toFixed(2))
  302. } : {}, {
  303. ao: $data.order != null
  304. }, $data.order != null ? common_vendor.e({
  305. ap: $data.report != null && $data.order.status >= 3
  306. }, $data.report != null && $data.order.status >= 3 ? {
  307. aq: common_vendor.o(($event) => $options.navTo("/pages_order/inquiryOrderReport?orderId=" + $data.order.orderId))
  308. } : {}) : {});
  309. }
  310. var MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-50609d60"], ["__file", "E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_company/inquiryOrderDetails.vue"]]);
  311. wx.createPage(MiniProgramPage);