From 3ef19c59f59bb1b5a43434b8d14ec12e06d505b0 Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期二, 19 三月 2024 13:07:19 +0800 Subject: [PATCH] 检验下单-下发功能更新 --- src/components/do/b1-ins-order/add.vue | 96 +++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 94 insertions(+), 2 deletions(-) diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue index 063abfc..fc68c15 100644 --- a/src/components/do/b1-ins-order/add.vue +++ b/src/components/do/b1-ins-order/add.vue @@ -361,6 +361,35 @@ <el-button type="primary" @click="addTemplateDia" :loading="templateLoading">纭� 瀹�</el-button> </span> </el-dialog> + <el-dialog title="妫�楠屼笅鍙�" :visible.sync="issuedDialogVisible" width="400px"> + <div class="body" style="max-height: 60vh;"> + <el-row> + <el-col class="search_thing" :span="22"> + <div class="search_label"><span class="required-span">* </span>绾﹀畾鏃堕棿锛�</div> + <div class="search_input"> + <el-date-picker size="small" v-model="distributeData.appointed" type="date" placeholder="閫夋嫨鏃ユ湡" + value-format="yyyy-MM-dd" style="width: 100%;" format="yyyy-MM-dd"> + </el-date-picker> + </div> + </el-col> + <el-col class="search_thing" :span="22"> + <div class="search_label"><span class="required-span">* </span>鎸囨淳浜哄憳锛�</div> + <div class="search_input"> + <el-select v-model="distributeData.userId" placeholder="璇烽�夋嫨" size="small" style="width: 100%;"> + <el-option v-for="item in personList" :key="item.value" :label="item.label" :value="item.value"> + </el-option> + </el-select> + </div> + </el-col> + </el-row> + </div> + <span slot="footer" class="dialog-footer"> + <el-row> + <el-button @click="issuedDialogVisible=false">鍙� 娑�</el-button> + <el-button type="primary" @click="submitForm2" :loading="upLoad">纭� 瀹�</el-button> + </el-row> + </span> + </el-dialog> </div> </template> @@ -450,7 +479,14 @@ saveLoad: false, templateDia:false, templateLoading:false, - templateName:'' + templateName:'', + issuedDialogVisible:false, + distributeData:{ + appointed:'', + userId:'' + }, + personList:[], + upLoad:false, } }, mounted() { @@ -458,6 +494,7 @@ this.getUserNow() this.selectStandardTreeList() this.selectInsOrderTemplate() + this.getAuthorizedPerson(); if(this.active==1){ // 涓嬪崟娴佺▼ }else { @@ -476,6 +513,18 @@ } }, methods: { + getAuthorizedPerson() { + this.$axios.get(this.$api.user.getUserMenu).then(res => { + let data = [] + res.data.forEach(a => { + data.push({ + label: a.name, + value: a.id + }) + }) + this.personList = data + }) + }, selectEnumByCategoryForType() { this.$axios.post(this.$api.enums.selectEnumByCategory, { category: "绱ф�ョ▼搴�" @@ -520,7 +569,20 @@ this.saveLoad = false if(res.code==201)return this.$message.success('宸叉彁浜�') - this.$parent.playOrder(0) + // 濡傛灉绱ф�ョ▼搴︿负绱ф�ワ紝闇�瑕佺洿鎺ヤ笅鍙戜汉鍛� + if(this.addObj.type==2){ + this.issuedDialogVisible = true; + this.$axios.post(this.$api.insOrder.selectOrderManDay,{ + id: res.data + }).then(ress=>{ + // TODO 闇�瑕佸啀纭涓�涓嬭繑鍥炲�� + this.distributeData.orderId = res.data + // this.distributeData.sampleId = res.data.sampleId + this.distributeData.appointed = ress.data + }) + }else{ + this.$parent.playOrder(0) + } }) } }, @@ -540,6 +602,36 @@ this.$parent.playOrder(0) }) }, + // 涓嬪彂 + submitForm2(){ + if(this.distributeData.appointed==null||this.distributeData.appointed==''){ + this.$message.error('绾﹀畾鏃堕棿鏈~鍐�') + return + } + if(this.distributeData.userId==null||this.distributeData.userId==''){ + this.$message.error('鎸囨淳浜哄憳鏈~鍐�') + return + } + this.upLoad = true; + this.$axios.post(this.$api.insOrder.upInsOrder, { + orderId: this.distributeData.orderId, + sampleId: this.distributeData.sampleId, + appointed: this.distributeData.appointed, + userId: this.distributeData.userId + }).then(res => { + if (res.code === 201) { + this.upLoad = false + return + } + this.$message.success('鎻愪氦鎴愬姛') + this.upLoad = false + this.issuedDialogVisible = false + this.$parent.playOrder(0) + }).catch(e => { + this.$message.error('淇敼澶辫触') + this.upLoad = false + }) + }, getUserNow() { this.$axios.get(this.$api.user.getUserNow).then(res => { let selects = res.data -- Gitblit v1.9.3