north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue
@@ -13,6 +13,7 @@ import {VXETable} from "vxe-table"; import { useI18n } from 'vue-i18n' import useUserInfoStore from '@/stores/userInfo' import {toolbarButtonClickEvent} from "@/hook/mouseMove"; //语言获取 const { t } = useI18n() const userStore = useUserInfoStore() @@ -27,35 +28,6 @@ switch (type) { case 'select' : { router.push({path: '/main/processCard/SelectDetailProcessCard', query: { processId: row.processId }}) break } case 'setType': { let state=row.layoutStatus if (state=='可排版'){ request.post(`/processCard/updateLayoutStatus/${row.processId}/2`).then((res) => { if (res.code == 200) { ElMessage.success(t('processCard.typesettingSuccess') ) router.push({path: '/main/processCard/SelectProcessCard', query: {random:Math.random()}}) } else { ElMessage.warning(res.msg) } }) } else if(state=='不可排版'){ request.post(`/processCard/updateLayoutStatus/${row.processId}/1`).then((res) => { if (res.code == 200) { ElMessage.success(t('processCard.modifySuccessfully')) router.push({path: '/main/processCard/SelectProcessCard', query: {random:Math.random()}}) } else { ElMessage.warning(res.msg) } }) } break } case 'delete': { @@ -74,17 +46,15 @@ } function padLeftZero(str) { return ('00' + str).substr(str.length) } //定义时间 //定义变量 const form = reactive({ date1: '', getSelect:'不可排版' }) //表尾求和 @@ -187,7 +157,8 @@ let endTime = form.date1[1] request.post(`/processCard/flowCard/${pageNum.value}/${total.pageSize}/${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 @@ -231,11 +202,11 @@ request.post(`/processCard/flowCard/1/${total.pageSize}/${startTime}/${endTime}`, filterData.value).then((res) => { if(res.code==200){ pageTotal.value=res.data.total total.dataTotal = res.data.total.total*1 total.pageTotal=parseInt(res.data.total) pageNum.value=1 produceList = deepClone(res.data.data) xGrid.value.loadData(produceList) xGrid.value.reloadData(produceList) gridOptions.loading=false }else{ ElMessage.warning(res.msg) @@ -282,33 +253,51 @@ },//表头参数 columns:[ {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, {title: t('basicData.operate'), width: 160, slots: { default: 'button_slot' },fixed:"left"}, {type: 'checkbox', fixed: "left", title: t('basicData.check'), width: 80}, {title: t('basicData.operate'), width: 100, slots: {default: 'button_slot'}, fixed: "left"}, { type: 'seq',fixed:"left", title: t('basicData.Number'), width: 50 }, {field: 'orderId', title: t('order.orderId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' },width: 110 }, {field: 'processId', width: 140, title: t('processCard.processId') ,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, {field: 'orderDetail.productId', title: t('order.productId') ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },}, {field: 'orderDetail.productName', title: t('order.product'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, width: 180}, { field: 'processId', width: 140, title: t('processCard.processId'), showOverflow: "ellipsis", filters: [{data: ''}], slots: {filter: 'num1_filter'} }, { field: 'orderDetail.productId', title: t('order.productId'), filters: [{data: ''}], slots: {filter: 'num1_filter'}, }, { field: 'orderDetail.productName', title: t('order.product'), filters: [{data: ''}], slots: {filter: 'num1_filter'}, width: 180 }, {field: 'order.project', title: t('order.project') ,showOverflow:"ellipsis"}, {field: 'quantity', title: t('order.quantity'), }, {field: 'orderDetail.computeGrossArea', title: t('order.area'), }, {field: 'founder', title: t('processCard.founder'), }, {field: 'orderDetail.processingNote', title: t('order.processingNote'), }, {field: 'layoutStatus', title: t('processCard.layoutStatus'), } {field: 'layoutStatus',width:100, title: t('processCard.layoutStatus'), filters: [{data: ''}], slots: {filter: 'select_filter'}} ],//表头按钮 toolbarConfig: { // buttons: [{ // // }], buttons: [ {code: 'update', name: '排版', status: 'primary'}, ], import: false, // export: true, // print: true, zoom: true, custom: true }, data: [ ],//table body实际数据 data: [],//table body实际数据 //脚部求和 footerMethod({columns, data}) {//页脚函数 let footList = ['', '',] @@ -327,6 +316,66 @@ }) const sexOptions = ref([ {label: '已排版', value: '已排版'}, {label: '可排版', value: '可排版'}, {label: '不可排版', value: '不可排版'} ]) //表格按钮 const gridEvents = { async toolbarButtonClick({code}) { const $grid = xGrid.value if ($grid) { switch (code) { case 'update': { const $table = xGrid.value if ($table) { const selectRecords = $table.getCheckboxRecords() if (selectRecords.length == 0) { ElMessage.warning("请勾选需要的数据") return; } let composingData = ref({ composing: selectRecords, }) //修改排版状态 request.post("/processCard/updateComposing", composingData.value).then((res) => { if (res.code == 200 && res.data === true) { ElMessage.success("修改成功") router.push({ path: '/main/processCard/SelectProcessCard', query: {random: Math.random()} }) } else { ElMessage.warning('修改失败') } }) } return; } } } } } const checkBoxConfig = { checkMethod: ({row}) => { if (row['layoutStatus'] === '可排版' || row['layoutStatus'] === '已排版') { return row.disable } else { return !row.disable } }, reserve: true } </script> @@ -337,30 +386,32 @@ <el-row :gutter="0"> <el-date-picker v-model="form.date1" type="daterange" format="YYYY/MM/DD" value-format="YYYY-MM-DD" :start-placeholder="$t('basicData.startDate')" :end-placeholder="$t('basicData.endDate')" :default-time="defaultTime" :end-placeholder="$t('basicData.endDate')" :start-placeholder="$t('basicData.startDate')" format="YYYY/MM/DD" type="daterange" value-format="YYYY-MM-DD" /> <el-button @click="getWorkOrder" id="select" type="primary" :icon="Search">{{$t('basicData.search')}} :icon="Search" type="primary" @click="getWorkOrder">{{ $t('basicData.search') }} </el-button> </el-row> </div> <vxe-grid max-height="100%" @filter-change="filterChanged" class="mytable-scrollbar" ref="xGrid" :checkbox-config="checkBoxConfig" class="mytable-scrollbar" max-height="100%" v-bind="gridOptions" v-on="gridEvents" @filter-change="filterChanged" > <!-- @toolbar-button-click="toolbarButtonClickEvent"--> @@ -381,20 +432,20 @@ <template #button_slot="{ row }" > <!-- <el-button @click="getTableRow(row,'select')" link type="primary" size="small">{{$t('basicData.edit')}}--> <!-- </el-button>--> <el-button @click="getTableRow(row,'select')" v-if="userStore.user.permissions.indexOf('SelectProcessCard.edit') > -1" <el-button v-if="userStore.user.permissions.indexOf('SelectProcessCard.edit') > -1" link size="small" type="primary" size="small"> @click="getTableRow(row,'select')"> {{ $t('basicData.edit') }} </el-button> <el-button v-if="row.layoutStatus=='可排版'" @click="getTableRow(row,'setType')" link type="primary" size="small">{{$t('processCard.composing')}}</el-button> <el-button v-else-if="row.layoutStatus=='不可排版'" @click="getTableRow(row,'setType')" link type="primary" size="small">{{$t('processCard.composingOk')}}</el-button> <el-button v-else-if="row.layoutStatus=='已排版'" disabled @click="getTableRow(row,'setType')" link type="primary" size="small">{{$t('processCard.typesetter')}}</el-button> <!-- <el-button v-if="row.layoutStatus=='可排版'" @click="getTableRow(row,'setType')" link type="primary" size="small">{{$t('processCard.composing')}}</el-button>--> <!-- <el-button v-else-if="row.layoutStatus=='不可排版'" @click="getTableRow(row,'setType')" link type="primary" size="small">{{$t('processCard.composingOk')}}</el-button>--> <!-- <el-button v-else-if="row.layoutStatus=='已排版'" disabled @click="getTableRow(row,'setType')" link type="primary" size="small">{{$t('processCard.typesetter')}}</el-button>--> <!-- <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">{{$t('basicData.delete')}}</el-button>--> <el-popconfirm @confirm="getTableRow(row,'delete')" :title="$t('searchOrder.deleteConfirm')"> <el-popconfirm :title="$t('searchOrder.deleteConfirm')" @confirm="getTableRow(row,'delete')"> <template #reference> <el-button link type="primary" size="small">{{ $t('basicData.delete') }}</el-button> <el-button link size="small" type="primary">{{ $t('basicData.delete') }}</el-button> </template> </el-popconfirm> </template> @@ -402,7 +453,19 @@ <template #num1_filter="{ column, $panel }"> <div> <div v-for="(option, index) in column.filters" :key="index"> <input type="text" v-model="option.data" @input="changeFilterEvent($event, option, $panel)"/> <input v-model="option.data" type="text" @input="changeFilterEvent($event, option, $panel)"/> </div> </div> </template> <template #select_filter="{ column, $panel }"> <div> <div v-for="(option, index) in column.filters" :key="index"> <select v-model="option.data" @change="changeFilterEvent($event, option, $panel)" style="width: 100%"> <option value="已排版" label="已排版"></option> <option value="可排版" label="可排版"></option> <option value="不可排版" label="不可排版"></option> </select> </div> </div> </template> @@ -410,12 +473,12 @@ <!--使用 pager 插槽--> <!-- 'PrevJump','NextJump', --> <vxe-pager @page-change="handlePageChange" :layouts="[ 'PrevPage', 'Jump','PageCount', 'NextPage', 'Total']" v-model:current-page="pageNum" v-model:page-size="total.pageSize" v-model:pager-count="total.pageTotal" :layouts="[ 'PrevPage', 'Jump','PageCount', 'NextPage', 'Total']" :total="total.dataTotal" @page-change="handlePageChange" > </vxe-pager> </template> @@ -429,6 +492,7 @@ width: 99%; height: 100%; } #selectForm { width: 40%; text-align: center; north-glass-erp/northglass-erp/src/views/pp/report/CrossProcessBreaking.vue
@@ -20,6 +20,8 @@ ],//表格表头字段 data:[],//表格数据 url :'/report/crossProcessBreaking', exportUrl :'/report/exportCrossProcessBreaking', exportName:'跨工序次破报表', footList:['quantity','grossArea','computeGrossArea','perimeter','price','grossAmount'] }) north-glass-erp/northglass-erp/src/views/pp/reportingWorks/QualityInspectionReview.vue
@@ -99,7 +99,7 @@ //定义数据返回结果 let produceList = ref([]) //定义当前页数 const pageNum = $ref(1) let pageNum=ref(1) let pageState = null //获取七天前到当前时间 @@ -150,7 +150,7 @@ const selectPageList = ()=>{ let startTime = form.date1[0] let endTime = form.date1[1] request.post(`/reportingWork/selectQualityTesting/${pageNum}/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`,filterData.value).then((res) => { request.post(`/reportingWork/selectQualityTesting/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`,filterData.value).then((res) => { if(res.code==200){ produceList = deepClone(res.data.data) @@ -170,7 +170,7 @@ if (inputVal == '') { inputVal = null } request.post(`/reportingWork/selectQualityTesting/${pageNum}/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`, filterData.value).then((res) => { request.post(`/reportingWork/selectQualityTesting/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`, filterData.value).then((res) => { if (res.code == 200) { total.dataTotal = res.data.total.total*1 total.pageTotal= res.data.total.pageTotal @@ -222,11 +222,11 @@ request.post(`/reportingWork/selectQualityTesting/1/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`, filterData.value).then((res) => { if (res.code == 200) { pageTotal.value=res.data.total total.dataTotal = res.data.total.total*1 total.pageTotal=parseInt(res.data.total) pageNum.value=1 produceList = deepClone(res.data.data) xGrid.value.loadData(produceList) xGrid.value.reloadData(produceList) gridOptions.loading = false } else { ElMessage.warning(res.msg) north-glass-erp/northglass-erp/src/views/pp/reportingWorks/SelectReportingWorks.vue
@@ -198,11 +198,11 @@ request.post(`/reportingWork/selectReportingWork/1/${total.pageSize}/${startTime}/${endTime}/${inputVal}`, filterData.value).then((res) => { if(res.code==200){ pageTotal.value=res.data.total total.dataTotal = res.data.total.total*1 total.pageTotal=parseInt(res.data.total) pageNum.value=1 produceList = deepClone(res.data.data) xGrid.value.loadData(produceList) xGrid.value.reloadData(produceList) gridOptions.loading=false }else{ ElMessage.warning(res.msg) north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java
@@ -180,4 +180,14 @@ public Result getSelectPrinting( @RequestBody Map<String,Object> object){ return Result.seccess(flowCardService.getSelectPrintingSv(object)); } @ApiOperation("复选框修改排版状态") @SaCheckPermission("SelectProcessCard.review") @PostMapping("/updateComposing") public Result updateComposing( @RequestBody Map<String,Object> object ){ return Result.seccess(flowCardService.updateComposingSv(object)); } } north-glass-erp/src/main/java/com/example/erp/controller/pp/ReportController.java
@@ -6,17 +6,22 @@ import com.example.erp.entity.pp.DamageDetails; import com.example.erp.entity.pp.FlowCard; import com.example.erp.entity.pp.Report; import com.example.erp.entity.sd.Order; import com.example.erp.entity.sd.OrderDetail; import com.example.erp.entity.sd.OrderGlassDetail; import com.example.erp.exception.ServiceException; import com.example.erp.service.pp.ReportService; import com.example.erp.service.pp.WorkOrderService; import com.example.erp.tools.DownExcel; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.sql.Date; import java.time.LocalDate; import java.util.List; import java.util.Map; @@ -153,4 +158,11 @@ @RequestBody Report report){ return Result.seccess(reportService.rawMaterialRequisitionSv(selectTime1,selectTime2,report)); } @ApiOperation("跨工序次破报表导出") @PostMapping("/exportCrossProcessBreaking") public void exportCrossProcessBreaking(HttpServletResponse response, @RequestBody List<LocalDate> dates) throws IOException, IllegalAccessException, InstantiationException { //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字 DownExcel.download(response, DamageDetails.class, reportService.exportCrossProcessBreakingSv(dates),"CrossProcessBreaking"); } } north-glass-erp/src/main/java/com/example/erp/dto/pp/CrossProcessBreakingDTO.java
New file @@ -0,0 +1,4 @@ package com.example.erp.dto.pp; public class CrossProcessBreakingDTO { } north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java
@@ -77,4 +77,6 @@ List<Map<String, Object>> getProcessList(String processId, Integer technologyNumber); Boolean updateInventory(String processId, String orderNumber, String technologyNumber, int completedQuantity); Boolean updateComposing(String processId); } north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportMapper.java
@@ -3,10 +3,12 @@ import com.example.erp.entity.pp.DamageDetails; import com.example.erp.entity.pp.Report; import com.example.erp.entity.sd.Order; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.sql.Date; import java.time.LocalDate; import java.util.List; import java.util.Map; @@ -43,6 +45,8 @@ List<Map<String, String>> rawMaterialRequisitionMp(Date selectTime1, Date selectTime2, Report report); List<DamageDetails> exportCrossProcessBreakingMp(List<LocalDate> dates); // Map<String, Integer> getWorkInProgressTotal( // @Param("selectTime1") Date selectTime1, @Param("selectTime2") Date selectTime2, // @Param("orderId") String orderId, @Param("inputProject") String inputProject, north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
@@ -6,6 +6,7 @@ import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.example.erp.entity.pp.FlowCard; import com.example.erp.entity.pp.ProductionScheduling; import com.example.erp.entity.sd.OrderGlassDetail; import com.example.erp.entity.sd.OrderProcessDetail; import com.example.erp.mapper.pp.FlowCardMapper; @@ -235,4 +236,18 @@ map.put("data", list); return map; } public Boolean updateComposingSv(Map<String, Object> object) { List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("composing")), FlowCard.class); if (!flowCardList.isEmpty()) { for (FlowCard flowCard : flowCardList) { flowCardMapper.updateComposing(flowCard.getProcessId()); } return true; } else { return false; } } } north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java
@@ -329,4 +329,8 @@ map.put("data",reportMapper.rawMaterialRequisitionMp( selectTime1,selectTime2,report)); return map; } public List exportCrossProcessBreakingSv(List<LocalDate> dates) { return reportMapper.exportCrossProcessBreakingMp(dates); } } north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -81,7 +81,15 @@ <if test="flowCard.order.project != null and flowCard.order.project!= ''"> and b.project regexp #{flowCard.order.project} </if> <if test="flowCard.layoutStatus != null and flowCard.layoutStatus != '' and flowCard.layoutStatus == '不可排版'"> and a.layout_status regexp 0 </if> <if test="flowCard.layoutStatus != null and flowCard.layoutStatus != '' and flowCard.layoutStatus == '可排版'"> and a.layout_status regexp 1 </if> <if test="flowCard.layoutStatus != null and flowCard.layoutStatus != '' and flowCard.layoutStatus == '已排版'"> and a.layout_status regexp 2 </if> group by a.process_Id ORDER BY a.id desc @@ -99,8 +107,8 @@ <if test="flowCard.orderId != null and flowCard.orderId != ''"> and a.order_id regexp #{flowCard.orderId} </if> <if test="flowCard.productionId != null and flowCard.productionId != ''"> and a.process_Id regexp #{flowCard.productionId} <if test="flowCard.processId != null and flowCard.processId != ''"> and a.process_Id regexp #{flowCard.processId} </if> <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''"> and c.product_id regexp #{flowCard.orderDetail.productId} @@ -111,6 +119,15 @@ <if test="flowCard.order.project != null and flowCard.order.project!= ''"> and b.project regexp #{flowCard.order.project} </if> <if test="flowCard.layoutStatus != null and flowCard.layoutStatus != '' and flowCard.layoutStatus == '不可排版'"> and a.layout_status regexp 0 </if> <if test="flowCard.layoutStatus != null and flowCard.layoutStatus != '' and flowCard.layoutStatus == '可排版'"> and a.layout_status regexp 1 </if> <if test="flowCard.layoutStatus != null and flowCard.layoutStatus != '' and flowCard.layoutStatus == '已排版'"> and a.layout_status regexp 2 </if> ORDER BY a.id desc @@ -491,4 +508,11 @@ update flow_card set inventory_quantity=#{completedQuantity} where process_id = #{processId} and order_number = #{orderNumber} and technology_number = #{technologyNumber} </update> <!-- 复选框修改排版状态--> <update id="updateComposing"> update flow_card as fc set fc.layout_status=1 where fc.process_id = #{processId} </update> </mapper> north-glass-erp/src/main/resources/mapper/pp/Report.xml
@@ -670,4 +670,35 @@ GROUP BY ou.width,ou.height,material_code </select> <select id="exportCrossProcessBreakingMp"> select rw.reporting_work_id, rw.reporting_work_time, dd.responsible_process, dd.responsible_team, dd.breakage_type, dd.breakage_reason, ROUND((dd.breakage_quantity)) as breakage_quantity, round(ogd.child_width * ogd.child_height * (dd.breakage_quantity) / 1000000, 2) as area, rw.this_process, o.project, o.order_id, ogd.glass_child from damage_details as dd left join reporting_work as rw on rw.reporting_work_id = dd.reporting_work_id left join sd.order as o on rw.order_id = o.order_id left join sd.order_glass_detail as ogd on ogd.order_id = o.order_id and ogd.order_number = dd.order_number and ogd.technology_number and dd.technology_number where date(rw.reporting_work_time) >= #{dates[0]} and date(rw.reporting_work_time) <= #{dates[1]} and rw.this_worn_quantity > 0 and dd.available = 0 and reviewed_state != 2 and rw.this_process != dd.responsible_process GROUP BY dd.id order by dd.id desc </select> </mapper> north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -530,6 +530,24 @@ where rw.reviewed_state != 2 and rw.reporting_work_time between #{selectTime1} and #{selectTime2} and position(#{orderId} in rw.order_id) and rw.reviewed_state!=-1 <if test="reportingWork.reportingWorkId != null and reportingWork.reportingWorkId != ''"> and rw.reporting_work_id regexp #{reportingWork.reportingWorkId} </if> <if test="reportingWork.orderId != null and reportingWork.orderId != ''"> and o.order_id regexp #{reportingWork.orderId} </if> <if test="reportingWork.processId != null and reportingWork.processId != ''"> and rw.process_id regexp #{reportingWork.processId} </if> <if test="reportingWork.order.project != null and reportingWork.order.project != ''"> and o.project regexp #{reportingWork.order.project} </if> <if test="reportingWork.order.batch != null and reportingWork.order.batch != ''"> and o.batch regexp #{reportingWork.order.batch} </if> <if test="reportingWork.thisProcess != null and reportingWork.thisProcess != ''"> and rw.this_process regexp #{reportingWork.thisProcess} </if> ORDER BY rw.reporting_work_id desc limit #{offset},#{pageSize}; </select> @@ -663,6 +681,18 @@ and position(#{processId} in rw.process_id) and position(#{state} in dd.quality_ins_status) and rw.reviewed_state!=-1 <if test="reportingWork.reportingWorkId != null and reportingWork.reportingWorkId != ''"> and rw.reporting_work_id regexp #{reportingWork.reportingWorkId} </if> <if test="reportingWork.processId != null and reportingWork.processId != ''"> and rw.process_id regexp #{reportingWork.processId} </if> <if test="reportingWork.order.project != null and reportingWork.order.project != ''"> and o.project regexp #{reportingWork.order.project} </if> <if test="reportingWork.order.customerName != null and reportingWork.order.customerName != ''"> and o.customer_name regexp #{reportingWork.order.customerName} </if> ORDER BY rw.reporting_work_id desc limit #{offset},#{pageSize}; </select>