Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
| | |
| | | <td>{{ itemDatile.total_area }}</td> |
| | | <td>{{ itemDatile.perimeter }}</td> |
| | | <td>{{ itemDatile.bend_radius }}</td> |
| | | <td>{{ itemDatile.remarks }}</td> |
| | | <td style="white-space: normal; word-break: break-all; word-wrap: break-word;">{{ itemDatile.remarks }}</td> |
| | | <template v-for=" n in item.processList.length"> |
| | | <td></td> |
| | | <td></td> |
| | |
| | | name: 'createFinishedGlassShelfEmit', |
| | | component: () => import('../views/mm/finishedGlassShelf/CreateFinishedGlassShelfEmit.vue'), |
| | | }, |
| | | { |
| | | // 料架入库查询 |
| | | path: 'finishedGlassShelfWithdraw', |
| | | name: 'finishedGlassShelfWithdraw', |
| | | component: () => import('../views/mm/finishedGlassShelf/FinishedGlassShelfWithdraw.vue'), |
| | | }, |
| | | { |
| | | // 料架入库明细查询 |
| | | path: 'createFinishedGlassShelfWithdraw', |
| | | name: 'createFinishedGlassShelfWithdraw', |
| | | component: () => import('../views/mm/finishedGlassShelf/CreateFinishedGlassShelfWithdraw.vue'), |
| | | }, |
| | | |
| | | |
| | | { |
| | |
| | | ruleForm.value.remarks=null |
| | | } |
| | | |
| | | |
| | | |
| | | const submitForm = () => { |
| | | if(ruleForm.value.glassShelfNumber==null||ruleForm.value.glassShelfNumber==''){ |
| | | ElMessage.warning('料架编号不能为空') |
| | | return |
| | | } |
| | | if(ruleForm.value.glassShelfName==null||ruleForm.value.glassShelfName==''){ |
| | | ElMessage.warning('料架名称不能为空') |
| | | return |
| | | } |
| | | if(ruleForm.value.totalQuantity==null||ruleForm.value.totalQuantity==''){ |
| | | ElMessage.warning('数量不能为空') |
| | | return |
| | | } |
| | | if(ruleForm.value.price==null||ruleForm.value.price==''){ |
| | | ElMessage.warning('单价不能为空') |
| | | return |
| | | } |
| | | if(ruleForm.value.unit==null||ruleForm.value.unit==''){ |
| | | ElMessage.warning('单位不能为空') |
| | | return |
| | | } |
| | | if(ruleForm.value.maxWeight==null||ruleForm.value.maxWeight==''){ |
| | | ElMessage.warning('最大承重不能为空') |
| | | return |
| | | } |
| | | if(ruleForm.value.maxWidth==null||ruleForm.value.maxWidth==''){ |
| | | ElMessage.warning('最大宽不能为空') |
| | | return |
| | | } |
| | | if(ruleForm.value.maxHeight==null||ruleForm.value.maxHeight==''){ |
| | | ElMessage.warning('最大高不能为空') |
| | | return |
| | | } |
| | | let filterData=ref({ |
| | | data:ruleForm.value, |
| | | title:ruleForm.value, |
| | | userName:userStore.user.userName, |
| | | userId:userStore.user.userId |
| | | }) |
| | | |
| | | console.log(filterData.value) |
| | | /*request.post("/materialStore/saveMaterialStore", filterData.value).then((res) => { |
| | | request.post("/finishedGlassShelf/saveFinishedGlassShelf", filterData.value).then((res) => { |
| | | if(res.code==200 && res.data==="true"){ |
| | | resetForm() |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | | }else if(res.data==="false1"){ |
| | | ElMessage.warning("该料架已存在") |
| | | }else{ |
| | | ElMessage.warning(t('basicData.msg.saveFail')) |
| | | } |
| | | }).catch((err)=>{ |
| | | ElMessage.error(t('basicData.msg.ServerConnectionError')) |
| | | router.push("/login") |
| | | })*/ |
| | | }) |
| | | |
| | | } |
| | | |
| | |
| | | if (typeof str != 'undefined' && str != null && str !== '' && str !== '\n' && str !== '\r'){ |
| | | ruleForm.value.id = Number(str) |
| | | |
| | | request.post(`/materialStore/getSelectMaterialStore`,ruleForm.value).then((res) => { |
| | | request.post(`/finishedGlassShelf/getSelectFinishedGlassShelfInformationById/${ruleForm.value.id}`).then((res) => { |
| | | if(res.code==200){ |
| | | ruleForm.value=deepClone(res.data.data) |
| | | }else{ |
| | |
| | | |
| | | <el-row gutter="20" > |
| | | <el-col :span="10" > |
| | | 料架编号:<el-input v-model="ruleForm.glassShelfNumber" :placeholder="$t('ingredients.pleaseEnterData')" style="width: 150px; height: 30px;" /> |
| | | 料架编号:<el-input v-model.trim="ruleForm.glassShelfNumber" :placeholder="$t('ingredients.pleaseEnterData')" style="width: 150px; height: 30px;" /> |
| | | </el-col> |
| | | <el-col :span="10" > |
| | | 料架名称:<el-input v-model="ruleForm.glassShelfName" :placeholder="$t('ingredients.pleaseEnterData')" style="width: 150px; height: 30px;" /> |
| | | 料架名称:<el-input v-model.trim="ruleForm.glassShelfName" :placeholder="$t('ingredients.pleaseEnterData')" style="width: 150px; height: 30px;" /> |
| | | </el-col> |
| | | <el-divider ></el-divider> <!-- 添加分隔线 --> |
| | | </el-row> |
| | | |
| | | <el-row gutter="20" > |
| | | <el-col :span="10" > |
| | | 现有数量:<el-input v-model="ruleForm.availableQuantity" :placeholder="$t('ingredients.pleaseEnterData')" style="width: 150px; height: 30px;" /> |
| | | 现有数量:<el-input v-model.trim="ruleForm.availableQuantity" :placeholder="$t('ingredients.pleaseEnterData')" style="width: 150px; height: 30px;" /> |
| | | </el-col> |
| | | <el-col :span="10" > |
| | | 总数量:<el-input v-model="ruleForm.totalQuantity" :placeholder="$t('ingredients.pleaseEnterData')" style="width: 150px; height: 30px;" /> |
| | | 总数量:<el-input v-model.trim="ruleForm.totalQuantity" :placeholder="$t('ingredients.pleaseEnterData')" style="width: 150px; height: 30px;" /> |
| | | </el-col> |
| | | <el-divider ></el-divider> <!-- 添加分隔线 --> |
| | | </el-row> |
| | | |
| | | <el-row gutter="20" > |
| | | <el-col :span="10" > |
| | | 单价:<el-input v-model="ruleForm.price" :placeholder="$t('ingredients.pleaseEnterData')" style="width: 150px; height: 30px;" /> |
| | | 单价:<el-input v-model.trim="ruleForm.price" :placeholder="$t('ingredients.pleaseEnterData')" style="width: 150px; height: 30px;" /> |
| | | </el-col> |
| | | <el-col :span="10" > |
| | | 单位:<el-input v-model="ruleForm.unit" :placeholder="$t('ingredients.pleaseEnterData')" style="width: 150px; height: 30px;" /> |
| | | 单位:<el-input v-model.trim="ruleForm.unit" :placeholder="$t('ingredients.pleaseEnterData')" style="width: 150px; height: 30px;" /> |
| | | </el-col> |
| | | <el-divider ></el-divider> <!-- 添加分隔线 --> |
| | | </el-row> |
| | | |
| | | <el-row gutter="20" > |
| | | <el-col :span="10" > |
| | | 最大宽:<el-input v-model="ruleForm.maxWidth" :placeholder="$t('ingredients.pleaseEnterData')" style="width: 150px; height: 30px;" /> |
| | | 最大宽:<el-input v-model.trim="ruleForm.maxWidth" :placeholder="$t('ingredients.pleaseEnterData')" style="width: 150px; height: 30px;" /> |
| | | </el-col> |
| | | <el-col :span="10" > |
| | | 最大高:<el-input v-model="ruleForm.maxHeight" :placeholder="$t('ingredients.pleaseEnterData')" style="width: 150px; height: 30px;" /> |
| | | 最大高:<el-input v-model.trim="ruleForm.maxHeight" :placeholder="$t('ingredients.pleaseEnterData')" style="width: 150px; height: 30px;" /> |
| | | </el-col> |
| | | <el-divider ></el-divider> <!-- 添加分隔线 --> |
| | | </el-row> |
| | | |
| | | <el-row gutter="20" > |
| | | <el-col :span="10" > |
| | | 最大承重:<el-input v-model="ruleForm.maxWeight" :placeholder="$t('ingredients.pleaseEnterData')" style="width: 150px; height: 30px;" /> |
| | | 最大承重:<el-input v-model.trim="ruleForm.maxWeight" :placeholder="$t('ingredients.pleaseEnterData')" style="width: 150px; height: 30px;" /> |
| | | </el-col> |
| | | <el-col :span="10" > |
| | | 备注:<el-input v-model="ruleForm.remarks" :placeholder="$t('ingredients.pleaseEnterData')" style="width: 150px; height: 30px;" /> |
| | |
| | | let titleUploadData = ref({ |
| | | emitId:'', |
| | | withdrawTime:'', |
| | | customerId:'', |
| | | customerName:'', |
| | | project:'', |
| | | operator:'', |
| | |
| | | if (typeof informationId !== 'undefined' && informationId !== null && informationId !== '' && informationId !== '\n' && informationId !== '\r'){ |
| | | |
| | | //第一次调用 |
| | | /*request.post("/delivery/getSelectShippingOrderDetails/1/100",filterData.value).then((res) => { |
| | | request.post("/finishedGlassShelf/getSelectFinishedGlassShelfInformationDetails/1/100",informationId).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | pageTotal.value=res.data.total |
| | | |
| | | |
| | | titleUploadData.value=deepClone(res.data.title) |
| | | titleUploadData.value.paymentTerms = titleSelectJson.value.paymentTerms[0].basicName |
| | | titleUploadData.value.payMethod = titleSelectJson.value.payMethod[0].basicName |
| | | titleUploadData.value.deliveryId="" |
| | | const today = new Date |
| | | today.setTime(today.getTime() ) |
| | | titleUploadData.value.deliveryDate=today.getFullYear() + |
| | | '-' + ("0" + (today.getMonth() + 1)).slice(-2) |
| | | + '-' + ("0" + today.getDate()).slice(-2) |
| | | titleUploadData.value.createTime=today.getFullYear() + |
| | | '-' + ("0" + (today.getMonth() + 1)).slice(-2) |
| | | + '-' + ("0" + today.getDate()).slice(-2) |
| | | titleUploadData.value.payDate=today.getFullYear() + |
| | | '-' + ("0" + (today.getMonth() + 1)).slice(-2) |
| | | + '-' + ("0" + today.getDate()).slice(-2) |
| | | |
| | | titleUploadData.value.creator=userStore.user.userName |
| | | titleUploadData.value.creatorId=userStore.user.userId |
| | | |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | |
| | | |
| | | const orderDetails = res.data.data |
| | | orderDetails.forEach(item => { |
| | | item.otherColumns = JSON.parse(item.otherColumns) |
| | | produceList.forEach(item=>{ |
| | | item.quantity=item.availableQuantity |
| | | }) |
| | | xGrid.value.reloadData(orderDetails) |
| | | xGrid.value.loadData(produceList) |
| | | //禁用按钮 |
| | | gridOptions.toolbarConfig.buttons[1].disabled = true |
| | | gridOptions.toolbarConfig.buttons[2].disabled = true |
| | | //显示复选框 |
| | | xGrid.value.showColumn("select") |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | })*/ |
| | | }) |
| | | } |
| | | //发货编辑 |
| | | const str = route.query.emitId |
| | | const emitId = route.query.emitId |
| | | |
| | | if (typeof str != 'undefined' && str != null && str !== '' && str !== '\n' && str !== '\r'){ |
| | | filterData.value.emitId=str |
| | | if (typeof emitId != 'undefined' && emitId != null && emitId !== '' && emitId !== '\n' && emitId !== '\r'){ |
| | | //第一次调用 |
| | | /*request.post("/delivery/getSelectShippingOrderDetail/1/100",filterData.value).then((res) => { |
| | | request.post("/finishedGlassShelf/getSelectFinishedGlassShelfEmitDetails/1/100",emitId).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | pageTotal.value=res.data.total |
| | | titleUploadData.value=deepClone(res.data.delivery) |
| | | titleUploadData.value.deliveryId=str |
| | | |
| | | //判断是否发货出库 |
| | | if(!company.deliveryOutbound){ |
| | | if(titleUploadData.value.stockState!==0){ |
| | | gridOptions.toolbarConfig.buttons[2].disabled = true |
| | | } |
| | | } |
| | | //根据审核状态显示审核按钮或者是反审按钮 |
| | | if(titleUploadData.value.deliveryState!==0){ |
| | | gridOptions.toolbarConfig.buttons[1].disabled = true |
| | | gridOptions.toolbarConfig.buttons[0].disabled = true |
| | | } |
| | | if(titleUploadData.value.deliveryState===0){ |
| | | gridOptions.toolbarConfig.buttons[2].disabled = true |
| | | } |
| | | |
| | | pageNum=1 |
| | | titleUploadData.value=deepClone(res.data.emit) |
| | | titleUploadData.value.customerId=titleUploadData.value.customerName |
| | | titleUploadData.value.emitId=emitId |
| | | produceList = deepClone(res.data.data) |
| | | const orderDetails = res.data.data |
| | | orderDetails.forEach(item => { |
| | | item.otherColumns = JSON.parse(item.otherColumns) |
| | | }) |
| | | otherMoney.value =res.data.orderOtherMoneyList |
| | | |
| | | titleUploadData.value.creator=userStore.user.userName |
| | | titleUploadData.value.creatorId=userStore.user.userId |
| | | |
| | | xGrid.value.reloadData(orderDetails) |
| | | xGrid.value.loadData(produceList) |
| | | //隐藏复选框 |
| | | /!*xGrid.value.hideColumn("select") |
| | | gridOptions.loading=false*!/ |
| | | xGrid.value.showColumn("select") |
| | | gridOptions.loading=false |
| | | |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | })*/ |
| | | }) |
| | | } |
| | | |
| | | |
| | |
| | | columns:[ |
| | | |
| | | {type: 'seq', title: t('basicData.Number'), width: 80 ,fixed:"left"}, |
| | | {field: 'orderId',width:120, title: t('料架编号'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'orderNumber',width:120, title: t('料架名称'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'finishedGoodsInventory.boxNo',width:120, title: t('现有数量'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'productName',width:120, title: t('总数量'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'width',width:120, title: t('单价'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'height',width:120, title: t('金额'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'deliveryDetail.quantity',width:120, title: t('单位'),editRender: { name: 'input' },filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'finishedGoodsInventory.quantityAvailable',width:120, title: t('备注'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'glassShelfNumber',width:120, title: t('料架编号'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'glassShelfName',width:120, title: t('料架名称'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'quantity',width:120, title: t('出库数量'),editRender: { name: 'input', attrs: { placeholder: '' } }}, |
| | | {field: 'availableQuantity',width:120, title: t('现有数量'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'totalQuantity',width:120, title: t('总数量'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'price',width:120, title: t('单价'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'money',width:120, title: t('金额'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'unit',width:120, title: t('单位'),editRender: { name: 'input' },filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'remarks',width:120, title: t('备注'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | |
| | | ],//表头按钮 |
| | | toolbarConfig: { |
| | |
| | | return |
| | | } |
| | | //表头数据校验 |
| | | const paymentTerms = titleUploadData.value.paymentTerms |
| | | if(paymentTerms === null || paymentTerms === undefined || paymentTerms === ''){ |
| | | ElMessage.error(t('delivery.pleaseSelectPaymentTerms')) |
| | | const customerName = titleUploadData.value.customerName |
| | | if(customerName === null || customerName === undefined || customerName === ''){ |
| | | ElMessage.error(t('客户名称不能为空')) |
| | | return |
| | | } |
| | | const payMethod = titleUploadData.value.payMethod |
| | | if(payMethod === null || payMethod === undefined || payMethod === ''){ |
| | | ElMessage.error(t('delivery.pleaseEnterThePaymentMethod')) |
| | | const project = titleUploadData.value.project |
| | | if(project === null || project === undefined || project === ''){ |
| | | ElMessage.error(t('项目名称不能为空')) |
| | | return |
| | | } |
| | | const freightPrice = titleUploadData.value.freightPrice |
| | | if(freightPrice=== null || freightPrice === undefined || freightPrice === ''){ |
| | | titleUploadData.value.freightPrice=0 |
| | | const withdrawTime = titleUploadData.value.withdrawTime |
| | | if(withdrawTime=== null || withdrawTime === undefined || withdrawTime === ''){ |
| | | ElMessage.error(t('归还日期不能为空')) |
| | | return |
| | | } |
| | | const freightQuantity = titleUploadData.value.freightQuantity |
| | | if(freightQuantity=== null || freightQuantity === undefined || freightQuantity === ''){ |
| | | titleUploadData.value.freightQuantity=0 |
| | | } |
| | | |
| | | |
| | | let flowData = ref({ |
| | | delivery: selectRecords, |
| | | emitDetails: selectRecords, |
| | | title: titleUploadData.value, |
| | | deliveryId: route.query.deliveryID, |
| | | otherMoney:otherMoney.value, |
| | | deliveryIdType:company.deliveryIdType |
| | | emitId: route.query.emitId, |
| | | userName:userStore.user.userName, |
| | | userId:userStore.user.userId |
| | | |
| | | }) |
| | | request.post("/delivery/insertDelivery", flowData.value).then((res) => { |
| | | request.post("/finishedGlassShelf/insertFinishedGlassShelfEmit", flowData.value).then((res) => { |
| | | if(res.code==200 && res.data==="true"){ |
| | | ElMessage.success(t('delivery.deliveryNoteSubmittedSuccessfully')) |
| | | ElMessage.success(t('保存成功')) |
| | | //router.push({path: '/main/delivery/selectDelivery', query:{random:Math.random()}}) |
| | | if(titleUploadData.value.deliveryId.trim()===""){ |
| | | router.push({path: '/main/delivery/selectDelivery', query:{random:Math.random()}}) |
| | | if(titleUploadData.value.emitId.trim()===""){ |
| | | router.push({path: '/main/finishedGlassShelf/finishedGlassShelfEmit', query:{random:Math.random()}}) |
| | | }else{ |
| | | router.push({path:'/main/delivery/createDelivery',query:{ |
| | | deliveryID:titleUploadData.value.deliveryId, |
| | | router.push({path:'/main/finishedGlassShelf/createFinishedGlassShelfEmit',query:{ |
| | | emitId:titleUploadData.value.emitId, |
| | | random:Math.random()}}) |
| | | } |
| | | }else if(res.data==="false1"){ |
| | |
| | | }) |
| | | break |
| | | } |
| | | case 'toExamine': { |
| | | let flowData = ref({ |
| | | deliveryId: route.query.deliveryID, |
| | | type: 2, |
| | | userName:userStore.user.userName, |
| | | userId:userStore.user.userId, |
| | | deliveryOutbound:company.deliveryOutbound |
| | | |
| | | }) |
| | | request.post("/delivery/updateDeliveryToExamine", flowData.value).then((res) => { |
| | | if (res.code == 200 && res.data==="true") { |
| | | ElMessage.success(t('basicData.msg.ReviewSuccess')) |
| | | //router.push({path: '/main/delivery/selectDelivery', query:{random:Math.random()}}) |
| | | router.push({path:'/main/delivery/createDelivery',query:{ |
| | | deliveryID:titleUploadData.value.deliveryId, |
| | | random:Math.random()}}) |
| | | } else { |
| | | ElMessage.warning(t('basicData.msg.reviewFail')) |
| | | } |
| | | }).catch((err)=>{ |
| | | ElMessage.error(t('basicData.msg.ServerConnectionError')) |
| | | router.push("/login") |
| | | }) |
| | | break |
| | | } |
| | | case 'CounterExamination': { |
| | | let flowData = ref({ |
| | | deliveryId: route.query.deliveryID, |
| | | type: 0, |
| | | userName:userStore.user.userName, |
| | | userId:userStore.user.userId, |
| | | deliveryOutbound:company.deliveryOutbound |
| | | |
| | | }) |
| | | request.post("/delivery/updateDeliveryToExamine", flowData.value).then((res) => { |
| | | if (res.code == 200 && res.data==="true") { |
| | | ElMessage.success(t('basicData.msg.cancelReviewSuccess')) |
| | | //router.push({path: '/main/delivery/selectDelivery', query:{random:Math.random()}}) |
| | | router.push({path:'/main/delivery/createDelivery',query:{ |
| | | deliveryID:titleUploadData.value.deliveryId, |
| | | random:Math.random()}}) |
| | | } else { |
| | | ElMessage.warning(t('basicData.msg.reviewFail')) |
| | | } |
| | | }).catch((err)=>{ |
| | | ElMessage.error(t('basicData.msg.ServerConnectionError')) |
| | | router.push("/login") |
| | | }) |
| | | break |
| | | } |
| | | |
| | | } |
| | | } |
| | | }, |
| | | menuClick ({ menu, row, column }) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | | switch (menu.code) { |
| | | |
| | | case 'copyChecked' :{ |
| | | let result = toolbarButtonClickEvent() |
| | | if(result){ |
| | | const dataList = xGrid.value.getTableData().visibleData |
| | | let firstVal=null; |
| | | if(result.cell.indexOf('.')>-1){ |
| | | firstVal = eval("dataList["+result.start +"]."+result.cell) |
| | | }else { |
| | | firstVal=dataList[result.start][result.cell]; |
| | | } |
| | | dataList.forEach((item,index) =>{ |
| | | if(index>=result.start && index<=result.end){ |
| | | //取消选中 |
| | | if(parseInt(firstVal)<=0){ |
| | | xGrid.value.setCheckboxRow(item, false); |
| | | } |
| | | if(result.cell.indexOf('.')>-1){ |
| | | const columnArr = result.cell.split('.') |
| | | item[columnArr[0]][columnArr[1]] = firstVal |
| | | }else{ |
| | | item[result.cell] = firstVal |
| | | } |
| | | |
| | | } |
| | | }) |
| | | } |
| | | break |
| | | } |
| | | case 'copyAll' :{ |
| | | let result = toolbarButtonClickEvent() |
| | | if(result){ |
| | | const dataList = xGrid.value.getTableData().visibleData |
| | | let firstVal=null; |
| | | if(result.cell.indexOf('.')>-1){ |
| | | firstVal = eval("dataList["+result.start +"]."+result.cell) |
| | | }else { |
| | | firstVal=dataList[result.start][result.cell]; |
| | | } |
| | | dataList.forEach((item,index) =>{ |
| | | if(index>=result.start){ |
| | | //取消选中 |
| | | if(parseInt(firstVal)<=0){ |
| | | xGrid.value.setCheckboxRow(item, false); |
| | | } |
| | | if(result.cell.indexOf('.')>-1){ |
| | | const columnArr = result.cell.split('.') |
| | | item[columnArr[0]][columnArr[1]] = firstVal |
| | | }else{ |
| | | item[result.cell] = firstVal |
| | | } |
| | | |
| | | } |
| | | }) |
| | | } |
| | | break |
| | | } |
| | | case 'otherMoney' :{ |
| | | otherMoneyVisible.value=true |
| | | break |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //计算金钱 |
| | | const countMoney = (list) => { |
| | | let countMoney = 0 |
| | | list.forEach((item)=>{ |
| | | countMoney += parseFloat(item.grossAmount) |
| | | }) |
| | | // otherMoney.value.forEach(item => { |
| | | // countMoney+=item.quantity*item.price |
| | | // }) |
| | | return parseFloat((countMoney).toFixed(2)) |
| | | } |
| | | |
| | | //关闭其他金额界面 |
| | | const refOtherMoney = ref() |
| | | const closeOtherMoneyDialog = async (done) => { |
| | | const flag = await refOtherMoney.value.validate() |
| | | if(flag){ |
| | | done() |
| | | //titleUploadData.value.money=countMoney(xGrid.value.getTableData().fullData).toString() |
| | | } |
| | | } |
| | | |
| | | function getNestedProperty(obj, path) { |
| | | return path.split('.').reduce(function(o, p) { |
| | | if(o && o.hasOwnProperty(p)) { |
| | | return o[p]; |
| | | } |
| | | }, obj); |
| | | } |
| | | |
| | | function setNestedValue(obj, path, value) { |
| | | const keys = path.split('.'); |
| | | const lastKey = keys.pop(); |
| | | const lastObj = keys.reduce((obj, key) => obj[key], obj); |
| | | lastObj[lastKey] = value; |
| | | } |
| | | |
| | | |
| | | /*数据校验*/ |
| | | const validRules = ref({ |
| | | "deliveryDetail.quantity": [{ |
| | | "quantity": [{ |
| | | validator (e) { |
| | | if (e.row.deliveryDetail.quantity > e.row.finishedGoodsInventory.quantityAvailable) { |
| | | return new Error(t('delivery.theShipmentQuantityCannotBeGreaterThanTheInventoryQuantity')) |
| | | }else if (e.row.deliveryDetail.quantity ==="") { |
| | | return new Error(t('delivery.theShipmentQuantityCannotBeEmptyOr0')) |
| | | if (e.row.quantity > e.row.availableQuantity) { |
| | | return new Error(t('ingredientsStock.theOutboundQuantityCannotBeGreaterThanTheAvailableQuantity')) |
| | | }else if (e.row.quantity ==="") { |
| | | return new Error(t('ingredientsStock.theOutboundQuantityCannotBeEmptyOrEqualTo0')) |
| | | } |
| | | const regex = /^[1-9]\d*$/g |
| | | if ( !regex.test(e.row.deliveryDetail.quantity) ) { |
| | | if ( !regex.test(e.row.quantity) ) { |
| | | return new Error(t('productStock.pleaseEnterAPositiveInteger')) |
| | | } |
| | | |
| | | } |
| | | |
| | | }], |
| | | price: [ |
| | | { |
| | | validator ({ cellValue }) { |
| | | const regex = /^(0(\.\d{1,2})?|([1-9]\d{0,4})(\.\d{1,2})?|99999(\.9{1,2})?)$/ |
| | | if ( !regex.test(cellValue) ) { |
| | | return new Error(t('basicData.msg.range99999Dec2') ) |
| | | } |
| | | } |
| | | } |
| | | ], |
| | | }] |
| | | |
| | | }) |
| | | |
| | |
| | | </el-col> |
| | | <el-col :span="2"><el-text>{{$t('经办人')}}:</el-text></el-col> |
| | | <el-col :span="3"><el-input disabled v-model="titleUploadData.operator"/></el-col> |
| | | |
| | | </el-row> |
| | | |
| | | <el-row> |
| | | <el-col :span="2"><el-text>{{$t('归还日期')}}:</el-text></el-col> |
| | | <el-col :span="3"> |
| | | <el-date-picker |
| | |
| | | value-format="YYYY-MM-DD" |
| | | :placeholder="$t('delivery.selectDate')"/> |
| | | </el-col> |
| | | <el-col :span="2"><el-text>{{$t('备注')}}:</el-text></el-col> |
| | | <el-col :span="3"><el-input v-model="titleUploadData.remarks"/></el-col> |
| | | </el-row> |
| | | |
| | | </div> |
| | |
| | | |
| | | .head{ |
| | | width: 100%; |
| | | height: 50px; |
| | | height: 70px; |
| | | } |
| | | |
| | | .main-table{ |
| | | width: 100%; |
| | | height: calc(100% - 50px); |
| | | height: calc(100% - 70px); |
| | | } |
| | | </style> |
| New file |
| | |
| | | <script setup> |
| | | |
| | | import {onMounted, reactive, ref} from "vue"; |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {useRoute, useRouter} from "vue-router" |
| | | import request from "@/utils/request" |
| | | import deepClone from "@/utils/deepClone" |
| | | import VXETable from "vxe-table"; |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | import {ElMessage} from "element-plus"; |
| | | import {addListener,toolbarButtonClickEvent} from "@/hook/mouseMove"; |
| | | import { useI18n } from 'vue-i18n' |
| | | import OrderOtherMoney from "@/components/sd/order/OrderOtherMoney.vue"; |
| | | import footSum from "@/hook/footSum"; |
| | | import {changeFilterEvent,filterChanged} from "@/hook" |
| | | import companyInfo from "@/stores/sd/companyInfo"; |
| | | import {multiply} from "@/utils/decimal"; |
| | | |
| | | //语言获取 |
| | | const { t } = useI18n() |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | const userStore = useUserInfoStore() |
| | | const username = userStore.user.userName |
| | | const userid = userStore.user.userId |
| | | const company = companyInfo() |
| | | let produceList = ref([]) |
| | | let cellArea = ref() |
| | | let otherMoneyVisible = ref(false) |
| | | let otherMoney = ref(null) |
| | | let projects = ref([]) |
| | | |
| | | 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]] |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | | customerName:[] |
| | | }) |
| | | |
| | | // 定义表头上传数据 |
| | | let titleUploadData = ref({ |
| | | emitId:'', |
| | | withdrawTime:'', |
| | | customerName:'', |
| | | project:'', |
| | | operator:'', |
| | | state:'', |
| | | remarks:'', |
| | | creatorId:userStore.user.userid, |
| | | creator:userStore.user.userName |
| | | }) |
| | | |
| | | |
| | | |
| | | //筛选条件,有外键需要先定义明细里面的数据 |
| | | let filterData = ref({ |
| | | emitId:'', |
| | | emitNumber:'', |
| | | glassShelfNumber:'', |
| | | glassShelfName:'', |
| | | quantity:'', |
| | | unit:'', |
| | | price:'', |
| | | money:'', |
| | | remarks:'' |
| | | }) |
| | | const initOrder = async ()=> { |
| | | //页面第一次加载 |
| | | await request.get(`/basicData/orderBasicData`).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | titleSelectJson.value = deepClone(res.data) |
| | | titleUploadData.value.operator=userStore.user.userName |
| | | const today = new Date |
| | | today.setTime(today.getTime()) |
| | | titleUploadData.value.withdrawTime = today.getFullYear() + |
| | | '-' + ("0" + (today.getMonth() + 1)).slice(-2) |
| | | + '-' + ("0" + today.getDate()).slice(-2) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | |
| | | } |
| | | |
| | | const xGrid = ref(); |
| | | |
| | | onMounted( async()=>{ |
| | | await initOrder() |
| | | //启用表格拖动选中 |
| | | addListener(xGrid.value,gridOptions,cellArea.value) |
| | | //发货新增 |
| | | const informationId = route.query.informationId |
| | | if (typeof informationId !== 'undefined' && informationId !== null && informationId !== '' && informationId !== '\n' && informationId !== '\r'){ |
| | | |
| | | //第一次调用 |
| | | /*request.post("/delivery/getSelectShippingOrderDetails/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | pageTotal.value=res.data.total |
| | | |
| | | |
| | | titleUploadData.value=deepClone(res.data.title) |
| | | titleUploadData.value.paymentTerms = titleSelectJson.value.paymentTerms[0].basicName |
| | | titleUploadData.value.payMethod = titleSelectJson.value.payMethod[0].basicName |
| | | titleUploadData.value.deliveryId="" |
| | | const today = new Date |
| | | today.setTime(today.getTime() ) |
| | | titleUploadData.value.deliveryDate=today.getFullYear() + |
| | | '-' + ("0" + (today.getMonth() + 1)).slice(-2) |
| | | + '-' + ("0" + today.getDate()).slice(-2) |
| | | titleUploadData.value.createTime=today.getFullYear() + |
| | | '-' + ("0" + (today.getMonth() + 1)).slice(-2) |
| | | + '-' + ("0" + today.getDate()).slice(-2) |
| | | titleUploadData.value.payDate=today.getFullYear() + |
| | | '-' + ("0" + (today.getMonth() + 1)).slice(-2) |
| | | + '-' + ("0" + today.getDate()).slice(-2) |
| | | |
| | | titleUploadData.value.creator=userStore.user.userName |
| | | titleUploadData.value.creatorId=userStore.user.userId |
| | | |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | |
| | | |
| | | const orderDetails = res.data.data |
| | | orderDetails.forEach(item => { |
| | | item.otherColumns = JSON.parse(item.otherColumns) |
| | | }) |
| | | xGrid.value.reloadData(orderDetails) |
| | | xGrid.value.loadData(produceList) |
| | | //禁用按钮 |
| | | gridOptions.toolbarConfig.buttons[1].disabled = true |
| | | gridOptions.toolbarConfig.buttons[2].disabled = true |
| | | //显示复选框 |
| | | xGrid.value.showColumn("select") |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | })*/ |
| | | } |
| | | //发货编辑 |
| | | const str = route.query.emitId |
| | | |
| | | if (typeof str != 'undefined' && str != null && str !== '' && str !== '\n' && str !== '\r'){ |
| | | filterData.value.emitId=str |
| | | //第一次调用 |
| | | /*request.post("/delivery/getSelectShippingOrderDetail/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | pageTotal.value=res.data.total |
| | | titleUploadData.value=deepClone(res.data.delivery) |
| | | titleUploadData.value.deliveryId=str |
| | | |
| | | //判断是否发货出库 |
| | | if(!company.deliveryOutbound){ |
| | | if(titleUploadData.value.stockState!==0){ |
| | | gridOptions.toolbarConfig.buttons[2].disabled = true |
| | | } |
| | | } |
| | | //根据审核状态显示审核按钮或者是反审按钮 |
| | | if(titleUploadData.value.deliveryState!==0){ |
| | | gridOptions.toolbarConfig.buttons[1].disabled = true |
| | | gridOptions.toolbarConfig.buttons[0].disabled = true |
| | | } |
| | | if(titleUploadData.value.deliveryState===0){ |
| | | gridOptions.toolbarConfig.buttons[2].disabled = true |
| | | } |
| | | |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | const orderDetails = res.data.data |
| | | orderDetails.forEach(item => { |
| | | item.otherColumns = JSON.parse(item.otherColumns) |
| | | }) |
| | | otherMoney.value =res.data.orderOtherMoneyList |
| | | |
| | | titleUploadData.value.creator=userStore.user.userName |
| | | titleUploadData.value.creatorId=userStore.user.userId |
| | | |
| | | xGrid.value.reloadData(orderDetails) |
| | | xGrid.value.loadData(produceList) |
| | | //隐藏复选框 |
| | | /!*xGrid.value.hideColumn("select") |
| | | gridOptions.loading=false*!/ |
| | | xGrid.value.showColumn("select") |
| | | gridOptions.loading=false |
| | | |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | })*/ |
| | | } |
| | | |
| | | |
| | | }) |
| | | |
| | | //定义页面总页数 |
| | | let pageTotal=ref('') |
| | | //定义当前页数 |
| | | let pageNum=$ref(1) |
| | | |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮 |
| | | id: 'CreateFinishedGlassShelfEmit', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | menuConfig: { |
| | | body: { |
| | | options: [ |
| | | [ |
| | | { code: 'copyChecked', name: t('归还'), prefixIcon: 'vxe-icon-copy', visible: true, disabled: false }, |
| | | ] |
| | | ] |
| | | } |
| | | }, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | //remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | checkboxConfig:{checkAll:true}, |
| | | mouseConfig:{selected: true},//鼠标选中 |
| | | keyboardConfig:{isArrow: true, isDel: true, isEnter: true, isTab: true, isEdit: true, isChecked: true}, |
| | | editConfig: { |
| | | trigger: 'dblclick', |
| | | mode: 'cell', |
| | | showStatus: true, |
| | | showIcon:false |
| | | },//表头参数 |
| | | columns:[ |
| | | |
| | | {type: 'seq', title: t('basicData.Number'), width: 80 ,fixed:"left"}, |
| | | {field: 'width',width:120, title: t('出库编号'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'height',width:120, title: t('出库序号'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'width',width:120, title: t('入库编号'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'height',width:120, title: t('入库序号'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'orderId',width:120, title: t('料架编号'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'orderNumber',width:120, title: t('料架名称'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'finishedGoodsInventory.boxNo',width:120, title: t('现有数量'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'productName',width:120, title: t('总数量'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'width',width:120, title: t('单价'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'height',width:120, title: t('金额'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'deliveryDetail.quantity',width:120, title: t('单位'),editRender: { name: 'input' },filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'finishedGoodsInventory.quantityAvailable',width:120, title: t('备注'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | |
| | | ],//表头按钮 |
| | | toolbarConfig: { |
| | | buttons: [ |
| | | {'code': 'add', 'name': t('basicData.save'),status: 'primary',icon: 'vxe-icon-save'} |
| | | ], |
| | | /*import: false, |
| | | export: true, |
| | | print: true,*/ |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | let footList=['deliveryDetail.quantity','quantity','deliveryDetail.money'] |
| | | //let footList=[] |
| | | 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 = { |
| | | async toolbarButtonClick({code}) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | | switch (code) { |
| | | case 'add': { |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | |
| | | if (selectRecords.length === 0) { |
| | | ElMessage.warning(t('productStock.unselectedData')) |
| | | return |
| | | } |
| | | const errMap = await $grid.validate(selectRecords) |
| | | if (errMap) { |
| | | ElMessage.warning(t('productStock.dataVerificationFailed')) |
| | | return |
| | | } |
| | | //表头数据校验 |
| | | const paymentTerms = titleUploadData.value.paymentTerms |
| | | if(paymentTerms === null || paymentTerms === undefined || paymentTerms === ''){ |
| | | ElMessage.error(t('delivery.pleaseSelectPaymentTerms')) |
| | | return |
| | | } |
| | | const payMethod = titleUploadData.value.payMethod |
| | | if(payMethod === null || payMethod === undefined || payMethod === ''){ |
| | | ElMessage.error(t('delivery.pleaseEnterThePaymentMethod')) |
| | | return |
| | | } |
| | | const freightPrice = titleUploadData.value.freightPrice |
| | | if(freightPrice=== null || freightPrice === undefined || freightPrice === ''){ |
| | | titleUploadData.value.freightPrice=0 |
| | | } |
| | | const freightQuantity = titleUploadData.value.freightQuantity |
| | | if(freightQuantity=== null || freightQuantity === undefined || freightQuantity === ''){ |
| | | titleUploadData.value.freightQuantity=0 |
| | | } |
| | | |
| | | |
| | | let flowData = ref({ |
| | | delivery: selectRecords, |
| | | title: titleUploadData.value, |
| | | deliveryId: route.query.deliveryID, |
| | | otherMoney:otherMoney.value, |
| | | deliveryIdType:company.deliveryIdType |
| | | |
| | | }) |
| | | request.post("/delivery/insertDelivery", flowData.value).then((res) => { |
| | | if(res.code==200 && res.data==="true"){ |
| | | ElMessage.success(t('delivery.deliveryNoteSubmittedSuccessfully')) |
| | | //router.push({path: '/main/delivery/selectDelivery', query:{random:Math.random()}}) |
| | | if(titleUploadData.value.deliveryId.trim()===""){ |
| | | router.push({path: '/main/delivery/selectDelivery', query:{random:Math.random()}}) |
| | | }else{ |
| | | router.push({path:'/main/delivery/createDelivery',query:{ |
| | | deliveryID:titleUploadData.value.deliveryId, |
| | | random:Math.random()}}) |
| | | } |
| | | }else if(res.data==="false1"){ |
| | | ElMessage.warning(t('delivery.pleaseMsg1')) |
| | | }else if(res.data==="false2"){ |
| | | ElMessage.warning(t('basicData.msg.quantityError')) |
| | | }else if(res.data==="false3"){ |
| | | ElMessage.warning(t('basicData.msg.dataDoesNotExist')) |
| | | }else{ |
| | | ElMessage.warning(t('basicData.msg.saveFail')) |
| | | } |
| | | }).catch((err)=>{ |
| | | ElMessage.error(t('basicData.msg.ServerConnectionError')) |
| | | router.push("/login") |
| | | }) |
| | | break |
| | | } |
| | | case 'toExamine': { |
| | | let flowData = ref({ |
| | | deliveryId: route.query.deliveryID, |
| | | type: 2, |
| | | userName:userStore.user.userName, |
| | | userId:userStore.user.userId, |
| | | deliveryOutbound:company.deliveryOutbound |
| | | |
| | | }) |
| | | request.post("/delivery/updateDeliveryToExamine", flowData.value).then((res) => { |
| | | if (res.code == 200 && res.data==="true") { |
| | | ElMessage.success(t('basicData.msg.ReviewSuccess')) |
| | | //router.push({path: '/main/delivery/selectDelivery', query:{random:Math.random()}}) |
| | | router.push({path:'/main/delivery/createDelivery',query:{ |
| | | deliveryID:titleUploadData.value.deliveryId, |
| | | random:Math.random()}}) |
| | | } else { |
| | | ElMessage.warning(t('basicData.msg.reviewFail')) |
| | | } |
| | | }).catch((err)=>{ |
| | | ElMessage.error(t('basicData.msg.ServerConnectionError')) |
| | | router.push("/login") |
| | | }) |
| | | break |
| | | } |
| | | case 'CounterExamination': { |
| | | let flowData = ref({ |
| | | deliveryId: route.query.deliveryID, |
| | | type: 0, |
| | | userName:userStore.user.userName, |
| | | userId:userStore.user.userId, |
| | | deliveryOutbound:company.deliveryOutbound |
| | | |
| | | }) |
| | | request.post("/delivery/updateDeliveryToExamine", flowData.value).then((res) => { |
| | | if (res.code == 200 && res.data==="true") { |
| | | ElMessage.success(t('basicData.msg.cancelReviewSuccess')) |
| | | //router.push({path: '/main/delivery/selectDelivery', query:{random:Math.random()}}) |
| | | router.push({path:'/main/delivery/createDelivery',query:{ |
| | | deliveryID:titleUploadData.value.deliveryId, |
| | | random:Math.random()}}) |
| | | } else { |
| | | ElMessage.warning(t('basicData.msg.reviewFail')) |
| | | } |
| | | }).catch((err)=>{ |
| | | ElMessage.error(t('basicData.msg.ServerConnectionError')) |
| | | router.push("/login") |
| | | }) |
| | | break |
| | | } |
| | | |
| | | } |
| | | } |
| | | }, |
| | | menuClick ({ menu, row, column }) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | | switch (menu.code) { |
| | | |
| | | case 'copyChecked' :{ |
| | | let result = toolbarButtonClickEvent() |
| | | if(result){ |
| | | const dataList = xGrid.value.getTableData().visibleData |
| | | let firstVal=null; |
| | | if(result.cell.indexOf('.')>-1){ |
| | | firstVal = eval("dataList["+result.start +"]."+result.cell) |
| | | }else { |
| | | firstVal=dataList[result.start][result.cell]; |
| | | } |
| | | dataList.forEach((item,index) =>{ |
| | | if(index>=result.start && index<=result.end){ |
| | | //取消选中 |
| | | if(parseInt(firstVal)<=0){ |
| | | xGrid.value.setCheckboxRow(item, false); |
| | | } |
| | | if(result.cell.indexOf('.')>-1){ |
| | | const columnArr = result.cell.split('.') |
| | | item[columnArr[0]][columnArr[1]] = firstVal |
| | | }else{ |
| | | item[result.cell] = firstVal |
| | | } |
| | | |
| | | } |
| | | }) |
| | | } |
| | | break |
| | | } |
| | | case 'copyAll' :{ |
| | | let result = toolbarButtonClickEvent() |
| | | if(result){ |
| | | const dataList = xGrid.value.getTableData().visibleData |
| | | let firstVal=null; |
| | | if(result.cell.indexOf('.')>-1){ |
| | | firstVal = eval("dataList["+result.start +"]."+result.cell) |
| | | }else { |
| | | firstVal=dataList[result.start][result.cell]; |
| | | } |
| | | dataList.forEach((item,index) =>{ |
| | | if(index>=result.start){ |
| | | //取消选中 |
| | | if(parseInt(firstVal)<=0){ |
| | | xGrid.value.setCheckboxRow(item, false); |
| | | } |
| | | if(result.cell.indexOf('.')>-1){ |
| | | const columnArr = result.cell.split('.') |
| | | item[columnArr[0]][columnArr[1]] = firstVal |
| | | }else{ |
| | | item[result.cell] = firstVal |
| | | } |
| | | |
| | | } |
| | | }) |
| | | } |
| | | break |
| | | } |
| | | case 'otherMoney' :{ |
| | | otherMoneyVisible.value=true |
| | | break |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /*数据校验*/ |
| | | const validRules = ref({ |
| | | "deliveryDetail.quantity": [{ |
| | | validator (e) { |
| | | if (e.row.deliveryDetail.quantity > e.row.finishedGoodsInventory.quantityAvailable) { |
| | | return new Error(t('delivery.theShipmentQuantityCannotBeGreaterThanTheInventoryQuantity')) |
| | | }else if (e.row.deliveryDetail.quantity ==="") { |
| | | return new Error(t('delivery.theShipmentQuantityCannotBeEmptyOr0')) |
| | | } |
| | | const regex = /^[1-9]\d*$/g |
| | | if ( !regex.test(e.row.deliveryDetail.quantity) ) { |
| | | return new Error(t('productStock.pleaseEnterAPositiveInteger')) |
| | | } |
| | | |
| | | } |
| | | |
| | | }], |
| | | price: [ |
| | | { |
| | | validator ({ cellValue }) { |
| | | const regex = /^(0(\.\d{1,2})?|([1-9]\d{0,4})(\.\d{1,2})?|99999(\.9{1,2})?)$/ |
| | | if ( !regex.test(cellValue) ) { |
| | | return new Error(t('basicData.msg.range99999Dec2') ) |
| | | } |
| | | } |
| | | } |
| | | ], |
| | | |
| | | }) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div style="width: 100%;height: 100%"> |
| | | <div class="head" style="background-color: white"> |
| | | <el-row> |
| | | <el-col :span="2"><el-text>*{{$t('order.customers')}}:</el-text></el-col> |
| | | <el-col :span="3"> |
| | | <el-input disabled v-model="titleUploadData.customerId"/> |
| | | </el-col> |
| | | <el-col :span="2"><el-text>*{{$t('order.project')}}:</el-text></el-col> |
| | | <el-col :span="3"> |
| | | <el-input disabled v-model="titleUploadData.project"/> |
| | | </el-col> |
| | | <el-col :span="2"><el-text>{{$t('经办人')}}:</el-text></el-col> |
| | | <el-col :span="3"><el-input disabled v-model="titleUploadData.operator"/></el-col> |
| | | <el-col :span="2"><el-text>{{$t('归还日期')}}:</el-text></el-col> |
| | | <el-col :span="3"> |
| | | <el-date-picker |
| | | v-model="titleUploadData.withdrawTime" |
| | | type="date" |
| | | format="YYYY-MM-DD" |
| | | value-format="YYYY-MM-DD" |
| | | :placeholder="$t('delivery.selectDate')"/> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | </div> |
| | | <div class="main-table"> |
| | | <vxe-grid |
| | | height="100%" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | :edit-rules="validRules" |
| | | |
| | | > |
| | | <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 #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> |
| | | |
| | | </vxe-grid> |
| | | </div> |
| | | <div class="vxe-table--cell-area" ref="cellArea" > |
| | | <span class="vxe-table--cell-main-area" ></span> |
| | | |
| | | <span class="vxe-table--cell-active-area" ></span> |
| | | </div> |
| | | |
| | | <el-dialog v-model="otherMoneyVisible" |
| | | :title="$t('basicData.otherAmounts')" |
| | | :close-on-click-modal="false" |
| | | :close-on-press-escape="false" |
| | | :before-close="closeOtherMoneyDialog" |
| | | style="width: 614px;height:445px "> |
| | | <order-other-money |
| | | ref="refOtherMoney" |
| | | :otherMoney="otherMoney" |
| | | style="width: 100%;height: 100%" /> |
| | | </el-dialog> |
| | | </div> |
| | | |
| | | </template> |
| | | |
| | | <style scoped> |
| | | .main-div { |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | .el-col{ |
| | | border: #181818 1px solid; |
| | | } |
| | | :deep(.el-input__wrapper) { |
| | | box-shadow: 0 0 0 0 var(--el-input-border-color, var(--el-border-color)) inset; |
| | | cursor: default; |
| | | border: none !important; |
| | | background-color: transparent; |
| | | } |
| | | .order-primary{ |
| | | width: 100%; |
| | | } |
| | | .order-detail{ |
| | | width: 100%; |
| | | height: 70%; |
| | | } |
| | | .vxe-grid { |
| | | /* 禁用浏览器默认选中 */ |
| | | -webkit-user-select: none; |
| | | -moz-user-select: none; |
| | | -ms-user-select: none; |
| | | user-select: none; |
| | | } |
| | | |
| | | :deep(#product .el-dialog__body){ |
| | | height: 90%; |
| | | width: 100%; |
| | | } |
| | | |
| | | .head{ |
| | | width: 100%; |
| | | height: 50px; |
| | | } |
| | | |
| | | .main-table{ |
| | | width: 100%; |
| | | height: calc(100% - 50px); |
| | | } |
| | | </style> |
| | |
| | | <el-breadcrumb :separator-icon="ArrowRight"> |
| | | <el-breadcrumb-item @click="changeRouter(1)" :class="indexFlag===1?'indexTag':''" :to="{ path: '/main/finishedGlassShelf/finishedGlassShelfInformation' }">{{$t('料架库存')}}</el-breadcrumb-item> |
| | | <el-breadcrumb-item @click="changeRouter(2)" :class="indexFlag===2?'indexTag':''" :to="{ path: '/main/finishedGlassShelf/finishedGlassShelfEmit' }">{{$t('料架出库')}}</el-breadcrumb-item> |
| | | <el-breadcrumb-item @click="changeRouter(3)" :class="indexFlag===3?'indexTag':''" :to="{ path: '/main/finishedGlassShelf/returnToStorage' }">{{$t('料架入库')}}</el-breadcrumb-item> |
| | | <el-breadcrumb-item @click="changeRouter(3)" :class="indexFlag===3?'indexTag':''" :to="{ path: '/main/finishedGlassShelf/finishedGlassShelfWithdraw' }">{{$t('料架入库')}}</el-breadcrumb-item> |
| | | <el-breadcrumb-item @click="changeRouter(4)" :class="indexFlag===4?'indexTag':''" :to="{ path: '/main/finishedGlassShelf/createFinishedGlassShelf' }">{{$t('料架新增')}}</el-breadcrumb-item> |
| | | <el-breadcrumb-item @click="changeRouter(6)" :class="indexFlag===6?'indexTag':''" :to="{ path: '/main/finishedGlassShelf/CreateFinishedGlassShelfEmit' }">{{$t('料架报表')}}</el-breadcrumb-item> |
| | | <el-breadcrumb-item @click="changeRouter(6)" :class="indexFlag===6?'indexTag':''" :to="{ path: '/main/finishedGlassShelf/createFinishedGlassShelfWithdraw' }">{{$t('料架报表')}}</el-breadcrumb-item> |
| | | <el-breadcrumb-item v-show="false" :to="{ path: '/main/order/orderReport' }">{{$t('ingredientsStock.returnToStorage')}}</el-breadcrumb-item> |
| | | </el-breadcrumb> |
| | | |
| | |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | router.push({path: '/main/finishedGlassShelf/createFinishedGlassShelfEmit', query: { id: row.id }}) |
| | | router.push({path: '/main/finishedGlassShelf/createFinishedGlassShelfEmit', query: { emitId: row.emitId }}) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | | let flowData = ref({ |
| | | id: row.id, |
| | | emitId: row.emitId, |
| | | userName:userStore.user.userName, |
| | | userId:userStore.user.userId |
| | | }) |
| | | request.post("/materialStore/deleteMaterialStore",flowData.value).then((res) => { |
| | | request.post("/finishedGlassShelf/deleteFinishedGlassShelfEmit",flowData.value).then((res) => { |
| | | if(res.code==200 && res.data==="true"){ |
| | | ElMessage.success(t('basicData.msg.deleteSuccess')) |
| | | router.push({path:'/main/ingredients/SelectIngredients',query:{random:Math.random()}}) |
| | | router.push({path:'/main/finishedGlassShelf/finishedGlassShelfEmit',query:{random:Math.random()}}) |
| | | }else if(res.data==="false1"){ |
| | | ElMessage.warning(t('ingredients.msg1')) |
| | | }else{ |
| | |
| | | addListener(xGrid.value,gridOptions) |
| | | |
| | | //第一次调用 |
| | | // request.get(`/BasicWarehouse/BasicWarehouseType/`+t('ingredients.originalFilm')+'|'+t('ingredients.accessories')).then((res) => { |
| | | // if(res.code==200){ |
| | | // gridOptions.columns.splice(0,gridOptions.columns.length) |
| | | // BasicData.value = res.data |
| | | // //添加列 |
| | | // gridOptions.columns=arr.slice() |
| | | // |
| | | // for (let i=0;i<BasicData.value.length;i++){ |
| | | // let aa=null |
| | | // if(BasicData.value[i].OperateType==="name"){ |
| | | // aa={field: "json."+BasicData.value[i].OperateType, width: '150',title: BasicData.value[i].OperateTypeName, sortable: true,showOverflow:'ellipsis' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChangeds} |
| | | // }else{ |
| | | // aa={field: "json."+BasicData.value[i].OperateType, width: '150',title: BasicData.value[i].OperateTypeName, sortable: true,showOverflow:'ellipsis' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged} |
| | | // } |
| | | // gridOptions.columns.push(aa) |
| | | // |
| | | // } |
| | | // values.value=t('ingredientsStock.inventory') |
| | | // getInventoryWorks() |
| | | // |
| | | // }else{ |
| | | // ElMessage.warning(res.msg) |
| | | // } |
| | | // }) |
| | | request.post(`/finishedGlassShelf/getSelectFinishedGlassShelfEmit/${pageNum.value}/${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) |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | const getInventoryEngineeringWork = () => { |
| | | |
| | | request.post(`/materialInventory/getSelectMaterialInventoryEngineeringDate/${pageNum.value}/${total.pageSize}/${selectDate.value}`,filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | materialStore.value=[] |
| | | for (let i=0;i<res.data.data.length;i++){ |
| | | materialStore.value[i]=(res.data.data[i]) |
| | | materialStore.value[i].json=(JSON.parse(res.data.data[i].json)) |
| | | |
| | | } |
| | | |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal= res.data.total.pageTotal |
| | | pageNum.value=1 |
| | | selectDate.value = res.data.selectDate |
| | | gridOptions.toolbarConfig.buttons[2].disabled = true |
| | | produceList = deepClone(materialStore.value) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | const selectOrderList = ()=>{ |
| | | request.get(`/BasicWarehouse/BasicWarehouseType/`+t('ingredients.originalFilm')+'|'+t('ingredients.accessories')).then((res) => { |
| | | request.post(`/finishedGlassShelf/getSelectFinishedGlassShelfEmit/1/${total.pageSize}/${selectDate.value}`,filterData.value).then((res) => { |
| | | if(res.code==200){ |
| | | gridOptions.columns.splice(0,gridOptions.columns.length) |
| | | BasicData.value = res.data |
| | | //添加列 |
| | | gridOptions.columns=arr.slice() |
| | | |
| | | for (let i=0;i<BasicData.value.length;i++){ |
| | | let aa=null |
| | | if(BasicData.value[i].OperateType==="model"){ |
| | | aa={field: "json."+BasicData.value[i].OperateType, width: '150',title: BasicData.value[i].OperateTypeName, sortable: true,showOverflow:'ellipsis' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged} |
| | | }else{ |
| | | aa={field: "json."+BasicData.value[i].OperateType, width: '150',title: BasicData.value[i].OperateTypeName, sortable: true,showOverflow:'ellipsis' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged} |
| | | } |
| | | |
| | | gridOptions.columns.push(aa) |
| | | |
| | | if (res.data.total!=null){ |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal= res.data.total.pageTotal |
| | | } |
| | | if(values.value===t('ingredientsStock.inventory')){ |
| | | getInventoryWorkPaging() |
| | | }else{ |
| | | getInventoryEngineeringWork() |
| | | } |
| | | |
| | | selectDate.value = res.data.selectDate |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | |
| | | columns:[ |
| | | {title: t('basicData.operate'), width: '110', slots: { default: 'button_slot' },fixed:'left'}, |
| | | { type: 'seq',fixed:"left", title: t('basicData.Number'), width: '80' }, |
| | | {field: 'inventoryOrganization', width:'150', title: t('出库单据编号'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged }, |
| | | {field: 'materialCode', width: '150',title: t('客户名称'), sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'producer', width: '120',title: t('项目名称'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'id',width: '100', title: t('经办人'), sortable: true,showOverflow:"ellipsis",filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'projectNo',width: '100', title: t('归还日期'), sortable: true}, |
| | | {field: 'emitId', width:'150', title: t('出库单据编号'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged }, |
| | | {field: 'customerName', width: '150',title: t('客户名称'), sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'project', width: '120',title: t('项目名称'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'operator',width: '100', title: t('经办人'), sortable: true,showOverflow:"ellipsis",filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'withdrawTime',width: '100', title: t('归还日期'), sortable: true}, |
| | | {field: 'createTime',width: '100', title: t('创建时间'), sortable: true}, |
| | | {field: 'qualityGuaranteePeriod',width: '100', title: t('备注'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'remarks',width: '100', title: t('备注'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | |
| | | ],//表头按钮 |
| | | toolbarConfig: { |
| | |
| | | </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> |
| | |
| | | <script setup> |
| | | |
| | | import {onMounted, reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | import {useRoute, useRouter} from 'vue-router' |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | |
| | | const userStore = useUserInfoStore() |
| | | const company = companyInfo() |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | let produceList = ref([]) |
| | | let sheetIndex = ref(-1) |
| | | let rowIndexData = ref(null) |
| | |
| | | userName:userStore.user.userName, |
| | | userId:userStore.user.userId |
| | | }) |
| | | request.post("/materialStore/deleteMaterialStore",flowData.value).then((res) => { |
| | | request.post("/finishedGlassShelf/deleteFinishedGlassShelfInformationById",flowData.value).then((res) => { |
| | | if(res.code==200 && res.data==="true"){ |
| | | ElMessage.success(t('basicData.msg.deleteSuccess')) |
| | | router.push({path:'/main/ingredients/SelectIngredients',query:{random:Math.random()}}) |
| | | }else if(res.data==="false1"){ |
| | | ElMessage.warning(t('ingredients.msg1')) |
| | | router.push({path:'/main/finishedGlassShelf/finishedGlassShelfInformation',query:{random:Math.random()}}) |
| | | }else{ |
| | | ElMessage.warning(t('basicData.msg.deleteFail')) |
| | | } |
| | |
| | | pageSize : 100 |
| | | }) |
| | | |
| | | let filterData = ref({ |
| | | |
| | | }) |
| | | |
| | | const values = ref('') |
| | | |
| | |
| | | let selectDate = ref(["",""]) |
| | | let BasicData = ref([]) |
| | | let materialStore= ref([]) |
| | | let orderId=ref(null) |
| | | let deliveryId=ref(null) |
| | | |
| | | |
| | | |
| | |
| | | onMounted(() => { |
| | | addListener(xGrid.value,gridOptions) |
| | | |
| | | const orderID = route.query.orderId |
| | | const deliveryID = route.query.deliveryID |
| | | if (typeof orderID !== 'undefined' && orderID !== null && orderID !== '' && orderID !== '\n' && orderID !== '\r'){ |
| | | orderId.value=orderID |
| | | } |
| | | if (typeof deliveryID !== 'undefined' && deliveryID !== null && deliveryID !== '' && deliveryID !== '\n' && deliveryID !== '\r'){ |
| | | deliveryId.value=deliveryID |
| | | } |
| | | |
| | | //第一次调用 |
| | | // request.get(`/BasicWarehouse/BasicWarehouseType/`+t('ingredients.originalFilm')+'|'+t('ingredients.accessories')).then((res) => { |
| | | // if(res.code==200){ |
| | | // gridOptions.columns.splice(0,gridOptions.columns.length) |
| | | // BasicData.value = res.data |
| | | // //添加列 |
| | | // gridOptions.columns=arr.slice() |
| | | // |
| | | // for (let i=0;i<BasicData.value.length;i++){ |
| | | // let aa=null |
| | | // if(BasicData.value[i].OperateType==="name"){ |
| | | // aa={field: "json."+BasicData.value[i].OperateType, width: '150',title: BasicData.value[i].OperateTypeName, sortable: true,showOverflow:'ellipsis' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChangeds} |
| | | // }else{ |
| | | // aa={field: "json."+BasicData.value[i].OperateType, width: '150',title: BasicData.value[i].OperateTypeName, sortable: true,showOverflow:'ellipsis' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged} |
| | | // } |
| | | // gridOptions.columns.push(aa) |
| | | // |
| | | // } |
| | | // values.value=t('ingredientsStock.inventory') |
| | | // getInventoryWorks() |
| | | // |
| | | // }else{ |
| | | // ElMessage.warning(res.msg) |
| | | // } |
| | | // }) |
| | | }) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | const getInventoryEngineeringWork = () => { |
| | | |
| | | request.post(`/materialInventory/getSelectMaterialInventoryEngineeringDate/${pageNum.value}/${total.pageSize}/${selectDate.value}`,filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | materialStore.value=[] |
| | | for (let i=0;i<res.data.data.length;i++){ |
| | | materialStore.value[i]=(res.data.data[i]) |
| | | materialStore.value[i].json=(JSON.parse(res.data.data[i].json)) |
| | | |
| | | } |
| | | |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal= res.data.total.pageTotal |
| | | pageNum.value=1 |
| | | selectDate.value = res.data.selectDate |
| | | gridOptions.toolbarConfig.buttons[2].disabled = true |
| | | produceList = deepClone(materialStore.value) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | const selectOrderList = ()=>{ |
| | | request.get(`/BasicWarehouse/BasicWarehouseType/`+t('ingredients.originalFilm')+'|'+t('ingredients.accessories')).then((res) => { |
| | | request.post(`/finishedGlassShelf/getSelectFinishedGlassShelfInformation/1/${total.pageSize}`).then((res) => { |
| | | if(res.code==200){ |
| | | gridOptions.columns.splice(0,gridOptions.columns.length) |
| | | BasicData.value = res.data |
| | | //添加列 |
| | | gridOptions.columns=arr.slice() |
| | | |
| | | for (let i=0;i<BasicData.value.length;i++){ |
| | | let aa=null |
| | | if(BasicData.value[i].OperateType==="model"){ |
| | | aa={field: "json."+BasicData.value[i].OperateType, width: '150',title: BasicData.value[i].OperateTypeName, sortable: true,showOverflow:'ellipsis' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged} |
| | | }else{ |
| | | aa={field: "json."+BasicData.value[i].OperateType, width: '150',title: BasicData.value[i].OperateTypeName, sortable: true,showOverflow:'ellipsis' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged} |
| | | } |
| | | |
| | | gridOptions.columns.push(aa) |
| | | |
| | | } |
| | | if(values.value===t('ingredientsStock.inventory')){ |
| | | getInventoryWorkPaging() |
| | | }else{ |
| | | getInventoryEngineeringWork() |
| | | } |
| | | |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal= res.data.total.pageTotal |
| | | pageNum.value=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const changeDate = ()=>{ |
| | | selectOrderList() |
| | | } |
| | | |
| | | //页脚跳转 |
| | | const handlePageChange = ({ currentPage, pageSize }) => { |
| | | selectOrderList() |
| | | total.pageTotal = pageSize |
| | | pageNum.value=currentPage |
| | | } |
| | | |
| | | }) |
| | | |
| | | |
| | | //子组件接收参数 |
| | |
| | | { type: 'checkbox',fixed:"left", title: t('basicData.check'), width: '80' }, |
| | | {title: t('basicData.operate'), width: '110', slots: { default: 'button_slot' },fixed:'left'}, |
| | | { type: 'seq',fixed:"left", title: t('basicData.Number'), width: '80' }, |
| | | {field: 'inventoryOrganization', width:'150', title: t('料架编号'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged }, |
| | | {field: 'materialCode', width: '150',title: t('料架名称'), sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'producer', width: '120',title: t('现有数量'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'id',width: '100', title: t('总数量'), sortable: true,showOverflow:"ellipsis",filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'projectNo',width: '100', title: t('单价'), sortable: true,showOverflow:"ellipsis",filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | |
| | | {field: 'inventoryQuantity',width: '100', title: t('金额'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'availableQuantity', width: '100',title: t('单位'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'planQuantity', width: '100',title: t('最大承重'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'totalArea',width: '100', title: t('最大高'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'dateOfManufacture',width: '100', title: t('最大宽'), sortable: true}, |
| | | {field: 'qualityGuaranteePeriod',width: '100', title: t('备注'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'glassShelfNumber', width:'150', title: t('料架编号'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged }, |
| | | {field: 'glassShelfName', width: '150',title: t('料架名称'), sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'availableQuantity', width: '120',title: t('现有数量'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'totalQuantity',width: '100', title: t('总数量'), sortable: true,showOverflow:"ellipsis",filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'price',width: '100', title: t('单价'), sortable: true,showOverflow:"ellipsis",filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'money',width: '100', title: t('金额'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'unit', width: '100',title: t('单位'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'maxWeight', width: '100',title: t('最大承重'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'maxWidth',width: '100', title: t('最大高'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'maxHeight',width: '100', title: t('最大宽'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'remarks',width: '100', title: t('备注'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'createTime',width: '100', title: t('创建时间'), sortable: true}, |
| | | |
| | | ],//表头按钮 |
| | | toolbarConfig: { |
| | | buttons: [ |
| | | {'code': 'add', 'name': t('添加'),status: 'primary'}, |
| | | {'code': 'out', 'name': t('出库'),status: 'primary'} |
| | | {'code': 'out', 'name': t('出库'),status: 'primary'}, |
| | | {'code': 'return', 'name': t('返回发货'),status: 'primary'} |
| | | ], |
| | | /*import: false, |
| | | export: true, |
| | |
| | | case 'out': { |
| | | $grid.clearFilter() |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | |
| | | |
| | | if (selectRecords.length === 0) { |
| | | ElMessage.warning(t('productStock.unselectedData')) |
| | | return |
| | | } |
| | | let id = "" |
| | | const array = []; |
| | | if (values.value===t('ingredientsStock.inventory')){ |
| | | for (let i = 0; i < selectRecords.length; i++) { |
| | | array.push(selectRecords[i].id) |
| | | if (i + 1 === selectRecords.length) { |
| | |
| | | id += selectRecords[i].id + "|" |
| | | } |
| | | } |
| | | }else{ |
| | | for (let i = 0; i < selectRecords.length; i++) { |
| | | array.push(selectRecords[i].useId) |
| | | if (i + 1 === selectRecords.length) { |
| | | id += selectRecords[i].useId |
| | | } else { |
| | | id += selectRecords[i].useId + "|" |
| | | } |
| | | } |
| | | |
| | | router.push({path: '/main/finishedGlassShelf/createFinishedGlassShelfEmit', query: {informationId: id}}) |
| | | break |
| | | |
| | | |
| | | } |
| | | case 'return': { |
| | | if(deliveryId.value!=null){ |
| | | router.push({path: '/main/delivery/createDelivery', query: {deliveryID: deliveryId.value}}) |
| | | break |
| | | }else if(orderId.value!=null){ |
| | | router.push({path: '/main/delivery/createDelivery', query: {orderId: orderId.value}}) |
| | | break |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | router.push({path: '/main/ingredientsStock/CreateOutbound', query: {id: id,type:values.value}}) |
| | | break |
| | | |
| | | |
| | | } |
| | | case 'add': { |
| | | dialogTableVisible.value=true |
| | | rowIndexData.value=null |
| | | sheetIndex.value=1 |
| | | break |
| | | } |
| | | |
| | | case 'update': { |
| | | |
| | | $grid.clearFilter() |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | if (selectRecords.length === 1) { |
| | | dialogTableVisible.value=true |
| | | rowIndexData.value=selectRecords[0] |
| | | sheetIndex.value=2 |
| | | }else{ |
| | | ElMessage.warning(t('请选中一行数据')) |
| | | return |
| | | } |
| | | |
| | | |
| | | break |
| | | } |
| | | |
| | | case 'delete': { |
| | | $grid.clearFilter() |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | if (selectRecords.length === 0) { |
| | | ElMessage.warning(t('productStock.unselectedData')) |
| | | return |
| | | } |
| | | ElMessageBox.confirm("确认删除?", |
| | | { |
| | | confirmButtonText: t('basicData.confirmButtonText'), |
| | | cancelButtonText: t('basicData.cancelButtonText'), |
| | | distinguishCancelAndClose: true, |
| | | type: 'warning', |
| | | } |
| | | ).then(()=>{ |
| | | let id = "" |
| | | const array = []; |
| | | if (values.value===t('ingredientsStock.inventory')){ |
| | | for (let i = 0; i < selectRecords.length; i++) { |
| | | array.push(selectRecords[i].id) |
| | | if (i + 1 === selectRecords.length) { |
| | | id += selectRecords[i].id |
| | | } else { |
| | | id += selectRecords[i].id + "|" |
| | | } |
| | | } |
| | | }else{ |
| | | for (let i = 0; i < selectRecords.length; i++) { |
| | | array.push(selectRecords[i].useId) |
| | | if (i + 1 === selectRecords.length) { |
| | | id += selectRecords[i].useId |
| | | } else { |
| | | id += selectRecords[i].useId + "|" |
| | | } |
| | | } |
| | | } |
| | | let flowData = ref({ |
| | | materialInventory: selectRecords, |
| | | ids: id, |
| | | creator: userStore.user.userName |
| | | |
| | | }) |
| | | request.post(`/materialInventory/deleteMaterialInventory`,flowData.value).then((res) => { |
| | | if(res.code==200 && res.data===true){ |
| | | ElMessage.success(t('searchOrder.msgDeleteSuccess')) |
| | | router.push({path:'/main/ingredientsStock/selectIngredientsStock', query:{random:Math.random()}}) |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | }).catch((action)=>{ |
| | | }) |
| | | break |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | | }, |
| | |
| | | |
| | | <template> |
| | | <div class="main-div-customer"> |
| | | <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 |
| | |
| | | </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> |
| | |
| | | |
| | | .main-table{ |
| | | width: 100%; |
| | | height: calc(100% - 35px); |
| | | height: calc(100% - 0px); |
| | | } |
| | | .vxe-grid { |
| | | /* 禁用浏览器默认选中 */ |
| New file |
| | |
| | | <script setup> |
| | | |
| | | import {onMounted, reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import { useI18n } from 'vue-i18n' |
| | | import {addListener, toolbarButtonClickEvent} from "@/hook/mouseMove"; |
| | | import {changeFilterEvent,filterChanged,filterChangeds} from "@/hook" |
| | | import {divideAuto, multiply} from "@/utils/decimal"; |
| | | import companyInfo from "@/stores/sd/companyInfo"; |
| | | import footSum from "@/hook/footSum"; |
| | | import {copyTableCellValue} from "@/hook/copyTableCellValue"; |
| | | |
| | | //语言获取 |
| | | const { t } = useI18n() |
| | | const userStore = useUserInfoStore() |
| | | const company = companyInfo() |
| | | const router = useRouter() |
| | | let produceList = ref([]) |
| | | let sheetIndex = ref(-1) |
| | | let rowIndexData = ref(null) |
| | | |
| | | let dialogTableVisible = ref(false) |
| | | let refMaterialAddition=ref() |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | router.push({path: '/main/finishedGlassShelf/createFinishedGlassShelfEmit', query: { id: row.id }}) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | | let flowData = ref({ |
| | | id: row.id, |
| | | userName:userStore.user.userName, |
| | | userId:userStore.user.userId |
| | | }) |
| | | request.post("/materialStore/deleteMaterialStore",flowData.value).then((res) => { |
| | | if(res.code==200 && res.data==="true"){ |
| | | ElMessage.success(t('basicData.msg.deleteSuccess')) |
| | | router.push({path:'/main/ingredients/SelectIngredients',query:{random:Math.random()}}) |
| | | }else if(res.data==="false1"){ |
| | | ElMessage.warning(t('ingredients.msg1')) |
| | | }else{ |
| | | ElMessage.warning(t('basicData.msg.deleteFail')) |
| | | } |
| | | }).catch((err)=>{ |
| | | ElMessage.error(t('basicData.msg.ServerConnectionError')) |
| | | router.push("/login") |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | } |
| | | |
| | | 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 pageNum=ref(1) |
| | | let total = reactive({ |
| | | pageTotal : 0, |
| | | dataTotal : 0, |
| | | pageSize : 100 |
| | | }) |
| | | |
| | | let filterData = ref({ |
| | | |
| | | }) |
| | | |
| | | const values = ref('') |
| | | |
| | | |
| | | let selectDate = ref(["",""]) |
| | | let BasicData = ref([]) |
| | | let materialStore= ref([]) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | onMounted(() => { |
| | | addListener(xGrid.value,gridOptions) |
| | | |
| | | //第一次调用 |
| | | // request.get(`/BasicWarehouse/BasicWarehouseType/`+t('ingredients.originalFilm')+'|'+t('ingredients.accessories')).then((res) => { |
| | | // if(res.code==200){ |
| | | // gridOptions.columns.splice(0,gridOptions.columns.length) |
| | | // BasicData.value = res.data |
| | | // //添加列 |
| | | // gridOptions.columns=arr.slice() |
| | | // |
| | | // for (let i=0;i<BasicData.value.length;i++){ |
| | | // let aa=null |
| | | // if(BasicData.value[i].OperateType==="name"){ |
| | | // aa={field: "json."+BasicData.value[i].OperateType, width: '150',title: BasicData.value[i].OperateTypeName, sortable: true,showOverflow:'ellipsis' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChangeds} |
| | | // }else{ |
| | | // aa={field: "json."+BasicData.value[i].OperateType, width: '150',title: BasicData.value[i].OperateTypeName, sortable: true,showOverflow:'ellipsis' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged} |
| | | // } |
| | | // gridOptions.columns.push(aa) |
| | | // |
| | | // } |
| | | // values.value=t('ingredientsStock.inventory') |
| | | // getInventoryWorks() |
| | | // |
| | | // }else{ |
| | | // ElMessage.warning(res.msg) |
| | | // } |
| | | // }) |
| | | }) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | const getInventoryEngineeringWork = () => { |
| | | |
| | | request.post(`/materialInventory/getSelectMaterialInventoryEngineeringDate/${pageNum.value}/${total.pageSize}/${selectDate.value}`,filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | materialStore.value=[] |
| | | for (let i=0;i<res.data.data.length;i++){ |
| | | materialStore.value[i]=(res.data.data[i]) |
| | | materialStore.value[i].json=(JSON.parse(res.data.data[i].json)) |
| | | |
| | | } |
| | | |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal= res.data.total.pageTotal |
| | | pageNum.value=1 |
| | | selectDate.value = res.data.selectDate |
| | | gridOptions.toolbarConfig.buttons[2].disabled = true |
| | | produceList = deepClone(materialStore.value) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | const selectOrderList = ()=>{ |
| | | request.get(`/BasicWarehouse/BasicWarehouseType/`+t('ingredients.originalFilm')+'|'+t('ingredients.accessories')).then((res) => { |
| | | if(res.code==200){ |
| | | |
| | | |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const changeDate = ()=>{ |
| | | selectOrderList() |
| | | } |
| | | |
| | | //页脚跳转 |
| | | const handlePageChange = ({ currentPage, pageSize }) => { |
| | | selectOrderList() |
| | | total.pageTotal = pageSize |
| | | pageNum.value=currentPage |
| | | } |
| | | |
| | | |
| | | |
| | | //子组件接收参数 |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮 |
| | | id: 'FinishedGlassShelfWithdraw', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollX:{enabled: true}, |
| | | scrollY:{ enabled: true ,gt:0},//开启虚拟滚动 |
| | | showOverflow:true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | //remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | editConfig: { |
| | | trigger: 'click', |
| | | mode: 'row', |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns:[ |
| | | {title: t('basicData.operate'), width: '110', slots: { default: 'button_slot' },fixed:'left'}, |
| | | { type: 'seq',fixed:"left", title: t('basicData.Number'), width: '80' }, |
| | | {field: 'deliveryState',title: t('状态'), width: 40,filters:[{ data: '' }], slots: { default: 'state',filter: 'num2_filter' }}, |
| | | {field: 'inventoryOrganization', width:'150', title: t('入库单据编号'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged }, |
| | | {field: 'materialCode', width: '150',title: t('客户名称'), sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'producer', width: '120',title: t('项目名称'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'id',width: '100', title: t('经办人'), sortable: true,showOverflow:"ellipsis",filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'createTime',width: '100', title: t('创建时间'), sortable: true}, |
| | | {field: 'qualityGuaranteePeriod',width: '100', title: t('备注'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | |
| | | ],//表头按钮 |
| | | toolbarConfig: { |
| | | buttons: [ |
| | | |
| | | ], |
| | | /*import: false, |
| | | export: true, |
| | | print: true,*/ |
| | | export: true, |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | |
| | | } |
| | | |
| | | }) |
| | | |
| | | |
| | | const gridEvents = { |
| | | async toolbarButtonClick({code}) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | | switch (code) { |
| | | case 'out': { |
| | | $grid.clearFilter() |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | |
| | | |
| | | if (selectRecords.length === 0) { |
| | | ElMessage.warning(t('productStock.unselectedData')) |
| | | return |
| | | } |
| | | let id = "" |
| | | const array = []; |
| | | if (values.value===t('ingredientsStock.inventory')){ |
| | | for (let i = 0; i < selectRecords.length; i++) { |
| | | array.push(selectRecords[i].id) |
| | | if (i + 1 === selectRecords.length) { |
| | | id += selectRecords[i].id |
| | | } else { |
| | | id += selectRecords[i].id + "|" |
| | | } |
| | | } |
| | | }else{ |
| | | for (let i = 0; i < selectRecords.length; i++) { |
| | | array.push(selectRecords[i].useId) |
| | | if (i + 1 === selectRecords.length) { |
| | | id += selectRecords[i].useId |
| | | } else { |
| | | id += selectRecords[i].useId + "|" |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | router.push({path: '/main/ingredientsStock/CreateOutbound', query: {id: id,type:values.value}}) |
| | | break |
| | | |
| | | |
| | | } |
| | | case 'add': { |
| | | dialogTableVisible.value=true |
| | | rowIndexData.value=null |
| | | sheetIndex.value=1 |
| | | break |
| | | } |
| | | |
| | | case 'update': { |
| | | |
| | | $grid.clearFilter() |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | if (selectRecords.length === 1) { |
| | | dialogTableVisible.value=true |
| | | rowIndexData.value=selectRecords[0] |
| | | sheetIndex.value=2 |
| | | }else{ |
| | | ElMessage.warning(t('请选中一行数据')) |
| | | return |
| | | } |
| | | |
| | | |
| | | break |
| | | } |
| | | |
| | | case 'delete': { |
| | | $grid.clearFilter() |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | if (selectRecords.length === 0) { |
| | | ElMessage.warning(t('productStock.unselectedData')) |
| | | return |
| | | } |
| | | ElMessageBox.confirm("确认删除?", |
| | | { |
| | | confirmButtonText: t('basicData.confirmButtonText'), |
| | | cancelButtonText: t('basicData.cancelButtonText'), |
| | | distinguishCancelAndClose: true, |
| | | type: 'warning', |
| | | } |
| | | ).then(()=>{ |
| | | let id = "" |
| | | const array = []; |
| | | if (values.value===t('ingredientsStock.inventory')){ |
| | | for (let i = 0; i < selectRecords.length; i++) { |
| | | array.push(selectRecords[i].id) |
| | | if (i + 1 === selectRecords.length) { |
| | | id += selectRecords[i].id |
| | | } else { |
| | | id += selectRecords[i].id + "|" |
| | | } |
| | | } |
| | | }else{ |
| | | for (let i = 0; i < selectRecords.length; i++) { |
| | | array.push(selectRecords[i].useId) |
| | | if (i + 1 === selectRecords.length) { |
| | | id += selectRecords[i].useId |
| | | } else { |
| | | id += selectRecords[i].useId + "|" |
| | | } |
| | | } |
| | | } |
| | | let flowData = ref({ |
| | | materialInventory: selectRecords, |
| | | ids: id, |
| | | creator: userStore.user.userName |
| | | |
| | | }) |
| | | request.post(`/materialInventory/deleteMaterialInventory`,flowData.value).then((res) => { |
| | | if(res.code==200 && res.data===true){ |
| | | ElMessage.success(t('searchOrder.msgDeleteSuccess')) |
| | | router.push({path:'/main/ingredientsStock/selectIngredientsStock', query:{random:Math.random()}}) |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | }).catch((action)=>{ |
| | | }) |
| | | break |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | cellDblclick ({row,column}) { |
| | | copyTableCellValue(row,column) |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div class="main-div-customer"> |
| | | <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%" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | |
| | | > |
| | | <!-- @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')" |
| | | v-if="userStore.user.permissions.indexOf('selectIngredients.edit') > -1" |
| | | link type="primary" size="small">{{ $t('basicData.edit') }}</el-button> |
| | | <el-popconfirm @confirm="getTableRow(row,'delete')" :title="$t('searchOrder.deleteConfirm')"> |
| | | <template #reference> |
| | | <el-button link type="primary" size="small">{{ $t('basicData.delete') }}</el-button> |
| | | </template> |
| | | </el-popconfirm> |
| | | </template> |
| | | |
| | | <template #state="{ row,column}"> |
| | | <el-checkbox |
| | | v-if="row[column.field] === 2" |
| | | @click.native.prevent |
| | | :indeterminate="row[column.field]===1" |
| | | :checked="true"/> |
| | | <el-checkbox |
| | | v-else |
| | | @click.native.prevent |
| | | :indeterminate="row[column.field]===1" |
| | | :checked="false"/> |
| | | </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> |
| | | |
| | | </vxe-grid> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | .main-div-customer{ |
| | | width: 99%; |
| | | height: 100%; |
| | | } |
| | | .main-div-customers{ |
| | | width: 99%; |
| | | height: 100%; |
| | | } |
| | | .el-col{ |
| | | margin-left: 15px; |
| | | margin-bottom: 5px; |
| | | } |
| | | .order-primary{ |
| | | width: 100%; |
| | | } |
| | | .head{ |
| | | width: 100%; |
| | | height: 35px; |
| | | } |
| | | |
| | | .main-table{ |
| | | width: 100%; |
| | | height: calc(100% - 35px); |
| | | } |
| | | .vxe-grid { |
| | | /* 禁用浏览器默认选中 */ |
| | | -webkit-user-select: none; |
| | | -moz-user-select: none; |
| | | -ms-user-select: none; |
| | | user-select: none; |
| | | } |
| | | </style> |
| | |
| | | |
| | | // 定义表头上传数据 |
| | | let titleUploadData = ref({ |
| | | id:'', |
| | | materialCode:'', |
| | | producer:'', |
| | | dateOfManufacture:'', |
| | | qualityGuaranteePeriod:'', |
| | | inventoryOrganization:'', |
| | | inventoryArea:'', |
| | | inventoryQuantity:'', |
| | | availableQuantity:'', |
| | | remarks:'' |
| | | }) |
| | | |
| | |
| | | titleUploadData.value.inventoryArea=props.data.inventoryArea |
| | | titleUploadData.value.inventoryQuantity=props.data.inventoryQuantity |
| | | titleUploadData.value.remarks=props.data.remarks |
| | | titleUploadData.value.materialCode=props.data.materialCode |
| | | titleUploadData.value.id=props.data.id |
| | | titleUploadData.value.availableQuantity=props.data.availableQuantity |
| | | isDisabled=true |
| | | }else{ |
| | | isDisabled=false |
| | |
| | | <el-col :span="2"><el-text>{{$t('ingredientsStock.qualityGuaranteePeriod')}}:</el-text></el-col> |
| | | <el-col :span="3"><el-input v-model="titleUploadData.qualityGuaranteePeriod" /></el-col> |
| | | <el-col :span="1"><el-text>{{$t('ingredientsStock.producer')}}:</el-text></el-col> |
| | | <el-col :span="3"><el-input v-model="titleUploadData.producer" /></el-col> |
| | | <el-col :span="3"><el-input v-model.trim="titleUploadData.producer" /></el-col> |
| | | |
| | | </el-row> |
| | | <el-row> |
| | |
| | | { |
| | | field: 'operationOrderNumber', |
| | | width: '150', |
| | | title: t('productStock.operationOrderNumber'), |
| | | title: t('ingredientsStock.dateOfManufacture'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'} |
| | | }, |
| | |
| | | body: { |
| | | options: [ |
| | | [ |
| | | {code: 'selectTrimming', name: '设置统一修边',}, |
| | | {code: 'selectTrimming', name: '设置统一修边',prefixIcon: 'vxe-icon-edit'}, |
| | | {code: 'Exports', name: '数据导出', prefixIcon: 'vxe-icon-download', visible: true, disabled: false}, |
| | | {code: 'addRow', name: t('basicData.add'), prefixIcon: 'vxe-icon-square-plus', visible: true, disabled: true }, |
| | | ], |
| | |
| | | gridRef: xGrid, |
| | | requiresRow: false, |
| | | openTrimming: async () => { |
| | | emit ( 'select-trimming', true) |
| | | // 获取当前选中的记录 |
| | | const selectedRecords = xGrid.value.getCheckboxRecords(); |
| | | // 发送事件给父组件,包含选中的数据 |
| | | emit('select-trimming', { |
| | | action: 'open-trimming-dialog', |
| | | selectedData: selectedRecords && selectedRecords.length > 0 ? selectedRecords : null, |
| | | timestamp: Date.now() |
| | | }); |
| | | } |
| | | }, |
| | | { |
| | |
| | | } |
| | | return; |
| | | } |
| | | |
| | | |
| | | if (config.code === 'selectTrimming') { |
| | | config.openTrimming(); |
| | | return; |
| | | } |
| | | // 添加确认提示弹窗,询问用户是否进行当前操作 |
| | | ElMessageBox.confirm('是否进行当前操作?', '确认操作', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | if (config.code === 'selectTrimming') { |
| | | config.openTrimming(); |
| | | ElMessage.success(config.successMsg); |
| | | } |
| | | // if (config.code === 'selectTrimming') { |
| | | // config.openTrimming(); |
| | | // ElMessage.success(config.successMsg); |
| | | // } |
| | | }).catch(() => { |
| | | // 用户点击取消后执行的逻辑 |
| | | ElMessage.info('已取消操作'); |
| | |
| | | const data = gridOptions.data; |
| | | if (data) { |
| | | try { |
| | | const updatedData = []; |
| | | for (let i = 0; i < data.length; i++) { |
| | | const item = data[i]; |
| | | const updatedItem = { |
| | | // 检查是否只对选中的项目应用修边 |
| | | const shouldApplyToSelectedOnly = receivedData.selectedItemsOnly; |
| | | let targetData = data; |
| | | |
| | | if (shouldApplyToSelectedOnly) { |
| | | // 只对选中的数据应用修边 |
| | | targetData = receivedData.selectedGlassData || []; |
| | | if (!targetData || targetData.length === 0) { |
| | | ElMessage.warning('未选择任何项目,修边未应用'); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | const updatedData = data.map(item => { |
| | | // 如果只对选中项应用,检查当前项是否在选中列表中 |
| | | if (shouldApplyToSelectedOnly) { |
| | | const isSelected = targetData.some(selectedItem => selectedItem.id === item.id); |
| | | if (!isSelected) { |
| | | return item; // 不在选中列表中,不修改 |
| | | } |
| | | } |
| | | |
| | | // 应用修边值 |
| | | return { |
| | | ...item, |
| | | // 从 receivedData 中获取对应的值来更新表格数据项 |
| | | leftTrim: Number(receivedData.quicksetLeft), |
| | | downTrim: Number(receivedData.quicksetBottom), |
| | | rightTrim: Number(receivedData.quicksetRight), |
| | | upTrim: Number(receivedData.quicksetTop), |
| | | }; |
| | | updatedData.push(updatedItem); |
| | | } |
| | | }); |
| | | |
| | | gridOptions.data = updatedData; |
| | | xGrid.value.loadData(updatedData); |
| | | } catch (error) { |
| | |
| | | |
| | | //右键菜单统一修边 |
| | | const props = defineProps({ |
| | | TrimmingDialogVisible: Boolean, |
| | | CheckboxChangeData: null |
| | | TrimmingDialogVisible: { |
| | | type: [Boolean, Object], |
| | | required: false, |
| | | default: null |
| | | }, |
| | | CheckboxChangeData: { |
| | | type: Array, |
| | | required: false, |
| | | default: null |
| | | } |
| | | }); |
| | | |
| | | |
| | | const selectedGlassDataForTrimming = ref([]); |
| | | |
| | | /*watch(() => props.TrimmingDialogVisible, (newValue) => { |
| | | if (newValue === true) { |
| | | dialogVisible.value[3] = newValue; |
| | |
| | | });*/ |
| | | |
| | | watch( |
| | | ()=> [props.TrimmingDialogVisible,props.CheckboxChangeData], |
| | | ([newValue, oldValue])=> { |
| | | if (props.TrimmingDialogVisible!=null){ |
| | | dialogVisible.value[3] = newValue; |
| | | () => props.TrimmingDialogVisible, |
| | | (newVal, oldVal) => { |
| | | // 处理打开修边对话框的逻辑 |
| | | if (newVal != null && typeof newVal === 'object' && newVal.action === 'open-trimming-dialog') { |
| | | dialogVisible.value[3] = true; |
| | | |
| | | // 更新选中的玻璃数据 |
| | | if (newVal.selectedData && newVal.selectedData.length > 0) { |
| | | selectedGlassDataForTrimming.value = newVal.selectedData; |
| | | } else { |
| | | selectedGlassDataForTrimming.value = []; |
| | | } |
| | | } |
| | | if (props.CheckboxChangeData!=null && props.CheckboxChangeData.length>0){ |
| | | } |
| | | ); |
| | | |
| | | // 单独处理选中原片数据的逻辑 |
| | | watch( |
| | | () => props.CheckboxChangeData, |
| | | (newData, oldData) => { |
| | | // 只有当有选中数据时才处理 |
| | | if (newData != null && newData.length > 0) { |
| | | optimizeData.value.materialDetails = []; |
| | | props.CheckboxChangeData.forEach(items=>{ |
| | | const detail={ |
| | | width :null, |
| | | height :null, |
| | | stockCode :null, |
| | | quantity :null, |
| | | upTrim :null, |
| | | downTrim :null, |
| | | leftTrim :null, |
| | | rightTrim:null, |
| | | priority:0 |
| | | newData.forEach(items => { |
| | | const detail = { |
| | | width: null, |
| | | height: null, |
| | | stockCode: null, |
| | | quantity: null, |
| | | upTrim: null, |
| | | downTrim: null, |
| | | leftTrim: null, |
| | | rightTrim: null, |
| | | priority: 0 |
| | | } |
| | | detail.width=items.width |
| | | detail.height=items.height |
| | | detail.stockCode=items.id |
| | | detail.quantity=items.available_quantity |
| | | detail.upTrim=items.upTrim |
| | | detail.downTrim=items.downTrim |
| | | detail.leftTrim=items.leftTrim |
| | | detail.rightTrim=items.rightTrim |
| | | detail.width = items.width |
| | | detail.height = items.height |
| | | detail.stockCode = items.id |
| | | detail.quantity = items.available_quantity |
| | | detail.upTrim = items.upTrim |
| | | detail.downTrim = items.downTrim |
| | | detail.leftTrim = items.leftTrim |
| | | detail.rightTrim = items.rightTrim |
| | | |
| | | optimizeData.value.materialDetails.push(detail) |
| | | }) |
| | | dialogVisible.value[4] = true; |
| | | }else{ |
| | | } else if (newData !== null && newData.length === 0) { |
| | | // 只有当明确传入空数组时才提示选择原片 |
| | | ElMessage.warning('请选择原片'); |
| | | } |
| | | console.log(optimizeData.value) |
| | | }); |
| | | } |
| | | ); |
| | | |
| | | |
| | | const route = useRoute(); |
| | |
| | | <el-button id="button" type="primary" @click="openDialog(3)">设置修边</el-button> |
| | | <el-dialog v-model="dialogVisible[3]" title="设置修边(mm)" destroy-on-close |
| | | style="width: 35%;height:80%;margin-top: 3vh;"> |
| | | <set-trimming :closeDialog="closeDialog" @send-data-event="handleTrimmingData"/> |
| | | <set-trimming |
| | | :closeDialog="closeDialog" |
| | | :selected-glass-data="selectedGlassDataForTrimming" |
| | | @send-data-event="handleTrimmingData"/> |
| | | </el-dialog> |
| | | <el-button id="button" type="primary" @click="saveOptimizeData()">保存</el-button> |
| | | <el-button id="button" type="primary" @click="openDialog(4)">优化</el-button> |
| | |
| | | |
| | | const emit = defineEmits(['send-data-event',]); |
| | | const props = defineProps({ |
| | | closeDialog: Function |
| | | closeDialog: { |
| | | type: Function, |
| | | required: true |
| | | }, |
| | | selectedGlassData: { |
| | | type: Array, |
| | | required: false, |
| | | default: () => [] |
| | | } |
| | | }); |
| | | |
| | | const setTrimming = () => { |
| | |
| | | quicksetTop: quicksetTop.value, |
| | | quicksetRight: quicksetRight.value, |
| | | quicksetBottom: quicksetBottom.value, |
| | | quicksetLeft: quicksetLeft.value |
| | | quicksetLeft: quicksetLeft.value, |
| | | selectedItemsOnly: props.selectedGlassData && props.selectedGlassData.length > 0, |
| | | selectedGlassData: props.selectedGlassData |
| | | }; |
| | | emit('send-data-event', dataToSend); |
| | | props.closeDialog(3); |
| New file |
| | |
| | | package com.example.erp.controller.mm; |
| | | |
| | | |
| | | import cn.dev33.satoken.annotation.SaCheckPermission; |
| | | import com.example.erp.common.Result; |
| | | import com.example.erp.entity.mm.FinishedGlassShelfEmit; |
| | | import com.example.erp.entity.mm.MaterialStore; |
| | | import com.example.erp.entity.sd.Delivery; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import com.example.erp.service.mm.FinishedGlassShelfService; |
| | | import com.example.erp.service.mm.MaterialStoreService; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @RequestMapping("/finishedGlassShelf") |
| | | @Api(value="玻璃料架controller",tags={"玻璃料架接口"}) |
| | | public class FinishedGlassShelfController { |
| | | @Autowired |
| | | FinishedGlassShelfService finishedGlassShelfService; |
| | | |
| | | @ApiOperation("玻璃料架新增接口") |
| | | @PostMapping("/saveFinishedGlassShelf") |
| | | public Result saveFinishedGlassShelf( @RequestBody Map<String,Object> object){ |
| | | return Result.seccess(finishedGlassShelfService.saveFinishedGlassShelf(object)); |
| | | } |
| | | |
| | | @ApiOperation("玻璃料架库存查询接口") |
| | | @PostMapping("/getSelectFinishedGlassShelfInformation/{pageNum}/{pageSize}") |
| | | public Result getSelectFinishedGlassShelfInformation(@PathVariable Integer pageNum, @PathVariable Integer pageSize){ |
| | | return Result.seccess(finishedGlassShelfService.getSelectFinishedGlassShelfInformation(pageNum,pageSize)); |
| | | } |
| | | |
| | | @ApiOperation("玻璃料架库存查询接口") |
| | | @PostMapping("/getSelectFinishedGlassShelfInformationById/{id}") |
| | | public Result getSelectFinishedGlassShelfInformationById(@PathVariable Long id){ |
| | | return Result.seccess(finishedGlassShelfService.getSelectFinishedGlassShelfInformationById(id)); |
| | | } |
| | | |
| | | @ApiOperation("删除玻璃料架接口") |
| | | @PostMapping("/deleteFinishedGlassShelfInformationById") |
| | | public Result deleteFinishedGlassShelfInformationById( @RequestBody Map<String,Object> object){ |
| | | return Result.seccess(finishedGlassShelfService.deleteFinishedGlassShelfInformationById(object)); |
| | | } |
| | | |
| | | @ApiOperation("玻璃料架新增出库明细查询接口") |
| | | @PostMapping("/getSelectFinishedGlassShelfInformationDetails/{pageNum}/{pageSize}") |
| | | public Result getSelectFinishedGlassShelfInformationDetails(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody String ids){ |
| | | return Result.seccess(finishedGlassShelfService.getSelectFinishedGlassShelfInformationDetails(pageNum,pageSize,ids)); |
| | | } |
| | | |
| | | @ApiOperation("玻璃料架编辑出库明细查询接口") |
| | | @PostMapping("/getSelectFinishedGlassShelfEmitDetails/{pageNum}/{pageSize}") |
| | | public Result getSelectFinishedGlassShelfEmitDetails(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody String emitId){ |
| | | return Result.seccess(finishedGlassShelfService.getSelectFinishedGlassShelfEmitDetails(pageNum,pageSize,emitId)); |
| | | } |
| | | |
| | | @ApiOperation("玻璃料架出库新增接口") |
| | | @PostMapping("/insertFinishedGlassShelfEmit") |
| | | public Result insertFinishedGlassShelfEmit( @RequestBody Map<String,Object> object){ |
| | | return Result.seccess(finishedGlassShelfService.insertFinishedGlassShelfEmit(object)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("玻璃料架出库查询接口") |
| | | @PostMapping("/getSelectFinishedGlassShelfEmit/{pageNum}/{pageSize}/{selectDate}") |
| | | public Result getSelectFinishedGlassShelfEmit(@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable List<String> selectDate, |
| | | @RequestBody FinishedGlassShelfEmit finishedGlassShelfEmit) throws JsonProcessingException { |
| | | return Result.seccess(finishedGlassShelfService.getSelectFinishedGlassShelfEmit(pageNum,pageSize,selectDate,finishedGlassShelfEmit)); |
| | | } |
| | | |
| | | @ApiOperation("玻璃料架出库删除接口") |
| | | @PostMapping("/deleteFinishedGlassShelfEmit") |
| | | public Result deleteFinishedGlassShelfEmit( @RequestBody Map<String,Object> object){ |
| | | return Result.seccess(finishedGlassShelfService.deleteFinishedGlassShelfEmit(object)); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.example.erp.entity.mm; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | public class FinishedGlassShelfEmit { |
| | | @TableId(type = IdType.AUTO) |
| | | |
| | | private Long id; |
| | | private String emitId; |
| | | private String customerName; |
| | | private String project; |
| | | private String operator; |
| | | private Integer state; |
| | | private String remarks; |
| | | private String withdrawTime; |
| | | private LocalDate createTime; |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.example.erp.entity.mm; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | public class FinishedGlassShelfEmitDetails { |
| | | @TableId(type = IdType.AUTO) |
| | | |
| | | private Long id; |
| | | private String emitId; |
| | | private Integer emitNumber; |
| | | private Long informationId; |
| | | private String glassShelfName; |
| | | private String glassShelfNumber; |
| | | private Integer withdrawQuantity; |
| | | private Integer quantity; |
| | | private String unit; |
| | | private Double price; |
| | | private Double money; |
| | | private String remarks; |
| | | private FinishedGlassShelfInformation finishedGlassShelfInformation; |
| | | private FinishedGlassShelfEmit finishedGlassShelfEmit; |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.example.erp.entity.mm; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | public class FinishedGlassShelfInformation { |
| | | @TableId(type = IdType.AUTO) |
| | | |
| | | private Long id; |
| | | private String glassShelfNumber; |
| | | private String glassShelfName; |
| | | private Integer availableQuantity; |
| | | private Integer totalQuantity; |
| | | private Double price; |
| | | private Double money; |
| | | private String unit; |
| | | private Double maxWeight; |
| | | private Double maxWidth; |
| | | private Double maxHeight; |
| | | private String remarks; |
| | | private LocalDate createTime; |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.example.erp.entity.mm; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | public class FinishedGlassShelfLog { |
| | | @TableId(type = IdType.AUTO) |
| | | |
| | | private Long id; |
| | | private String documentId; |
| | | private Integer documentNumber; |
| | | private String type; |
| | | private String glassShelfName; |
| | | private String glassShelfNumber; |
| | | private Integer quantity; |
| | | private String unit; |
| | | private Double price; |
| | | private Double money; |
| | | private String remarks; |
| | | private Double maxWeight; |
| | | private Double maxWidth; |
| | | private Double maxHeight; |
| | | private LocalDate createTime; |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.example.erp.entity.mm; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | public class FinishedGlassShelfWithdraw { |
| | | @TableId(type = IdType.AUTO) |
| | | |
| | | private Long id; |
| | | private String withdrawId; |
| | | private String customerName; |
| | | private String project; |
| | | private String operator; |
| | | private String remarks; |
| | | private LocalDate createTime; |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.example.erp.entity.mm; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class FinishedGlassShelfWithdrawDetails { |
| | | @TableId(type = IdType.AUTO) |
| | | |
| | | private Long id; |
| | | |
| | | private String withdrawId; |
| | | private Integer withdrawNumber; |
| | | private String emitId; |
| | | private Integer emitNumber; |
| | | private String glassShelfName; |
| | | private String glassShelfNumber; |
| | | private Integer quantity; |
| | | private String unit; |
| | | private Double price; |
| | | private Double money; |
| | | private String remarks; |
| | | private FinishedGlassShelfWithdraw finishedGlassShelfWithdraw; |
| | | private FinishedGlassShelfEmitDetails finishedGlassShelfEmitDetails; |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.example.erp.mapper.mm; |
| | | |
| | | import com.example.erp.entity.mm.FinishedGlassShelfEmit; |
| | | import com.example.erp.entity.mm.FinishedGlassShelfEmitDetails; |
| | | import com.example.erp.entity.mm.FinishedGlassShelfInformation; |
| | | import com.example.erp.entity.mm.MaterialInventory; |
| | | import com.example.erp.entity.sd.Delivery; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import com.example.erp.entity.sd.OrderOtherMoney; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.data.repository.CrudRepository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | public interface FinishedGlassShelfMapper extends CrudRepository<FinishedGlassShelfInformation,Long> { |
| | | |
| | | List<FinishedGlassShelfInformation> getSelectFinishedGlassShelfInformation(@Param("finishedGlassShelfInformation") FinishedGlassShelfInformation finishedGlassShelfInformation); |
| | | |
| | | boolean insetFinishedGlassShelfInformation(@Param("finishedGlassShelfInformation") FinishedGlassShelfInformation finishedGlassShelfInformation); |
| | | |
| | | boolean insetFinishedGlassShelfLog(@Param("finishedGlassShelfInformation") FinishedGlassShelfInformation finishedGlassShelfInformation); |
| | | |
| | | boolean updateFinishedGlassShelfInformationQuantity(Integer quantity,Long id); |
| | | |
| | | boolean updateFinishedGlassShelfInformation(@Param("finishedGlassShelfInformation") FinishedGlassShelfInformation finishedGlassShelfInformation,Long id); |
| | | |
| | | List<FinishedGlassShelfInformation> getSelectFinishedGlassShelfInformationDate(@Param("offset") Integer offset,@Param("pageSize") Integer pageSize); |
| | | |
| | | |
| | | Map<String,Integer> getSelectFinishedGlassShelfInformationDatePageTotal(Integer offset, Integer pageSize); |
| | | |
| | | FinishedGlassShelfInformation getSelectFinishedGlassShelfInformationById(Long id); |
| | | |
| | | List<Map<String, Object>> getSelectFinishedGlassShelfInformationInId(@Param("ids") List<Long> ids); |
| | | |
| | | boolean deleteFinishedGlassShelfInformationById(Long id); |
| | | |
| | | FinishedGlassShelfEmit getSelectFinishedGlassShelfEmitByemitId(@Param("emitId") String emitId); |
| | | |
| | | List<FinishedGlassShelfEmitDetails> getSelectFinishedGlassShelfEmitDetailsByemitId1(@Param("emitId") String emitId); |
| | | |
| | | List<Map<String, Object>> getSelectFinishedGlassShelfEmitDetailsByemitId(@Param("emitId") String emitId); |
| | | |
| | | Integer getmaximumWithdraw(); |
| | | |
| | | Integer getmaximumEmit(); |
| | | |
| | | boolean insertFinishedGlassShelfEmit(@Param("finishedGlassShelfEmit") FinishedGlassShelfEmit finishedGlassShelfEmit,String emitId); |
| | | |
| | | boolean updateFinishedGlassShelfEmit(@Param("finishedGlassShelfEmit") FinishedGlassShelfEmit finishedGlassShelfEmit,String emitId); |
| | | |
| | | boolean insertFinishedGlassShelfEmitDetails(String emitId,Integer emitNumber, |
| | | @Param("finishedGlassShelfEmitDetails") FinishedGlassShelfEmitDetails finishedGlassShelfEmitDetails); |
| | | |
| | | boolean updateInformationAvailableQuantityOut(@Param("finishedGlassShelfEmitDetails") FinishedGlassShelfEmitDetails finishedGlassShelfEmitDetails); |
| | | |
| | | boolean updateInformationAvailableQuantityInt(@Param("finishedGlassShelfEmitDetails") FinishedGlassShelfEmitDetails finishedGlassShelfEmitDetails); |
| | | |
| | | boolean insertFinishedGlassShelfEmitDetailsLog(String emitId,Integer emitNumber, |
| | | @Param("finishedGlassShelfEmitDetails") FinishedGlassShelfEmitDetails finishedGlassShelfEmitDetails); |
| | | |
| | | List<FinishedGlassShelfEmit> getSelectFinishedGlassShelfEmit(@Param("offset") Integer offset, |
| | | @Param("pageSize") Integer pageSize, String startDate, String endDate, |
| | | @Param("emit") FinishedGlassShelfEmit finishedGlassShelfEmit); |
| | | |
| | | Map<String,Integer> getSelectFinishedGlassShelfEmitPageTotal(Integer offset, Integer pageSize, String startDate, String endDate, |
| | | @Param("emit") FinishedGlassShelfEmit finishedGlassShelfEmit); |
| | | |
| | | |
| | | boolean deleteFinishedGlassShelfEmitDetails(@Param("emitId") String emitId); |
| | | |
| | | boolean deleteFinishedGlassShelfEmit(@Param("emitId") String emitId); |
| | | |
| | | boolean deleteFinishedGlassShelfEmitDetailsLog(@Param("emitId") String emitId); |
| | | |
| | | boolean updateFinishedGlassShelfEmitDetailsLog(@Param("emitId") String emitId); |
| | | |
| | | } |
| | |
| | | |
| | | Integer getReturningWarehouseCount(@Param("returningId") String returningId); |
| | | |
| | | List<MaterialInventory> getMaterialInventoryCount(@Param("materialCode") Long materialCode,@Param("dateOfManufacture") LocalDate dateOfManufacture); |
| | | List<MaterialInventory> getMaterialInventoryCount(@Param("materialCode") Long materialCode,@Param("dateOfManufacture") LocalDate dateOfManufacture,String producer); |
| | | |
| | | List<MaterialInventory> getMaterialInventoryCountNull(@Param("materialCode") Long materialCode); |
| | | List<MaterialInventory> getMaterialInventoryCountNull(@Param("materialCode") Long materialCode,String producer); |
| | | |
| | | |
| | | List<MaterialInventory> getMaterialInventoryCountId(@Param("materialCode") Long materialCode,@Param("dateOfManufacture") LocalDate dateOfManufacture); |
| | | List<MaterialInventory> getMaterialInventoryCountId(@Param("materialCode") Long materialCode,@Param("dateOfManufacture") LocalDate dateOfManufacture,String producer); |
| | | |
| | | List<MaterialInventory> getMaterialInventoryCountNullId(@Param("materialCode") Long materialCode); |
| | | List<MaterialInventory> getMaterialInventoryCountNullId(@Param("materialCode") Long materialCode,String producer); |
| | | |
| | | List<MaterialOutboundDetail> getIsNotMaterialOutboundDetail( @Param("materialOutboundId") String materialOutboundId); |
| | | |
| | |
| | | @Param("materialInventory") MaterialInventory materialInventory); |
| | | |
| | | Boolean updateMaterialInventoryOut(@Param("materialCode") Long materialCode,@Param("quantity") Integer quantity, |
| | | @Param("dateOfManufacture") String dateOfManufacture); |
| | | @Param("dateOfManufacture") String dateOfManufacture,@Param("producer") String producer); |
| | | |
| | | Boolean updateMaterialInventoryNullOut(@Param("materialCode") Long materialCode,@Param("quantity") Integer quantity); |
| | | Boolean updateMaterialInventoryNullOut(@Param("materialCode") Long materialCode,@Param("quantity") Integer quantity,@Param("producer") String producer); |
| | | |
| | | Boolean insertMaterialInventory(@Param("materialCode") Long materialCode,@Param("singlePieceArea") Double singlePieceArea, |
| | | @Param("totalArea") Double totalArea, |
| | |
| | | List<Map<String,Object>> getSelectMaterialInventoryMes(); |
| | | |
| | | Boolean updateMaterialInventoryAll(@Param("materialInventoryId") Long materialInventoryId,@Param("materialInventory") MaterialInventory materialInventory); |
| | | |
| | | Boolean updateMaterialInventoryOne(@Param("materialInventoryId") Long materialInventoryId,@Param("materialInventory") MaterialInventory materialInventory); |
| | | } |
| New file |
| | |
| | | package com.example.erp.service.mm; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.example.erp.entity.mm.*; |
| | | import com.example.erp.entity.sd.*; |
| | | import com.example.erp.entity.userInfo.Log; |
| | | import com.example.erp.entity.userInfo.SysError; |
| | | import com.example.erp.mapper.mm.BasicWarehouseTypeMapper; |
| | | import com.example.erp.mapper.mm.FinishedGlassShelfMapper; |
| | | import com.example.erp.mapper.mm.MaterialInventoryMapper; |
| | | import com.example.erp.mapper.mm.MaterialStoreMapper; |
| | | import com.example.erp.service.userInfo.LogService; |
| | | import com.example.erp.service.userInfo.SysErrorService; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.DecimalFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.util.*; |
| | | import java.util.concurrent.atomic.AtomicReference; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | @DS("mm") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class FinishedGlassShelfService { |
| | | @Autowired |
| | | FinishedGlassShelfMapper finishedGlassShelfMapper; |
| | | @Autowired |
| | | SysErrorService sysErrorService; |
| | | @Autowired |
| | | LogService logService; |
| | | |
| | | public String saveFinishedGlassShelf(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()); |
| | | |
| | | String userName = ""; |
| | | if (object.get("userName") != null) { |
| | | userName = object.get("userName").toString(); |
| | | } |
| | | |
| | | FinishedGlassShelfInformation finishedGlassShelfInformation = |
| | | JSONObject.parseObject(JSONObject.toJSONString(object.get("title")), FinishedGlassShelfInformation.class); |
| | | finishedGlassShelfInformation.setMoney(finishedGlassShelfInformation.getPrice()*finishedGlassShelfInformation.getTotalQuantity()); |
| | | |
| | | List<FinishedGlassShelfInformation> finishedGlassShelfInformationList=finishedGlassShelfMapper |
| | | .getSelectFinishedGlassShelfInformation(finishedGlassShelfInformation); |
| | | |
| | | if(finishedGlassShelfInformation.getId()>0){ |
| | | finishedGlassShelfMapper.updateFinishedGlassShelfInformation(finishedGlassShelfInformation,finishedGlassShelfInformation.getId()); |
| | | log.setFunction("saveFinishedGlassShelf修改1"); |
| | | }else{ |
| | | if(finishedGlassShelfInformationList.size()==0){ |
| | | finishedGlassShelfMapper.insetFinishedGlassShelfInformation(finishedGlassShelfInformation); |
| | | log.setFunction("saveFinishedGlassShelf新增"); |
| | | }else if(finishedGlassShelfInformationList.size()==1){ |
| | | finishedGlassShelfMapper.updateFinishedGlassShelfInformationQuantity(finishedGlassShelfInformation.getTotalQuantity(),finishedGlassShelfInformationList.get(0).getId()); |
| | | log.setFunction("saveFinishedGlassShelf修改2"); |
| | | }else{ |
| | | saveState = "false"; |
| | | } |
| | | |
| | | if(saveState.equals("true")){ |
| | | finishedGlassShelfMapper.insetFinishedGlassShelfLog(finishedGlassShelfInformation); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | logService.saveLog(log); |
| | | |
| | | } catch (Exception e) { |
| | | TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint); |
| | | //将异常传入数据库 |
| | | SysError sysError = new SysError(); |
| | | sysError.setError(e+Arrays.toString(e.getStackTrace())); |
| | | sysError.setFunc("saveFinishedGlassShelf"); |
| | | sysErrorService.insert(sysError); |
| | | saveState = "false"; |
| | | |
| | | } |
| | | return saveState; |
| | | |
| | | } |
| | | |
| | | public Map<String, Object> getSelectFinishedGlassShelfInformation(Integer pageNum, Integer pageSize) { |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", finishedGlassShelfMapper.getSelectFinishedGlassShelfInformationDate(offset, pageSize)); |
| | | map.put("total", finishedGlassShelfMapper.getSelectFinishedGlassShelfInformationDatePageTotal(offset, pageSize)); |
| | | return map; |
| | | } |
| | | |
| | | public Map<String, Object> getSelectFinishedGlassShelfInformationById(Long id) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", finishedGlassShelfMapper.getSelectFinishedGlassShelfInformationById(id)); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | public String deleteFinishedGlassShelfInformationById(Map<String,Object> object) { |
| | | String saveState = "true"; |
| | | //设置回滚点 |
| | | Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint(); |
| | | try { |
| | | Long id = 0l; |
| | | if (object.get("id") != null) { |
| | | id = Long.valueOf(object.get("id").toString()); |
| | | } |
| | | |
| | | finishedGlassShelfMapper.deleteFinishedGlassShelfInformationById(id); |
| | | |
| | | Log log = new Log(); |
| | | log.setOperatorId(object.get("userId").toString()); |
| | | log.setOperator(object.get("userName").toString()); |
| | | log.setContent(object.toString()); |
| | | log.setFunction("deleteFinishedGlassShelfInformationById删除:"+id); |
| | | logService.saveLog(log); |
| | | |
| | | |
| | | |
| | | } catch (Exception e) { |
| | | TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint); |
| | | //将异常传入数据库 |
| | | SysError sysError = new SysError(); |
| | | sysError.setError(e+Arrays.toString(e.getStackTrace())); |
| | | sysError.setFunc("eleteFinishedGlassShelfInformationById"); |
| | | sysErrorService.insert(sysError); |
| | | saveState = "false"; |
| | | |
| | | } |
| | | return saveState; |
| | | |
| | | } |
| | | |
| | | public Map<String, Object> getSelectFinishedGlassShelfInformationDetails(Integer pageNum, Integer pageSize, String ids) { |
| | | if (ids.startsWith("\"") && ids.endsWith("\"")) { |
| | | ids = ids.substring(1, ids.length() - 1); // 去除首尾引号 |
| | | } |
| | | List<Long> id=new ArrayList<>();; |
| | | if(ids!=null && !ids.isEmpty()){ |
| | | List<String> result = StrUtil.split(ids, '|'); |
| | | id=result.stream().map(Long::valueOf).collect(Collectors.toList()); |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", finishedGlassShelfMapper.getSelectFinishedGlassShelfInformationInId(id)); |
| | | return map; |
| | | } |
| | | |
| | | public Map<String, Object> getSelectFinishedGlassShelfEmitDetails(Integer pageNum, Integer pageSize, String emitId) { |
| | | if (emitId.startsWith("\"") && emitId.endsWith("\"")) { |
| | | emitId = emitId.substring(1, emitId.length() - 1); // 去除首尾引号 |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("emit", finishedGlassShelfMapper.getSelectFinishedGlassShelfEmitByemitId(emitId)); |
| | | map.put("data", finishedGlassShelfMapper.getSelectFinishedGlassShelfEmitDetailsByemitId(emitId)); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | public String insertFinishedGlassShelfEmit(Map<String,Object> object) { |
| | | |
| | | String saveState = "true"; |
| | | //设置回滚点 |
| | | Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint(); |
| | | |
| | | try { |
| | | String emitId=""; |
| | | String oddNumber = null; |
| | | if (object.get("emitId") != null) { |
| | | emitId = object.get("emitId").toString(); |
| | | } else { |
| | | emitId = ""; |
| | | } |
| | | FinishedGlassShelfEmit finishedGlassShelfEmit = JSONObject.parseObject(JSONObject.toJSONString(object.get("title")), FinishedGlassShelfEmit.class); |
| | | List<FinishedGlassShelfEmitDetails> finishedGlassShelfEmitDetailsList = JSONArray.parseArray(JSONObject.toJSONString(object.get("emitDetails")), FinishedGlassShelfEmitDetails.class); |
| | | //查询出库单是否存在 |
| | | FinishedGlassShelfEmit finishedGlassShelfEmit2 = finishedGlassShelfMapper.getSelectFinishedGlassShelfEmitByemitId(emitId); |
| | | |
| | | Log log = new Log(); |
| | | log.setOperator(object.get("userName").toString()); |
| | | log.setOperatorId(object.get("userId").toString()); |
| | | log.setContent(object.toString()); |
| | | |
| | | if (finishedGlassShelfEmit2 != null) { |
| | | //编辑还原数据 |
| | | List<FinishedGlassShelfEmitDetails> finishedGlassShelfEmitDetailsList2 = finishedGlassShelfMapper.getSelectFinishedGlassShelfEmitDetailsByemitId1(emitId); |
| | | if (!finishedGlassShelfEmitDetailsList2.isEmpty()) { |
| | | for (FinishedGlassShelfEmitDetails finishedGlassShelfEmitDetails : finishedGlassShelfEmitDetailsList2) { |
| | | finishedGlassShelfMapper.updateInformationAvailableQuantityInt(finishedGlassShelfEmitDetails); |
| | | finishedGlassShelfMapper.deleteFinishedGlassShelfEmitDetails(emitId); |
| | | finishedGlassShelfMapper.updateFinishedGlassShelfEmitDetailsLog(emitId); |
| | | } |
| | | } |
| | | |
| | | oddNumber = emitId; |
| | | finishedGlassShelfMapper.updateFinishedGlassShelfEmit(finishedGlassShelfEmit, oddNumber); |
| | | log.setFunction("insertDelivery修改:"+oddNumber); |
| | | } else { |
| | | //获取单号 |
| | | oddNumber = orderNumberSetting("出库"); |
| | | //新增出库数据 |
| | | finishedGlassShelfMapper.insertFinishedGlassShelfEmit(finishedGlassShelfEmit, oddNumber); |
| | | log.setFunction("insertFinishedGlassShelfEmit新增:"+oddNumber); |
| | | } |
| | | |
| | | //获取对象集合循环进行新增修改 |
| | | if (finishedGlassShelfEmitDetailsList.size()>0) { |
| | | int index=1; |
| | | for (FinishedGlassShelfEmitDetails finishedGlassShelfEmitDetails:finishedGlassShelfEmitDetailsList){ |
| | | finishedGlassShelfEmitDetails.setMoney(finishedGlassShelfEmitDetails.getPrice()*finishedGlassShelfEmitDetails.getQuantity()); |
| | | finishedGlassShelfMapper.updateInformationAvailableQuantityOut(finishedGlassShelfEmitDetails); |
| | | finishedGlassShelfMapper.insertFinishedGlassShelfEmitDetails(oddNumber,index,finishedGlassShelfEmitDetails); |
| | | finishedGlassShelfMapper.insertFinishedGlassShelfEmitDetailsLog(oddNumber,index,finishedGlassShelfEmitDetails); |
| | | index++; |
| | | } |
| | | logService.saveLog(log); |
| | | } else { |
| | | return "false3"; |
| | | } |
| | | }catch (Exception e) { |
| | | TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint); |
| | | //将异常传入数据库 |
| | | SysError sysError = new SysError(); |
| | | sysError.setError(e+Arrays.toString(e.getStackTrace())); |
| | | sysError.setFunc("insertDelivery"); |
| | | sysErrorService.insert(sysError); |
| | | saveState = "false4"; |
| | | |
| | | } |
| | | |
| | | return saveState; |
| | | } |
| | | |
| | | |
| | | public Map<String, Object> getSelectFinishedGlassShelfEmit(Integer pageNum, Integer pageSize,List<String> selectDate, |
| | | FinishedGlassShelfEmit finishedGlassShelfEmit) throws JsonProcessingException { |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | String endDate = LocalDate.now().toString(); |
| | | String startDate = LocalDate.now().minusDays(15).toString(); |
| | | if(selectDate !=null && selectDate.size()==2){ |
| | | if(!selectDate.get(0).isEmpty()){ |
| | | startDate = selectDate.get(0); |
| | | } |
| | | if(!selectDate.get(1).isEmpty()){ |
| | | endDate = selectDate.get(1); |
| | | } |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", finishedGlassShelfMapper.getSelectFinishedGlassShelfEmit(offset, pageSize,startDate,endDate, finishedGlassShelfEmit)); |
| | | map.put("total", finishedGlassShelfMapper.getSelectFinishedGlassShelfEmitPageTotal(offset, pageSize,startDate,endDate, finishedGlassShelfEmit)); |
| | | List<String> list = new ArrayList<>(); |
| | | list.add(startDate); |
| | | list.add(endDate); |
| | | map.put("selectDate",list); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | public String deleteFinishedGlassShelfEmit(Map<String,Object> object) { |
| | | String saveState = "true"; |
| | | //设置回滚点 |
| | | Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint(); |
| | | try { |
| | | String emitId = ""; |
| | | if (object.get("emitId") != null) { |
| | | emitId = object.get("emitId").toString(); |
| | | } |
| | | FinishedGlassShelfEmit finishedGlassShelfEmit2 = finishedGlassShelfMapper.getSelectFinishedGlassShelfEmitByemitId(emitId); |
| | | |
| | | if (finishedGlassShelfEmit2 != null) { |
| | | //编辑还原数据 |
| | | List<FinishedGlassShelfEmitDetails> finishedGlassShelfEmitDetailsList2 = finishedGlassShelfMapper.getSelectFinishedGlassShelfEmitDetailsByemitId1(emitId); |
| | | if (!finishedGlassShelfEmitDetailsList2.isEmpty()) { |
| | | for (FinishedGlassShelfEmitDetails finishedGlassShelfEmitDetails : finishedGlassShelfEmitDetailsList2) { |
| | | finishedGlassShelfMapper.updateInformationAvailableQuantityInt(finishedGlassShelfEmitDetails); |
| | | finishedGlassShelfMapper.deleteFinishedGlassShelfEmitDetailsLog(emitId); |
| | | } |
| | | } |
| | | |
| | | } |
| | | finishedGlassShelfMapper.deleteFinishedGlassShelfEmitDetails(emitId); |
| | | finishedGlassShelfMapper.deleteFinishedGlassShelfEmit(emitId); |
| | | |
| | | |
| | | Log log = new Log(); |
| | | log.setOperatorId(object.get("userId").toString()); |
| | | log.setOperator(object.get("userName").toString()); |
| | | log.setContent(object.toString()); |
| | | log.setFunction("deleteFinishedGlassShelfEmit删除:"+emitId); |
| | | logService.saveLog(log); |
| | | |
| | | return "true"; |
| | | }catch (Exception e) { |
| | | TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint); |
| | | //将异常传入数据库 |
| | | SysError sysError = new SysError(); |
| | | sysError.setError(e+Arrays.toString(e.getStackTrace())); |
| | | sysError.setFunc("deleteFinishedGlassShelfEmit"); |
| | | sysErrorService.insert(sysError); |
| | | saveState = "false"; |
| | | |
| | | } |
| | | return saveState; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public String orderNumberSetting(String type) { |
| | | //根据类型自动生成不同的操作单号 |
| | | String alias=""; |
| | | Integer maximum=0; |
| | | if(Objects.equals(type, "入库")){ |
| | | alias="RK"; |
| | | maximum=finishedGlassShelfMapper.getmaximumWithdraw(); |
| | | }else if(Objects.equals(type, "出库")){ |
| | | alias="CK"; |
| | | maximum=finishedGlassShelfMapper.getmaximumEmit(); |
| | | } |
| | | //设置两位不够补0 |
| | | String formattedNumber = String.format("%02d", maximum+1); |
| | | //格式化当前日期 |
| | | Date currentDate = new Date(); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyMMdd"); |
| | | String formattedDate = dateFormat.format(currentDate); |
| | | String oddNumbers = alias+formattedDate+formattedNumber; |
| | | return oddNumbers; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | MaterialInventory materialInventory = JSONObject.parseObject(JSONObject.toJSONString(object.get("title")), MaterialInventory.class); |
| | | |
| | | |
| | | if(materialInventory.getProducer()==null){ |
| | | materialInventory.setProducer(""); |
| | | } |
| | | //查询物料是否存在 |
| | | List<MaterialInventory> MaterialInventoryCount; |
| | | if (materialInventory.getDateOfManufacture()!=null){ |
| | | MaterialInventoryCount = materialInventoryMapper.getMaterialInventoryCount(materialCode,materialInventory.getDateOfManufacture()); |
| | | MaterialInventoryCount = materialInventoryMapper.getMaterialInventoryCount(materialCode,materialInventory.getDateOfManufacture(),materialInventory.getProducer()); |
| | | }else{ |
| | | MaterialInventoryCount = materialInventoryMapper.getMaterialInventoryCountNull(materialCode); |
| | | MaterialInventoryCount = materialInventoryMapper.getMaterialInventoryCountNull(materialCode,materialInventory.getProducer()); |
| | | } |
| | | |
| | | if(MaterialInventoryCount.size()==1){ |
| | |
| | | totalArea= Double.parseDouble(decimalFormat.format(singlePieceArea * returningWarehouseDetail.getReturnQuantity())); |
| | | |
| | | |
| | | if(returningWarehouseDetail.getProducer()==null){ |
| | | returningWarehouseDetail.setProducer(""); |
| | | } |
| | | //查询物料是否存在 |
| | | List<MaterialInventory> MaterialInventoryCount; |
| | | if (returningWarehouseDetail.getDateOfManufacture()!=null){ |
| | | MaterialInventoryCount = materialInventoryMapper.getMaterialInventoryCount(returningWarehouseDetail.getId(),returningWarehouseDetail.getDateOfManufacture()); |
| | | MaterialInventoryCount = materialInventoryMapper.getMaterialInventoryCount(returningWarehouseDetail.getId(),returningWarehouseDetail.getDateOfManufacture(),returningWarehouseDetail.getProducer()); |
| | | }else{ |
| | | MaterialInventoryCount = materialInventoryMapper.getMaterialInventoryCountNull(returningWarehouseDetail.getId()); |
| | | MaterialInventoryCount = materialInventoryMapper.getMaterialInventoryCountNull(returningWarehouseDetail.getId(),returningWarehouseDetail.getProducer()); |
| | | } |
| | | |
| | | |
| | |
| | | //获取库存编号添加到返库明细表 |
| | | List<MaterialInventory> MaterialInventoryId; |
| | | if (returningWarehouseDetail.getDateOfManufacture()!=null){ |
| | | MaterialInventoryId = materialInventoryMapper.getMaterialInventoryCountId(returningWarehouseDetail.getId(),returningWarehouseDetail.getDateOfManufacture()); |
| | | MaterialInventoryId = materialInventoryMapper.getMaterialInventoryCountId(returningWarehouseDetail.getId(),returningWarehouseDetail.getDateOfManufacture(),returningWarehouseDetail.getProducer()); |
| | | }else{ |
| | | MaterialInventoryId = materialInventoryMapper.getMaterialInventoryCountNullId(returningWarehouseDetail.getId()); |
| | | MaterialInventoryId = materialInventoryMapper.getMaterialInventoryCountNullId(returningWarehouseDetail.getId(),returningWarehouseDetail.getProducer()); |
| | | } |
| | | materialInventoryMapper.updateReturningWarehouseDetail(oddNumber, returningWarehouseDetailMaximum + 1,MaterialInventoryId.get(0).getId()); |
| | | |
| | |
| | | if (!materialLoglist.isEmpty()){ |
| | | for (MaterialLog materialLog : materialLoglist) { |
| | | |
| | | if(materialLog.getProducer()==null){ |
| | | materialLog.setProducer(""); |
| | | } |
| | | //查询物料是否存在 |
| | | List<MaterialInventory> MaterialInventoryList; |
| | | if (materialLog.getOperationOrderNumber()!=null){ |
| | | MaterialInventoryList = materialInventoryMapper.getMaterialInventoryCount(materialLog.getMaterialCode(), LocalDate.parse(materialLog.getOperationOrderNumber())); |
| | | MaterialInventoryList = materialInventoryMapper.getMaterialInventoryCount(materialLog.getMaterialCode(), LocalDate.parse(materialLog.getOperationOrderNumber()),materialLog.getProducer()); |
| | | }else{ |
| | | MaterialInventoryList = materialInventoryMapper.getMaterialInventoryCountNull(materialLog.getMaterialCode()); |
| | | MaterialInventoryList = materialInventoryMapper.getMaterialInventoryCountNull(materialLog.getMaterialCode(),materialLog.getProducer()); |
| | | } |
| | | |
| | | if(MaterialInventoryList.size()==1){ |
| | | if(MaterialInventoryList.get(0).getAvailableQuantity()>=materialLog.getQuantity()){ |
| | | if (materialLog.getOperationOrderNumber()!=null){ |
| | | materialInventoryMapper.updateMaterialInventoryOut(materialLog.getMaterialCode(),materialLog.getQuantity(),materialLog.getOperationOrderNumber()); |
| | | materialInventoryMapper.updateMaterialInventoryOut(materialLog.getMaterialCode(),materialLog.getQuantity(), |
| | | materialLog.getOperationOrderNumber(),materialLog.getProducer()); |
| | | }else{ |
| | | materialInventoryMapper.updateMaterialInventoryNullOut(materialLog.getMaterialCode(),materialLog.getQuantity()); |
| | | materialInventoryMapper.updateMaterialInventoryNullOut(materialLog.getMaterialCode(),materialLog.getQuantity(), |
| | | materialLog.getProducer()); |
| | | } |
| | | materialInventoryMapper.deleteMaterialLogById(materialLog.getId()); |
| | | }else{ |
| | |
| | | log.setFunction("updateMaterialInventory物料库存修改"); |
| | | MaterialInventory materialInventory = JSONObject.parseObject(JSONObject.toJSONString(object.get("title")), MaterialInventory.class); |
| | | |
| | | materialInventoryMapper.updateMaterialInventoryAll(materialInventoryId,materialInventory); |
| | | if(materialInventory.getProducer()==null){ |
| | | materialInventory.setProducer(""); |
| | | } |
| | | //查询物料是否存在 |
| | | List<MaterialInventory> MaterialInventoryCount; |
| | | if (materialInventory.getDateOfManufacture()!=null){ |
| | | MaterialInventoryCount = materialInventoryMapper.getMaterialInventoryCount(materialInventory.getMaterialCode(),materialInventory.getDateOfManufacture(),materialInventory.getProducer()); |
| | | }else{ |
| | | MaterialInventoryCount = materialInventoryMapper.getMaterialInventoryCountNull(materialInventory.getMaterialCode(),materialInventory.getProducer()); |
| | | } |
| | | |
| | | if(MaterialInventoryCount.size()==1){ |
| | | materialInventoryMapper.updateMaterialInventoryOne(MaterialInventoryCount.get(0).getId(),materialInventory); |
| | | List<Long> id=new ArrayList<>(); |
| | | id.add(materialInventoryId); |
| | | materialInventoryMapper.deleteMaterialInventory(id); |
| | | }else{ |
| | | materialInventoryMapper.updateMaterialInventoryAll(materialInventoryId,materialInventory); |
| | | } |
| | | |
| | | |
| | | |
| | | logService.saveLog(log); |
| | | } catch (Exception e) { |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.example.erp.mapper.mm.FinishedGlassShelfMapper"> |
| | | |
| | | <resultMap id="selectFinishedGlassShelfEmitDetails" type="com.example.erp.entity.mm.FinishedGlassShelfEmitDetails"> |
| | | <id column="id" property="id"/> |
| | | <result column="emit_id" property="emitId"/> |
| | | <result column="emit_number" property="emitNumber"/> |
| | | <result column="information_id" property="informationId"/> |
| | | <result column="glass_shelf_number" property="glassShelfNumber"/> |
| | | <result column="glass_shelf_name" property="glassShelfName"/> |
| | | <result column="withdraw_quantity" property="withdrawQuantity"/> |
| | | <result column="quantity" property="quantity"/> |
| | | <result column="unit" property="unit"/> |
| | | <result column="price" property="price"/> |
| | | <result column="money" property="money"/> |
| | | <result column="remarks" property="remarks"/> |
| | | |
| | | <result column="available_quantity" property="finishedGlassShelfInformation.availableQuantity"/> |
| | | <result column="total_quantity" property="finishedGlassShelfInformation.totalQuantity"/> |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="getSelectFinishedGlassShelfInformation"> |
| | | select |
| | | * |
| | | from |
| | | mm.finished_glass_shelf_information |
| | | where glass_shelf_number = #{finishedGlassShelfInformation.glassShelfNumber} |
| | | and glass_shelf_name = #{finishedGlassShelfInformation.glassShelfName} |
| | | and price = #{finishedGlassShelfInformation.price} |
| | | and unit = #{finishedGlassShelfInformation.unit} |
| | | and max_weight = #{finishedGlassShelfInformation.maxWeight} |
| | | and max_width = #{finishedGlassShelfInformation.maxWidth} |
| | | and max_height = #{finishedGlassShelfInformation.maxHeight} |
| | | |
| | | </select> |
| | | |
| | | |
| | | <insert id="insetFinishedGlassShelfInformation" useGeneratedKeys="true" > |
| | | insert into mm.finished_glass_shelf_information(glass_shelf_number,glass_shelf_name,available_quantity, |
| | | total_quantity,price,money,unit,max_weight,max_width,max_height,remarks,create_time) |
| | | values ( |
| | | #{finishedGlassShelfInformation.glassShelfNumber},#{finishedGlassShelfInformation.glassShelfName} |
| | | ,#{finishedGlassShelfInformation.totalQuantity},#{finishedGlassShelfInformation.totalQuantity} |
| | | ,#{finishedGlassShelfInformation.price},#{finishedGlassShelfInformation.money} |
| | | ,#{finishedGlassShelfInformation.unit},#{finishedGlassShelfInformation.maxWeight} |
| | | ,#{finishedGlassShelfInformation.maxWidth},#{finishedGlassShelfInformation.maxHeight},#{finishedGlassShelfInformation.remarks},now() |
| | | ) |
| | | </insert> |
| | | |
| | | <insert id="insetFinishedGlassShelfLog" useGeneratedKeys="true" > |
| | | insert into mm.finished_glass_shelf_log(type,glass_shelf_number,glass_shelf_name,quantity,price,money,unit, |
| | | max_weight,max_width,max_height,remarks,create_time) |
| | | values ( |
| | | 3,#{finishedGlassShelfInformation.glassShelfNumber},#{finishedGlassShelfInformation.glassShelfName} |
| | | ,#{finishedGlassShelfInformation.totalQuantity} |
| | | ,#{finishedGlassShelfInformation.price},#{finishedGlassShelfInformation.money} |
| | | ,#{finishedGlassShelfInformation.unit},#{finishedGlassShelfInformation.maxWeight} |
| | | ,#{finishedGlassShelfInformation.maxWidth},#{finishedGlassShelfInformation.maxHeight},#{finishedGlassShelfInformation.remarks},now() |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateFinishedGlassShelfInformationQuantity"> |
| | | update mm.finished_glass_shelf_information set available_quantity=available_quantity+ #{quantity}, |
| | | total_quantity=total_quantity+#{quantity} where id=#{id} |
| | | </update> |
| | | |
| | | <update id="updateFinishedGlassShelfInformation"> |
| | | update mm.finished_glass_shelf_information set glass_shelf_number=#{finishedGlassShelfInformation.glassShelfNumber}, |
| | | glass_shelf_name=#{finishedGlassShelfInformation.glassShelfName}, |
| | | available_quantity=#{finishedGlassShelfInformation.availableQuantity}, |
| | | total_quantity=#{finishedGlassShelfInformation.totalQuantity}, |
| | | price=#{finishedGlassShelfInformation.price}, |
| | | money=#{finishedGlassShelfInformation.money}, |
| | | unit=#{finishedGlassShelfInformation.unit}, |
| | | max_weight=#{finishedGlassShelfInformation.maxWeight}, |
| | | max_width=#{finishedGlassShelfInformation.maxWidth}, |
| | | max_height=#{finishedGlassShelfInformation.maxHeight}, |
| | | remarks=#{finishedGlassShelfInformation.remarks}, |
| | | create_time=now() |
| | | where id=#{id} |
| | | </update> |
| | | |
| | | |
| | | <select id="getSelectFinishedGlassShelfInformationDate"> |
| | | select * from mm.finished_glass_shelf_information where available_quantity>0 limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getSelectFinishedGlassShelfInformationDatePageTotal"> |
| | | select |
| | | CEILING(count(id)/#{pageSize}) as 'pageTotal', |
| | | count(id) as 'total' |
| | | from |
| | | mm.finished_glass_shelf_information where available_quantity>0 |
| | | </select> |
| | | |
| | | <select id="getSelectFinishedGlassShelfInformationById"> |
| | | select |
| | | * |
| | | from |
| | | mm.finished_glass_shelf_information where id = #{id} |
| | | |
| | | </select> |
| | | |
| | | |
| | | <select id="getSelectFinishedGlassShelfInformationInId"> |
| | | select |
| | | id as informationId, |
| | | glass_shelf_number as glassShelfNumber, |
| | | glass_shelf_name as glassShelfName, |
| | | available_quantity as availableQuantity, |
| | | total_quantity as totalQuantity, |
| | | price, |
| | | money, |
| | | unit, |
| | | max_weight as maxWeight, |
| | | max_width as maxWidth, |
| | | max_height as maxHeight, |
| | | remarks |
| | | from |
| | | mm.finished_glass_shelf_information where id in |
| | | <foreach item="id" collection="ids" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteFinishedGlassShelfInformationById"> |
| | | delete from mm.finished_glass_shelf_information where id=#{id} |
| | | |
| | | </delete> |
| | | |
| | | <select id="getSelectFinishedGlassShelfEmitByemitId"> |
| | | select * from |
| | | mm.finished_glass_shelf_emit |
| | | where emit_id=#{emitId} |
| | | </select> |
| | | |
| | | <select id="getSelectFinishedGlassShelfEmitDetailsByemitId" > |
| | | select |
| | | fed.information_id as informationId, |
| | | fed.glass_shelf_number as glassShelfNumber, |
| | | fed.glass_shelf_name as glassShelfName, |
| | | fed.quantity as quantity, |
| | | fi.available_quantity+fed.quantity as availableQuantity, |
| | | fi.total_quantity as totalQuantity, |
| | | fed.price, |
| | | fed.money, |
| | | fed.unit, |
| | | fed.remarks |
| | | from |
| | | mm.finished_glass_shelf_emit_details fed left join mm.finished_glass_shelf_information fi on fed.information_id=fi.id |
| | | where emit_id=#{emitId} |
| | | </select> |
| | | |
| | | <select id="getSelectFinishedGlassShelfEmitDetailsByemitId1" > |
| | | select * from mm.finished_glass_shelf_emit_details where emit_id=#{emitId} |
| | | </select> |
| | | |
| | | |
| | | <select id="getmaximumEmit" > |
| | | select ifnull(SUBSTR(max(right(emit_id,8)) from 7),0) from mm.finished_glass_shelf_emit where date(create_time)=CURDATE() |
| | | </select> |
| | | |
| | | <select id="getmaximumWithdraw" > |
| | | select ifnull(SUBSTR(max(right(emit_id,8)) from 7),0) from mm.finished_glass_shelf_withdraw where date(create_time)=CURDATE() |
| | | </select> |
| | | |
| | | |
| | | <insert id="insertFinishedGlassShelfEmit" useGeneratedKeys="true" > |
| | | insert into mm.finished_glass_shelf_emit(emit_id,create_time,withdraw_time,customer_name,project,operator,state,remarks) |
| | | values ( |
| | | #{emitId},now(),#{finishedGlassShelfEmit.withdrawTime},#{finishedGlassShelfEmit.customerName} |
| | | ,#{finishedGlassShelfEmit.project},#{finishedGlassShelfEmit.operator},0,#{finishedGlassShelfEmit.remarks} |
| | | ) |
| | | </insert> |
| | | |
| | | <insert id="insertFinishedGlassShelfEmitDetails" useGeneratedKeys="true" > |
| | | insert into mm.finished_glass_shelf_emit_details(emit_id,emit_number,information_id,glass_shelf_number,glass_shelf_name, |
| | | withdraw_quantity,quantity,price,unit,money,remarks) |
| | | values ( |
| | | #{emitId},#{emitNumber},#{finishedGlassShelfEmitDetails.informationId}, |
| | | #{finishedGlassShelfEmitDetails.glassShelfNumber},#{finishedGlassShelfEmitDetails.glassShelfName} |
| | | ,0,#{finishedGlassShelfEmitDetails.quantity},#{finishedGlassShelfEmitDetails.price},#{finishedGlassShelfEmitDetails.unit}, |
| | | #{finishedGlassShelfEmitDetails.money},#{finishedGlassShelfEmitDetails.remarks} |
| | | ) |
| | | </insert> |
| | | |
| | | <insert id="insertFinishedGlassShelfEmitDetailsLog" useGeneratedKeys="true" > |
| | | insert into mm.finished_glass_shelf_log(document_id,document_number,type,glass_shelf_number,glass_shelf_name,quantity,price,money,unit, |
| | | remarks,create_time) |
| | | values ( |
| | | #{emitId},#{emitNumber},1, #{finishedGlassShelfEmitDetails.glassShelfNumber},#{finishedGlassShelfEmitDetails.glassShelfName}, |
| | | #{finishedGlassShelfEmitDetails.quantity},#{finishedGlassShelfEmitDetails.price}, |
| | | #{finishedGlassShelfEmitDetails.money},#{finishedGlassShelfEmitDetails.unit},#{finishedGlassShelfEmitDetails.remarks},now() |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateInformationAvailableQuantityOut"> |
| | | update mm.finished_glass_shelf_information set available_quantity=available_quantity-#{finishedGlassShelfEmitDetails.quantity} |
| | | where id=#{finishedGlassShelfEmitDetails.informationId} |
| | | </update> |
| | | |
| | | <update id="updateInformationAvailableQuantityInt"> |
| | | update mm.finished_glass_shelf_information set available_quantity=available_quantity+#{finishedGlassShelfEmitDetails.quantity} |
| | | where id=#{finishedGlassShelfEmitDetails.informationId} |
| | | </update> |
| | | |
| | | <update id="updateFinishedGlassShelfEmit" > |
| | | update mm.finished_glass_shelf_emit set create_time=now(), |
| | | withdraw_time=#{finishedGlassShelfEmit.withdrawTime}, |
| | | customer_name=#{finishedGlassShelfEmit.customerName}, |
| | | project=#{finishedGlassShelfEmit.project}, |
| | | operator=#{finishedGlassShelfEmit.operator}, |
| | | remarks=#{finishedGlassShelfEmit.remarks} |
| | | where emit_id=#{emitId} |
| | | </update> |
| | | |
| | | <delete id="deleteFinishedGlassShelfEmitDetails" > |
| | | delete from mm.finished_glass_shelf_emit_details where emit_id=#{emitId} |
| | | </delete> |
| | | |
| | | <delete id="deleteFinishedGlassShelfEmit" > |
| | | delete from mm.finished_glass_shelf_emit where emit_id=#{emitId} |
| | | </delete> |
| | | |
| | | <delete id="deleteFinishedGlassShelfEmitDetailsLog" > |
| | | delete from mm.finished_glass_shelf_log where document_id=#{emitId} |
| | | </delete> |
| | | |
| | | <update id="updateFinishedGlassShelfEmitDetailsLog" > |
| | | update mm.finished_glass_shelf_log set state=1 where document_id=#{emitId} |
| | | </update> |
| | | |
| | | |
| | | <select id="getSelectFinishedGlassShelfEmit"> |
| | | select * from mm.finished_glass_shelf_emit |
| | | <where> |
| | | date(create_time)>=#{startDate} and date(create_time) <= #{endDate} |
| | | <if test="emit.emitId != null and emit.emitId != ''"> |
| | | and emit_id regexp #{emit.emitId} |
| | | </if> |
| | | <if test="emit.customerName != null and emit.customerName != ''"> |
| | | and customer_name regexp #{emit.customerName} |
| | | </if> |
| | | <if test="emit.project != null and emit.project != ''"> |
| | | and project regexp #{emit.project} |
| | | </if> |
| | | <if test="emit.operator != null and emit.operator != ''"> |
| | | and operator regexp #{emit.operator} |
| | | </if> |
| | | <if test="emit.state != null and emit.state != ''"> |
| | | and state regexp #{emit.state} |
| | | </if> |
| | | <if test="emit.remarks != null and emit.remarks != ''"> |
| | | and remarks regexp #{emit.remarks} |
| | | </if> |
| | | |
| | | </where> |
| | | group by emit_id |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getSelectFinishedGlassShelfEmitPageTotal"> |
| | | select |
| | | CEILING(count(id)/#{pageSize}) as 'pageTotal', |
| | | count(id) as 'total' |
| | | from mm.finished_glass_shelf_emit |
| | | <where> |
| | | date(create_time)>=#{startDate} and date(create_time) <= #{endDate} |
| | | <if test="emit.emitId != null and emit.emitId != ''"> |
| | | and emit_id regexp #{emit.emitId} |
| | | </if> |
| | | <if test="emit.customerName != null and emit.customerName != ''"> |
| | | and customer_name regexp #{emit.customerName} |
| | | </if> |
| | | <if test="emit.project != null and emit.project != ''"> |
| | | and project regexp #{emit.project} |
| | | </if> |
| | | <if test="emit.operator != null and emit.operator != ''"> |
| | | and operator regexp #{emit.operator} |
| | | </if> |
| | | <if test="emit.state != null and emit.state != ''"> |
| | | and state regexp #{emit.state} |
| | | </if> |
| | | <if test="emit.remarks != null and emit.remarks != ''"> |
| | | and remarks regexp #{emit.remarks} |
| | | </if> |
| | | </where> |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | </select> |
| | | |
| | | <select id="getMaterialInventoryCount" > |
| | | select * 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} and producer=#{producer} |
| | | </select> |
| | | |
| | | <select id="getMaterialInventoryCountNull" > |
| | | select * 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 and producer=#{producer} |
| | | </select> |
| | | |
| | | <select id="getMaterialInventoryCountId" > |
| | | select id from mm.material_inventory where material_code=#{materialCode} and date_of_manufacture=#{dateOfManufacture} |
| | | select id from mm.material_inventory where material_code=#{materialCode} and date_of_manufacture=#{dateOfManufacture} and producer=#{producer} |
| | | </select> |
| | | |
| | | <select id="getMaterialInventoryCountNullId" > |
| | | select id from mm.material_inventory where material_code=#{materialCode} and date_of_manufacture is null |
| | | select id from mm.material_inventory where material_code=#{materialCode} and date_of_manufacture is null and producer=#{producer} |
| | | </select> |
| | | |
| | | <select id="getIsNotMaterialOutboundDetail" > |
| | |
| | | available_quantity=available_quantity+#{materialInventory.inventoryQuantity}, |
| | | total_area=single_piece_area*inventory_quantity |
| | | where material_code=#{materialCode} and date_of_manufacture=#{materialInventory.dateOfManufacture} |
| | | and producer=#{materialInventory.producer} |
| | | </update> |
| | | |
| | | <update id="updateMaterialInventoryNull" > |
| | | 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} and date_of_manufacture is null |
| | | where material_code=#{materialCode} and date_of_manufacture is null and producer=#{materialInventory.producer} |
| | | </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} |
| | | where material_code=#{materialCode} and date_of_manufacture=#{dateOfManufacture} and producer=#{producer} |
| | | </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 |
| | | where material_code=#{materialCode} and date_of_manufacture is null and producer=#{producer} |
| | | </update> |
| | | |
| | | <update id="updateMaterialInventoryReturning" > |
| | | update mm.material_inventory set available_quantity=available_quantity+#{returningWarehouseDetail.returnQuantity} |
| | | where material_code=#{materialCode} and |
| | | date_of_manufacture=#{returningWarehouseDetail.dateOfManufacture} |
| | | date_of_manufacture=#{returningWarehouseDetail.dateOfManufacture} and producer=#{returningWarehouseDetail.producer} |
| | | |
| | | |
| | | </update> |
| | |
| | | <update id="updateMaterialInventoryReturningNull" > |
| | | update mm.material_inventory set available_quantity=available_quantity+#{returningWarehouseDetail.returnQuantity} |
| | | where material_code=#{materialCode} and |
| | | date_of_manufacture is null |
| | | date_of_manufacture is null and producer=#{returningWarehouseDetail.producer} |
| | | |
| | | |
| | | </update> |
| | |
| | | where id=#{materialInventoryId} |
| | | </update> |
| | | |
| | | <update id="updateMaterialInventoryOne" > |
| | | update mm.material_inventory set |
| | | quality_guarantee_period=#{materialInventory.qualityGuaranteePeriod}, |
| | | inventory_area=#{materialInventory.inventoryArea}, |
| | | remarks=#{materialInventory.remarks}, |
| | | available_quantity=available_quantity+#{materialInventory.availableQuantity}, |
| | | inventory_quantity=inventory_quantity+#{materialInventory.inventoryQuantity}, |
| | | total_area=inventory_quantity*single_piece_area |
| | | where id=#{materialInventoryId} |
| | | </update> |
| | | |
| | | </mapper> |
| | |
| | | </select> |
| | | |
| | | <select id="teamOutputFootSum"> |
| | | select SUM(completed_quantity) as completedQuantity, |
| | | ifnull(SUM(ROUND(width * height * completed_quantity / 1000000, 2)),0) AS area |
| | | from ( |
| | | SELECT |
| | | SUM(completed_quantity) as completedQuantity, |
| | | ifnull(SUM(ROUND(width * height * completed_quantity / 1000000, 2)),0) AS area |
| | | FROM |
| | | ( |
| | | SELECT |
| | | rw.reporting_work_time, |
| | | rw.this_process, |
| | | rw.teams_groups_name, |
| | | o.project, |
| | | rw.process_id, |
| | | fc.order_number, |
| | | MAX( ogd.child_width ) as width, |
| | | MAX( ogd.child_height ) as height, |
| | | rwd.completed_quantity as completed_quantity |
| | | MAX(ogd.child_width) AS width, |
| | | MAX(ogd.child_height) AS height, |
| | | od.edging_type, |
| | | rwd.completed_quantity AS completed_quantity, |
| | | ROUND(MAX(ogd.child_width) * MAX(ogd.child_height) * rwd.completed_quantity / 1000000, 2) AS area, |
| | | od.product_name, |
| | | JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')) AS code, |
| | | rw.reviewed, |
| | | rw.examine_time, |
| | | rw.device_name, |
| | | o.order_type, |
| | | CASE |
| | | WHEN LOCATE('step', #{laminating}) > 0 THEN GROUP_CONCAT(ogd.glass_child SEPARATOR '+') |
| | | ELSE MAX(ogd.glass_child) |
| | | END AS workProcessName, |
| | | o.batch |
| | | FROM |
| | | reporting_work as rw left join reporting_work_detail as rwd on rwd.reporting_work_id=rw.reporting_work_id |
| | | left join flow_card as fc on fc.order_id=rw.order_id and fc.process_id=rw.process_id and fc.order_number=rwd.order_number and fc.technology_number=rwd.technology_number |
| | | left join sd.order_glass_detail as ogd on ogd.order_id=fc.order_id and ogd.order_number=fc.order_number and ogd.technology_number=fc.technology_number |
| | | left join sd.order_detail as od on od.order_id=ogd.order_id and od.order_number=ogd.order_number |
| | | left join sd.`order` as o on o.order_id=od.order_id |
| | | where o.create_order>0 and rw.reviewed_state>=0 and rwd.completed_quantity>0 |
| | | AND rw.reporting_work_time >= #{selectTime1} |
| | | reporting_work AS rw |
| | | LEFT JOIN reporting_work_detail AS rwd |
| | | ON rwd.reporting_work_id = rw.reporting_work_id |
| | | LEFT JOIN flow_card AS fc |
| | | ON fc.order_id = rw.order_id |
| | | AND fc.process_id = rw.process_id |
| | | AND fc.order_number = rwd.order_number |
| | | AND fc.technology_number = rwd.technology_number |
| | | LEFT JOIN sd.order_glass_detail AS ogd |
| | | ON ogd.order_id = fc.order_id |
| | | AND ogd.order_number = fc.order_number |
| | | AND ogd.technology_number = fc.technology_number |
| | | LEFT JOIN sd.order_detail AS od |
| | | ON od.order_id = ogd.order_id |
| | | AND od.order_number = ogd.order_number |
| | | LEFT JOIN sd.`order` AS o |
| | | ON o.order_id = od.order_id |
| | | WHERE |
| | | o.create_order > 0 |
| | | AND rw.reviewed_state >= 0 |
| | | AND rwd.completed_quantity > 0 |
| | | AND rw.reporting_work_time >= #{selectTime1} |
| | | AND rw.reporting_work_time < #{selectTime2} |
| | | and position(#{selectProcesses} in rw.this_process) |
| | | <choose> |
| | | <!-- 有传工序:精确匹配 --> |
| | | <when test="selectProcesses != null and selectProcesses != ''"> |
| | | AND rw.this_process = #{selectProcesses} |
| | | </when> |
| | | <!-- 未传工序:不加限制,查所有) --> |
| | | <otherwise> |
| | | </otherwise> |
| | | </choose> |
| | | <if test="teamOutputDTO.thisProcess != null and teamOutputDTO.thisProcess != ''"> |
| | | and rw.this_process regexp #{teamOutputDTO.thisProcess} |
| | | AND rw.this_process REGEXP #{teamOutputDTO.thisProcess} |
| | | </if> |
| | | <if test="teamOutputDTO.teamsGroupsName != null and teamOutputDTO.teamsGroupsName != ''"> |
| | | and rw.teams_groups_name regexp #{teamOutputDTO.teamsGroupsName} |
| | | AND rw.teams_groups_name REGEXP #{teamOutputDTO.teamsGroupsName} |
| | | </if> |
| | | <if test="teamOutputDTO.project != null and teamOutputDTO.project != ''"> |
| | | and o.project regexp #{teamOutputDTO.project} |
| | | AND o.project REGEXP #{teamOutputDTO.project} |
| | | </if> |
| | | <if test="teamOutputDTO.processId != null and teamOutputDTO.processId != ''"> |
| | | and rw.process_id regexp #{teamOutputDTO.processId} |
| | | AND rw.process_id REGEXP #{teamOutputDTO.processId} |
| | | </if> |
| | | <if test="teamOutputDTO.edgingType != null and teamOutputDTO.edgingType != ''"> |
| | | and od.edging_type regexp #{teamOutputDTO.edgingType} |
| | | AND od.edging_type REGEXP #{teamOutputDTO.edgingType} |
| | | </if> |
| | | <if test="teamOutputDTO.deviceName != null and teamOutputDTO.deviceName != ''"> |
| | | and rw.device_name regexp #{teamOutputDTO.deviceName} |
| | | AND rw.device_name REGEXP #{teamOutputDTO.deviceName} |
| | | </if> |
| | | |
| | | <choose> |
| | | <when test="laminating == ''"> |
| | | GROUP BY |
| | |
| | | </when> |
| | | <otherwise> |
| | | GROUP BY |
| | | <if test="laminating == 'stepA' || laminating == 'stepC'"> |
| | | ogd.`group`, |
| | | </if> |
| | | rw.reporting_work_id, |
| | | rw.process_id, |
| | | rw.this_process, |
| | |
| | | rwd.order_number |
| | | </otherwise> |
| | | </choose> |
| | | ) t |
| | | WHERE 1 = 1 |
| | | <if test="teamOutputDTO.workProcessName != null and teamOutputDTO.workProcessName != ''"> |
| | | AND t.workProcessName REGEXP #{teamOutputDTO.workProcessName} |
| | | </if> |
| | | ORDER BY |
| | | rw.this_process, |
| | | rw.process_id, |
| | | rwd.order_number, |
| | | rw.reporting_work_time, |
| | | rw.teams_groups_name |
| | | ) as subquery |
| | | t.this_process, |
| | | t.process_id, |
| | | t.order_number, |
| | | t.reporting_work_time, |
| | | t.teams_groups_name |
| | | </select> |
| | | |
| | | <select id="getLaminating"> |