diff --git a/src/api/jhzxgl/pgd.js b/src/api/jhzxgl/pgd.js index 4cc16ba..239fa4f 100644 --- a/src/api/jhzxgl/pgd.js +++ b/src/api/jhzxgl/pgd.js @@ -28,6 +28,8 @@ export function slPrint(data) {return request({url: '/pgdSljh/slPrint', method: 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 kcAdnSlBd1(data) {return request({url: '/pgdSljh/kcAdnSlBd1', method: 'post', data})} +export function kcAdnSlBd2(data) {return request({url: '/pgdSljh/kcAdnSlBd2', 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})} export function saveSljhPgdXdBack(data) {return request({url: '/pgdSljh/saveSljhPgdXdBack', method: 'post', data})} diff --git a/src/views/jhzxgl/sljhD.vue b/src/views/jhzxgl/sljhD.vue index 79a1639..7459f82 100644 --- a/src/views/jhzxgl/sljhD.vue +++ b/src/views/jhzxgl/sljhD.vue @@ -74,66 +74,72 @@ <el-form-item > - <el-button type="success" @click="initList">查询</el-button> - </el-form-item> - </el-form> - </el-col> - - <el-col :span="10"> - - <el-form :inline="true" label-width="80px" label-position="left"> - - <el-form-item label="生产船号:"> - <vxe-pulldown ref="xDown4" transfer > - <template #default> - <vxe-input - v-model="queryParam.xqdcch" - placeholder="船号" - style="height: 28px; - line-height: 28px; width: 140px;" - suffix-icon="vxe-icon--search" - @keyup="keyupEvent4" - @focus="focusEvent4" - /> - </template> - <template #dropdown> - <div class="my-dropdown mytable " style="width: 250px"> - <vxe-grid - highlight-hover-row - height="auto" - :data="projectData" - :columns="projectColumns" - @cell-click="cellClickEvent" - show-overflow - > - <template #wgbsEdit="{ row}"> - <vxe-checkbox v-model="row.wgbs" checked-value="Y" unchecked-value="N" disabled ></vxe-checkbox> - </template> - </vxe-grid> - </div> - </template> - </vxe-pulldown> - - - </el-form-item> - <el-form-item label="生产批量:"> - <el-input v-model="queryParam.xqpl" type="search" placeholder="批量" ></el-input> - </el-form-item> - <!-- <el-form-item label="跨位:">--> - <!-- <el-input v-model="queryParam.kw" type="search" placeholder="跨位" ></el-input>--> - <!-- </el-form-item>--> - - - <el-form-item style="float: right" > - <el-button type="success" @click="initList1">查询</el-button> </el-form-item> </el-form> </el-col> + <el-col :span="10" style="text-align: right"> + <el-button type="success" @click="initList">查询</el-button> + <el-button type="success" @click="hdClick()">核对</el-button> + <!-- <el-button type="danger" @click="delOne('insert')">删除</el-button>--> + <el-button type="success" @click="saveOne()">保存</el-button> + <el-button type="success" @click="print()">打印</el-button> + </el-col> +<!-- <el-col :span="10">--> + +<!-- <el-form :inline="true" label-width="80px" label-position="left">--> + +<!-- <el-form-item label="生产船号:">--> +<!-- <vxe-pulldown ref="xDown4" transfer >--> +<!-- <template #default>--> +<!-- <vxe-input--> +<!-- v-model="queryParam.xqdcch"--> +<!-- placeholder="船号"--> +<!-- style="height: 28px;--> +<!-- line-height: 28px; width: 140px;"--> +<!-- suffix-icon="vxe-icon--search"--> +<!-- @keyup="keyupEvent4"--> +<!-- @focus="focusEvent4"--> +<!-- />--> +<!-- </template>--> +<!-- <template #dropdown>--> +<!-- <div class="my-dropdown mytable " style="width: 250px">--> +<!-- <vxe-grid--> +<!-- highlight-hover-row--> +<!-- height="auto"--> + +<!-- :data="projectData"--> +<!-- :columns="projectColumns"--> +<!-- @cell-click="cellClickEvent"--> +<!-- show-overflow--> +<!-- >--> +<!-- <template #wgbsEdit="{ row}">--> +<!-- <vxe-checkbox v-model="row.wgbs" checked-value="Y" unchecked-value="N" disabled ></vxe-checkbox>--> +<!-- </template>--> +<!-- </vxe-grid>--> +<!-- </div>--> +<!-- </template>--> +<!-- </vxe-pulldown>--> + + +<!-- </el-form-item>--> +<!-- <el-form-item label="生产批量:">--> +<!-- <el-input v-model="queryParam.xqpl" type="search" placeholder="批量" ></el-input>--> +<!-- </el-form-item>--> +<!-- <!– <el-form-item label="跨位:">–>--> +<!-- <!– <el-input v-model="queryParam.kw" type="search" placeholder="跨位" ></el-input>–>--> +<!-- <!– </el-form-item>–>--> + + +<!-- <el-form-item style="float: right" >--> +<!-- <el-button type="success" @click="initList1">查询</el-button>--> +<!-- </el-form-item>--> +<!-- </el-form>--> +<!-- </el-col>--> </el-row> <el-row> - <el-col :span="14"> + <el-col :span="24"> @@ -213,31 +219,30 @@ > </el-option> </el-select> + <el-date-picker v-model="inParam.jhrq" value-format="yyyy/MM/dd" type="date" placeholder="计划日期"/> + <el-input v-model="inParam.bz" type="search" placeholder="备注" ></el-input> + <el-button type="info" @click="updates2()" >批量</el-button> </el-col> - <el-col :span="10"> +<!-- <el-col :span="10">--> - <el-select v-model="inParam.dw" placeholder="预处理垛位" clearable > - <el-option - v-for="item in this.dictData.ycldws" - :key="item.id" - :label="item.name" - :value="item.id" - > - </el-option> - </el-select> - </el-col> +<!-- <el-select v-model="inParam.dw" placeholder="预处理垛位" clearable >--> +<!-- <el-option--> +<!-- v-for="item in this.dictData.ycldws"--> +<!-- :key="item.id"--> +<!-- :label="item.name"--> +<!-- :value="item.id"--> +<!-- >--> +<!-- </el-option>--> +<!-- </el-select>--> +<!-- </el-col>--> </el-row> <el-row> <el-col :span="14"> <!-- <el-date-picker v-model="inParam.jhrq" value-format="yyyy/MM/dd" type="date" placeholder="计划日期"/>--> - <el-input v-model="inParam.bz" type="search" placeholder="备注" ></el-input> - <el-button type="info" @click="updates2()" >批量</el-button> - <el-button type="success" @click="hdClick()">核对</el-button> - <!-- <el-button type="danger" @click="delOne('insert')">删除</el-button>--> - <el-button type="success" @click="saveOne()">保存</el-button> - <el-button type="success" @click="print()">打印</el-button> + + </el-col> </el-row> @@ -246,7 +251,7 @@ <el-container> <el-main> - <div class="mytableLfet" style="width: 60%"> + <div class="mytableLfet" style="width: 100%"> <vxe-grid id="id" @@ -275,32 +280,32 @@ </div> - <div class="mytableLfet" style="width: 40%"> - - <vxe-grid - id="id1" - ref="xGrid1" - border - resizable - keep-source - :scroll-y="{enabled: true}" - :height="height" - :columns="tableColumn2" - :data="tableTwo" - :custom-config="{storage: true}" - :edit-config="{trigger: 'click', mode: 'cell', showStatus: true,showIcon:false}" - highlight-hover-row - show-overflow - highlight-current-row - :header-cell-style="{'text-align':'center'}" - > - <!-- <template #operation="{ row }">--> - <!-- <vxe-button type="text" icon="vxe-icon--plus" @click="openMat(row)" />--> - <!-- </template>--> - </vxe-grid> - <!-- <el-button type="success" @click="addTwo()">增加</el-button>--> - <!-- <el-button type="danger" @click="delTwo('insert')">删除</el-button>--> - </div> +<!-- <div class="mytableLfet" style="width: 40%">--> + +<!-- <vxe-grid--> +<!-- id="id1"--> +<!-- ref="xGrid1"--> +<!-- border--> +<!-- resizable--> +<!-- keep-source--> +<!-- :scroll-y="{enabled: true}"--> +<!-- :height="height"--> +<!-- :columns="tableColumn2"--> +<!-- :data="tableTwo"--> +<!-- :custom-config="{storage: true}"--> +<!-- :edit-config="{trigger: 'click', mode: 'cell', showStatus: true,showIcon:false}"--> +<!-- highlight-hover-row--> +<!-- show-overflow--> +<!-- highlight-current-row--> +<!-- :header-cell-style="{'text-align':'center'}"--> +<!-- >--> +<!-- <!– <template #operation="{ row }">–>--> +<!-- <!– <vxe-button type="text" icon="vxe-icon--plus" @click="openMat(row)" />–>--> +<!-- <!– </template>–>--> +<!-- </vxe-grid>--> +<!-- <!– <el-button type="success" @click="addTwo()">增加</el-button>–>--> +<!-- <!– <el-button type="danger" @click="delTwo('insert')">删除</el-button>–>--> +<!-- </div>--> </el-main> </el-container> </el-container> @@ -319,7 +324,17 @@ import { saveSljhPgdXd, saveSljhPgdXdBack, saveSljhFk, - getPgdBase, saveSljhPg, saveSljhPgBack, getKcAndSljh, kcAdnSlBd, kcAdnSlZx, getydjhByid, getKcAndSljh1, slPrint + getPgdBase, + saveSljhPg, + saveSljhPgBack, + getKcAndSljh, + kcAdnSlBd, + kcAdnSlZx, + getydjhByid, + getKcAndSljh1, + slPrint, + kcAdnSlBd1, + kcAdnSlBd2 } from '@/api/jhzxgl/pgd' import { mapGetters } from 'vuex' import XEUtils from 'xe-utils' @@ -636,8 +651,8 @@ export default { { title: '套料图号', width: "120px", - field: 'dcTh', - + field: 'dcth', + editRender: { name: 'input' }, filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }], filterRender: { name: 'FilterCombination' }, }, @@ -1057,29 +1072,75 @@ export default { return } // this.bdbs='01' 核对 标识 等于 01 不能继续核对 - if(this.inParam.dcch !==''){ - this.queryParam.dcch=this.inParam.dcch + if(this.inParam.dcch ===''){ + this.$message({ message: '请输入需求船号', type: 'warning' }) + return } - this.initList().then(res=>{ - if(this.inParam.pl !=='') { - this.queryParam.xqpl = this.inParam.pl - } - 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()) + if(this.inParam.dcpl ===''){ + this.$message({ message: '请输入需求批量', type: 'warning' }) + return + } + let obj =this.$refs.xGrid.getTableData().visibleData; + if(obj.length<=0){ + this.$message({ message: '页面无数据', type: 'warning' }) + } + kcAdnSlBd2({ + "data1":this.$refs.xGrid.getTableData().visibleData, + "dcch":this.inParam.dcch, + "dcpl":this.inParam.dcpl, + }).then(res=>{ + if(res.success){ + let array1 = this.$refs.xGrid.getTableData().visibleData + let array2=res.data.slkcs + console.log(array1) + console.log(array2) + array1.forEach(item1 => { + this.$refs.xGrid.setCheckboxRow(item1,false) + + 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.dcth = item2.dcth + + // item1.dhh = item2.sljhrq + + this.$refs.xGrid.setCheckboxRow(item1,true) + return + + } + }); + }); + } }) + // this.initList().then(res=>{ + // if(this.inParam.pl !=='') { + // this.queryParam.xqpl = this.inParam.pl + // } + // 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()) + // }) }, @@ -1160,15 +1221,15 @@ export default { } - kcAdnSlZx({ + kcAdnSlBd1( // "data1":this.$refs.xGrid.getTableData().visibleData, // "data2":this.$refs.xGrid1.getTableData().visibleData - "data1":this.$refs.xGrid.getUpdateRecords(), - "data2":this.$refs.xGrid1.getUpdateRecords() - }).then((res) => { + this.$refs.xGrid.getUpdateRecords(), + + ).then((res) => { // if(res.success){ this.initList() - this.initList1() + //} })