otherCompleteOrder.vue 17 KB

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