otherCompleteOrder.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  1. <template>
  2. <view class="HomeItem">
  3. <view class="goWorkAll">
  4. <view class="goWorkSelect combination" v-if="actionConfirmSwitch">
  5. <view class="goWorkSelect-head">您需要完成以下动作,才可完成工单。如完成请勾选对应项!</view>
  6. <view class="goWorkSelect-list scroll">
  7. <checkbox-group @change="checkboxChange">
  8. <label class="goWorkSelect-item relative" v-for="action in actions" :key="action.value">
  9. <view>
  10. <checkbox :value="action.value" :checked="action.checked" />
  11. </view>
  12. <view>{{action.name}}</view>
  13. </label>
  14. </checkbox-group>
  15. </view>
  16. </view>
  17. <view class="goWorkSelect history" v-if="actionPhotoSwitch">
  18. <view class="goWorkSelect-head">您需要拍摄现场照片才可完成工单!</view>
  19. <view class="goWorkSelect-list">
  20. <uni-file-picker :auto-upload="false" :limit="3" title="最多选择3张图片" v-model="imageValue" fileMediatype="image"
  21. mode="grid" @select="selectFile" @delete="deleteFile"></uni-file-picker>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="foot_btn_spe">
  26. <view class="btn1" @click="photographToOther(order, 'end')">完成工单</view>
  27. <view class="btn3" @click="goBack">返回</view>
  28. </view>
  29. <!-- 填写交接人账号弹窗 -->
  30. <selectAccount v-if="hosModels.disjunctor" :title="hosModels.title" :disjunctor="hosModels.disjunctor" @ok="hosOk"
  31. @cancel="hosCancel">
  32. </selectAccount>
  33. </view>
  34. </template>
  35. <script>
  36. import * as commonFun from '../../tools/commonFun.js';
  37. import {
  38. pathUrl
  39. } from "../../tools/photograph.js";
  40. import selectAccount from "../../components/selectAccount/selectAccount.vue";
  41. import {
  42. get,
  43. post,
  44. webHandle
  45. } from "../../http/http.js";
  46. export default {
  47. components: {
  48. selectAccount,
  49. },
  50. data() {
  51. return {
  52. // 填写交接人账号弹窗model
  53. hosModels: {
  54. disjunctor: false,
  55. },
  56. currentCode: '', //当前拍照使用的科室二维码
  57. currentData: {}, //当前小扫描的工单对象
  58. orderId: undefined,
  59. order: {},
  60. // 拍照动作开关
  61. actionPhotoSwitch: false,
  62. // 确认动作开关
  63. actionConfirmSwitch: false,
  64. // 参数
  65. options: {},
  66. //动作列表
  67. actions: [],
  68. //图片列表
  69. imageValue: [],
  70. };
  71. },
  72. methods: {
  73. // 其他临床服务-运输过程-终点科室是否开通备注填写
  74. isOpenTransportationProcessRemarks(data, accountObj, funName){
  75. const tasktype = data.taskType;
  76. console.log(tasktype, data);
  77. if(tasktype.associationType.value === 'other' && tasktype.carryingCourses[1].logSwitch && data.gdState.value == 5){
  78. uni.navigateTo({
  79. url: `../../pages/transportationProcessRemarks/transportationProcessRemarks?data=${data ? encodeURIComponent(JSON.stringify(data)) : ''}&accountObj=${accountObj ? encodeURIComponent(JSON.stringify(accountObj)) : ''}&currentCode=${this.currentCode}&funName=${funName}&actions=${this.actions ? encodeURIComponent(JSON.stringify(this.actions)) : ''}&imageValue=${this.imageValue ? encodeURIComponent(JSON.stringify(this.imageValue)) : ''}`
  80. })
  81. }else{
  82. commonFun[funName](this, data, accountObj);
  83. }
  84. },
  85. // 填写交接人账号-确认
  86. hosOk(data) {
  87. console.log(data);
  88. const {
  89. accountName,
  90. account,
  91. accountId
  92. } = data;
  93. if (!accountName && !account) {
  94. //没有填写交接人
  95. uni.showModal({
  96. title: '提示',
  97. content: "请填写交接人账号!",
  98. showCancel: false,
  99. success: function(res) {
  100. if (res.confirm) {
  101. console.log('用户点击确定');
  102. } else if (res.cancel) {
  103. console.log('用户点击取消');
  104. }
  105. }
  106. });
  107. return;
  108. } else if (!accountName && account || accountName && !account) {
  109. //没有填写交接人
  110. uni.showModal({
  111. title: '提示',
  112. content: "请填写正确的交接人账号!",
  113. showCancel: false,
  114. success: function(res) {
  115. if (res.confirm) {
  116. console.log('用户点击确定');
  117. } else if (res.cancel) {
  118. console.log('用户点击取消');
  119. }
  120. }
  121. });
  122. return;
  123. }
  124. this.hosModels.disjunctor = false;
  125. let associationTypeValue = this.currentData.taskType.associationType.value;
  126. console.log(associationTypeValue)
  127. if(this.actionPhotoSwitch && this.actionConfirmSwitch){
  128. this.isOpenTransportationProcessRemarks(this.currentData, data, 'uploadToOther');
  129. }else if(this.actionConfirmSwitch){
  130. // 动作
  131. this.isOpenTransportationProcessRemarks(this.currentData, data, 'nextDeptOrder_ss');
  132. }else if(this.actionPhotoSwitch){
  133. // 拍照
  134. this.isOpenTransportationProcessRemarks(this.currentData, data, 'uploadToOther');
  135. }
  136. },
  137. // 填写交接人账号-取消
  138. hosCancel() {
  139. this.hosModels.disjunctor = false;
  140. },
  141. // 填写交接人账号弹窗
  142. showSelectAccount() {
  143. this.hosModels = {
  144. title: '填写交接人账号',
  145. disjunctor: true,
  146. }
  147. },
  148. // 拍照-其他
  149. photographToOther(data, type) {
  150. this.currentData = data;
  151. let actions = this.actions.filter(v => v.checked);
  152. let imageValue = this.imageValue;
  153. console.log(actions);
  154. console.log(imageValue);
  155. if(this.actionConfirmSwitch && this.actions.length !== actions.length){
  156. uni.showToast({
  157. icon: "none",
  158. title: '您需要完成以下动作,才可完成功工单!',
  159. duration: 2000
  160. });
  161. return;
  162. }
  163. if(this.actionPhotoSwitch && !imageValue.length){
  164. uni.showToast({
  165. icon: "none",
  166. title: '您需要完成拍照,才可完成功工单!',
  167. duration: 2000
  168. });
  169. return;
  170. }
  171. uni.showLoading({
  172. title: "加载中",
  173. mask: true,
  174. });
  175. // 其他临床服务
  176. //检验二维码的有效性
  177. post("/dept/scanning", {
  178. content: type === 'start' ? data.startDept.qrcode : data.endDepts[0].qrcode,
  179. taskTypeId: data.taskType.id,
  180. gdState: data.gdState.id,
  181. }).then((result) => {
  182. this.currentCode = result.code;
  183. if (result.state == 200 || result.state == 201) {
  184. let accountObj = undefined;
  185. if (result.account) {
  186. accountObj = {
  187. account: result.account,
  188. accountName: result.name,
  189. accountId: result.id,
  190. };
  191. } else {
  192. accountObj = undefined;
  193. }
  194. if(this.actionPhotoSwitch && this.actionConfirmSwitch){
  195. this.isOpenTransportationProcessRemarks(data, accountObj, 'uploadToOther');
  196. }else if(this.actionConfirmSwitch){
  197. // 动作
  198. this.isOpenTransportationProcessRemarks(data, accountObj, 'nextDeptOrder_ss');
  199. }else if(this.actionPhotoSwitch){
  200. // 拍照
  201. this.isOpenTransportationProcessRemarks(data, accountObj, 'uploadToOther');
  202. }
  203. } else if (result.state == '0000') {
  204. uni.hideLoading();
  205. this.showSelectAccount();
  206. } else {
  207. uni.hideLoading();
  208. uni.showToast({
  209. icon: "none",
  210. title: "请求失败!",
  211. });
  212. }
  213. });
  214. },
  215. // 返回
  216. goBack() {
  217. uni.navigateBack();
  218. },
  219. // 选择动作
  220. checkboxChange: function (e) {
  221. var items = this.actions,
  222. values = e.detail.value;
  223. for (var i = 0, lenI = items.length; i < lenI; ++i) {
  224. const item = items[i]
  225. if(values.includes(item.value)){
  226. this.$set(item,'checked',true)
  227. }else{
  228. this.$set(item,'checked',false)
  229. }
  230. }
  231. },
  232. // 获取上传状态
  233. selectFile(e) {
  234. console.log('选择文件:', e)
  235. this.imageValue = this.imageValue.concat(e.tempFiles);
  236. },
  237. // 移除
  238. deleteFile(e) {
  239. console.log('移除:', e);
  240. },
  241. },
  242. onLoad(options) {
  243. console.log(options);
  244. this.options = options;
  245. if(options.order){
  246. options.order = JSON.parse(options.order);
  247. this.order = options.order;
  248. }
  249. if(options.orderId){
  250. this.orderId = options.orderId;
  251. }
  252. if(options.taskType){
  253. options.taskType = JSON.parse(options.taskType);
  254. this.actionConfirmSwitch = options.taskType.carryingCourses[1].actionConfirmSwitch;
  255. let actions = options.taskType.carryingCourses[1].actionRemarks || "";
  256. this.actions = actions.split('$').map((v, i) => ({
  257. value: i,
  258. name: v,
  259. }));
  260. this.actionPhotoSwitch = options.taskType.carryingCourses[1].actionPhotoSwitch;
  261. }
  262. },
  263. };
  264. </script>
  265. <style lang="less" scoped>
  266. .HomeItem {
  267. .foot_btn_spe {
  268. width: 100%;
  269. position: fixed;
  270. bottom: 30rpx;
  271. left: 0;
  272. line-height: 88rpx;
  273. height: 88rpx;
  274. text-align: center;
  275. display: flex;
  276. justify-content: space-between;
  277. flex-wrap: wrap;
  278. &::after {
  279. content: '';
  280. flex: 1;
  281. }
  282. view {
  283. height: 88rpx;
  284. width: 48%;
  285. margin: 0 1%;
  286. background-image: linear-gradient(to right, #72c172, #3bb197);
  287. color: #fff;
  288. border-radius: 8rpx;
  289. font-size: 32rpx;
  290. margin-top: 16rpx;
  291. }
  292. }
  293. .login {
  294. height: 420rpx;
  295. padding: 0 32rpx;
  296. padding-top: 164rpx;
  297. position: relative;
  298. z-index: 999;
  299. .savePassword {
  300. margin-top: 32rpx;
  301. }
  302. /deep/ uni-checkbox:not([disabled]) .uni-checkbox-input:hover {
  303. border-color: #42b983 !important;
  304. }
  305. .login_input {
  306. margin-top: 32rpx;
  307. background-color: #ffffff;
  308. height: 72rpx;
  309. box-sizing: border-box;
  310. padding: 16rpx;
  311. }
  312. .title {
  313. font-size: 36rpx;
  314. color: #42b983;
  315. text-align: center;
  316. }
  317. .tips {
  318. font-size: 28rpx;
  319. color: red;
  320. margin-top: 16rpx;
  321. }
  322. .page_item_btn {
  323. height: 88rpx;
  324. background-image: linear-gradient(to right, #72c172, #3bb197);
  325. border-radius: 8rpx;
  326. line-height: 88rpx;
  327. color: #fff;
  328. font-size: 36rpx;
  329. font-weight: 700;
  330. margin-top: 64rpx;
  331. text-align: center;
  332. }
  333. }
  334. //上班页面
  335. .goWorkAll {
  336. height: calc(100vh - 118rpx);
  337. overflow-y: auto;
  338. display: flex;
  339. flex-direction: column;
  340. justify-content: space-between;
  341. /deep/ .uni-radio-input-checked {
  342. background-color: #42b983 !important;
  343. border-color: #42b983 !important;
  344. }
  345. /deep/ .uni-checkbox-input-checked {
  346. color: #42b983 !important;
  347. }
  348. .goWorkSelect {
  349. &.history {
  350. height: 356rpx;
  351. padding-bottom: 16rpx;
  352. }
  353. &.combination {
  354. .goWorkSelect-head {}
  355. .goWorkSelect-list {}
  356. }
  357. .goWorkSelect-head {
  358. font-size: 28rpx;
  359. padding: 16rpx 0;
  360. color: #42b983;
  361. border-bottom: 2rpx solid #42b983;
  362. text-align: center;
  363. }
  364. .goWorkSelect-list {
  365. padding: 16rpx;
  366. .goWorkSelect-item {
  367. height: 52rpx;
  368. display: flex;
  369. align-items: center;
  370. border-bottom: 2rpx solid #e5e9ed;
  371. padding: 16rpx;
  372. &.relative {
  373. position: relative;
  374. .picker {
  375. position: absolute;
  376. width: 100%;
  377. padding-left: 64rpx;
  378. }
  379. }
  380. button {
  381. font-size: 32rpx;
  382. height: 52rpx;
  383. line-height: 52rpx;
  384. margin: 0;
  385. margin-left: 16rpx;
  386. color: rgb(7, 134, 60);
  387. font-weight: 700;
  388. }
  389. }
  390. }
  391. }
  392. }
  393. .goWork {
  394. margin: 0 auto 48rpx;
  395. width: 240rpx;
  396. height: 240rpx;
  397. .goWork_btn_E {
  398. width: 100%;
  399. height: 100%;
  400. background: #bee1a7;
  401. border-radius: 30%;
  402. .goWork_btn_W {
  403. width: 75%;
  404. height: 75%;
  405. background-image: linear-gradient(to right, #72c172, #3bb197);
  406. border-radius: 30%;
  407. margin: 0 auto;
  408. position: relative;
  409. top: 12.5%;
  410. line-height: 180rpx;
  411. color: #fff;
  412. font-size: 36rpx;
  413. text-align: center;
  414. }
  415. }
  416. }
  417. .goWork_text {
  418. width: 100%;
  419. view {
  420. text-align: center;
  421. }
  422. .goWork_text-p {
  423. font-size: 36rpx;
  424. margin-bottom: 48rpx;
  425. }
  426. }
  427. .botImg {
  428. height: 600rpx;
  429. width: 100%;
  430. position: fixed;
  431. bottom: 0;
  432. .img {
  433. height: 100%;
  434. background: url("../../static/img/BG.png") no-repeat center center;
  435. background-size: 100% 100%;
  436. }
  437. }
  438. }
  439. </style>