| | |
| | | import Sortable from 'sortablejs' |
| | | import BasicTable from '@/components/basic/BasicTable.vue' |
| | | import {VXETable} from "vxe-table"; |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | |
| | | let productGlassTypeStore = useProductGlassTypeStore() |
| | | let router = useRouter() |
| | | const userStore = useUserInfoStore() |
| | | const username = userStore.user.userName |
| | | const getTableRow = (row, type) => { |
| | | switch (type) { |
| | | case 'edit' : { |
| | |
| | | } |
| | | } |
| | | |
| | | let flag = $ref(true) |
| | | function intoCreateProduct(){ |
| | | if(flag){ |
| | | router.push(`/main/processCard/SplittingDetails?orderId=${orderId}`) |
| | | }else { |
| | | router.push('/main/processCard/SplittingDetails?orderId=${orderId}') |
| | | } |
| | | flag=!flag |
| | | } |
| | | |
| | | //定义时间 |
| | | const form = reactive({ |
| | |
| | | let filterData = ref({ |
| | | product: { |
| | | thickness: '', |
| | | totalThickness:'' |
| | | totalThickness: '' |
| | | }, |
| | | orderDetail: { |
| | | orderNumber: '', |
| | | height: '', |
| | | computeGrossArea: '', |
| | | quantity: '', |
| | | shape:'', |
| | | width:'', |
| | | weight:'' |
| | | binningQuantity: '', |
| | | shape: '', |
| | | width: '', |
| | | weight: '' |
| | | } |
| | | |
| | | }) |
| | |
| | | request.post(`/processCard/selectNoCard/${orderId}/${productionId}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | //console.log(res.data) |
| | | console.log(res.data) |
| | | pageTotal.value = res.data.total |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | xGrid.value.reloadData(produceList) |
| | |
| | | // 手动触发筛选 |
| | | $panel.changeOption(event, !!option.data, option) |
| | | } |
| | | |
| | | function padLeftZero(str) { |
| | | return ('00' + str).substr(str.length) |
| | | } |
| | | |
| | | function filterChanged(column) { |
| | | gridOptions.loading = true |
| | | //筛选条件发生变化条件发生变化 |
| | |
| | | |
| | | |
| | | request.post(`/processCard/selectNoCard/${orderId}/${productionId}`, filterData.value).then((res) => { |
| | | if(res.code==200){ |
| | | pageTotal.value=res.data.total |
| | | if (res.code == 200) { |
| | | |
| | | pageTotal.value = res.data.total |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | |
| | | //右侧子组件接收参数 |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮 |
| | | stripe: true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 30},//鼠标移动或选择高亮 |
| | | id: 'CustomerList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | scrollY: {enabled: true},//开启虚拟滚动 |
| | | showOverflow: true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | |
| | | mode: 'row', |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns:[ |
| | | columns: [ |
| | | {type: 'checkbox', fixed: "left", title: '选择'}, |
| | | {field: 'orderNumber', title: '订序',filters:[{ data: '' }],slots: { filter: 'num1_filter' } }, |
| | | {field: 'shape', title: '形状', showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'width', title: '宽', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'height', title: '高',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'baiscQuantity', title: '数量', showOverflow:"ellipsis"}, |
| | | {field: 'computeGrossArea', title: '面积'}, |
| | | {field: 'orderNumber', title: '订序', filters: [{data: ''}], slots: {filter: 'num1_filter'}}, |
| | | {field: 'shape', title: '形状', showOverflow: "ellipsis", filters: [{data: ''}], slots: {filter: 'num1_filter'}}, |
| | | {field: 'width', title: '宽', filters: [{data: ''}], slots: {filter: 'num1_filter'}}, |
| | | {field: 'height', title: '高', filters: [{data: ''}], slots: {filter: 'num1_filter'}}, |
| | | {field: 'baiscQuantity', title: '待分数量', showOverflow: "ellipsis"}, |
| | | {field: 'computeGrossArea', title: '待分面积'}, |
| | | {field: 'totalThickness', title: '总厚度'}, |
| | | {field: 'thickness', title: '玻璃厚度'}, |
| | | {field: 'weight', title: '重量'} |
| | |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | |
| | | ],//table body实际数据 |
| | | data: [],//table body实际数据 |
| | | //脚部求和 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | let footList=['总数量','总面积','分箱数'] |
| | | return[ |
| | | footerMethod({columns, data}) {//页脚函数 |
| | | let footList = ['baiscQuantity', 'computeGrossArea', 'totalThickness','thickness', 'weight'] |
| | | return [ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | |
| | | //左侧子组件接收参数 |
| | | const xGridLeft = ref() |
| | | const gridLeftOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮 |
| | | stripe: true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 30},//鼠标移动或选择高亮 |
| | | id: 'CustomerList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | scrollY: {enabled: true},//开启虚拟滚动 |
| | | showOverflow: true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | |
| | | mode: 'row', |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns:[ |
| | | columns: [ |
| | | {type: 'checkbox', fixed: "left", title: '选择'}, |
| | | {field: 'processId', title: '流程卡号',filters:[{ data: '' }],slots: { filter: 'num1_filter' },width:130 }, |
| | | {field: 'orderNumber', title: '订序', showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'landingSequence', title: '落架顺序', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'shape', title: '形状',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'width', title: '宽', showOverflow:"ellipsis"}, |
| | | {field: 'processId', title: '流程卡号', filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 130}, |
| | | { |
| | | field: 'orderNumber', |
| | | title: '订序', |
| | | showOverflow: "ellipsis", |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'} |
| | | }, |
| | | {field: 'landingSequence', title: '落架顺序', filters: [{data: ''}], slots: {filter: 'num1_filter'}}, |
| | | {field: 'shape', title: '形状', filters: [{data: ''}], slots: {filter: 'num1_filter'}}, |
| | | {field: 'width', title: '宽', showOverflow: "ellipsis"}, |
| | | {field: 'height', title: '高'}, |
| | | {field: 'quantity', title: '总数量'}, |
| | | {field: 'totalThickness', title: '总厚度'}, |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | | // buttons: [{ |
| | | // |
| | | // }], |
| | | buttons: [ |
| | | {code: 'saveFlowCard', name: '保存', status: 'primary', icon: 'vxe-icon-save'}, |
| | | ], |
| | | import: false, |
| | | export: true, |
| | | print: true, |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | |
| | | ],//table body实际数据 |
| | | data: [],//table body实际数据 |
| | | //脚部求和 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | let footList=['总数量','总面积','分箱数'] |
| | | return[ |
| | | footerMethod({columns, data}) {//页脚函数 |
| | | let footList = ['总数量', '总面积', '分箱数'] |
| | | return [ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | |
| | | const createProcessCard = () => { |
| | | const $grid = xGrid.value |
| | | const checkedList = $grid.getCheckboxRecords() |
| | | if(checkedList.length===0){ |
| | | if (checkedList.length === 0) { |
| | | ElMessage.warning("请先选择右侧数据") |
| | | return |
| | | } |
| | |
| | | const $gridLeft = xGridLeft.value |
| | | const leftData = $gridLeft.getTableData().fullData |
| | | let index = 1 |
| | | if(leftData.length!==0){ |
| | | index = leftData[0].landingSequence + 1 |
| | | if (leftData.length !== 0) { |
| | | index = leftData[0].landingSequence + 1 |
| | | //index = index.toString().padStart(2, '0') |
| | | } |
| | | const processId = productionId + index.toString().padStart(2, '0') |
| | |
| | | $grid.remove(checkedList) |
| | | } |
| | | |
| | | let checkedNum = ref('') |
| | | let checkedNum = ref('') |
| | | |
| | | //向右边表格添加数据 |
| | | const addRight = () => { |
| | | try{ |
| | | const addRight = () => { |
| | | try { |
| | | //左边表格定义 |
| | | const $gridLeft = xGridLeft.value |
| | | //右边表格定义 |
| | |
| | | //获取左边表格checkbox选中的数据 |
| | | const checkedList = $gridLeft.getCheckboxRecords() |
| | | //判断左边表格是否有选中的数据 |
| | | if(checkedList.length===0){ |
| | | if (checkedList.length === 0) { |
| | | ElMessage.warning("请先选择左侧数据") |
| | | return |
| | | } |
| | | const regex = /^(\d+|)$/; |
| | | if(!regex.test(checkedNum.value)){ |
| | | const regex = /^(\d+|)$/; |
| | | if (!regex.test(checkedNum.value)) { |
| | | ElMessage.warning("请输入正整数") |
| | | return |
| | | } |
| | | //判断正整数 |
| | | if(/^[1-9]\d*$/.test(checkedNum.value)){ |
| | | if (/^[1-9]\d*$/.test(checkedNum.value)) { |
| | | //对选中的左边表格数据进行循环 |
| | | checkedList.forEach((item)=> { |
| | | checkedList.forEach((item) => { |
| | | //判断可用数量是否大于等于输入的数量,不满足则抛出异常 |
| | | if(item.quantity <checkedNum.value) throw new Error("请输入小于等于可用数量的数字"); |
| | | if (item.quantity < checkedNum.value) throw new Error("请输入小于等于可用数量的数字"); |
| | | //左边表格可用数量减去输入的数量 |
| | | item.quantity = item.quantity-checkedNum.value |
| | | item.quantity = item.quantity - checkedNum.value |
| | | //右边表格数据 |
| | | let rightData = $grid.getTableData().fullData |
| | | //右边表格数据中查找当前数据下标 |
| | | let filterIndex = rightData.findIndex(item1 => item1.orderNumber === item.orderNumber) |
| | | //如果右边表格数据中存在当前数据则数量相加 |
| | | if (filterIndex>=0){ |
| | | rightData[filterIndex].baiscQuantity =rightData[filterIndex].baiscQuantity*1+ checkedNum.value*1 |
| | | if (filterIndex >= 0) { |
| | | rightData[filterIndex].baiscQuantity = rightData[filterIndex].baiscQuantity * 1 + checkedNum.value * 1 |
| | | //如果左边数量为0时删除此条数据 |
| | | if(item.quantity=== 0){ |
| | | if (item.quantity === 0) { |
| | | $gridLeft.remove(item) |
| | | } |
| | | }else { |
| | | } else { |
| | | //右边表格没有此条数据则往右边表格插入数据 |
| | | item.baiscQuantity = checkedNum.value |
| | | $grid.insert(item) |
| | | } |
| | | }) |
| | | }else if(checkedNum.value===''){//判断数量输入框有无输入数字 |
| | | } else if (checkedNum.value === '') {//判断数量输入框有无输入数字 |
| | | |
| | | checkedList.forEach((item)=> { |
| | | checkedList.forEach((item) => { |
| | | let rightData = $grid.getTableData().fullData |
| | | let filterIndex = rightData.findIndex(item1 => item1.orderNumber === item.orderNumber) |
| | | //无输入并且如果右边表格数据中存在当前数据则数量相加 |
| | | if(filterIndex>-1){ |
| | | rightData[filterIndex].baiscQuantity =rightData[filterIndex].baiscQuantity*1+ item.quantity*1 |
| | | }else{ |
| | | if (filterIndex > -1) { |
| | | rightData[filterIndex].baiscQuantity = rightData[filterIndex].baiscQuantity * 1 + item.quantity * 1 |
| | | } else { |
| | | $grid.insert(item) |
| | | } |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | } |
| | | catch (e){ |
| | | } catch (e) { |
| | | ElMessage.warning(e.message) |
| | | } |
| | | } |
| | | //向左边表格添加数据 |
| | | const addLeft = () => { |
| | | const addLeft = () => { |
| | | try { |
| | | //左边表格定义 |
| | | const $gridLeft = xGridLeft.value |
| | | //右边表格定义 |
| | | const $grid = xGrid.value |
| | | //获取右边表格checkbox选中的数据 |
| | | const checkedList = $grid.getCheckboxRecords() |
| | | //获取左边表格checkbox选中的数据 |
| | | const checkedListLeft = $gridLeft.getCheckboxRecords() |
| | | //判断右边表格是否有选中的数据 |
| | | if (checkedList.length === 0) { |
| | | ElMessage.warning("请先选择右侧数据") |
| | | return |
| | | } |
| | | if (checkedListLeft.length !== 1) { |
| | | ElMessage.warning("请先选择左侧一条数据") |
| | | return |
| | | } |
| | | const regex = /^(\d+|)$/; |
| | | if (!regex.test(checkedNum.value)) { |
| | | ElMessage.warning("请输入正整数") |
| | | return |
| | | } |
| | | //判断正整数 |
| | | if (/^[1-9]\d*$/.test(checkedNum.value)) { |
| | | checkedList.forEach((item) => { |
| | | //判断可用数量是否大于等于输入的数量,不满足则抛出异常 |
| | | if (item.baiscQuantity < checkedNum.value) throw new Error("请输入小于等于可用数量的数字"); |
| | | item.baiscQuantity = item.baiscQuantity - checkedNum.value |
| | | //左边表格数据 |
| | | let leftData = $gridLeft.getTableData().fullData |
| | | //左边表格数据中查找当前数据下标 |
| | | let filterIndex = leftData.findIndex(item1 => item1.orderNumber === item.orderNumber) |
| | | //如果右边表格数据中存在当前数据则数量相加 |
| | | if (filterIndex >= 0) { |
| | | leftData[filterIndex].quantity = leftData[filterIndex].quantity * 1 + checkedNum.value * 1 |
| | | |
| | | if (item.baiscQuantity === 0) { |
| | | $grid.remove(checkedList) |
| | | } |
| | | } else { |
| | | item.quantity = checkedNum.value |
| | | item.processId = checkedListLeft[0].processId |
| | | item.landingSequence = checkedListLeft[0].landingSequence |
| | | $gridLeft.insert(item) |
| | | } |
| | | |
| | | }) |
| | | } else if (checkedNum.value === '') {//判断数量输入框有无输入数字 |
| | | checkedList.forEach((item) => { |
| | | item.processId = checkedListLeft[0].processId |
| | | item.landingSequence = checkedListLeft[0].landingSequence |
| | | }) |
| | | $gridLeft.insertAt(checkedList) |
| | | $grid.remove(checkedList) |
| | | } |
| | | } catch (e) { |
| | | ElMessage.warning(e.message) |
| | | } |
| | | } |
| | | |
| | | //保存流程卡数据 |
| | | const gridEvents = { |
| | | toolbarButtonClick({code}) { |
| | | const $grid = xGridLeft.value |
| | | if ($grid) { |
| | | switch (code) { |
| | | case 'saveFlowCard': { |
| | | const $table = xGridLeft.value |
| | | const $tableRight = xGrid.value |
| | | if ($table) { |
| | | const selectRecords = $table.getCheckboxRecords() |
| | | const selectRight = $tableRight.getCheckboxRecords() |
| | | if (selectRecords.length === 0){ |
| | | ElMessage.warning("请先选择保存的数据") |
| | | return |
| | | } |
| | | if (selectRight.length > 0){ |
| | | ElMessage.warning("请先将右侧数据全部建立流程卡后保存") |
| | | return; |
| | | } |
| | | //console.log(selectRecords[0].quantity) |
| | | let flowCardData = ref({ |
| | | flowCard: selectRecords, |
| | | userName:username, |
| | | productionId:productionId |
| | | }) |
| | | |
| | | console.log(flowCardData.value) |
| | | request.post("/processCard/addFlowCard", flowCardData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | ElMessage.success("保存成功") |
| | | location.reload(); |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | |
| | | } |
| | | return; |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | <div class="header"> |
| | | |
| | | <el-button |
| | | style="float: left" |
| | | @click="intoCreateProduct" |
| | | id="searchButton1" |
| | | type="primary" |
| | | :icon="ArrowLeftBold" |
| | | round > |
| | | {{flag?'返回':'返回'}} |
| | | </el-button> |
| | | <el-button type="primary">保存分架</el-button> |
| | | <el-button type="primary">分架汇总</el-button> |
| | | <el-button type="primary">左侧全选</el-button> |
| | | <el-button type="primary">右侧全选</el-button> |
| | | </div> |
| | | <div class="common-layout"> |
| | | <el-container height="100%"> |
| | | <el-aside width="44%" style=""> |
| | | <div class="common-layout" style="height: 100%"> |
| | | <div class="header"> |
| | | |
| | | <el-button |
| | | style="float: left" |
| | | @click="intoCreateProduct" |
| | | id="searchButton1" |
| | | type="primary" |
| | | :icon="ArrowLeftBold" |
| | | round> |
| | | {{ flag ? '返回' : '返回' }} |
| | | </el-button> |
| | | <!-- <el-button type="primary">保存分架</el-button>--> |
| | | <!-- <el-button type="primary" :hidden="true">分架汇总</el-button>--> |
| | | <div style="width: 100px;"> |
| | | |
| | | </div> |
| | | </div> |
| | | <el-container height="600px"> |
| | | <el-aside width="44%" > |
| | | <vxe-grid |
| | | max-height="100%" |
| | | @filter-change="filterChanged" |
| | | class="mytable-scrollbar" |
| | | ref="xGridLeft" |
| | | v-bind="gridLeftOptions" |
| | | v-on="gridEvents" |
| | | > |
| | | <!-- @toolbar-button-click="toolbarButtonClickEvent"--> |
| | | <!-- 下拉显示所有信息插槽--> |
| | |
| | | <ul class="expand-wrapper"> |
| | | <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined "> |
| | | <span style="font-weight: bold">{{ item.title + ': ' }}</span> |
| | | <span v-if="hasDecimal(item.field)">{{ row[item.field.split('.')[0]][item.field.split('.')[1]] }}</span> |
| | | <span v-if="hasDecimal(item.field)">{{ |
| | | row[item.field.split('.')[0]][item.field.split('.')[1]] |
| | | }}</span> |
| | | <span v-else>{{ row[item.field] }}</span> |
| | | </li> |
| | | </ul> |
| | |
| | | </el-aside> |
| | | |
| | | <el-main width="12%" style=""> |
| | | <span>未分数量:45</span><br> |
| | | <span>未分重量:333</span><br> |
| | | <span>选中数量:<el-input type="number" v-model="checkedNum"></el-input></span><br> |
| | | <el-button type="primary" @click="addRight"> → </el-button> |
| | | <el-button type="primary" @click="addRight"> →</el-button> |
| | | <br> |
| | | <br> |
| | | <el-button type="primary" @click="addLeft"> ← </el-button> |
| | | <el-button type="primary" @click="addLeft"> ←</el-button> |
| | | <br> |
| | | <br> |
| | | <el-button @click="createProcessCard" type="primary">建立流程卡</el-button> |
| | | </el-main> |
| | | |
| | | <el-aside width="44%" style=""> |
| | | |
| | | <el-aside width="45%" height="500px" style=""> |
| | | <vxe-grid |
| | | max-height="100%" |
| | | |
| | | max-height="97%" |
| | | @filter-change="filterChanged" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | |
| | | <ul class="expand-wrapper"> |
| | | <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined "> |
| | | <span style="font-weight: bold">{{ item.title + ': ' }}</span> |
| | | <span v-if="hasDecimal(item.field)">{{ row[item.field.split('.')[0]][item.field.split('.')[1]] }}</span> |
| | | <span v-if="hasDecimal(item.field)">{{ |
| | | row[item.field.split('.')[0]][item.field.split('.')[1]] |
| | | }}</span> |
| | | <span v-else>{{ row[item.field] }}</span> |
| | | </li> |
| | | </ul> |
| | |
| | | </template> |
| | | |
| | | <style scoped> |
| | | .common-layout{ |
| | | .common-layout { |
| | | height: 100%; |
| | | } |
| | | |
| | | .el-aside{ |
| | | .header{ |
| | | width: 100%; |
| | | height: 35px; |
| | | margin-top: -20px; |
| | | } |
| | | |
| | | .el-aside { |
| | | height: 100%; |
| | | } |
| | | |
| | | .el-main{ |
| | | .el-main { |
| | | height: 100%; |
| | | text-align: center; |
| | | } |
| | | |
| | | |
| | | |
| | | </style> |
| | |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | {title: '操作', width: 80, slots: { default: 'button_slot' },fixed:"left"}, |
| | | { type: 'seq',fixed:"left", title: '自序', width: 50 }, |
| | | {field: 'order.orderId', title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, }, |
| | | {field: 'order.customerName', title: '客户名称', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.project', title: '项目名称', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.batch', title: '批次',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'order.otherRemarks', title: '原片要求', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: 'order.icon', title: '商标选项', sortable: true}, |
| | | {field: 'order.orderType', title: '订单类型', sortable: true}, |
| | | {field: 'order.salesman', title: '业务员', sortable: true}, |
| | | {field: 'order.processingNote', title: '加工要求', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: 'order.deliveryAddress', title: '送货地址', sortable: true}, |
| | | {field: 'order.orderId', title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' } , }, |
| | | {field: 'order.customerName', title: '客户名称',showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.project', title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.batch', title: '批次',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, }, |
| | | {field: 'order.otherRemarks', title: '原片要求' ,showOverflow:"ellipsis",filters:[{ data: '' },],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.icon', title: '商标选项',filters:[{ data: '' }],slots: { filter: 'num1_filter' } }, |
| | | {field: 'order.orderType', title: '订单类型',filters:[{ data: '' }],slots: { filter: 'num1_filter' } }, |
| | | {field: 'order.salesman', title: '业务员',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.processingNote', title: '加工要求',showOverflow:"ellipsis"}, |
| | | {field: 'order.deliveryAddress', title: '送货地址',}, |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | |
| | | ElMessage.success("排版成功") |
| | | location.reload(); |
| | | } else { |
| | | console.log(res.code) |
| | | |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | |
| | | let filterData = ref({ |
| | | |
| | | orderGlassDetail: { |
| | | productName: '', |
| | | computeArea: '', |
| | | quantity: '', |
| | | computeGrossArea: '', |
| | | perimeter: '', |
| | | bendRadius: '', |
| | | processingNote: '' |
| | | productionId: '', |
| | | }, |
| | | orderDetail:{ |
| | | orderDetail:'' |
| | | orderDetail:{ |
| | | orderId:'', |
| | | productId:'', |
| | | productName:'', |
| | | } |
| | | |
| | | |
| | | }) |
| | | //定义页面总页数 |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | console.log(filterData.value) |
| | | request.post(`/processCard/detailsSelect/${id}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | pageTotal.value = res.data.total |
| | |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | {title: '操作', width: 80, slots: { default: 'button_slot' },fixed:"left"}, |
| | | { type: 'seq',fixed:"left", title: '自序', width: 50 }, |
| | | {field: 'orderId', title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, }, |
| | | {field: 'productionId', title: '生产订单号', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'productId', title: '产品编号', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'productName', title: '产品名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'quantity', title: '总数量', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: 'computeGrossArea', title: '总面积', sortable: true}, |
| | | {field: 'perimeter', title: '周长', sortable: true}, |
| | | {field: 'orderId', title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, }, |
| | | {field: 'orderGlassDetail.productionId', title: '生产订单号', showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderDetail.productId', title: '产品编号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderDetail.productName', title: '产品名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' },}, |
| | | {field: 'orderDetail.quantity', title: '总数量',showOverflow:"ellipsis"}, |
| | | {field: 'orderDetail.computeGrossArea', title: '总面积', }, |
| | | {field: 'orderDetail.perimeter', title: '周长',}, |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | | // buttons: [{ |
| | | // |
| | | // }], |
| | | import: false, |
| | | export: true, |
| | | print: true, |
| | | // import: false, |
| | | // export: true, |
| | | // print: true, |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: null,//表格数据 |
| | | //脚部求和 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | let footList=['总数量','总面积'] |
| | | console.log(columns,data) |
| | | let footList=['data.orderDetail.quantity','data.orderDetail.computeGrossArea'] |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.sql.Date; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @RequestMapping("/processCard") |
| | |
| | | |
| | | public Result DetailsSelect( |
| | | @PathVariable String orderId, |
| | | @RequestBody OrderDetail orderDetail){ |
| | | return Result.seccess(flowCardService.DetailsSelectSv(orderId,orderDetail)); |
| | | @RequestBody FlowCard flowCard){ |
| | | return Result.seccess(flowCardService.DetailsSelectSv(orderId,flowCard)); |
| | | |
| | | } |
| | | |
| | |
| | | public Result SelectNoCard( |
| | | @PathVariable String orderId, |
| | | @PathVariable String productionId, |
| | | @RequestBody OrderDetail orderDetail){ |
| | | return Result.seccess(flowCardService.SelectNoCardSv(orderId,productionId,orderDetail)); |
| | | @RequestBody FlowCard flowCard){ |
| | | return Result.seccess(flowCardService.SelectNoCardSv(orderId,productionId,flowCard)); |
| | | |
| | | } |
| | | |
| | | //添加流程卡 |
| | | @PostMapping("/addFlowCard") |
| | | public Result AddOrderWork( @RequestBody Map<String,Object> object){ |
| | | System.out.println("obj:"+object); |
| | | if(flowCardService.AddFlowCardSv(object)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"保存失败"); |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | //工艺确认序号 |
| | | private Integer technologyNumber; |
| | | //分架数量 |
| | | private Integer binningQuantity; |
| | | private Integer quantity; |
| | | //已优化数量 |
| | | private Integer optimizeQuantity; |
| | | //排版状态 |
| | |
| | | |
| | | import java.sql.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | public interface FlowCardMapper { |
| | |
| | | List<FlowCard> selectFlowCardMp(Date selectTime1, Date selectTime2, FlowCard flowCard); |
| | | |
| | | //分架明细查询 |
| | | List<OrderDetail> DetailsSelectMp(String orderId, OrderDetail orderDetail); |
| | | List<FlowCard> DetailsSelectMp(String orderId, FlowCard flowCard); |
| | | |
| | | //删除工单 |
| | | Boolean DeleteFlowCardMp(String orderId, String processId); |
| | | |
| | | //分架新增明细查询 |
| | | List<OrderDetail> SelectNoCardMp(String orderId, String productionId, OrderDetail orderDetail); |
| | | List<Map<String,String>> SelectNoCardMp(String orderId, String productionId, FlowCard flowCard); |
| | | |
| | | //修改排版状态 |
| | | Boolean UpdateLayoutStatusMp(String processId); |
| | |
| | | Integer SelectLayoutStatus(String processId); |
| | | |
| | | Integer ReportingWorkCount(String processId); |
| | | |
| | | Boolean AddFlowCardMp(String processId, Integer orderNumber, Integer landingSequence, Integer quantity, String productionId, String userName); |
| | | |
| | | Boolean UpdateFlowState(String productionId, Integer orderNumber); |
| | | |
| | | Integer SelectFlowCount(String productionId); |
| | | |
| | | |
| | | Boolean UpdateProcessingCard(String productionId, int state); |
| | | |
| | | Boolean UpdateDeleteState(String orderId, String processId); |
| | | } |
| | |
| | | |
| | | package com.example.erp.service.pp; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.entity.sd.Order; |
| | |
| | | |
| | | import java.sql.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | |
| | | } |
| | | |
| | | //分架明细查询 |
| | | public Map<String, Object> DetailsSelectSv(String orderId, OrderDetail orderDetail) { |
| | | public Map<String, Object> DetailsSelectSv(String orderId, FlowCard flowCard) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", flowCardMapper.DetailsSelectMp(orderId, orderDetail)); |
| | | map.put("data", flowCardMapper.DetailsSelectMp(orderId, flowCard)); |
| | | return map; |
| | | } |
| | | |
| | |
| | | if (!orderId.isEmpty() && !processId.isEmpty()) { |
| | | Integer count=flowCardMapper.ReportingWorkCount(processId); |
| | | if (count==0){ |
| | | //修改分架状态 |
| | | flowCardMapper.UpdateDeleteState(orderId, processId); |
| | | //删除分架明细 |
| | | flowCardMapper.DeleteFlowCardMp(orderId, processId); |
| | | return true; |
| | | } |
| | |
| | | } |
| | | |
| | | //分架新增明细查询 |
| | | public Map<String, Object> SelectNoCardSv(String orderId, String productionId, OrderDetail orderDetail) { |
| | | public Map<String, Object> SelectNoCardSv(String orderId, String productionId, FlowCard flowCard) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", flowCardMapper.SelectNoCardMp(orderId, productionId, orderDetail)); |
| | | map.put("data", flowCardMapper.SelectNoCardMp(orderId, productionId, flowCard)); |
| | | return map; |
| | | } |
| | | |
| | |
| | | |
| | | if (!processId.isEmpty()) { |
| | | Integer Status = flowCardMapper.SelectLayoutStatus(processId); |
| | | if (Status == 0) { |
| | | if (Status == 1) { |
| | | flowCardMapper.UpdateLayoutStatusMp(processId); |
| | | } else { |
| | | return false; |
| | |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | public Boolean AddFlowCardSv(Map<String, Object> object) { |
| | | String userName = ""; |
| | | if (object.get("userName") != null) { |
| | | userName = object.get("userName").toString(); |
| | | } |
| | | |
| | | String productionId = ""; |
| | | if (object.get("productionId") != null) { |
| | | productionId = object.get("productionId").toString(); |
| | | } |
| | | |
| | | List<FlowCard> FlowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("flowCard")), FlowCard.class); |
| | | if (!FlowCardList.isEmpty()) { |
| | | for (FlowCard flowCard : FlowCardList) { |
| | | //添加流程卡数据 |
| | | flowCardMapper.AddFlowCardMp(flowCard.getProcessId(),flowCard.getOrderNumber(),flowCard.getLandingSequence(),flowCard.getQuantity(),productionId,userName); |
| | | //修改分架状态,将状态改为1 |
| | | flowCardMapper.UpdateFlowState(productionId,flowCard.getOrderNumber()); |
| | | //查询该订单未分架数量 |
| | | Integer FlowCount= flowCardMapper.SelectFlowCount(productionId); |
| | | |
| | | if (FlowCount==0){ |
| | | //修改订单表分架状态为2 |
| | | System.out.println("我来试试1"); |
| | | flowCardMapper.UpdateProcessingCard(productionId,2); |
| | | } |
| | | else{ |
| | | //修改订单表分架状态为1,未全部分架完成 |
| | | System.out.println("我来试试2"); |
| | | flowCardMapper.UpdateProcessingCard(productionId,1); |
| | | } |
| | | } |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | public Map<String, Object> AddDateWork(String orderId, OrderDetail orderDetail) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | |
| | | map.put("data", workOrderMapper.addWordOrder(orderId, orderDetail)); |
| | | return map; |
| | | } |
| | |
| | | |
| | | if (!orderDetaillist.isEmpty()) { |
| | | for (OrderDetail orderDetail : orderDetaillist) { |
| | | //生成生产订单号 |
| | | |
| | | for (int i = 0; i < count; i++) { |
| | | letters = lettr++; |
| | | productIdVl = orderID + letters; |
| | | //查询生成的生产订单号是否存在 |
| | | |
| | | Integer workCount = workOrderMapper.SelectOrderNumber(productIdVl); |
| | | if (workCount < 1) { |
| | | System.out.println("生产订单号:" + productIdVl + " 查询结果:" + workCount); |
| | | if (workCount < 1 ) { |
| | | break; |
| | | } |
| | | |
| | | } |
| | | System.out.println(productIdVl); |
| | | |
| | | //添加生产订单 |
| | | workOrderMapper.AddOrderWorkMp(productIdVl, orderDetail.getOrderId(), orderDetail.getProductId(), orderDetail.getProductName(), userName); |
| | | Integer State = 2; |
| | | Integer States = 1; |
| | | //查询该订单未转生产订单的条数 |
| | | Integer NoWorkCount = workOrderMapper.SelectWorkCount(orderDetail.getOrderId()); |
| | | System.out.println(NoWorkCount); |
| | | if (NoWorkCount == 0) { |
| | | //条数为0修改转生产订单状态为2,否则为1 |
| | | workOrderMapper.UpdateWorkType(orderDetail.getOrderId(), State); |
| | | } else { |
| | | workOrderMapper.UpdateWorkType(orderDetail.getOrderId(), States); |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.example.erp.mapper.pp.FlowCardMapper"> |
| | | <resultMap id="flowCardMap" type="com.example.erp.entity.pp.FlowCard"> |
| | | <result column="order_id" property="orderId"/> |
| | | <result column="process_Id" property="processId"/> |
| | | <result column="quantity" property="quantity"/> |
| | | <result column="founder" property="founder"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <!--接收其他外键实体类数据--> |
| | | <association property="order" javaType="com.example.erp.entity.sd.Order"> |
| | | <result column="project" property="project"/> |
| | | <result column="order_id" property="orderId"/> |
| | | <result column="customer_name" property="customerName"/> |
| | | <result column="batch" property="batch"/> |
| | | <result column="other_remarks" property="otherRemarks"/> |
| | | <result column="icon" property="icon"/> |
| | | <result column="order_type" property="orderType"/> |
| | | <result column="salesman" property="salesman"/> |
| | | <result column="processing_note" property="processingNote"/> |
| | | <result column="delivery_address" property="deliveryAddress"/> |
| | | </association> |
| | | <association property="orderDetail" javaType="com.example.erp.entity.sd.OrderDetail"> |
| | | <result column="product_id" property="productId"/> |
| | | <result column="product_name" property="productName"/> |
| | | <result column="compute_gross_area" property="computeGrossArea"/> |
| | | <result column="processing_note" property="processingNote"/> |
| | | <result column="quantity" property="quantity"/> |
| | | <result column="compute_gross_area" property="computeGrossArea"/> |
| | | <result column="perimeter" property="perimeter"/> |
| | | <result column="order_number" property="orderNumber"/> |
| | | <result column="width" property="width"/> |
| | | <result column="height" property="height"/> |
| | | <result column="shape" property="shape"/> |
| | | <result column="weight" property="weight"/> |
| | | </association> |
| | | <association property="orderGlassDetail" javaType="com.example.erp.entity.sd.OrderGlassDetail"> |
| | | <result column="production_id" property="productionId"/> |
| | | </association> |
| | | <association property="product" javaType="com.example.erp.entity.sd.Product"> |
| | | <result column="total_thickness" property="totalThickness"/> |
| | | <result column="thickness" property="thickness"/> |
| | | </association> |
| | | |
| | | <!--<result column="g_typeId" property="glassTypes.typeId"/> |
| | | <result column="g_type" property="glassTypes.type"/>--> |
| | | |
| | | </resultMap> |
| | | <!-- 流程卡管理查询--> |
| | | <select id="selectFlowCard" resultMap="flowCardMap"> |
| | | select |
| | | a.order_Id, |
| | | a.process_Id, |
| | | c.product_id, |
| | | c.product_name, |
| | | b.project, |
| | | a.quantity, |
| | | c.compute_gross_area, |
| | | a.founder, |
| | | c.processing_note |
| | | from flow_card as a left join sd.`order` as b on a.order_Id=b.order_id |
| | | left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number |
| | | where a.create_time between #{selectTime1} and #{selectTime2} |
| | | <if test="flowCard.orderId != null and flowCard.orderId != ''"> |
| | | and a.order_id regexp #{flowCard.orderId} |
| | | </if> |
| | | <if test="flowCard.productionId != null and flowCard.productionId != ''"> |
| | | and a.process_Id regexp #{flowCard.productionId} |
| | | </if> |
| | | <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''"> |
| | | and c.product_id regexp #{flowCard.orderDetail.productId} |
| | | </if> |
| | | <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName!= ''"> |
| | | and c.product_name regexp #{flowCard.orderDetail.productName} |
| | | </if> |
| | | |
| | | <if test="flowCard.order.project != null and flowCard.order.project!= ''"> |
| | | and b.project regexp #{flowCard.order.project} |
| | | </if> |
| | | |
| | | |
| | | group by a.process_Id; |
| | | </select> |
| | | |
| | | <!--分架查询--> |
| | | <select id="selectFlowCardMp" resultMap="flowCardMap"> |
| | | select o.order_id, |
| | | o.customer_name, |
| | | o.project, |
| | | o.batch, |
| | | o.other_remarks, |
| | | o.icon, |
| | | o.order_type, |
| | | o.salesman, |
| | | o.processing_note, |
| | | o.delivery_address |
| | | from sd.`order` as o |
| | | left join sd.order_glass_detail ogd on o.order_id = ogd.order_id |
| | | where o.production_order=2 and ogd.splitting_status=0 and o.create_time between #{selectTime1} and #{selectTime2} |
| | | |
| | | <if test="flowCard.order.orderId != null and flowCard.order.orderId != ''"> |
| | | and o.order_id, regexp #{flowCard.order.orderId} |
| | | </if> |
| | | <if test="flowCard.order.customerName != null and flowCard.order.customerName != ''"> |
| | | and o.customer_name regexp #{flowCard.order.customerName} |
| | | </if> |
| | | <if test="flowCard.order.project != null and flowCard.order.project != ''"> |
| | | and o.project regexp #{flowCard.order.project} |
| | | </if> |
| | | <if test="flowCard.order.batch != null and flowCard.order.batch!= ''"> |
| | | and o.batch regexp #{flowCard.order.batch} |
| | | </if> |
| | | |
| | | <if test="flowCard.order.otherRemarks != null and flowCard.order.otherRemarks!= ''"> |
| | | and o.other_remarks regexp #{flowCard.order.otherRemarks} |
| | | </if> |
| | | |
| | | <if test="flowCard.order.icon != null and flowCard.order.icon!= ''"> |
| | | and o.icon regexp #{flowCard.order.icon} |
| | | </if> |
| | | <if test="flowCard.order.orderType != null and flowCard.order.orderType!= ''"> |
| | | and o.order_type regexp #{flowCard.order.orderType} |
| | | </if> |
| | | <if test="flowCard.order.salesman != null and flowCard.order.salesman!= ''"> |
| | | and o.salesman regexp #{flowCard.order.salesman} |
| | | </if> |
| | | group by o.order_id |
| | | |
| | | ; |
| | | </select> |
| | | |
| | | <!-- 分架明细查询--> |
| | | <select id="DetailsSelectMp" resultMap="flowCardMap"> |
| | | select od.order_id, |
| | | ogd.production_id, |
| | | od.product_id, |
| | | od.product_name, |
| | | SUM( od.quantity) as quantity, |
| | | SUM(od.compute_gross_area) as compute_gross_area, |
| | | od.perimeter |
| | | from sd.order_detail as od left join sd.order_glass_detail as ogd |
| | | on od.order_id=ogd.order_id and od.order_number=ogd.order_number |
| | | where od.order_id = #{orderId} and ogd.splitting_status=0 |
| | | <if test="flowCard.orderDetail.orderId != null and flowCard.orderDetail.orderId != ''"> |
| | | and od.order_id regexp #{flowCard.orderDetail.orderId} |
| | | </if> |
| | | <if test="flowCard.orderGlassDetail.productionId != null and flowCard.orderGlassDetail.productionId != ''"> |
| | | and ogd.production_id regexp #{flowCard.orderGlassDetail.productionId} |
| | | </if> |
| | | <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''"> |
| | | and od.product_id regexp #{flowCard.orderDetail.productId} |
| | | </if> |
| | | <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName != ''"> |
| | | and od.product_name regexp #{flowCard.orderDetail.productName} |
| | | </if> |
| | | group by od.order_id, ogd.production_id |
| | | </select> |
| | | |
| | | <update id="UpdateDeleteState"> |
| | | update sd.order_glass_detail as ogd |
| | | set ogd.production_id=null, |
| | | ogd.production_time=null, |
| | | ogd.founder=null |
| | | where ogd.production_id = #{processId} |
| | | |
| | | </update> |
| | | |
| | | <!-- 删除流程卡--> |
| | | <update id="DeleteFlowCardMp"> |
| | | update sd.order_detail as od left join sd.order_glass_detail as ogd |
| | | on od.order_id = ogd.order_id and od.order_number = ogd.order_number |
| | | set ogd.production_id=null, |
| | | ogd.production_time=null, |
| | | ogd.founder=null |
| | | where od.order_id = #{orderId} |
| | | and ogd.production_id = #{processId} |
| | | </update> |
| | | |
| | | <!-- 分架新增明细查询--> |
| | | |
| | | <!--resultMap="flowCardMap"--> |
| | | <select id="SelectNoCardMp" > |
| | | |
| | | select |
| | | od.order_number, |
| | | od.order_number AS 'orderNumber', |
| | | od.width, |
| | | od.height, |
| | | od.shape, |
| | | od.quantity, |
| | | od.compute_gross_area, |
| | | p.total_thickness, |
| | | od.quantity as baiscQuantity, |
| | | od.compute_gross_area as 'computeGrossArea', |
| | | p.total_thickness AS 'totalThickness', |
| | | p.thickness, |
| | | od.weight |
| | | from |
| | | sd.order_detail as od |
| | | left join sd.order_glass_detail as ogd on od.order_id=ogd.order_id and od.order_number=ogd.order_number |
| | | left join sd.product as p on od.product_name=p.product_name |
| | | where od.order_id=#{orderId} and ogd.production_id=#{productionId} and ogd.splitting_status=0 |
| | | GROUP BY od.order_number; |
| | | |
| | | |
| | | </select> |
| | | |
| | | <!--修改排版状态--> |
| | | <update id="UpdateLayoutStatusMp"> |
| | | update flow_card as fc |
| | | set fc.layout_status=2 |
| | | where fc.process_id = #{processId} |
| | | </update> |
| | | |
| | | <!-- 查询对应流程卡号排版状态--> |
| | | <select id="SelectLayoutStatus"> |
| | | select fc.layout_status |
| | | from flow_card as fc |
| | | where fc.process_id = #{processId} |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <!-- 查询报工表内是否有对应流程卡--> |
| | | <select id="ReportingWorkCount"> |
| | | select COUNT(rw.process_id) |
| | | from reporting_work as rw |
| | | where rw.process_id = #{processId} |
| | | </select> |
| | | <!-- 插入Flow_card表--> |
| | | <insert id="AddFlowCardMp"> |
| | | insert into |
| | | flow_card ( |
| | | order_id, |
| | | production_id, |
| | | process_id, |
| | | landing_sequence, |
| | | order_number, |
| | | technology_number, |
| | | quantity, |
| | | founder, |
| | | splitFrame_time, |
| | | create_time |
| | | ) |
| | | select |
| | | ogd.order_id, |
| | | ogd.production_id, |
| | | #{processId}, |
| | | #{landingSequence}, |
| | | ogd.order_number, |
| | | ogd.technology_number, |
| | | #{quantity}, |
| | | #{userName}, |
| | | NOW(), |
| | | NOW() |
| | | |
| | | |
| | | |
| | | from sd.order_glass_detail as ogd |
| | | where ogd.production_id=#{productionId} and ogd.order_number=#{orderNumber} |
| | | GROUP BY ogd.technology_number |
| | | </insert> |
| | | |
| | | <!-- 更新分架状态--> |
| | | <update id="UpdateFlowState"> |
| | | update sd.order_glass_detail as ogd |
| | | set ogd.splitting_status=1 |
| | | where ogd.production_id=#{productionId} and ogd.order_number=#{orderNumber} |
| | | </update> |
| | | <!-- 查询未分架的条数--> |
| | | <select id="SelectFlowCount"> |
| | | select COUNT(*) |
| | | from sd.order_glass_detail as ogd |
| | | where ogd.order_id = left(#{productionId},10) |
| | | and ogd.splitting_status = 0 |
| | | </select> |
| | | <!-- 修改订单表分架状态--> |
| | | <update id="UpdateProcessingCard"> |
| | | update sd.`order` as o |
| | | set o.processing_card=#{state} |
| | | where o.order_id=left(#{productionId},10) |
| | | </update> |
| | | </mapper> |
| | |
| | | |
| | | <select id="addWordOrder" > |
| | | select od.order_id, |
| | | od.product_id, |
| | | od.product_name, |
| | | od.quantity, |
| | | od.compute_gross_area, |
| | | od.perimeter |
| | | from order_detail as od |
| | | left join sd.order_glass_detail as ogd |
| | | on od.order_id = ogd.order_id |
| | | where od.order_id = #{orderId} and ISNULL(ogd.production_id) |
| | | od.product_id, |
| | | od.product_name, |
| | | sum( od.quantity) as quantity, |
| | | od.compute_gross_area, |
| | | od.perimeter |
| | | from sd.order_detail as od |
| | | left join sd.order as o |
| | | on od.order_id =o.order_id |
| | | where od.order_id = #{orderId} and o.production_order!=2 |
| | | <if test="orderDetail.orderId != null and orderDetail.orderId != ''"> |
| | | and od.order_id regexp #{orderDetail.orderId} |
| | | </if> |
| | |
| | | ; |
| | | </select> |
| | | |
| | | <select id="SelectOrderNumber" resultMap="wordOrderMap"> |
| | | select count(ogd.production_id) |
| | | <select id="SelectOrderNumber" > |
| | | select ifnull(count(ogd.production_id),0) |
| | | from sd.order_glass_detail as ogd |
| | | where ogd.production_id = #{productIdVl} |
| | | </select> |
| | |
| | | and od.product_name = #{productName} |
| | | </update> |
| | | |
| | | <!-- 删除工单--> |
| | | <update id="DeleteOrderWorkMp"> |
| | | update sd.order_detail as od left join sd.order_glass_detail as ogd |
| | | on od.order_id = ogd.order_id and od.order_number = ogd.order_number |
| | |
| | | <resultMap id="flowCardMap" type="com.example.erp.entity.pp.FlowCard"> |
| | | <result column="order_id" property="orderId"/> |
| | | <result column="process_Id" property="processId"/> |
| | | <result column="binning_quantity" property="binningQuantity"/> |
| | | <result column="quantity" property="quantity"/> |
| | | <result column="founder" property="founder"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <!--接收其他外键实体类数据--> |
| | |
| | | c.product_id, |
| | | c.product_name, |
| | | b.project, |
| | | a.binning_quantity, |
| | | a.quantity, |
| | | c.compute_gross_area, |
| | | a.founder, |
| | | c.processing_note |
| | |
| | | o.processing_note, |
| | | o.delivery_address |
| | | from sd.`order` as o |
| | | where o.production_order=2 and o.create_time between #{selectTime1} and #{selectTime2} |
| | | <!-- <where>--> |
| | | <!-- <if test="flowCard.orderId != null and flowCard.orderId != ''">--> |
| | | <!-- and a.order_id regexp #{flowCard.orderId}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="flowCard.productionId != null and flowCard.productionId != ''">--> |
| | | <!-- and a.process_Id regexp #{flowCard.productionId}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''">--> |
| | | <!-- and c.product_id regexp #{flowCard.orderDetail.productId}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName!= ''">--> |
| | | <!-- and c.product_name regexp #{flowCard.orderDetail.productName}--> |
| | | <!-- </if>--> |
| | | left join sd.order_glass_detail ogd on o.order_id = ogd.order_id |
| | | where o.production_order=2 and ogd.splitting_status=0 and o.create_time between #{selectTime1} and #{selectTime2} |
| | | |
| | | <!-- <if test="flowCard.order.project != null and flowCard.order.project!= ''">--> |
| | | <!-- and b.project regexp #{flowCard.order.project}--> |
| | | <!-- </if>--> |
| | | <if test="flowCard.order.orderId != null and flowCard.order.orderId != ''"> |
| | | and o.order_id, regexp #{flowCard.order.orderId} |
| | | </if> |
| | | <if test="flowCard.order.customerName != null and flowCard.order.customerName != ''"> |
| | | and o.customer_name regexp #{flowCard.order.customerName} |
| | | </if> |
| | | <if test="flowCard.order.project != null and flowCard.order.project != ''"> |
| | | and o.project regexp #{flowCard.order.project} |
| | | </if> |
| | | <if test="flowCard.order.batch != null and flowCard.order.batch!= ''"> |
| | | and o.batch regexp #{flowCard.order.batch} |
| | | </if> |
| | | |
| | | <if test="flowCard.order.otherRemarks != null and flowCard.order.otherRemarks!= ''"> |
| | | and o.other_remarks regexp #{flowCard.order.otherRemarks} |
| | | </if> |
| | | |
| | | <!-- </where>--> |
| | | <if test="flowCard.order.icon != null and flowCard.order.icon!= ''"> |
| | | and o.icon regexp #{flowCard.order.icon} |
| | | </if> |
| | | <if test="flowCard.order.orderType != null and flowCard.order.orderType!= ''"> |
| | | and o.order_type regexp #{flowCard.order.orderType} |
| | | </if> |
| | | <if test="flowCard.order.salesman != null and flowCard.order.salesman!= ''"> |
| | | and o.salesman regexp #{flowCard.order.salesman} |
| | | </if> |
| | | group by o.order_id |
| | | |
| | | ; |
| | | </select> |
| | | |
| | | <!-- 分架明细查询--> |
| | | <select id="DetailsSelectMp" resultMap="flowCardMap"> |
| | | select od.order_id, |
| | | ogd.production_id, |
| | | od.product_id, |
| | | od.product_name, |
| | | od.quantity, |
| | | od.compute_gross_area, |
| | | od.perimeter |
| | | from sd.order_detail as od |
| | | left join sd.order_glass_detail as ogd |
| | | on od.order_id = ogd.order_id and od.order_number = ogd.order_number |
| | | where od.order_id = #{orderId} |
| | | <!-- <if test="orderDetail.orderId != null and orderDetail.orderId != ''">--> |
| | | <!-- and od.order_id regexp #{orderDetail.orderId}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="flowCard.orderGlassDetail.productionId != null and flowCard.orderGlassDetail.productionId != ''">--> |
| | | <!-- and ogd.production_id regexp #{flowCard.orderGlassDetail.productionId}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="orderDetail.productId != null and orderDetail.productId != ''">--> |
| | | <!-- and od.product_id regexp #{orderDetail.productId}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="orderDetail.productName != null and orderDetail.productName != ''">--> |
| | | <!-- and od.product_name regexp #{orderDetail.productName}--> |
| | | <!-- </if>--> |
| | | ogd.production_id, |
| | | od.product_id, |
| | | od.product_name, |
| | | SUM( od.quantity) as quantity, |
| | | SUM(od.compute_gross_area) as compute_gross_area, |
| | | od.perimeter |
| | | from sd.order_detail as od left join sd.order_glass_detail as ogd |
| | | on od.order_id=ogd.order_id and od.order_number=ogd.order_number |
| | | where od.order_id = #{orderId} and ogd.splitting_status=0 |
| | | <if test="flowCard.orderDetail.orderId != null and flowCard.orderDetail.orderId != ''"> |
| | | and od.order_id regexp #{flowCard.orderDetail.orderId} |
| | | </if> |
| | | <if test="flowCard.orderGlassDetail.productionId != null and flowCard.orderGlassDetail.productionId != ''"> |
| | | and ogd.production_id regexp #{flowCard.orderGlassDetail.productionId} |
| | | </if> |
| | | <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''"> |
| | | and od.product_id regexp #{flowCard.orderDetail.productId} |
| | | </if> |
| | | <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName != ''"> |
| | | and od.product_name regexp #{flowCard.orderDetail.productName} |
| | | </if> |
| | | group by od.order_id, ogd.production_id |
| | | </select> |
| | | |
| | | <update id="UpdateDeleteState"> |
| | | update sd.order_glass_detail as ogd |
| | | set ogd.production_id=null, |
| | | ogd.production_time=null, |
| | | ogd.founder=null |
| | | where ogd.production_id = #{processId} |
| | | |
| | | <!-- 删除工单--> |
| | | </update> |
| | | |
| | | <!-- 删除流程卡--> |
| | | <update id="DeleteFlowCardMp"> |
| | | update sd.order_detail as od left join sd.order_glass_detail as ogd |
| | | on od.order_id = ogd.order_id and od.order_number = ogd.order_number |
| | |
| | | ogd.production_time=null, |
| | | ogd.founder=null |
| | | where od.order_id = #{orderId} |
| | | and od.product_name = #{productName} |
| | | and ogd.production_id = #{processId} |
| | | </update> |
| | | |
| | | <!-- 分架新增明细查询--> |
| | | <select id="SelectNoCardMp" resultMap="flowCardMap"> |
| | | |
| | | <!--resultMap="flowCardMap"--> |
| | | <select id="SelectNoCardMp" > |
| | | |
| | | select |
| | | od.order_number, |
| | | od.order_number AS 'orderNumber', |
| | | od.width, |
| | | od.height, |
| | | od.shape, |
| | | od.quantity, |
| | | od.compute_gross_area, |
| | | p.total_thickness, |
| | | od.quantity as baiscQuantity, |
| | | od.compute_gross_area as 'computeGrossArea', |
| | | p.total_thickness AS 'totalThickness', |
| | | p.thickness, |
| | | od.weight |
| | | from |
| | | sd.order_detail as od |
| | | left join sd.order_glass_detail as ogd on od.order_id=ogd.order_id and od.order_number=ogd.order_number |
| | | left join sd.product as p on od.product_name=p.product_name |
| | | where od.order_id=#{orderId}and ogd.production_id=#{productionId} and ogd.splitting_status=0 |
| | | <if test="flowCard.orderDetail.orderNumber != null and flowCard.orderDetail.orderNumber != ''"> |
| | | and od.order_number regexp #{flowCard.orderDetail.orderNumber} |
| | | </if> |
| | | <if test="flowCard.orderDetail.width != null and flowCard.orderDetail.width != ''"> |
| | | and od.width regexp #{flowCard.orderDetail.width} |
| | | </if> |
| | | <if test="flowCard.orderDetail.height != null and flowCard.orderDetail.height != ''"> |
| | | and od.height regexp #{flowCard.orderDetail.height} |
| | | </if> |
| | | <if test="flowCard.orderDetail.shape != null and flowCard.orderDetail.shape != ''"> |
| | | and od.shape regexp #{flowCard.orderDetail.shape} |
| | | |
| | | </if> |
| | | where od.order_id=#{orderId} and ogd.production_id=#{productionId} and ogd.splitting_status=0 |
| | | GROUP BY od.order_number; |
| | | |
| | | |
| | |
| | | <!--修改排版状态--> |
| | | <update id="UpdateLayoutStatusMp"> |
| | | update flow_card as fc |
| | | set fc.layout_status=1 |
| | | set fc.layout_status=2 |
| | | where fc.process_id = #{processId} |
| | | </update> |
| | | |
| | |
| | | from reporting_work as rw |
| | | where rw.process_id = #{processId} |
| | | </select> |
| | | <!-- 插入Flow_card表--> |
| | | <insert id="AddFlowCardMp"> |
| | | insert into |
| | | flow_card ( |
| | | order_id, |
| | | production_id, |
| | | process_id, |
| | | landing_sequence, |
| | | order_number, |
| | | technology_number, |
| | | quantity, |
| | | founder, |
| | | splitFrame_time, |
| | | create_time |
| | | ) |
| | | select |
| | | ogd.order_id, |
| | | ogd.production_id, |
| | | #{processId}, |
| | | #{landingSequence}, |
| | | ogd.order_number, |
| | | ogd.technology_number, |
| | | #{quantity}, |
| | | #{userName}, |
| | | NOW(), |
| | | NOW() |
| | | |
| | | |
| | | |
| | | from sd.order_glass_detail as ogd |
| | | where ogd.production_id=#{productionId} and ogd.order_number=#{orderNumber} |
| | | GROUP BY ogd.technology_number |
| | | </insert> |
| | | |
| | | <!-- 更新分架状态--> |
| | | <update id="UpdateFlowState"> |
| | | update sd.order_glass_detail as ogd |
| | | set ogd.splitting_status=1 |
| | | where ogd.production_id=#{productionId} and ogd.order_number=#{orderNumber} |
| | | </update> |
| | | <!-- 查询未分架的条数--> |
| | | <select id="SelectFlowCount"> |
| | | select COUNT(*) |
| | | from sd.order_glass_detail as ogd |
| | | where ogd.order_id = left(#{productionId},10) |
| | | and ogd.splitting_status = 0 |
| | | </select> |
| | | <!-- 修改订单表分架状态--> |
| | | <update id="UpdateProcessingCard"> |
| | | update sd.`order` as o |
| | | set o.processing_card=#{state} |
| | | where o.order_id=left(#{productionId},10) |
| | | </update> |
| | | </mapper> |
| | |
| | | |
| | | <select id="addWordOrder" > |
| | | select od.order_id, |
| | | od.product_id, |
| | | od.product_name, |
| | | od.quantity, |
| | | od.compute_gross_area, |
| | | od.perimeter |
| | | from order_detail as od |
| | | left join sd.order_glass_detail as ogd |
| | | on od.order_id = ogd.order_id |
| | | where od.order_id = #{orderId} and ISNULL(ogd.production_id) |
| | | od.product_id, |
| | | od.product_name, |
| | | sum( od.quantity) as quantity, |
| | | od.compute_gross_area, |
| | | od.perimeter |
| | | from sd.order_detail as od |
| | | left join sd.order as o |
| | | on od.order_id =o.order_id |
| | | where od.order_id = #{orderId} and o.production_order!=2 |
| | | <if test="orderDetail.orderId != null and orderDetail.orderId != ''"> |
| | | and od.order_id regexp #{orderDetail.orderId} |
| | | </if> |
| | |
| | | ; |
| | | </select> |
| | | |
| | | <select id="SelectOrderNumber" resultMap="wordOrderMap"> |
| | | select count(ogd.production_id) |
| | | <select id="SelectOrderNumber" > |
| | | select ifnull(count(ogd.production_id),0) |
| | | from sd.order_glass_detail as ogd |
| | | where ogd.production_id = #{productIdVl} |
| | | </select> |
| | |
| | | and od.product_name = #{productName} |
| | | </update> |
| | | |
| | | <!-- 删除工单--> |
| | | <update id="DeleteOrderWorkMp"> |
| | | update sd.order_detail as od left join sd.order_glass_detail as ogd |
| | | on od.order_id = ogd.order_id and od.order_number = ogd.order_number |