123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668 |
- <template>
- <view class="pharmacyDetails" v-show="drugsBagDto.id">
- <view class="pharmacyDetails_title">请领信息</view>
- <view class="page_item_wrap">
- <view class="page_item">
- <view class="page_item_top">
- <view class="page_item_top-inner">
- <view class="page_item_top_L">
- <text class="L_text">请领单:{{ drugsBagDto.packid||'-' }}</text>
- </view>
- <view class="page_item_top_R">
- <text class="L_iocn">{{
- drugsBagDto.drugsState ? drugsBagDto.drugsState.name : "-"
- }}</text>
- </view>
- </view>
- </view>
- <view class="page_item_cont">
- <view class="page_item_cont_B">
- <view class="page_item_cont_title">
- <text>药包类型</text>
- <text class="text_big">
- <text>
- {{(drugsBagDto.packType && drugsBagDto.packType !== 0) ? DRUGSBAG_TYPE[drugsBagDto.packType] : "-"}}
- </text>
- </text>
- </view>
- </view>
- <view class="page_item_cont_C">
- <view class="page_item_cont_title_C">
- <text>记账时间</text>
- <text class="text_big">
- <text>{{ drugsBagDto.creatTime||'-' }}</text>
- </text>
- </view>
- </view>
- <view class="page_item_cont_C">
- <view class="page_item_cont_title_C">
- <text>请领科室</text>
- <text class="text_big">
- <text>{{
- drugsBagDto.target ? drugsBagDto.target.dept : "-"
- }}</text>
- </text>
- </view>
- </view>
- <view class="page_item_cont_C" v-show="workOrder.id">
- <view class="page_item_cont_title_C">
- <text>单号</text>
- <text class="text_big">
- <text>{{ workOrder.gdcode||'-' }}</text>
- </text>
- </view>
- </view>
- <view class="page_item_cont_C" v-show="workOrder.id">
- <view class="page_item_cont_title_C">
- <text>状态</text>
- <text class="text_big">
- <text>{{
- workOrder.gdState ? workOrder.gdState.name : "-"
- }}</text>
- </text>
- </view>
- </view>
- <view class="page_item_cont_C" v-show="workOrder.id">
- <view class="page_item_cont_title_C">
- <text>服务人员</text>
- <text class="text_big">
- <text>{{ workOrder.worker ? workOrder.worker.name : "-" }}</text>
- </text>
- </view>
- </view>
- </view>
- <view class="L"></view>
- <view class="R"></view>
- </view>
- <view class="L-l"></view>
- <view class="R-l"></view>
- </view>
- <button class="cube-toolbar-item" v-show="isShowBtn" @click="receiveOrderAndSign()">
- 接单并签到
- </button>
- <button class="cube-toolbar-item" v-show="!workOrder.id" @click="buildOrderAndSign()">
- 建单并签到
- </button>
- <button class="cube-toolbar-item" v-show="!isShowBtn && workOrder.id" @click="goBack()">
- 知道了
- </button>
- <!-- 弹窗 -->
- <showModel :title="models.title" :icon="models.icon" :disjunctor="models.disjunctor" :content="models.content"
- @ok="ok" @cancel="cancel" :operate="models.operate"></showModel>
- <!-- 填写交接人账号弹窗 -->
- <selectAccount v-if="hosModels.disjunctor" :title="hosModels.title" :disjunctor="hosModels.disjunctor" @ok="hosOk"
- @cancel="hosCancel">
- </selectAccount>
- </view>
- </template>
- <script>
- import {
- DRUGSBAG_TYPE
- } from '../../tools/enum.drugsbagType.js';
- import selectAccount from "@/components/selectAccount/selectAccount";
- import {
- webHandle,
- post
- } from "../../http/http.js";
- export default {
- data() {
- return {
- hosId: null,
- DRUGSBAG_TYPE,
- // 弹窗model
- models: {
- disjunctor: false,
- },
- drugsBagDto: {}, //药包信息
- workOrder: {}, //药包关联的工单信息
- currentCode: "", //当前小扫描的科室二维码
- currentData: {}, //当前小扫描的工单对象
- // 填写交接人账号弹窗model
- hosModels: {
- disjunctor: false,
- },
- grabOrders: null,
- gotoFlag: true,
- };
- },
- components: {
- selectAccount,
- },
- computed: {
- isShowBtn() {
- if (this.workOrder.gdState) {
- let state = this.workOrder.gdState.value;
- // 待抢单,待接单,待到达,待送达
- return state == 2 || state == 3 || state == 4 || state == 5;
- } else {
- return false;
- }
- },
- },
- methods: {
- goBack() {
- uni.navigateTo({
- url: "../receiptpage/receiptpage",
- });
- },
- // 如果不是患者陪检或患者转运或其他
- // 科室签到
- nextDeptOrder_s(data, accountObj) {
- console.log(data, accountObj);
- let ids = [];
- let id = data.id;
- ids.push(id);
- let code = "";
- let postData = {
- ids,
- };
- if (accountObj) {
- postData.handover = [accountObj.accountId];
- }
- if (this.grabOrders) {
- postData.grabOrders = this.grabOrders;
- }
- if (this.currentCode) {
- code = this.currentCode;
- // 科室签到
- post("/workerOrder/orderSign/" + code, postData).then((res) => {
- uni.hideLoading();
- if (res.status == 200) {
- // 跳转到扫描科室
- // type1: res.type, //type类型
- // id: data.id, //工单ID
- // deptCode: code, //二维码
- // dept: res.dept //科室名称
- let urlObj = {
- url: `/pages/scanning_code/scanning_code?type=${
- data.taskType.associationType.value
- }&type1=${res.type}&id=${data.id}&deptCode=${code}&dept=${
- res.dept
- }&accountObj=${encodeURIComponent(JSON.stringify(accountObj))}`,
- };
- if (this.grabOrders) {
- urlObj.url += `&grabOrders=666`;
- }
- uni.navigateTo(urlObj);
- } else {
- uni.navigateTo({
- url: `/pages/scanning_Result/scanning_Result?type=${data.taskType.associationType.value}&type1=${res.type}&id=${data.id}&status=600&msg=${res.msg}&isKs=1&qrcode=${this.currentCode}`,
- });
- }
- });
- }
- },
- // 签到
- orderSign(data, type, ress1) {
- this.currentData = data;
- console.log(data, "data");
- uni.showLoading({
- title: "加载中",
- mask: true,
- });
- //检验二维码的有效性
- post("/dept/scanning", {
- content: ress1,
- taskTypeId: data.taskType.id,
- gdState: data.gdState.id,
- }).then((result) => {
- this.currentCode = result.code;
- if (result.state == 200 || result.state == 201) {
- if (result.account) {
- if (type == 2) {
- this.nextDeptOrder_s(this.currentData, {
- account: result.account,
- accountName: result.name,
- accountId: result.id,
- });
- }
- } else {
- if (type == 2) {
- this.nextDeptOrder_s(this.currentData);
- }
- }
- } else if (result.state == "0000") {
- uni.hideLoading();
- this.showSelectAccount();
- } else {
- uni.hideLoading();
- uni.showToast({
- icon: "none",
- title: result.info || "接口获取数据失败!",
- });
- }
- });
- },
- // 填写交接人账号-确认
- hosOk(data) {
- console.log(data);
- const {
- accountName,
- account,
- accountId
- } = data;
- if (!accountName && !account) {
- //没有填写交接人
- uni.showModal({
- title: "提示",
- content: "请填写交接人账号!",
- showCancel: false,
- success: function(res) {
- if (res.confirm) {
- console.log("用户点击确定");
- } else if (res.cancel) {
- console.log("用户点击取消");
- }
- },
- });
- return;
- } else if ((!accountName && account) || (accountName && !account)) {
- //没有填写交接人
- uni.showModal({
- title: "提示",
- content: "请填写正确的交接人账号!",
- showCancel: false,
- success: function(res) {
- if (res.confirm) {
- console.log("用户点击确定");
- } else if (res.cancel) {
- console.log("用户点击取消");
- }
- },
- });
- return;
- }
- this.hosModels.disjunctor = false;
- this.commonBuild(data);
- },
- // 填写交接人账号-取消
- hosCancel() {
- this.hosModels.disjunctor = false;
- this.gotoFlag = true;
- },
- // 填写交接人账号弹窗
- showSelectAccount() {
- this.hosModels = {
- title: "填写交接人账号",
- disjunctor: true,
- };
- },
- // 接单---data就是交接人信息
- commonBuild(data) {
- let postData = {
- packId: this.workOrder.drugs.packid,
- orderId: this.workOrder.id,
- };
- if (data) {
- //有交接人
- postData.handover = data.accountId;
- }
- uni.showLoading({
- title: "加载中",
- mask: true,
- });
- post("/workerOrder/drugBagReceiving", postData).then((ress) => {
- uni.hideLoading();
- if (ress.status == 200) {
- this.grabOrders = ress.grabOrders ? ["666"] : null;
- // this.orderSign(ress.workOrder, 2, ress.content);
- let info = {
- targetDept: ress.data.target.dept, //所属科室
- packid: ress.data.packid, //药包编码
- batchNo: ress.data.batchNo, //药包批次
- status: ress.status,
- msg: ress.msg,
- };
- if (data) {
- //有交接人
- info.accountName = data.accountName; //交接人姓名
- info.account = data.account; //交接人账号
- }
- uni.navigateTo({
- url: `../scanning_result_seimin/scanning_result_seimin?info=${encodeURIComponent(
- JSON.stringify(info)
- )}`,
- });
- } else if (ress.status == "0000") {
- uni.hideLoading();
- this.showSelectAccount();
- } else {
- uni.showToast({
- icon: "none",
- title: ress.msg || "接口获取数据失败!",
- });
- }
- });
- },
- ok() {
- this.models.disjunctor = false;
- this.commonBuild();
- },
- // 取消
- cancel() {
- this.models.disjunctor = false;
- this.gotoFlag = true;
- },
- // 接单并签到
- receiveOrderAndSign() {
- if (!this.gotoFlag) {
- return;
- }
- this.gotoFlag = false;
- if (this.workOrder.gdState) {
- let state = this.workOrder.gdState.value;
- if (state == 4 || state == 5) {
- //待到达,待送达
- this.models = {
- disjunctor: true,
- title: "提示",
- content: "您想接单的药品,工单正在执行中。请确认是否继续接单签到?",
- icon: "warn",
- operate: {
- ok: "确定",
- cancel: "取消",
- },
- };
- } else {
- // 待接单 待抢单
- this.commonBuild();
- }
- }
- },
- // 建单并签到
- buildOrderAndSign() {
- if (!this.gotoFlag) {
- return;
- }
- this.gotoFlag = false;
- uni.showModal({
- title: "提示",
- content: "请确认是否建单并签到?",
- success: (result) => {
- if (result.confirm) {
- console.log("用户点击确定");
- let postData = {
- packId: this.drugsBagDto.packid,
- };
- uni.showLoading({
- title: "加载中",
- mask: true,
- });
- post("/workerOrder/drugBagReceiving", postData).then((ress) => {
- uni.hideLoading();
- if (ress.status == 200) {
- let info = {
- targetDept: ress.data.target.dept, //所属科室
- packid: ress.data.packid, //药包编码
- batchNo: ress.data.batchNo, //药包批次
- status: ress.status,
- msg: ress.msg,
- };
- uni.navigateTo({
- url: `../scanning_result_seimin/scanning_result_seimin?info=${encodeURIComponent(
- JSON.stringify(info)
- )}`,
- });
- } else {
- uni.showToast({
- icon: "none",
- title: ress.msg || "接口获取数据失败!",
- });
- }
- });
- } else if (result.cancel) {
- console.log("用户点击取消");
- }
- },
- });
- },
- //获取药包信息及其关联的工单信息
- queryDrugsBagForId(drugsBagId) {
- uni.showLoading({
- title: "加载中",
- mask: true,
- });
- post("/workerOrder/queryDrugsBagForId", {
- drugsBagId,
- }).then((res) => {
- uni.hideLoading();
- if (res.status == 200) {
- this.drugsBagDto = res.drugsBagDto || {};
- this.workOrder = res.workOrder || {};
- console.log(this.workOrder)
- } else {
- uni.showToast({
- icon: "none",
- title: res.msg || "接口获取数据失败!",
- });
- }
- });
- },
- },
- onShow() {
- this.gotoFlag = true;
- },
- onLoad(options) {
- this.hosId = uni.getStorageSync('userData').user.currentHospital.id;
- console.log(options);
- let {
- drugsBagId,
- drugsBagBatchNo,
- } = options;
- if (drugsBagId) {
- this.queryDrugsBagForId(drugsBagId);
- }
- // this.infoDATA = JSON.parse(options.infoDATA); //详细信息
- // console.log(this.infoDATA)
- // this.res["status"] = options.status; //状态码
- // this.res["msg"] = options.msg; //返回的信息
- // #ifdef APP-PLUS
- webHandle("no", "app");
- // #endif
- // #ifdef H5
- webHandle("no", "wx");
- // #endif
- },
- };
- </script>
- <style lang="less" scoped>
- .pharmacyDetails {
- background-color: rgb(249, 250, 251);
- padding-top: 10%;
- .pharmacyDetails_title {
- font-size: 46rpx;
- font-weight: 550;
- text-align: center;
- }
- .page_item_wrap {
- position: relative;
- margin-top: 32rpx;
- .page_item {
- margin-top: 16rpx;
- margin-bottom: 124rpx;
- background: #fff;
- border-radius: 8rpx;
- margin: 0 20rpx;
- border: 2rpx solid #e5e9ed;
- position: relative;
- overflow: hidden;
- padding: 0 16rpx;
- .L {
- width: 40rpx;
- height: 40rpx;
- border-radius: 50%;
- background: #f9fafb;
- position: absolute;
- left: -20rpx;
- top: 68rpx;
- border: 2rpx solid #e5e9ed;
- }
- .R {
- width: 40rpx;
- height: 40rpx;
- border-radius: 50%;
- background: #f9fafb;
- position: absolute;
- float: right;
- right: -20rpx;
- top: 68rpx;
- border: 2rpx solid #e5e9ed;
- }
- .page_item_top {
- height: 88rpx;
- border-bottom: 2rpx dashed #e5e9ed;
- padding: 0 16rpx;
- .page_item_top-inner {
- display: flex;
- justify-content: space-between;
- align-items: center;
- height: 100%;
- .page_item_top_L {
- .L_text {
- font-size: 32rpx;
- font-weight: 700;
- }
- }
- .page_item_top_R {
- font-size: 32rpx;
- .L_iocn {
- color: rgb(7, 134, 60);
- font-size: 36rpx;
- font-weight: 700;
- }
- }
- }
- }
- .page_item_cont {
- min-height: 180rpx;
- max-height: 424rpx;
- padding: 0 16rpx;
- text-align: left;
- position: relative;
- .text_big {
- font-size: 32rpx;
- font-weight: 700;
- text {
- font-weight: 700;
- line-height: 1.5;
- }
- }
- .line {
- height: 20rpx;
- width: 2rpx;
- border-left: 2rpx solid #e5e9ed;
- position: absolute;
- top: 82rpx;
- left: 40rpx;
- }
- .page_item_cont_T {
- padding-top: 28rpx;
- font-size: 28rpx;
- .page_item_cont_title {
- height: 100%;
- font-size: 32rpx;
- display: flex;
- justify-content: space-between;
- }
- }
- .page_item_cont_B {
- padding-top: 28rpx;
- margin-bottom: 28rpx;
- .page_item_cont_title {
- font-size: 32rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- }
- .page_item_cont_C {
- margin-bottom: 28rpx;
- .page_item_cont_title_C {
- font-size: 32rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- }
- #infos {
- display: none;
- }
- }
- }
- .L-l {
- width: 2rpx;
- height: 40rpx;
- background: #f9fafb;
- position: absolute;
- left: 20rpx;
- top: 72rpx;
- }
- .R-l {
- width: 2rpx;
- height: 40rpx;
- background: #f9fafb;
- position: absolute;
- right: 20rpx;
- top: 72rpx;
- }
- }
- .cube-toolbar-item {
- width: 710rpx;
- height: 68rpx;
- line-height: 68rpx;
- position: fixed;
- left: 20rpx;
- bottom: 160rpx;
- border-radius: 8rpx;
- background: linear-gradient(to right, #72c172, #3bb197);
- font-size: 36rpx;
- color: #fff;
- text-align: center;
- }
- .btn-wrap {
- display: flex;
- justify-content: space-between;
- position: fixed;
- left: 20rpx;
- bottom: 160rpx;
- }
- .cube-toolbar-item1 {
- width: 350rpx;
- height: 68rpx;
- line-height: 68rpx;
- border-radius: 8rpx;
- margin: 0 5rpx;
- background: linear-gradient(to right, #72c172, #3bb197);
- font-size: 36rpx;
- color: #fff;
- text-align: center;
- }
- }
- </style>
|