123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656 |
- <template>
- <view class="HomeItem">
- <view class="goWorkAll">
- <view class="title">{{taskName}}</view>
- <view class="goWorkSelect history">
- <view class="goWorkSelect-list">
- <view class="list-title">申请科室:</view>
- <view @click="searchDept('applyDept')" :class="applyDeptId ? 'black' : 'gray'">
- {{applyDept}}
- </view>
- <text class="right-icon newicon newicon-weibiaoti2010104" @click="searchDept('applyDept')"></text>
- <text class="toolbar-icon newicon newicon-saoma" @click="scan()"></text>
- </view>
- <view class="goWorkSelect-list">
- <view class="list-title">起点科室:</view>
- <view @click="searchDept('startDept')" :class="startDeptId ? 'black' : 'gray'">
- {{startDept}}
- </view>
- <text v-if="startTarget==202 || startTarget==204 || startTarget==205" class="right-icon newicon newicon-weibiaoti2010104" @click="searchDept('startDept')"></text>
- </view>
- <view class="goWorkSelect-list">
- <view class="list-title">终点科室:</view>
- <view @click="searchDept('endDept')" :class="endDeptId ? 'black' : 'gray'">
- {{endDept}}
- </view>
- <text v-if="endTarget==202 || endTarget==204 || endTarget==205" class="right-icon newicon newicon-weibiaoti2010104" @click="searchDept('endDept')"></text>
- </view>
- <view class="goWorkSelect-list besides" v-if="remarksSwitch==1">
- <view class="list-title">备注信息:</view>
- <textarea v-model="remark" :placeholder="remarksPrompts"/>
- </view>
- </view>
- </view>
- <view class="foot_btn_spe">
- <view class="btn3" @click="submit">建单</view>
- <view class="btn3" @click="goBack">返回</view>
- </view>
-
- <uni-popup ref="alertDialog" type="dialog" :mask-click="false">
- <uni-popup-dialog type="info" cancelText="取消" confirmText="确定" title="提示" :content="content" @confirm="dialogConfirm"
- @close="dialogClose"></uni-popup-dialog>
- </uni-popup>
- </view>
- </template>
- <script>
- import {
- get,
- post,
- webHandle,
- SM
- } from "../../http/http.js";
-
- export default {
- data() {
- return {
- list:[],
- hosId: uni.getStorageSync('userData').user.currentHospital.id,
- SMFlag:true,
- applyDept:"请选择申请科室",
- applyDeptId:null,
- startDept:"请选择起点科室",
- startDeptId:null,
- endDept:"请选择终点科室",
- endDeptId:null,
- remark:null,
- itemTaskType:null,
- remarksSwitch:null,
- remarksPrompts:null,
- startTarget:null,
- endTarget:null,
- taskTypeData:null, //点击的任务类型数据
- taskTypeId: null,
- content:null,
- tipsCreateOder:null
- };
- },
- methods: {
- // 清空缓存
- setSess(){
- uni.setStorageSync('applyDept', null)
- uni.setStorageSync('taskStartDept', null)
- uni.setStorageSync('taskEndDept', null)
- uni.setStorageSync('sponsorTaskBuildData', null)
- },
- // 返回
- goBack() {
- this.setSess();
- uni.navigateTo({
- url:'/pages/sponsorTask/sponsorTask'
- })
- },
- // 建单
- submit(){
- if(!this.applyDeptId){
- uni.showToast({
- icon: 'none',
- title: '申请科室不能为空'
- });
- return
- }
- if(!this.startDeptId){
- uni.showToast({
- icon: 'none',
- title: '起点科室不能为空'
- });
- return
- }
- if(!this.endDeptId){
- uni.showToast({
- icon: 'none',
- title: '终点科室不能为空'
- });
- return
- }
- this.content = `您将前往【${this.startDept}】执行【${this.taskName}】,送往【${this.endDept}】,确定建单吗?`
- this.$refs.alertDialog.open()
- },
-
- // 确定中转
- dialogConfirm(){
- uni.showLoading({
- title: "加载中",
- mask: true,
- });
- let data = {
- workOrder:{
- tipsCreateOder: null,
- worker:{
- id: uni.getStorageSync('userData').user.id
- },
- createDept: this.applyDeptId,
- startDept:{
- id: this.startDeptId
- },
- endDepts:{
- id: this.endDeptId
- },
- sourceId: 4,
- workOrderRemark: this.remark,
- taskType:{
- id : this.taskTypeId
- }
- }
- }
- if(this.tipsCreateOder == 1){
- data.tipsCreateOder = 1
- }else{
- data.tipsCreateOder = undefined
- }
- post("/api/startOrder", data).then((res2) => {
- uni.hideLoading();
- if (res2.status == 200) {
- this.tipsCreateOder = null
- uni.showToast({
- icon: 'none',
- title: '操作成功'
- });
- this.setSess()
- setTimeout(_=>{
- uni.redirectTo({
- url:'/pages/receiptpage/receiptpage'
- })
- },1500)
- } else if(res2.status == 1000033){
- this.tipsCreateOder = 1
- this.content = res2.msg
- this.$refs.alertDialog.close()
- setTimeout(_=>{
- this.$refs.alertDialog.open()
- },500)
- } else {
- uni.showToast({
- icon: 'none',
- title: res2.msg || '请求数据失败!'
- });
- }
- });
- },
- // 取消
- dialogClose(){
- this.tipsCreateOder = null
- this.$refs.alertDialog.close()
- },
- // 搜索科室
- searchDept(type){
- if(type=='startDept'){
- if(this.startTarget==201 || this.startTarget==203){
- return
- }
- }
- if(type=='endDept'){
- if(this.endTarget==201 || this.endTarget==203){
- return
- }
- }
- let data = {
- applyDept:this.applyDept,
- applyDeptId:this.applyDeptId,
- startDept:this.startDept,
- startDeptId:this.startDeptId,
- endDept:this.endDept,
- endDeptId:this.endDeptId,
- remark:this.remark
- }
- uni.setStorageSync('sponsorTaskBuildData', JSON.stringify(data))
- uni.navigateTo({
- url: `../taskTypeSearch/taskTypeSearch?type=${type}&startTarget=${this.startTarget}&endTarget=${this.endTarget}&taskTypeData=${JSON.stringify(this.taskTypeData)}&taskTypeId=${this.taskTypeId}&taskName=${this.taskName}`
- });
- },
- // 扫描科室
- scan(){
- if (!this.SMFlag) {
- return;
- }
- this.SMFlag = false;
- // let content = '87bdf1c7-1514-4fa8-8fa4-07f37c06bec7'
- SM().then((content) => {
- uni.showLoading({
- title: "加载中",
- mask: true,
- });
- let data = {
- getDeptInfo: true,
- content: content
- }
- post("/dept/scanning" , data).then((res2) => {
- this.SMFlag = true;
- uni.hideLoading();
- if (res2.state == 200) {
- this.applyDept = res2.data.dept
- this.applyDeptId = res2.data.id
- if(this.startTarget==201){
- this.startDept = res2.data.dept
- this.startDeptId = res2.data.id
- }
- if(this.endTarget==201){
- this.endDept = res2.data.dept
- this.endDeptId = res2.data.id
- }
- } else {
- uni.showToast({
- icon: 'none',
- title: res2.msg || '请求数据失败!'
- });
- }
- });
- }).catch(err => {
- this.SMFlag = true;
- });
- },
- getTaskType(id){
- uni.showLoading({
- title: "加载中",
- mask: true,
- });
- let postData= {
- taskTypeId: id
- }
- post("/ser/getdeptList", postData).then((res) => {
- uni.hideLoading();
- this.taskTypeData = res
- this.startTarget = this.taskTypeData.startStatus
- this.endTarget = this.taskTypeData.endStatus
- if(this.startTarget==203){
- this.startDept = this.taskTypeData.startDept[0].dept
- this.startDeptId = this.taskTypeData.startDept[0].id
- }
- if(this.endTarget==203){
- this.endDept = this.taskTypeData.endDept[0].dept
- this.endDeptId = this.taskTypeData.endDept[0].id
- }
- this.remarksSwitch = this.taskTypeData.taskType.remarksSwitch
- this.remarksPrompts = this.taskTypeData.taskType.remarksPrompts
- });
- }
- },
- onUnload(){
- this.setSess();
- },
- onShow(options){
-
- },
- onLoad(options) {
- console.log(111, options)
- let sponsorTaskBuildData = uni.getStorageSync('sponsorTaskBuildData')
- let applyDept = uni.getStorageSync('applyDept')
- let taskStartDept = uni.getStorageSync('taskStartDept')
- let taskEndDept = uni.getStorageSync('taskEndDept')
- if(applyDept){
- // 科室类型:201:默认发起科室
- // 科室类型:202:固定科室范围
- // 科室类型:203:固定科室
- // 科室类型:204:自主填写
- // 科室类型:205:固定科室类型
- let data = JSON.parse(applyDept)
- this.applyDept = data.dept
- this.applyDeptId = data.id
- if(options.startTarget){
- this.startTarget = options.startTarget
- }
- if(options.endTarget){
- this.endTarget = options.endTarget
- }
- console.log(456, this.startTarget)
- if(this.startTarget==201){
- this.startDept = data.dept
- this.startDeptId = data.id
- }
- if(this.endTarget==201){
- this.endDept = data.dept
- this.endDeptId = data.id
- }
- }
- if (taskStartDept){
- let data = JSON.parse(taskStartDept)
- if(this.startTarget!=201){
- this.startDept = data.dept
- this.startDeptId = data.id
- }
- }
- if (taskEndDept){
- let data = JSON.parse(taskEndDept)
- if(this.endTarget!=201){
- this.endDept = data.dept
- this.endDeptId = data.id
- }
- }
- // 之前有填写过数据-回显
- if(sponsorTaskBuildData){
- let data = JSON.parse(sponsorTaskBuildData)
- console.log(777, data)
- if(!applyDept){
- if(data.applyDept){
- this.applyDept = data.applyDept
- this.applyDeptId = data.applyDeptId
- }
- }
-
- if(!taskStartDept){
- if(data.startDept && this.startTarget!=201){
- this.startDept = data.startDept
- this.startDeptId = data.startDeptId
- }
- }
-
- if(!taskEndDept){
- if(data.endDept && this.endTarget!=201){
- this.endDept = data.endDept
- this.endDeptId = data.endDeptId
- }
- }
- if(data.remark){
- this.remark = data.remark
- }
- }
-
- if(options.data){
- options.data = JSON.parse(options.data);
- this.getTaskType(options.data.id);
- this.taskTypeId = options.data.id;
- this.taskName = options.data.taskName;
- }
-
- if(options.taskTypeId){
- this.taskTypeId = options.taskTypeId;
- this.taskName = options.taskName;
- this.getTaskType(options.taskTypeId);
- }
- },
- };
- </script>
- <style scoped>
- /deep/ .uni-textarea-wrapper{
- border: 1rpx solid #E5E5E5;
- padding-left: 6rpx;
- }
- /deep/ .uni-textarea-placeholder{
- padding: 6rpx;
- }
- /deep/ .uni-button-color{
- color: #64BD7B;
- }
- </style>
- <style lang="less" scoped>
- .black{
- color: #000;
- width: 400rpx;
- // overflow:hidden;/*内容超出后隐藏*/
- // text-overflow:ellipsis;/*超出内容显示为省略号*/
- // white-space:nowrap;
- }
- .gray{
- color: #7b7b7b;
- width: 400rpx;
- // overflow:hidden;/*内容超出后隐藏*/
- // text-overflow:ellipsis;/*超出内容显示为省略号*/
- // white-space:nowrap;
- }
- .HomeItem {
- .foot_btn_spe {
- width: 100%;
- position: fixed;
- bottom: 30rpx;
- left: 0;
- line-height: 88rpx;
- height: 88rpx;
- text-align: center;
- display: flex;
- justify-content: space-between;
- flex-wrap: wrap;
-
- &::after {
- content: '';
- flex: 1;
- }
-
- view {
- height: 88rpx;
- width: 48%;
- margin: 0 1%;
- background-image: linear-gradient(to right, #72c172, #3bb197);
- color: #fff;
- border-radius: 8rpx;
- font-size: 32rpx;
- margin-top: 16rpx;
- }
- }
- .login {
- height: 420rpx;
- padding: 0 32rpx;
- padding-top: 164rpx;
- position: relative;
- z-index: 999;
- .savePassword {
- margin-top: 32rpx;
- }
- /deep/ uni-checkbox:not([disabled]) .uni-checkbox-input:hover {
- border-color: #42b983 !important;
- }
- .login_input {
- margin-top: 32rpx;
- background-color: #ffffff;
- height: 72rpx;
- box-sizing: border-box;
- padding: 16rpx;
- }
- .title {
- font-size: 36rpx;
- color: #42b983;
- text-align: center;
- }
- .tips {
- font-size: 28rpx;
- color: red;
- margin-top: 16rpx;
- }
- .page_item_btn {
- height: 88rpx;
- background-image: linear-gradient(to right, #72c172, #3bb197);
- border-radius: 8rpx;
- line-height: 88rpx;
- color: #fff;
- font-size: 36rpx;
- font-weight: 700;
- margin-top: 64rpx;
- text-align: center;
- }
- }
- //上班页面
- .goWorkAll {
- overflow-y: auto;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- /deep/ .uni-radio-input-checked {
- background-color: #42b983 !important;
- border-color: #42b983 !important;
- }
- /deep/ .uni-checkbox-input-checked {
- color: #42b983 !important;
- }
-
- .title{
- text-align: center;
- color: #64BD7B;
- line-height: 80rpx;
- border-bottom: 1rpx solid #E5E5E5;
- }
-
- .goWorkSelect {
- &.history {
- padding-bottom: 16rpx;
- }
- &.combination {
- .goWorkSelect-head {}
- .goWorkSelect-list {}
- }
- .goWorkSelect-head {
- font-size: 28rpx;
- line-height: 80rpx;
- border-bottom: 2rpx solid #E5E5E5;
- text-align: center;
- }
-
- .besides{
- align-items: start !important;
- }
-
- .goWorkSelect-list {
- display: flex;
- flex-wrap: nowrap;
- align-items: center;
- padding: 20rpx;
- border-bottom: 1rpx solid #E5E5E5;
- position: relative;
-
- .list-title{
- width: 180rpx;
- }
-
- .input-sign{
- user-select: none;
- pointer-events: none;
- }
-
- .right-icon{
- font-size: 38rpx !important;
- margin: 0 40rpx 0 10rpx;
- position: relative;
- top: -2rpx;
- }
-
- .toolbar-icon{
- position: absolute;
- right: 20rpx;
- }
-
- .newicon{
- font-size: 32rpx;
- color: #b8b8b8;
- }
-
- .input-num {
- height: 60rpx;
- border: 2rpx solid #E5E5E5;
- border-radius: 5rpx;
- // width: 100%;
- padding-left: 10rpx;
- // padding-right: 10rpx;
- }
-
- .goWorkSelect-item {
- height: 52rpx;
- display: flex;
- align-items: center;
- border-bottom: 2rpx solid #e5e9ed;
- padding: 16rpx;
- &.relative {
- position: relative;
- .picker {
- position: absolute;
- width: 100%;
- padding-left: 64rpx;
- }
- }
- button {
- font-size: 32rpx;
- height: 52rpx;
- line-height: 52rpx;
- margin: 0;
- margin-left: 16rpx;
- color: rgb(7, 134, 60);
- font-weight: 700;
- }
- }
- }
-
- .goWorkSelect-list:last-child {
- border-bottom: none;
- }
- }
- }
- .goWork {
- margin: 0 auto 48rpx;
- width: 240rpx;
- height: 240rpx;
- .goWork_btn_E {
- width: 100%;
- height: 100%;
- background: #bee1a7;
- border-radius: 30%;
- .goWork_btn_W {
- width: 75%;
- height: 75%;
- background-image: linear-gradient(to right, #72c172, #3bb197);
- border-radius: 30%;
- margin: 0 auto;
- position: relative;
- top: 12.5%;
- line-height: 180rpx;
- color: #fff;
- font-size: 36rpx;
- text-align: center;
- }
- }
- }
- .goWork_text {
- width: 100%;
- view {
- text-align: center;
- }
- .goWork_text-p {
- font-size: 36rpx;
- margin-bottom: 48rpx;
- }
- }
- .botImg {
- height: 600rpx;
- width: 100%;
- position: fixed;
- bottom: 0;
- .img {
- height: 100%;
- background: url("../../static/img/BG.png") no-repeat center center;
- background-size: 100% 100%;
- }
- }
- }
- </style>
|