duizhaopin_ui
cxw 2 years ago
parent 5a4f3d4051
commit 0ff71c1f9e

@ -163,13 +163,13 @@ export default {
adddialogVisible:false, adddialogVisible:false,
row_id:'', row_id:'',
formData: { formData: {
name: undefined, name: '',
cas_number: undefined, cas_number: '',
purity: undefined, purity: '',
export_count:undefined, export_count:'',
speci: undefined, speci: '',
net_weight_unit: undefined, net_weight_unit: '',
net_weight: undefined net_weight: ''
}, },
statusColorMap: ['warning','success','danger'], statusColorMap: ['warning','success','danger'],
statusMap: ['未处理', '已处理','已驳回'], statusMap: ['未处理', '已处理','已驳回'],
@ -224,17 +224,7 @@ export default {
} }
], ],
net_weight_unit: [ net_weight_unit: [
{ required: true, message: '请输入单位', trigger: 'change' }, { required: true, message: '请输入单位', trigger: 'change' }
{
validator (rule, value, callback) {
if (/(^[1-9]\d*$)/.test(value)) {
callback()
} else {
callback(new Error('请输入正整数'))
}
},
trigger: 'blur'
}
], ],
net_weight: [ net_weight: [
@ -367,6 +357,16 @@ export default {
// //
openDialogTableVisible(){ openDialogTableVisible(){
this.title='新增采购试剂' this.title='新增采购试剂'
this.checkList=[]
this.formData = {
name: '',
cas_number: '',
purity: '',
export_count:'',
speci: '',
net_weight_unit: '',
net_weight: ''
}
this.adddialogVisible = true this.adddialogVisible = true
}, },
// //
@ -374,53 +374,59 @@ export default {
this.adddialogVisible = false this.adddialogVisible = false
this.checkList=[] this.checkList=[]
this.formData = { this.formData = {
name: undefined, name: '',
cas_number: undefined, cas_number: '',
purity: undefined, purity: '',
export_count:undefined, export_count:'',
speci: undefined, speci: '',
net_weight_unit: undefined, net_weight_unit: '',
net_weight: undefined net_weight: ''
} }
}, },
// //
create_apply(){ create_apply(){
var that =this var that =this
let datalist = that.checkList.map((item) => { let datalist = that.checkList.map((item) => {
return Object.assign({}, {net_weight_unit: item.net_weight_unit, net_weight: item.net_weight, name: item.name, cas_number: item.cas_number,purity: item.purity, export_count: item.export_count, speci: item.speci}) return Object.assign({}, {net_weight_unit: item.net_weight_unit, total: item.net_weight, name: item.name,value:item.name, cas_number: item.cas_number,purity: item.purity, remark6:'瓶',
export_count: item.export_count, speci: item.speci,distributor:'',english_name:'',expiration_date:'',manufacturer:'',medicament_id:'',production_date:'',net_weight:'',shelf_life:''})
}) })
if(this.title=='编辑采购试剂'){ console.log(datalist,'5')
const data = { if(datalist.length==0){
id: this.row_id, this.$message.error('没有数据')
use_content: JSON.stringify(datalist),
}
update(stringify(data)).then(rsp => {
console.log("rsp>>", rsp)
if (rsp.status==0){
this.dialogTableClose()
//
this.$refs.multipleTable.clearSelection();
that.checkList=[]
this.page =1
this.get_drug_group()
}
})
}else{ }else{
const data = { if(this.title=='编辑采购试剂'){
use_doc: '', const data = {
use_content: JSON.stringify(datalist), id: this.row_id,
} use_content: JSON.stringify(datalist),
add(stringify(data)).then(rsp => {
console.log("rsp>>", rsp)
if (rsp.status==0){
this.dialogTableClose()
//
this.$refs.multipleTable.clearSelection();
that.checkList=[]
this.page =1
this.get_drug_group()
} }
}) update(stringify(data)).then(rsp => {
console.log("rsp>>", rsp)
if (rsp.status==0){
this.dialogTableClose()
//
this.$refs.multipleTable.clearSelection();
that.checkList=[]
this.page =1
this.get_drug_group()
}
})
}else{
const data = {
use_doc: '',
use_content: JSON.stringify(datalist),
}
add(stringify(data)).then(rsp => {
console.log("rsp>>", rsp)
if (rsp.status==0){
this.dialogTableClose()
//
this.$refs.multipleTable.clearSelection();
that.checkList=[]
this.page =1
this.get_drug_group()
}
})
}
} }
}, },
} }

Loading…
Cancel
Save