diff --git a/src/views/reagent/createapply/index.vue b/src/views/reagent/createapply/index.vue index bb76048..d631042 100644 --- a/src/views/reagent/createapply/index.vue +++ b/src/views/reagent/createapply/index.vue @@ -276,7 +276,8 @@ export default { { required: true, message: '请选择陪同人', trigger: 'change' } ] }, - currentItem: {} + currentItem: {}, + notes_msg: "", } }, created() { @@ -397,42 +398,24 @@ export default { //添加申请列表 handleClick(row) { var that = this - that.$prompt('请输入领取用途', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消' - }).then(({ value }) => { - if (value) { - row.notes = value - // 检查先进先出 - get_check_last_drug(stringify(row)).then(res => { - this.check_last_medicament(res.data).then((check_res) => { - // 继续领用当前试剂 - if (check_res) { - var result = that.checkList.filter(item => item).map(item => item.bar_code) - if (result.indexOf(row.bar_code) != -1) { - that.$message({ - type: 'info', - message: '不可重复添加' - }) - } else { - that.checkList.push(row) - let getLocation = that.tableData.indexOf(row) - that.tableData.splice(getLocation, 1) - } - } - }) - }) - - } else { - that.$message({ - type: 'info', - message: '请输入用途' - }) - } - }).catch(() => { - that.$message({ - type: 'info', - message: '取消输入' + + // 检查先进先出 + get_check_last_drug(stringify(row)).then(res => { + this.check_last_medicament(res.data).then((check_res) => { + // 继续领用当前试剂 + if (check_res) { + var result = that.checkList.filter(item => item).map(item => item.bar_code); + if (result.indexOf(row.bar_code) != -1) { + that.$message({ + type: 'info', + message: '不可重复添加' + }); + } else { + that.checkList.push(row) + let getLocation = that.tableData.indexOf(row); + that.tableData.splice(getLocation, 1) + } + } }) }) }, @@ -518,47 +501,70 @@ export default { }) console.log('giao') }, + + // 统一填写申请理由 + prompt_notes(){ + var that = this + return new Promise((resolve, reject) => { + that.$prompt('请输入领取用途', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + }).then(({ value }) => { + if(value){ + this.notes_msg =value + resolve(true) + }else{ + that.$message({ + type: 'info', + message: '请输入用途' + }); + resolve(false) + } + }).catch(() => { + that.$message({ + type: 'info', + message: '取消输入' + }); + resolve(false) + }); + }) + }, + //提交申请 create_apply(pt_from) { var that = this - let datalist = that.checkList.map((item) => { - return Object.assign({}, { - info: '', - notes: item.notes, - bar_code: item.bar_code, - client_code: item.client_code, - place: item.flow_position_code, - remark12: item.remark12, - name: item.name, - num: item.num, - client_id: item.client_id, - purity: item.purity, - speci: item.speci, - medicament_id: item.medicament_id - }) - }) - if (pt_from.user_id_pt === '') { - that.$message({ - type: 'info', - message: '请选择陪同人' - }) - } else { - const data = { - user_id: this.$store.state.user.id, - user_id_pt: pt_from.user_id_pt, - use_content: JSON.stringify(datalist) - } - add_apply(stringify(data)).then(rsp => { - console.log('rsp>>', rsp) - if (rsp.status == 0) { - this.dialogTableClose() - //清空表格多选框 - this.$refs.multipleTable.clearSelection() - that.checkList = [] - this.get_apply() + that.prompt_notes().then(notes_res => { + if (!notes_res){ + return + } else { + console.log("申请理由notes_msg", this.notes_msg) + let datalist = that.checkList.map((item) => { + return Object.assign({}, {info:'',notes:this.notes_msg,bar_code: item.bar_code,client_code: item.client_code,place: item.flow_position_code,remark12: item.remark12,name: item.name, num: item.num,client_id: item.client_id, purity: item.purity, speci: item.speci,medicament_id:item.medicament_id}) + }) + if (pt_from.user_id_pt === '') { + that.$message({ + type: 'info', + message: '请选择陪同人' + }); + } else { + const data = { + user_id: this.$store.state.user.id, + user_id_pt: pt_from.user_id_pt, + use_content: JSON.stringify(datalist), + } + add_apply(stringify(data)).then(rsp => { + console.log("rsp>>", rsp) + if (rsp.status == 0) { + this.dialogTableClose() + //清空表格多选框 + this.$refs.multipleTable.clearSelection(); + that.checkList = [] + this.get_apply() + } + }) } - }) - } + } + }) }, //申请页翻页 pageChange(page) { diff --git a/src/views/reagent/management/variety/index.vue b/src/views/reagent/management/variety/index.vue index 2b7e235..a68a689 100644 --- a/src/views/reagent/management/variety/index.vue +++ b/src/views/reagent/management/variety/index.vue @@ -25,9 +25,11 @@ + + @@ -78,6 +80,18 @@ + + + + + + + + + + + +