|
|
@@ -53,9 +53,12 @@ export default {
|
|
|
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'`
|
|
|
let liuYangSQL = `select liu_yang_qi_xian_ from t_lyqxpzb limit 1`
|
|
|
- Promise.all([repostCurd('sql', sql), repostCurd('sql', liuYangSQL)]).then((res) => {
|
|
|
+ let cfIDSQL = `select cun_fang_id_,liu_yang_id_ FROM t_ypwzmrxzb`
|
|
|
+ Promise.all([repostCurd('sql', sql), repostCurd('sql', liuYangSQL),repostCurd('sql',cfIDSQL)]).then((res) => {
|
|
|
let temp = res[0].variables.data
|
|
|
let option = res[1].variables.data[0].liu_yang_qi_xian_
|
|
|
+ let cfID = res[2].variables.data[0].cun_fang_id_
|
|
|
+ let lyID = res[2].variables.data[0].liu_yang_id_
|
|
|
let rq = options[option]
|
|
|
if (temp) {
|
|
|
temp.forEach(item => {
|
|
|
@@ -68,14 +71,20 @@ export default {
|
|
|
item.shi_fou_liu_yang_ = '是'
|
|
|
item.yan_shou_jie_guo_ = '完好'
|
|
|
item.liu_yang_shu_lian_yi = ' ml/支×1支'
|
|
|
- item.yang_pin_lei_er_ ? item.liu_yang_shu_lian_er = ' ml/支×1支' : null
|
|
|
- item.yang_pin_lei_san_ ? item.liu_yang_shu_lian_san = ' ml/支×1支' : null
|
|
|
- item.yang_pin_lei_si_ ? item.liu_yang_shu_lian_si = ' ml/支×1支' : null
|
|
|
+ item.shou_yang_wei_zhi_yi = cfID
|
|
|
+ item.liu_yang_wei_zhi_yi = lyID
|
|
|
+ item.yang_pin_lei_er_ ?
|
|
|
+ (item.liu_yang_shu_lian_er = ' ml/支×1支' ,item.shou_yang_wei_zhi_er = cfID,item.liu_yang_wei_zhi_er = lyID) : null
|
|
|
+ item.yang_pin_lei_san_ ?
|
|
|
+ (item.liu_yang_shu_lian_san = ' ml/支×1支',item.shou_yang_wei_zhi_san = cfID,item.liu_yang_wei_zhi_san = lyID) : null
|
|
|
+ item.yang_pin_lei_si_ ?
|
|
|
+ (item.liu_yang_shu_lian_si = ' ml/支×1支',item.shou_yang_wei_zhi_si = cfID,item.liu_yang_wei_zhi_si = lyID) : null
|
|
|
item.liu_yang_ri_qi_ = new Date(new Date().getTime() + 28800000).toJSON().slice(0, 10).replace('T', ' ')
|
|
|
item.yang_pin_lei_er_ ? this.$set(item, 'flag2', true) : this.$set(item, 'flag2', false)
|
|
|
item.yang_pin_lei_san_ ? this.$set(item, 'flag3', true) : this.$set(item, 'flag3', false)
|
|
|
item.yang_pin_lei_si_ ? this.$set(item, 'flag4', true) : this.$set(item, 'flag4', false)
|
|
|
item.liu_yang_qi_xian = dayjs(item.song_jian_shi_jia).add(rq, '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 = temp
|
|
|
@@ -88,9 +97,13 @@ export default {
|
|
|
// 扫码扫到新数据,查询 并分页 回填展示
|
|
|
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'`
|
|
|
let liuYangSQL = `select liu_yang_qi_xian_ from t_lyqxpzb limit 1`
|
|
|
- Promise.all([repostCurd('sql', fysql), repostCurd('sql', liuYangSQL)]).then(([res1,res2]) => {
|
|
|
- console.log(res1)
|
|
|
- console.log(res2)
|
|
|
+ let cfIDSQL = `select cun_fang_id_,liu_yang_id_ FROM t_ypwzmrxzb`
|
|
|
+ Promise.all([repostCurd('sql', fysql), repostCurd('sql', liuYangSQL),repostCurd('sql',cfIDSQL)]).then(([res1,res2,res3]) => {
|
|
|
+ // console.log(res1)
|
|
|
+ // console.log(res2)
|
|
|
+ // console.log(res3)
|
|
|
+ let cfID = res3.variables.data[0].cun_fang_id_
|
|
|
+ let lyID = res3.variables.data[0].liu_yang_id_
|
|
|
this.listData = []
|
|
|
let temp = res1.variables.data
|
|
|
let option = res2.variables.data[0].liu_yang_qi_xian_
|
|
|
@@ -106,9 +119,17 @@ export default {
|
|
|
item.shi_fou_liu_yang_ = '是'
|
|
|
item.yan_shou_jie_guo_ = '完好'
|
|
|
item.liu_yang_shu_lian_yi = ' ml/支×1支'
|
|
|
- item.yang_pin_lei_er_ ? item.liu_yang_shu_lian_er = ' ml/支×1支' : null
|
|
|
- item.yang_pin_lei_san_ ? item.liu_yang_shu_lian_san = ' ml/支×1支' : null
|
|
|
- item.yang_pin_lei_si_ ? item.liu_yang_shu_lian_si = ' ml/支×1支' : null
|
|
|
+ item.shou_yang_wei_zhi_yi = cfID
|
|
|
+ item.liu_yang_wei_zhi_yi = lyID
|
|
|
+ item.yang_pin_lei_er_ ?
|
|
|
+ (item.liu_yang_shu_lian_er = ' ml/支×1支' ,item.shou_yang_wei_zhi_er = cfID,item.liu_yang_wei_zhi_er = lyID) : null
|
|
|
+ item.yang_pin_lei_san_ ?
|
|
|
+ (item.liu_yang_shu_lian_san = ' ml/支×1支',item.shou_yang_wei_zhi_san = cfID,item.liu_yang_wei_zhi_san = lyID) : null
|
|
|
+ item.yang_pin_lei_si_ ?
|
|
|
+ (item.liu_yang_shu_lian_si = ' ml/支×1支',item.shou_yang_wei_zhi_si = cfID,item.liu_yang_wei_zhi_si = lyID) : null
|
|
|
+ // item.yang_pin_lei_er_ ? item.liu_yang_shu_lian_er = ' ml/支×1支' : null
|
|
|
+ // item.yang_pin_lei_san_ ? item.liu_yang_shu_lian_san = ' ml/支×1支' : null
|
|
|
+ // item.yang_pin_lei_si_ ? item.liu_yang_shu_lian_si = ' ml/支×1支' : null
|
|
|
item.liu_yang_ri_qi_ = new Date(new Date().getTime() + 28800000).toJSON().slice(0, 10).replace('T', ' ')
|
|
|
item.yang_pin_lei_er_ ? this.$set(item, 'flag2', true) : this.$set(item, 'flag2', false)
|
|
|
item.yang_pin_lei_san_ ? this.$set(item, 'flag3', true) : this.$set(item, 'flag3', false)
|
|
|
@@ -197,6 +218,7 @@ export default {
|
|
|
let localStr = ''
|
|
|
let locationIds = new Set()
|
|
|
let localArr = []
|
|
|
+ let sampleList = []
|
|
|
|
|
|
for (let yp in ypInfoList) { //样品数据
|
|
|
let cfwz = ''
|
|
|
@@ -229,22 +251,38 @@ export default {
|
|
|
this_.$message.error("留样时必须填写留样日期!")
|
|
|
return;
|
|
|
}
|
|
|
+ // 判断位置是否为空
|
|
|
+ if (ypInfoList[yp].liu_yang_wei_zhi_yi == null || ypInfoList[yp].liu_yang_wei_zhi_yi == '') {
|
|
|
+ this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 类型1的留样位置选择不能为空!')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (ypInfoList[yp].flag2 == true && (ypInfoList[yp].liu_yang_wei_zhi_er == '' || ypInfoList[yp].liu_yang_wei_zhi_er == null)) {
|
|
|
+ this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 类型2的留样位置选择不能为空!')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (ypInfoList[yp].flag3 == true && (ypInfoList[yp].liu_yang_wei_zhi_san == '' || ypInfoList[yp].liu_yang_wei_zhi_san == null)) {
|
|
|
+ this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 类型3的留样位置选择不能为空!')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (ypInfoList[yp].flag4 == true && (ypInfoList[yp].liu_yang_wei_zhi_si == '' || ypInfoList[yp].liu_yang_wei_zhi_si == null)) {
|
|
|
+ this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 类型4的留样位置选择不能为空!')
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
// 判断位置是否为空
|
|
|
- if (ypInfoList[yp].shou_yang_wei_zhi_yi == null || ypInfoList[yp].shou_yang_wei_zhi_yi == ''
|
|
|
- || ypInfoList[yp].liu_yang_wei_zhi_yi == null || ypInfoList[yp].liu_yang_wei_zhi_yi == '') {
|
|
|
+ if (ypInfoList[yp].shou_yang_wei_zhi_yi == null || ypInfoList[yp].shou_yang_wei_zhi_yi == '') {
|
|
|
this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 类型1的位置选择不能为空!')
|
|
|
return;
|
|
|
}
|
|
|
- if (ypInfoList[yp].flag2 == true && (ypInfoList[yp].shou_yang_wei_zhi_er == '' || ypInfoList[yp].shou_yang_wei_zhi_er == null || ypInfoList[yp].liu_yang_wei_zhi_er == '' || ypInfoList[yp].liu_yang_wei_zhi_er == null)) {
|
|
|
+ if (ypInfoList[yp].flag2 == true && (ypInfoList[yp].shou_yang_wei_zhi_er == '' || ypInfoList[yp].shou_yang_wei_zhi_er == null)) {
|
|
|
this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 类型2的位置选择不能为空!')
|
|
|
return;
|
|
|
}
|
|
|
- if (ypInfoList[yp].flag3 == true && (ypInfoList[yp].shou_yang_wei_zhi_san == '' || ypInfoList[yp].shou_yang_wei_zhi_san == null || ypInfoList[yp].liu_yang_wei_zhi_san == '' || ypInfoList[yp].liu_yang_wei_zhi_san == null)) {
|
|
|
+ if (ypInfoList[yp].flag3 == true && (ypInfoList[yp].shou_yang_wei_zhi_san == '' || ypInfoList[yp].shou_yang_wei_zhi_san == null)) {
|
|
|
this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 类型3的位置选择不能为空!')
|
|
|
return;
|
|
|
}
|
|
|
- if (ypInfoList[yp].flag4 == true && (ypInfoList[yp].shou_yang_wei_zhi_si == '' || ypInfoList[yp].shou_yang_wei_zhi_si == null || ypInfoList[yp].liu_yang_wei_zhi_si == '' || ypInfoList[yp].liu_yang_wei_zhi_si == null)) {
|
|
|
+ if (ypInfoList[yp].flag4 == true && (ypInfoList[yp].shou_yang_wei_zhi_si == '' || ypInfoList[yp].shou_yang_wei_zhi_si == null)) {
|
|
|
this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 类型4的位置选择不能为空!')
|
|
|
return;
|
|
|
}
|
|
|
@@ -265,6 +303,36 @@ export default {
|
|
|
ypInfoList[yp].shou_yang_wei_zhi_san, ypInfoList[yp].liu_yang_wei_zhi_san,
|
|
|
ypInfoList[yp].shou_yang_wei_zhi_si, ypInfoList[yp].liu_yang_wei_zhi_si
|
|
|
)
|
|
|
+
|
|
|
+ let o = {
|
|
|
+ where:{
|
|
|
+ id_ : ypInfoList[yp].id_
|
|
|
+ },
|
|
|
+ param:{
|
|
|
+ yang_pin_lei_xing: ypInfoList[yp].yang_pin_lei_xing,
|
|
|
+ yang_ben_yun_shu_: ypInfoList[yp].yang_ben_yun_shu_,
|
|
|
+ shu_liang_: ypInfoList[yp].shu_liang_,
|
|
|
+ yang_pin_gui_ge_: ypInfoList[yp].yang_pin_gui_ge_,
|
|
|
+
|
|
|
+ yang_pin_lei_er_: ypInfoList[yp].yang_pin_lei_er_,
|
|
|
+ yang_pin_yun_shu_: ypInfoList[yp].yang_pin_yun_shu_,
|
|
|
+ shu_liang_er_: ypInfoList[yp].shu_liang_er_,
|
|
|
+ yang_pin_gui_ge_e: ypInfoList[yp].yang_pin_gui_ge_e,
|
|
|
+
|
|
|
+ yang_pin_lei_san_: ypInfoList[yp].yang_pin_lei_san_,
|
|
|
+ yang_pin_yun_san: ypInfoList[yp].yang_pin_yun_san,
|
|
|
+ shu_liang_san_: ypInfoList[yp].shu_liang_san_,
|
|
|
+ yang_pin_gui_ge_s: ypInfoList[yp].yang_pin_gui_ge_s,
|
|
|
+
|
|
|
+ yang_pin_lei_si_: ypInfoList[yp].yang_pin_lei_si_,
|
|
|
+ yang_pin_yun_si_: ypInfoList[yp].yang_pin_yun_si_,
|
|
|
+ shu_liang_si_: ypInfoList[yp].shu_liang_si_,
|
|
|
+ yang_pin_gui_si_: ypInfoList[yp].yang_pin_gui_si_,
|
|
|
+
|
|
|
+ jie_yang_zhuang_t:"已接收"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sampleList.push(o)
|
|
|
}
|
|
|
localStr = localArr.filter(i => i).join(',')
|
|
|
|
|
|
@@ -289,7 +357,6 @@ export default {
|
|
|
Promise.all([repostCurd("sql", allSQL), repostCurd("sql", allLocal)]).then((res) => {
|
|
|
let result = res[0].variables.data
|
|
|
let localInfo = res[1].variables.data
|
|
|
- // todo
|
|
|
// console.log(localInfo)
|
|
|
/* 1、更新货架位置信息 */
|
|
|
this.emptyLocal = []
|
|
|
@@ -468,11 +535,21 @@ export default {
|
|
|
}
|
|
|
console.log('样品登记表:',ypdjb)
|
|
|
repostCurd('add', '{"tableName":"t_lhypdjb","paramWhere":' + JSON.stringify(ypdjb) + '}')
|
|
|
- /* 3、更新样品表 */
|
|
|
+ /* 3、更新样品表
|
|
|
// console.log('3、更新样品表',lhypIdNewList)
|
|
|
repostCurd('updates', '{"tableName":"t_lhypb","paramWhere":[' + lhypIdNewList + '],"paramCond":{"jie_yang_zhuang_t":"已接收"}}').then(res=>{
|
|
|
this.handleAnySituation(true,"样品成功接收,正在开启任务分配!",'success')
|
|
|
})
|
|
|
+ */
|
|
|
+ console.log('更新样品表',sampleList)
|
|
|
+ let allSampleParams ={
|
|
|
+ tableName:'t_lhypb',
|
|
|
+ updList:sampleList
|
|
|
+ }
|
|
|
+ repostCurd('updatesByWhere', JSON.stringify(allSampleParams)).then(res=>{
|
|
|
+ this.handleAnySituation(true,"样品成功接收,正在开启任务分配!",'success')
|
|
|
+ })
|
|
|
+
|
|
|
})
|
|
|
|
|
|
|