|
|
@@ -87,6 +87,7 @@ import VueBarcode from 'vue-barcode';
|
|
|
import vueEasyPrint from "vue-easy-print";
|
|
|
import repostCurd from '@/business/platform/form/utils/custom/joinCURD.js';
|
|
|
import { resolve } from 'path';
|
|
|
+import { async } from 'q';
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
@@ -145,10 +146,43 @@ export default {
|
|
|
},
|
|
|
async getInit() {
|
|
|
let this_ = this;
|
|
|
- // console.log('getInit:',this.obj)
|
|
|
- this.jcxmList = []
|
|
|
- var idStr = '';
|
|
|
- var wjStr = '';
|
|
|
+ // console.log('getInit:',this.obj)
|
|
|
+ let jcxmList = []
|
|
|
+ let idStr = ''
|
|
|
+ let wjStr = ''
|
|
|
+ if(this.obj.length > 0 && this.obj[0].indexOf(" ") != -1){
|
|
|
+ for(let item of this.obj){
|
|
|
+ idStr += item.split(" ")[0] + ','
|
|
|
+ wjStr += item.split(" ")[1] + ','
|
|
|
+ jcxmList.push(item.split(" ")[2].split(','))
|
|
|
+ }
|
|
|
+ idStr = idStr.substring(0,idStr.length-1);
|
|
|
+ wjStr = wjStr.substring(0,wjStr.length-1);
|
|
|
+ this.getLookJCXM(idStr,wjStr,jcxmList)
|
|
|
+
|
|
|
+ // this.obj.forEach((item,index)=>{
|
|
|
+ // let jcxmList = []
|
|
|
+ // let tcxmList = []
|
|
|
+ // let idStr = item.split(" ")[0];
|
|
|
+ // let wjStr = item.split(" ")[1];
|
|
|
+ // // idStr += item.split(" ")[0] + ','
|
|
|
+ // // wjStr += item.split(" ")[1] + ','
|
|
|
+ // jcxmList.push(item.split(" ")[2].split(','))
|
|
|
+ // tcxmList.push(item.split(" ")[3].split(','))
|
|
|
+ // this.getLookJCXM(idStr,wjStr,jcxmList,tcxmList)
|
|
|
+ // if(index === this.obj.length -1){
|
|
|
+ // this.list = this.finalList
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // setTimeout(() => {
|
|
|
+ // console.log('obj',this.obj.length)
|
|
|
+ // console.log('finalList',this.finalList.length)
|
|
|
+ // console.log('finalList',this.finalList)
|
|
|
+ // this.list = this.finalList
|
|
|
+ // }, 3000);
|
|
|
+ }
|
|
|
+
|
|
|
+/*
|
|
|
if(this.obj.length > 0 && this.obj[0].indexOf(" ") != -1){
|
|
|
this.obj.forEach(item=>{
|
|
|
idStr += item.split(" ")[0] + ','
|
|
|
@@ -158,7 +192,8 @@ export default {
|
|
|
idStr = idStr.substring(0,idStr.length-1);
|
|
|
wjStr = wjStr.substring(0,wjStr.length-1);
|
|
|
this.getLookJCXM(idStr,wjStr,this.jcxmList)
|
|
|
- }else{
|
|
|
+ }
|
|
|
+ */else{
|
|
|
// 列表标签打印
|
|
|
let ypInfo = []
|
|
|
for(let item of this.obj){
|
|
|
@@ -237,32 +272,37 @@ export default {
|
|
|
this.list = list;
|
|
|
},
|
|
|
getLookJCXM(id,wjStr,jcxmList){
|
|
|
- // console.log(id,wjStr,jcxmList)
|
|
|
- let jcxmSQL = `select xiang_mu_bian_hao from t_mjjcnlfw where find_in_set(id_,'${jcxmList}')`
|
|
|
+ // console.log(id,wjStr,jcxmList)
|
|
|
+ // let jcxmSQL = `select xiang_mu_bian_hao from t_mjjcnlfw where find_in_set(id_,'${jcxmList}') union all select xiang_mu_bian_hao from t_mjjcnlfw where find_in_set(id_,'${tcxmList}')`
|
|
|
+ let jcxmSQL = `select id_,xiang_mu_bian_hao from t_mjjcnlfw`
|
|
|
let sql = `select yang_pin_ming_che,yang_pin_bian_hao from t_mjypb where find_in_set(id_,'${id}')`
|
|
|
+ // console.log(sql)
|
|
|
let wtsql = `select wei_tuo_ri_qi_ from t_mjwtsqb where find_in_set(id_,'${wjStr}')`
|
|
|
- Promise.all([repostCurd("sql", jcxmSQL),repostCurd("sql", sql),repostCurd('sql',wtsql)]).then((res1,res2,res3)=>{
|
|
|
- // console.log(res1[0].variables.data)
|
|
|
- // console.log(res1[1].variables.data)
|
|
|
- // console.log(res1[2].variables.data)
|
|
|
+ Promise.all([repostCurd("sql", jcxmSQL),repostCurd("sql", sql),repostCurd('sql',wtsql)]).then((res1)=>{
|
|
|
let jcxmInfo = res1[0].variables.data
|
|
|
- let ypInfo = res1[1].variables.data
|
|
|
- let rq = res1[2].variables.data
|
|
|
+ let jcxmArr = []
|
|
|
+ jcxmList.forEach(item=>{
|
|
|
+ let temp = []
|
|
|
+ item.forEach(i=>{
|
|
|
+ temp.push(jcxmInfo.find(x => x.id_ == i).xiang_mu_bian_hao)
|
|
|
+ })
|
|
|
+ jcxmArr.push(temp)
|
|
|
+ })
|
|
|
+ let ypInfo = res1[1].variables.data.reverse()
|
|
|
+ // console.log(ypInfo)
|
|
|
let list = []
|
|
|
ypInfo.forEach((item,index) => {
|
|
|
- rq.forEach((a,b)=>{
|
|
|
- jcxmInfo.forEach((it,ind)=>{
|
|
|
- let o = {
|
|
|
- name: item.yang_pin_ming_che,
|
|
|
- serial: item.yang_pin_bian_hao,
|
|
|
- type: a.wei_tuo_ri_qi_,
|
|
|
- condition: it.xiang_mu_bian_hao
|
|
|
- }
|
|
|
- list.push(o)
|
|
|
- })
|
|
|
- })
|
|
|
+ jcxmArr[index].forEach((it,ind)=>{
|
|
|
+ let o = {
|
|
|
+ name: item.yang_pin_ming_che,
|
|
|
+ serial: item.yang_pin_bian_hao,
|
|
|
+ condition: it
|
|
|
+ }
|
|
|
+ list.push(o)
|
|
|
+ })
|
|
|
})
|
|
|
this.list = list
|
|
|
+ console.log(this.list.length)
|
|
|
})
|
|
|
/*
|
|
|
let sql = `select * from t_mjypb where find_in_set(id_,'${id}')`
|