123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353 |
- <template>
- <view class="smallScreen">
- <view class="smallScreen_scan" @click="Scan_ss(sData,sType)">
- <slot></slot>
- </view>
- <!-- 填写交接人账号弹窗 -->
- <selectAccount v-if="hosModels.disjunctor" :title="hosModels.title" :disjunctor="hosModels.disjunctor" @ok="hosOk"
- @cancel="hosCancel">
- </selectAccount>
- </view>
- </template>
- <script>
- import selectAccount from "../../components/selectAccount/selectAccount.vue";
- import {
- post,
- SM
- } from "../../http/http.js";
- export default {
- data() {
- return {
- currentCode: '', //当前小扫描的科室二维码
- currentData: {}, //当前小扫描的工单对象
- // 填写交接人账号弹窗model
- hosModels: {
- disjunctor: false,
- },
- }
- },
- props:{
- sData:{
- type:Object
- },
- sType:{
- type:Number
- }
- },
- methods: {
- // 如果不是静配,药配,标本配送,标本轮巡
- // 科室签到(小扫描)
- nextDeptOrder_ss(data, accountObj) {
- let isKs = 0;
- let ids = [];
- let id = data.id;
- ids.push(id);
- let list = {
- code: "",
- ids: ids,
- };
- let code = "";
- let type = "";
- if (this.currentCode) {
- let gdStateValue = data.gdState.value; //工单状态value
- let associationTypeValue = data.taskType.associationType.value; //关联类型value
- // 患者陪检,并且工单状态是待到达
- if (
- gdStateValue == "4" &&
- associationTypeValue == "inspect"
- ) {
- list.code = this.currentCode; //其他
- type = "handleIns";
- }
- // 其他临床服务,并且工单状态是待到达||工单状态待送达
- if (
- (associationTypeValue == "other" &&
- gdStateValue == "4") ||
- gdStateValue == "5"
- ) {
- code = this.currentCode;
- type = "orderSign/" + code;
- list = {
- ids
- };
- if (accountObj) {
- list.handover = [accountObj.accountId];
- }
- isKs = 1;
- }
- if (
- (gdStateValue == "5" &&
- associationTypeValue == "inspect") ||
- associationTypeValue == "patientTransport"
- ) {
- code = this.currentCode;
- type = "orderSign/" + code;
- list = {
- ids
- };
- if (accountObj) {
- list.handover = [accountObj.accountId];
- }
- isKs = 1;
- }
- if (gdStateValue == "8") {
- code = this.currentCode; //患者陪检--检查
- type = "orderSign/" + code;
- list = {
- ids
- };
- if (accountObj) {
- list.handover = [accountObj.accountId];
- }
- isKs = 1;
- }
- if (
- gdStateValue == "4" &&
- associationTypeValue == "patientTransport"
- ) {
- list = {
- code: this.currentCode, //患者转运--检查
- ids: ids,
- };
- type = "handleTrans";
- }
- post("/workerOrder/" + type, list).then((res) => {
- uni.hideLoading();
- if (res) {
- if (res.status == 200) {
- if (
- gdStateValue == "4" &&
- associationTypeValue == "other"
- ) {
- uni.navigateTo({
- url: `../../pages/scanning_code/scanning_code?type=${associationTypeValue}&type1=${res.type}&id=${data.id}&deptCode=${code}&dept=${res.dept}&accountObj=${encodeURIComponent(JSON.stringify(accountObj))}`,
- });
- }
- if (
- gdStateValue == "4" &&
- associationTypeValue != "other"
- ) {
- uni.navigateTo({
- url: `../../pages/scanning_Result/scanning_Result?type=${
- associationTypeValue
- }&type1=${res.type}&id=${data.id}&deptCode=${
- list.code
- }&patient=${res.patient}&patientCode=${
- res.patientCode
- }&deptName=${res.deptName}&bedNum=${
- res.bedNum
- }&status=${res.status}&msg=${
- res.msg
- }&model=${encodeURIComponent(JSON.stringify(res))}&accountObj=${encodeURIComponent(JSON.stringify(accountObj))}`,
- });
- }
- if (gdStateValue == "8") {
- uni.navigateTo({
- url: `../../pages/scanning_code/scanning_code?type=${associationTypeValue}&type1=${res.type}&id=${data.id}&deptCode=${code}&dept=${res.dept}&accountObj=${encodeURIComponent(JSON.stringify(accountObj))}`,
- });
- }
- if (gdStateValue == "5") {
- uni.navigateTo({
- url: `../../pages/scanning_code/scanning_code?type=${associationTypeValue}&type1=${res.type}&id=${data.id}&deptCode=${code}&dept=${res.dept}&accountObj=${encodeURIComponent(JSON.stringify(accountObj))}`,
- });
- }
- } else {
- console.log(res, "扫描失败");
- if (res.type == "trans-ddd-1") {
- //起点科室扫描腕带码失败
- uni.navigateTo({
- url: `../../pages/scanning_Result/scanning_Result?type=${associationTypeValue}&type1=${res.type}&id=${data.id}&status=600&msg=${res.msg}`,
- });
- } else {
- uni.navigateTo({
- url: `../../pages/scanning_Result/scanning_Result?type=${
- associationTypeValue
- }&type1=${res.type}&id=${data.id}&status=600&msg=${
- res.msg
- }&isKs=${isKs}&model=${encodeURIComponent(
- JSON.stringify(res)
- )}`,
- });
- }
- }
- } else {
- uni.navigateTo({
- url: `../../pages/scanning_Result/scanning_Result?id=${data.id}&status=600&msg=扫码失败!请扫描正确的二维码!&isKs=${isKs}`,
- });
- }
- });
- }
- },
- // 如果不是患者陪检或患者转运或其他
- // 科室签到
- 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.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 //科室名称
- uni.navigateTo({
- 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))}`,
- });
- } 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`,
- });
- }
- });
- }
- },
- // type==1 如果不是静配,药配,标本配送,标本轮巡
- // type==2 如果不是患者陪检,患者转运,其他
- // 扫码(小扫描)
- Scan_ss(data, type) {
- this.currentData = data;
- console.log(data, 'data');
- SM().then((ress1) => {
- 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 == 1) {
- this.nextDeptOrder_ss(this.currentData, {
- account: result.account,
- accountName: result.name,
- accountId: result.id,
- });
- } else if (type == 2) {
- this.nextDeptOrder_s(this.currentData, {
- account: result.account,
- accountName: result.name,
- accountId: result.id,
- });
- }
- } else {
- this.nextDeptOrder_ss(this.currentData);
- }
- } else if (result.state == '0000') {
- uni.hideLoading();
- this.showSelectAccount(); //yeye
- } else {
- uni.hideLoading();
- uni.showToast({
- icon: "none",
- title: "请求失败!",
- });
- }
- });
- });
- },
- // 填写交接人账号-确认
- 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;
- let associationTypeValue = this.currentData.taskType.associationType.value;
- console.log(associationTypeValue)
- if (
- associationTypeValue !== "patientTransport" &&
- associationTypeValue !== "inspect" &&
- associationTypeValue !== "other"
- ) {
- this.nextDeptOrder_s(this.currentData, data);
- }
- if (
- associationTypeValue !== "jPBag" &&
- associationTypeValue !== "drugsBag" &&
- associationTypeValue !== "specimen" &&
- associationTypeValue !== "specimenPlan"
- ) {
- this.nextDeptOrder_ss(this.currentData, data);
- }
- },
- // 填写交接人账号-取消
- hosCancel() {
- this.hosModels.disjunctor = false;
- },
- // 填写交接人账号弹窗
- showSelectAccount() {
- this.hosModels = {
- title: '填写交接人账号',
- disjunctor: true,
- }
- },
- },
- components: {
- selectAccount
- }
- };
- </script>
- <style lang="less">
- .smallScreen{
- width: 100%;
- height: 100%;
- .smallScreen_scan{
- width: 100%;
- height: 100%;
- }
- }
- </style>
|