| | |
| | | <script setup> |
| | | |
| | | import {reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | let router=useRouter() |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/reportingWorks/ReportingWorkDetail', query: { id: row.id }}) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | | alert('我接收到子组件传送的删除信息') |
| | | break |
| | | } |
| | | case 'setType':{ |
| | | alert('我接收到子组件传送的反审状态') |
| | | break |
| | | } |
| | | } |
| | | } |
| | | import {useRouter} from 'vue-router' |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import {ElDatePicker, ElMessage} from "element-plus"; |
| | | import {useI18n} from 'vue-i18n' |
| | | import {changeFilterEvent, filterChanged} from "@/hook" |
| | | //语言获取 |
| | | const {t} = useI18n() |
| | | let router = useRouter() |
| | | let filterData = ref({}) |
| | | //提交的表单 |
| | | const form = reactive({ |
| | | date1: '', |
| | | orderId: '', |
| | | project: '' |
| | | }) |
| | | |
| | | //工序 |
| | | const value = ref('磨边') |
| | | |
| | | //表尾求和 |
| | | const sumNum = (list, field) => { |
| | |
| | | return count.toFixed(2) |
| | | } |
| | | |
| | | //子组件接收参数 |
| | | //定义滚动条高度 |
| | | let scrollTop = ref(null) |
| | | let scrollHeight = ref(null) |
| | | let clientHeight = ref(null) |
| | | const scrollEvnt = (row) => { |
| | | // 内容高度 |
| | | scrollTop.value = row.$event.target.scrollTop |
| | | scrollHeight.value = row.$event.target.scrollHeight |
| | | clientHeight.value = row.$event.target.clientHeight |
| | | } |
| | | |
| | | |
| | | //定义页面总页数 |
| | | let pageTotal = ref('') |
| | | //定义数据返回结果 |
| | | let produceList = ref([]) |
| | | //定义当前页数 |
| | | let pageNum = ref(1) |
| | | let pageState = null |
| | | |
| | | //获取七天前到当前时间 |
| | | function getNowTime() { |
| | | const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 7) |
| | | .toISOString() |
| | | .replace('T', ' ') |
| | | .slice(0, 10) //默认开始时间7天前 |
| | | const end = new Date(new Date().getTime() + 3600 * 1000 * 24) |
| | | .toISOString() |
| | | .replace('T', ' ') |
| | | .slice(0, 10)//默认结束时间当前时间 |
| | | return [start, end] |
| | | } |
| | | |
| | | |
| | | //第一次加载获取近七天时间和默认状态 |
| | | form.date1 = getNowTime() |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let total = reactive({ |
| | | pageTotal: 0, |
| | | dataTotal: 0, |
| | | pageSize: 100 |
| | | }) |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | | processType: [], |
| | | }) |
| | | //第一次加载数据 |
| | | request.post(`/report/damageReport/${startTime}/${endTime}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | // total.dataTotal = res.data.total.total*1 |
| | | // total.pageTotal= res.data.total.pageTotal |
| | | // pageTotal.value = res.data.total |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | |
| | | //页脚翻页查询 |
| | | const selectPageList = () => { |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | |
| | | request.post(`/report/selectReportingWork/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${inputVal}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | |
| | | |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //点击查询 |
| | | const getWorkOrder = () => { |
| | | |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | request.post(`/report/damageReport/${startTime}/${endTime}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | // total.dataTotal = res.data.total.total*1 |
| | | // total.pageTotal= res.data.total.pageTotal |
| | | // pageTotal.value = res.data.total |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //页脚跳转 |
| | | const handlePageChange = ({currentPage, pageSize}) => { |
| | | pageNum.value = currentPage |
| | | total.pageTotal = pageSize |
| | | selectPageList() |
| | | } |
| | | |
| | | |
| | | /*使用筛选,后端获取数据*/ |
| | | // const changeFilterEvent = (event, option, $panel,) => { |
| | | // // 手动触发筛选 |
| | | // $panel.changeOption(event, !!option.data, option) |
| | | // } |
| | | |
| | | // function filterChanged(column){ |
| | | // //gridOptions.loading=true |
| | | // //筛选条件发生变化条件发生变化 |
| | | // let value = column.datas[0]!=undefined?column.datas[0]:'' |
| | | // value = value.trim() |
| | | // //判断是否存在外键 |
| | | // if (column.property.indexOf('.')>-1){ |
| | | // const columnArr = column.property.split('.') |
| | | // filterData.value[columnArr[0]] = { |
| | | // [columnArr[1]]:value |
| | | // } |
| | | // }else{ |
| | | // filterData.value[column.property] = value |
| | | // } |
| | | // |
| | | // gridOptions.loading = true |
| | | // |
| | | // } |
| | | |
| | | /*后端返回结果多层嵌套展示*/ |
| | | const hasDecimal = (value) => { |
| | | const regex = /\./; // 定义正则表达式,查找小数点 |
| | | return regex.test(value); // 返回true/false |
| | | } |
| | | |
| | | //子组件接收参数 |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮 |
| | | stripe: true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 50},//鼠标移动或选择高亮 |
| | | id: 'CustomerList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | scrollY: {enabled: true},//开启虚拟滚动 |
| | | showOverflow: true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | // remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | |
| | | mode: 'row', |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | { type: 'seq',fixed:"left", title: '自序', width: 50 }, |
| | | {field: '1', width: 120, title: '报工时间',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, }, |
| | | {field: '2',width: 120, title: '工序', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: '3', width: 130,title: '责任班组', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: '4',width: 120, title: '责任设备',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '5', width: 100,title: '次破原因', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: '6', width: 100,title: '次破数量', sortable: true}, |
| | | {field: '7',width: 100, title: '次破面积', sortable: true}, |
| | | {field: '8',width: 120, title: '成品率', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: '9', width: 120,title: '项目名称', sortable: true}, |
| | | {field: '10', width: 120,title: '批次', sortable: true}, |
| | | {field: '11',width: 120, title: '销售单号', sortable: true}, |
| | | {field: '12',width: 120, title: '单品名称', sortable: true}, |
| | | {field: '13',width: 120, title: '产地', sortable: true}, |
| | | columns: [ |
| | | {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50}, |
| | | {type: 'seq', fixed: "left", title: '自序', width: 50}, |
| | | { |
| | | field: 'order_id', width: 120, title: '销售单号', filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'project', |
| | | width: 120, |
| | | title: '项目名称', |
| | | showOverflow: "ellipsis", |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'process_id', width: 130, title: '流程卡号', filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'order_number', width: 120, title: '订单序号', filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'technology_number', width: 100, title: '小片顺序', filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'reporting_work_time', |
| | | width: 100, |
| | | title: '报工时间', |
| | | type: 'date', |
| | | attrs: {placeholder: '', type: 'date'}, |
| | | }, |
| | | {field: 'responsible_process', width: 120, title: '责任工序', showOverflow: "ellipsis"}, |
| | | {field: 'responsible_team', width: 100, title: '责任班组'}, |
| | | {field: 'responsible_equipment', width: 120, title: '责任设备'}, |
| | | {field: 'breakage_type', width: 120, title: '次破类型'}, |
| | | {field: 'breakage_reason', width: 120, title: '次破原因'}, |
| | | {field: 'breakage_quantity', width: 120, title: '次破数量'}, |
| | | {field: 'area', width: 120, title: '次破面积'}, |
| | | {field: 'personnel', width: 120, title: '责任人员'}, |
| | | {field: 'glass_child', width: 120, title: '单片名称'}, |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | 1:'2023-01-01', |
| | | 2:'钢化', |
| | | 3:'钢化一班', |
| | | 4:'黑金刚', |
| | | 5:'机器', |
| | | 6:'1 ', |
| | | 7:'3.14', |
| | | 8:'89', |
| | | 9:'奔向幕墙', |
| | | 10:'一批', |
| | | 11:'NG20010101', |
| | | 12:'6mm超白平钢', |
| | | 13:'北方', |
| | | |
| | | }, |
| | | { |
| | | 1:'2023-01-01', |
| | | 2:'钢化', |
| | | 3:'钢化一班', |
| | | 4:'黑金刚', |
| | | 5:'机器', |
| | | 6:'1 ', |
| | | 7:'3.14', |
| | | 8:'89', |
| | | 9:'奔向幕墙', |
| | | 10:'一批', |
| | | 11:'NG20010101', |
| | | 12:'6mm超白平钢', |
| | | 13:'北方', |
| | | |
| | | }, |
| | | { |
| | | 1:'2023-01-01', |
| | | 2:'钢化', |
| | | 3:'钢化一班', |
| | | 4:'黑金刚', |
| | | 5:'机器', |
| | | 6:'1 ', |
| | | 7:'3.14', |
| | | 8:'89', |
| | | 9:'奔向幕墙', |
| | | 10:'一批', |
| | | 11:'NG20010101', |
| | | 12:'6mm超白平钢', |
| | | 13:'北方', |
| | | |
| | | }, |
| | | { |
| | | 1:'2023-01-01', |
| | | 2:'钢化', |
| | | 3:'钢化一班', |
| | | 4:'黑金刚', |
| | | 5:'机器', |
| | | 6:'1 ', |
| | | 7:'3.14', |
| | | 8:'89', |
| | | 9:'奔向幕墙', |
| | | 10:'一批', |
| | | 11:'NG20010101', |
| | | 12:'6mm超白平钢', |
| | | 13:'北方', |
| | | |
| | | }, |
| | | ],//table body实际数据 |
| | | data: [],//table body实际数据 |
| | | //脚部求和 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | let footList=['6','7'] |
| | | return[ |
| | | footerMethod({columns, data}) {//页脚函数 |
| | | let footList = [''] |
| | | return [ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | |
| | | |
| | | }) |
| | | |
| | | const value = ref('') |
| | | const options = [ |
| | | { |
| | | value: 'Option1', |
| | | label: 'Option1', |
| | | }, |
| | | { |
| | | value: 'Option2', |
| | | label: 'Option2', |
| | | }, |
| | | { |
| | | value: 'Option3', |
| | | label: 'Option3', |
| | | }, |
| | | ] |
| | | |
| | | const form = reactive({ |
| | | name: '', |
| | | region: '', |
| | | date1: '', |
| | | date2: '', |
| | | delivery: false, |
| | | type: [], |
| | | resource: '', |
| | | desc: '', |
| | | |
| | | }) |
| | | |
| | | </script> |
| | | |
| | |
| | | <div class="main-div-customer"> |
| | | <div id="selectForm"> |
| | | <el-row :gutter="0"> |
| | | <!-- <el-input placeholder="销售单号" v-model="form.name" style="width: 150px"/>--> |
| | | <!-- <el-input placeholder="项目名称" v-model="form.name" style="width: 150px"/>--> |
| | | |
| | | <el-date-picker |
| | | v-model="form.date1" |
| | | type="daterange" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | :default-time="defaultTime" |
| | | format="YYYY/MM/DD" |
| | | start-placeholder="开始时间" |
| | | style="width: 100px" |
| | | type="daterange" |
| | | value-format="YYYY-MM-DD" |
| | | /> |
| | | |
| | | <el-select v-model="value" class="m-2" placeholder="查询类型"> |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | <el-button type="primary">查询</el-button> |
| | | <el-button type="primary" @click="getWorkOrder">查询</el-button> |
| | | </el-row> |
| | | |
| | | </div> |
| | | <vxe-grid |
| | | max-height="100%" |
| | | @filter-change="filterChanged" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | class="mytable-scrollbar" |
| | | max-height="100%" |
| | | v-bind="gridOptions" |
| | | |
| | | > |
| | |
| | | <!-- 下拉显示所有信息插槽--> |
| | | <template #content="{ row }"> |
| | | <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> |
| | | <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined "> |
| | | <span style="font-weight: bold">{{ item.title + ': ' }}</span> |
| | | <span>{{ row[item.field] }}</span> |
| | | </li> |
| | | </ul> |
| | |
| | | |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">编辑</el-button> |
| | | <el-button @click="getTableRow(row,'setType')" link type="primary" size="small">反审</el-button> |
| | | <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">删除</el-button> |
| | | <el-button link size="small" type="primary" @click="getTableRow(row,'edit')">编辑</el-button> |
| | | <el-button link size="small" type="primary" @click="getTableRow(row,'setType')">反审</el-button> |
| | | <el-button link size="small" type="primary" @click="getTableRow(row,'delete')">删除</el-button> |
| | | </template> |
| | | |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <input type="type" v-model="option.data" @input="changeFilterEvent($event, option, $panel)"/> |
| | | <input v-model="option.data" type="type" @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | </template> |
| | | |
| | | <style scoped> |
| | | .main-div-customer{ |
| | | .main-div-customer { |
| | | width: 99%; |
| | | height: 100%; |
| | | } |
| | | |
| | | #selectForm { |
| | | width: 60%; |
| | | text-align: center; |
| | |
| | | <script setup> |
| | | |
| | | import {reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | let router=useRouter() |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/reportingWorks/ReportingWorkDetail', query: { id: row.id }}) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | | alert('我接收到子组件传送的删除信息') |
| | | break |
| | | } |
| | | case 'setType':{ |
| | | alert('我接收到子组件传送的反审状态') |
| | | break |
| | | } |
| | | } |
| | | } |
| | | import {useRouter} from 'vue-router' |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import {ElDatePicker, ElMessage} from "element-plus"; |
| | | import {useI18n} from 'vue-i18n' |
| | | import {changeFilterEvent, filterChanged} from "@/hook" |
| | | //语言获取 |
| | | const {t} = useI18n() |
| | | let router = useRouter() |
| | | let filterData = ref({}) |
| | | //提交的表单 |
| | | const form = reactive({ |
| | | date1: '', |
| | | orderId: '', |
| | | project: '' |
| | | }) |
| | | |
| | | //工序 |
| | | const value = ref('磨边') |
| | | |
| | | //表尾求和 |
| | | const sumNum = (list, field) => { |
| | |
| | | return count.toFixed(2) |
| | | } |
| | | |
| | | //子组件接收参数 |
| | | //定义滚动条高度 |
| | | let scrollTop = ref(null) |
| | | let scrollHeight = ref(null) |
| | | let clientHeight = ref(null) |
| | | const scrollEvnt = (row) => { |
| | | // 内容高度 |
| | | scrollTop.value = row.$event.target.scrollTop |
| | | scrollHeight.value = row.$event.target.scrollHeight |
| | | clientHeight.value = row.$event.target.clientHeight |
| | | } |
| | | |
| | | |
| | | //定义页面总页数 |
| | | let pageTotal = ref('') |
| | | //定义数据返回结果 |
| | | let produceList = ref([]) |
| | | //定义当前页数 |
| | | let pageNum = ref(1) |
| | | let pageState = null |
| | | |
| | | //获取七天前到当前时间 |
| | | function getNowTime() { |
| | | const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 7) |
| | | .toISOString() |
| | | .replace('T', ' ') |
| | | .slice(0, 10) //默认开始时间7天前 |
| | | const end = new Date(new Date().getTime() + 3600 * 1000 * 24) |
| | | .toISOString() |
| | | .replace('T', ' ') |
| | | .slice(0, 10)//默认结束时间当前时间 |
| | | return [start, end] |
| | | } |
| | | |
| | | |
| | | //第一次加载获取近七天时间和默认状态 |
| | | form.date1 = getNowTime() |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let total = reactive({ |
| | | pageTotal: 0, |
| | | dataTotal: 0, |
| | | pageSize: 100 |
| | | }) |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | | processType: [], |
| | | }) |
| | | //第一次加载数据 |
| | | request.post(`/report/orderPlanDecomposition/${startTime}/${endTime}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | // total.dataTotal = res.data.total.total*1 |
| | | // total.pageTotal= res.data.total.pageTotal |
| | | // pageTotal.value = res.data.total |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | |
| | | //页脚翻页查询 |
| | | const selectPageList = () => { |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | |
| | | request.post(`/report/selectReportingWork/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${inputVal}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | |
| | | |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //点击查询 |
| | | const getWorkOrder = () => { |
| | | |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | request.post(`/report/orderPlanDecomposition/${startTime}/${endTime}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | // total.dataTotal = res.data.total.total*1 |
| | | // total.pageTotal= res.data.total.pageTotal |
| | | // pageTotal.value = res.data.total |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //页脚跳转 |
| | | const handlePageChange = ({currentPage, pageSize}) => { |
| | | pageNum.value = currentPage |
| | | total.pageTotal = pageSize |
| | | selectPageList() |
| | | } |
| | | |
| | | |
| | | /*使用筛选,后端获取数据*/ |
| | | // const changeFilterEvent = (event, option, $panel,) => { |
| | | // // 手动触发筛选 |
| | | // $panel.changeOption(event, !!option.data, option) |
| | | // } |
| | | |
| | | // function filterChanged(column){ |
| | | // //gridOptions.loading=true |
| | | // //筛选条件发生变化条件发生变化 |
| | | // let value = column.datas[0]!=undefined?column.datas[0]:'' |
| | | // value = value.trim() |
| | | // //判断是否存在外键 |
| | | // if (column.property.indexOf('.')>-1){ |
| | | // const columnArr = column.property.split('.') |
| | | // filterData.value[columnArr[0]] = { |
| | | // [columnArr[1]]:value |
| | | // } |
| | | // }else{ |
| | | // filterData.value[column.property] = value |
| | | // } |
| | | // |
| | | // gridOptions.loading = true |
| | | // |
| | | // } |
| | | |
| | | /*后端返回结果多层嵌套展示*/ |
| | | const hasDecimal = (value) => { |
| | | const regex = /\./; // 定义正则表达式,查找小数点 |
| | | return regex.test(value); // 返回true/false |
| | | } |
| | | |
| | | //子组件接收参数 |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮 |
| | | stripe: true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 50},//鼠标移动或选择高亮 |
| | | id: 'CustomerList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | scrollY: {enabled: true},//开启虚拟滚动 |
| | | showOverflow: true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | // remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | |
| | | mode: 'row', |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | { type: 'seq',fixed:"left", title: '自序', width: 50 }, |
| | | {field: '1', width: 120, title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, }, |
| | | {field: '2',width: 120, title: '客户批次', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: '3', width: 130,title: '批次', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: '4',width: 120, title: '数量',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '5', width: 100,title: '面积', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: '6', width: 100,title: '订单交接时间', sortable: true}, |
| | | {field: '7',width: 100, title: '销售单号', sortable: true}, |
| | | {field: '8',width: 120, title: '开始切割时间', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: '9', width: 120,title: '流转工序', sortable: true}, |
| | | {field: '10', width: 120,title: '完工数量', sortable: true}, |
| | | {field: '11',width: 120, title: '已入库数量', sortable: true}, |
| | | {field: '12',width: 120, title: '未入库数量', sortable: true}, |
| | | {field: '13',width: 120, title: '清单时间', sortable: true}, |
| | | {field: '14',width: 120, title: '生产用时(天)', sortable: true}, |
| | | columns: [ |
| | | {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50}, |
| | | {type: 'seq', fixed: "left", title: '自序', width: 50}, |
| | | { |
| | | field: 'order_id', width: 120, title: '销售单号', filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'customer_name', |
| | | width: 120, |
| | | title: '客户名称', |
| | | showOverflow: "ellipsis", |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'project', |
| | | width: 120, |
| | | title: '项目名称', |
| | | showOverflow: "ellipsis", |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'batch', width: 130, title: '批次', filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'quantity', width: 120, title: '订数量', filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'area', width: 100, title: '订单面积', filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'create_time', |
| | | width: 100, |
| | | title: '分架时间', |
| | | type: 'date', |
| | | attrs: {placeholder: '', type: 'date'}, |
| | | }, |
| | | {field: 'startTime', width: 120, title: '切割开始时间', showOverflow: "ellipsis"}, |
| | | {field: 'completionsNum', width: 100, title: '完工数量'}, |
| | | {field: 'received_quantity', width: 120, title: '入库数量'}, |
| | | {field: 'receivedNo', width: 120, title: '未入库数量'}, |
| | | {field: 'accomplish', width: 120, title: '是否清单'}, |
| | | {field: 'daysDifference', width: 120, title: '生产天数'}, |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | 1:'新安北玻产业园', |
| | | 2:'1#宿舍楼墙', |
| | | 3:'1#补片', |
| | | 4:'8', |
| | | 5:'9.82', |
| | | 6:'2023-12-01 11:06:10', |
| | | 7:'NG23113003', |
| | | 8:'2023-12-03 23:19:11', |
| | | 9:'切割', |
| | | 10:'2', |
| | | 11:'0', |
| | | 12:'9', |
| | | 13:'已审核', |
| | | 14:'4', |
| | | }, |
| | | { |
| | | 1:'新安北玻产业园', |
| | | 2:'1#宿舍楼墙', |
| | | 3:'1#补片', |
| | | 4:'8', |
| | | 5:'9.82', |
| | | 6:'2023-12-01 11:06:10', |
| | | 7:'NG23113003', |
| | | 8:'2023-12-03 23:19:11', |
| | | 9:'切割', |
| | | 10:'2', |
| | | 11:'0', |
| | | 12:'9', |
| | | 13:'已审核', |
| | | 14:'4', |
| | | }, |
| | | { |
| | | 1:'新安北玻产业园', |
| | | 2:'1#宿舍楼墙', |
| | | 3:'1#补片', |
| | | 4:'8', |
| | | 5:'9.82', |
| | | 6:'2023-12-01 11:06:10', |
| | | 7:'NG23113003', |
| | | 8:'2023-12-03 23:19:11', |
| | | 9:'切割', |
| | | 10:'2', |
| | | 11:'0', |
| | | 12:'9', |
| | | 13:'已审核', |
| | | 14:'4', |
| | | }, |
| | | { |
| | | 1:'新安北玻产业园', |
| | | 2:'1#宿舍楼墙', |
| | | 3:'1#补片', |
| | | 4:'8', |
| | | 5:'9.82', |
| | | 6:'2023-12-01 11:06:10', |
| | | 7:'NG23113003', |
| | | 8:'2023-12-03 23:19:11', |
| | | 9:'切割', |
| | | 10:'2', |
| | | 11:'0', |
| | | 12:'9', |
| | | 13:'已审核', |
| | | 14:'4', |
| | | }, |
| | | ],//table body实际数据 |
| | | data: [],//table body实际数据 |
| | | //脚部求和 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | let footList=['4','5','10','11','12'] |
| | | return[ |
| | | footerMethod({columns, data}) {//页脚函数 |
| | | let footList = [''] |
| | | return [ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | |
| | | |
| | | }) |
| | | |
| | | const value = ref('') |
| | | const options = [ |
| | | { |
| | | value: 'Option1', |
| | | label: 'Option1', |
| | | }, |
| | | { |
| | | value: 'Option2', |
| | | label: 'Option2', |
| | | }, |
| | | { |
| | | value: 'Option3', |
| | | label: 'Option3', |
| | | }, |
| | | ] |
| | | |
| | | const form = reactive({ |
| | | name: '', |
| | | region: '', |
| | | date1: '', |
| | | date2: '', |
| | | delivery: false, |
| | | type: [], |
| | | resource: '', |
| | | desc: '', |
| | | |
| | | }) |
| | | |
| | | </script> |
| | | |
| | |
| | | <div class="main-div-customer"> |
| | | <div id="selectForm"> |
| | | <el-row :gutter="0"> |
| | | <!-- <el-input placeholder="销售单号" v-model="form.name" style="width: 150px"/>--> |
| | | <!-- <el-input placeholder="项目名称" v-model="form.name" style="width: 150px"/>--> |
| | | |
| | | <el-date-picker |
| | | v-model="form.date1" |
| | | type="daterange" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | :default-time="defaultTime" |
| | | format="YYYY/MM/DD" |
| | | start-placeholder="开始时间" |
| | | style="width: 100px" |
| | | type="daterange" |
| | | value-format="YYYY-MM-DD" |
| | | /> |
| | | |
| | | <el-select v-model="value" class="m-2" placeholder="查询类型"> |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | <el-button type="primary">查询</el-button> |
| | | <el-button type="primary" @click="getWorkOrder">查询</el-button> |
| | | </el-row> |
| | | |
| | | </div> |
| | | <vxe-grid |
| | | max-height="100%" |
| | | @filter-change="filterChanged" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | class="mytable-scrollbar" |
| | | max-height="100%" |
| | | v-bind="gridOptions" |
| | | |
| | | > |
| | |
| | | <!-- 下拉显示所有信息插槽--> |
| | | <template #content="{ row }"> |
| | | <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> |
| | | <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined "> |
| | | <span style="font-weight: bold">{{ item.title + ': ' }}</span> |
| | | <span>{{ row[item.field] }}</span> |
| | | </li> |
| | | </ul> |
| | | </template> |
| | | |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">编辑</el-button> |
| | | <el-button @click="getTableRow(row,'setType')" link type="primary" size="small">反审</el-button> |
| | | <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">删除</el-button> |
| | | </template> |
| | | |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <input type="type" v-model="option.data" @input="changeFilterEvent($event, option, $panel)"/> |
| | | <input v-model="option.data" type="type" @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | </template> |
| | | |
| | | <style scoped> |
| | | .main-div-customer{ |
| | | .main-div-customer { |
| | | width: 99%; |
| | | height: 100%; |
| | | } |
| | | |
| | | #selectForm { |
| | | width: 60%; |
| | | text-align: center; |
| | |
| | | <script setup> |
| | | |
| | | import {reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import request from "@/utils/request" |
| | | import {ElDatePicker, ElMessage} from "element-plus" |
| | | import {nextTick, onMounted, onUnmounted, reactive, ref, watch} from "vue" |
| | | import {Search} from "@element-plus/icons-vue" |
| | | import {useRouter} from 'vue-router' |
| | | import {changeFilterEvent, filterChanged} from "@/hook" |
| | | |
| | | import { useI18n } from 'vue-i18n' |
| | | import request from "@/utils/request"; |
| | | import {ElMessage} from "element-plus"; |
| | | //语言获取 |
| | | const { t } = useI18n() |
| | | let router=useRouter() |
| | | |
| | | let props = defineProps({ |
| | | orderId:null |
| | | }) |
| | | onMounted(()=>{ |
| | | if(props.orderId===null || props.orderId===undefined || props.orderId===''){ |
| | | return |
| | | } |
| | | form.orderId = props.orderId |
| | | getWorkOrder() |
| | | }) |
| | | |
| | | |
| | | //表尾求和 |
| | | const sumNum = (list, field) => { |
| | |
| | | computeGrossArea: '', |
| | | processingNote: '', |
| | | } |
| | | |
| | | }) |
| | | |
| | | |
| | | const columns = [ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | {field: 'order_number', width: 150, title: '订单序号',filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged}, |
| | | {field: 'shape',width: 130, title: '形状' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged}, |
| | | {field: 'product_name', width: 120,title: '产品名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged}, |
| | | {field: 'child_width',width: 110, title: '宽',filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged}, |
| | | {field: 'child_height', width: 90,title: '高',showOverflow:"ellipsis"}, |
| | | {field: 'quantity', width: 90,title: '数量'}, |
| | | {field: 'technology_number',width: 90, title: '小片顺序'}, |
| | | {field: 'glass_child',width: 120, title: '单片名称'}, |
| | | {field: 'inventoryNum',width: 120, title: '入库数量'}, |
| | | {field: 'inventoryArea',width: 120, title: '入库面积'}, |
| | | {field: 'shippedQuantity',width: 120, title: '发货数量'}, |
| | | {field: 'area',width: 120, title: '发货面积'}, |
| | | ] |
| | | //需要合并的列 |
| | | let column = [1,2,3] |
| | | //点击查询 |
| | | const getWorkOrder = () => { |
| | | let inputVal = form.orderId |
| | | |
| | | request.post(`/report/ProductionSchedule/${inputVal}`, filterData.value).then((res) => { |
| | | request.post(`/report/productionSchedule/${form.orderId}`,column).then((res) => { |
| | | if (res.code == 200) { |
| | | |
| | | pageTotal.value = res.data.total |
| | | if(res.data.data.length===0){ |
| | | ElMessage.warning('未查询到此订单数据') |
| | | return |
| | | } |
| | | gridOptions.columns = JSON.parse(JSON.stringify(columns)) |
| | | res.data.title.forEach(item =>{ |
| | | let column = {slots: { default: 'quantitySum' }, width: 90,title: item.process} |
| | | gridOptions.columns.push(column) |
| | | }) |
| | | res.data.data.forEach(item => { |
| | | item.reportWorkQuantity=JSON.parse(item.reportWorkQuantity) |
| | | item.reportWorkQuantityCount=JSON.parse(item.reportWorkQuantityCount) |
| | | }) |
| | | mergeCells.value = res.data.mergeCell |
| | | xGrid.value.loadData(res.data.data) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | const quantitySum = ( row,column )=>{ |
| | | const reportWorkQuantity = row.reportWorkQuantity[column.title] || 0 |
| | | const reportWorkQuantityCount = row.reportWorkQuantityCount[column.title] || 0 |
| | | if(reportWorkQuantity===reportWorkQuantityCount){ |
| | | return reportWorkQuantity |
| | | } |
| | | |
| | | return (reportWorkQuantity |
| | | +'(' |
| | | +reportWorkQuantityCount |
| | | +')' ) |
| | | //return |
| | | } |
| | | |
| | | |
| | |
| | | return regex.test(value); // 返回true/false |
| | | } |
| | | |
| | | //子组件接收参数 |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮 |
| | | id: 'CustomerList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | |
| | | mode: 'row', |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | {field: '1', width: 100, title: '序号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, }, |
| | | {field: '2',width: 120, title: '楼层编号', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: '3', width: 100,title: '形状', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: '4',width: 120, title: '成品名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '5', width: 90,title: '宽', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: '6', width: 90,title: '高', sortable: true}, |
| | | {field: '7',width: 90, title: '数量', sortable: true}, |
| | | {field: '8',width: 90, title: '片标记', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: '9', width: 80,title: '标记', sortable: true}, |
| | | {field: '10', width: 120,title: '单片名称', sortable: true}, |
| | | {field: '11',width: 120, title: '切割', sortable: true}, |
| | | {field: '12',width: 120, title: '磨边', sortable: true}, |
| | | {field: '13',width: 120, title: '钢化', sortable: true}, |
| | | {field: '14',width: 120, title: '入库数量', sortable: true}, |
| | | {field: '15',width: 120, title: '入库面积', sortable: true}, |
| | | {field: '16',width: 120, title: '发货数量', sortable: true}, |
| | | {field: '17',width: 120, title: '发货面积', sortable: true}, |
| | | {field: '17',width: 120, title: '结算总面积', sortable: true}, |
| | | ],//表头按钮 |
| | | columns:[],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | | // buttons: [{ |
| | | // |
| | | // }], |
| | | import: false, |
| | | export: true, |
| | | // import: false, |
| | | // export: true, |
| | | print: true, |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | 1:'1', |
| | | 2:'J8-B1-BD-BL1-001', |
| | | 3:'普形', |
| | | 4:'10mm超白UD60平钢(外)+12Ar(结)+10mm超白平钢+12Ar(结)+10mm超白平钢(内)', |
| | | 5:'1114', |
| | | 6:'1445', |
| | | 7:'3', |
| | | 8:'(外)', |
| | | 9:'1', |
| | | 10:'10mm超白UD60平钢(外)', |
| | | 11:'1', |
| | | 12:'1', |
| | | 13:'1', |
| | | 14:'0', |
| | | 15:'0', |
| | | 16:'0', |
| | | 17:'0', |
| | | 18:'4.11', |
| | | }, |
| | | { |
| | | 1:'1', |
| | | 2:'J8-B1-BD-BL1-001', |
| | | 3:'普形', |
| | | 4:'10mm超白UD60平钢(外)+12Ar(结)+10mm超白平钢+12Ar(结)+10mm超白平钢(内)', |
| | | 5:'1114', |
| | | 6:'1445', |
| | | 7:'3', |
| | | 8:'(中)', |
| | | 9:'2', |
| | | 10:'10mm超白UD60平钢(外)', |
| | | 11:'1', |
| | | 12:'1', |
| | | 13:'1', |
| | | 14:'0', |
| | | 15:'0', |
| | | 16:'0', |
| | | 17:'0', |
| | | 18:'4.11', |
| | | }, |
| | | { |
| | | 1:'1', |
| | | 2:'J8-B1-BD-BL1-001', |
| | | 3:'普形', |
| | | 4:'10mm超白UD60平钢(外)+12Ar(结)+10mm超白平钢+12Ar(结)+10mm超白平钢(内)', |
| | | 5:'1114', |
| | | 6:'1445', |
| | | 7:'3', |
| | | 8:'(内)', |
| | | 9:'3', |
| | | 10:'10mm超白UD60平钢(外)', |
| | | 11:'1', |
| | | 12:'1', |
| | | 13:'1', |
| | | 14:'0', |
| | | 15:'0', |
| | | 16:'0', |
| | | 17:'0', |
| | | 18:'4.11', |
| | | }, |
| | | { |
| | | 1:'2', |
| | | 2:'J8-B1-BD-BL1-001', |
| | | 3:'普形', |
| | | 4:'6mm超白UD60平钢(外)+12Ar(结)+6mm超白平钢+12Ar(结)+6mm超白平钢(内)', |
| | | 5:'1114', |
| | | 6:'1445', |
| | | 7:'3', |
| | | 8:'(外)', |
| | | 9:'1', |
| | | 10:'6mm超白UD60平钢(外)', |
| | | 11:'1', |
| | | 12:'1', |
| | | 13:'1', |
| | | 14:'0', |
| | | 15:'0', |
| | | 16:'0', |
| | | 17:'0', |
| | | 18:'4.11', |
| | | }, |
| | | { |
| | | 1:'2', |
| | | 2:'J8-B1-BD-BL1-001', |
| | | 3:'普形', |
| | | 4:'6mm超白UD60平钢(外)+12Ar(结)+6mm超白平钢+12Ar(结)+6mm超白平钢(内)', |
| | | 5:'1114', |
| | | 6:'1445', |
| | | 7:'3', |
| | | 8:'(中)', |
| | | 9:'2', |
| | | 10:'6mm超白UD60平钢(外)', |
| | | 11:'1', |
| | | 12:'1', |
| | | 13:'1', |
| | | 14:'0', |
| | | 15:'0', |
| | | 16:'0', |
| | | 17:'0', |
| | | 18:'4.11', |
| | | }, |
| | | { |
| | | 1:'2', |
| | | 2:'J8-B1-BD-BL1-001', |
| | | 3:'普形', |
| | | 4:'6mm超白UD60平钢(外)+12Ar(结)+6mm超白平钢+12Ar(结)+6mm超白平钢(内)', |
| | | 5:'1114', |
| | | 6:'1445', |
| | | 7:'3', |
| | | 8:'(内)', |
| | | 9:'3', |
| | | 10:'6mm超白UD60平钢(外)', |
| | | 11:'1', |
| | | 12:'1', |
| | | 13:'1', |
| | | 14:'0', |
| | | 15:'0', |
| | | 16:'0', |
| | | 17:'0', |
| | | 18:'4.11', |
| | | }, |
| | | ],//table body实际数据 |
| | | //脚部求和 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | let footList=['11','12','13','14','15','16','17','18'] |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | | } |
| | | if (footList.includes(column.field)) { |
| | | return sumNum(data, column.field) |
| | | } |
| | | return '' |
| | | }) |
| | | ] |
| | | } |
| | | // footerMethod ({ columns, data }) {//页脚函数 |
| | | // let footList=['7','8','9','10'] |
| | | // return[ |
| | | // columns.map((column, columnIndex) => { |
| | | // if (columnIndex === 0) { |
| | | // return '合计:' |
| | | // } |
| | | // if (footList.includes(column.field)) { |
| | | // return sumNum(data, column.field) |
| | | // } |
| | | // return '' |
| | | // }) |
| | | // ] |
| | | // } |
| | | |
| | | }) |
| | | |
| | | const value = ref('') |
| | | const options = [ |
| | | { |
| | | value: 'Option1', |
| | | label: 'Option1', |
| | | }, |
| | | { |
| | | value: 'Option2', |
| | | label: 'Option2', |
| | | }, |
| | | { |
| | | value: 'Option3', |
| | | label: 'Option3', |
| | | }, |
| | | ] |
| | | |
| | | |
| | | const form = reactive({ |
| | | name: '', |
| | | region: '', |
| | | date1: '', |
| | | date2: '', |
| | | delivery: false, |
| | | type: [], |
| | | resource: '', |
| | | desc: '', |
| | | orderId: '', |
| | | |
| | | }) |
| | | |
| | | const mergeCells = ref([ |
| | | { row: 0, col: 1, rowspan: 3, colspan: 0}, |
| | | { row: 3, col: 1, rowspan: 3, colspan: 0}, |
| | | |
| | | { row: 0, col: 2, rowspan: 3, colspan: 0}, |
| | | { row: 3, col: 2, rowspan: 3, colspan: 0}, |
| | | |
| | | { row: 0, col: 3, rowspan: 3, colspan: 0}, |
| | | { row: 3, col: 3, rowspan: 3, colspan: 0}, |
| | | |
| | | { row: 0, col: 4, rowspan: 3, colspan: 0}, |
| | | { row: 3, col: 4, rowspan: 3, colspan: 0}, |
| | | |
| | | |
| | | ]) |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div class="main-div-customer"> |
| | | <div class="main-div-customer" > |
| | | <div id="selectForm"> |
| | | <el-row :gutter="0"> |
| | | <el-input v-model="form.orderId" clearable :placeholder="$t('order.orderId')" style="width: 130px"></el-input> |
| | | <el-input |
| | | v-model="form.orderId" |
| | | clearable |
| | | :disabled="props.orderId" |
| | | :placeholder="$t('order.orderId')" |
| | | style="width: 130px"></el-input> |
| | | |
| | | <el-button |
| | | :disabled="props.orderId" |
| | | @click="getWorkOrder" |
| | | id="select" |
| | | type="primary" :icon="Search">{{$t('basicData.search')}} |
| | |
| | | |
| | | </div> |
| | | <vxe-grid |
| | | max-height="100%" |
| | | height="400px" |
| | | @filter-change="filterChanged" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | |
| | | </ul> |
| | | </template> |
| | | |
| | | |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | |
| | | </div> |
| | | </template> |
| | | |
| | | <template #quantitySum="{ row,column }"> |
| | | <span>{{ quantitySum(row,column) }} </span> |
| | | </template> |
| | | |
| | | |
| | | </vxe-grid> |
| | | </div> |
| | |
| | | <script setup> |
| | | |
| | | import {reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | let router=useRouter() |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/reportingWorks/ReportingWorkDetail', query: { id: row.id }}) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | | alert('我接收到子组件传送的删除信息') |
| | | break |
| | | } |
| | | case 'setType':{ |
| | | alert('我接收到子组件传送的反审状态') |
| | | break |
| | | } |
| | | } |
| | | } |
| | | import {useRouter} from 'vue-router' |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import {ElDatePicker, ElMessage} from "element-plus"; |
| | | import {useI18n} from 'vue-i18n' |
| | | import {changeFilterEvent, filterChanged} from "@/hook" |
| | | //语言获取 |
| | | const {t} = useI18n() |
| | | let router = useRouter() |
| | | let filterData = ref({}) |
| | | //提交的表单 |
| | | const form = reactive({ |
| | | date1: '', |
| | | orderId: '', |
| | | project: '' |
| | | }) |
| | | |
| | | //工序 |
| | | const value = ref('磨边') |
| | | |
| | | //表尾求和 |
| | | const sumNum = (list, field) => { |
| | |
| | | return count.toFixed(2) |
| | | } |
| | | |
| | | //子组件接收参数 |
| | | //定义滚动条高度 |
| | | let scrollTop = ref(null) |
| | | let scrollHeight = ref(null) |
| | | let clientHeight = ref(null) |
| | | const scrollEvnt = (row) => { |
| | | // 内容高度 |
| | | scrollTop.value = row.$event.target.scrollTop |
| | | scrollHeight.value = row.$event.target.scrollHeight |
| | | clientHeight.value = row.$event.target.clientHeight |
| | | } |
| | | |
| | | |
| | | //定义页面总页数 |
| | | let pageTotal = ref('') |
| | | //定义数据返回结果 |
| | | let produceList = ref([]) |
| | | //定义当前页数 |
| | | let pageNum = ref(1) |
| | | let pageState = null |
| | | |
| | | //获取七天前到当前时间 |
| | | function getNowTime() { |
| | | const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 7) |
| | | .toISOString() |
| | | .replace('T', ' ') |
| | | .slice(0, 10) //默认开始时间7天前 |
| | | const end = new Date(new Date().getTime() + 3600 * 1000 * 24) |
| | | .toISOString() |
| | | .replace('T', ' ') |
| | | .slice(0, 10)//默认结束时间当前时间 |
| | | return [start, end] |
| | | } |
| | | |
| | | |
| | | //第一次加载获取近七天时间和默认状态 |
| | | form.date1 = getNowTime() |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let total = reactive({ |
| | | pageTotal: 0, |
| | | dataTotal: 0, |
| | | pageSize: 100 |
| | | }) |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | | processType: [], |
| | | }) |
| | | //第一次加载数据 |
| | | request.post(`/report/qualityReport/${startTime}/${endTime}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | // total.dataTotal = res.data.total.total*1 |
| | | // total.pageTotal= res.data.total.pageTotal |
| | | // pageTotal.value = res.data.total |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | |
| | | //页脚翻页查询 |
| | | const selectPageList = () => { |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | |
| | | request.post(`/report/qualityReport/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${inputVal}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | |
| | | |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //点击查询 |
| | | const getWorkOrder = () => { |
| | | |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | request.post(`/report/qualityReport/${startTime}/${endTime}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | // total.dataTotal = res.data.total.total*1 |
| | | // total.pageTotal= res.data.total.pageTotal |
| | | // pageTotal.value = res.data.total |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //页脚跳转 |
| | | const handlePageChange = ({currentPage, pageSize}) => { |
| | | pageNum.value = currentPage |
| | | total.pageTotal = pageSize |
| | | selectPageList() |
| | | } |
| | | |
| | | |
| | | /*使用筛选,后端获取数据*/ |
| | | // const changeFilterEvent = (event, option, $panel,) => { |
| | | // // 手动触发筛选 |
| | | // $panel.changeOption(event, !!option.data, option) |
| | | // } |
| | | |
| | | // function filterChanged(column){ |
| | | // //gridOptions.loading=true |
| | | // //筛选条件发生变化条件发生变化 |
| | | // let value = column.datas[0]!=undefined?column.datas[0]:'' |
| | | // value = value.trim() |
| | | // //判断是否存在外键 |
| | | // if (column.property.indexOf('.')>-1){ |
| | | // const columnArr = column.property.split('.') |
| | | // filterData.value[columnArr[0]] = { |
| | | // [columnArr[1]]:value |
| | | // } |
| | | // }else{ |
| | | // filterData.value[column.property] = value |
| | | // } |
| | | // |
| | | // gridOptions.loading = true |
| | | // |
| | | // } |
| | | |
| | | /*后端返回结果多层嵌套展示*/ |
| | | const hasDecimal = (value) => { |
| | | const regex = /\./; // 定义正则表达式,查找小数点 |
| | | return regex.test(value); // 返回true/false |
| | | } |
| | | |
| | | //子组件接收参数 |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮 |
| | | stripe: true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 50},//鼠标移动或选择高亮 |
| | | id: 'CustomerList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | scrollY: {enabled: true},//开启虚拟滚动 |
| | | showOverflow: true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | // remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | |
| | | mode: 'row', |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | { type: 'seq',fixed:"left", title: '自序', width: 50 }, |
| | | {field: '1', width: 120, title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, }, |
| | | {field: '2',width: 120, title: '客户编码', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: '3', width: 130,title: '项目名称', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: '4',width: 120, title: '订单序号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '5', width: 100,title: '产品名称', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: '6', width: 100,title: '订单数量', sortable: true}, |
| | | {field: '7',width: 100, title: '备用件', sortable: true}, |
| | | {field: '8',width: 120, title: '投入数量', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: '9', width: 120,title: '次破数量', sortable: true}, |
| | | {field: '10', width: 120,title: '补片数量', sortable: true}, |
| | | {field: '11',width: 120, title: '入库数量', sortable: true}, |
| | | {field: '12',width: 120, title: '报废率', sortable: true}, |
| | | columns: [ |
| | | {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50}, |
| | | {type: 'seq', fixed: "left", title: '自序', width: 50}, |
| | | { |
| | | field: 'order_id', width: 120, title: '销售单号', filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'customer_name', |
| | | width: 120, |
| | | title: '客户名称', |
| | | showOverflow: "ellipsis", |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'project', |
| | | width: 120, |
| | | title: '项目名称', |
| | | showOverflow: "ellipsis", |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'order_number', width: 130, title: '订单序号', filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'technology_number', width: 120, title: '小片顺序', filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'product_name', width: 100, title: '产品名称', filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'quantity', |
| | | width: 100, |
| | | title: '订单数量', |
| | | type: 'date', |
| | | attrs: {placeholder: '', type: 'date'}, |
| | | }, |
| | | {field: 'quantityMax', width: 120, title: '投入数量', showOverflow: "ellipsis"}, |
| | | {field: 'breakage_quantity', width: 100, title: '次破数量'}, |
| | | {field: 'patch_num', width: 120, title: '补片数量'}, |
| | | {field: 'received_quantity', width: 120, title: '入库数量'}, |
| | | {field: 'finished', width: 120, title: '成品率'}, |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | 1:'NG23022706', |
| | | 2:'45', |
| | | 3:'大板镜', |
| | | 4:'1', |
| | | 5:'3mm 高性能环保镜 3660*2440', |
| | | 6:'180 ', |
| | | 7:'0', |
| | | 8:'186', |
| | | 9:'3', |
| | | 10:'3', |
| | | 11:'180', |
| | | 12:'1.6129%', |
| | | |
| | | }, |
| | | { |
| | | 1:'NG23022706', |
| | | 2:'45', |
| | | 3:'大板镜', |
| | | 4:'1', |
| | | 5:'3mm 高性能环保镜 3660*2440', |
| | | 6:'180 ', |
| | | 7:'0', |
| | | 8:'186', |
| | | 9:'3', |
| | | 10:'3', |
| | | 11:'180', |
| | | 12:'1.6129%', |
| | | |
| | | }, |
| | | { |
| | | 1:'NG23022706', |
| | | 2:'45', |
| | | 3:'大板镜', |
| | | 4:'1', |
| | | 5:'3mm 高性能环保镜 3660*2440', |
| | | 6:'180 ', |
| | | 7:'0', |
| | | 8:'186', |
| | | 9:'3', |
| | | 10:'3', |
| | | 11:'180', |
| | | 12:'1.6129%', |
| | | |
| | | }, |
| | | { |
| | | 1:'NG23022706', |
| | | 2:'45', |
| | | 3:'大板镜', |
| | | 4:'1', |
| | | 5:'3mm 高性能环保镜 3660*2440', |
| | | 6:'180 ', |
| | | 7:'0', |
| | | 8:'186', |
| | | 9:'3', |
| | | 10:'3', |
| | | 11:'180', |
| | | 12:'1.6129%', |
| | | |
| | | }, |
| | | ],//table body实际数据 |
| | | data: [],//table body实际数据 |
| | | //脚部求和 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | let footList=['6','7','8','9','10','11'] |
| | | return[ |
| | | footerMethod({columns, data}) {//页脚函数 |
| | | let footList = [''] |
| | | return [ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | |
| | | |
| | | }) |
| | | |
| | | const value = ref('') |
| | | const options = [ |
| | | { |
| | | value: 'Option1', |
| | | label: 'Option1', |
| | | }, |
| | | { |
| | | value: 'Option2', |
| | | label: 'Option2', |
| | | }, |
| | | { |
| | | value: 'Option3', |
| | | label: 'Option3', |
| | | }, |
| | | ] |
| | | |
| | | const form = reactive({ |
| | | name: '', |
| | | region: '', |
| | | date1: '', |
| | | date2: '', |
| | | delivery: false, |
| | | type: [], |
| | | resource: '', |
| | | desc: '', |
| | | |
| | | }) |
| | | |
| | | </script> |
| | | |
| | |
| | | <div class="main-div-customer"> |
| | | <div id="selectForm"> |
| | | <el-row :gutter="0"> |
| | | <!-- <el-input placeholder="销售单号" v-model="form.name" style="width: 150px"/>--> |
| | | <!-- <el-input placeholder="项目名称" v-model="form.name" style="width: 150px"/>--> |
| | | |
| | | <el-date-picker |
| | | v-model="form.date1" |
| | | type="daterange" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | :default-time="defaultTime" |
| | | format="YYYY/MM/DD" |
| | | start-placeholder="开始时间" |
| | | style="width: 100px" |
| | | type="daterange" |
| | | value-format="YYYY-MM-DD" |
| | | /> |
| | | |
| | | <el-button type="primary">查询</el-button> |
| | | <el-button type="primary" @click="getWorkOrder">查询</el-button> |
| | | </el-row> |
| | | |
| | | </div> |
| | | <vxe-grid |
| | | max-height="100%" |
| | | @filter-change="filterChanged" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | class="mytable-scrollbar" |
| | | max-height="100%" |
| | | v-bind="gridOptions" |
| | | |
| | | > |
| | |
| | | <!-- 下拉显示所有信息插槽--> |
| | | <template #content="{ row }"> |
| | | <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> |
| | | <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined "> |
| | | <span style="font-weight: bold">{{ item.title + ': ' }}</span> |
| | | <span>{{ row[item.field] }}</span> |
| | | </li> |
| | | </ul> |
| | | </template> |
| | | |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">编辑</el-button> |
| | | <el-button @click="getTableRow(row,'setType')" link type="primary" size="small">反审</el-button> |
| | | <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">删除</el-button> |
| | | </template> |
| | | |
| | | |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <input type="type" v-model="option.data" @input="changeFilterEvent($event, option, $panel)"/> |
| | | <input v-model="option.data" type="type" @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | </template> |
| | | |
| | | <style scoped> |
| | | .main-div-customer{ |
| | | .main-div-customer { |
| | | width: 99%; |
| | | height: 100%; |
| | | } |
| | | |
| | | #selectForm { |
| | | width: 50%; |
| | | width: 60%; |
| | | text-align: center; |
| | | } |
| | | </style> |
| | |
| | | <script setup> |
| | | |
| | | import {reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | import {useRouter} from 'vue-router' |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import {ElMessage} from "element-plus"; |
| | | let router=useRouter() |
| | | import {ElDatePicker, ElMessage} from "element-plus"; |
| | | import {useI18n} from 'vue-i18n' |
| | | import {changeFilterEvent, filterChanged} from "@/hook" |
| | | //语言获取 |
| | | const {t} = useI18n() |
| | | let router = useRouter() |
| | | let filterData = ref({}) |
| | | //提交的表单 |
| | | const form = reactive({ |
| | | date1: '', |
| | | orderId: '' |
| | | orderId: '', |
| | | project: '' |
| | | }) |
| | | |
| | | //工序 |
| | | const value = ref('磨边') |
| | | |
| | | //表尾求和 |
| | | const sumNum = (list, field) => { |
| | |
| | | clientHeight.value = row.$event.target.clientHeight |
| | | } |
| | | |
| | | |
| | | //定义页面总页数 |
| | | let pageTotal = ref('') |
| | | //定义数据返回结果 |
| | | let produceList = ref([]) |
| | | //定义当前页数 |
| | | let pageNum=ref(1) |
| | | let pageNum = ref(1) |
| | | let pageState = null |
| | | |
| | | //获取七天前到当前时间 |
| | | function getNowTime() { |
| | | const start = new Date(new Date().getTime()- 3600 * 1000 * 24 * 7) |
| | | const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 7) |
| | | .toISOString() |
| | | .replace('T', ' ') |
| | | .slice(0,10) //默认开始时间7天前 |
| | | const end = new Date(new Date().getTime()+3600 * 1000 * 24) |
| | | .slice(0, 10) //默认开始时间7天前 |
| | | const end = new Date(new Date().getTime() + 3600 * 1000 * 24) |
| | | .toISOString() |
| | | .replace('T', ' ') |
| | | .slice(0,10)//默认结束时间当前时间 |
| | | .slice(0, 10)//默认结束时间当前时间 |
| | | return [start, end] |
| | | } |
| | | |
| | | |
| | | //第一次加载获取近七天时间和默认状态 |
| | | form.date1=getNowTime() |
| | | form.date1 = getNowTime() |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let inputVal = form.orderId |
| | | if (inputVal == '') { |
| | | inputVal = null |
| | | } |
| | | let total = reactive({ |
| | | pageTotal : 0, |
| | | dataTotal : 0, |
| | | pageSize : 100 |
| | | pageTotal: 0, |
| | | dataTotal: 0, |
| | | pageSize: 100 |
| | | }) |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | | processType: [], |
| | | }) |
| | | //第一次加载数据 |
| | | request.post(`/reportingWork/selectReportingWork/1/${total.pageSize}/${startTime}/${endTime}/${inputVal}`, filterData.value).then((res) => { |
| | | request.post(`/report/rawMaterialRequisition/${startTime}/${endTime}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal= res.data.total.pageTotal |
| | | pageTotal.value = res.data.total |
| | | // total.dataTotal = res.data.total.total*1 |
| | | // total.pageTotal= res.data.total.pageTotal |
| | | // pageTotal.value = res.data.total |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading = false |
| | |
| | | }) |
| | | |
| | | //页脚翻页查询 |
| | | const selectPageList = ()=>{ |
| | | const selectPageList = () => { |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let inputVal = form.orderId |
| | | if (inputVal == '') { |
| | | inputVal = null |
| | | } |
| | | request.post(`/reportingWork/selectReportingWork/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${inputVal}`,filterData.value).then((res) => { |
| | | if(res.code==200){ |
| | | |
| | | request.post(`/report/selectReportingWork/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${inputVal}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | |
| | | |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | }else{ |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | |
| | | |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let inputVal = form.orderId |
| | | if (inputVal == '') { |
| | | inputVal = null |
| | | } |
| | | request.post(`/reportingWork/selectReportingWork/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${inputVal}`, filterData.value).then((res) => { |
| | | request.post(`/report/rawMaterialRequisition/${startTime}/${endTime}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal= res.data.total.pageTotal |
| | | pageTotal.value = res.data.total |
| | | xGrid.value.loadData(res.data.data) |
| | | gridOptions.loading = false |
| | | // total.dataTotal = res.data.total.total*1 |
| | | // total.pageTotal= res.data.total.pageTotal |
| | | // pageTotal.value = res.data.total |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | |
| | | } |
| | | |
| | | //页脚跳转 |
| | | const handlePageChange = ({ currentPage, pageSize }) => { |
| | | pageNum.value=currentPage |
| | | total.pageTotal = pageSize |
| | | const handlePageChange = ({currentPage, pageSize}) => { |
| | | pageNum.value = currentPage |
| | | total.pageTotal = pageSize |
| | | selectPageList() |
| | | } |
| | | |
| | | |
| | | |
| | | /*使用筛选,后端获取数据*/ |
| | | const changeFilterEvent = (event, option, $panel,) => { |
| | | // 手动触发筛选 |
| | | $panel.changeOption(event, !!option.data, option) |
| | | } |
| | | // const changeFilterEvent = (event, option, $panel,) => { |
| | | // // 手动触发筛选 |
| | | // $panel.changeOption(event, !!option.data, option) |
| | | // } |
| | | |
| | | function filterChanged(column) { |
| | | gridOptions.loading = true |
| | | //筛选条件发生变化条件发生变化 |
| | | let value = column.datas[0] != undefined ? column.datas[0] : '' |
| | | value = value.trim() |
| | | //判断是否存在外键 |
| | | if (column.property.indexOf('.') > -1) { |
| | | const columnArr = column.property.split('.') |
| | | filterData.value[columnArr[0]] = { |
| | | [columnArr[1]]: value |
| | | } |
| | | } else { |
| | | filterData.value[column.property] = value |
| | | } |
| | | |
| | | //获取选中时间 |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | |
| | | request.post(`/reportingWork/selectReportingWork/1/${total.pageSize}/${startTime}/${endTime}/${inputVal}`, filterData.value).then((res) => { |
| | | if(res.code==200){ |
| | | pageTotal.value=res.data.total |
| | | total.pageTotal=parseInt(res.data.total) |
| | | pageNum.value=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | // function filterChanged(column){ |
| | | // //gridOptions.loading=true |
| | | // //筛选条件发生变化条件发生变化 |
| | | // let value = column.datas[0]!=undefined?column.datas[0]:'' |
| | | // value = value.trim() |
| | | // //判断是否存在外键 |
| | | // if (column.property.indexOf('.')>-1){ |
| | | // const columnArr = column.property.split('.') |
| | | // filterData.value[columnArr[0]] = { |
| | | // [columnArr[1]]:value |
| | | // } |
| | | // }else{ |
| | | // filterData.value[column.property] = value |
| | | // } |
| | | // |
| | | // gridOptions.loading = true |
| | | // |
| | | // } |
| | | |
| | | /*后端返回结果多层嵌套展示*/ |
| | | const hasDecimal = (value) => { |
| | |
| | | //子组件接收参数 |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮 |
| | | stripe: true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 50},//鼠标移动或选择高亮 |
| | | id: 'CustomerList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | scrollY: {enabled: true},//开启虚拟滚动 |
| | | showOverflow: true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | // remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | |
| | | mode: 'row', |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | { type: 'seq',fixed:"left", title: '自序', width: 50 }, |
| | | {field: '1', width: 120, title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, }, |
| | | {field: '2',width: 100, title: '批次', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: '3', width: 130,title: '销售单号', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: '4',width: 120, title: '产品类型',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '5', width: 100,title: '物料名称', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: '6', width: 100,title: '原片产地', sortable: true}, |
| | | {field: '7',width: 90, title: '宽', sortable: true}, |
| | | {field: '8',width: 90, title: '高', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: '9', width: 120,title: '已领数量', sortable: true}, |
| | | {field: '10', width: 120,title: '已领面积', sortable: true}, |
| | | {field: '11',width: 120, title: '原片生产日期', sortable: true}, |
| | | columns: [ |
| | | {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50}, |
| | | {type: 'seq', fixed: "left", title: '自序', width: 50}, |
| | | |
| | | { |
| | | field: 'project_no', |
| | | width: 120, |
| | | title: '工程编号', |
| | | showOverflow: "ellipsis", |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'material_name', width: 120, title: '物料名称', filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'producer',title: '原片产地', filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'width', |
| | | title: '宽', |
| | | type: 'date', |
| | | attrs: {placeholder: '', type: 'date'}, |
| | | }, |
| | | {field: 'height', title: '高', showOverflow: "ellipsis"}, |
| | | {field: 'quantity', title: '已领数量'}, |
| | | {field: 'area', title: '已领面积'}, |
| | | {field: 'date_of_manufacture', title: '原片生产日期'}, |
| | | {field: 'date', title: '领出日期'}, |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | ],//table body实际数据 |
| | | data: [],//table body实际数据 |
| | | //脚部求和 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | let footList=['9','10'] |
| | | return[ |
| | | footerMethod({columns, data}) {//页脚函数 |
| | | let footList = [''] |
| | | return [ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | |
| | | <div class="main-div-customer"> |
| | | <div id="selectForm"> |
| | | <el-row :gutter="0"> |
| | | <!-- <el-input placeholder="销售单号" v-model="form.name" style="width: 150px"/>--> |
| | | <!-- <el-input placeholder="项目名称" v-model="form.name" style="width: 150px"/>--> |
| | | |
| | | <el-date-picker |
| | | v-model="form.date1" |
| | | type="daterange" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | :default-time="defaultTime" |
| | | format="YYYY/MM/DD" |
| | | start-placeholder="开始时间" |
| | | style="width: 100px" |
| | | type="daterange" |
| | | value-format="YYYY-MM-DD" |
| | | /> |
| | | |
| | | |
| | | <el-button type="primary">查询</el-button> |
| | | <el-button type="primary" @click="getWorkOrder">查询</el-button> |
| | | </el-row> |
| | | |
| | | </div> |
| | | <vxe-grid |
| | | max-height="100%" |
| | | @filter-change="filterChanged" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | class="mytable-scrollbar" |
| | | max-height="100%" |
| | | v-bind="gridOptions" |
| | | |
| | | > |
| | |
| | | <!-- 下拉显示所有信息插槽--> |
| | | <template #content="{ row }"> |
| | | <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> |
| | | <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined "> |
| | | <span style="font-weight: bold">{{ item.title + ': ' }}</span> |
| | | <span>{{ row[item.field] }}</span> |
| | | </li> |
| | | </ul> |
| | | </template> |
| | | |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">编辑</el-button> |
| | | <el-button @click="getTableRow(row,'setType')" link type="primary" size="small">反审</el-button> |
| | | <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">删除</el-button> |
| | | </template> |
| | | |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <input type="type" v-model="option.data" @input="changeFilterEvent($event, option, $panel)"/> |
| | | <input v-model="option.data" type="type" @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | </template> |
| | | |
| | | <style scoped> |
| | | .main-div-customer{ |
| | | .main-div-customer { |
| | | width: 99%; |
| | | height: 100%; |
| | | } |
| | | |
| | | #selectForm { |
| | | width: 60%; |
| | | text-align: center; |
| | |
| | | <script setup> |
| | | |
| | | import {reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | let router=useRouter() |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/reportingWorks/ReportingWorkDetail', query: { id: row.id }}) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | | alert('我接收到子组件传送的删除信息') |
| | | break |
| | | } |
| | | case 'setType':{ |
| | | alert('我接收到子组件传送的反审状态') |
| | | break |
| | | } |
| | | } |
| | | } |
| | | import {useRouter} from 'vue-router' |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import {ElDatePicker, ElMessage} from "element-plus"; |
| | | import {useI18n} from 'vue-i18n' |
| | | import {changeFilterEvent, filterChanged} from "@/hook" |
| | | //语言获取 |
| | | const {t} = useI18n() |
| | | let router = useRouter() |
| | | let filterData = ref({}) |
| | | //提交的表单 |
| | | const form = reactive({ |
| | | date1: '', |
| | | orderId: '', |
| | | project: '' |
| | | }) |
| | | |
| | | |
| | | |
| | | //表尾求和 |
| | | const sumNum = (list, field) => { |
| | |
| | | return count.toFixed(2) |
| | | } |
| | | |
| | | //子组件接收参数 |
| | | //定义滚动条高度 |
| | | let scrollTop = ref(null) |
| | | let scrollHeight = ref(null) |
| | | let clientHeight = ref(null) |
| | | const scrollEvnt = (row) => { |
| | | // 内容高度 |
| | | scrollTop.value = row.$event.target.scrollTop |
| | | scrollHeight.value = row.$event.target.scrollHeight |
| | | clientHeight.value = row.$event.target.clientHeight |
| | | } |
| | | |
| | | |
| | | //定义页面总页数 |
| | | let pageTotal = ref('') |
| | | //定义数据返回结果 |
| | | let produceList = ref([]) |
| | | //定义当前页数 |
| | | let pageNum = ref(1) |
| | | let pageState = null |
| | | |
| | | let inputVal = form.orderId |
| | | if (inputVal == '') { |
| | | inputVal = null |
| | | } |
| | | let total = reactive({ |
| | | pageTotal: 0, |
| | | dataTotal: 0, |
| | | pageSize: 100 |
| | | }) |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | | processType: [], |
| | | }) |
| | | //第一次加载数据 |
| | | request.post(`/report/splittingDetailsOutside/${inputVal}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | // total.dataTotal = res.data.total.total*1 |
| | | // total.pageTotal= res.data.total.pageTotal |
| | | // pageTotal.value = res.data.total |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | |
| | | //页脚翻页查询 |
| | | const selectPageList = () => { |
| | | let inputVal = form.orderId |
| | | if (inputVal == '') { |
| | | inputVal = null |
| | | } |
| | | |
| | | request.post(`/report/selectReportingWork/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${inputVal}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //点击查询 |
| | | const getWorkOrder = () => { |
| | | let inputVal = form.orderId |
| | | if (inputVal == '') { |
| | | inputVal = null |
| | | } |
| | | request.post(`/report/splittingDetailsOutside/${inputVal}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | // total.dataTotal = res.data.total.total*1 |
| | | // total.pageTotal= res.data.total.pageTotal |
| | | // pageTotal.value = res.data.total |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //页脚跳转 |
| | | const handlePageChange = ({currentPage, pageSize}) => { |
| | | pageNum.value = currentPage |
| | | total.pageTotal = pageSize |
| | | selectPageList() |
| | | } |
| | | |
| | | |
| | | /*使用筛选,后端获取数据*/ |
| | | // const changeFilterEvent = (event, option, $panel,) => { |
| | | // // 手动触发筛选 |
| | | // $panel.changeOption(event, !!option.data, option) |
| | | // } |
| | | |
| | | // function filterChanged(column){ |
| | | // //gridOptions.loading=true |
| | | // //筛选条件发生变化条件发生变化 |
| | | // let value = column.datas[0]!=undefined?column.datas[0]:'' |
| | | // value = value.trim() |
| | | // //判断是否存在外键 |
| | | // if (column.property.indexOf('.')>-1){ |
| | | // const columnArr = column.property.split('.') |
| | | // filterData.value[columnArr[0]] = { |
| | | // [columnArr[1]]:value |
| | | // } |
| | | // }else{ |
| | | // filterData.value[column.property] = value |
| | | // } |
| | | // |
| | | // gridOptions.loading = true |
| | | // |
| | | // } |
| | | |
| | | /*后端返回结果多层嵌套展示*/ |
| | | const hasDecimal = (value) => { |
| | | const regex = /\./; // 定义正则表达式,查找小数点 |
| | | return regex.test(value); // 返回true/false |
| | | } |
| | | |
| | | //子组件接收参数 |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮 |
| | | stripe: true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 50},//鼠标移动或选择高亮 |
| | | id: 'CustomerList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | scrollY: {enabled: true},//开启虚拟滚动 |
| | | showOverflow: true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | // remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | |
| | | mode: 'row', |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | { type: 'seq',fixed:"left", title: '自序', width: 50 }, |
| | | {field: '1', width: 130, title: '流程卡号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, }, |
| | | {field: '2',width: 100, title: '序号', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: '3', width: 100,title: '落架顺序', sortable: true,}, |
| | | {field: '4',width: 120, title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '5', width: 100,title: '批次', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: '6', width: 100,title: '楼层编号', sortable: true}, |
| | | {field: '7',width: 90, title: '宽', sortable: true}, |
| | | {field: '8',width: 90, title: '高', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: '9', width: 90,title: '数量', sortable: true}, |
| | | {field: '10', width: 90,title: '面积', sortable: true}, |
| | | {field: '11',width: 90, title: '形状', sortable: true}, |
| | | {field: '12',width: 120, title: '备注', sortable: true}, |
| | | columns: [ |
| | | {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50}, |
| | | {type: 'seq', fixed: "left", title: '自序', width: 50}, |
| | | { |
| | | field: 'process_id', width: 120, title: '流程卡号', filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'order_number', |
| | | width: 120, |
| | | title: '订单序号', |
| | | showOverflow: "ellipsis", |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'technology_number', width: 130, title: '小片顺序', filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'project', width: 120, title: '项目名称', filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'batch', width: 100, title: '批次', filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | {field: 'child_width', width: 120, title: '宽'}, |
| | | {field: 'child_height', width: 120, title: '高'}, |
| | | {field: 'quantity', width: 120, title: '订单数'}, |
| | | |
| | | {field: 'area', width: 100, title: '面积'}, |
| | | {field: 'shape', width: 120, title: '形状',}, |
| | | {field: 'remarks', width: 100, title: '备注'}, |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | 1:'NG23120702A01', |
| | | 2:'8', |
| | | 3:'1', |
| | | 4:'银隆广场', |
| | | 5:'补8', |
| | | 6:'J8-B1-BD-BL1-009 ', |
| | | 7:'1764', |
| | | 8:'2466', |
| | | 9:'5', |
| | | 10:'23.13', |
| | | 11:'普形', |
| | | 12:'', |
| | | |
| | | }, |
| | | { |
| | | 1:'NG23120702A01', |
| | | 2:'8', |
| | | 3:'1', |
| | | 4:'银隆广场', |
| | | 5:'补8', |
| | | 6:'J8-B1-BD-BL1-009 ', |
| | | 7:'1764', |
| | | 8:'2466', |
| | | 9:'5', |
| | | 10:'23.13', |
| | | 11:'普形', |
| | | 12:'', |
| | | |
| | | }, |
| | | { |
| | | 1:'NG23120702A01', |
| | | 2:'8', |
| | | 3:'1', |
| | | 4:'银隆广场', |
| | | 5:'补8', |
| | | 6:'J8-B1-BD-BL1-009 ', |
| | | 7:'1764', |
| | | 8:'2466', |
| | | 9:'5', |
| | | 10:'23.13', |
| | | 11:'普形', |
| | | 12:'', |
| | | |
| | | }, |
| | | { |
| | | 1:'NG23120702A01', |
| | | 2:'8', |
| | | 3:'1', |
| | | 4:'银隆广场', |
| | | 5:'补8', |
| | | 6:'J8-B1-BD-BL1-009 ', |
| | | 7:'1764', |
| | | 8:'2466', |
| | | 9:'5', |
| | | 10:'23.13', |
| | | 11:'普形', |
| | | 12:'', |
| | | |
| | | }, |
| | | ],//table body实际数据 |
| | | data: [],//table body实际数据 |
| | | //脚部求和 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | let footList=['9','10'] |
| | | return[ |
| | | footerMethod({columns, data}) {//页脚函数 |
| | | let footList = [''] |
| | | return [ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | |
| | | |
| | | }) |
| | | |
| | | const value = ref('') |
| | | const options = [ |
| | | { |
| | | value: 'Option1', |
| | | label: 'Option1', |
| | | }, |
| | | { |
| | | value: 'Option2', |
| | | label: 'Option2', |
| | | }, |
| | | { |
| | | value: 'Option3', |
| | | label: 'Option3', |
| | | }, |
| | | ] |
| | | |
| | | const form = reactive({ |
| | | name: '', |
| | | region: '', |
| | | date1: '', |
| | | date2: '', |
| | | delivery: false, |
| | | type: [], |
| | | resource: '', |
| | | desc: '', |
| | | |
| | | }) |
| | | |
| | | </script> |
| | | |
| | |
| | | <div class="main-div-customer"> |
| | | <div id="selectForm"> |
| | | <el-row :gutter="0"> |
| | | <el-input placeholder="销售单号" v-model="form.name" style="width: 200px"/> |
| | | |
| | | <el-input v-model="form.orderId" :placeholder="$t('order.orderId')" clearable style="width: 130px"></el-input> |
| | | |
| | | <el-button type="primary">查询</el-button> |
| | | |
| | | <el-button type="primary" @click="getWorkOrder">查询</el-button> |
| | | </el-row> |
| | | |
| | | </div> |
| | | <vxe-grid |
| | | max-height="100%" |
| | | @filter-change="filterChanged" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | class="mytable-scrollbar" |
| | | max-height="100%" |
| | | v-bind="gridOptions" |
| | | |
| | | > |
| | |
| | | <!-- 下拉显示所有信息插槽--> |
| | | <template #content="{ row }"> |
| | | <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> |
| | | <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined "> |
| | | <span style="font-weight: bold">{{ item.title + ': ' }}</span> |
| | | <span>{{ row[item.field] }}</span> |
| | | </li> |
| | | </ul> |
| | | </template> |
| | | |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">编辑</el-button> |
| | | <el-button @click="getTableRow(row,'setType')" link type="primary" size="small">反审</el-button> |
| | | <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">删除</el-button> |
| | | </template> |
| | | |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <input type="type" v-model="option.data" @input="changeFilterEvent($event, option, $panel)"/> |
| | | <input v-model="option.data" type="type" @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | </template> |
| | | |
| | | <style scoped> |
| | | .main-div-customer{ |
| | | .main-div-customer { |
| | | width: 99%; |
| | | height: 100%; |
| | | } |
| | | |
| | | #selectForm { |
| | | width: 60%; |
| | | text-align: center; |
| | |
| | | <script setup> |
| | | |
| | | import {reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | import request from "@/utils/request" |
| | | import {ElDatePicker, ElMessage} from "element-plus" |
| | | import {nextTick, onMounted, onUnmounted, reactive, ref, watch} from "vue" |
| | | import {Search} from "@element-plus/icons-vue" |
| | | import {useRouter} from 'vue-router' |
| | | import {changeFilterEvent, filterChanged} from "@/hook" |
| | | |
| | | import { useI18n } from 'vue-i18n' |
| | | //语言获取 |
| | | const { t } = useI18n() |
| | | let router=useRouter() |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/reportingWorks/ReportingWorkDetail', query: { id: row.id }}) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | | alert('我接收到子组件传送的删除信息') |
| | | break |
| | | } |
| | | case 'setType':{ |
| | | alert('我接收到子组件传送的反审状态') |
| | | break |
| | | } |
| | | |
| | | let props = defineProps({ |
| | | orderId:null |
| | | }) |
| | | //提交的表单 |
| | | const time = reactive({ |
| | | date1: '', |
| | | }) |
| | | onMounted(()=>{ |
| | | if(props.orderId===null || props.orderId===undefined || props.orderId===''){ |
| | | return |
| | | } |
| | | form.orderId = props.orderId |
| | | getWorkOrder() |
| | | }) |
| | | |
| | | //获取七天前到当前时间 |
| | | function getNowTime() { |
| | | const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 7) |
| | | .toISOString() |
| | | .replace('T', ' ') |
| | | .slice(0, 10) //默认开始时间7天前 |
| | | const end = new Date(new Date().getTime() + 3600 * 1000 * 24) |
| | | .toISOString() |
| | | .replace('T', ' ') |
| | | .slice(0, 10)//默认结束时间当前时间 |
| | | return [start, end] |
| | | } |
| | | |
| | | time.date1 = getNowTime() |
| | | |
| | | |
| | | //表尾求和 |
| | | const sumNum = (list, field) => { |
| | |
| | | return count.toFixed(2) |
| | | } |
| | | |
| | | //子组件接收参数 |
| | | //定义滚动条高度 |
| | | let scrollTop = ref(null) |
| | | let scrollHeight = ref(null) |
| | | let clientHeight = ref(null) |
| | | const scrollEvnt = (row) => { |
| | | // 内容高度 |
| | | scrollTop.value = row.$event.target.scrollTop |
| | | scrollHeight.value = row.$event.target.scrollHeight |
| | | clientHeight.value = row.$event.target.clientHeight |
| | | } |
| | | //筛选条件,有外键需要先定义明细里面的数据 |
| | | let filterData = ref({ |
| | | order: { |
| | | project: '' |
| | | }, |
| | | orderDetail: { |
| | | productId: '', |
| | | productName: '', |
| | | computeGrossArea: '', |
| | | processingNote: '', |
| | | } |
| | | }) |
| | | const columns = [ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | {field: 'customer_name', width: 150, title: '客户名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged}, |
| | | {field: 'project',width: 130, title: '项目名称' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged}, |
| | | {field: 'batch', width: 120,title: '批次',filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged}, |
| | | {field: 'order_id',width: 110, title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged}, |
| | | {field: 'quantity', width: 90,title: '订单数量',showOverflow:"ellipsis"}, |
| | | {field: 'area', width: 90,title: '订单面积'}, |
| | | {field: 'shippedQuantity',width: 90, title: '发货数量'}, |
| | | {field: 'shippedArea',width: 120, title: '发货面积'}, |
| | | ] |
| | | //需要合并的列 |
| | | let column = [1,2,3] |
| | | //点击查询 |
| | | const getWorkOrder = () => { |
| | | let startTime = time.date1[0] |
| | | let endTime = time.date1[1] |
| | | request.post(`/report/taskCompletionStatus/${startTime}/${endTime}`,column).then((res) => { |
| | | if (res.code == 200) { |
| | | if(res.data.data.length===0){ |
| | | ElMessage.warning('未查询到此订单数据') |
| | | return |
| | | } |
| | | gridOptions.columns = JSON.parse(JSON.stringify(columns)) |
| | | res.data.title.forEach(item =>{ |
| | | let column = {slots: { default: 'quantitySum' }, width: 90,title: item.process} |
| | | gridOptions.columns.push(column) |
| | | }) |
| | | res.data.data.forEach(item => { |
| | | item.reportWorkQuantity=JSON.parse(item.reportWorkQuantity) |
| | | item.reportWorkQuantityCount=JSON.parse(item.reportWorkQuantityCount) |
| | | }) |
| | | mergeCells.value = res.data.mergeCell |
| | | xGrid.value.loadData(res.data.data) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | const quantitySum = ( row,column )=>{ |
| | | const reportWorkQuantity = row.reportWorkQuantity[column.title] || 0 |
| | | const reportWorkQuantityCount = row.reportWorkQuantityCount[column.title] || 0 |
| | | if(reportWorkQuantity===reportWorkQuantityCount){ |
| | | return reportWorkQuantity |
| | | } |
| | | |
| | | return (reportWorkQuantity |
| | | +'(' |
| | | +reportWorkQuantityCount |
| | | +')' ) |
| | | //return |
| | | } |
| | | |
| | | |
| | | /*后端返回结果多层嵌套展示*/ |
| | | const hasDecimal = (value) => { |
| | | const regex = /\./; // 定义正则表达式,查找小数点 |
| | | return regex.test(value); // 返回true/false |
| | | } |
| | | |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮 |
| | | id: 'CustomerList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | |
| | | mode: 'row', |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | { type: 'seq',fixed:"left", title: '自序', width: 50 }, |
| | | {field: '1', width: 120, title: '客户名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, }, |
| | | {field: '2',width: 120, title: '项目名称', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: '3', width: 100,title: '批次', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: '4',width: 120, title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '5', width: 100,title: '产品大类', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: '6', width: 100,title: '产品小类', sortable: true}, |
| | | {field: '7',width: 100, title: '订单数', sortable: true}, |
| | | {field: '8',width: 100, title: '总面积', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: '9', width: 120,title: '发货数量', sortable: true}, |
| | | {field: '10', width: 120,title: '发货面积', sortable: true}, |
| | | {field: '11',width: 120, title: '报表日期', sortable: true}, |
| | | {field: '12',width: 90, title: '切割', sortable: true}, |
| | | {field: '13',width: 90, title: '磨边', sortable: true}, |
| | | {field: '14',width: 90, title: '钢化', sortable: true}, |
| | | ],//表头按钮 |
| | | columns:[],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | | // buttons: [{ |
| | | // |
| | | // }], |
| | | import: false, |
| | | export: true, |
| | | // import: false, |
| | | // export: true, |
| | | print: true, |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | 1:'西安高科幕墙门窗有限公司 ', |
| | | 2:'银隆广场', |
| | | 3:'补8', |
| | | 4:'NG23120702', |
| | | 5:'中空玻璃', |
| | | 6:'双平钢中空', |
| | | 7:'1', |
| | | 8:'1.88', |
| | | 9:'', |
| | | 10:'', |
| | | 11:'2023-12-17', |
| | | 12:'5', |
| | | 13:'5', |
| | | 14:'5', |
| | | |
| | | }, |
| | | { |
| | | 1:'西安高科幕墙门窗有限公司 ', |
| | | 2:'银隆广场', |
| | | 3:'补8', |
| | | 4:'NG23120702', |
| | | 5:'中空玻璃', |
| | | 6:'双平钢中空', |
| | | 7:'1', |
| | | 8:'1.88', |
| | | 9:'', |
| | | 10:'', |
| | | 11:'2023-12-17', |
| | | 12:'5', |
| | | 13:'5', |
| | | 14:'5', |
| | | |
| | | }, |
| | | { |
| | | 1:'西安高科幕墙门窗有限公司 ', |
| | | 2:'银隆广场', |
| | | 3:'补8', |
| | | 4:'NG23120702', |
| | | 5:'中空玻璃', |
| | | 6:'双平钢中空', |
| | | 7:'1', |
| | | 8:'1.88', |
| | | 9:'', |
| | | 10:'', |
| | | 11:'2023-12-17', |
| | | 12:'5', |
| | | 13:'5', |
| | | 14:'5', |
| | | |
| | | }, |
| | | { |
| | | 1:'西安高科幕墙门窗有限公司 ', |
| | | 2:'银隆广场', |
| | | 3:'补8', |
| | | 4:'NG23120702', |
| | | 5:'中空玻璃', |
| | | 6:'双平钢中空', |
| | | 7:'1', |
| | | 8:'1.88', |
| | | 9:'', |
| | | 10:'', |
| | | 11:'2023-12-17', |
| | | 12:'5', |
| | | 13:'5', |
| | | 14:'5', |
| | | |
| | | }, |
| | | ],//table body实际数据 |
| | | //脚部求和 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | let footList=['7','8','9','10'] |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | | } |
| | | if (footList.includes(column.field)) { |
| | | return sumNum(data, column.field) |
| | | } |
| | | return '' |
| | | }) |
| | | ] |
| | | } |
| | | // footerMethod ({ columns, data }) {//页脚函数 |
| | | // let footList=['7','8','9','10'] |
| | | // return[ |
| | | // columns.map((column, columnIndex) => { |
| | | // if (columnIndex === 0) { |
| | | // return '合计:' |
| | | // } |
| | | // if (footList.includes(column.field)) { |
| | | // return sumNum(data, column.field) |
| | | // } |
| | | // return '' |
| | | // }) |
| | | // ] |
| | | // } |
| | | |
| | | }) |
| | | |
| | | const value = ref('') |
| | | const options = [ |
| | | { |
| | | value: 'Option1', |
| | | label: 'Option1', |
| | | }, |
| | | { |
| | | value: 'Option2', |
| | | label: 'Option2', |
| | | }, |
| | | { |
| | | value: 'Option3', |
| | | label: 'Option3', |
| | | }, |
| | | ] |
| | | |
| | | |
| | | const form = reactive({ |
| | | name: '', |
| | | region: '', |
| | | date1: '', |
| | | date2: '', |
| | | delivery: false, |
| | | type: [], |
| | | resource: '', |
| | | desc: '', |
| | | orderId: '', |
| | | |
| | | }) |
| | | |
| | | const mergeCells = ref([ |
| | | |
| | | ]) |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div class="main-div-customer"> |
| | | <div class="main-div-customer" > |
| | | <div id="selectForm"> |
| | | <el-row :gutter="0"> |
| | | <!-- <el-input placeholder="销售单号" v-model="form.name" style="width: 150px"/>--> |
| | | <!-- <el-input placeholder="项目名称" v-model="form.name" style="width: 150px"/>--> |
| | | |
| | | <!-- <el-input--> |
| | | <!-- v-model="form.orderId"--> |
| | | <!-- clearable--> |
| | | <!-- :disabled="props.orderId"--> |
| | | <!-- :placeholder="$t('order.orderId')"--> |
| | | <!-- style="width: 130px"></el-input>--> |
| | | <el-date-picker |
| | | v-model="form.date1" |
| | | type="daterange" |
| | | start-placeholder="开始时间" |
| | | v-model="time.date1" |
| | | end-placeholder="结束时间" |
| | | :default-time="defaultTime" |
| | | format="YYYY/MM/DD" |
| | | start-placeholder="开始时间" |
| | | style="width: 100px" |
| | | type="daterange" |
| | | value-format="YYYY-MM-DD" |
| | | /> |
| | | |
| | | <el-select v-model="value" class="m-2" placeholder="查询类型"> |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | <el-button type="primary">查询</el-button> |
| | | <el-button |
| | | :disabled="props.orderId" |
| | | @click="getWorkOrder" |
| | | id="select" |
| | | type="primary" :icon="Search">{{$t('basicData.search')}} |
| | | |
| | | </el-button> |
| | | </el-row> |
| | | |
| | | </div> |
| | | <vxe-grid |
| | | max-height="100%" |
| | | height="400px" |
| | | @filter-change="filterChanged" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | :merge-cells="mergeCells" |
| | | |
| | | > |
| | | <!-- @toolbar-button-click="toolbarButtonClickEvent"--> |
| | |
| | | </ul> |
| | | </template> |
| | | |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">编辑</el-button> |
| | | <el-button @click="getTableRow(row,'setType')" link type="primary" size="small">反审</el-button> |
| | | <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">删除</el-button> |
| | | </template> |
| | | |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | |
| | | </div> |
| | | </template> |
| | | |
| | | <template #quantitySum="{ row,column }"> |
| | | <span>{{ quantitySum(row,column) }} </span> |
| | | </template> |
| | | |
| | | |
| | | </vxe-grid> |
| | | </div> |
| | |
| | | // total.dataTotal = res.data.total.total*1 |
| | | // total.pageTotal= res.data.total.pageTotal |
| | | // pageTotal.value = res.data.total |
| | | console.log(res.data.data) |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | titleSelectJson.value.processType = res.data.process |
| | | xGrid.value.reloadData(produceList) |
| | |
| | | if (inputProject == '') { |
| | | inputProject = null |
| | | } |
| | | console.log(startTime, endTime) |
| | | request.post(`/report/workInProgress/${startTime}/${endTime}/${inputVal}/${inputProject}/${selectProcesses}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | // total.dataTotal = res.data.total.total*1 |
| | | // total.pageTotal= res.data.total.pageTotal |
| | | // pageTotal.value = res.data.total |
| | | console.log(res.data.data) |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | } else { |
| | |
| | | <script setup> |
| | | |
| | | import {reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | let router=useRouter() |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/reportingWorks/ReportingWorkDetail', query: { id: row.id }}) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | | alert('我接收到子组件传送的删除信息') |
| | | break |
| | | } |
| | | case 'setType':{ |
| | | alert('我接收到子组件传送的反审状态') |
| | | break |
| | | } |
| | | } |
| | | } |
| | | import {useRouter} from 'vue-router' |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import {ElDatePicker, ElMessage} from "element-plus"; |
| | | import {useI18n} from 'vue-i18n' |
| | | import {changeFilterEvent, filterChanged} from "@/hook" |
| | | //语言获取 |
| | | const {t} = useI18n() |
| | | let router = useRouter() |
| | | let filterData = ref({}) |
| | | //提交的表单 |
| | | const form = reactive({ |
| | | date1: '', |
| | | orderId: '', |
| | | project: '' |
| | | }) |
| | | |
| | | //工序 |
| | | const value = ref('磨边') |
| | | |
| | | //表尾求和 |
| | | const sumNum = (list, field) => { |
| | |
| | | return count.toFixed(2) |
| | | } |
| | | |
| | | //子组件接收参数 |
| | | //定义滚动条高度 |
| | | let scrollTop = ref(null) |
| | | let scrollHeight = ref(null) |
| | | let clientHeight = ref(null) |
| | | const scrollEvnt = (row) => { |
| | | // 内容高度 |
| | | scrollTop.value = row.$event.target.scrollTop |
| | | scrollHeight.value = row.$event.target.scrollHeight |
| | | clientHeight.value = row.$event.target.clientHeight |
| | | } |
| | | |
| | | |
| | | //定义页面总页数 |
| | | let pageTotal = ref('') |
| | | //定义数据返回结果 |
| | | let produceList = ref([]) |
| | | //定义当前页数 |
| | | let pageNum = ref(1) |
| | | let pageState = null |
| | | |
| | | //获取七天前到当前时间 |
| | | function getNowTime() { |
| | | const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 7) |
| | | .toISOString() |
| | | .replace('T', ' ') |
| | | .slice(0, 10) //默认开始时间7天前 |
| | | const end = new Date(new Date().getTime() + 3600 * 1000 * 24) |
| | | .toISOString() |
| | | .replace('T', ' ') |
| | | .slice(0, 10)//默认结束时间当前时间 |
| | | return [start, end] |
| | | } |
| | | |
| | | |
| | | //第一次加载获取近七天时间和默认状态 |
| | | form.date1 = getNowTime() |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let selectProcesses = value.value |
| | | let total = reactive({ |
| | | pageTotal: 0, |
| | | dataTotal: 0, |
| | | pageSize: 100 |
| | | }) |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | | processType: [], |
| | | }) |
| | | //第一次加载数据 |
| | | request.post(`/report/yield/${startTime}/${endTime}/${selectProcesses}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | // total.dataTotal = res.data.total.total*1 |
| | | // total.pageTotal= res.data.total.pageTotal |
| | | // pageTotal.value = res.data.total |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | titleSelectJson.value.processType = res.data.process |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | |
| | | //页脚翻页查询 |
| | | const selectPageList = () => { |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | |
| | | request.post(`/report/yield/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${inputVal}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | |
| | | |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //点击查询 |
| | | const getWorkOrder = () => { |
| | | |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let selectProcesses = value.value |
| | | request.post(`/report/yield/${startTime}/${endTime}/${selectProcesses}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | // total.dataTotal = res.data.total.total*1 |
| | | // total.pageTotal= res.data.total.pageTotal |
| | | // pageTotal.value = res.data.total |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //页脚跳转 |
| | | const handlePageChange = ({currentPage, pageSize}) => { |
| | | pageNum.value = currentPage |
| | | total.pageTotal = pageSize |
| | | selectPageList() |
| | | } |
| | | |
| | | |
| | | /*使用筛选,后端获取数据*/ |
| | | // const changeFilterEvent = (event, option, $panel,) => { |
| | | // // 手动触发筛选 |
| | | // $panel.changeOption(event, !!option.data, option) |
| | | // } |
| | | |
| | | // function filterChanged(column){ |
| | | // //gridOptions.loading=true |
| | | // //筛选条件发生变化条件发生变化 |
| | | // let value = column.datas[0]!=undefined?column.datas[0]:'' |
| | | // value = value.trim() |
| | | // //判断是否存在外键 |
| | | // if (column.property.indexOf('.')>-1){ |
| | | // const columnArr = column.property.split('.') |
| | | // filterData.value[columnArr[0]] = { |
| | | // [columnArr[1]]:value |
| | | // } |
| | | // }else{ |
| | | // filterData.value[column.property] = value |
| | | // } |
| | | // |
| | | // gridOptions.loading = true |
| | | // |
| | | // } |
| | | |
| | | /*后端返回结果多层嵌套展示*/ |
| | | const hasDecimal = (value) => { |
| | | const regex = /\./; // 定义正则表达式,查找小数点 |
| | | return regex.test(value); // 返回true/false |
| | | } |
| | | |
| | | //子组件接收参数 |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮 |
| | | stripe: true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 50},//鼠标移动或选择高亮 |
| | | id: 'CustomerList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | scrollY: {enabled: true},//开启虚拟滚动 |
| | | showOverflow: true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | // remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | |
| | | mode: 'row', |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | { type: 'seq',fixed:"left", title: '自序', width: 50 }, |
| | | {field: '1', title: '工序',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, }, |
| | | {field: '2', title: '销售单号', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: '3',title: '客户名称', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: '4', title: '成品名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '5',title: '完工面积', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: '6',title: '次破面积', sortable: true}, |
| | | {field: '7', title: '总面积', sortable: true}, |
| | | {field: '8', title: '成品率', sortable: true,}, |
| | | columns: [ |
| | | {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50}, |
| | | {type: 'seq', fixed: "left", title: '自序', width: 50}, |
| | | { |
| | | field: 'process', width: 120, title: '工序', filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'order_id', |
| | | width: 120, |
| | | title: '销售单号', |
| | | showOverflow: "ellipsis", |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'customer_name', title: '客户名称', filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'project', |
| | | title: '项目名称', |
| | | showOverflow: "ellipsis", |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | |
| | | { |
| | | field: 'product_name', title: '产品名称', filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'finishedArea', title: '完工面积', filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | filterMethod: filterChanged |
| | | }, |
| | | { |
| | | field: 'brokenArea', |
| | | title: '次破面积', |
| | | type: 'date', |
| | | attrs: {placeholder: '', type: 'date'}, |
| | | }, |
| | | {field: 'area', width: 120, title: '总面积', showOverflow: "ellipsis"}, |
| | | {field: 'finished', width: 100, title: '成品率'}, |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | 1:'夹层', |
| | | 2:'NG23103001', |
| | | 3:'慕青文化', |
| | | 4:'10mmLYTM-140弯钢化(外)+2.28PVB透明+10mm白玻弯钢化(内)', |
| | | 5:'256.67', |
| | | 6:'7.94', |
| | | 7:'264.61', |
| | | 8:'97.0%', |
| | | |
| | | }, |
| | | { |
| | | 1:'夹层', |
| | | 2:'NG23103001', |
| | | 3:'慕青文化', |
| | | 4:'10mmLYTM-140弯钢化(外)+2.28PVB透明+10mm白玻弯钢化(内)', |
| | | 5:'256.67', |
| | | 6:'7.94', |
| | | 7:'264.61', |
| | | 8:'97.0%', |
| | | |
| | | }, |
| | | { |
| | | 1:'夹层', |
| | | 2:'NG23103001', |
| | | 3:'慕青文化', |
| | | 4:'10mmLYTM-140弯钢化(外)+2.28PVB透明+10mm白玻弯钢化(内)', |
| | | 5:'256.67', |
| | | 6:'7.94', |
| | | 7:'264.61', |
| | | 8:'97.0%', |
| | | |
| | | }, |
| | | { |
| | | 1:'夹层', |
| | | 2:'NG23103001', |
| | | 3:'慕青文化', |
| | | 4:'10mmLYTM-140弯钢化(外)+2.28PVB透明+10mm白玻弯钢化(内)', |
| | | 5:'256.67', |
| | | 6:'7.94', |
| | | 7:'264.61', |
| | | 8:'97.0%', |
| | | |
| | | }, |
| | | |
| | | ],//table body实际数据 |
| | | data: [],//table body实际数据 |
| | | //脚部求和 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | let footList=['5','6','7'] |
| | | return[ |
| | | footerMethod({columns, data}) {//页脚函数 |
| | | let footList = [''] |
| | | return [ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | |
| | | |
| | | }) |
| | | |
| | | const value = ref('') |
| | | const options = [ |
| | | { |
| | | value: 'Option1', |
| | | label: 'Option1', |
| | | }, |
| | | { |
| | | value: 'Option2', |
| | | label: 'Option2', |
| | | }, |
| | | { |
| | | value: 'Option3', |
| | | label: 'Option3', |
| | | }, |
| | | ] |
| | | |
| | | const form = reactive({ |
| | | name: '', |
| | | region: '', |
| | | date1: '', |
| | | date2: '', |
| | | delivery: false, |
| | | type: [], |
| | | resource: '', |
| | | desc: '', |
| | | |
| | | }) |
| | | |
| | | </script> |
| | | |
| | |
| | | <div class="main-div-customer"> |
| | | <div id="selectForm"> |
| | | <el-row :gutter="0"> |
| | | <!-- <el-input placeholder="销售单号" v-model="form.name" style="width: 150px"/>--> |
| | | <!-- <el-input placeholder="项目名称" v-model="form.name" style="width: 150px"/>--> |
| | | |
| | | <el-date-picker |
| | | v-model="form.date1" |
| | | type="daterange" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | :default-time="defaultTime" |
| | | format="YYYY/MM/DD" |
| | | start-placeholder="开始时间" |
| | | style="width: 100px" |
| | | type="daterange" |
| | | value-format="YYYY-MM-DD" |
| | | /> |
| | | |
| | | <el-select v-model="value" class="m-2" placeholder="查询类型"> |
| | | <el-select v-model="value" clearable default-value="default_city" style="width: 120px"> |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | v-for="item in titleSelectJson['processType']" |
| | | :key="item.id" |
| | | :label="item.basic_name" |
| | | :value="item.basic_name" |
| | | /> |
| | | </el-select> |
| | | <el-button type="primary">查询</el-button> |
| | | <el-button type="primary" @click="getWorkOrder">查询</el-button> |
| | | </el-row> |
| | | |
| | | </div> |
| | | <vxe-grid |
| | | max-height="100%" |
| | | @filter-change="filterChanged" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | class="mytable-scrollbar" |
| | | max-height="100%" |
| | | v-bind="gridOptions" |
| | | |
| | | > |
| | |
| | | <!-- 下拉显示所有信息插槽--> |
| | | <template #content="{ row }"> |
| | | <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> |
| | | <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined "> |
| | | <span style="font-weight: bold">{{ item.title + ': ' }}</span> |
| | | <span>{{ row[item.field] }}</span> |
| | | </li> |
| | | </ul> |
| | | </template> |
| | | |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">编辑</el-button> |
| | | <el-button @click="getTableRow(row,'setType')" link type="primary" size="small">反审</el-button> |
| | | <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">删除</el-button> |
| | | </template> |
| | | |
| | | |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <input type="type" v-model="option.data" @input="changeFilterEvent($event, option, $panel)"/> |
| | | <input v-model="option.data" type="type" @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | </template> |
| | | |
| | | <style scoped> |
| | | .main-div-customer{ |
| | | .main-div-customer { |
| | | width: 99%; |
| | | height: 100%; |
| | | } |
| | | |
| | | #selectForm { |
| | | width: 60%; |
| | | text-align: center; |
| | |
| | | |
| | | } |
| | | |
| | | @ApiOperation("次破明细报表") |
| | | @PostMapping("/damageReport/{selectTime1}/{selectTime2}") |
| | | public Result damageReport( |
| | | @PathVariable Date selectTime1, |
| | | @PathVariable Date selectTime2, |
| | | @RequestBody Report report) { |
| | | return Result.seccess(reportService.selectDamageReportSv(selectTime1,selectTime2,report)); |
| | | |
| | | } |
| | | @ApiOperation("分架明细报表") |
| | | @PostMapping("/splittingDetailsOutside/{orderId}") |
| | | public Result splittingDetailsOutside( |
| | | @PathVariable String orderId, |
| | | @RequestBody Report report) { |
| | | return Result.seccess(reportService.splittingDetailsOutsideSv(orderId,report)); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("品质报表") |
| | | @PostMapping("/qualityReport/{selectTime1}/{selectTime2}") |
| | | public Result qualityReport( |
| | | @PathVariable Date selectTime1, |
| | | @PathVariable Date selectTime2, |
| | | @RequestBody Report report) { |
| | | return Result.seccess(reportService.qualityReportSv(selectTime1,selectTime2,report)); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("成品率报表") |
| | | @PostMapping("/yield/{selectTime1}/{selectTime2}/{selectProcesses}") |
| | | public Result yield( |
| | | @PathVariable Date selectTime1, |
| | | @PathVariable Date selectTime2, |
| | | @PathVariable String selectProcesses, |
| | | @RequestBody Report report) { |
| | | return Result.seccess(reportService.yieldSv(selectTime1,selectTime2,selectProcesses,report)); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("生产发货进度") |
| | | @PostMapping ("/productionSchedule/{orderId}") |
| | | public Result productionSchedule(@PathVariable String orderId, @RequestBody List<Integer> columns){ |
| | | return Result.seccess(reportService.productionScheduleSv(orderId,columns)); |
| | | } |
| | | |
| | | @ApiOperation("任务完成情况汇总进度") |
| | | @PostMapping ("/taskCompletionStatus/{selectTime1}/{selectTime2}") |
| | | public Result taskCompletionStatus(@PathVariable Date selectTime1, |
| | | @PathVariable Date selectTime2, |
| | | @RequestBody List<Integer> columns){ |
| | | return Result.seccess(reportService.taskCompletionStatusSv(selectTime1,selectTime2,columns)); |
| | | } |
| | | |
| | | @ApiOperation("订单计划分解") |
| | | @PostMapping ("/orderPlanDecomposition/{selectTime1}/{selectTime2}") |
| | | public Result orderPlanDecomposition(@PathVariable Date selectTime1, |
| | | @PathVariable Date selectTime2, |
| | | @RequestBody Report report){ |
| | | return Result.seccess(reportService.orderPlanDecompositionSv(selectTime1,selectTime2,report)); |
| | | } |
| | | |
| | | @ApiOperation("原片领料") |
| | | @PostMapping ("/rawMaterialRequisition/{selectTime1}/{selectTime2}") |
| | | public Result rawMaterialRequisition(@PathVariable Date selectTime1, |
| | | @PathVariable Date selectTime2, |
| | | @RequestBody Report report){ |
| | | return Result.seccess(reportService.rawMaterialRequisitionSv(selectTime1,selectTime2,report)); |
| | | } |
| | | } |
| | |
| | | List<Map<String, String>> processToBeCompletedMp(Date selectTime1, Date selectTime2, String orderId, |
| | | String inputProject, String selectProcesses, Report report); |
| | | |
| | | List<Map<String, String>> selectDamageReportMp(Date selectTime1, Date selectTime2, Report report); |
| | | |
| | | List<Map<String, String>> splittingDetailsOutsideMp(String orderId, Report report); |
| | | |
| | | List<Map<String, String>> qualityReportMp(Date selectTime1, Date selectTime2, Report report); |
| | | |
| | | List<Map<String, String>> yieldMp(Date selectTime1, Date selectTime2, String selectProcesses, Report report); |
| | | |
| | | List<Map<String, String>> productionScheduleMp(String orderId); |
| | | |
| | | List<Map<String, String>> taskCompletionStatusMp(Date selectTime1, Date selectTime2); |
| | | |
| | | List<Map<String, String>> orderPlanDecompositionMp(Date selectTime1, Date selectTime2, Report report); |
| | | |
| | | List<Map<String, String>> rawMaterialRequisitionMp(Date selectTime1, Date selectTime2, Report report); |
| | | |
| | | // Map<String, Integer> getWorkInProgressTotal( |
| | | // @Param("selectTime1") Date selectTime1, @Param("selectTime2") Date selectTime2, |
| | | // @Param("orderId") String orderId, @Param("inputProject") String inputProject, |
| | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.sql.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | List<Map<String, String>> filterLastProcess(String orderId, String orderNumber, String technologyNumber,String id); |
| | | |
| | | void insertByReportingWorkDetail(ReportingWorkDetail reportingWorkDetail, String processId, String thisProcess); |
| | | |
| | | List<Map<String,String>> filterOrderProcessCollect(Date selectTime1, Date selectTime2); |
| | | |
| | | List<Map<String, Integer>> getGlassLRowCollect(Date selectTime1, Date selectTime2); |
| | | } |
| | |
| | | map.put("process", productionSchedulingMapper.selectProcess()); |
| | | return map; |
| | | } |
| | | |
| | | public Map<String,Object> selectDamageReportSv(Date selectTime1, Date selectTime2, Report report) { |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("data",reportMapper.selectDamageReportMp( selectTime1, selectTime2,report)); |
| | | return map; |
| | | } |
| | | |
| | | public Map<String,Object> splittingDetailsOutsideSv(String orderId, Report report) { |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("data",reportMapper.splittingDetailsOutsideMp( orderId,report)); |
| | | return map; |
| | | } |
| | | |
| | | public Map<String,Object> qualityReportSv(Date selectTime1, Date selectTime2, Report report) { |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("data",reportMapper.qualityReportMp( selectTime1,selectTime2,report)); |
| | | return map; |
| | | } |
| | | |
| | | public Map<String,Object> yieldSv(Date selectTime1, Date selectTime2, String selectProcesses, Report report) { |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("data",reportMapper.yieldMp( selectTime1,selectTime2,selectProcesses,report)); |
| | | map.put("process", productionSchedulingMapper.selectProcess()); |
| | | return map; |
| | | } |
| | | |
| | | public Map<String, Object> productionScheduleSv(String orderId, List<Integer> columns) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | //获取表格内容数据 |
| | | map.put("data", reportMapper.productionScheduleMp(orderId)); |
| | | |
| | | //获取表头工序筛选数据 |
| | | List<Map<String,String>> processFilterList = orderProcessDetailMapper.filterOrderProcess(orderId); |
| | | List<Map<String,String>> processList = processFilterList; |
| | | |
| | | List<String> filterList = new ArrayList<>(); |
| | | //循环遍历数组,判断此序号当前的工序 |
| | | for (int i = 1; i < processFilterList.size(); i++) { |
| | | filterList.add(processFilterList.get(i).get("process")); |
| | | List<Map<String,String>> lastProcessList = |
| | | orderProcessDetailMapper.filterLastProcess( |
| | | orderId, |
| | | String.valueOf(processFilterList.get(i).get("order_number")), |
| | | String.valueOf(processFilterList.get(i).get("technology_number")), |
| | | String.valueOf(processFilterList.get(i).get("id")) |
| | | ); |
| | | if(!lastProcessList.isEmpty()){ |
| | | int finalI = i; |
| | | lastProcessList.forEach(lastProcess -> { |
| | | if(filterList.contains(lastProcess.get("process"))){ |
| | | processList.add(lastProcess); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | // 使用HashSet来记录已经遇到的value值 |
| | | Set<String> seenValues = new HashSet<>(); |
| | | // 创建一个新的List来存储结果 |
| | | List<Map<String, String>> uniqueList = new ArrayList<>(); |
| | | |
| | | // 反向遍历原始List |
| | | for (int i = processList.size() - 1; i >= 0; i--) { |
| | | Map<String, String> maps = processList.get(i); |
| | | String value = maps.values().iterator().next(); // 假设每个Map只有一个value |
| | | |
| | | // 如果value还没有被看到过,就添加到结果List和HashSet中 |
| | | if (!seenValues.contains(value)) { |
| | | uniqueList.add(0, maps); // 添加到结果List的开头,以保持原顺序 |
| | | seenValues.add(value); |
| | | } |
| | | } |
| | | map.put("title", uniqueList ); |
| | | |
| | | |
| | | |
| | | |
| | | List<Map<String,Integer>> getRowCount = orderProcessDetailMapper.getGlassLRow(orderId); |
| | | List<Map<String,Integer>> rowCount = new ArrayList<>(); |
| | | columns.forEach(col ->{ |
| | | getRowCount.forEach(row ->{ |
| | | Map<String,Integer> getRow = new HashMap<>(); |
| | | // { row: 0, col: 1, rowspan: 3, colspan: 0}, |
| | | getRow.put("row",row.get("RowNum")); |
| | | getRow.put("col",col); |
| | | getRow.put("rowspan",row.get("rowCount")); |
| | | getRow.put("colspan",0); |
| | | rowCount.add(getRow); |
| | | }); |
| | | }); |
| | | |
| | | |
| | | map.put("mergeCells",rowCount); |
| | | |
| | | return map; |
| | | } |
| | | |
| | | public Map<String, Object> taskCompletionStatusSv(Date selectTime1, Date selectTime2, List<Integer> columns) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | //获取表格内容数据 |
| | | map.put("data", reportMapper.taskCompletionStatusMp(selectTime1,selectTime2)); |
| | | |
| | | //获取表头工序筛选数据 |
| | | List<Map<String,String>> processFilterList = orderProcessDetailMapper.filterOrderProcessCollect(selectTime1,selectTime2); |
| | | List<Map<String,String>> processList = processFilterList; |
| | | |
| | | List<String> filterList = new ArrayList<>(); |
| | | //循环遍历数组,判断此序号当前的工序 |
| | | for (int i = 1; i < processFilterList.size(); i++) { |
| | | filterList.add(processFilterList.get(i).get("process")); |
| | | List<Map<String,String>> lastProcessList = |
| | | orderProcessDetailMapper.filterLastProcess( |
| | | String.valueOf(processFilterList.get(i).get("order_id")), |
| | | String.valueOf(processFilterList.get(i).get("order_number")), |
| | | String.valueOf(processFilterList.get(i).get("technology_number")), |
| | | String.valueOf(processFilterList.get(i).get("id")) |
| | | ); |
| | | if(!lastProcessList.isEmpty()){ |
| | | int finalI = i; |
| | | lastProcessList.forEach(lastProcess -> { |
| | | if(filterList.contains(lastProcess.get("process"))){ |
| | | processList.add(lastProcess); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | // 使用HashSet来记录已经遇到的value值 |
| | | Set<String> seenValues = new HashSet<>(); |
| | | // 创建一个新的List来存储结果 |
| | | List<Map<String, String>> uniqueList = new ArrayList<>(); |
| | | |
| | | // 反向遍历原始List |
| | | for (int i = processList.size() - 1; i >= 0; i--) { |
| | | Map<String, String> maps = processList.get(i); |
| | | String value = maps.values().iterator().next(); // 假设每个Map只有一个value |
| | | |
| | | // 如果value还没有被看到过,就添加到结果List和HashSet中 |
| | | if (!seenValues.contains(value)) { |
| | | uniqueList.add(0, maps); // 添加到结果List的开头,以保持原顺序 |
| | | seenValues.add(value); |
| | | } |
| | | } |
| | | map.put("title", uniqueList ); |
| | | |
| | | |
| | | |
| | | |
| | | List<Map<String,Integer>> getRowCount = orderProcessDetailMapper.getGlassLRowCollect(selectTime1,selectTime2); |
| | | List<Map<String,Integer>> rowCount = new ArrayList<>(); |
| | | columns.forEach(col ->{ |
| | | getRowCount.forEach(row ->{ |
| | | Map<String,Integer> getRow = new HashMap<>(); |
| | | // { row: 0, col: 1, rowspan: 3, colspan: 0}, |
| | | getRow.put("row",row.get("RowNum")); |
| | | getRow.put("col",col); |
| | | getRow.put("rowspan",row.get("rowCount")); |
| | | getRow.put("colspan",0); |
| | | rowCount.add(getRow); |
| | | }); |
| | | }); |
| | | |
| | | |
| | | map.put("mergeCells",rowCount); |
| | | |
| | | return map; |
| | | } |
| | | |
| | | public Map<String,Object> orderPlanDecompositionSv(Date selectTime1, Date selectTime2,Report report) { |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("data",reportMapper.orderPlanDecompositionMp( selectTime1,selectTime2,report)); |
| | | return map; |
| | | } |
| | | |
| | | public Map<String,Object> rawMaterialRequisitionSv(Date selectTime1, Date selectTime2, Report report) { |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("data",reportMapper.rawMaterialRequisitionMp( selectTime1,selectTime2,report)); |
| | | return map; |
| | | } |
| | | } |
| | |
| | | group by fc.process_id, fc.order_number, fc.technology_number |
| | | order by fc.process_id, fc.order_number, fc.technology_number |
| | | </select> |
| | | |
| | | <select id="selectDamageReportMp"> |
| | | SELECT |
| | | o.order_id, |
| | | o.project, |
| | | rw.process_id, |
| | | dd.order_number, |
| | | dd.technology_number, |
| | | date(rw.reporting_work_time) as reporting_work_time, |
| | | dd.responsible_process, |
| | | dd.responsible_team, |
| | | dd.responsible_equipment, |
| | | dd.breakage_type, |
| | | dd.breakage_reason, |
| | | dd.breakage_quantity, |
| | | round( ogd.child_width * ogd.child_height * dd.breakage_quantity / 1000000, 2 ) as area, |
| | | IFNULL(dd.responsible_personnel,'') as personnel, |
| | | ogd.glass_child |
| | | FROM |
| | | sd.ORDER AS o |
| | | LEFT JOIN sd.order_glass_detail AS ogd ON ogd.order_id = o.order_id |
| | | LEFT JOIN reporting_work AS rw ON rw.order_id = o.order_id |
| | | LEFT JOIN damage_details AS dd ON dd.reporting_work_id = rw.reporting_work_id |
| | | AND dd.order_number = ogd.order_number |
| | | AND dd.technology_number = ogd.technology_number |
| | | WHERE |
| | | rw.reporting_work_time between #{selectTime1} and #{selectTime2} |
| | | AND dd.available = 0 |
| | | AND LENGTH( rw.process_id )= 14 |
| | | GROUP BY |
| | | dd.id |
| | | </select> |
| | | |
| | | <select id="splittingDetailsOutsideMp"> |
| | | SELECT |
| | | fc.process_id, |
| | | fc.order_number, |
| | | fc.technology_number, |
| | | o.project, |
| | | o.batch, |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | fc.quantity, |
| | | round( ogd.child_width * ogd.child_height * fc.quantity / 1000000, 2 ) as area, |
| | | od.shape, |
| | | od.remarks |
| | | FROM |
| | | sd.ORDER AS o |
| | | LEFT JOIN sd.order_detail AS od ON od.order_id = od.order_id |
| | | LEFT JOIN sd.order_glass_detail AS ogd ON o.order_id = ogd.order_id |
| | | AND ogd.order_number = od.order_number |
| | | LEFT JOIN flow_card AS fc ON fc.order_id = ogd.order_id |
| | | AND fc.order_number |
| | | AND fc.technology_number = ogd.technology_number |
| | | WHERE |
| | | fc.order_id = #{orderId} |
| | | GROUP BY |
| | | fc.id |
| | | </select> |
| | | |
| | | <select id="qualityReportMp"> |
| | | SELECT o.order_id, |
| | | o.customer_name, |
| | | o.project, |
| | | fc.order_number, |
| | | fc.technology_number, |
| | | od.product_name, |
| | | od.quantity, |
| | | MAX(opd.reporting_work_num_count) as quantityMax, |
| | | IFNULL(SUM(distinct dd.breakage_quantity), 0) as breakage_quantity, |
| | | IFNULL(sum(distinct pl.patch_num), 0) as patch_num, |
| | | fc.received_quantity, |
| | | CONCAT(ROUND(ROUND(od.quantity / MAX(opd.reporting_work_num_count), 2) * 100), '%') as finished |
| | | FROM sd.`order` AS o |
| | | LEFT JOIN sd.order_detail AS od ON od.order_id = o.order_id |
| | | |
| | | LEFT JOIN flow_card AS fc ON o.order_id = fc.order_id |
| | | AND fc.order_number = od.order_number |
| | | |
| | | LEFT JOIN damage_details AS dd ON dd.process_id = fc.process_id |
| | | AND dd.order_number = fc.order_number |
| | | AND dd.technology_number = fc.technology_number |
| | | and dd.available != 1 |
| | | |
| | | LEFT JOIN patch_log AS pl ON pl.order_id = fc.order_id |
| | | AND pl.process_id = fc.process_id |
| | | AND pl.order_sort = fc.order_number |
| | | AND pl.technology_number = fc.technology_number |
| | | |
| | | LEFT JOIN sd.order_process_detail AS opd ON opd.order_id = fc.order_id |
| | | AND opd.order_number = fc.order_number |
| | | AND opd.technology_number = fc.technology_number |
| | | |
| | | WHERE o.create_time BETWEEN #{selectTime1} and #{selectTime2} |
| | | |
| | | GROUP BY o.order_id, |
| | | fc.order_number, |
| | | fc.technology_number |
| | | ORDER BY fc.order_number |
| | | </select> |
| | | |
| | | <select id="yieldMp"> |
| | | SELECT opd.process, |
| | | o.order_id, |
| | | o.customer_name, |
| | | o.project, |
| | | od.product_name, |
| | | ROUND(SUM(distinct opd.reporting_work_num) * od.area, 2) as finishedArea |
| | | , |
| | | ROUND(SUM(distinct opd.broken_num) * od.area, 2) as brokenArea, |
| | | (ROUND(SUM(distinct opd.reporting_work_num) * od.area, 2) + |
| | | ROUND(SUM(distinct opd.broken_num) * od.area, 2)) as area, |
| | | CONCAT(ROUND(ROUND(ROUND(SUM(distinct opd.reporting_work_num) * od.area, 2) / |
| | | (ROUND(SUM(distinct opd.reporting_work_num) * od.area, 2) + |
| | | ROUND(SUM(distinct opd.broken_num) * od.area, 2)), 2) * 100), '%') as finished |
| | | FROM sd.`order` AS o |
| | | LEFT JOIN sd.order_detail AS od ON od.order_id = o.order_id |
| | | LEFT JOIN flow_card AS fc ON fc.order_id = od.order_id |
| | | AND fc.order_number = fc.order_number |
| | | LEFT JOIN sd.order_process_detail AS opd ON opd.order_id = fc.order_id |
| | | AND opd.process_id = fc.process_id |
| | | AND opd.order_number = fc.order_number |
| | | AND opd.technology_number = fc.technology_number |
| | | WHERE opd.reporting_work_num > 0 |
| | | and o.create_time BETWEEN #{selectTime1} and #{selectTime2} |
| | | AND position(#{selectProcesses} IN opd.process) |
| | | GROUP BY opd.process, o.order_id |
| | | </select> |
| | | |
| | | <select id="productionScheduleMp"> |
| | | select |
| | | a.order_number, |
| | | a.shape, |
| | | a.product_name, |
| | | b.child_width, |
| | | b.child_height, |
| | | c.quantity, |
| | | c.technology_number, |
| | | b.glass_child, |
| | | e.reportWorkQuantity, |
| | | e.reportWorkQuantityCount, |
| | | ifnull(f.inventory,0) as inventoryNum, |
| | | round(ifnull(f.inventory,0)*a.area,2) as inventoryArea, |
| | | dd.quantity as shippedQuantity, |
| | | dd.area |
| | | |
| | | from |
| | | flow_card as c |
| | | left join |
| | | sd.order_detail as a |
| | | on c.order_id = a.order_id |
| | | and c.order_number = a.order_number |
| | | left join sd.order_glass_detail as b |
| | | on c.order_id = b.order_id |
| | | and b.order_number = c.order_number |
| | | and c.technology_number = b.technology_number |
| | | left join sd.`order` as d |
| | | on c.order_id = d.order_id |
| | | left join mm.finished_goods_inventory as f |
| | | on c.order_id = f.order_id and f.order_number = c.order_number |
| | | left join ( |
| | | SELECT process_id, |
| | | technology_number, |
| | | sum(a.broken_num) as broken_num, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"",process,"\":\"",reporting_work_num,"\"")), |
| | | '}' |
| | | ) as reportWorkQuantity, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"",process,"\":\"",reporting_work_num,"\"")), |
| | | '}' |
| | | ) as reportWorkQuantityCount |
| | | FROM sd.order_process_detail as a |
| | | where a.order_id=#{orderId} |
| | | GROUP BY process_id,a.technology_number |
| | | ) as e |
| | | on e.process_id = c.process_id |
| | | and e.technology_number = c.technology_number |
| | | left join sd.delivery_detail as dd on dd.order_id=a.order_id and dd.order_number=a.order_number |
| | | where a.order_id = #{orderId} |
| | | ORDER BY a.order_number |
| | | </select> |
| | | |
| | | <select id="taskCompletionStatusMp"> |
| | | select d.customer_name, |
| | | d.project, |
| | | d.batch, |
| | | c.order_id, |
| | | d.quantity, |
| | | d.area, |
| | | dd.quantity as shippedQuantity, |
| | | dd.area as shippedArea, |
| | | e.reportWorkQuantity, |
| | | e.reportWorkQuantityCount |
| | | |
| | | from sd.`order` as d |
| | | left join flow_card as c on c.order_id = d.order_id |
| | | left join |
| | | sd.order_detail as a |
| | | on c.order_id = a.order_id |
| | | and c.order_number = a.order_number |
| | | left join sd.order_glass_detail as b |
| | | on c.order_id = b.order_id |
| | | and b.order_number = c.order_number |
| | | and c.technology_number = b.technology_number |
| | | left join mm.finished_goods_inventory as f |
| | | on c.order_id = f.order_id and f.order_number = c.order_number |
| | | left join (SELECT process_id, |
| | | technology_number, |
| | | sum(a.broken_num) as broken_num, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", ifnull(reporting_work_num,0), "\"")), |
| | | '}' |
| | | ) as reportWorkQuantity, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", ifnull(reporting_work_num,0), "\"")), |
| | | '}' |
| | | ) as reportWorkQuantityCount |
| | | FROM sd.order_process_detail as a |
| | | left join sd.`order` as o on o.order_id = a.order_id |
| | | where o.create_time BETWEEN #{selectTime1} and #{selectTime2} |
| | | GROUP BY process_id,a.technology_number |
| | | ) as e |
| | | on e.process_id = c.process_id |
| | | and e.technology_number = c.technology_number |
| | | left join sd.delivery_detail as dd on dd.order_id = a.order_id and dd.order_number = a.order_number |
| | | where d.create_time BETWEEN #{selectTime1} and #{selectTime2} and reportWorkQuantity is not null |
| | | GROUP BY a.order_id |
| | | ORDER BY a.order_id |
| | | </select> |
| | | |
| | | <select id="orderPlanDecompositionMp"> |
| | | SELECT |
| | | o.order_id, |
| | | o.customer_name, |
| | | o.project, |
| | | o.batch, |
| | | o.quantity, |
| | | o.area, |
| | | date(fc.create_time) as create_time, |
| | | date(orw.startTime) as startTime, |
| | | oopd.completionsNum, |
| | | sum( DISTINCT fc.received_quantity ) AS received_quantity, |
| | | sum( DISTINCT fc.quantity - fc.received_quantity ) AS receivedNo, |
| | | IF(fc.quantity=fc.received_quantity,'已清单','') as accomplish, |
| | | DATEDIFF( |
| | | MAX( rw.reporting_work_time ), |
| | | min( rw.reporting_work_time ))+1 AS daysDifference |
| | | FROM |
| | | sd.`order` AS o |
| | | LEFT JOIN flow_card AS fc ON fc.order_id = o.order_id |
| | | LEFT JOIN ( |
| | | SELECT |
| | | a.order_id, |
| | | MIN( b.reporting_work_time ) AS startTime |
| | | FROM |
| | | sd.`order` AS a |
| | | LEFT JOIN reporting_work AS b ON a.order_id = b.order_id |
| | | WHERE |
| | | b.this_process = '切割' |
| | | AND a.create_time BETWEEN #{selectTime1} and #{selectTime2} |
| | | GROUP BY |
| | | a.order_id |
| | | ) AS orw ON orw.order_id = o.order_id |
| | | LEFT JOIN ( |
| | | SELECT |
| | | a.order_id, |
| | | SUM( b.reporting_work_num ) AS completionsNum |
| | | FROM |
| | | sd.`order` AS a |
| | | LEFT JOIN sd.order_process_detail AS b ON a.order_id = b.order_id |
| | | WHERE |
| | | b.process = '包装' |
| | | AND a.create_time BETWEEN #{selectTime1} and #{selectTime2} |
| | | GROUP BY |
| | | a.order_id |
| | | ) AS oopd ON oopd.order_id = o.order_id |
| | | LEFT JOIN reporting_work AS rw ON rw.order_id = fc.order_id |
| | | AND rw.process_id = fc.process_id |
| | | WHERE |
| | | o.create_time BETWEEN #{selectTime1} and #{selectTime2} |
| | | AND fc.create_time IS NOT NULL |
| | | GROUP BY |
| | | o.order_id |
| | | </select> |
| | | |
| | | <select id="rawMaterialRequisitionMp"> |
| | | SELECT |
| | | fc.project_no, |
| | | modl.material_name, |
| | | modl.producer, |
| | | ou.width, |
| | | ou.height, |
| | | modl.date_of_manufacture, |
| | | SUM(distinct modl.outbound_quantity) as quantity, |
| | | ROUND(SUM(modl.outbound_quantity)*SUM(modl.single_piece_area),2) as area, |
| | | date(mo.material_requisition_date) as date |
| | | FROM |
| | | mm.material_outbound_detail AS modl |
| | | left join mm.material_outbound as mo on mo.material_outbound_id=modl.material_outbound_id |
| | | LEFT JOIN optimize_use AS ou ON modl.use_id = ou.id and ou.raw_stock_code=modl.inventory_id |
| | | LEFT JOIN flow_card AS fc ON ou.project_no = fc.project_no |
| | | where modl.use_id IS NOT NULL and mo.material_requisition_date BETWEEN #{selectTime1} and #{selectTime2} |
| | | GROUP BY |
| | | ou.width,ou.height,material_code |
| | | </select> |
| | | </mapper> |
| | |
| | | and a.process=#{thisProcess} |
| | | |
| | | </update> |
| | | |
| | | <select id="filterOrderProcessCollect"> |
| | | select a.id,process,order_number,technology_number,a.order_id |
| | | from order_process_detail as a |
| | | left join `order` as b on a.order_id=b.order_id |
| | | where b.create_time BETWEEN #{selectTime1} and #{selectTime2} |
| | | group by process |
| | | |
| | | </select> |
| | | |
| | | <select id="getGlassLRowCollect"> |
| | | select |
| | | max(a.technology_number) as rowCount, |
| | | RowNum |
| | | from order_process_detail as a |
| | | left join |
| | | (select min((@i:=@i+1)) AS RowNum,c.* |
| | | from sd.order_glass_detail as c |
| | | left join sd.`order` o2 on c.order_id = o2.order_id, |
| | | (SELECT @i:=-1) as d |
| | | where o2.create_time BETWEEN #{selectTime1} and #{selectTime2} |
| | | GROUP BY order_number |
| | | ) as b |
| | | on b.order_number = a.order_number |
| | | left join sd.`order` o on a.order_id = o.order_id |
| | | where o.create_time BETWEEN #{selectTime1} and #{selectTime2} |
| | | group by a.order_number |
| | | </select> |
| | | </mapper> |