diff --git a/src/api/jhzxgl/pgd.js b/src/api/jhzxgl/pgd.js index ce3e3f4..eabd5f1 100644 --- a/src/api/jhzxgl/pgd.js +++ b/src/api/jhzxgl/pgd.js @@ -23,7 +23,9 @@ export function saveDhPgdFk(data) {return request({url: '/pgdDh/saveDhPgdFk', me // export function getSljhPgd(data) {return request({url: '/pgdSljh/getSljhPgd', method: 'post', data})} export function getSljhPgd(data) {return request({url: '/zyjh/sljh', method: 'post', data})} export function getydjhByid(data) {return request({url: '/pgdSljh/getydjhByid', method: 'post', data})} +export function slPrint(data) {return request({url: '/pgdSljh/slPrint', method: 'post', data})} export function getKcAndSljh(data) {return request({url: '/pgdSljh/getKcAndSljh', method: 'post', data})} +export function getKcAndSljh1(data) {return request({url: '/pgdSljh/getKcAndSljh1', method: 'post', data})} export function kcAdnSlBd(data) {return request({url: '/pgdSljh/kcAdnSlBd', method: 'post', data})} export function kcAdnSlZx(data) {return request({url: '/pgdSljh/kcAdnSlZx', method: 'post', data})} export function saveSljhPgdXd(data) {return request({url: '/pgdSljh/saveSljhPgdXd', method: 'post', data})} diff --git a/src/views/jhzxgl/components/SljhPrint.vue b/src/views/jhzxgl/components/SljhPrint.vue new file mode 100644 index 0000000..99fb2e0 --- /dev/null +++ b/src/views/jhzxgl/components/SljhPrint.vue @@ -0,0 +1,201 @@ + + + + + + + + + 上 料 计 划 + + + + + 制单日期:{{item.dyrq}} + + + 序号 + 合同号 + 船号 + 材质 + + 规格 + 炉批号 + 数量 + 库存垛位 + 层数 + 需求船只 + 需求批量 + 流向 + 跨位 + 物品状态 + 备注 + + + + + {{ item1.xh }} + {{ item1.dcFd }} + {{ item1.dcch }} + {{ item1.wpxh }} + + {{ item1.wpgg }} + {{ item1.lph }} + {{ item1.qxkcl }} + {{ item1.kwh }} + {{ item1.cfcs1 }} + {{ item1.zych }} + {{ item1.zypl }} + {{ item1.zylx }} + {{ item1.sldw }} + {{ item1.wpzt }} + {{ item1.bz }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/jhzxgl/pwjhD.vue b/src/views/jhzxgl/pwjhD.vue index 1f372ea..8da0b73 100644 --- a/src/views/jhzxgl/pwjhD.vue +++ b/src/views/jhzxgl/pwjhD.vue @@ -54,9 +54,17 @@ - - - + + + + + + @@ -179,7 +187,8 @@ export default { field:'', user:'', jhrqField:'', - zt:'21' + zt:'21', + qgkw:'' }, statusOptions: [ { @@ -278,14 +287,14 @@ export default { },{ field: 'pwxcldw', - title: '抛丸库存垛位', + title: '上料预处理垛位', width: 100, filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filterRender: { name: 'FilterCombination' } }, { field: 'pwcs', - title: '抛丸层数', + title: '上料预处理层数', width: 100, filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filterRender: { name: 'FilterCombination' } @@ -455,7 +464,7 @@ export default { 'field': 'pwfkrq', 'fieldry': 'pwfkry', 'zxZtName':'PWFK', - 'list':obj + 'list':obj, }).then(res=>{ if(res.success){ diff --git a/src/views/jhzxgl/sljhD.vue b/src/views/jhzxgl/sljhD.vue index 2e8f5a9..676e84e 100644 --- a/src/views/jhzxgl/sljhD.vue +++ b/src/views/jhzxgl/sljhD.vue @@ -1,29 +1,71 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 查询 + + + + + + + + + - - + + - - - - + + + - - - - 查询 + 查询 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 批量 + 核对 + + 保存 + 打印 + + + @@ -129,6 +197,7 @@ + - - - + + + - 核对 - - 保存 + @@ -177,17 +244,20 @@ highlight-current-row :header-cell-style="{'text-align':'center'}" > - - - + + + - - + + + + + @@ -199,25 +269,32 @@ import { saveSljhPgdXd, saveSljhPgdXdBack, saveSljhFk, - getPgdBase, saveSljhPg, saveSljhPgBack, getKcAndSljh, kcAdnSlBd, kcAdnSlZx,getydjhByid + getPgdBase, saveSljhPg, saveSljhPgBack, getKcAndSljh, kcAdnSlBd, kcAdnSlZx, getydjhByid, getKcAndSljh1, slPrint } from '@/api/jhzxgl/pgd' import { mapGetters } from 'vuex' import XEUtils from 'xe-utils' +import SljhPrint from "@/views/jhzxgl/components/SljhPrint"; import {null2str} from "@/utils/rpkj"; import { getToken } from '@/utils/auth' import { startLoading, endLoading } from '@/utils' import { Message } from 'element-ui' export default { name:'SljhD', + components: {SljhPrint}, data() { return { queryParam: { dcch:'', - pl:'', + ql:'', + xqdcch:'', + xqpl:'', kw:'', sljhrq:'', rqopt:'01' }, + defaultHeight: { height: '' }, + wgzyprintFlag:false, + sljhPrintData:[], statusOptions: [ { value: "01", @@ -225,16 +302,22 @@ export default { }, { value: "02", - label: "已核对", + label: "未打印", + }, + { + value: "03", + label: "已打印", } ], inParam:{ - slry:'', - slks:'', - sljs:'', - dw:'', - scry:'', - scdw:'' + dcch:'', + pl:'', + pwwz:'', + qgkw:'', + jhrq:'', + bz:'', + lx:'', + dw:'' }, list: [], tableOne: [], @@ -255,6 +338,7 @@ export default { }, ], tableColumn2: [ + { type: 'checkbox', width: 40 }, { type: 'seq', width: '40px', title: '序号' }, // { field: 'id', title: 'id',width: 80, // filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],}, @@ -279,9 +363,7 @@ export default { { field: 'tzbh', title: '套料图号',width: 90, filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filterRender: { name: 'FilterCombination', }}, - { field: 'jssj', title: '前方需求时间',width: 110, - filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], - filterRender: { name: 'FilterCombination', }}, + // { field: 'lqlb', title: '领取类型',width: 90,formatter: ['dictFormat','CLlQ'], // filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], // filterRender: { name: 'FilterCombination', }}, @@ -300,12 +382,7 @@ export default { { field: 'slkcdw', title: '上料库存垛位', - editRender: { - name: '$select', options: [], - optionProps: {value: 'id', label: 'name'}, - props: {clearable: true} - , events: {change: this.selectChange} - }, + editRender: { name: 'input' }, width: 100, filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filterRender: { name: 'FilterCombination' } @@ -320,21 +397,21 @@ export default { { field: 'slxhth', title: '上料小合同号', - width: 120, + width: 120, editRender: { name: 'input' }, filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filterRender: { name: 'FilterCombination' } }, { field: 'slhth', title: '上料合同号', - width: 100, + width: 100, editRender: { name: 'input' }, filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filterRender: { name: 'FilterCombination' } }, { field: 'slwlh', title: '上料物料号', - width: 120, + width: 120, editRender: { name: 'input' }, filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filterRender: { name: 'FilterCombination' } }, @@ -387,8 +464,15 @@ export default { filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filterRender: { name: 'FilterCombination' } }, + { field: 'jssj', title: '前方需求时间',width: 110, + filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], + filterRender: { name: 'FilterCombination', }}, + { field: 'id', title: '生产id',width: 110, + filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], + filterRender: { name: 'FilterCombination', }}, ], tableColumn1: [ + { type: 'checkbox', width: 40 }, { type: 'seq', width: 40, title: '序号' }, // 1 // { title: '操作', width: 50, slots: { default: 'operation' }, fixed: 'right' }, { @@ -399,34 +483,19 @@ export default { filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filterRender: { name: 'FilterCombination' }, }, - { - title: '车号', - width: "100px", - field: 'dcTpbh', - filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], - filterRender: { name: 'FilterCombination' }, - }, { - title: '合同号', - width: "120px", - field: 'dcFd', - + title: '期量', + width: "90px", + field: 'dzwz', + formatter: ['dictFormat','DHQL'], filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filterRender: { name: 'FilterCombination' }, }, - { - title: '小合同号', - width: "120px", - field: 'gcddh', - - filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], - filterRender: { name: 'FilterCombination' }, - }, { title: '船号', - width: "100px", + width: "80px", field: 'dcch', filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], @@ -434,7 +503,7 @@ export default { }, { title: '材质', - width: "100px", + width: "80px", field: 'wpxh', filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], @@ -442,7 +511,7 @@ export default { }, { title: '规格', - width: "100px", + width: "80px", field: 'wpgg', filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], @@ -450,7 +519,7 @@ export default { }, { title: '炉批号', - width: "120px", + width: "70px", field: 'lph', filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], @@ -458,7 +527,7 @@ export default { }, { title: '数量', - width: "100px", + width: "70px", field: 'qxkcl', filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], @@ -466,7 +535,7 @@ export default { }, { title: '库存', - width: "100px", + width: "70px", field: 'kwh', filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], @@ -501,7 +570,12 @@ export default { title: '需求船只', width: "120px", field: 'zych', - + editRender: { + name: '$select', options: [], + optionProps: {value: 'cbbm', label: 'cbbm'}, + props: {clearable: true} + , events: {change: this.selectChange} + }, filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filterRender: { name: 'FilterCombination' }, }, @@ -509,7 +583,7 @@ export default { title: '需求批量', width: "120px", field: 'zypl', - + editRender: { name: 'input' }, filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filterRender: { name: 'FilterCombination' }, }, @@ -517,7 +591,12 @@ export default { title: '流向', width: "120px", field: 'zylx', - formatter: ['dictFormat', 'ZLLB'], + editRender: { + name: '$select', options: [], + optionProps: {value: 'bm', label: 'bmsm'}, + props: {clearable: true} + , events: {change: this.selectChange} + }, filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filterRender: { name: 'FilterCombination' }, }, @@ -526,20 +605,86 @@ export default { width: "120px", field: 'sldw', formatter: ['dictFormat', 'QGKW'], + editRender: { + name: '$select', options: [], + optionProps: {value: 'bm', label: 'bmsm'}, + props: {clearable: true} + , events: {change: this.selectChange} + }, + filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], + filterRender: { name: 'FilterCombination' }, + }, + { + title: '抛丸位置', + width: "120px", + field: 'pwwz', + formatter: ['dictFormat', 'PWWZ'], + editRender: { + name: '$select', options: [], + optionProps: {value: 'bm', label: 'bmsm'}, + props: {clearable: true} + , events: {change: this.selectChange} + }, + filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], + filterRender: { name: 'FilterCombination' }, + }, + { + title: '计划日期', + width: "120px", + field: 'dhh', + editRender: { name: 'input' }, + filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], + filterRender: { name: 'FilterCombination' }, + }, + { + title: '物品状态', + width: "120px", + field: 'wpzt', + formatter: ['dictFormat', 'WPZT'], filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filterRender: { name: 'FilterCombination' }, }, - - { title: '备注', width: "120px", field: 'bz', + editRender: { name: 'input' }, + filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], + filterRender: { name: 'FilterCombination' }, + }, + { + title: '小合同号', + width: "120px", + field: 'gcddh', filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filterRender: { name: 'FilterCombination' }, - } + }, + { + title: '车号', + width: "100px", + field: 'dcTpbh', + + filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], + filterRender: { name: 'FilterCombination' }, + }, + { + title: '合同号', + width: "120px", + field: 'dcFd', + + filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], + filterRender: { name: 'FilterCombination' }, + }, + { + title: '生产id', + width: "120px", + field: 'ydid', + + filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], + filterRender: { name: 'FilterCombination' }, + }, ], } }, @@ -551,11 +696,11 @@ export default { this.getHeight() this.initBase() - + this.inParam.dw=0 }, methods: { cellClickEvent({row}) { - this.queryParam.dcch = row.cbbm + this.queryParam.xqdcch = row.cbbm this.$refs.xDown4.hidePanel() }, focusEvent4() { @@ -564,8 +709,8 @@ export default { keyupEvent4() { - if (this.queryParam.dcch) { - this.projectData = this.projectData1.filter(row => row.cbbm.indexOf(this.queryParam.dcch.toUpperCase()) > -1) + if (this.queryParam.xqdcch) { + this.projectData = this.projectData1.filter(row => row.cbbm.indexOf(this.queryParam.xqdcch.toUpperCase()) > -1) } else { this.projectData = this.projectData1.slice(0) } @@ -586,10 +731,36 @@ export default { if(selectRecords.length>0){ for(let i = 0; i < selectRecords.length; i++) { - selectRecords[i].slkcdw = this.inParam.dw - //selectRecords[i].dw = this.inParam.dw - //selectRecords[i].scdw = this.inParam.scdw - // selectRecords[i].scry = this.inParam.scry + + + if(this.inParam.dcch !==''){ + selectRecords[i].zych = this.inParam.dcch + } + if(this.inParam.pl !==''){ + selectRecords[i].zypl = this.inParam.pl + } + if(this.inParam.lx !==''){ + selectRecords[i].zylx = this.inParam.lx + } + if(this.inParam.qgkw !==''){ + selectRecords[i].sldw = this.inParam.qgkw + } + if(this.inParam.pwwz!==''){ + selectRecords[i].pwwz = this.inParam.pwwz + } + if(this.inParam.jhrq !==''){ + selectRecords[i].dhh = this.inParam.jhrq + } + if(this.inParam.bz !==''){ + selectRecords[i].bz = this.inParam.bz + } + + + + + + + } @@ -633,8 +804,27 @@ export default { this.projectData=res.data.cbbm this.projectData1=res.data.cbbm - // const slkcdw = this.$refs.xGrid.getColumnByField('slkcdw') - // slkcdw.editRender.options = this.dictData.ycldws + + + + + const zych = this.$refs.xGrid.getColumnByField('zych') + zych.editRender.options = this.dictData.cbbm + + const zylx = this.$refs.xGrid.getColumnByField('zylx') + zylx.editRender.options = this.dictData.zylx + + + const sldw = this.$refs.xGrid.getColumnByField('sldw') + sldw.editRender.options = this.dictData.qgkw + + const pwwz = this.$refs.xGrid.getColumnByField('pwwz') + pwwz.editRender.options = this.dictData.pwwz + + + + + }) }, plClick(){ @@ -647,181 +837,193 @@ export default { } }, - saveclick(){ - - if(this.queryParam.zt!=='2'){ - return ; + print(){ + let selectRecords = this.$refs.xGrid.getCheckboxRecords() + if(selectRecords.length>0){ + slPrint(selectRecords).then(res=>{ + this.sljhPrintData=res.data + console.log(this.sljhPrintData) + this.wgzyprintFlag=true + setTimeout(() => { + this.$print(this.$refs.print) + this.wgzyprintFlag = false + this.initList() + }, 50) + }) } - let obj=this.$refs.xGrid.getCheckboxRecords() - // if(obj.length===0){ - // this.$message({ message: '请填写反馈原因在进行反馈', type: 'warning' }) - // return - // } - saveSljhFk(obj).then(res=>{ - if(res.success){ - this.initList() - } - }) }, + async getlist1 (){ + await getKcAndSljh1(this.queryParam).then((res) => { - slpgclick(){ - if(this.queryParam.zt!=="01"){ - return - } - - let obj=this.$refs.xGrid.getCheckboxRecords() - if(obj.length===0){ - return - } - if(this.queryParam.zt==='02'){ - this.$confirm('取消派工?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() =>{ - saveSljhPgBack(obj).then(res=>{ - if(res.success){ - this.$message({ message: '取消派工成功', type: 'success' }) - this.initList() - } - }) - }) - }else { - this.$confirm('派工?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() =>{ - saveSljhPg(obj).then(res=>{ - if(res.success){ - this.initList() - } - }) + this.tableTwo = res.data - }) - } + if (this.$refs.xGrid1) { + this.$refs.xGrid1.loadData(res.data) + console.log(this.list) + } + }) }, - async rowClick({ column, row }) { - if(this.queryParam.rqopt==="02"){ - if(row.ydid==='' || row.ydid==null){ - this.$refs.xGrid1.setCurrentRow(); - } - getydjhByid({"id":row.ydid}).then(res=>{ - if(res.success){ - let subObj=this.$refs.xGrid1.getTableData().visibleData - for(let obj of subObj){ - console.log(obj) - console.log(res.data) - // console.log(Object.assign(this.testClone(updateobj),obj)) - if(obj.id===res.data.id){ - this.$refs.xGrid1.setCurrentRow( obj); - } - } - } - }) - } - }, - xdClick(){ + async rowClick({ column, row }) { - if(this.queryParam.zt!=="02"){ - return - } - let obj=this.$refs.xGrid.getCheckboxRecords() - if(obj.length===0){ + if(row.ydid==='' || row.ydid==null){ + this.$refs.xGrid1.setCurrentRow(); return } - if(this.queryParam.zt==='03'){ - this.$confirm('取消接收?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() =>{ - saveSljhPgdXdBack(obj).then(res=>{ - if(res.success){ - this.$message({ message: '取消下达成功', type: 'success' }) - this.initList() - } - }) - - }) - }else { - this.$confirm('接收?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() =>{ - saveSljhPgdXd(obj).then(res=>{ - if(res.success){ - this.$message({ message: '下达成功', type: 'success' }) - this.initList() + let a=true + getydjhByid({"id":row.ydid}).then(res=>{ + if(res.success){ + let subObj=this.$refs.xGrid1.getTableData().visibleData + for(let obj of subObj){ + console.log(obj) + console.log(res.data) + let yds=res.data + // console.log(Object.assign(this.testClone(updateobj),obj)) + if(obj.id===yds[0].id){ + a=false + this.$refs.xGrid1.setCurrentRow( obj); } - }) - - }) - } - - + } + if(a){ + this.$refs.xGrid1.loadData(res.data) + } + } + }) }, + initList() { this.bdbs="" - if (this.queryParam.dcch === '') { - this.$message.warning('选择船只编号') - return - } + // if (this.queryParam.dcch === '') { + // this.$message.warning('选择船只编号') + // return + // } getKcAndSljh(this.queryParam).then((res) => { this.tableOne = res.data.slkcs console.log(this.tableOne) - this.tableTwo = res.data.ydjhs + //this.tableTwo = res.data.ydjhs console.log(this.tableTwo) if (this.$refs.xGrid) { this.$refs.xGrid.loadData(this.tableOne) console.log(this.list) } + // if (this.$refs.xGrid1) { + // this.$refs.xGrid1.loadData(this.tableTwo) + // console.log(this.list) + // } + + }) + }, + initList1() { + this.bdbs="" + // if (this.queryParam.dcch === '') { + // this.$message.warning('选择船只编号') + // return + // } + getKcAndSljh1(this.queryParam).then((res) => { + + + this.tableTwo = res.data + + if (this.$refs.xGrid1) { - this.$refs.xGrid1.loadData(this.tableTwo) + this.$refs.xGrid1.loadData(res.data) console.log(this.list) } }) }, + hdClick(){ if(this.queryParam.rqopt!=='01'){ return } - if(this.bdbs=='01'){ - this.$message({ message: '核对结果未保存,重新查询后进行核对', type: 'warning' }) - return + + if(this.inParam.pl !=='') { + this.queryParam.xqdcch = this.inParam.dcch + } + if(this.inParam.dcch !==''){ + this.queryParam.xqdcch=this.inParam.dcch + this.getlist1().then(res=>{ + this.hd() + }) + + }else{ + this.hd() } + + // if(this.bdbs=='01'){ + // this.$message({ message: '核对结果未保存,重新查询后进行核对', type: 'warning' }) + // return + // } console.log(this.$refs.xGrid.getTableData()) - kcAdnSlBd({ + + }, + + async hd (){ + await kcAdnSlBd({ // "data1":this.$refs.xGrid.getTableData().visibleData, // "data2":this.$refs.xGrid1.getTableData().visibleData - "data1":this.$refs.xGrid.getTableData().fullData, - "data2":this.$refs.xGrid1.getTableData().fullData + "data1":this.$refs.xGrid.getTableData().visibleData, + "data2":this.$refs.xGrid1.getTableData().visibleData, + "dw":this.inParam.dw }).then((res) => { if(res.success){ - this.tableOne = res.data.slkcs - console.log(this.tableOne) - - this.tableTwo = res.data.ydjhs - console.log(this.tableTwo) - if (this.$refs.xGrid) { - this.$refs.xGrid.loadData(this.tableOne) - console.log(this.list) - } - if (this.$refs.xGrid1) { - this.$refs.xGrid1.loadData(this.tableTwo) - console.log(this.list) - } - this.bdbs="01" + // 与现有数据进行比对 + let array1 = this.$refs.xGrid.getTableData().visibleData + let array2=res.data.slkcs + console.log(array1) + console.log(array2) + array1.forEach(item1 => { + array2.forEach(item2 => { + if (item1.ckh === item2.ckh && item1.wph === item2.wph && item1.kwh === item2.kwh && item1.nbsbm === item2.nbsbm) { + //console.log(`Match found: ${item1.name} and ${item2.name}`); + //console.log(item1.nbsbm); + console.log(item2); + item1.zych = item2.dcch + item1.zypl = item2.zypl + item1.zylx =item2.zylx + item1.sldw = item2.sldw + item1.ydid = item2.ydid + item1.dhh = item2.dhh + + // item1.dhh = item2.sljhrq + + this.$refs.xGrid.setCheckboxRow(item1,true) + return + + } + }); + }); + + array1 = this.$refs.xGrid1.getTableData().visibleData + array2=res.data.slkcs + console.log(array1) + console.log(array2) + array1.forEach(item1 => { + array2.forEach(item2 => { + if (item1.id === item2.ydid) { + //console.log(`Match found: ${item1.name} and ${item2.name}`); + item1.slcs = item2.cfcs1 + item1.slxhth = item2.gcddh + item1.slhth = item2.dcFd + item1.slwlh = item2.wph + item1.slkcdw = item2.kwh + item1.slycldw = item1.slycldw + + this.$refs.xGrid1.setCheckboxRow(item1, true) + return + + } + }); + }); + } @@ -831,19 +1033,17 @@ export default { if(this.queryParam.rqopt!=='01'){ return } - if(this.bdbs!=='01'){ - this.$message({ message: '请先进行核对', type: 'warning' }) - return - } + kcAdnSlZx({ // "data1":this.$refs.xGrid.getTableData().visibleData, // "data2":this.$refs.xGrid1.getTableData().visibleData - "data1":this.$refs.xGrid.getTableData().fullData, - "data2":this.$refs.xGrid1.getTableData().fullData + "data1":this.$refs.xGrid.getUpdateRecords(), + "data2":this.$refs.xGrid1.getUpdateRecords() }).then((res) => { - // if(res.success){ - this.initList() + // if(res.success){ + this.initList() + this.initList1() //} })