Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
| | |
| | | |
| | | <style scoped> |
| | | @media print { |
| | | |
| | | @page { |
| | | margin: 8mm 16mm 20mm 16mm !important; |
| | | } |
| | | .pages { |
| | | page-break-after: always; |
| | | } |
| | |
| | | |
| | | <style scoped> |
| | | @media print { |
| | | |
| | | @page { |
| | | margin: 8mm 16mm 20mm 16mm !important; |
| | | } |
| | | .pages { |
| | | page-break-after: always; |
| | | } |
| | |
| | | thisWornQuantity:'تنقطع هذه العملية', |
| | | passAudit:'تمت الموافقة', |
| | | patchCondition:'补片状态', |
| | | changeFailed:'修改失败,请检查是否为报工转移订单', |
| | | |
| | | |
| | | selectResponsibleTeam:'الرجاء اختيار الفريق المسؤول', |
| | |
| | | thisWornQuantity:'This Worn Quantity', |
| | | passAudit:'Pass The Audit', |
| | | patchCondition:'Patch Condition', |
| | | changeFailed:'修改失败,请检查是否为报工转移订单', |
| | | |
| | | selectResponsibleTeam:'Please select a responsible team', |
| | | selectWorkReportingTeam:'Please select a responsible team', |
| | |
| | | thisWornQuantity:'Это процесс повреждение ', |
| | | passAudit:'Проверка прошла', |
| | | patchCondition:'补片状态', |
| | | changeFailed:'修改失败,请检查是否为报工转移订单', |
| | | |
| | | |
| | | selectResponsibleTeam:'Пожалуйста, выберите группу ответственности.', |
| | |
| | | thisWornQuantity:'本工序次破', |
| | | passAudit:'审核通过', |
| | | patchCondition:'补片状态', |
| | | changeFailed:'修改失败,请检查是否为报工转移订单', |
| | | |
| | | |
| | | selectResponsibleTeam:'请选择责任班组', |
| | |
| | | name:'returnToStorageCreate', |
| | | component:()=>import('../views/mm/ingredientStock/ReturnToStorageCreate.vue') |
| | | }, |
| | | //物料新增 |
| | | { |
| | | path:'materialAdditionRecord', |
| | | name:'materialAdditionRecord', |
| | | component:()=>import('../views/mm/ingredientStock/MaterialAdditionRecord.vue') |
| | | }, |
| | | { |
| | | path: '', |
| | | redirect:'/main/ingredientsStock/selectIngredientsStock' |
| | |
| | | <el-breadcrumb-item @click="changeRouter(4)" :class="indexFlag===4?'indexTag':''" :to="{ path: '/main/ingredientsStock/AccessoriesMonthlySettlement' }">辅料月结</el-breadcrumb-item>--> |
| | | <el-breadcrumb-item @click="changeRouter(5)" :class="indexFlag===5?'indexTag':''" :to="{ path: '/main/ingredientsStock/returnToStorage' }">{{$t('ingredientsStock.returnToStorage')}}</el-breadcrumb-item> |
| | | <el-breadcrumb-item @click="changeRouter(6)" :class="indexFlag===6?'indexTag':''" :to="{ path: '/main/ingredientsStock/selectSurplusMaterials' }">{{$t('ingredientsStock.surplusMaterialManagement')}}</el-breadcrumb-item> |
| | | <el-breadcrumb-item @click="changeRouter(7)" :class="indexFlag===7?'indexTag':''" :to="{ path: '/main/ingredientsStock/materialAdditionRecord' }">{{$t('物料新增')}}</el-breadcrumb-item> |
| | | <el-breadcrumb-item v-show="false" :to="{ path: '/main/order/orderReport' }">{{$t('ingredientsStock.returnToStorage')}}</el-breadcrumb-item> |
| | | </el-breadcrumb> |
| | | |
| New file |
| | |
| | | <!-- 领出记录 --> |
| | | <script setup> |
| | | |
| | | import {onMounted, reactive, ref} from "vue"; |
| | | import {useRoute, useRouter} from "vue-router" |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | import {ElMessage} from "element-plus"; |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import { useI18n } from 'vue-i18n' |
| | | import footSum from "@/hook/footSum"; |
| | | |
| | | //语言获取 |
| | | const { t } = useI18n() |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | const userStore = useUserInfoStore() |
| | | const username = userStore.user.userName |
| | | const userid = userStore.user.userId |
| | | let produceList = ref([]) |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'add' :{ |
| | | alert('我接收到子组件传送的编辑信息') |
| | | break |
| | | } |
| | | case 'delete':{ |
| | | alert('我接收到子组件传送的删除信息') |
| | | break |
| | | } |
| | | } |
| | | } |
| | | |
| | | const hasDecimal=(value)=>{ |
| | | const regex=/\./ // 定义正则表达式,查找小数点 |
| | | return regex.test(value) //返回true/false |
| | | } |
| | | |
| | | const hasDecimalhtml=(item,row)=>{ |
| | | let aa=item.split('.').length |
| | | if (aa===2){ |
| | | return row[item.split('.')[0]][item.split('.')[1]] |
| | | }else if(aa===3){ |
| | | return row[item.split('.')[0]][item.split('.')[1]][item.split('.')[2]] |
| | | } |
| | | |
| | | |
| | | } |
| | | let selectDate = ref(["",""]) |
| | | |
| | | let type = ref("") |
| | | |
| | | //筛选条件,有外键需要先定义明细里面的数据 |
| | | let filterData = ref({ |
| | | |
| | | }) |
| | | |
| | | let pageNum=ref(1) |
| | | let total = reactive({ |
| | | pageTotal : 0, |
| | | dataTotal : 0, |
| | | pageSize : 100 |
| | | }) |
| | | |
| | | onMounted(()=> { |
| | | |
| | | //第一次调用 |
| | | request.post(`/materialInventory/getMaterialLogReport/物料新增/1/${total.pageSize}/${selectDate.value}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | console.log(res.data) |
| | | total.dataTotal = res.data.total.total * 1 |
| | | total.pageTotal = res.data.total.pageTotal |
| | | selectDate.value = res.data.selectDate |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | let pageState = null |
| | | |
| | | /*使用筛选,后端获取数据*/ |
| | | 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 |
| | | } |
| | | request.post(`/materialInventory/getMaterialLogReport/物料新增/1/${total.pageSize}/${selectDate.value}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | total.dataTotal = res.data.total.total * 1 |
| | | total.pageTotal = res.data.total.pageTotal |
| | | |
| | | selectDate.value = res.data.selectDate |
| | | pageNum.value = 1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | const selectOrderList = () => { |
| | | request.post(`/materialInventory/getMaterialLogReport/物料新增/${pageNum.value}/${total.pageSize}/${selectDate.value}/${type.value}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | selectDate.value = res.data.selectDate |
| | | if (res.data.total != null) { |
| | | total.dataTotal = res.data.total.total * 1 |
| | | total.pageTotal = res.data.total.pageTotal |
| | | } |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const changeDate = () => { |
| | | selectOrderList() |
| | | } |
| | | |
| | | //页脚跳转 |
| | | const handlePageChange = ({currentPage, pageSize}) => { |
| | | total.pageTotal = pageSize |
| | | pageNum.value = currentPage |
| | | |
| | | selectOrderList() |
| | | } |
| | | |
| | | |
| | | //子组件接收参数 |
| | | const xGrid = ref(); |
| | | |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe: true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 30},//鼠标移动或选择高亮 |
| | | id: 'StorageRecord', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY: {enabled: true},//开启虚拟滚动 |
| | | showOverflow: true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | editConfig: { |
| | | trigger: 'click', |
| | | mode: 'row', |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns: [ |
| | | |
| | | {type: 'checkbox',fixed:"left", title: t('basicData.check'), width: '80' }, |
| | | {type: 'seq', fixed: "left", title: t('basicData.Number'), width: '80'}, |
| | | { |
| | | field: 'operationOrderNumber', |
| | | width: '150', |
| | | title: t('productStock.operationOrderNumber'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'} |
| | | }, |
| | | { |
| | | field: 'operationNumber', |
| | | width: '100', |
| | | title: t('order.OrderNum'), |
| | | showOverflow: "ellipsis", |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'} |
| | | }, |
| | | { |
| | | field: 'operateType', |
| | | width: '120', |
| | | title: t('warehouseBasicData.type'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'} |
| | | }, |
| | | { |
| | | field: 'quantity', |
| | | width: '140', |
| | | title: t('order.quantity'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'} |
| | | }, |
| | | { |
| | | field: 'inventoryId', |
| | | width: '100', |
| | | title: t('ingredientsStock.id'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'} |
| | | }, |
| | | { |
| | | field: 'materialCode', |
| | | width: '140', |
| | | title: t('ingredients.materialCode'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'} |
| | | }, |
| | | { |
| | | field: 'materialName', |
| | | width: '140', |
| | | title: t('ingredientsStock.materialName'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'} |
| | | }, |
| | | {field: 'width', width: '100', title: t('order.width'), filters: [{data: ''}], slots: {filter: 'num1_filter'}}, |
| | | {field: 'height', width: '100', title: t('order.height'), filters: [{data: ''}], slots: {filter: 'num1_filter'}}, |
| | | { |
| | | field: 'thickness', |
| | | width: '150', |
| | | title: t('order.totalThickness'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'} |
| | | }, |
| | | { |
| | | field: 'producer', |
| | | width: '100', |
| | | title: t('ingredientsStock.producer'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'} |
| | | }, |
| | | { |
| | | field: 'unit', |
| | | width: '140', |
| | | title: t('ingredients.unit'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'} |
| | | }, |
| | | { |
| | | field: 'singlePieceArea', |
| | | width: '140', |
| | | title: t('productStock.singlePieceArea'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'} |
| | | }, |
| | | { |
| | | field: 'inventoryArea', |
| | | width: '140', |
| | | title: t('productStock.inventoryArea'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'} |
| | | }, |
| | | { |
| | | field: 'operator', |
| | | width: '100', |
| | | title: t('productStock.creator'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'} |
| | | }, |
| | | { |
| | | field: 'operateTime', |
| | | width: '140', |
| | | title: t('productStock.productionDate'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'} |
| | | }, |
| | | { |
| | | field: 'remarks', |
| | | width: '140', |
| | | title: t('productStock.remarks'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'} |
| | | }, |
| | | ],//表头按钮 |
| | | toolbarConfig: { |
| | | buttons: [ |
| | | { |
| | | 'name': t('productStock.returnToWarehouse'), status: 'primary', |
| | | 'code': 'cancel' |
| | | }], |
| | | /*import: false, |
| | | export: true, |
| | | print: true,*/ |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | |
| | | footerMethod({columns, data}) {//页脚函数 |
| | | let footList = ['quantity'] |
| | | return [ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return t('basicData.total') |
| | | } |
| | | if (footList.includes(column.field)) { |
| | | return footSum(data, column.field) |
| | | } |
| | | return '' |
| | | }) |
| | | ] |
| | | } |
| | | |
| | | }) |
| | | |
| | | const gridEvents = { |
| | | toolbarButtonClick({code}) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | | switch (code) { |
| | | |
| | | case 'cancel': { |
| | | const $table = xGrid.value |
| | | //gridOptions.columns.unshift(a) |
| | | if ($table) { |
| | | const selectRecords = $table.getCheckboxRecords() |
| | | |
| | | if (selectRecords.length <= 0) { |
| | | ElMessage.warning(t('productStock.unselectedData')) |
| | | return |
| | | } |
| | | let flowData = ref({ |
| | | |
| | | userId: userid, |
| | | userName: username, |
| | | materialAdd: selectRecords |
| | | |
| | | }) |
| | | request.post("/materialInventory/cancelMaterialAdditionRecord", flowData.value).then((res) => { |
| | | if (res.code == 200 && res.data === "true") { |
| | | ElMessage.success(t('product.msg.operateSuccess')) |
| | | router.push({ |
| | | path: '/main/ingredientsStock/materialAdditionRecord', |
| | | query: {random: Math.random(), storageType: type.value} |
| | | }) |
| | | |
| | | }else if(res.data === "false1"){ |
| | | ElMessage.warning(t('数量不对请检查')) |
| | | }else if(res.data === "false2"){ |
| | | ElMessage.warning(t('库存不存在或者存在多条')) |
| | | }else { |
| | | ElMessage.warning(t('productStock.cancellationFailed')) |
| | | } |
| | | }).catch((err) => { |
| | | ElMessage.error(t('basicData.msg.ServerConnectionError')) |
| | | router.push("/login") |
| | | }) |
| | | } |
| | | return; |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div style="width: 100%;height: 100%"> |
| | | <div class="head"> |
| | | <el-date-picker |
| | | v-model="selectDate" |
| | | type="daterange" |
| | | :start-placeholder="$t('basicData.startDate')" |
| | | :end-placeholder="$t('basicData.endDate')" |
| | | format="YYYY-MM-DD" |
| | | value-format="YYYY-MM-DD" |
| | | |
| | | /> |
| | | <el-button @click="changeDate" style="margin-top: -5px" id="searchButton" type="primary" :icon="Search">{{$t('basicData.search')}}</el-button> |
| | | </div> |
| | | |
| | | <div class="main-table"> |
| | | <vxe-grid |
| | | height="100%" |
| | | @filter-change="filterChanged" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | :checkbox-config="checkBoxConfig" |
| | | |
| | | > |
| | | |
| | | <!-- <template #state="{ row,column}"> |
| | | <!– <p>{{row[column.field]}}</p>–> |
| | | <!– <el-checkbox v-model="row['isState']" :disabled="row[column.field]==='已审核'||row[column.field]==='未通过'"/>–> |
| | | <vxe-checkbox v-model="row['isState']" :disabled="row[column.field]==='已审核'||row[column.field]==='未通过'"></vxe-checkbox> |
| | | </template>--> |
| | | |
| | | |
| | | <!-- @toolbar-button-click="toolbarButtonClickEvent"--> |
| | | <!-- 下拉显示所有信息插槽--> |
| | | <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> |
| | | <span v-if="hasDecimal(item.field)">{{ hasDecimalhtml(item.field,row) }}</span> |
| | | <span v-else>{{ row[item.field] }}</span> |
| | | </li> |
| | | </ul> |
| | | </template> |
| | | |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">{{$t('basicData.edit')}}</el-button> |
| | | <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">{{$t('basicData.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" @keyup.enter.native="$panel.confirmFilter()" @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <template #pager> |
| | | <!--使用 pager 插槽--> |
| | | <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" |
| | | :total="total.dataTotal" |
| | | > |
| | | </vxe-pager> |
| | | </template> |
| | | |
| | | |
| | | </vxe-grid> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | .head{ |
| | | width: 100%; |
| | | height: 35px; |
| | | } |
| | | |
| | | .main-table{ |
| | | width: 100%; |
| | | height: calc(100% - 35px); |
| | | } |
| | | </style> |
| | |
| | | }else{ |
| | | localStorage.setItem('hasRefreshed', 'false'); |
| | | } |
| | | //流程卡编辑打印标签 常州 |
| | | if (printType == 1) { |
| | | request.post(`/processCard/getSelectPrintCustomLabel2/${type}/1`, data.value).then((res) => { |
| | | if (res.code == 200) { |
| | |
| | | } |
| | | }) |
| | | |
| | | }else if(printType==2){ |
| | | } |
| | | //明细分架打印标签 常州 |
| | | else if(printType==2){ |
| | | request.post(`/processCard/getSelectPrintCustomLabelDetails/${type}/1`, data.value).then((res) => { |
| | | if (res.code == 200) { |
| | | produceList.value = deepClone(res.data.title) |
| | |
| | | }else{ |
| | | localStorage.setItem('hasRefreshed', 'false'); |
| | | } |
| | | //工程打印成品标签 |
| | | if(projectNo.value!=null){ |
| | | request.post(`/processCard/getSelectPrintLabel/${projectNo.value}/${type.value}`).then((res) => { |
| | | if (res.code == 200) { |
| | |
| | | |
| | | }else{ |
| | | data.value.printList = JSON.parse(route.query.printList) |
| | | //流程卡编辑打印标签 常州 |
| | | if (printType == 1) { |
| | | request.post(`/processCard/getSelectPrintLabel1`, data.value).then((res) => { |
| | | if (res.code == 200) { |
| | |
| | | } |
| | | }) |
| | | |
| | | }else if(printType==2){ |
| | | } |
| | | //明细分架打印标签 常州 |
| | | else if(printType==2){ |
| | | request.post(`/processCard/getSelectPrintLabelDetails`, data.value).then((res) => { |
| | | if (res.code == 200) { |
| | | produceList.value = deepClone(res.data.data) |
| | |
| | | let lableTitle = lableType.text |
| | | if ($grid) { |
| | | switch (code) { |
| | | //打印流程卡 |
| | | case 'print': { |
| | | if (selectRecords === null || selectRecords === '' || selectRecords.length === 0) { |
| | | ElMessage.warning(t('searchOrder.msgList.checkOrder')) |
| | |
| | | |
| | | break |
| | | } |
| | | |
| | | //标签打印 |
| | | case 'printLabel': { |
| | | if (selectRecords === null || selectRecords === '' || selectRecords.length === 0) { |
| | | ElMessage.warning(t('searchOrder.msgList.checkOrder')) |
| | |
| | | |
| | | break |
| | | } |
| | | //标签打印2 |
| | | case 'printLabel2': { |
| | | if (selectRecords === null || selectRecords === '' || selectRecords.length === 0) { |
| | | ElMessage.warning(t('searchOrder.msgList.checkOrder')) |
| | |
| | | |
| | | break |
| | | } |
| | | //排序汇总 |
| | | case 'sort': { |
| | | const $table = xGridDetail.value |
| | | let data = $table.getTableData().fullData |
| | |
| | | }) |
| | | break |
| | | } |
| | | //自定义打印 |
| | | case 'customLabel': { |
| | | if (selectRecords === null || selectRecords === '' || selectRecords.length === 0) { |
| | | ElMessage.warning(t('searchOrder.msgList.checkOrder')) |
| | |
| | | id += selectRecords[i].id + "|" |
| | | } |
| | | } |
| | | //成品标签1 |
| | | if (lableTypes == 1) { |
| | | |
| | | labelRow.value.list = JSON.stringify(selectRecords) |
| | |
| | | dialogTableVisibleLabel.value = true |
| | | } |
| | | |
| | | } else if (company.label === 2) { |
| | | } |
| | | //常州项目 |
| | | else if (company.label === 2) { |
| | | router.push({ |
| | | path: '/main/processCard/PrintCustomLabelCZ', |
| | | query: { |
| | |
| | | }) |
| | | } |
| | | |
| | | } else if (lableTypes == 2) { |
| | | } |
| | | //成品标签2 |
| | | else if (lableTypes == 2) { |
| | | labelRow.value.list = JSON.stringify(selectRecords) |
| | | labelRow.value.faceOrientation = faceOrientation |
| | | labelRow.value.type = type |
| | | labelRow.value.lableType = lableTypes |
| | | if (company.label === 1) { |
| | | dialogTableVisibleCustomLabel.value = true |
| | | } else if (company.label === 2) { |
| | | } |
| | | //常州项目 |
| | | else if (company.label === 2) { |
| | | router.push({ |
| | | path: '/main/processCard/PrintCustomLabelSemiCZ', |
| | | query: { |
| | |
| | | } |
| | | }) |
| | | } |
| | | } else if (lableTypes == 3) { |
| | | } |
| | | //成品标签3 常州项目 |
| | | else if (lableTypes == 3) { |
| | | router.push({ |
| | | path: '/main/processCard/PrintLabel1', |
| | | query: { |
| | |
| | | let lableTitle = lableType.text |
| | | if ($grid) { |
| | | switch (code) { |
| | | //打印流程卡 |
| | | case 'print': { |
| | | if (selectRecords === null || selectRecords === '' || selectRecords.length === 0) { |
| | | ElMessage.warning(t('searchOrder.msgList.checkOrder')) |
| | |
| | | dialogTableVisible.value = true |
| | | break |
| | | } |
| | | |
| | | //标签打印 常州 |
| | | case 'printLabel': { |
| | | if (selectRecords === null || selectRecords === '' || selectRecords.length === 0) { |
| | | ElMessage.warning(t('searchOrder.msgList.checkOrder')) |
| | |
| | | |
| | | break |
| | | } |
| | | //标签打印2 常州 |
| | | case 'printLabel2': { |
| | | if (selectRecords === null || selectRecords === '' || selectRecords.length === 0) { |
| | | ElMessage.warning(t('searchOrder.msgList.checkOrder')) |
| | |
| | | }) |
| | | break |
| | | } |
| | | //自定义成品标签打印 |
| | | case 'customLabel': { |
| | | if (selectRecords === null || selectRecords === '' || selectRecords.length === 0) { |
| | | ElMessage.warning(t('searchOrder.msgList.checkOrder')) |
| | |
| | | id += selectRecords[i].id + "|" |
| | | } |
| | | } |
| | | //成品标签1 |
| | | if (lableTypes == 1) { |
| | | labelRow.value.list = JSON.stringify(selectRecords) |
| | | labelRow.value.faceOrientation = faceOrientation |
| | |
| | | lastList.value = [] |
| | | if (company.label === 1) { |
| | | dialogTableVisibleLabel.value = true |
| | | } else if (company.label === 2) { |
| | | } |
| | | //常州项目 |
| | | else if (company.label === 2) { |
| | | router.push({ |
| | | path: '/main/processCard/PrintCustomLabelCZ', |
| | | query: { |
| | |
| | | }) |
| | | } |
| | | |
| | | } else if (lableTypes == 2) { |
| | | } |
| | | //成品标签2 |
| | | else if (lableTypes == 2) { |
| | | labelRow.value.list = JSON.stringify(selectRecords) |
| | | labelRow.value.faceOrientation = faceOrientation |
| | | labelRow.value.type = type |
| | |
| | | lastList.value = [] |
| | | if (company.label === 1) { |
| | | dialogTableVisibleCustomLabel.value = true |
| | | } else if (company.label === 2) { |
| | | } |
| | | //常州项目 |
| | | else if (company.label === 2) { |
| | | router.push({ |
| | | path: '/main/processCard/PrintCustomLabelSemiCZ', |
| | | query: { |
| | |
| | | } |
| | | }) |
| | | } |
| | | } else if (lableTypes == 3) { |
| | | } |
| | | //成品标签3 |
| | | else if (lableTypes == 3) { |
| | | router.push({ |
| | | path: '/main/processCard/PrintLabel1', |
| | | query: { |
| | |
| | | }else{ |
| | | localStorage.setItem('hasRefreshed', 'false'); |
| | | } |
| | | //工程打印 |
| | | if(projectNo.value!=null){ |
| | | request.post(`/processCard/getSelectPrintLabel/${projectNo.value}/${type.value}`).then((res) => { |
| | | if (res.code == 200) { |
| | |
| | | } |
| | | }) |
| | | }else{ |
| | | //流程卡编辑打印标签 常州 |
| | | if (printType == 1) { |
| | | data.value.printList = JSON.parse(route.query.printList) |
| | | request.post(`/processCard/getSelectPrintLabel1`,data.value).then((res) => { |
| | |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | }else if(printType==2){ |
| | | } |
| | | //明细分架打印标签 常州 |
| | | else if(printType==2){ |
| | | data.value.printList = JSON.parse(route.query.printList) |
| | | request.post(`/processCard/getSelectPrintLabelDetails`, data.value).then((res) => { |
| | | if (res.code == 200) { |
| | |
| | | }else{ |
| | | localStorage.setItem('hasRefreshed', 'false'); |
| | | } |
| | | //流程卡编辑打印标签2 常州 |
| | | if (printType == 1) { |
| | | request.post(`/processCard/getSelectPrintCustomLabel2/${type}/1`, data.value).then((res) => { |
| | | if (res.code == 200) { |
| | |
| | | } |
| | | }) |
| | | |
| | | }else if(printType==2){ |
| | | } |
| | | //明细分架打印标签2 常州 |
| | | else if(printType==2){ |
| | | request.post(`/processCard/getSelectPrintCustomLabelDetails/${type}/1`, data.value).then((res) => { |
| | | if (res.code == 200) { |
| | | produceList.value = deepClone(res.data.title) |
| | |
| | | titleStyleVisible.value = true |
| | | break |
| | | } |
| | | //编辑 |
| | | case 'editCheckbox': { |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | if(selectRecords===null ||selectRecords===''||selectRecords.length===0){ |
| | |
| | | return; |
| | | |
| | | } |
| | | //明细打印 |
| | | case 'detailsPrint': { |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | if(selectRecords===null ||selectRecords===''||selectRecords.length===0){ |
| | |
| | | return; |
| | | |
| | | } |
| | | //明细分架打印 |
| | | case 'detailsProcessPrint': { |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | if(selectRecords===null ||selectRecords===''||selectRecords.length===0){ |
| | |
| | | return; |
| | | |
| | | } |
| | | //订单打印 |
| | | case 'orderPrint': { |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | if(selectRecords===null ||selectRecords===''||selectRecords.length===0){ |
| | |
| | | reviewState = 'review' |
| | | } |
| | | request.post(`/reportingWork/updateReportingWork/${reviewState}`,requestData).then(res =>{ |
| | | if (res.code == 200){ |
| | | if (res.code == 200 && res.data===true){ |
| | | ElMessage.success(t('reportingWorks.successfulModificationOfWorkApplication')) |
| | | router.push({path:'/main/reportingWorks/AddReportingWork', |
| | | query:{ |
| | | processId:titleUploadData.value.processId, |
| | | random:Math.random()} |
| | | }) |
| | | } else { |
| | | ElMessage.warning(t('reportingWorks.changeFailed')) |
| | | } |
| | | }) |
| | | } |
| | |
| | | return Result.seccess(materialInventoryService.mesMaterialOutbound(reportingWork)); |
| | | } |
| | | |
| | | @ApiOperation("物料新增返回接口") |
| | | @PostMapping("/cancelMaterialAdditionRecord") |
| | | public Result cancelMaterialAdditionRecord( @RequestBody Map<String,Object> object){ |
| | | return Result.seccess(materialInventoryService.cancelMaterialAdditionRecord(object)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | |
| | | Boolean deleteMaterialLog(@Param("materialOutboundId") String materialOutboundId); |
| | | |
| | | Boolean deleteMaterialLogById(@Param("id") Long id); |
| | | |
| | | Integer getMaximum(@Param("type") String type); |
| | | |
| | | Integer getMaximums(@Param("type") String type); |
| | |
| | | |
| | | Integer getReturningWarehouseCount(@Param("returningId") String returningId); |
| | | |
| | | Integer getMaterialInventoryCount(@Param("materialCode") Long materialCode,@Param("dateOfManufacture") LocalDate dateOfManufacture); |
| | | List<MaterialInventory> getMaterialInventoryCount(@Param("materialCode") Long materialCode,@Param("dateOfManufacture") LocalDate dateOfManufacture); |
| | | |
| | | Integer getMaterialInventoryCountNull(@Param("materialCode") Long materialCode); |
| | | List<MaterialInventory> getMaterialInventoryCountNull(@Param("materialCode") Long materialCode); |
| | | |
| | | |
| | | List<MaterialInventory> getMaterialInventoryCountId(@Param("materialCode") Long materialCode,@Param("dateOfManufacture") LocalDate dateOfManufacture); |
| | |
| | | @Param("totalArea") Double totalArea, |
| | | @Param("materialInventory") MaterialInventory materialInventory); |
| | | |
| | | Boolean updateMaterialInventoryOut(@Param("materialCode") Long materialCode,@Param("quantity") Integer quantity, |
| | | @Param("dateOfManufacture") String dateOfManufacture); |
| | | |
| | | Boolean updateMaterialInventoryNullOut(@Param("materialCode") Long materialCode,@Param("quantity") Integer quantity); |
| | | |
| | | Boolean insertMaterialInventory(@Param("materialCode") Long materialCode,@Param("singlePieceArea") Double singlePieceArea, |
| | | @Param("totalArea") Double totalArea, |
| | | @Param("materialInventory") MaterialInventory materialInventory); |
| | |
| | | String selectOrderid(String processIdStr); |
| | | |
| | | Map<String,Float> getFootSum(Date selectTime1, Date selectTime2, String orderId, ReportingWork reportingWork); |
| | | |
| | | Integer selectReviewedState(String reportingWorkId); |
| | | } |
| | |
| | | |
| | | |
| | | //查询物料是否存在 |
| | | Integer MaterialInventoryCount=0; |
| | | List<MaterialInventory> MaterialInventoryCount; |
| | | if (materialInventory.getDateOfManufacture()!=null){ |
| | | MaterialInventoryCount = materialInventoryMapper.getMaterialInventoryCount(materialCode,materialInventory.getDateOfManufacture()); |
| | | }else{ |
| | | MaterialInventoryCount = materialInventoryMapper.getMaterialInventoryCountNull(materialCode); |
| | | } |
| | | |
| | | if(MaterialInventoryCount==1){ |
| | | if(MaterialInventoryCount.size()==1){ |
| | | materialInventory.setId(MaterialInventoryCount.get(0).getId()); |
| | | if (materialInventory.getDateOfManufacture()!=null){ |
| | | materialInventoryMapper.updateMaterialInventory(materialCode,singlePieceArea,totalArea,materialInventory); |
| | | }else{ |
| | | materialInventoryMapper.updateMaterialInventoryNull(materialCode,singlePieceArea,totalArea,materialInventory); |
| | | } |
| | | log.setFunction("saveMaterialInventory修改"); |
| | | }else if(MaterialInventoryCount==0) { |
| | | }else if(MaterialInventoryCount.isEmpty()) { |
| | | materialInventoryMapper.insertMaterialInventory(materialCode,singlePieceArea,totalArea,materialInventory); |
| | | log.setFunction("saveMaterialInventory新增"); |
| | | }else { |
| | |
| | | MaterialStore materialStore=materialStoreMapper.getSelectMaterialStoreById(materialCode); |
| | | json=materialStore.getJson().substring(1, materialStore.getJson().length() - 1); |
| | | MaterialLog materialLog=new MaterialLog(); |
| | | if(materialInventory.getDateOfManufacture()!=null){ |
| | | materialLog.setOperationOrderNumber(materialInventory.getDateOfManufacture().toString()); |
| | | } |
| | | materialLog.setOperateType("物料新增"); |
| | | materialLog.setMaterialCode(materialCode); |
| | | materialLog.setMaterialName(convertString(json,"\"name\"")); |
| | |
| | | |
| | | |
| | | //查询物料是否存在 |
| | | Integer MaterialInventoryCount=0; |
| | | List<MaterialInventory> MaterialInventoryCount; |
| | | if (returningWarehouseDetail.getDateOfManufacture()!=null){ |
| | | MaterialInventoryCount = materialInventoryMapper.getMaterialInventoryCount(returningWarehouseDetail.getId(),returningWarehouseDetail.getDateOfManufacture()); |
| | | }else{ |
| | |
| | | } |
| | | |
| | | |
| | | if(MaterialInventoryCount>0){ |
| | | if(!MaterialInventoryCount.isEmpty()){ |
| | | if (returningWarehouseDetail.getDateOfManufacture()!=null){ |
| | | materialInventoryMapper.updateMaterialInventoryReturning(returningWarehouseDetail.getId(),singlePieceArea,totalArea,returningWarehouseDetail); |
| | | }else{ |
| | |
| | | } |
| | | |
| | | |
| | | public String cancelMaterialAdditionRecord(Map<String,Object> object) { |
| | | String saveState = "true"; |
| | | //设置回滚点 |
| | | Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint(); |
| | | try { |
| | | Log log = new Log(); |
| | | log.setOperatorId(object.get("userId").toString()); |
| | | log.setOperator(object.get("userName").toString()); |
| | | log.setContent(object.toString()); |
| | | //获取对象集合循环进行新增修改 |
| | | List<MaterialLog> materialLoglist = JSONArray.parseArray(JSONObject.toJSONString(object.get("materialAdd")), MaterialLog.class); |
| | | if (!materialLoglist.isEmpty()){ |
| | | for (MaterialLog materialLog : materialLoglist) { |
| | | |
| | | //查询物料是否存在 |
| | | List<MaterialInventory> MaterialInventoryList; |
| | | if (materialLog.getOperationOrderNumber()!=null){ |
| | | MaterialInventoryList = materialInventoryMapper.getMaterialInventoryCount(materialLog.getMaterialCode(), LocalDate.parse(materialLog.getOperationOrderNumber())); |
| | | }else{ |
| | | MaterialInventoryList = materialInventoryMapper.getMaterialInventoryCountNull(materialLog.getMaterialCode()); |
| | | } |
| | | |
| | | if(MaterialInventoryList.size()==1){ |
| | | if(MaterialInventoryList.get(0).getAvailableQuantity()>=materialLog.getQuantity()){ |
| | | if (materialLog.getOperationOrderNumber()!=null){ |
| | | materialInventoryMapper.updateMaterialInventoryOut(materialLog.getMaterialCode(),materialLog.getQuantity(),materialLog.getOperationOrderNumber()); |
| | | }else{ |
| | | materialInventoryMapper.updateMaterialInventoryNullOut(materialLog.getMaterialCode(),materialLog.getQuantity()); |
| | | } |
| | | materialInventoryMapper.deleteMaterialLogById(materialLog.getId()); |
| | | }else{ |
| | | return "false1"; |
| | | } |
| | | |
| | | }else{ |
| | | return "false2"; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | logService.saveLog(log); |
| | | |
| | | } catch (Exception e) { |
| | | TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint); |
| | | //将异常传入数据库 |
| | | SysError sysError = new SysError(); |
| | | sysError.setError(e+Arrays.toString(e.getStackTrace())); |
| | | sysError.setFunc("cancelFinishedGoodsInventoryStorage"); |
| | | sysErrorService.insert(sysError); |
| | | saveState = "false"; |
| | | |
| | | } |
| | | return saveState; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | JSONObject reportingWorkJson = new JSONObject(reportingWorkMap); |
| | | ReportingWork reportingWork = JSONObject.parseObject(JSONObject.toJSONString(reportingWorkJson.get("title")), ReportingWork.class); |
| | | List<ReportingWorkDetail> reportingWorkDetails = JSONArray.parseArray(JSONObject.toJSONString(reportingWorkJson.get("detail")), ReportingWorkDetail.class); |
| | | //查询该报工是否为报工转移订单 |
| | | Integer transferState = reportingWorkMapper.selectReviewedState(reportingWork.getReportingWorkId()); |
| | | if (transferState !=3){ |
| | | //删除刺破明细表刺破数据 |
| | | damageDetailsMapper.delete( |
| | | new LambdaQueryWrapper<DamageDetails>() |
| | | .eq(DamageDetails::getReportingWorkId, reportingWork.getReportingWorkId()) |
| | | ); |
| | | //修改小片流程表数量 |
| | | orderProcessDetailMapper.updateQuantity(reportingWork.getReportingWorkId(), reportingWork.getThisProcess(), "delete"); |
| | | //删除报工明细表数据 |
| | | reportingWorkDetailMapper |
| | | .delete(new LambdaQueryWrapper<ReportingWorkDetail>() |
| | | .eq(ReportingWorkDetail::getReportingWorkId, reportingWork.getReportingWorkId())); |
| | | |
| | | //删除刺破明细表刺破数据 |
| | | damageDetailsMapper.delete( |
| | | new LambdaQueryWrapper<DamageDetails>() |
| | | .eq(DamageDetails::getReportingWorkId, reportingWork.getReportingWorkId()) |
| | | ); |
| | | //修改小片流程表数量 |
| | | orderProcessDetailMapper.updateQuantity(reportingWork.getReportingWorkId(), reportingWork.getThisProcess(), "delete"); |
| | | //删除报工明细表数据 |
| | | reportingWorkDetailMapper |
| | | .delete(new LambdaQueryWrapper<ReportingWorkDetail>() |
| | | .eq(ReportingWorkDetail::getReportingWorkId, reportingWork.getReportingWorkId())); |
| | | |
| | | //更新报工主表 |
| | | int qualityInsStatus = (int) reportingWorkJson.get("qualityInsStatus"); |
| | | reportingWorkMapper.updateById(reportingWork); |
| | | reportingWorkDetails.forEach(reportingWorkDetail -> { |
| | | reportingWorkDetail.setReportingWorkId(reportingWork.getReportingWorkId()); |
| | | List<DamageDetails> damageDetails = reportingWorkDetail.getDamageDetails(); |
| | | //每一条报工数据循环插入次破明细表 |
| | | if (damageDetails != null && !damageDetails.isEmpty()) { |
| | | damageDetails.forEach(damageDetail -> { |
| | | damageDetail.setReportingWorkId(reportingWork.getReportingWorkId()); |
| | | damageDetail.setProcessId(reportingWork.getProcessId()); |
| | | damageDetail.setOrderNumber(reportingWorkDetail.getOrderNumber()); |
| | | damageDetail.setTechnologyNumber(reportingWorkDetail.getTechnologyNumber()); |
| | | //是否修改质检状态 |
| | | if (!Objects.equals(reportingWork.getThisProcess(), damageDetail.getResponsibleProcess()) && qualityInsStatus==2) { |
| | | damageDetail.setQualityInsStatus(1); |
| | | } |
| | | if (Objects.equals(reviewState, "review")) { |
| | | damageDetail.setQualityInsStatus(2); |
| | | } |
| | | |
| | | damageDetailsMapper.insert(damageDetail); |
| | | }); |
| | | } |
| | | //插入报工数据 |
| | | reportingWorkDetailMapper.insert(reportingWorkDetail); |
| | | orderProcessDetailMapper.insertByReportingWorkDetail(reportingWorkDetail,reportingWork.getProcessId(),reportingWork.getThisProcess()); |
| | | //修改包装时修改库存数量 |
| | | if (reportingWork.getNextProcess()==null || reportingWork.getNextProcess().isEmpty()){ |
| | | //获取该报工修改后的可入库数量 |
| | | Integer inventory = reportingWorkDetailMapper.selectInventory(reportingWork.getProcessId(),Integer.parseInt(reportingWorkDetail.getOrderNumber()),Integer.parseInt(reportingWorkDetail.getTechnologyNumber()),reportingWork.getThisProcess()); |
| | | //修改流程卡表库存数量 |
| | | flowCardMapper.updateInventory(reportingWork.getProcessId(),reportingWorkDetail.getOrderNumber(),reportingWorkDetail.getTechnologyNumber(),inventory); |
| | | } |
| | | }); |
| | | //获取质检时间 |
| | | if (Objects.equals(reviewState, "review")) { |
| | | LocalDateTime |
| | | currentDate = LocalDateTime.now(); |
| | | reportingWork.setQualityInsTime(currentDate); |
| | | //更新报工主表 |
| | | int qualityInsStatus = (int) reportingWorkJson.get("qualityInsStatus"); |
| | | reportingWorkMapper.updateById(reportingWork); |
| | | reportingWorkDetails.forEach(reportingWorkDetail -> { |
| | | reportingWorkDetail.setReportingWorkId(reportingWork.getReportingWorkId()); |
| | | List<DamageDetails> damageDetails = reportingWorkDetail.getDamageDetails(); |
| | | //每一条报工数据循环插入次破明细表 |
| | | if (damageDetails != null && !damageDetails.isEmpty()) { |
| | | damageDetails.forEach(damageDetail -> { |
| | | damageDetail.setReportingWorkId(reportingWork.getReportingWorkId()); |
| | | damageDetail.setProcessId(reportingWork.getProcessId()); |
| | | damageDetail.setOrderNumber(reportingWorkDetail.getOrderNumber()); |
| | | damageDetail.setTechnologyNumber(reportingWorkDetail.getTechnologyNumber()); |
| | | //是否修改质检状态 |
| | | if (!Objects.equals(reportingWork.getThisProcess(), damageDetail.getResponsibleProcess()) && qualityInsStatus==2) { |
| | | damageDetail.setQualityInsStatus(1); |
| | | } |
| | | if (Objects.equals(reviewState, "review")) { |
| | | damageDetail.setQualityInsStatus(2); |
| | | } |
| | | |
| | | damageDetailsMapper.insert(damageDetail); |
| | | }); |
| | | } |
| | | //插入报工数据 |
| | | reportingWorkDetailMapper.insert(reportingWorkDetail); |
| | | orderProcessDetailMapper.insertByReportingWorkDetail(reportingWorkDetail,reportingWork.getProcessId(),reportingWork.getThisProcess()); |
| | | //修改包装时修改库存数量 |
| | | if (reportingWork.getNextProcess()==null || reportingWork.getNextProcess().isEmpty()){ |
| | | //获取该报工修改后的可入库数量 |
| | | Integer inventory = reportingWorkDetailMapper.selectInventory(reportingWork.getProcessId(),Integer.parseInt(reportingWorkDetail.getOrderNumber()),Integer.parseInt(reportingWorkDetail.getTechnologyNumber()),reportingWork.getThisProcess()); |
| | | //修改流程卡表库存数量 |
| | | flowCardMapper.updateInventory(reportingWork.getProcessId(),reportingWorkDetail.getOrderNumber(),reportingWorkDetail.getTechnologyNumber(),inventory); |
| | | } |
| | | }); |
| | | //获取质检时间 |
| | | if (Objects.equals(reviewState, "review")) { |
| | | LocalDateTime |
| | | currentDate = LocalDateTime.now(); |
| | | reportingWork.setQualityInsTime(currentDate); |
| | | reportingWorkMapper.updateById(reportingWork); |
| | | } |
| | | |
| | | //修改小片流程表数量为报工明细表数量 |
| | | //orderProcessDetailMapper.updateQuantity(reportingWork.getReportingWorkId(), reportingWork.getThisProcess(), "add"); |
| | | //保存日志 |
| | | Log log = new Log(); |
| | | log.setContent(reportingWorkMap.toString()); |
| | | log.setFunction("updateReportingWork报工修改"); |
| | | log.setOperatorId((String) reportingWorkJson.get("userId")); |
| | | log.setOperator((String) reportingWorkJson.get("userName")); |
| | | logService.saveLog(log); |
| | | |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | |
| | | //修改小片流程表数量为报工明细表数量 |
| | | //orderProcessDetailMapper.updateQuantity(reportingWork.getReportingWorkId(), reportingWork.getThisProcess(), "add"); |
| | | //保存日志 |
| | | Log log = new Log(); |
| | | log.setContent(reportingWorkMap.toString()); |
| | | log.setFunction("updateReportingWork报工修改"); |
| | | log.setOperatorId((String) reportingWorkJson.get("userId")); |
| | | log.setOperator((String) reportingWorkJson.get("userName")); |
| | | logService.saveLog(log); |
| | | |
| | | return true; |
| | | } |
| | | |
| | | //报工管理查询 |
| | |
| | | String lastProcess = reportingWorkMapper.selectLastProcess(processId); |
| | | //获取是否有已补片或返工 |
| | | Integer countStates= Integer.valueOf(reportingWorkMapper.getPatchConditionMp(reportingWorkId)); |
| | | //判断是否有补片返工数据 |
| | | if (countStates==0){ |
| | | //判断是否是入库工序 |
| | | if (lastProcess.equals(thisProcess)) {//是入库工序 |
| | | //查询该流程卡数量、可入库数量、已入库数量 |
| | | Map<String, Object> list = reportingWorkMapper.selectReceiptQuantity(processId); |
| | | if (list.get("quantity") == list.get("receiptQuantity")) { |
| | | return false; |
| | | } else { |
| | | //转换类型:已入库数量 |
| | | Integer receiptQuantity = Integer.parseInt(list.get("receivedQuantity").toString()); |
| | | //转换类型:可入库数量 |
| | | Integer inventoryQuantity = Integer.parseInt(list.get("inventoryQuantity").toString()); |
| | | //查询该报工编号本工序完工数量 |
| | | Integer completedQuantity = reportingWorkMapper.selectCompletedQuantity(reportingWorkId); |
| | | //当该工序完工数量小于等于已入库数量时 |
| | | //可入库数量-已入库数量>=报工编号本工序完工数量 |
| | | if (inventoryQuantity - receiptQuantity >= completedQuantity) { |
| | | //查询该报工是否为报工转移订单 |
| | | Integer transferState = reportingWorkMapper.selectReviewedState(reportingWorkId); |
| | | if (transferState !=3){ |
| | | //判断是否有补片返工数据 |
| | | if (countStates==0){ |
| | | //判断是否是入库工序 |
| | | if (lastProcess.equals(thisProcess)) {//是入库工序 |
| | | //查询该流程卡数量、可入库数量、已入库数量 |
| | | Map<String, Object> list = reportingWorkMapper.selectReceiptQuantity(processId); |
| | | if (list.get("quantity") == list.get("receiptQuantity")) { |
| | | return false; |
| | | } else { |
| | | //转换类型:已入库数量 |
| | | Integer receiptQuantity = Integer.parseInt(list.get("receivedQuantity").toString()); |
| | | //转换类型:可入库数量 |
| | | Integer inventoryQuantity = Integer.parseInt(list.get("inventoryQuantity").toString()); |
| | | //查询该报工编号本工序完工数量 |
| | | Integer completedQuantity = reportingWorkMapper.selectCompletedQuantity(reportingWorkId); |
| | | //当该工序完工数量小于等于已入库数量时 |
| | | //可入库数量-已入库数量>=报工编号本工序完工数量 |
| | | if (inventoryQuantity - receiptQuantity >= completedQuantity) { |
| | | //查询当前报工编号完工次破数量的数据 |
| | | List<Map<String, Object>> workDateList = reportingWorkMapper.reportingWorkDate(reportingWorkId); |
| | | for (Map<String, Object> item : workDateList) { |
| | | //更新流程卡可入库数量 |
| | | reportingWorkMapper.updateInventoryQuantity(processId, item.get("order_number"), item.get("technology_number"), item.get("completed_quantity")); |
| | | //更新报工流程表数据 |
| | | reportingWorkMapper.updateWorkProcess(processId, item.get("order_number"), item.get("technology_number"), item.get("completed_quantity"), item.get("breakage_quantity"), thisProcess); |
| | | } |
| | | //删除报工,将审核状态改为-1 |
| | | reportingWorkMapper.deleteWork(reportingWorkId); |
| | | //保存日志 |
| | | Log log = new Log(); |
| | | log.setContent(reportingWorkId+"-"+processId+"-"+thisProcess); |
| | | log.setFunction("deleteWork报工入库删除"); |
| | | log.setOperatorId(userId); |
| | | log.setOperator(userName); |
| | | logService.saveLog(log); |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | } else {//不是入库工序 |
| | | if (count == 0) { |
| | | //查询当前报工编号完工次破数量的数据 |
| | | List<Map<String, Object>> workDateList = reportingWorkMapper.reportingWorkDate(reportingWorkId); |
| | | for (Map<String, Object> item : workDateList) { |
| | | //更新流程卡可入库数量 |
| | | reportingWorkMapper.updateInventoryQuantity(processId, item.get("order_number"), item.get("technology_number"), item.get("completed_quantity")); |
| | | //更新报工流程表数据 |
| | | reportingWorkMapper.updateWorkProcess(processId, item.get("order_number"), item.get("technology_number"), item.get("completed_quantity"), item.get("breakage_quantity"), thisProcess); |
| | | } |
| | | //删除报工,将审核状态改为-1 |
| | | reportingWorkMapper.deleteWork(reportingWorkId); |
| | | |
| | | //保存日志 |
| | | Log log = new Log(); |
| | | log.setContent(reportingWorkId+"-"+processId+"-"+thisProcess); |
| | | log.setFunction("deleteWork报工入库删除"); |
| | | log.setFunction("deleteWork报工删除"); |
| | | log.setOperatorId(userId); |
| | | log.setOperator(userName); |
| | | logService.saveLog(log); |
| | |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | } else {//不是入库工序 |
| | | if (count == 0) { |
| | | //查询当前报工编号完工次破数量的数据 |
| | | List<Map<String, Object>> workDateList = reportingWorkMapper.reportingWorkDate(reportingWorkId); |
| | | for (Map<String, Object> item : workDateList) { |
| | | //更新报工流程表数据 |
| | | reportingWorkMapper.updateWorkProcess(processId, item.get("order_number"), item.get("technology_number"), item.get("completed_quantity"), item.get("breakage_quantity"), thisProcess); |
| | | } |
| | | //删除报工,将审核状态改为-1 |
| | | reportingWorkMapper.deleteWork(reportingWorkId); |
| | | |
| | | //保存日志 |
| | | Log log = new Log(); |
| | | log.setContent(reportingWorkId+"-"+processId+"-"+thisProcess); |
| | | log.setFunction("deleteWork报工删除"); |
| | | log.setOperatorId(userId); |
| | | log.setOperator(userName); |
| | | logService.saveLog(log); |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | else { |
| | | else { |
| | | return false; |
| | | } |
| | | } else { |
| | | return false; |
| | | } |
| | | |
| | | |
| | | } else { |
| | | return false; |
| | | } |
| | |
| | | delete from mm.material_log where operation_order_number=#{materialOutboundId} |
| | | </delete> |
| | | |
| | | <delete id="deleteMaterialLogById" > |
| | | delete from mm.material_log where id=#{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteReturningWarehouseDetail" > |
| | | delete from mm.returning_warehouse_detail where returning_id=#{returningId} |
| | | </delete> |
| | |
| | | </select> |
| | | |
| | | <select id="getMaterialInventoryCount" > |
| | | select count(*) from mm.material_inventory where material_code=#{materialCode} and date_of_manufacture=#{dateOfManufacture} |
| | | select * from mm.material_inventory where material_code=#{materialCode} and date_of_manufacture=#{dateOfManufacture} |
| | | </select> |
| | | |
| | | <select id="getMaterialInventoryCountNull" > |
| | | select count(*) from mm.material_inventory where material_code=#{materialCode} and date_of_manufacture is null |
| | | select * from mm.material_inventory where material_code=#{materialCode} and date_of_manufacture is null |
| | | </select> |
| | | |
| | | <select id="getMaterialInventoryCountId" > |
| | |
| | | update mm.material_inventory set inventory_quantity=inventory_quantity+#{materialInventory.inventoryQuantity}, |
| | | available_quantity=available_quantity+#{materialInventory.inventoryQuantity}, |
| | | total_area=single_piece_area*inventory_quantity |
| | | where material_code=#{materialCode} |
| | | where material_code=#{materialCode} and date_of_manufacture is null |
| | | </update> |
| | | |
| | | <update id="updateMaterialInventoryOut" > |
| | | update mm.material_inventory set inventory_quantity=inventory_quantity-#{quantity}, |
| | | available_quantity=available_quantity-#{quantity}, |
| | | total_area=single_piece_area*inventory_quantity |
| | | where material_code=#{materialCode} and date_of_manufacture=#{dateOfManufacture} |
| | | </update> |
| | | |
| | | <update id="updateMaterialInventoryNullOut" > |
| | | update mm.material_inventory set inventory_quantity=inventory_quantity-#{quantity}, |
| | | available_quantity=available_quantity-#{quantity}, |
| | | total_area=single_piece_area*inventory_quantity |
| | | where material_code=#{materialCode} and date_of_manufacture is null |
| | | </update> |
| | | |
| | | <update id="updateMaterialInventoryReturning" > |
| | |
| | | ) AS subquery; |
| | | |
| | | </select> |
| | | |
| | | <select id="selectReviewedState"> |
| | | select reviewed_state from pp.reporting_work where reporting_work_id=#{reportingWorkId}; |
| | | </select> |
| | | </mapper> |