From 59ef8ccfa6240c5fa3c823d773aab15930af4d41 Mon Sep 17 00:00:00 2001 From: 李林 <z1292839451@163.com> Date: 星期二, 19 三月 2024 17:13:20 +0800 Subject: [PATCH] 功能调整 --- src/components/do/b1-ins-order/add.vue | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 102 insertions(+), 13 deletions(-) diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue index 063abfc..1dbec6e 100644 --- a/src/components/do/b1-ins-order/add.vue +++ b/src/components/do/b1-ins-order/add.vue @@ -98,8 +98,8 @@ <span style="color: #3A7BFA;">淇濆瓨妯℃澘</span> </el-button> <el-button size="medium" type="primary" @click="save" :loading="saveLoad" v-show="active==1">鎻愪氦</el-button> - <el-button size="medium" @click="upInsOrderOfState(2)" :loading="saveLoad" v-show="active==3">瀹℃牳涓嶉�氳繃</el-button> - <el-button size="medium" type="primary" @click="upInsOrderOfState(1)" :loading="saveLoad" v-show="active==3">瀹℃牳閫氳繃</el-button> + <el-button size="medium" @click="upInsOrderOfState(2)" :loading="saveLoad" v-show="active==3">涓嶉�氳繃</el-button> + <el-button size="medium" type="primary" @click="upInsOrderOfState(1)" :loading="saveLoad" v-show="active==3">閫氳繃</el-button> <el-button size="medium" @click="$parent.playOrder(0)"> <span style="color: #3A7BFA;">杩斿洖</span> </el-button> @@ -127,13 +127,6 @@ <div class="search_label"><span class="required-span">* </span>涓嬪崟鍗曚綅锛�</div> <div class="search_input"> <el-input size="small" placeholder="閫夋嫨涓嬪崟瀹㈡埛" clearable disabled v-model="addObj.company"></el-input> - </div> - </el-col> - <el-col class="search_thing" :span="6"> - <div class="search_label">闇�姹傛椂闂达細</div> - <div class="search_input"> - <el-date-picker type="date" placeholder="閫夋嫨鏃ユ湡" size="small" value-format="yyyy-MM-dd" style="width: 100%;" - v-model="addObj.appointed"></el-date-picker> </div> </el-col> <el-col class="search_thing" :span="6"> @@ -170,7 +163,7 @@ </div> <div> <div style="text-align: right;line-height: 45px;" v-if="active<2"> - <el-button type="primary" size="small" @click="addSampleDia = true" >娣诲姞鏍峰搧</el-button> + <el-button type="primary" size="small" @click="addSampleDia = true">娣诲姞鏍峰搧</el-button> <el-button size="small" @click="delSample"> <span style="color: #3A7BFA;">鍒犻櫎鏍峰搧</span> </el-button> @@ -220,7 +213,7 @@ <el-table-column label="鎿嶄綔" width="65" align="center"> <template slot-scope="scope"> {{scope.index}} - <el-button type="text" size="small" @click="sampleList.splice(scope.$index, 1)" :disabled="active!=1">鍒犻櫎</el-button> + <el-button type="text" size="small" @click="delSampleAndProduct" :disabled="active!=1">鍒犻櫎</el-button> </template> </el-table-column> </el-table> @@ -361,6 +354,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 +472,14 @@ saveLoad: false, templateDia:false, templateLoading:false, - templateName:'' + templateName:'', + issuedDialogVisible:false, + distributeData:{ + appointed:'', + userId:'' + }, + personList:[], + upLoad:false, } }, mounted() { @@ -458,6 +487,7 @@ this.getUserNow() this.selectStandardTreeList() this.selectInsOrderTemplate() + this.getAuthorizedPerson(); if(this.active==1){ // 涓嬪崟娴佺▼ }else { @@ -476,6 +506,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 +562,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) + } }) } }, @@ -538,6 +593,36 @@ if(res.code==201)return this.$message.success('鎻愪氦鎴愬姛') 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() { @@ -756,6 +841,10 @@ this.sampleList = obj.sampleList; }) }, + delSampleAndProduct(){ + this.sampleList.splice(scope.$index, 1) + this.productList = [] + } } } </script> -- Gitblit v1.9.3