import repostCurd from '@/business/platform/form/utils/custom/joinCURD.js' import * as dayjs from 'dayjs' export default { props:{ obj:{ default: [], type:Array } }, methods: { facilityData(page) { if(this.obj.length > 0){ this.loadData(this.obj) }else{ this.loadDataBySQL(page) } }, /* 获取数据 ,开始查阅记录 */ loadData(obj) { let sql = `select ypb.*,sqb.chu_ju_bao_gao_ya from t_lhypb ypb join t_lhwtsqb sqb on ypb.parent_id_ = sqb.id_ and find_in_set(ypb.id_,'${obj}') and ypb.jie_yang_zhuang_t = '待接收' and ypb.shi_fou_guo_shen_ = '1'` repostCurd('sql',sql).then(response=>{ if (response.variables.data && response.variables.data.length > 0) { let temp = response.variables.data this.listData = [] for (let i in temp) { temp[i].jie_yang_shu_lian = temp[i].yang_pin_zong_shu temp[i].jie_yang_zhuang_t = '已确认' temp[i].biao_zhi_uuid_ = this.uuid() temp[i].shi_fou_liu_yang_ = '是' temp[i].yan_shou_jie_guo_ = '完好' temp[i].liu_yang_shu_lian = ' ml/支×1支' temp[i].liu_yang_ri_qi_ = this.dateFormat() temp[i].liu_yang_qi_xian = dayjs(temp[i].song_jian_shi_jia).add(3,'month').format("YYYY-MM-DD") temp[i].xiao_hui_ri_qi_ = dayjs(temp[i].liu_yang_qi_xian).endOf('month').format("YYYY-MM-DD") this.listData.push(temp[i]) } }else{ this.handleEmptyData(); } }) }, loadDataBySQL(page) { // 扫码扫到新数据,查询 并分页 回填展示 let countSQL = `select count(*) as count from t_lhypb where jie_yang_zhuang_t = '待接收' and shi_fou_guo_shen_ = '1'` let str = (page-1)*10 // let fysql = `select * from t_lhypb where jie_yang_zhuang_t = '待接收' and shi_fou_guo_shen_ = '1' limit ${str},10` let fysql = `select ypb.*,sqb.chu_ju_bao_gao_ya from t_lhypb ypb join t_lhwtsqb sqb on ypb.parent_id_ = sqb.id_ and ypb.jie_yang_zhuang_t = '待接收' and ypb.shi_fou_guo_shen_ = '1'` Promise.all([repostCurd('sql', countSQL), repostCurd('sql', fysql)]).then(([res1, res]) => { this.listData = [] this.pageCount = res1.variables.data[0].count if (res.variables.data && res.variables.data.length > 0) { for (let i in res.variables.data) { res.variables.data[i].jie_yang_shu_lian = res.variables.data[i].yang_pin_zong_shu res.variables.data[i].jie_yang_zhuang_t = '已确认' res.variables.data[i].biao_zhi_uuid_ = this.uuid() res.variables.data[i].shi_fou_liu_yang_ = '是' res.variables.data[i].yan_shou_jie_guo_ = '完好' res.variables.data[i].liu_yang_shu_lian = ' ml/支×1支' res.variables.data[i].liu_yang_ri_qi_ = this.dateFormat() res.variables.data[i].liu_yang_qi_xian = dayjs(res.variables.data[i].song_jian_shi_jia).add(3,'month').format("YYYY-MM-DD") res.variables.data[i].xiao_hui_ri_qi_ = dayjs(res.variables.data[i].liu_yang_qi_xian).endOf('month').format("YYYY-MM-DD") this.listData.push(res.variables.data[i]) } }else{ this.handleEmptyList(); } }) }, handleEmptyData(){ this.$confirm('您所选择的样品还未到实验室现场,无法接样!').then(_ => { this.closeDialog(); }).catch(_ => {}); }, handleEmptyList(){ this.$confirm('目前暂无样品需要接样!').then(_ => { this.closeDialog(); }).catch(_ => {}); }, /* 列表失去焦点*/ handleChange() { this.$refs.redarInput.focus(); //聚焦input }, /* 关闭弹出列表框*/ closeDialog() { this.remRedar() //回传关闭事件。隐藏当前组件。 }, handleClose() { this.handleChange() this.$confirm('确认关闭样品列表页面?').then(_ => { this.closeDialog(); }).catch(_ => {}); }, submitData(type) { // this指针 let this_ = this; let changeWeiZhi; // 此处俩字段作用在下面 选择货位时出现重复位置 而重新更新样品登记表 收样位置|留样位置 let changesyWeiZhi; // 回传关闭事件。隐藏当前组件。 let judge = true; if (this_.listData.length == 0) { this.$emit('callback', true) this.visable = false this.$message({ message: '暂无样品待接收确认!', type: 'error' }) this.closeDialog(); } else { this.$confirm('请再次确认 [样品接收信息]').then(_ => { // 获取样品列表 let ypInfoList = this_.listData // console.log(ypInfoList, "样品信息") let dWhere = [] let ypbh = [] let cfwzIdList = [] // 放置 存放位置的ID let ypbhList = [] // 样品编号列表 // 罗湖样品编号列表 let lhypbhList = [] let lhypmcList = [] // 罗湖委托单列表 let lhwtsqbList = [] // 罗湖样品表列表 let lhypbList = [] // 罗湖样品表外键 let lhypbWJ = [] // 罗湖委托表主键 let lhwtbID = [] let lhwtbOnlyId = [] // 罗湖委托表展示表ID let lhwtzsbID = [] // 罗湖样品id列表 let lhypIdList = [] // 罗湖样品id格式列表 let lhypIdNewList = [] let uuidList = [] // 列表的UUID for (let yp in ypInfoList) { //样品数据 let cfwzObj = [] let cfwz = '' /* 校验: 1、样品数量 <= 确认数量 2、是否留样 => 填收样位置|留样位置 3、验收结果必填 4、如果留样 => 必填项:留样日期、留样数量、留样期限至、销毁日期 */ if (ypInfoList[yp].jie_yang_shu_lian > ypInfoList[yp].yang_pin_zong_shu) { this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 接收确认数量不得大于收样数量。') return; } if (ypInfoList[yp].jie_yang_zhuang_t == '未确认') { this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 接收确认状态必须为已确认。') return; } if (ypInfoList[yp].yan_shou_jie_guo_ == null || ypInfoList[yp].yan_shou_jie_guo_ == '') { this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 验收结果不能为空!') return; } if (ypInfoList[yp].shi_fou_liu_yang_ == null || ypInfoList[yp].shi_fou_liu_yang_ == '') { this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 是否留样不能为空!') return; } // if (ypInfoList[yp].bao_gao_bian_zhi_ == undefined || ypInfoList[yp].bao_gao_bian_zhi_ == '') { // this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 报告编制员不能为空!') // return; // } // if (ypInfoList[yp].bao_gao_shen_he_y == undefined || ypInfoList[yp].bao_gao_shen_he_y == '') { // this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 报告审核员不能为空!') // return; // } cfwzObj.push(ypInfoList[yp].shou_yang_wei_zhi) //取位置信息 if (ypInfoList[yp].shi_fou_liu_yang_ == "是") { if (ypInfoList[yp].liu_yang_wei_zhi_ == null || ypInfoList[yp].liu_yang_wei_zhi_ == '') { this_.$message.error("你要留样的话,存放位置不能为空哦!") return; } // if (ypInfoList[yp].shou_yang_wei_zhi != undefined && ypInfoList[yp].shou_yang_wei_zhi != '') { // this_.$message.error("你要留样的话,就不要选收样存放位置!") // return; // } if (ypInfoList[yp].liu_yang_ri_qi_ == null || ypInfoList[yp].liu_yang_ri_qi_ == '') { this_.$message.error("留样时必须填写留样日期!") return; } if (ypInfoList[yp].liu_yang_shu_lian == null || ypInfoList[yp].liu_yang_shu_lian == '') { this_.$message.error("留样时必须填写留样数量!") return; } // if (ypInfoList[yp].liu_yang_shu_lian > ypInfoList[yp].yang_pin_zong_shu) { // this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 留样数量不得大于收样数量。') // return; // } if (ypInfoList[yp].liu_yang_qi_xian == null || ypInfoList[yp].liu_yang_qi_xian == '') { this_.$message.error("留样时必须填写留样期限!") return; } if (ypInfoList[yp].xiao_hui_ri_qi_ == null || ypInfoList[yp].xiao_hui_ri_qi_ == '') { this_.$message.error("留样时必须填写销毁日期!") return; } // cfwz = ypInfoList[yp].liu_yang_wei_zhi_ cfwzObj.push(ypInfoList[yp].liu_yang_wei_zhi_) } // else { // if (ypInfoList[yp].shou_yang_wei_zhi == null || ypInfoList[yp].shou_yang_wei_zhi == '') { // this_.$message.error("你正常收样的话,样品存放位置不能为空哦!") // return; // } // if (ypInfoList[yp].liu_yang_wei_zhi_ != undefined && ypInfoList[yp].liu_yang_wei_zhi_ != '') { // this_.$message.error("你正常收样的话,就不要选择留样存放位置!") // return; // } // cfwz = ypInfoList[yp].shou_yang_wei_zhi //取位置信息 // } // uuidList.push(ypInfoList[yp].biao_zhi_uuid_) // ypIdList.push('{"id_":"' + ypInfoList[yp].id_ + '"}') // ypWeiZhi.push(ypInfoList[yp].shou_yang_wei_zhi) // 收样存放位置 // ypLiuYangWeiZhi.push(ypInfoList[yp].liu_yang_wei_zhi_) // 留样存放位置 // saoMaNumList.push(ypInfoList[yp].jie_yang_shu_lian) // 扫码数量 // jieYangQueRenZTList.push(ypInfoList[yp].jie_yang_zhuang_t) // 接收确认状态 ypbhList.push('{"yang_pin_bian_hao":"' + ypInfoList[yp].yang_pin_bian_hao + '"}') // 样品编号列表 // 罗湖 // lhypbhList.push('{"yang_pin_bian_hao":"' + ypInfoList[yp].yang_pin_bian_hao + '"}') // lhypbWJ.push('{"id_":"' + ypInfoList[yp].parent_id_ + '"}') dWhere.push('{"id_":"' + cfwz + '"}') cfwzIdList.push(cfwzObj) lhypbhList.push( ypInfoList[yp].yang_pin_bian_hao ) lhypbWJ.push( ypInfoList[yp].parent_id_ ) lhypIdList.push( ypInfoList[yp].id_ ) lhypIdNewList.push('{"id_":"' + ypInfoList[yp].id_ + '"}') uuidList.push(ypInfoList[yp].biao_zhi_uuid_) ypbh.push(ypInfoList[yp].yang_pin_bian_hao) lhypmcList.push(ypInfoList[yp].yang_pin_ming_che) } /* 封装好样品登记表对象,add 样品登记表 */ let value = '' let lhypIdStr = '' for(let i =0;i { /* 封装样品登记表对象 */ let ypdjb = [] let res = res1.variables.data wtdAndYpb = res for(let i = 0; i { let result = response.variables.data console.log(result) for(var i in result){ if(result[i].bao_gao_bian_zhi_ == '' || result[i].bao_gao_bian_zhi_ == undefined){ finalWtdIdList.push(result[i]) } } console.log('finalWtdIdList',finalWtdIdList) }) */ /* 3、任务分配 【2022/11/23 取消 直接 批量开检测子流程】【2022/11/30 胡老师又要】 3-1、根据 wtdAndYpb 的 wtID 更改委托表的 委托状态 wei_tuo_zhuang_ta 变成 已完成 3-2、根据每个样品一个任务分配流程 遍历样品表开任务分配流程 3-3、委托表找zhan_shi_biao_id_ 修改 t_lhwtzsb "zhuang_tai_"为"待任务分配" */ // console.log('委托单及样品信息',wtdAndYpb) // console.log('委托单id列表 ',lhwtbID) // console.log('展示表id列表 ',lhwtzsbID) repostCurd('updates', '{"tableName":"t_lhwtsqb","paramWhere":[' + lhwtbID + '],"paramCond":{"wei_tuo_zhuang_ta":"已完成"}}') let rws = [] if(wtdAndYpb.length>0){ for(var i in wtdAndYpb){ // let strs = wtdAndYpb[i].jian_ce_xiang_mu_.split(',') // for(var l in strs){ let rw = {} // rw["ren_wu_ming_cheng"] = strs[l] //检测项目 rw["yang_pin_ming_che"] = wtdAndYpb[i].yang_pin_ming_che//样品名称 rw["yang_pin_bian_hao"] = wtdAndYpb[i].yang_pin_bian_hao//样品编号 rw["wei_tuo_lei_xing_"] = wtdAndYpb[i].wei_tuo_lei_xing_ //委托类型 let yplxz = '' if(wtdAndYpb[i].yang_pin_lei_xing != null && wtdAndYpb[i].yang_pin_lei_xing!=''){ //样品类型1 yplxz = wtdAndYpb[i].yang_pin_lei_xing //样品类型 } if(wtdAndYpb[i].yang_pin_lei_er_ != null && wtdAndYpb[i].yang_pin_lei_er_!=''){ //样品类型2 if(yplxz==null || yplxz == ''){ yplxz = wtdAndYpb[i].yang_pin_lei_er_ //样品类型 }else{ yplxz =yplxz+','+ wtdAndYpb[i].yang_pin_lei_er_ //样品类型 } } if(wtdAndYpb[i].yang_pin_lei_san_ != null && wtdAndYpb[i].yang_pin_lei_san_!=''){ //样品类型3 if(yplxz==null || yplxz == ''){ yplxz = wtdAndYpb[i].yang_pin_lei_san_ //样品类型 }else{ yplxz =yplxz+','+ wtdAndYpb[i].yang_pin_lei_san_ //样品类型 } } if(wtdAndYpb[i].yang_pin_lei_si_ != null && wtdAndYpb[i].yang_pin_lei_si_!=''){ //样品类型4 if(yplxz==null || yplxz == ''){ yplxz = wtdAndYpb[i].yang_pin_lei_si_ //样品类型 }else{ yplxz = yplxz+','+ wtdAndYpb[i].yang_pin_lei_si_ //样品类型 } } rw["yang_pin_lei_xing"] = yplxz // 样品类型 rw["wei_tuo_id_"] = wtdAndYpb[i].wtID // 委托id rw["he_tong_id_"] = wtdAndYpb[i].he_tong_id_ // 合同id rw["zhuang_tai_"] = '待任务分配' // 状态 rw["wan_cheng_shi_jia"] = wtdAndYpb[i].song_jian_shi_jia // 送检日期 // rw["bao_gao_bian_zhi_"] = ypInfoList[i].bao_gao_bian_zhi_ // 报告编制人 // rw["bao_gao_shen_he_y"] = ypInfoList[i].bao_gao_shen_he_y // 报告审核人 rw["bao_gao_lei_xing_"] = wtdAndYpb[i].bao_gao_lei_xing_ // 报告类型 rw["xin_xiang_mu_ming"] = wtdAndYpb[i].xiang_mu_ming_che // 项目名称 rw["zhan_shi_biao_id_"] = wtdAndYpb[i].zhan_shi_biao_id_ // 展示表id rw["fen_zhuang_liu_ya"] = ypInfoList[i].liu_yang_shu_lian // 留样数量 rw["shi_fou_jia_ji_"] = wtdAndYpb[i].chu_ju_bao_gao_ya // 是否加急【2023/2/23王嘎嘎提出】 rw["yang_pin_shu_lian"] = ypInfoList[i].jie_yang_shu_lian // 样品确认总数【2023/3/7王嘎嘎提出】 rws.push(rw) // } } // console.log("任务分配",rws) repostCurd('add', '{"tableName":"t_lhrwfpb","paramWhere":'+JSON.stringify(rws)+',"defKey":"Process_04o0csc","formKey":"lhrwfp"}') } // 更新委托单 检测开始时间 问吴懿是否需要 不需要 // repostCurd('updates', '{"tableName":"t_lhwtsqb","paramWhere":[' + lhwtbID + '],"paramCond":{"jian_ce_kai_shi_s":"' + this_.dateFormat() + '"}}') //更新展示表 if(lhwtzsbID.length > 0){ repostCurd('updates', '{"tableName":"t_lhwtzsb","paramWhere":['+lhwtzsbID+'],"paramCond":{"zhuang_tai_":"任务分配进行中"}}') } /* 3、【任务分配2022/11/23 取消 直接 批量开检测子流程】【2022/11/30 取消】 3-1、根据 wtdAndYpb 的 wtID 更改委托表的 委托状态 wei_tuo_zhuang_ta 变成 已完成 3-2、根据每个样品对应的检测项目,开启一个或多个任务 / 遍历样品表开检测子流程,一个样品可能对应多个检测 3-3、委托表找zhan_shi_biao_id_ 修改 t_lhwtzsb "zhuang_tai_"为"待环境监控" repostCurd('updates', '{"tableName":"t_lhwtsqb","paramWhere":[' + lhwtbID + '],"paramCond":{"wei_tuo_zhuang_ta":"已完成"}}') */ // console.log('dwhere:',dWhere) // console.log('cfwzIdList:',cfwzIdList) /* 2、更新货架位置信息(位置状态、样品编号、入库时间)如果是重复位置,则新增一条位置记录,并增加对应UUID 判断是否是留样位置,如果是留样位置 位置表shi_fou_liu_yang_字段值为`是` 否则 值为`否` */ for (let num in dWhere) { let firstIfEmpty = true let secondIfEmpty = true for(let index = 0; index { let resArr = response.variables.data // console.log(resArr) if (resArr.length == 1) { if (resArr[0].wei_zhi_zhuang_ta == "空余") { if(index == 0){ firstIfEmpty = false }else{ secondIfEmpty = false } let content = { id_ : cfwzIdList[num][index] } let params = { wei_zhi_zhuang_ta : "占用", ru_ku_shi_jian_ : this_.dateFormat(), yang_pin_bian_hao : ypbh[num], yang_pin_ming_che : lhypmcList[num], shi_fou_liu_yang_ : isLiuYang } let o = { tableName:'t_ypcfwz', paramWhere:content, paramCond : params } repostCurd('update',JSON.stringify(o)).then(res=>{ console.log("空余位置修改") }) } else if (resArr[0].wei_zhi_zhuang_ta == "占用") { // 新增一条新的位置记录,使用旧的位置记录 修改它的样品编号,入库时间,标识UUID let cfNewList = [] let cfNew = {} cfNew["fang_jian_lei_xin"] = resArr[0].fang_jian_lei_xin cfNew["wei_zhi_"] = resArr[0].wei_zhi_ cfNew["qu_yu_"] = resArr[0].qu_yu_ cfNew["huo_jia_lei_xing_"] = resArr[0].huo_jia_lei_xing_ cfNew["huo_jia_hao_"] = resArr[0].huo_jia_hao_ cfNew["ceng_hao_"] = resArr[0].ceng_hao_ cfNew["shui_ping_fen_qu_"] = resArr[0].shui_ping_fen_qu_ cfNew["wei_zhi_bian_hao_"] = resArr[0].wei_zhi_bian_hao_ cfNew["wei_zhi_zhuang_ta"] = resArr[0].wei_zhi_zhuang_ta cfNew["cun_chu_tiao_jian"] = resArr[0].cun_chu_tiao_jian cfNew["yang_pin_bian_hao"] = ypbh[num] cfNew["shi_fou_guo_shen_"] = '启用' // cfNew["yang_pin_bian_hao"] = lhypIdList[num] cfNew["yang_pin_ming_che"] = lhypmcList[num] cfNew["ru_ku_shi_jian_"] = this_.dateFormat() cfNew["shi_fou_liu_yang_"] = isLiuYang cfNew["biao_zhi_uuid_"] = uuidList[num] cfNewList.push(cfNew) let uuid = cfNew["biao_zhi_uuid_"]; // console.log('货位:',cfNewList) repostCurd('add', '{"tableName":"t_ypcfwz","paramWhere":' + JSON.stringify(cfNewList) + '}').then(res => { let selectsql = "select id_ from t_ypcfwz where biao_zhi_uuid_='" + uuid + "'"; repostCurd('sql', selectsql).then(res => { // let dataid = res.variables.data[0].id_; let data = res.variables.data; // console.log('data:',data) let suchAs = '{"biao_zhi_uuid_":"' + uuid + '"}' // console.log(data.length,changeWeiZhi,changesyWeiZhi,firstIfEmpty,secondIfEmpty) if(data.length == 1 && changeWeiZhi && firstIfEmpty){ repostCurd('update', '{"tableName":"t_lhypdjb","paramWhere":'+suchAs+',"paramCond":{"cun_fang_wei_zhi_":"'+data[0].id_+'"}}').then(res=>{ console.log('One 存放位置',res) }) }else if(data.length == 1 && changesyWeiZhi && secondIfEmpty){ repostCurd('update', '{"tableName":"t_lhypdjb","paramWhere":'+suchAs+',"paramCond":{"liu_yang_cun_fang":"'+data[0].id_+'"}}').then(res=>{ console.log('One 留样位置',res) }) }else if(data.length == 2 && changeWeiZhi && changesyWeiZhi){ let whereL = [] whereL.push(suchAs) repostCurd('updates', '{"tableName":"t_lhypdjb","paramWhere":['+whereL+'],"paramCond":{"cun_fang_wei_zhi_":"'+data[0].id_+'","liu_yang_cun_fang":"'+data[1].id_+'"}}').then(res=>{ console.log('Two 收样留样位置',res) }) } }) }) } } }) } } /* let ffbSql = "select * from t_lhfbb where FIND_IN_SET( parent_id_,'"+ fbbIdStr +"')" repostCurd('sql',ffbSql).then(response => { let ffbList = response.variables.data if(wtdAndYpb.length>0){ let jcxmArr = [] wtdAndYpb.forEach(item=>{ item.jian_ce_xiang_mu_.split(',').reverse().forEach(temp=>{ jcxmArr.push(temp) }) }) let allProject = [] let finalJCTask = [] let processDefKeyParam = [] let processFormKeyParam = [] let sql111 = `select id_, defkey_, formkey_ from t_mjjcnlfw where defkey_ != '' and find_in_set(id_, '${jcxmArr.join(',')}')` repostCurd('sql', sql111).then(res => { allProject = res.variables.data wtdAndYpb.forEach(item => { let yblxArr = [] let yblxStr = '' yblxArr.push(item.yang_pin_lei_xing, item.yang_pin_lei_er_, item.yang_pin_lei_san_, item.yang_pin_lei_si_) yblxStr = yblxArr.filter(s => s).join(',') let t = item.jian_ce_xiang_mu_.split(',') let ypList = ypInfoList.find(k => k.id_ === item.id_) t.forEach(i => { let fbbItem = ffbList.find(j => j.jian_ce_xiang_mu_ === i) let jcxmItem = allProject.find(k => k.id_ === i) let obj = { jian_ce_yuan_: fbbItem.jian_ce_yuan_, fu_he_yuan_ : fbbItem.fu_he_yuan_, yang_pin_ming_che: item.yang_pin_ming_che, yang_pin_bian_hao: item.yang_pin_bian_hao, jian_ce_xiang_mu_:jcxmItem.id_, wei_tuo_id_:item.wtID, he_tong_id_:item.he_tong_id_, bao_gao_bian_zhi_:ypList.bao_gao_bian_zhi_, bao_gao_fu_he_yua:ypList.bao_gao_shen_he_y, wei_tuo_lei_xing_:item.wei_tuo_lei_xing_, yang_pin_lei_xing: yblxStr, xin_xiang_mu_ming:item.xiang_mu_ming_che, wan_cheng_shi_jia:item.song_jian_shi_jia, zhuang_tai_:'待环境监控', zhan_shi_biao_id_:item.zhan_shi_biao_id_ } finalJCTask.push(obj) processDefKeyParam.push(jcxmItem.defkey_) processFormKeyParam.push(jcxmItem.formkey_) }) }) finalJCTask.forEach((item,index )=>{ let obj = { tableName:"t_lhjczb", paramWhere:[item], defKey:processDefKeyParam[index], formKey:processFormKeyParam[index] } repostCurd('add', JSON.stringify(obj)) }) }) } }) //更新展示表 if(lhwtzsbID.length > 0){ repostCurd('updates', '{"tableName":"t_lhwtzsb","paramWhere":['+lhwtzsbID+'],"paramCond":{"zhuang_tai_":"检测进行中"}}') } */ }) this.$emit('callback', true) this.visable = false this.$message({ message: '样品接收确认操作成功!', type: 'success' }) this.closeDialog(); }).catch(_ => {}); } }, /* 去除指定行数据 使用过滤器filter过滤指定行号数据 */ deleteData(val) { this.listData = this.listData.filter((data) => { return data.id_ != val }) }, unique(arr) { return arr.filter((item, index) => { return arr.indexOf(item, 0) === index; }); }, uuid() { var s = []; var hexDigits = "0123456789abcdef"; for (var i = 0; i < 36; i++) { s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1); } s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010 s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01 s[8] = s[13] = s[18] = s[23] = "-"; var uuid = s.join(""); return uuid; }, Update(name, where, cond) { let cont = {} cont['tableName'] = name cont['paramWhere'] = where cont['paramCond'] = cond return repostCurd('update', JSON.stringify(cont)) }, /* zzj add */ dateFormat() { // 获取当前时间 var date = new Date(); var year = date.getFullYear(); var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1; var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate(); return year + "-" + month + "-" + day; }, /* 关闭*/ remRedar() { this.visible = false // 列表隐藏 this.listData = [] // 清空列表数据 this.redar = false // 扫码图标隐藏 this.$emit('scanOff', false) }, } }