diff --git a/.env.development b/.env.development index 8971a6a..9db14b9 100644 --- a/.env.development +++ b/.env.development @@ -2,5 +2,5 @@ ENV = 'development' # base api -VUE_APP_BASE_API = 'http://127.0.0.1:9001' -VUE_APP_FACE_API = 'http://127.0.0.1:5000' +VUE_APP_BASE_API = 'http://192.168.1.114:9001' +VUE_APP_FACE_API = 'http://192.168.1.114:5000' diff --git a/.env.production b/.env.production index 03db484..b33d4a4 100644 --- a/.env.production +++ b/.env.production @@ -2,6 +2,6 @@ ENV = 'production' # base api -VUE_APP_BASE_API = 'http://127.0.0.1:9001' -VUE_APP_FACE_API ='http://127.0.0.1:5000' +VUE_APP_BASE_API = 'http://192.168.1.114:9001' +VUE_APP_FACE_API ='http://192.168.1.114:5000' diff --git a/.env.staging b/.env.staging index c1452c1..5f4a155 100644 --- a/.env.staging +++ b/.env.staging @@ -4,6 +4,6 @@ NODE_ENV = production ENV = 'staging' # base api -VUE_APP_BASE_API = 'http://127.0.0.1:9001' -VUE_APP_FACE_API='http://127.0.0.1:5000' +VUE_APP_BASE_API = 'http://192.168.1.114:9001' +VUE_APP_FACE_API='http://192.168.1.114:5000' diff --git a/src/views/reagent/createapply/index copy.vue b/src/views/reagent/createapply/index copy.vue index b9209f6..7d8c057 100644 --- a/src/views/reagent/createapply/index copy.vue +++ b/src/views/reagent/createapply/index copy.vue @@ -3,39 +3,89 @@
创建申请
申请 + 详情查看 + + +
+ + + + + + + + + +
+
- - - - - - - - +
+ + + + + + + + +
+ + 搜索 +
+
- + + + + + + + + + + + + - + + - + - + + + +
取消 提交申请
-
@@ -45,28 +95,35 @@ - - - - - - - - + + + + + + + + + + + + +
@@ -81,16 +138,22 @@ import { get_drug_group_list, add_apply } from '@/api/reagent/createapply' +import { + get_apply_list, +} from '@/api/reagent/applymanage' export default { name: 'CreateApply', data() { return { page: 1, - page_size: 15, + page_size: 10, + seach_word:'', total: 0, + total1: 0, client_id: '', dialogVisible: false, tableData: [], + tableData1: [], headerStyle: { 'background': '#E6E6E6' }, multipleSelection: [], handleSelectionSelection: [], @@ -110,6 +173,8 @@ export default { pt_form:{ user_id_pt: '', }, + statusColorMap: ['warning','success','danger'], + statusMap: ['未处理', '已处理','已驳回'], rules: { user_id_pt: [ { required: true, message: '请选择陪同人', trigger: 'change' } @@ -119,33 +184,106 @@ export default { }, created () { this.client_id = this.$store.getters.currentOptions[0].client_id + this.get_apply() this.get_drug_group() this.get_pt_user() }, methods: { + //勾选 handleSelection(selection){ var that =this - that.checkList =selection + that.handleSelectionSelection =selection + }, + // 查看详情 + handleCheck() { + if (this.handleSelectionSelection.length === 1) { + this.dialogHistoryVisible = true + this.historyData = JSON.parse(this.handleSelectionSelection[0].use_content) + } else { + this.$message.warning("选择一条记录操作!") + } + }, + //查看详情关闭 + dialogHistoryClose() { + this.dialogHistoryVisible = false + this.historyData = [] + }, + + //添加申请列表 + handleClick(row){ + var that =this + that.$prompt('请输入数量', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + inputPattern: /^[1-9]\d*$/, + inputErrorMessage: '请输入数字' + }).then(({ value }) => { + if(value>row.drug_num){ + that.$message({ + type: 'info', + message: '余量不足' + }); + }else{ + row.num =value + console.log(row.name,that.checkList) + var result = that.checkList.filter(x => x.name === row.name); + console.log(result,'111') + if (result.length>0){ + that.$message({ + type: 'info', + message: '禁止重复添加' + }); + }else{ + that.checkList.push(row) + } + + // that.tableData.splice(row.$index, 1) + } + }).catch(() => { + that.$message({ + type: 'info', + message: '取消输入' + }); + }); + }, + //取消试剂申请 + cancelClick(row){ + var that =this + let getLocation = that.checkList.indexOf(row); + that.checkList.splice(getLocation, 1) }, + //获取试剂列表 get_drug_group: function() { const data = { - client_id: this.client_id, - page:this.page, - page_size: this.page_size + page:1, + seach_word:this.seach_word, + page_size: 10000 } get_drug_group_list(stringify(data)).then(rsp => { console.log("rsp.data.data_list>>", rsp.data.data_list) - rsp.data.data_list.forEach((value , index) => { - value['num'] = 1 - }) this.tableData = this.addDataIndex(rsp.data.data_list) this.total = rsp.data.total_count }) }, + + //获取申请列表 + get_apply(){ + const data = { + page:this.page, + page_size: this.page_size + } + get_apply_list(stringify(data)).then(rsp => { + console.log("apply>>>", rsp) + this.tableData1 = rsp.data.data_list + this.total1 = rsp.data.total_count + }) + }, + + //陪同用户 get_pt_user() { console.log("jjj") const data = { - page: this.page, + page: 1, page_size: 10000, user_id:this.$store.state.user.id, user_code: this.user_code, @@ -160,13 +298,17 @@ export default { }) console.log("giao") }, + //提交申请 create_apply(pt_from){ var that =this let datalist = that.checkList.map((item) => { return Object.assign({}, { name: item.name, num: item.num,client_id: item.client_id, purity: item.purity, speci: item.speci}) }) if (pt_from.user_id_pt === '') { - alert("请选择陪同人"); + that.$message({ + type: 'info', + message: '请选择陪同人' + }); }else{ const data = { user_id: this.$store.state.user.id, @@ -180,13 +322,15 @@ export default { //清空表格多选框 this.$refs.multipleTable.clearSelection(); that.checkList=[] + this.get_apply() } }) } }, + //申请页翻页 pageChange(page) { this.page = page - this.get_drug_group() + this.get_apply() }, addDataIndex(initData){ for (let i = 0; i < initData.length; i++) { @@ -194,35 +338,20 @@ export default { } return initData }, + //申请 handleRefresh() { + this.get_apply() this.get_drug_group() }, - handleApply() { - const data = { - client_id: this.client_id - } - get_drug_list(stringify(data)).then(rsp => { - this.multipleSelection = rsp.data - }) - this.dialogVisible = true - }, - onClose() { - this.multipleSelection = [] - }, - close() { - this.dialogVisible = false - this.multipleSelection = [] - }, + //打开申请列表 openDialogTableVisible(){ - if (this.checkList.length === 0 ){ - alert("未选择"); - } else { - this.dialogTableVisible = true - } + this.dialogTableVisible = true }, + //关闭申请列表 dialogTableClose() { this.user_id_pt = '' this.dialogTableVisible = false + this.checkList=[] }, } } @@ -264,12 +393,6 @@ export default { } - - diff --git a/src/views/reagent/createapply/index.vue b/src/views/reagent/createapply/index.vue index 7d8c057..def64a7 100644 --- a/src/views/reagent/createapply/index.vue +++ b/src/views/reagent/createapply/index.vue @@ -49,7 +49,8 @@ - + + @@ -67,7 +68,8 @@ - + + @@ -212,39 +214,50 @@ export default { //添加申请列表 handleClick(row){ var that =this - that.$prompt('请输入数量', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - inputPattern: /^[1-9]\d*$/, - inputErrorMessage: '请输入数字' - }).then(({ value }) => { - if(value>row.drug_num){ - that.$message({ - type: 'info', - message: '余量不足' - }); - }else{ - row.num =value - console.log(row.name,that.checkList) - var result = that.checkList.filter(x => x.name === row.name); - console.log(result,'111') - if (result.length>0){ - that.$message({ - type: 'info', - message: '禁止重复添加' - }); - }else{ - that.checkList.push(row) - } + // that.$prompt('请输入数量', '提示', { + // confirmButtonText: '确定', + // cancelButtonText: '取消', + // inputPattern: /^[1-9]\d*$/, + // inputErrorMessage: '请输入数字' + // }).then(({ value }) => { + // if(value>row.drug_num){ + // that.$message({ + // type: 'info', + // message: '余量不足' + // }); + // }else{ + // row.num =value + // console.log(row.name,that.checkList) + // var result = that.checkList.filter(x => x.name === row.name); + // console.log(result,'111') + // if (result.length>0){ + // that.$message({ + // type: 'info', + // message: '禁止重复添加' + // }); + // }else{ + // that.checkList.push(row) + // } - // that.tableData.splice(row.$index, 1) - } - }).catch(() => { + // // that.tableData.splice(row.$index, 1) + // } + // }).catch(() => { + // that.$message({ + // type: 'info', + // message: '取消输入' + // }); + // }); + var result = that.checkList.filter(item => item).map(item => item.bar_code); + if(result.indexOf(row.bar_code) !=-1){ that.$message({ type: 'info', - message: '取消输入' - }); - }); + message: '不可重复添加' + }); + }else{ + that.checkList.push(row) + let getLocation = that.tableData.indexOf(row); + that.tableData.splice(getLocation, 1) + } }, //取消试剂申请 cancelClick(row){ @@ -254,6 +267,7 @@ export default { }, //获取试剂列表 get_drug_group: function() { + var that =this const data = { page:1, seach_word:this.seach_word, @@ -261,7 +275,14 @@ export default { } get_drug_group_list(stringify(data)).then(rsp => { console.log("rsp.data.data_list>>", rsp.data.data_list) - this.tableData = this.addDataIndex(rsp.data.data_list) + var datalist=[] + var result = that.checkList.filter(item => item).map(item => item.bar_code); + rsp.data.data_list.forEach(item => { + if (result.indexOf(item.bar_code) ==-1) { + datalist.push(item) + } + }) + this.tableData = this.addDataIndex(datalist) this.total = rsp.data.total_count }) }, diff --git a/src/views/reagent/warehousing/index.vue b/src/views/reagent/warehousing/index.vue index ab42c15..5e21423 100644 --- a/src/views/reagent/warehousing/index.vue +++ b/src/views/reagent/warehousing/index.vue @@ -913,7 +913,7 @@ export default { }, // 处理新增 条目form handleReagentAddForm(obj) { - obj.name = obj.value + obj.name = obj.name if (this.reagentAddFormTitle.indexOf('新增') !== -1) { this.reagentAddTmpData.push(obj) } else {