| | |
| | | let remarks = ref(null) |
| | | const xGrid = ref(); |
| | | const gridEvents = { |
| | | toolbarButtonClick({ code }) { |
| | | async toolbarButtonClick({code}) { |
| | | const $grid = xGrid.value |
| | | if($grid){ |
| | | switch (code){ |
| | | case 'verify':{ |
| | | const $table = xGrid.value |
| | | if ($table) { |
| | | const selectRecords = $table.getCheckboxRecords() |
| | | |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | console.log(selectRecords) |
| | | |
| | | if (selectRecords.length > 0) { |
| | | const errMap = await $grid.validate(selectRecords) |
| | | console.log(errMap) |
| | | if (errMap) { |
| | | ElMessage.warning("数据校验失败") |
| | | return |
| | | } |
| | | } else { |
| | | ElMessage.warning("未选中数据") |
| | | return |
| | | } |
| | | |
| | | const operatetype = operateType._rawValue |
| | | if(operatetype === null || operatetype === undefined || operatetype === ''){ |
| | | ElMessage.warning("请选择领出类型") |
| | | return |
| | | } |
| | | |
| | | let flowData = ref({ |
| | | |
| | |
| | | }) |
| | | request.post("/FinishedGoodsInventory/updateFinishedGoodsInventoryTakeOut",flowData.value).then((res) => { |
| | | if(res.code==200){ |
| | | location.reload(); |
| | | ElMessage.success("领出成功") |
| | | router.push({path: '/main/delivery/SelectOrderList'}) |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | return |
| | | } |
| | |
| | | |
| | | }) |
| | | |
| | | /*数据校验*/ |
| | | const validRules = ref({ |
| | | quantity: [ |
| | | { required: true, message: '请输入领取数量' } |
| | | ] |
| | | }) |
| | | |
| | | |
| | | |
| | | |
| | |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | :edit-rules="validRules" |
| | | > |
| | | <!-- @toolbar-button-click="toolbarButtonClickEvent"--> |
| | | <!-- 下拉显示所有信息插槽--> |
| | |
| | | |
| | | import {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} from "element-plus"; |
| | | const userStore = useUserInfoStore() |
| | | const username = userStore.user.userName |
| | | const userid = userStore.user.userId |
| | | let router=useRouter() |
| | | let produceList = ref([]) |
| | | |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/productStock/OrderAllocation', query: { id: row.id }}) |
| | | break |
| | | } |
| | | case 'back':{ |
| | | router.push({path: '/main/productStock/FinishedProductRework', query: { id: row.id }}) |
| | | break |
| | | } |
| | | case 'out' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/productStock/TakeOutRecord'}); |
| | | return |
| | | } |
| | | } |
| | | } |
| | | |
| | | let operateType = ref(null) |
| | | let remarks = ref(null) |
| | | const xGrid = ref(); |
| | | const gridEvents = { |
| | | toolbarButtonClick({ code }) { |
| | | async toolbarButtonClick({code}) { |
| | | const $grid = xGrid.value |
| | | if($grid){ |
| | | switch (code){ |
| | | case 'ver':{ |
| | | alert('我接收到子组件传送的编辑信息') |
| | | // router.push({path: '/main/productStock/OrderAllocation'}); |
| | | // return; |
| | | break |
| | | |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | console.log(selectRecords) |
| | | |
| | | if (selectRecords.length > 0) { |
| | | const errMap = await $grid.validate(selectRecords) |
| | | console.log(errMap) |
| | | if (errMap) { |
| | | ElMessage.warning("数据校验失败") |
| | | return |
| | | } |
| | | case 'record':{ |
| | | router.push({path: '/main/productStock/ReworkRecord'}); |
| | | return; |
| | | break; |
| | | } else { |
| | | ElMessage.warning("未选中数据") |
| | | return |
| | | } |
| | | |
| | | const operatetype = operateType._rawValue |
| | | if(operatetype === null || operatetype === undefined || operatetype === ''){ |
| | | ElMessage.warning("请选择返工类型") |
| | | return |
| | | } |
| | | |
| | | let flowData = ref({ |
| | | |
| | | userId: userid, |
| | | userName: username, |
| | | operateType: operateType, |
| | | remarks: remarks, |
| | | orderDetail: selectRecords |
| | | |
| | | }) |
| | | request.post("/FinishedGoodsInventory/updateFinishedGoodsInventoryRework", flowData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | location.reload(); |
| | | ElMessage.success("返工成功") |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | |
| | | |
| | | |
| | | return |
| | | } |
| | | case 'rework':{ |
| | | router.push({path: '/main/productStock/FinishedProductRework'}); |
| | | return; |
| | | break; |
| | | router.push({path: '/main/productStock/TakeOutRecord'}); |
| | | |
| | | 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 filterData = ref({ |
| | | finishedGoodsInventory:{ |
| | | orderNumber:'', |
| | | orderId:'', |
| | | quantityAvailable:'', |
| | | actualSignalArea:'', |
| | | area:'', |
| | | storageRegion:'' |
| | | }, |
| | | order:{ |
| | | project:'', |
| | | customerId:'', |
| | | customerName:'' |
| | | |
| | | } |
| | | }) |
| | | |
| | | let takeOut = ref(null) |
| | | //第一次调用 |
| | | request.post("/FinishedGoodsInventory/getSelectAllocate/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | console.log(res.data) |
| | | pageTotal.value=res.data.total |
| | | takeOut.value=res.data.types |
| | | |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | |
| | | |
| | | //定义页面总页数 |
| | | let pageTotal=ref('') |
| | | //定义当前页数 |
| | | let pageNum=$ref(1) |
| | | let pageState = null |
| | | |
| | | /*使用筛选,后端获取数据*/ |
| | | const changeFilterEvent = (event, option, $panel,) => { |
| | | // 手动触发筛选 |
| | | $panel.changeOption(event, !!option.data, option) |
| | | } |
| | | function filterChanged(column){ |
| | | gridOptions.loading=true |
| | | //筛选条件发生变化条件发生变化 |
| | | let value = column.datas[0]!=undefined?column.datas[0]:'' |
| | | value = value.trim() |
| | | //判断是否存在外键 |
| | | if (column.property.indexOf('.')>-1){ |
| | | const columnArr = column.property.split('.') |
| | | filterData.value[columnArr[0]] = { |
| | | [columnArr[1]]:value |
| | | } |
| | | }else{ |
| | | filterData.value[column.property] = value |
| | | } |
| | | request.post("/FinishedGoodsInventory/getSelectAllocate/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | console.log(res.data) |
| | | pageTotal.value=res.data.total |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: '50'}, |
| | | { type: 'checkbox',fixed:"left", title: '选择', width: '80' }, |
| | | // { type: 'seq',fixed:"left", title: '自序', width: '80' }, |
| | | // {title: '操作', width: '220', slots: { default: 'button_slot' },fixed:"left"}, |
| | | {field: 'SalesOrderNumber', width: '150',title: '销售单号', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'ProjectName', width: '120',title: '项目名称', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'ProcessCardNumber',width: '100', title: '流程卡号', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: 'FinishedProductNumber', width: '100',title: '成品编号', sortable: true}, |
| | | {field: 'Quantity',width: '140', title: '数量', sortable: true}, |
| | | {field: 'ReworkQuantity',width: '140', title: '返工数量',editRender: { name: 'input', attrs: { placeholder: '' } }, sortable: true}, |
| | | {field: 'ProductNumber',width: '100', title: '产品编号', sortable: true}, |
| | | {field: 'CustomerNumber', width: '100',title: '客户编号', sortable: true}, |
| | | {field: 'CustomerName',width: '100', title: '客户名称', sortable: true}, |
| | | {field: 'Length', width: '100',title: '长度', sortable: true}, |
| | | {field: 'Width',width: '100', title: '宽度', sortable: true}, |
| | | {field: 'Thickness', width: '100',title: '厚度', sortable: true}, |
| | | {field: 'SingleArea',width: '140', title: '单片面积', sortable: true}, |
| | | {field: 'TotalArea',width: '100', title: '总面积', sortable: true}, |
| | | {field: 'StorageArea',width: '100', title: '库区', sortable: true}, |
| | | {field: 'Location',width: '100', title: '库位', sortable: true}, |
| | | { type: 'seq',fixed:"left", title: '自序', width: '80' }, |
| | | {field: 'finishedGoodsInventory.orderId', width: '150',title: '销售单号',showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.project', width: '150',title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'productId',width: '150', title: '产品编号', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'productName', width: '150',title: '产品名称', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'finishedGoodsInventory.quantityAvailable',width: '140', title: '数量', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'quantity',width: '140', title: '返工数量',editRender: { name: 'input', attrs: { placeholder: '' } }}, |
| | | {field: 'order.customerId', width: '100',title: '客户编号', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.customerName',width: '150', title: '客户名称', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'width', width: '100',title: '长度', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'height',width: '100', title: '宽度', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'finishedGoodsInventory.actualSignalArea',width: '140', title: '单片面积', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'finishedGoodsInventory.area',width: '150', title: '总面积', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'finishedGoodsInventory.storageRegion',width: '100', title: '库存区域', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | ],//表头按钮 |
| | | toolbarConfig: { |
| | | buttons: [{ |
| | |
| | | }, |
| | | { |
| | | 'name': '返工记录', |
| | | 'code':'record' |
| | | 'code':'rework' |
| | | }], |
| | | import: false, |
| | | export: true, |
| | |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | "SalesOrderNumber": "NG23072003", |
| | | "ProjectName": "钢化玻璃", |
| | | "ProcessCardNumber": "NG23072003A01", |
| | | 'FinishedProductNumber':'', |
| | | 'FinishedProductName':'', |
| | | 'BoxNumber':'', |
| | | "CustomerNumber": "KD0071", |
| | | "CustomerName": "件", |
| | | "Length": "1075.00", |
| | | "Width": "440.00", |
| | | "Thickness": "3.00", |
| | | "Quantity": "360", |
| | | "SingleArea": "0.473000", |
| | | "TotalArea": "170.28", |
| | | "StorageArea": "0.47", |
| | | "Location": "170.28", |
| | | },{ |
| | | "SalesOrderNumber": "NG23072003", |
| | | "ProjectName": "钢化玻璃", |
| | | "ProcessCardNumber": "NG23072003A01", |
| | | 'FinishedProductNumber':'', |
| | | 'FinishedProductName':'', |
| | | 'BoxNumber':'', |
| | | "CustomerNumber": "KD0071", |
| | | "CustomerName": "件", |
| | | "Length": "1075.00", |
| | | "Width": "440.00", |
| | | "Thickness": "3.00", |
| | | "Quantity": "360", |
| | | "SingleArea": "0.473000", |
| | | "TotalArea": "170.28", |
| | | "StorageArea": "0.47", |
| | | "Location": "170.28", |
| | | },{ |
| | | "SalesOrderNumber": "NG23072003", |
| | | "ProjectName": "钢化玻璃", |
| | | "ProcessCardNumber": "NG23072003A01", |
| | | 'FinishedProductNumber':'', |
| | | 'FinishedProductName':'', |
| | | 'BoxNumber':'', |
| | | "CustomerNumber": "KD0071", |
| | | "CustomerName": "件", |
| | | "Length": "1075.00", |
| | | "Width": "440.00", |
| | | "Thickness": "3.00", |
| | | "Quantity": "360", |
| | | "SingleArea": "0.473000", |
| | | "TotalArea": "170.28", |
| | | "StorageArea": "0.47", |
| | | "Location": "170.28", |
| | | }, |
| | | |
| | | ],//table body实际数据 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | | return `页数:${pageNum}/${pageTotal.value}` |
| | | } |
| | | // if (props.tableProp.footList.includes(column.field)) { |
| | | // return sumNum(data, column.field) |
| | |
| | | |
| | | }) |
| | | |
| | | /*数据校验*/ |
| | | const validRules = ref({ |
| | | quantity: [ |
| | | { required: true, message: '请输入领取数量' } |
| | | ] |
| | | }) |
| | | |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div class="main-div-customer"> |
| | | <vxe-select v-model="operateType" placeholder="请选择返工类型"> |
| | | <vxe-option v-for="(item,index) in takeOut" :key="index" :value="item.operateTypeName" :label="item.operateTypeName" ></vxe-option> |
| | | </vxe-select> |
| | | |
| | | <vxe-input v-model="remarks" placeholder="备注"></vxe-input> |
| | | |
| | | <vxe-grid |
| | | max-height="100%" |
| | | @filter-change="filterChanged" |
| | |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | :edit-rules="validRules" |
| | | > |
| | | <!-- @toolbar-button-click="toolbarButtonClickEvent"--> |
| | | <!-- 下拉显示所有信息插槽--> |
| | |
| | | <ul class="expand-wrapper"> |
| | | <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined "> |
| | | <span style="font-weight: bold">{{item.title+': '}}</span> |
| | | <span>{{ row[item.field] }}</span> |
| | | <span v-if="hasDecimal(item.field)">{{ hasDecimalhtml(item.field,row) }}</span> |
| | | <span v-else>{{ row[item.field] }}</span> |
| | | </li> |
| | | </ul> |
| | | </template> |
| | |
| | | |
| | | const xGrid = ref(); |
| | | const gridEvents = { |
| | | toolbarButtonClick({ code }) { |
| | | async toolbarButtonClick({code}) { |
| | | const $grid = xGrid.value |
| | | if($grid){ |
| | | switch (code){ |
| | | case 'edit':{ |
| | | const $table = xGrid.value |
| | | if ($table) { |
| | | const selectRecords = $table.getCheckboxRecords() |
| | | |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | console.log(selectRecords) |
| | | |
| | | if (selectRecords.length > 0) { |
| | | const errMap = await $grid.validate(selectRecords) |
| | | console.log(errMap) |
| | | if (errMap) { |
| | | ElMessage.warning("数据校验失败") |
| | | return |
| | | } |
| | | } else { |
| | | ElMessage.warning("未选中数据") |
| | | return |
| | | } |
| | | |
| | | let flowData = ref({ |
| | | |
| | |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | } |
| | | |
| | | return; |
| | | } |
| | | case 'record':{ |
| | |
| | | } |
| | | } |
| | | |
| | | /*数据校验*/ |
| | | const validRules = ref({ |
| | | orderId: [ |
| | | { required: true, message: '请输入调拨的订单号' } |
| | | ], |
| | | orderNumber: [ |
| | | { required: true, message: '请输入调拨的订单序号' } |
| | | ], |
| | | quantity: [ |
| | | { required: true, message: '请输入调拨的数量' } |
| | | ] |
| | | }) |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | :edit-rules="validRules" |
| | | > |
| | | <!-- @toolbar-button-click="toolbarButtonClickEvent"--> |
| | | <!-- 下拉显示所有信息插槽--> |
| | |
| | | buttons: [{ |
| | | 'name': '审核',status: 'primary', |
| | | 'code':'add' |
| | | }, |
| | | { |
| | | 'name': '反审',status: 'primary', |
| | | 'code':'rework' |
| | | }], |
| | | import: false, |
| | | export: true, |
| | |
| | | if ($table) { |
| | | const selectRecords = $table.getCheckboxRecords() |
| | | console.log(selectRecords) |
| | | |
| | | let flowData = ref({ |
| | | |
| | | userId:userid, |
| | | userName:username, |
| | | orderDetail:selectRecords |
| | | |
| | | }) |
| | | request.post("/FinishedGoodsInventory/updateFinishedGoodsInventoryToExamine",flowData.value).then((res) => { |
| | | if(res.code==200){ |
| | | ElMessage.success("审核成功") |
| | | location.reload(); |
| | | |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | } |
| | | return; |
| | | |
| | | } |
| | | case 'rework': { |
| | | router.push({path: '/main/productStock/TransferRecord'}); |
| | | return |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | <!-- 调拨记录 --> |
| | | <!-- 领出记录 --> |
| | | <script setup> |
| | | |
| | | import {reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | import request from "@/utils/request" |
| | | import deepClone from "@/utils/deepClone" |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | import {ElMessage} from "element-plus"; |
| | | |
| | | const userStore = useUserInfoStore() |
| | | const username = userStore.user.userName |
| | | const userid = userStore.user.userId |
| | | let router=useRouter() |
| | | let produceList = ref([]) |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/trader/CreateTrader', query: { id: row.id }}) |
| | | case 'add' :{ |
| | | alert('我接收到子组件传送的编辑信息') |
| | | break |
| | | } |
| | | case 'delete':{ |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | const hasDecimal=(value)=>{ |
| | | const regex=/\./ // 定义正则表达式,查找小数点 |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | //筛选条件,有外键需要先定义明细里面的数据 |
| | | let filterData = ref({ |
| | | orderDetail:{ |
| | | productName:'', |
| | | productId:'', |
| | | width:'', |
| | | height:'' |
| | | }, |
| | | getDate:{ |
| | | startDate:'', |
| | | stopDate:'' |
| | | height:'', |
| | | productId:'', |
| | | productName:'' |
| | | |
| | | } |
| | | |
| | | }) |
| | | |
| | | |
| | | //第一次调用 |
| | | request.post("/FinishedGoodsInventory/getselectAllocateFinishedOperateLog/1/100",filterData.value).then((res) => { |
| | | request.post("/FinishedGoodsInventory/getSelectOperateRecord/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | console.log(res.data) |
| | | pageTotal.value=res.data.total |
| | | |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | |
| | | } |
| | | }) |
| | | |
| | | const selectedDate = ref(); |
| | | const xGrid = ref(); |
| | | |
| | | //定义页面总页数 |
| | | let pageTotal=ref('') |
| | | //定义当前页数 |
| | |
| | | }else{ |
| | | filterData.value[column.property] = value |
| | | } |
| | | request.post("/FinishedGoodsInventory/getselectAllocateFinishedOperateLog/1/100",filterData.value).then((res) => { |
| | | request.post("/FinishedGoodsInventory/getSelectOperateRecord/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | console.log(res.data) |
| | |
| | | } |
| | | }) |
| | | } |
| | | const a = {field:"status", title: '选择', width: '80',slots: { default: 'state' } } |
| | | |
| | | |
| | | |
| | | |
| | | //子组件接收参数 |
| | | const xGrid = ref(); |
| | | |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: '50'}, |
| | | |
| | | {type: 'checkbox',fixed:"left", title: '选择', width: '80' }, |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: '80'}, |
| | | { type: 'seq',fixed:"left", title: '自序', width: '80' }, |
| | | {field: 'operationOrderNumber', width: '150',title: '新订单号',showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderId', width: '150',title: '原订单号',showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'operationNumber', width: '100',title: '原序号', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'staterOperationOrderNumber', width: '150',title: '新订单号', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'endOperationOrderNumber', width: '100',title: '新序号', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'quantity', width: '120',title: '调拨数量', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'operator', width: '120',title: '制单人', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'status', width: '120',title: '单据状态',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'operationOrderNumber', width:'150', title: '操作单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderId', width: '150',title: '销售单号',showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'operationNumber', width: '100',title: '序号', showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'quantity', width: '140',title: '领出/返工数量',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderDetail.productId',width: '100', title: '产品编号', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderDetail.productName',width: '100', title: '产品名称', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderDetail.productName',width: '140', title: '产品名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderDetail.width', width: '100',title: '宽度', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderDetail.height',width: '100', title: '高度', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'operateTime', width: '100',title: '制单日期', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'operator', width: '100',title: '制单人',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'operateTime', width:'140', title: '制单日期',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'reviewed', width: '100',title: '审核人',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'reviewedTime', width: '140',title: '审核日期',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'remarks', width: '140',title: '备注',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | ],//表头按钮 |
| | | toolbarConfig: { |
| | | // buttons: [{ |
| | | // 'name': '新增' |
| | | // }], |
| | | buttons: [{ |
| | | 'name': '反审',status: 'primary', |
| | | 'code':'add' |
| | | }], |
| | | import: false, |
| | | export: true, |
| | | print: true, |
| | |
| | | } |
| | | |
| | | }) |
| | | let date; |
| | | const getDate = () => { |
| | | let filterData = ref({ |
| | | orderDetail:{ |
| | | productName:'', |
| | | productId:'', |
| | | width:'', |
| | | height:'' |
| | | }, |
| | | getDate:{ |
| | | startDate:date[0], |
| | | stopDate:date[1], |
| | | } |
| | | |
| | | const gridEvents = { |
| | | toolbarButtonClick ({ code }) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | | switch (code) { |
| | | case 'add': { |
| | | const $table = xGrid.value |
| | | //gridOptions.columns.unshift(a) |
| | | if ($table) { |
| | | const selectRecords = $table.getCheckboxRecords() |
| | | console.log(selectRecords) |
| | | |
| | | let flowData = ref({ |
| | | |
| | | userId:userid, |
| | | userName:username, |
| | | orderDetail:selectRecords |
| | | |
| | | }) |
| | | |
| | | request.post("/FinishedGoodsInventory/getselectAllocateFinishedOperateLog/1/100",filterData.value).then((res) => { |
| | | |
| | | request.post("/FinishedGoodsInventory/updateFinishedGoodsInventoryCounterexamination",flowData.value).then((res) => { |
| | | if(res.code==200){ |
| | | console.log(res.data) |
| | | pageTotal.value=res.data.total |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | ElMessage.success("反审成功") |
| | | location.reload(); |
| | | |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | } |
| | | return; |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | } |
| | | |
| | | const checkBoxConfig = { |
| | | checkMethod: ({ row }) => { |
| | | if (row['status']==='已审核'||row['status']==='未通过'){ |
| | | return !row.disable |
| | | }else{ |
| | | return row.disable |
| | | } |
| | | |
| | | }, |
| | | reserve:true |
| | | } |
| | | |
| | | |
| | | |
| | | </script> |
| | |
| | | <el-col :span="2.5"> |
| | | <div class="label-text">制单日期范围</div> |
| | | </el-col> |
| | | <el-col :span="3"> |
| | | <el-col :span="4"> |
| | | <el-date-picker |
| | | v-model="selectedDate" |
| | | type="daterange" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | |
| | | /> |
| | | </el-col> |
| | | <el-col span="4"> |
| | | <el-button id="searchButton" type="primary" @click="getDate" :icon="Search">查询</el-button> |
| | | <el-button id="searchButton" type="primary" :icon="Search">查询</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | :checkbox-config="checkBoxConfig" |
| | | |
| | | > |
| | | |
| | | <!-- <template #state="{ row,column}"> |
| | | <!– <p>{{row[column.field]}}</p>–> |
| | | <!– <el-checkbox v-model="row['isState']" :disabled="row[column.field]==='已审核'||row[column.field]==='未通过'"/>–> |
| | | <vxe-checkbox v-model="row['isState']" :disabled="row[column.field]==='已审核'||row[column.field]==='未通过'"></vxe-checkbox> |
| | | </template>--> |
| | | |
| | | |
| | | <!-- @toolbar-button-click="toolbarButtonClickEvent"--> |
| | | <!-- 下拉显示所有信息插槽--> |
| | | <template #content="{ row }"> |
| | |
| | | <script setup> |
| | | |
| | | import {reactive} from "vue"; |
| | | 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"; |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | const userStore = useUserInfoStore() |
| | | const username = userStore.user.userName |
| | | const userid = userStore.user.userId |
| | | let produceList = 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]] |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | let unpaidQuantity = ref({}) |
| | | |
| | | // 定义表头上传数据 |
| | | let titleUploadData = ref({ |
| | | customerId:'', |
| | | customerName:'', |
| | | project:'', |
| | | money:'', |
| | | payMethod:'', |
| | | payDate:'', |
| | | contacts:'', |
| | | contactNumber:'', |
| | | deliveryAddress:'', |
| | | remarks:'', |
| | | createTime:'', |
| | | deliveryDate:'', |
| | | salesmanId:'', |
| | | salesman:'', |
| | | creatorId:userStore.user.userid, |
| | | creator:userStore.user.userName |
| | | }) |
| | | |
| | | |
| | | |
| | | //筛选条件,有外键需要先定义明细里面的数据 |
| | | let filterData = ref({ |
| | | deliveryDetail:{ |
| | | deliveryId:'', |
| | | quantity:'', |
| | | money:'', |
| | | deliveryDetailRemakes:'' |
| | | }, |
| | | order:{ |
| | | batch:'' |
| | | }, |
| | | delivery:{ |
| | | customerId:'', |
| | | customerName:'', |
| | | money:'', |
| | | payMethod:'', |
| | | payDate:'', |
| | | contacts:'', |
| | | contactNumber:'', |
| | | deliveryAddress:'', |
| | | remarks:'', |
| | | createTime:'', |
| | | deliveryDate:'', |
| | | creator:'' |
| | | }, |
| | | finishedGoodsInventory:{ |
| | | quantityAvailable:'', |
| | | storageRegion:'', |
| | | actualSignalArea:'' |
| | | |
| | | }, |
| | | |
| | | }) |
| | | |
| | | |
| | | const xGrid = ref(); |
| | | |
| | | onMounted(()=>{ |
| | | const orderId = route.query.orderId |
| | | if (typeof orderId !== 'undefined' && orderId !== null && orderId !== '' && orderId !== '\n' && orderId !== '\r'){ |
| | | filterData.value.orderId=orderId |
| | | //第一次调用 |
| | | request.post("/Delivery/getseletShippingOrderDetails/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | console.log(res.data.title) |
| | | pageTotal.value=res.data.total |
| | | |
| | | |
| | | titleUploadData.value=deepClone(res.data.title) |
| | | const today = new Date |
| | | today.setTime(today.getTime() + (15 * 24 * 60 * 60 * 1000)) |
| | | 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) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const str = route.query.deliveryID |
| | | |
| | | if (typeof str != 'undefined' && str != null && str !== '' && str !== '\n' && str !== '\r'){ |
| | | filterData.value.deliveryDetail.deliveryId=str |
| | | console.log(filterData) |
| | | //第一次调用 |
| | | request.post("/Delivery/getseletShippingOrderDetail/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | console.log(res.data.data) |
| | | pageTotal.value=res.data.total |
| | | titleUploadData.value=deepClone(res.data.delivery) |
| | | console.log(titleUploadData.value) |
| | | console.log(titleUploadData.value.customerId) |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | }) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //定义页面总页数 |
| | | let pageTotal=ref('') |
| | | //定义当前页数 |
| | | let pageNum=$ref(1) |
| | | |
| | | |
| | | |
| | | |
| | |
| | | },//表头参数 |
| | | columns:[ |
| | | |
| | | {type:'expand',slots: { content:'content' },width: 50,fixed:"left"}, |
| | | {type:'checkbox',title: '选则', width: 80,fixed:"left"}, |
| | | {type:'expand',slots: { content:'content' },width: 60,fixed:"left"}, |
| | | {type:'checkbox',title: '选择', width: 80,fixed:"left"}, |
| | | {type: 'seq', title: '自序', width: 80 ,fixed:"left"}, |
| | | {field: '0',width:120, title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '1',width:120, title: '批次',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '2',width:120, title: '库存可发',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '3',width:120, title: '未发数量',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '4',width:120, title: '总数量',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '5',width:120, title: '发货数量',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '6',width:120, title: '楼号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '7',width:120, title: '产品编号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '8',width:120, title: '产品名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '9',width:120, title: '单价',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '10',width:120, title: '库区',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '11',width:120, title: '金额',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '12',width:120, title: '宽',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '13',width:120, title: '高',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '14',width:120, title: '形状',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '15',width:120, title: '单片面积',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '16',width:120, title: '总面积',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '17',width:120, title: '结算单片面积',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '18',width:120, title: '结算总面积',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '19',width:120, title: '加工要求',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '20',width:120, title: '备注',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '21',width:120, title: '磨边类型',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '22',width:120, title: '周长',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'orderId',width:120, title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'order.batch',width:120, title: '批次',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'finishedGoodsInventory.quantityAvailable',width:120, title: '库存可发',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'order.quantity',width:120, title: '未发数量',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'quantity',width:120, title: '总数量',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'deliveryDetail.quantity',width:120, title: '发货数量',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'buildingNumber',width:120, title: '楼号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'productId',width:120, title: '产品编号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'productName',width:120, title: '产品名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'price',width:120, title: '单价',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'finishedGoodsInventory.storageRegion',width:120, title: '库区',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'deliveryDetail.money',width:120, title: '金额',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'width',width:120, title: '宽',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'height',width:120, title: '高',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'shape',width:120, title: '形状',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'finishedGoodsInventory.actualSignalArea',width:120, title: '单片面积',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'grossArea',width:120, title: '总面积',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'computeArea',width:120, title: '结算单片面积',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'computeGrossArea',width:120, title: '结算总面积',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'processingNote',width:120, title: '加工要求',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'deliveryDetail.deliveryDetailRemakes',width:120, title: '备注',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'edgingType',width:120, title: '磨边类型',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'perimeter',width:120, title: '周长',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | |
| | | |
| | | ],//表头按钮 |
| | |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | '0': 'NG23110102', |
| | | '1': '20批1', |
| | | '2': '16', |
| | | '3': '18', |
| | | '4': '20', |
| | | '5': '20', |
| | | '6': 'A楼b层', |
| | | '7': '101', |
| | | '8': '10mmLYTM-140弯钢化', |
| | | '9': '1008.38', |
| | | '10': 'A号柱子', |
| | | '11': '100', |
| | | '12': '3360', |
| | | '13': '2440', |
| | | '14': '普形', |
| | | '15': '1.11', |
| | | '16': '100.1', |
| | | '17': '1.22', |
| | | '18': '11.11', |
| | | '19': '这是加工要求', |
| | | '20': '这是备注', |
| | | '21': '这是磨边类型', |
| | | '22': '1.1' |
| | | }, |
| | | { |
| | | '0': 'NG23110102', |
| | | '1': '20批1', |
| | | '2': '16', |
| | | '3': '18', |
| | | '4': '20', |
| | | '5': '20', |
| | | '6': 'A楼b层', |
| | | '7': '101', |
| | | '8': '10mmLYTM-140弯钢化', |
| | | '9': '1008.38', |
| | | '10': 'A号柱子', |
| | | '11': '100', |
| | | '12': '3360', |
| | | '13': '2440', |
| | | '14': '普形', |
| | | '15': '1.11', |
| | | '16': '100.1', |
| | | '17': '1.22', |
| | | '18': '11.11', |
| | | '19': '这是加工要求', |
| | | '20': '这是备注', |
| | | '21': '这是磨边类型', |
| | | '22': '1.1' |
| | | } |
| | | ],//table body实际数据 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | | return `页数:${pageNum}/${pageTotal.value}` |
| | | } |
| | | // if (props.tableProp.footList.includes(column.field)) { |
| | | // return sumNum(data, column.field) |
| | |
| | | } |
| | | |
| | | }) |
| | | |
| | | const gridEvents = { |
| | | toolbarButtonClick ({ code }) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | | switch (code) { |
| | | case 'add': { |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | console.log(selectRecords) |
| | | |
| | | if (selectRecords.length === 0) { |
| | | ElMessage.warning("未选中数据") |
| | | return |
| | | } |
| | | let flowData = ref({ |
| | | delivery:selectRecords, |
| | | title:titleUploadData.value |
| | | |
| | | }) |
| | | console.log(flowData) |
| | | request.post("/Delivery/insertDelivery", flowData.value).then((res) => { |
| | | if(res.code==200){ |
| | | ElMessage.success("发货单提交成功") |
| | | router.push({path: '/main/delivery/selectDelivery', query: { id: 1 }}) |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | break |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | <div class="order-primary" style="background-color: white"> |
| | | <el-row> |
| | | <el-col :span="2"><el-text>客户编码:</el-text></el-col> |
| | | <el-col :span="5"><el-text style="font-size: large;color: #181818">131</el-text></el-col> |
| | | <el-col :span="5"><el-input style="font-size: large;color: #181818" v-model="titleUploadData.customerId" ></el-input></el-col> |
| | | <el-col :span="2"><el-text>客户名称:</el-text></el-col> |
| | | <el-col :span="5"><el-text></el-text></el-col> |
| | | <el-col :span="5"><el-input v-model="titleUploadData.customerName"></el-input></el-col> |
| | | <el-col :span="2"><el-text>项目名称:</el-text></el-col> |
| | | <el-col :span="5"><el-text></el-text></el-col> |
| | | <el-col :span="5"><el-input v-model="titleUploadData.project"></el-input></el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="2"><el-text>付款条件:</el-text></el-col> |
| | |
| | | </el-select> |
| | | </el-col> |
| | | <el-col :span="2"><el-text>收款方式:</el-text></el-col> |
| | | <el-col :span="5"></el-col> |
| | | <el-col :span="5"><el-input v-model="titleUploadData.payMethod"></el-input></el-col> |
| | | <el-col :span="2"><el-text>收款日期:</el-text></el-col> |
| | | <el-col :span="5"> |
| | | <el-date-picker |
| | | type="week" |
| | | format="[Week] ww" |
| | | v-model="titleUploadData.payDate" |
| | | type="date" |
| | | placeholder="选择日期"/> |
| | | </el-col> |
| | | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="2"><el-text>联系人:</el-text></el-col> |
| | | <el-col :span="5"><el-input/></el-col> |
| | | <el-col :span="5"><el-input v-model="titleUploadData.contacts"/></el-col> |
| | | <el-col :span="2"><el-text>联系电话:</el-text></el-col> |
| | | <el-col :span="5"><el-input/></el-col> |
| | | <el-col :span="5"><el-input v-model="titleUploadData.contactNumber"/></el-col> |
| | | <el-col :span="2"><el-text>送货地址:</el-text></el-col> |
| | | <el-col :span="5"><el-input/></el-col> |
| | | <el-col :span="5"><el-input v-model="titleUploadData.deliveryAddress"/></el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="2"><el-text>备注:</el-text></el-col> |
| | | <el-col :span="5"><el-input/></el-col> |
| | | <el-col :span="5"><el-input v-model="titleUploadData.remarks"/></el-col> |
| | | <el-col :span="2"><el-text>报表日期:</el-text></el-col> |
| | | <el-col :span="5"></el-col> |
| | | <el-col :span="5"><el-input v-model="titleUploadData.createTime"></el-input></el-col> |
| | | <el-col :span="2"><el-text>发货报表日期:</el-text></el-col> |
| | | <el-col :span="5"> |
| | | <el-date-picker |
| | | type="week" |
| | | format="[Week] ww" |
| | | v-model="titleUploadData.deliveryDate" |
| | | type="date" |
| | | placeholder="选择日期"/> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="2"><el-text>业务员:</el-text></el-col> |
| | | <el-col :span="5"><el-text style="font-size: large;color: #181818"></el-text></el-col> |
| | | <el-col :span="5"><el-input v-model="titleUploadData.salesman"/></el-col> |
| | | <el-col :span="2"><el-text>发货员:</el-text></el-col> |
| | | <el-col :span="5"><el-text style="font-size: large;color: #181818"></el-text></el-col> |
| | | <el-col :span="5"><el-input v-model="titleUploadData.creator"/></el-col> |
| | | </el-row> |
| | | </div> |
| | | <div class="order-detail"> |
| | |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | |
| | | > |
| | | <template #num1_filter="{ column, $panel }"> |
| | |
| | | <script setup> |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {reactive} from "vue"; |
| | | import {reactive, ref} from "vue"; |
| | | import {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"; |
| | | const router = useRouter() |
| | | const userStore = useUserInfoStore() |
| | | const username = userStore.user.userName |
| | | const userid = userStore.user.userId |
| | | let produceList = ref([]) |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/delivery/createDelivery', query: { deliveryID: 'JG24010101' }}) |
| | | console.log(row) |
| | | router.push({path: '/main/delivery/createDelivery', query: { deliveryID: row.deliveryId }}) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | |
| | | break |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | const hasDecimal=(value)=>{ |
| | | const regex=/\./ // 定义正则表达式,查找小数点 |
| | | return regex.test(value) //返回true/false |
| | | } |
| | | |
| | | const hasDecimalhtml=(item,row)=>{ |
| | | let aa=item.split('.').length |
| | | if (aa===2){ |
| | | return row[item.split('.')[0]][item.split('.')[1]] |
| | | }else if(aa===3){ |
| | | return row[item.split('.')[0]][item.split('.')[1]][item.split('.')[2]] |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | //筛选条件,有外键需要先定义明细里面的数据 |
| | | let filterData = ref({}) |
| | | |
| | | const xGrid = ref(); |
| | | |
| | | //第一次调用 |
| | | request.post("/Delivery/getseletShippingOrder/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | console.log(res.data) |
| | | pageTotal.value=res.data.total |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | |
| | | |
| | | //定义页面总页数 |
| | | let pageTotal=ref('') |
| | | //定义当前页数 |
| | | let pageNum=$ref(1) |
| | | |
| | | /*使用筛选,后端获取数据*/ |
| | | const changeFilterEvent = (event, option, $panel,) => { |
| | | // 手动触发筛选 |
| | | $panel.changeOption(event, !!option.data, option) |
| | | } |
| | | function filterChanged(column){ |
| | | gridOptions.loading=true |
| | | //筛选条件发生变化条件发生变化 |
| | | let value = column.datas[0]!=undefined?column.datas[0]:'' |
| | | value = value.trim() |
| | | //判断是否存在外键 |
| | | if (column.property.indexOf('.')>-1){ |
| | | const columnArr = column.property.split('.') |
| | | filterData.value[columnArr[0]] = { |
| | | [columnArr[1]]:value |
| | | } |
| | | }else{ |
| | | filterData.value[column.property] = value |
| | | } |
| | | request.post("/Delivery/getseletShippingOrder/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | console.log(res.data) |
| | | pageTotal.value=res.data.total |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const gridOptions = reactive({ |
| | |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns:[ |
| | | {type:'expand',slots: { content:'content' },width: 50}, |
| | | {type:'expand',slots: { content:'content' },width: 60}, |
| | | {title: '操作', width: 110, slots: { default: 'button_slot' }}, |
| | | {type: 'seq', title: '自序', width: 80 }, |
| | | |
| | | {title: '审核', width: 40, slots: { default: 'state' }}, |
| | | {title: '出库', width: 40, slots: { default: 'state' }}, |
| | | {field: '3',width:120, title: '发货单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '4',width:120, title: '发货员',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '5',width:120, title: '发货日期',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '6',width:120, title: '客户编号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '7',width:120, title: '客户名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '8',width:120, title: '批次',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '9',width:120, title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '10',width:120, title: '订单编号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '11',width:120, title: '付款条件',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '12',width:120, title: '付款方式',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '13',width:120, title: '总数量',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '14',width:120, title: '总面积',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true} |
| | | {field: 'deliveryState',title: '审核', width: 40, slots: { default: 'state' }}, |
| | | {field: 'stockState',title: '出库', width: 40, slots: { default: 'state' }}, |
| | | |
| | | {field: 'deliveryId',width:120, title: '发货单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'creator',width:120, title: '发货员',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'deliveryDate',width:120, title: '发货日期',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'customerId',width:120, title: '客户编号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'customerName',width:120, title: '客户名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'project',width:120, title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'orderId',width:120, title: '订单编号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | //{field: '11',width:120, title: '付款条件',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'payMethod',width:120, title: '付款方式',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'quantity',width:120, title: '总数量',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'area',width:120, title: '总面积',filters:[{ data: '' }],slots: { filter: 'num1_filter' }} |
| | | |
| | | |
| | | ],//表头按钮 |
| | |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [{ |
| | | '3': 'JG23120801', |
| | | '4': '郑珊珊', |
| | | '5': '2023-12-08', |
| | | '6': '310', |
| | | '7': '上海里诺建筑工程有限公司', |
| | | '8': '补1-2', |
| | | '9': '宿迁某某项目', |
| | | '10': 'NG23112304', |
| | | '11': '按合同', |
| | | '12': '', |
| | | '13': '8', |
| | | '14': '15.68', |
| | | '15': '11912.05', |
| | | '16': '2023-11-24', |
| | | '17': '王龙', |
| | | '18': '宿迁某某地址', |
| | | '19': '2023-12-08' |
| | | } |
| | | ],//table body实际数据 |
| | | |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | | return `页数:${pageNum}/${pageTotal.value}` |
| | | } |
| | | // if (props.tableProp.footList.includes(column.field)) { |
| | | // return sumNum(data, column.field) |
| | |
| | | <el-button style="margin-top: -5px" id="searchButton" type="primary" :icon="Search">查询</el-button> |
| | | <vxe-grid |
| | | max-height="97%" |
| | | @filter-change="filterChanged" |
| | | @cell-dblclick="cellClickEvent" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | |
| | | <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>{{ row[item.field] }}</span> |
| | | <span v-if="hasDecimal(item.field)">{{ hasDecimalhtml(item.field,row) }}</span> |
| | | <span v-else>{{ row[item.field] }}</span> |
| | | </li> |
| | | </ul> |
| | | </template> |
| | | |
| | | <template #state="{ row}"> |
| | | <el-checkbox checked/> |
| | | <template #state="{ row,column}"> |
| | | <el-checkbox @click.native.prevent :checked="row[column.field]===1"/> |
| | | </template> |
| | | |
| | | |
| | | |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">编辑</el-button> |
New file |
| | |
| | | |
| | | |
| | | <script lang="ts" setup> |
| | | import {onMounted, reactive, ref, watch} from "vue" |
| | | import {useRouter,useRoute} from "vue-router" |
| | | import * as XLXS from "xlsx" |
| | | import {ElMessage} from "element-plus" |
| | | import request from "@/utils/request" |
| | | import deepClone from "@/utils/deepClone" |
| | | import useUserInfoStore from '@/stores/userInfo' |
| | | let dialogTableVisible = ref(false) |
| | | const userStore = useUserInfoStore() |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | const xGrid = ref() |
| | | // 定义表头上传数据 |
| | | const titleUploadData = ref({ |
| | | project:'', |
| | | orderType:'', |
| | | customerId:'', |
| | | customerName:'', |
| | | icon:'', |
| | | orderClassify:'', |
| | | packType:'', |
| | | orderId:'', |
| | | deliveryDate:'', |
| | | batch:'', |
| | | calculateType:'', |
| | | salesmanId:'', |
| | | salesman:'', |
| | | alType:'', |
| | | money:'', |
| | | contractId:'', |
| | | customerBatch:'', |
| | | contacts:'', |
| | | contactNumber:'', |
| | | deliveryAddress:'', |
| | | otherMoney:'', |
| | | otherMoneyRemarks:'', |
| | | processingNote:'', |
| | | createOrder:0, |
| | | creatorId:userStore.user.userName, |
| | | creator:userStore.user.userId, |
| | | }) |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | | orderType:[], |
| | | alType:[], |
| | | icon:[], |
| | | orderClassify:[], |
| | | packType:[], |
| | | customer:[], |
| | | saleMan:[] |
| | | }) |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮 |
| | | id: 'OrderList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | menuConfig: { |
| | | body: { |
| | | options: [ |
| | | [ |
| | | { code: 'addRow', name: '添加', prefixIcon: 'vxe-icon-square-plus', visible: true, disabled: false } |
| | | ] |
| | | ] |
| | | } |
| | | }, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | editConfig: { |
| | | trigger: 'click', |
| | | mode: 'cell', |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns:[ |
| | | // {title: '操作', width: 110,fixed:"left",slots: { default: 'openProductList' }}, |
| | | {type: 'seq',fixed:"left", title: '自序', width: 80 }, |
| | | {field: 'buildingNumber',width:120, title: '楼号',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'productId',width:140, title: '产品ID',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'productName',width:120, title: '产品',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'price',width:140, title: '单价',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'quantity',width:120, title: '数量',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'grossAmount',width:120, title: '总金额',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'width',width:120, title: '宽',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'height',width:120, title: '高',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'area',width:150, title: '实际单片面积',filters:[{ data: '' }],slots: { filter: 'num1_filter'}, sortable: true}, |
| | | {field: 'grossArea',width:140, title: '实际总面积',filters:[{ data: '' }],slots: { filter: 'num1_filter'}, sortable: true}, |
| | | {field: 'computeArea',width:180, title: '结算单片面积',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'computeGrossArea',width:140, title: '结算总面积',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'shape',width:120, title: '形状',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'bendRadius',width:140, title: '弯钢弧度',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'edgingType',width:140, title: '磨边类型',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'processingNote',width:140, title: '加工要求',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'remarks',width:120, title: '备注',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true} |
| | | |
| | | |
| | | ], |
| | | //表单验证 |
| | | editRules: { |
| | | buildingNumber: [ |
| | | { required: false}, |
| | | { min: 0, max: 255, message: '名称长度在 0 到 255 个字符' } |
| | | ], |
| | | productId: [ |
| | | { required: true, message: '请选择产品' } |
| | | ], |
| | | price: [ |
| | | { |
| | | validator ({ cellValue }) { |
| | | const regex = /^(0|[1-9][0-9]{0,4}([.][0-9]{1,2})?)$/ |
| | | if ( !regex.test(cellValue) ) { |
| | | return new Error('输入0.00~99999.99的数字') |
| | | } |
| | | } |
| | | } |
| | | ], |
| | | computeArea: [ |
| | | { |
| | | validator ({ cellValue }) { |
| | | const regex = /^(0|[1-9][0-9]{0,4}([.][0-9]{1,2})?)$/ |
| | | if (!regex.test(cellValue)) { |
| | | return new Error('输入0.00~99999.99的数字') |
| | | } |
| | | } |
| | | } |
| | | ], |
| | | quantity: [ |
| | | { type: 'number', min: 0, message: '请输入大于等于0的数值' } |
| | | ], |
| | | width:[ |
| | | { |
| | | validator ({ cellValue }) { |
| | | const regex = /^(0|[1-9][0-9]{0,4}([.][0-9]{1,2})?)$/ |
| | | if (!regex.test(cellValue)) { |
| | | return new Error('输入0.00~99999.99的数字') |
| | | } |
| | | } |
| | | } |
| | | ], |
| | | height:[ |
| | | { |
| | | validator ({ cellValue }) { |
| | | const regex = /^(0|[1-9][0-9]{0,4}([.][0-9]{1,2})?)$/ |
| | | if ( !regex.test(cellValue)) { |
| | | return new Error('输入0.00~99999.99的数字') |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }, |
| | | toolbarConfig: { |
| | | buttons: [ |
| | | {'code': 'remarks', 'name': '加工要求'}, |
| | | {'code': 'Craft', 'name': '工艺',status: 'primary',disabled: true}, |
| | | {'code': 'review', 'name': '审核',status: 'primary',disabled: true}, |
| | | {'code': 'saveOrder', 'name': '保存',status: 'primary',icon: 'vxe-icon-save'} |
| | | ], |
| | | slots: { |
| | | tools: 'toolbar_buttons' |
| | | }, |
| | | // import: false, |
| | | // export: true, |
| | | // print: true, |
| | | zoom: true, |
| | | custom: true |
| | | } |
| | | , |
| | | //table body实际数据 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | | } |
| | | // if (props.tableProp.footList.includes(column.field)) { |
| | | // return sumNum(data, column.field) |
| | | // } |
| | | return '' |
| | | }) |
| | | ] |
| | | } |
| | | |
| | | }) |
| | | const gridEvents = { |
| | | async toolbarButtonClick({code}) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | | switch (code) { |
| | | case 'remarks': { |
| | | dialogTableVisible.value=true |
| | | break |
| | | } |
| | | case 'Craft': { |
| | | await router.push({path: '/main/order/updateOrderCraft', query: {orderID: titleUploadData.value.orderId }}) |
| | | break |
| | | } |
| | | case 'review': { |
| | | reviewOrder(2) |
| | | break |
| | | } |
| | | case 'reviews': {//反审 |
| | | reviewOrder(0) |
| | | break |
| | | } |
| | | case 'saveOrder': { |
| | | if ($grid.getTableData().tableData.length === 0){ |
| | | ElMessage.error('没有表格数据!') |
| | | return |
| | | } |
| | | const project = titleUploadData.value.project |
| | | if(project === null || project === undefined || project === ''){ |
| | | ElMessage.error('输入项目名称!') |
| | | return |
| | | } |
| | | const customer = titleUploadData.value.customerId |
| | | if(customer === null || customer === undefined || customer === ''){ |
| | | ElMessage.error('请选择客户!') |
| | | return |
| | | } |
| | | const salasMan = titleUploadData.value.salesman |
| | | if(salasMan === null || salasMan === undefined || salasMan === ''){ |
| | | ElMessage.error('请选择业务员!') |
| | | return |
| | | } |
| | | const calculateType = titleUploadData.value.calculateType |
| | | if(calculateType === null || calculateType === undefined || calculateType === ''){ |
| | | ElMessage.error('请选择计算方式!') |
| | | return |
| | | } |
| | | |
| | | if ($grid) { |
| | | const errMap = await $grid.validate(true) |
| | | if (errMap) { |
| | | ElMessage.error(`校验不通过!`) |
| | | return |
| | | } |
| | | let order ={ |
| | | title:titleUploadData.value, |
| | | detail:$grid.getTableData().tableData |
| | | } |
| | | saveOrder(order) |
| | | } |
| | | break |
| | | } |
| | | } |
| | | } |
| | | },//头部按钮事件 |
| | | menuClick ({ menu, row, column }) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | | switch (menu.code) { |
| | | case 'deleteList': { |
| | | $grid.removeCheckboxRow() |
| | | break |
| | | } |
| | | case 'addRow': { |
| | | if ($grid.getTableData().tableData.length >=240){ |
| | | ElMessage.error('表格数据已达到最大值!') |
| | | return |
| | | } |
| | | $grid.insert({}) |
| | | //console.log($grid.getRecordset().insertRecords) |
| | | break |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | cellDblclick (params) {//表格内容双击打开产品界面 |
| | | const { row } = params |
| | | //alert("我打开了产品界面") |
| | | } |
| | | } |
| | | |
| | | //初始化判断是否有id传入 |
| | | onMounted(()=>{ |
| | | const str = route.query.orderId |
| | | if (typeof str === 'undefined' || str === null || str === '' || str === '\n' || str === '\r'){ |
| | | return |
| | | } |
| | | request.post(`/order/getOrderById/${str}`).then((res) => { |
| | | if(res.code==200){ |
| | | console.log(res.data.order) |
| | | titleUploadData.value = res.data.order |
| | | //取消工艺按钮禁用 |
| | | gridOptions.toolbarConfig.buttons[1].disabled = false |
| | | //取消审核按钮禁用 |
| | | if(res.data.order.processReview === 2 && res.data.order.orderReview === 0){ |
| | | gridOptions.toolbarConfig.buttons[2].disabled = false |
| | | } |
| | | //按钮审核过后变为反审 |
| | | if(res.data.order.orderReview === 2){ |
| | | gridOptions.toolbarConfig.buttons[2].disabled = false |
| | | gridOptions.toolbarConfig.buttons[2].code='reviews' |
| | | gridOptions.toolbarConfig.buttons[2].name='反审' |
| | | } |
| | | if(res.data.order.produtionOrder !==0 ){ |
| | | gridOptions.toolbarConfig.buttons[2].disabled = true |
| | | } |
| | | |
| | | |
| | | xGrid.value.reloadData(res.data.orderDetails) |
| | | }else{ |
| | | ElMessage.error(res.msg) |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | //页面第一次加载执行 |
| | | request.get(`/basicData/orderBasicData`).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | titleSelectJson.value=deepClone(res.data) |
| | | titleUploadData.value.orderType = titleSelectJson.value.orderType[0].basicName |
| | | titleUploadData.value.orderClassify = titleSelectJson.value.orderClassify[0].basicName |
| | | titleUploadData.value.icon = titleSelectJson.value.icon[0].basicName |
| | | titleUploadData.value.packType = titleSelectJson.value.packType[0].basicName |
| | | titleUploadData.value.alType = titleSelectJson.value.alType[0].basicName |
| | | const today = new Date |
| | | today.setTime(today.getTime() + (15 * 24 * 60 * 60 * 1000)) |
| | | titleUploadData.value.deliveryDate = today.getFullYear() + |
| | | '-' + ("0" + (today.getMonth() + 1)).slice(-2) |
| | | + '-' + ("0" + today.getDate()).slice(-2) |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | |
| | | //保存订单方法 |
| | | const saveOrder = (order) => { |
| | | request.post(`/order/saveOrder`,order).then((res) => { |
| | | if(res.code==200){ |
| | | location.reload() |
| | | ElMessage.success('保存成功') |
| | | }else { |
| | | ElMessage.error(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | // 审核订单 |
| | | const reviewOrder = (state) => { |
| | | request.post(`/order/reviewOrderById/${titleUploadData.value.orderId}/${state}`).then(res =>{ |
| | | if(res.code==200){ |
| | | gridOptions.toolbarConfig.buttons[2].disabled = true |
| | | if(state==2){ |
| | | ElMessage.success('审核成功!') |
| | | }else if (state==0){ |
| | | ElMessage.success('反审成功!') |
| | | } |
| | | setTimeout(() =>{ |
| | | location.reload() |
| | | },1500) |
| | | |
| | | }else{ |
| | | ElMessage.error(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const changeCustomer = () => { |
| | | const changedCustomerId = titleUploadData.value.customerId |
| | | const customer = titleSelectJson.value.customer.filter(item => item.id === changedCustomerId) |
| | | titleUploadData.value.customerName = customer[0].customerName |
| | | //titleSelectJson.value.customer |
| | | } |
| | | |
| | | const changeSaleMan = () => { |
| | | const changedSaleManId = titleUploadData.value.salesmanId |
| | | const SaleMan = titleSelectJson.value.saleMan.filter(item => item.id === changedSaleManId) |
| | | titleUploadData.value.salesman = SaleMan[0].basicName |
| | | } |
| | | |
| | | const area = (row) => { |
| | | return parseFloat((row.width * row.height/1000000).toFixed(2)) |
| | | } |
| | | const countArea = (row) => { |
| | | const area = parseFloat((row.width * row.height/1000000).toFixed(2)) |
| | | return parseFloat((area * row.quantity).toFixed(2)) |
| | | } |
| | | |
| | | const countMoney = (list) => { |
| | | let countMoney = 0 |
| | | list.forEach((item)=>{ |
| | | countMoney += parseFloat(item.grossAmount) |
| | | }) |
| | | return countMoney |
| | | } |
| | | //导入功能 |
| | | const importEvent = async () => { |
| | | const $grid = xGrid.value |
| | | const { files } = await $grid.readFile({ |
| | | types: ['xls', 'xlsx'] |
| | | }) |
| | | const fileReader = new FileReader() |
| | | fileReader.onload = (event) => { |
| | | const data = event.target ? event.target.result : '' |
| | | const workbook = XLXS.read(data, { type: 'binary' }) |
| | | let jsonData = XLXS.utils.sheet_to_json(workbook.Sheets.Sheet1).slice(1) |
| | | if(jsonData.length>240){ |
| | | ElMessage.error(`导入${jsonData.length}条,数据不能超过240条,请分订单导入`) |
| | | return |
| | | } |
| | | jsonData.forEach((item,index) => { |
| | | if(item.computeArea === undefined){ |
| | | item.computeArea = area(item) |
| | | } |
| | | item.area = area(item) |
| | | item.grossArea = countArea(item) |
| | | item.computeGrossArea = parseFloat((item.computeArea*item.quantity).toFixed(2)) |
| | | item.grossAmount=parseFloat((item.price * item.computeGrossArea).toFixed(2)) |
| | | }) |
| | | //赋值表头数据 |
| | | titleUploadData.value.money=countMoney(jsonData).toString() |
| | | xGrid.value.loadData(jsonData) |
| | | } |
| | | fileReader.readAsBinaryString(files[0]) |
| | | } |
| | | |
| | | //行单元格修改修改触发此事件 |
| | | const editClosedEvent = ({ row, column }) => { |
| | | //判断修改相应的数值修改面积与金额 |
| | | if (['width', 'height', 'quantity', 'price'].includes(column.property)) { |
| | | row.area = area(row) |
| | | row.grossArea = countArea(row) |
| | | row.computeArea = row.area |
| | | row.computeGrossArea = row.grossArea |
| | | row.grossAmount=parseFloat((row.price * row.computeGrossArea).toFixed(2)) |
| | | }else if(column.property === 'computeArea'){ |
| | | row.computeGrossArea=parseFloat((row.computeArea*row.quantity).toFixed(2)) |
| | | row.grossAmount=parseFloat((row.price * row.computeGrossArea).toFixed(2)) |
| | | } |
| | | |
| | | titleUploadData.value.money=countMoney(xGrid.value.getTableData().fullData).toString() |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <div class="main-div"> |
| | | <div class="order-primary" style="background-color: white"> |
| | | <el-row> |
| | | <el-col :span="2"><el-text>*项目名称:</el-text></el-col> |
| | | <el-col :span="2"><el-input v-model="titleUploadData.project"/></el-col> |
| | | <el-col :span="2"><el-text>*客户选择:</el-text></el-col> |
| | | <el-col :span="2"> |
| | | <el-select v-model="titleUploadData.customerId" |
| | | @change="changeCustomer" |
| | | filterable |
| | | clearable |
| | | placeholder="" > |
| | | <el-option v-for="item in titleSelectJson['customer']" |
| | | :key="item.id" |
| | | :label="item.id+' '+item.customerName" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-col> |
| | | <el-col :span="2"><el-text>*订单类型:</el-text></el-col> |
| | | <el-col :span="2"> |
| | | <el-select v-model="titleUploadData.orderType" clearable placeholder="" > |
| | | <el-option |
| | | v-for="item in titleSelectJson['orderType']" |
| | | :key="item.id" |
| | | :label="item.basicName" |
| | | :value="item.basicName" |
| | | /> |
| | | </el-select> |
| | | </el-col> |
| | | <el-col :span="2"><el-text>订单分类:</el-text></el-col> |
| | | <el-col :span="2"> |
| | | <el-select v-model="titleUploadData.orderClassify" clearable placeholder=" " > |
| | | <el-option |
| | | v-for="item in titleSelectJson['orderClassify']" |
| | | :key="item.id" |
| | | :label="item.basicName" |
| | | :value="item.basicName" |
| | | /> |
| | | </el-select> |
| | | </el-col> |
| | | <el-col :span="2"><el-text>商标选项:</el-text></el-col> |
| | | <el-col :span="2"> |
| | | <el-select v-model="titleUploadData.icon" clearable placeholder=" " > |
| | | <el-option v-for="item in titleSelectJson['icon']" |
| | | :key="item.id" |
| | | :label="item.basicName" |
| | | :value="item.basicName"/> |
| | | </el-select> |
| | | </el-col> |
| | | <el-col :span="2"><el-text>包装方式:</el-text></el-col> |
| | | <el-col :span="2"> |
| | | <el-select v-model="titleUploadData.packType" clearable placeholder=" " > |
| | | <el-option v-for="item in titleSelectJson['packType']" |
| | | :key="item.id" |
| | | :label="item.basicName" |
| | | :value="item.basicName"/> |
| | | </el-select> |
| | | </el-col> |
| | | <!-- <el-col :span="2"><el-text /></el-col>--> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="2"><el-text>销售单号:</el-text></el-col> |
| | | <el-col :span="2"><el-text >{{titleUploadData.orderId}}</el-text></el-col> |
| | | <el-col :span="2"><el-text>交货日期:</el-text></el-col> |
| | | <el-col :span="2"> |
| | | <el-date-picker |
| | | v-model="titleUploadData.deliveryDate" |
| | | type="date" |
| | | placeholder="" |
| | | /> |
| | | </el-col> |
| | | <el-col :span="2"><el-text>批次:</el-text></el-col> |
| | | <el-col :span="2"><el-input v-model="titleUploadData.batch"/></el-col> |
| | | <el-col :span="2"><el-text>计算方式:</el-text></el-col> |
| | | <el-col :span="2"> |
| | | <el-select v-model="titleUploadData.calculateType" clearable placeholder=" " > |
| | | <el-option value="1" label="1"/> |
| | | </el-select> |
| | | </el-col> |
| | | <el-col :span="2"><el-text>*业务员:</el-text></el-col> |
| | | <el-col :span="2"> |
| | | <el-select |
| | | v-model="titleUploadData.salesmanId" |
| | | @change = "changeSaleMan" |
| | | clearable |
| | | placeholder=" " |
| | | > |
| | | <el-option v-for="item in titleSelectJson['saleMan']" |
| | | :key="item.id" |
| | | :label="item.basicName" |
| | | :value="item.id"/> |
| | | </el-select> |
| | | </el-col> |
| | | <el-col :span="2"><el-text>铝条方式:</el-text></el-col> |
| | | <el-col :span="2"> |
| | | <el-select v-model="titleUploadData.alType" clearable placeholder=" " > |
| | | <el-option v-for="item in titleSelectJson['alType']" |
| | | :key="item.id" |
| | | :label="item.basicName" |
| | | :value="item.basicName"/> |
| | | </el-select> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="2"><el-text>总金额:</el-text></el-col> |
| | | <el-col :span="2"><el-text >{{titleUploadData.money}}</el-text></el-col> |
| | | <el-col :span="2"><el-text>合同编号:</el-text></el-col> |
| | | <el-col :span="2"><el-input v-model="titleUploadData.contractId"/></el-col> |
| | | <el-col :span="2"><el-text>客户批次:</el-text></el-col> |
| | | <el-col :span="2"><el-input v-model="titleUploadData.customerBatch"/></el-col> |
| | | <el-col :span="2"><el-text>联系人:</el-text></el-col> |
| | | <el-col :span="2"><el-input v-model="titleUploadData.contacts" /></el-col> |
| | | <el-col :span="2"><el-text>联系电话:</el-text></el-col> |
| | | <el-col :span="2"><el-input v-model="titleUploadData.contactNumber"/></el-col> |
| | | <el-col :span="2"><el-text >送货地址:</el-text></el-col> |
| | | <el-col :span="2"><el-input v-model="titleUploadData.deliveryAddress"/></el-col> |
| | | </el-row> |
| | | <!-- <el-row>--> |
| | | <!-- <el-col :span="2"><el-text>其他金额:</el-text></el-col>--> |
| | | <!-- <el-col :span="2"><el-text /></el-col>--> |
| | | <!-- <el-col :span="2"><el-text>其他金额备注:</el-text></el-col>--> |
| | | <!-- <el-col :span="2"><el-text /></el-col>--> |
| | | |
| | | <!-- </el-row>--> |
| | | </div> |
| | | <div class="order-detail"> |
| | | <vxe-grid |
| | | max-height="100%" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | @edit-closed="editClosedEvent" |
| | | > |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <input type="type" v-model="option.data" @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <template #toolbar_buttons> |
| | | <vxe-button @click="importEvent">导入</vxe-button> |
| | | </template> |
| | | |
| | | |
| | | </vxe-grid> |
| | | </div> |
| | | <el-dialog v-model="dialogTableVisible" title="加工要求" style="width: 60%;height:75% "> |
| | | <el-input |
| | | v-model="titleUploadData.processingNote" |
| | | type="textarea" |
| | | :autosize="{ minRows: 2, maxRows: 20 }" |
| | | /> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | .main-div { |
| | | width: 100%; |
| | | height: 100%; |
| | | text-align: center; |
| | | } |
| | | .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: 85%; |
| | | } |
| | | |
| | | </style> |
| | | v1.8.0 |
| | |
| | | import {Search} from "@element-plus/icons-vue" |
| | | import {useRouter} from "vue-router" |
| | | import {reactive, ref} from "vue"; |
| | | 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"; |
| | | const router = useRouter() |
| | | const userStore = useUserInfoStore() |
| | | const username = userStore.user.userName |
| | | const userid = userStore.user.userId |
| | | let produceList = ref([]) |
| | | |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | |
| | | router.push({path: '/main/delivery/createDelivery', query: { deliveryID: 'JG24010101' }}) |
| | | break |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | const hasDecimal=(value)=>{ |
| | | const regex=/\./ // 定义正则表达式,查找小数点 |
| | | return regex.test(value) //返回true/false |
| | | } |
| | | |
| | | const hasDecimalhtml=(item,row)=>{ |
| | | let aa=item.split('.').length |
| | | if (aa===2){ |
| | | return row[item.split('.')[0]][item.split('.')[1]] |
| | | }else if(aa===3){ |
| | | return row[item.split('.')[0]][item.split('.')[1]][item.split('.')[2]] |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | //筛选条件,有外键需要先定义明细里面的数据 |
| | | let filterData = ref({ |
| | | |
| | | finishedGoodsInventory:{ |
| | | quantityAvailable:'', |
| | | |
| | | }, |
| | | |
| | | }) |
| | | |
| | | |
| | | //第一次调用 |
| | | request.post("/Delivery/getSelectOrderInventory/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | pageTotal.value=res.data.total |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | |
| | | //定义页面总页数 |
| | | let pageTotal=ref('') |
| | | //定义当前页数 |
| | | let pageNum=$ref(1) |
| | | |
| | | const changeFilterEvent = (event, option, $panel,) => { |
| | | // 手动触发筛选 |
| | | $panel.changeOption(event, !!option.data, option) |
| | | } |
| | | function filterChanged(column){ |
| | | gridOptions.loading=true |
| | | //筛选条件发生变化条件发生变化 |
| | | let value = column.datas[0]!=undefined?column.datas[0]:'' |
| | | value = value.trim() |
| | | //判断是否存在外键 |
| | | if (column.property.indexOf('.')>-1){ |
| | | const columnArr = column.property.split('.') |
| | | filterData.value[columnArr[0]] = { |
| | | [columnArr[1]]:value |
| | | } |
| | | }else{ |
| | | filterData.value[column.property] = value |
| | | } |
| | | request.post("/Delivery/getSelectOrderInventory/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | console.log(res.data) |
| | | pageTotal.value=res.data.total |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | |
| | | },//表头参数 |
| | | columns:[ |
| | | |
| | | {type:'expand',slots: { content:'content' },width: 50,fixed:"left"}, |
| | | {type:'checkbox',title: '选则', width: 80,fixed:"left"}, |
| | | {type:'expand',slots: { content:'content' },width: 60,fixed:"left"}, |
| | | {type:'checkbox',title: '选择', width: 80,fixed:"left"}, |
| | | {type: 'seq', title: '自序', width: 80 ,fixed:"left"}, |
| | | |
| | | {title: '下单', width: 40, slots: { default: 'state' }}, |
| | | {title: '工艺', width: 40, slots: { default: 'state' }}, |
| | | {title: '审核', width: 40, slots: { default: 'state' }}, |
| | | {title: '生产', width: 40, slots: { default: 'state' }}, |
| | | {title: '交接', width: 40, slots: { default: 'state' }}, |
| | | {title: '下达', width: 40, slots: { default: 'state' }}, |
| | | {title: '入库', width: 40, slots: { default: 'state' }}, |
| | | {title: '发货', width: 40, slots: { default: 'state' }}, |
| | | {field: 'createOrder',title: '下单', width: 40, slots: { default: 'state' }}, |
| | | {field: 'processReview',title: '工艺', width: 40, slots: { default: 'state' }}, |
| | | {field: 'orderReview',title: '审核', width: 40, slots: { default: 'state' }}, |
| | | {field: 'productionOrder',title: '生产', width: 40, slots: { default: 'state' }}, |
| | | {field: 'processingCard',title: '流程卡', width: 60, slots: { default: 'state' }}, |
| | | {field: 'warehousing',title: '入库', width: 40, slots: { default: 'state' }}, |
| | | {field: 'delivery',title: '发货', width: 40, slots: { default: 'state' }}, |
| | | |
| | | {field: '1',width:120, title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '2',width:120, title: '客户编号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '3',width:120, title: '客户名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '4',width:120, title: '总数量',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '5',width:120, title: '可用库存',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '6',width:120, title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '7',width:120, title: '批次',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '8',width:120, title: '总金额',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '9',width:120, title: '结算总面积',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '10',width:120, title: '报表日期',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '11',width:120, title: '包装方式',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '12',width:120, title: '订单类型',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '13',width:120, title: '订单类型',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: '14',width:120, title: '订单类型',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true} |
| | | {field: 'orderId',width:120, title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'customerId',width:120, title: '客户编号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'customerName',width:120, title: '客户名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'quantity',width:120, title: '总数量',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'finishedGoodsInventory.quantityAvailable',width:120, title: '可用库存',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'project',width:120, title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'batch',width:120, title: '批次',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'money',width:120, title: '总金额',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'area',width:120, title: '总面积',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'createTime',width:120, title: '报表日期',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'packType',width:120, title: '包装方式',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'orderType',width:120, title: '订单类型',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'creator',width:120, title: '创建人',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true} |
| | | |
| | | |
| | | ],//表头按钮 |
| | |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | '0': '1', |
| | | '1': 'NG23110102', |
| | | '2': '11', |
| | | '3': '中建', |
| | | '4': '534', |
| | | '5': '116', |
| | | '6': '黄石有轨电车', |
| | | '7': '20批', |
| | | '8': '111100.02', |
| | | '9': '1008.38', |
| | | '10': '2023-10-30', |
| | | '11': '叉车木箱', |
| | | '12': '普通订单', |
| | | '13': '', |
| | | '14': '王龙' |
| | | }, |
| | | { |
| | | '0': '1', |
| | | '1': 'NG23110101', |
| | | '2': '11', |
| | | '3': '中建', |
| | | '4': '534', |
| | | '5': '116', |
| | | '6': '黄石有轨电车', |
| | | '7': '20批', |
| | | '8': '111100.02', |
| | | '9': '1008.38', |
| | | '10': '2023-10-30', |
| | | '11': '叉车木箱', |
| | | '12': '普通订单', |
| | | '13': '', |
| | | '14': '王龙' |
| | | } |
| | | ],//table body实际数据 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | | return `页数:${pageNum}/${pageTotal.value}` |
| | | } |
| | | // if (props.tableProp.footList.includes(column.field)) { |
| | | // return sumNum(data, column.field) |
| | |
| | | if ($grid) { |
| | | switch (code) { |
| | | case 'add': { |
| | | router.push({path: '/main/delivery/createDelivery', params: { orderID: 'NG24010101' }}) |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | console.log(selectRecords) |
| | | |
| | | if (selectRecords.length === 0) { |
| | | ElMessage.warning("未选中数据") |
| | | return |
| | | } |
| | | let order_id="" |
| | | for (let i=0;i<selectRecords.length;i++){ |
| | | if(i+1===selectRecords.length){ |
| | | order_id+=selectRecords[i].orderId |
| | | }else{ |
| | | order_id+=selectRecords[i].orderId+"|" |
| | | } |
| | | } |
| | | |
| | | router.push({path: '/main/delivery/createDelivery', query: { orderId: order_id }}) |
| | | break |
| | | } |
| | | } |
| | |
| | | <vxe-grid |
| | | max-height="97%" |
| | | class="mytable-scrollbar" |
| | | @filter-change="filterChanged" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | |
| | | </ul> |
| | | </template> |
| | | |
| | | <template #state="{ row}"> |
| | | <el-checkbox checked/> |
| | | <template #state="{ row,column}"> |
| | | <el-checkbox @click.native.prevent :checked="row[column.field]===2"/> |
| | | </template> |
| | | |
| | | <!--左边固定显示的插槽--> |
| | |
| | | public Result getSelectOperateRecord(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody FinishedOperateLog finishedOperateLog){ |
| | | return Result.seccess(finishedGoodsInventoryService.getSelectOperateRecord(pageNum,pageSize,finishedOperateLog)); |
| | | } |
| | | |
| | | /*订单返工*/ |
| | | @PostMapping("/updateFinishedGoodsInventoryRework") |
| | | public Result updateFinishedGoodsInventoryRework( @RequestBody Map<String,Object> object){ |
| | | |
| | | if(finishedGoodsInventoryService.updateFinishedGoodsInventoryRework(object)){ |
| | | return Result.seccess(); |
| | | |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"返工失败"); |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /*订单审核*/ |
| | | @PostMapping("/updateFinishedGoodsInventoryToExamine") |
| | | public Result updateFinishedGoodsInventoryToExamine( @RequestBody Map<String,Object> object){ |
| | | |
| | | if(finishedGoodsInventoryService.updateFinishedGoodsInventoryToExamine(object,"审核")){ |
| | | return Result.seccess(); |
| | | |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"领出失败"); |
| | | |
| | | } |
| | | } |
| | | /*订单反审*/ |
| | | @PostMapping("/updateFinishedGoodsInventoryCounterexamination") |
| | | public Result updateFinishedGoodsInventoryCounterexamination( @RequestBody Map<String,Object> object){ |
| | | |
| | | if(finishedGoodsInventoryService.updateFinishedGoodsInventoryToExamine(object,"反审")){ |
| | | return Result.seccess(); |
| | | |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"领出失败"); |
| | | |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.example.erp.controller.sd; |
| | | |
| | | |
| | | import com.example.erp.common.Constants; |
| | | import com.example.erp.common.Result; |
| | | import com.example.erp.entity.mm.FinishedGoodsInventory; |
| | | import com.example.erp.entity.sd.Delivery; |
| | | import com.example.erp.entity.sd.DeliveryDetail; |
| | | import com.example.erp.entity.sd.Order; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import com.example.erp.exception.ServiceException; |
| | | import com.example.erp.service.sd.DeliveryService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @RequestMapping("/Delivery") |
| | | public class DeliveryController { |
| | | @Autowired |
| | | DeliveryService deliveryService; |
| | | |
| | | |
| | | /*发货订单查询*/ |
| | | @PostMapping("/getseletShippingOrder/{pageNum}/{pageSize}") |
| | | public Result getseletShippingOrder(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody Delivery delivery){ |
| | | return Result.seccess(deliveryService.getseletShippingOrder(pageNum,pageSize,delivery)); |
| | | } |
| | | |
| | | /*发货订单明细查询*/ |
| | | @PostMapping("/getseletShippingOrderDetail/{pageNum}/{pageSize}") |
| | | public Result getseletShippingOrderDetail(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody OrderDetail orderDetail){ |
| | | System.out.println(orderDetail.getDeliveryDetail().getDeliveryId()); |
| | | return Result.seccess(deliveryService.getseletShippingOrderDetail(pageNum,pageSize,orderDetail)); |
| | | } |
| | | |
| | | /*库存可发货订单查询*/ |
| | | @PostMapping("/getSelectOrderInventory/{pageNum}/{pageSize}") |
| | | public Result getSelectOrderInventory(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody Order order){ |
| | | return Result.seccess(deliveryService.getSelectOrderInventory(pageNum,pageSize,order)); |
| | | } |
| | | |
| | | /*发货订单明细查询*/ |
| | | @PostMapping("/getseletShippingOrderDetails/{pageNum}/{pageSize}") |
| | | public Result getseletShippingOrderDetails(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody OrderDetail orderDetail){ |
| | | System.out.println(orderDetail); |
| | | return Result.seccess(deliveryService.getseletShippingOrderDetails(pageNum,pageSize,orderDetail)); |
| | | } |
| | | |
| | | @PostMapping("/insertDelivery") |
| | | public Result insertDelivery( @RequestBody Map<String,Object> object){ |
| | | System.out.println(object); |
| | | if(deliveryService.insertDelivery(object)){ |
| | | return Result.seccess(); |
| | | |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"发货失败"); |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | private LocalDate deliveryDate; |
| | | private String payMethod; |
| | | private LocalDate payDate; |
| | | private String saleManId; |
| | | private String saleMan; |
| | | private String salesmanId; |
| | | private String salesman; |
| | | private String creatorId; |
| | | private String creator; |
| | | private String contacts; |
| | |
| | | public interface BasicWarehouseTypeMapper extends CrudRepository<BasicWarehouseType,Long> { |
| | | List<BasicWarehouseType> getBasicWarehouseTypeTakeOut(); |
| | | |
| | | List<BasicWarehouseType> getBasicWarehouseTypeRework(); |
| | | |
| | | |
| | | } |
| | |
| | | Boolean updateInventoryquantityAllocateInt(@Param("orderId") String orderId, |
| | | @Param("orderNumber") Integer orderNumber, |
| | | @Param("quantity") Integer quantity); |
| | | |
| | | Boolean updateInventoryquantityOut(@Param("orderId") String orderId, |
| | | @Param("orderNumber") Integer orderNumber, |
| | | @Param("quantity") Integer quantity); |
| | | Boolean updateInventoryquantityInt(@Param("orderId") String orderId, |
| | | @Param("orderNumber") Integer orderNumber, |
| | | @Param("quantity") Integer quantity); |
| | | |
| | | Boolean updateInventoryInventoryOut(@Param("orderId") String orderId, |
| | | @Param("orderNumber") Integer orderNumber, |
| | | @Param("quantity") Integer quantity); |
| | | Boolean updateInventoryInventoryInt(@Param("orderId") String orderId, |
| | | @Param("orderNumber") Integer orderNumber, |
| | | @Param("quantity") Integer quantity); |
| | | } |
| | | |
| | | |
| | |
| | | @Param("operateType") String operateType, |
| | | @Param("remarks") String remarks); |
| | | |
| | | Boolean insertFinishedOperateLogRework(@Param("orderDetail") OrderDetail orderDetail, |
| | | @Param("userName") String userName, |
| | | @Param("oddNumber") String oddNumber, |
| | | @Param("operateType") String operateType, |
| | | @Param("remarks") String remarks); |
| | | |
| | | List<OrderDetail> getSelectOperateRecord(@Param("offset") Integer offset, |
| | | @Param("pageSize") Integer pageSize, |
| | | @Param("finishedOperateLog") FinishedOperateLog finishedOperateLog); |
| | |
| | | Integer getSelectOperateRecordLogPageTotal(@Param("offset") Integer offset, |
| | | @Param("pageSize") Integer pageSize, |
| | | @Param("finishedOperateLog") FinishedOperateLog finishedOperateLog); |
| | | |
| | | Boolean updateToExamine(@Param("finishedOperateLog") FinishedOperateLog finishedOperateLog, |
| | | @Param("userName") String userName, |
| | | @Param("type") String type); |
| | | } |
New file |
| | |
| | | package com.example.erp.mapper.sd; |
| | | |
| | | import com.example.erp.entity.sd.Delivery; |
| | | import com.example.erp.entity.sd.DeliveryDetail; |
| | | import com.example.erp.entity.sd.Order; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.data.repository.CrudRepository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface DeliveryDetailMapper extends CrudRepository<DeliveryDetail,Long> { |
| | | |
| | | List<DeliveryDetail> getseletShippingOrderDetail(@Param("offset") Integer offset, |
| | | @Param("pageSize") Integer pageSize, |
| | | @Param("orderDetail") OrderDetail orderDetail); |
| | | |
| | | |
| | | |
| | | Integer getseletShippingOrderDetailPageTotal(Integer offset, Integer pageSize,OrderDetail orderDetail); |
| | | |
| | | List<DeliveryDetail> getseletShippingOrderDetails(@Param("offset") Integer offset, |
| | | @Param("pageSize") Integer pageSize, |
| | | @Param("orderDetail") OrderDetail orderDetail); |
| | | |
| | | |
| | | |
| | | Integer getseletShippingOrderDetailsPageTotal(Integer offset, Integer pageSize,OrderDetail orderDetail); |
| | | |
| | | Boolean insertDeliveryDetail(@Param("orderDetail") OrderDetail orderDetail, @Param("number") String number,@Param("deliveryNumber") Integer deliveryNumber); |
| | | |
| | | Integer getdeliveryDetailmaximum(@Param("deliveryId") String deliveryId); |
| | | |
| | | Boolean updateOrderDetailDeliveryNum(OrderDetail orderDetail); |
| | | |
| | | } |
New file |
| | |
| | | package com.example.erp.mapper.sd; |
| | | |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.entity.sd.Delivery; |
| | | import com.example.erp.entity.sd.DeliveryDetail; |
| | | import com.example.erp.entity.sd.Order; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.data.repository.CrudRepository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface DeliveryMapper extends CrudRepository<Delivery,Long> { |
| | | |
| | | List<Delivery> getseletShippingOrder(@Param("offset") Integer offset, |
| | | @Param("pageSize") Integer pageSize, |
| | | @Param("delivery") Delivery delivery); |
| | | |
| | | Delivery getseletShippingOrderDetaildelivery(@Param("offset") Integer offset, |
| | | @Param("pageSize") Integer pageSize, |
| | | @Param("orderDetail") OrderDetail orderDetail); |
| | | |
| | | Order getseletShippingOrderDetaildeliverys(@Param("offset") Integer offset, |
| | | @Param("pageSize") Integer pageSize, |
| | | @Param("orderDetail") OrderDetail orderDetail); |
| | | Integer getseletShippingOrderPageTotal(Integer offset, Integer pageSize,Delivery delivery); |
| | | |
| | | List<Order> getSelectOrderInventory(@Param("offset") Integer offset, |
| | | @Param("pageSize") Integer pageSize, |
| | | @Param("order") Order order); |
| | | |
| | | Integer getSelectOrderInventoryPageTotal(Integer offset, Integer pageSize, Order order); |
| | | |
| | | Boolean insertDelivery(@Param("delivery") Delivery delivery,@Param("number") String number,@Param("orderId") String orderId); |
| | | |
| | | Integer getmaximum(@Param("type") String type); |
| | | |
| | | Boolean updatedelivery(@Param("area") Double area, |
| | | @Param("quantity") Integer quantity, |
| | | @Param("money") Double money, |
| | | @Param("oddNumber") String oddNumber); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | if(Objects.equals(finishedGoodsInventorybycount, orderDetail.getWarehouseNum())){ |
| | | System.out.println(123); |
| | | //修改库存表出库数量 |
| | | finishedGoodsInventoryMapper.updateInventoryquantityavailable(orderDetail); |
| | | //finishedGoodsInventoryMapper.updateInventoryquantityavailable(orderDetail); |
| | | //修改发货明细表状态 |
| | | finishedGoodsInventoryMapper.updateDeliveryDetailState(orderDetail,0); |
| | | //修改订单明细表发货数量 |
| | |
| | | map.put("data", finishedGoodsInventoryMapper.getSelectAllocate(offset, pageSize, orderDetail)); |
| | | map.put("total", finishedGoodsInventoryMapper.getSelectAllocatePageTotal(offset, pageSize, orderDetail)); |
| | | map.put("type", basicWarehouseTypeMapper.getBasicWarehouseTypeTakeOut()); |
| | | map.put("types", basicWarehouseTypeMapper.getBasicWarehouseTypeRework()); |
| | | return map; |
| | | } |
| | | |
| | |
| | | String userId = ""; |
| | | if (object.get("userName") != null) { |
| | | userName = object.get("userName").toString(); |
| | | System.out.println(12344); |
| | | } |
| | | if (object.get("userId") != null) { |
| | | userId = object.get("userId").toString(); |
| | |
| | | //添加领出记录 |
| | | finishedOperateLogMapper.insertFinishedOperateLogTakeOut(orderDetail,userName,oddNumber,operateType,remarks); |
| | | //修改库存数量 |
| | | finishedGoodsInventoryMapper.updateInventoryquantityAllocateOut(orderDetail.getFinishedGoodsInventory().getOrderId(),orderDetail.getFinishedGoodsInventory().getOrderNumber(), Math.toIntExact(orderDetail.getQuantity())); |
| | | finishedGoodsInventoryMapper.updateInventoryquantityOut(orderDetail.getFinishedGoodsInventory().getOrderId(),orderDetail.getFinishedGoodsInventory().getOrderNumber(), Math.toIntExact(orderDetail.getQuantity())); |
| | | //修改订单明细表数量 |
| | | finishedGoodsInventoryMapper.updateOutOrderNumberConut(orderDetail.getFinishedGoodsInventory().getOrderId(),orderDetail.getFinishedGoodsInventory().getOrderNumber(), Math.toIntExact(orderDetail.getQuantity())); |
| | | if (Objects.equals(oldordersum, oldordernumbersum)){ |
| | |
| | | } |
| | | |
| | | |
| | | public Boolean updateFinishedGoodsInventoryRework(Map<String,Object> object) { |
| | | Boolean isinsert=false; |
| | | String userName = ""; |
| | | String userId = ""; |
| | | if (object.get("userName") != null) { |
| | | userName = object.get("userName").toString(); |
| | | } |
| | | if (object.get("userId") != null) { |
| | | userId = object.get("userId").toString(); |
| | | } |
| | | |
| | | String operateType = ""; |
| | | String remarks = ""; |
| | | if (object.get("remarks") != null) { |
| | | remarks = object.get("remarks").toString(); |
| | | } |
| | | if (object.get("operateType") != null) { |
| | | operateType = object.get("operateType").toString(); |
| | | } |
| | | //获取对象集合循环进行新增修改 |
| | | List<OrderDetail> orderDetaillist = JSONArray.parseArray(JSONObject.toJSONString(object.get("orderDetail")), OrderDetail.class); |
| | | if (!orderDetaillist.isEmpty()){ |
| | | for (OrderDetail orderDetail : orderDetaillist) { |
| | | Integer oldordersum = finishedGoodsInventoryMapper.findOrderQuantity(orderDetail.getFinishedGoodsInventory().getOrderId()); |
| | | Integer oldordernumbersum = finishedGoodsInventoryMapper.findOrderNumberdsum(orderDetail.getFinishedGoodsInventory().getOrderId()); |
| | | |
| | | //获取单号 |
| | | String oddNumber= orderNumberSetting("返工"); |
| | | //添加领出记录 |
| | | finishedOperateLogMapper.insertFinishedOperateLogRework(orderDetail,userName,oddNumber,operateType,remarks); |
| | | //修改库存数量 |
| | | finishedGoodsInventoryMapper.updateInventoryquantityOut(orderDetail.getFinishedGoodsInventory().getOrderId(),orderDetail.getFinishedGoodsInventory().getOrderNumber(), Math.toIntExact(orderDetail.getQuantity())); |
| | | //修改订单明细表数量 |
| | | finishedGoodsInventoryMapper.updateOutOrderNumberConut(orderDetail.getFinishedGoodsInventory().getOrderId(),orderDetail.getFinishedGoodsInventory().getOrderNumber(), Math.toIntExact(orderDetail.getQuantity())); |
| | | if (Objects.equals(oldordersum, oldordernumbersum)){ |
| | | //修改订单表入库状态 |
| | | finishedGoodsInventoryMapper.updateOrderWarehousingState(orderDetail.getFinishedGoodsInventory().getOrderId(),1); |
| | | } |
| | | isinsert=true; |
| | | } |
| | | return isinsert; |
| | | }else{ |
| | | return false; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | public Boolean updateFinishedGoodsInventoryToExamine(Map<String,Object> object,String type) { |
| | | Boolean isinsert=false; |
| | | String userName = ""; |
| | | String userId = ""; |
| | | if (object.get("userName") != null) { |
| | | userName = object.get("userName").toString(); |
| | | } |
| | | if (object.get("userId") != null) { |
| | | userId = object.get("userId").toString(); |
| | | } |
| | | //获取对象集合循环进行新增修改 |
| | | List<FinishedOperateLog> finishedOperateLogslist = JSONArray.parseArray(JSONObject.toJSONString(object.get("orderDetail")), FinishedOperateLog.class); |
| | | if (!finishedOperateLogslist.isEmpty()){ |
| | | for (FinishedOperateLog finishedOperateLog : finishedOperateLogslist) { |
| | | if(Objects.equals(type, "审核")){ |
| | | //审核修改领出记录 |
| | | finishedOperateLogMapper.updateToExamine(finishedOperateLog,userName,"已审核"); |
| | | //审核修改库存数量 |
| | | finishedGoodsInventoryMapper.updateInventoryInventoryOut(finishedOperateLog.getOrderId(),finishedOperateLog.getOperationNumber(),Math.toIntExact(finishedOperateLog.getQuantity())); |
| | | } else if (Objects.equals(type, "反审")) { |
| | | //审核修改领出记录 |
| | | finishedOperateLogMapper.updateToExamine(finishedOperateLog,userName,"未审核"); |
| | | //审核修改库存数量 |
| | | finishedGoodsInventoryMapper.updateInventoryInventoryInt(finishedOperateLog.getOrderId(),finishedOperateLog.getOperationNumber(),Math.toIntExact(finishedOperateLog.getQuantity())); |
| | | } |
| | | |
| | | |
| | | isinsert=true; |
| | | } |
| | | return isinsert; |
| | | }else{ |
| | | return false; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.example.erp.service.sd; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.example.erp.entity.sd.Delivery; |
| | | import com.example.erp.entity.sd.DeliveryDetail; |
| | | import com.example.erp.entity.sd.Order; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import com.example.erp.mapper.mm.FinishedGoodsInventoryMapper; |
| | | import com.example.erp.mapper.sd.DeliveryDetailMapper; |
| | | import com.example.erp.mapper.sd.DeliveryMapper; |
| | | import com.example.erp.mapper.sd.OrderDetailMapper; |
| | | import com.example.erp.mapper.sd.OrderMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | @Service |
| | | @DS("sd") |
| | | public class DeliveryService { |
| | | @Autowired |
| | | DeliveryMapper deliveryMapper; |
| | | @Autowired |
| | | DeliveryDetailMapper deliveryDetailMapper; |
| | | @Autowired |
| | | OrderMapper orderMapper; |
| | | @Autowired |
| | | OrderDetailMapper orderDetailMapper; |
| | | @Autowired |
| | | FinishedGoodsInventoryMapper finishedGoodsInventoryMapper; |
| | | |
| | | public Map<String, Object> getseletShippingOrder(Integer pageNum, Integer pageSize, Delivery delivery) { |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", deliveryMapper.getseletShippingOrder(offset, pageSize, delivery)); |
| | | System.out.println(deliveryMapper.getseletShippingOrder(offset, pageSize, delivery)); |
| | | map.put("total", deliveryMapper.getseletShippingOrderPageTotal(offset, pageSize, delivery)); |
| | | return map; |
| | | } |
| | | |
| | | public Map<String, Object> getseletShippingOrderDetail(Integer pageNum, Integer pageSize, OrderDetail orderDetail) { |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", deliveryDetailMapper.getseletShippingOrderDetail(offset, pageSize, orderDetail)); |
| | | map.put("delivery", deliveryMapper.getseletShippingOrderDetaildelivery(offset, pageSize, orderDetail)); |
| | | map.put("total", deliveryDetailMapper.getseletShippingOrderDetailPageTotal(offset, pageSize, orderDetail)); |
| | | return map; |
| | | } |
| | | |
| | | public Map<String, Object> getSelectOrderInventory(Integer pageNum, Integer pageSize, Order order) { |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", deliveryMapper.getSelectOrderInventory(offset, pageSize, order)); |
| | | map.put("total", deliveryMapper.getSelectOrderInventoryPageTotal(offset, pageSize, order)); |
| | | return map; |
| | | } |
| | | |
| | | public Map<String, Object> getseletShippingOrderDetails(Integer pageNum, Integer pageSize, OrderDetail orderDetail) { |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", deliveryDetailMapper.getseletShippingOrderDetails(offset, pageSize, orderDetail)); |
| | | map.put("title", deliveryMapper.getseletShippingOrderDetaildeliverys(offset, pageSize, orderDetail)); |
| | | map.put("total", deliveryDetailMapper.getseletShippingOrderDetailsPageTotal(offset, pageSize, orderDetail)); |
| | | return map; |
| | | } |
| | | |
| | | public Boolean insertDelivery(Map<String,Object> object) { |
| | | Boolean isinsert=false; |
| | | Delivery delivery = JSONObject.parseObject(JSONObject.toJSONString(object.get("title")), Delivery.class); |
| | | List<OrderDetail> orderDetaillist = JSONArray.parseArray(JSONObject.toJSONString(object.get("delivery")), OrderDetail.class); |
| | | //获取单号 |
| | | String oddNumber= orderNumberSetting("发货"); |
| | | System.out.println(delivery); |
| | | deliveryMapper.insertDelivery(delivery,oddNumber,orderDetaillist.get(0).getOrderId()); |
| | | Double area=0.0; |
| | | Integer quantity=0; |
| | | Double money=0.0; |
| | | //获取对象集合循环进行新增修改 |
| | | |
| | | if (!orderDetaillist.isEmpty()){ |
| | | for (OrderDetail orderDetail : orderDetaillist) { |
| | | quantity+=orderDetail.getFinishedGoodsInventory().getQuantityAvailable(); |
| | | area+=orderDetail.getFinishedGoodsInventory().getActualSignalArea()*orderDetail.getFinishedGoodsInventory().getQuantityAvailable(); |
| | | money+=orderDetail.getPrice()*orderDetail.getFinishedGoodsInventory().getQuantityAvailable(); |
| | | Integer deliveryDetailmaximum=deliveryDetailMapper.getdeliveryDetailmaximum(oddNumber); |
| | | System.out.println(deliveryDetailmaximum); |
| | | deliveryDetailMapper.insertDeliveryDetail(orderDetail,oddNumber,deliveryDetailmaximum); |
| | | deliveryDetailMapper.updateOrderDetailDeliveryNum(orderDetail); |
| | | //修改库存表出库数量 |
| | | finishedGoodsInventoryMapper.updateInventoryquantityOut(orderDetail.getOrderId(),orderDetail.getOrderNumber(),orderDetail.getFinishedGoodsInventory().getQuantityAvailable()); |
| | | isinsert=true; |
| | | } |
| | | System.out.println("面积"+area+"数量"+quantity+"金额"+money); |
| | | deliveryMapper.updatedelivery(area,quantity,money,oddNumber); |
| | | return isinsert; |
| | | }else{ |
| | | return false; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | public String orderNumberSetting(String type) { |
| | | //根据类型自动生成不同的操作单号 |
| | | String alias=""; |
| | | if(Objects.equals(type, "发货")){ |
| | | alias="FH"; |
| | | }else if(Objects.equals(type, "出库")){ |
| | | alias="CK"; |
| | | }else if(Objects.equals(type, "调拨")){ |
| | | alias="DB"; |
| | | }else if(Objects.equals(type, "领出")){ |
| | | alias="LC"; |
| | | }else if(Objects.equals(type, "返工")){ |
| | | alias="FG"; |
| | | } |
| | | //查询当天的最大数量 |
| | | Integer maximum=deliveryMapper.getmaximum(type); |
| | | //设置两位不够补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; |
| | | } |
| | | } |
| | |
| | | select * from mm.basic_warehouse_type where operate_type='领出'; |
| | | </select> |
| | | |
| | | <select id="getBasicWarehouseTypeRework" > |
| | | select * from mm.basic_warehouse_type where operate_type='返工'; |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | |
| | | where order_number=#{orderNumber} and order_id=#{orderId} |
| | | </update> |
| | | |
| | | <update id="updateInventoryquantityInt"> |
| | | update mm.finished_goods_inventory |
| | | set quantity_available=quantity_available+#{quantity}, |
| | | update_time=now(),area=actual_signal_area*quantity_available |
| | | where order_number=#{orderNumber} and order_id=#{orderId} |
| | | </update> |
| | | |
| | | <update id="updateInventoryquantityOut"> |
| | | update mm.finished_goods_inventory |
| | | set quantity_available=quantity_available-#{quantity}, |
| | | update_time=now(),area=actual_signal_area*quantity_available |
| | | where order_number=#{orderNumber} and order_id=#{orderId} |
| | | </update> |
| | | |
| | | <update id="updateInventoryInventoryInt"> |
| | | update mm.finished_goods_inventory |
| | | set inventory=inventory+#{quantity} |
| | | where order_number=#{orderNumber} and order_id=#{orderId} |
| | | </update> |
| | | |
| | | <update id="updateInventoryInventoryOut"> |
| | | update mm.finished_goods_inventory |
| | | set inventory=inventory-#{quantity} |
| | | where order_number=#{orderNumber} and order_id=#{orderId} |
| | | </update> |
| | | |
| | | <select id="getSelectAllocate" resultMap="selectDeliveryFinishedGoodsInventory"> |
| | | select fgi.order_id, |
| | | o.project, |
| | |
| | | from mm.finished_goods_inventory fgi |
| | | left join sd.order_detail od on fgi.order_id = od.order_id and fgi.order_number = od.order_number |
| | | left join sd.`order` o on fgi.order_id = o.order_id |
| | | <where> |
| | | and fgi.quantity_available>0 |
| | | <if test="orderDetail.finishedGoodsInventory.orderId != null and orderDetail.finishedGoodsInventory.orderId != ''"> |
| | | and fgi.order_id regexp #{orderDetail.finishedGoodsInventory.orderId} |
| | | </if> |
| | | <if test="orderDetail.order.project != null and orderDetail.order.project != ''"> |
| | | and o.project regexp #{orderDetail.order.project} |
| | | </if> |
| | | <if test="orderDetail.finishedGoodsInventory.orderNumber != null and orderDetail.finishedGoodsInventory.orderNumber != ''"> |
| | | and fgi.order_number regexp #{orderDetail.finishedGoodsInventory.orderNumber} |
| | | </if> |
| | | <if test="orderDetail.finishedGoodsInventory.quantityAvailable != null and orderDetail.finishedGoodsInventory.quantityAvailable != ''"> |
| | | and fgi.quantity_available regexp #{orderDetail.finishedGoodsInventory.quantityAvailable} |
| | | </if> |
| | | <if test="orderDetail.productId != null and orderDetail.productId != ''"> |
| | | and od.product_id regexp #{orderDetail.productId} |
| | | </if> |
| | | <if test="orderDetail.productName != null and orderDetail.productName != ''"> |
| | | and od.product_name regexp #{orderDetail.productName} |
| | | </if> |
| | | <if test="orderDetail.width != null and orderDetail.width != ''"> |
| | | and od.width regexp #{orderDetail.width} |
| | | </if> |
| | | <if test="orderDetail.height != null and orderDetail.height != ''"> |
| | | and od.height regexp #{orderDetail.height} |
| | | </if> |
| | | <if test="orderDetail.order.customerId != null and orderDetail.order.customerId != ''"> |
| | | and o.customer_id regexp #{orderDetail.order.customerId} |
| | | </if> |
| | | <if test="orderDetail.order.customerName != null and orderDetail.order.customerName != ''"> |
| | | and o.customer_name regexp #{orderDetail.order.customerName} |
| | | </if> |
| | | <if test="orderDetail.finishedGoodsInventory.actualSignalArea != null and orderDetail.finishedGoodsInventory.actualSignalArea != ''"> |
| | | and fgi.actual_signal_area regexp #{orderDetail.finishedGoodsInventory.actualSignalArea} |
| | | </if> |
| | | <if test="orderDetail.finishedGoodsInventory.area != null and orderDetail.finishedGoodsInventory.area != ''"> |
| | | and fgi.area regexp #{orderDetail.finishedGoodsInventory.area} |
| | | </if> |
| | | <if test="orderDetail.finishedGoodsInventory.storageRegion != null and orderDetail.finishedGoodsInventory.storageRegion != ''"> |
| | | and fgi.storage_region regexp #{orderDetail.finishedGoodsInventory.storageRegion} |
| | | </if> |
| | | </where> |
| | | group by fgi.order_id, fgi.order_number) as zu |
| | | |
| | | limit #{offset},#{pageSize}; |
| | |
| | | |
| | | </resultMap> |
| | | |
| | | <update id="updateToExamine"> |
| | | update mm.finished_operate_log set reviewed=#{userName},reviewed_time=now(),status=#{type} where operation_order_number=#{finishedOperateLog.operationOrderNumber}; |
| | | </update> |
| | | |
| | | <select id="getSelectOperateRecord" resultMap="selectFinishedGoodsInventory"> |
| | | select fol.operation_order_number, |
| | | fol.order_id, |
| | |
| | | and fol.remarks regexp #{finishedOperateLog.remarksr} |
| | | </if> |
| | | </where> |
| | | |
| | | order by fol.`status` desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | |
| | | and fol.remarks regexp #{finishedOperateLog.remarksr} |
| | | </if> |
| | | </where> |
| | | order by fol.`status` desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | |
| | | ) |
| | | </insert> |
| | | |
| | | <insert id="insertFinishedOperateLogRework" useGeneratedKeys="true" > |
| | | insert into mm.finished_operate_log(operation_order_number, |
| | | order_id, |
| | | operation_number, |
| | | operate_type, |
| | | operator, |
| | | quantity, |
| | | operate_time, |
| | | status, |
| | | type, |
| | | remarks |
| | | ) |
| | | values ( |
| | | #{oddNumber} ,#{orderDetail.finishedGoodsInventory.orderId},#{orderDetail.finishedGoodsInventory.orderNumber} |
| | | ,"返工",#{userName},#{orderDetail.quantity},now(),"未审核",#{operateType},#{remarks} |
| | | ) |
| | | </insert> |
| | | |
| | | <insert id="insertFinishedOperateLogAllocate" useGeneratedKeys="true" > |
| | | insert into mm.finished_operate_log(operation_order_number, |
| | | order_id, |
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.sd.DeliveryMapper"> |
| | | |
| | | <resultMap id="selectOrderInventory" type="com.example.erp.entity.sd.Order"> |
| | | |
| | | <result column="create_order" property="createOrder"/> |
| | | <result column="process_review" property="processReview"/> |
| | | <result column="order_review" property="orderReview"/> |
| | | <result column="production_order" property="productionOrder"/> |
| | | <result column="processing_card" property="processingCard"/> |
| | | <result column="warehousing" property="warehousing"/> |
| | | <result column="delivery" property="delivery"/> |
| | | <result column="order_id" property="orderId"/> |
| | | <result column="customer_id" property="customerId"/> |
| | | <result column="customer_name" property="customerName"/> |
| | | <result column="quantity" property="quantity"/> |
| | | <result column="project" property="project"/> |
| | | <result column="batch" property="batch"/> |
| | | <result column="money" property="money"/> |
| | | <result column="area" property="area"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="pack_type" property="packType"/> |
| | | <result column="order_type" property="orderType"/> |
| | | <result column="creator" property="creator"/> |
| | | <result column="quantity_available" property="finishedGoodsInventory.quantityAvailable"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <update id="updatedelivery"> |
| | | update sd.delivery set area=#{area},quantity=#{quantity},money=#{money} where delivery_id=#{oddNumber} |
| | | </update> |
| | | |
| | | <select id="getmaximum" > |
| | | select count(*) from sd.delivery where date(create_time)=CURDATE() |
| | | </select> |
| | | |
| | | |
| | | <insert id="insertDelivery" useGeneratedKeys="true" > |
| | | insert into sd.delivery(delivery_state,stock_state,delivery_id,order_id,project,customer_id,customer_name, |
| | | delivery_date,pay_method,pay_date,salesman_id,salesman,creator_id,creator,contacts,contact_number,delivery_address, |
| | | area,quantity,money,remarks,create_time) |
| | | values ( |
| | | 0,0,#{number} ,#{orderId},#{delivery.project},#{delivery.customerId},#{delivery.customerName},#{delivery.deliveryDate},#{delivery.payMethod}, |
| | | #{delivery.payDate},#{delivery.salesmanId},#{delivery.salesman},#{delivery.creatorId},#{delivery.creator},#{delivery.contacts},#{delivery.contactNumber},#{delivery.deliveryAddress}, |
| | | 0,0,0,#{delivery.remarks},now() |
| | | ) |
| | | </insert> |
| | | |
| | | <select id="getSelectOrderInventory" resultMap="selectOrderInventory"> |
| | | select o.create_order, |
| | | o.process_review, |
| | | o.order_review, |
| | | o.production_order, |
| | | o.processing_card, |
| | | o.warehousing, |
| | | o.delivery, |
| | | o.order_id, |
| | | o.customer_id, |
| | | o.customer_name, |
| | | o.quantity, |
| | | sum(fgi.quantity_available) as quantity_available, |
| | | o.project, |
| | | o.batch, |
| | | o.money, |
| | | o.area, |
| | | o.create_time, |
| | | o.pack_type, |
| | | o.order_type, |
| | | o.creator |
| | | from sd.`order` o |
| | | left join mm.finished_goods_inventory fgi on o.order_id = fgi.order_id |
| | | <where> |
| | | fgi.quantity_available > 0 |
| | | <if test="order.orderId != null and order.orderId != ''"> |
| | | and o.order_id REGEXP #{order.orderId} |
| | | </if> |
| | | <if test="order.customerId != null and order.customerId != ''"> |
| | | and o.customer_id REGEXP #{order.customerId} |
| | | </if> |
| | | <if test="order.customerName != null and order.customerName != ''"> |
| | | and o.customer_name REGEXP #{order.customerName} |
| | | </if> |
| | | <if test="order.quantity != null and order.quantity != ''"> |
| | | and o.quantity REGEXP #{order.quantity} |
| | | </if> |
| | | <if test="order.project != null and order.project != ''"> |
| | | and o.project REGEXP #{order.project} |
| | | </if> |
| | | <if test="order.batch != null and order.batch != ''"> |
| | | and o.batch REGEXP #{order.batch} |
| | | </if> |
| | | <if test="order.money != null and order.money != ''"> |
| | | and o.money REGEXP #{order.money} |
| | | </if> |
| | | <if test="order.area != null and order.area != ''"> |
| | | and o.area REGEXP #{order.area} |
| | | </if> |
| | | <if test="order.packType != null and order.packType != ''"> |
| | | and o.pack_type REGEXP #{order.packType} |
| | | </if> |
| | | <if test="order.orderType != null and order.orderType != ''"> |
| | | and o.order_type REGEXP #{order.orderType} |
| | | </if> |
| | | <if test="order.creator != null and order.creator != ''"> |
| | | and o.creator REGEXP #{order.creator} |
| | | </if> |
| | | <if test="order.createTime != null and order.createTime != ''"> |
| | | and o.create_time REGEXP #{order.createTime} |
| | | </if> |
| | | <if test="order.finishedGoodsInventory.quantityAvailable != null and order.finishedGoodsInventory.quantityAvailable != ''"> |
| | | and fgi.quantity_available REGEXP #{order.finishedGoodsInventory.quantityAvailable} |
| | | </if> |
| | | </where> |
| | | group by o.order_id |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getSelectOrderInventoryPageTotal" > |
| | | select CEILING(count(zu.order_id)/#{pageSize}) from |
| | | (select o.create_order,o.process_review,o.order_review,o.production_order, |
| | | o.processing_card,o.warehousing,o.delivery,o.order_id,o.customer_id, |
| | | o.customer_name,o.quantity,sum(fgi.quantity_available),o.project,o.batch, |
| | | o.money,o.area,o.create_time,o.pack_type,o.order_type,o.creator |
| | | from sd.`order` o left join mm.finished_goods_inventory fgi on o.order_id=fgi.order_id |
| | | <where> |
| | | fgi.quantity_available > 0 |
| | | <if test="order.orderId != null and order.orderId != ''"> |
| | | and o.order_id REGEXP #{order.orderId} |
| | | </if> |
| | | <if test="order.customerId != null and order.customerId != ''"> |
| | | and o.customer_id REGEXP #{order.customerId} |
| | | </if> |
| | | <if test="order.customerName != null and order.customerName != ''"> |
| | | and o.customer_name REGEXP #{order.customerName} |
| | | </if> |
| | | <if test="order.quantity != null and order.quantity != ''"> |
| | | and o.quantity REGEXP #{order.quantity} |
| | | </if> |
| | | <if test="order.project != null and order.project != ''"> |
| | | and o.project REGEXP #{order.project} |
| | | </if> |
| | | <if test="order.batch != null and order.batch != ''"> |
| | | and o.batch REGEXP #{order.batch} |
| | | </if> |
| | | <if test="order.money != null and order.money != ''"> |
| | | and o.money REGEXP #{order.money} |
| | | </if> |
| | | <if test="order.area != null and order.area != ''"> |
| | | and o.area REGEXP #{order.area} |
| | | </if> |
| | | <if test="order.packType != null and order.packType != ''"> |
| | | and o.pack_type REGEXP #{order.packType} |
| | | </if> |
| | | <if test="order.orderType != null and order.orderType != ''"> |
| | | and o.order_type REGEXP #{order.orderType} |
| | | </if> |
| | | <if test="order.creator != null and order.creator != ''"> |
| | | and o.creator REGEXP #{order.creator} |
| | | </if> |
| | | <if test="order.createTime != null and order.createTime != ''"> |
| | | and o.create_time REGEXP #{order.createTime} |
| | | </if> |
| | | <if test="order.finishedGoodsInventory.quantityAvailable != null and order.finishedGoodsInventory.quantityAvailable != ''"> |
| | | and fgi.quantity_available REGEXP #{order.finishedGoodsInventory.quantityAvailable} |
| | | </if> |
| | | </where> |
| | | group by o.order_id) as zu |
| | | limit #{offset},#{pageSize}; |
| | | |
| | | |
| | | |
| | | |
| | | </select> |
| | | |
| | | <select id="getseletShippingOrderDetaildelivery" > |
| | | select |
| | | d.customer_id,d.customer_name,d.project,d.pay_method,d.pay_date,d.contacts,d.contact_number, |
| | | d.delivery_address,d.remarks,d.create_time,d.delivery_date,d.creator,d.salesman,d.salesman_id |
| | | from sd.delivery d |
| | | <where> |
| | | <if test="orderDetail.deliveryDetail.deliveryId != null and orderDetail.deliveryDetail.deliveryId != ''"> |
| | | and d.delivery_id regexp #{orderDetail.deliveryDetail.deliveryId} |
| | | </if> |
| | | |
| | | </where> |
| | | limit 0,1 |
| | | </select> |
| | | |
| | | |
| | | <select id="getseletShippingOrderDetaildeliverys" > |
| | | select customer_id,customer_name,project,salesman,salesman_id from sd.`order` |
| | | <where> |
| | | <if test="orderDetail.orderId != null and orderDetail.orderId != ''"> |
| | | and order_id regexp #{orderDetail.orderId} |
| | | </if> |
| | | |
| | | </where> |
| | | limit 0,1 |
| | | </select> |
| | | |
| | | <select id="getseletShippingOrder"> |
| | | select * from sd.delivery d |
| | | <where> |
| | | <if test="delivery.deliveryId != null and delivery.deliveryId != ''"> |
| | | and d.delivery_id regexp #{delivery.deliveryId} |
| | | </if> |
| | | <if test="delivery.creator != null and delivery.creator != ''"> |
| | | and d.creator regexp #{delivery.creator} |
| | | </if> |
| | | <if test="delivery.deliveryDate != null and delivery.deliveryDate != ''"> |
| | | and d.delivery_date regexp #{delivery.deliveryDate} |
| | | </if> |
| | | <if test="delivery.customerId != null and delivery.customerId != ''"> |
| | | and d.customer_id regexp #{delivery.customerId} |
| | | </if> |
| | | <if test="delivery.customerName != null and delivery.customerName != ''"> |
| | | and d.customer_name regexp #{delivery.customerName} |
| | | </if> |
| | | <if test="delivery.project != null and delivery.project != ''"> |
| | | and d.project regexp #{delivery.project} |
| | | </if> |
| | | <if test="delivery.orderId != null and delivery.orderId != ''"> |
| | | and d.order_id regexp #{delivery.orderId} |
| | | </if> |
| | | <if test="delivery.payMethod != null and delivery.payMethod != ''"> |
| | | and d.pay_method regexp #{delivery.payMethod} |
| | | </if> |
| | | <if test="delivery.quantity != null and delivery.quantity != ''"> |
| | | and d.quantity regexp #{delivery.quantity} |
| | | </if> |
| | | <if test="delivery.area != null and delivery.area != ''"> |
| | | and d.area regexp #{delivery.area} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="getseletShippingOrderPageTotal"> |
| | | select |
| | | CEILING(count(id)/#{pageSize}) |
| | | from sd.delivery |
| | | </select> |
| | | </mapper> |
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.sd.DeliveryDetailMapper"> |
| | | |
| | | <resultMap id="selectDeliveryFinishedGoodsInventoryOrderDetail" type="com.example.erp.entity.sd.OrderDetail"> |
| | | |
| | | <result column="order_id" property="orderId"/> |
| | | <result column="order_number" property="orderNumber"/> |
| | | <result column="o_quantity" property="quantity"/> |
| | | <result column="building_number" property="buildingNumber"/> |
| | | <result column="product_name" property="productName"/> |
| | | <result column="product_id" property="productId"/> |
| | | <result column="price" property="price"/> |
| | | <result column="width" property="width"/> |
| | | <result column="height" property="height"/> |
| | | <result column="shape" property="shape"/> |
| | | <result column="gross_area" property="grossArea"/> |
| | | <result column="compute_area" property="computeArea"/> |
| | | <result column="compute_gross_area" property="computeGrossArea"/> |
| | | <result column="processing_note" property="processingNote"/> |
| | | <result column="edging_type" property="edgingType"/> |
| | | <result column="perimeter" property="perimeter"/> |
| | | |
| | | <result column="delivery_num" property="deliveryNum"/> |
| | | |
| | | <result column="delivery_id" property="deliveryDetail.deliveryid"/> |
| | | |
| | | <result column="d_quantity" property="deliveryDetail.quantity"/> |
| | | <result column="money" property="deliveryDetail.money"/> |
| | | <result column="delivery_detail_remakes" property="deliveryDetail.deliveryDetailRemakes"/> |
| | | |
| | | <result column="batch" property="order.batch"/> |
| | | <result column="t_quantity" property="order.quantity"/> |
| | | |
| | | |
| | | <result column="customer_id" property="delivery.customerId"/> |
| | | <result column="customer_name" property="delivery.customerName"/> |
| | | <result column="project" property="delivery.project"/> |
| | | <result column="pay_method" property="delivery.payMethod"/> |
| | | <result column="pay_date" property="delivery.payDate"/> |
| | | <result column="contacts" property="delivery.contacts"/> |
| | | <result column="contact_number" property="delivery.contactNumber"/> |
| | | <result column="delivery_address" property="delivery.deliveryAddress"/> |
| | | <result column="remarks" property="delivery.remarks"/> |
| | | <result column="create_time" property="delivery.createTime"/> |
| | | <result column="delivery_date" property="delivery.deliveryDate"/> |
| | | <result column="creator" property="delivery.creator"/> |
| | | |
| | | <result column="quantity_available" property="finishedGoodsInventory.quantityAvailable"/> |
| | | <result column="storage_region" property="finishedGoodsInventory.storageRegion"/> |
| | | <result column="actual_signal_area" property="finishedGoodsInventory.actualSignalArea"/> |
| | | |
| | | |
| | | </resultMap> |
| | | |
| | | <update id="updateOrderDetailDeliveryNum"> |
| | | update sd.order_detail set delivery_num=#{finishedGoodsInventory.quantityAvailable} where order_id=#{orderId} and order_number=#{orderNumber} |
| | | </update> |
| | | |
| | | <select id="getdeliveryDetailmaximum" > |
| | | select count(*) from sd.delivery_detail where delivery_id=#{deliveryId} |
| | | </select> |
| | | |
| | | |
| | | <insert id="insertDeliveryDetail" useGeneratedKeys="true" > |
| | | insert into sd.delivery_detail (delivery_id,delivery_number,order_number, |
| | | area,order_id,quantity,money,delivery_detail_remakes,delivery_detail_state,create_time) |
| | | values ( |
| | | #{number} ,#{deliveryNumber},#{orderDetail.orderNumber},#{orderDetail.computeGrossArea}, |
| | | #{orderDetail.orderId},#{orderDetail.finishedGoodsInventory.quantityAvailable}, |
| | | #{orderDetail.price}*#{orderDetail.finishedGoodsInventory.quantityAvailable},'',1,now() |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | |
| | | <select id="getseletShippingOrderDetail" resultMap="selectDeliveryFinishedGoodsInventoryOrderDetail"> |
| | | select od.order_id,o.batch,fgi.quantity_available,od.quantity-dd.quantity as t_quantity,od.quantity as o_quantity,dd.quantity |
| | | as d_quantity,od.building_number,od.product_id,od.product_name,od.price,fgi.storage_region,dd.money,od.width, |
| | | od.height,od.shape,fgi.actual_signal_area,od.gross_area,od.compute_area,od.compute_gross_area, |
| | | od.processing_note,od.edging_type,od.perimeter,dd.delivery_detail_remakes |
| | | from sd.delivery_detail dd |
| | | left join sd.delivery d on dd.delivery_id=d.delivery_id |
| | | left join sd.order_detail od on dd.order_id=od.order_id and dd.order_number=od.order_number |
| | | left join sd.`order` o on dd.order_id=o.order_id |
| | | left join mm.finished_goods_inventory fgi on dd.order_id=fgi.order_id and dd.order_number=fgi.order_number |
| | | <where> |
| | | <if test="orderDetail.deliveryDetail.deliveryId != null and orderDetail.deliveryDetail.deliveryId != ''"> |
| | | and dd.delivery_id regexp #{orderDetail.deliveryDetail.deliveryId} |
| | | </if> |
| | | |
| | | </where> |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getseletShippingOrderDetailPageTotal"> |
| | | select |
| | | CEILING(count(dd.id)/#{pageSize}) |
| | | from sd.delivery_detail dd |
| | | left join sd.delivery d on dd.delivery_id=d.delivery_id |
| | | left join sd.order_detail od on dd.order_id=od.order_id and dd.order_number=od.order_number |
| | | left join sd.`order` o on dd.order_id=o.order_id |
| | | left join mm.finished_goods_inventory fgi on dd.order_id=fgi.order_id and dd.order_number=fgi.order_number |
| | | <where> |
| | | <if test="orderDetail.deliveryDetail.deliveryId != null and orderDetail.deliveryDetail.deliveryId != ''"> |
| | | and dd.delivery_id regexp #{orderDetail.deliveryDetail.deliveryId} |
| | | </if> |
| | | </where> |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getseletShippingOrderDetails" resultMap="selectDeliveryFinishedGoodsInventoryOrderDetail"> |
| | | select od.order_id, |
| | | od.order_number, |
| | | o.batch, |
| | | fgi.quantity_available, |
| | | od.quantity- od.delivery_num as t_quantity, |
| | | od.quantity as o_quantity, |
| | | od.delivery_num as d_quantity, |
| | | od.building_number, |
| | | od.product_id, |
| | | od.product_name, |
| | | od.price, |
| | | fgi.storage_region, |
| | | od.width, |
| | | od.height, |
| | | od.shape, |
| | | fgi.actual_signal_area, |
| | | od.gross_area, |
| | | od.compute_area, |
| | | od.compute_gross_area, |
| | | od.processing_note, |
| | | od.edging_type, |
| | | od.perimeter |
| | | from sd.order_detail od |
| | | left join sd.`order` o on od.order_id = o.order_id |
| | | left join mm.finished_goods_inventory fgi |
| | | on od.order_id = fgi.order_id and od.order_number = fgi.order_number |
| | | <where> |
| | | fgi.quantity_available > 0 and od.quantity > od.delivery_num |
| | | <if test="orderDetail.orderId != null and orderDetail.orderId != ''"> |
| | | and od.order_id regexp #{orderDetail.orderId} |
| | | </if> |
| | | </where> |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getseletShippingOrderDetailsPageTotal"> |
| | | select |
| | | CEILING(count(od.id)/#{pageSize}) |
| | | from sd.order_detail od |
| | | left join sd.`order` o on od.order_id = o.order_id |
| | | left join mm.finished_goods_inventory fgi |
| | | on od.order_id = fgi.order_id and od.order_number = fgi.order_number |
| | | <where> |
| | | fgi.quantity_available > 0 and od.quantity > od.delivery_num |
| | | <if test="orderDetail.orderId != null and orderDetail.orderId != ''"> |
| | | and od.order_id regexp #{orderDetail.orderId} |
| | | </if> |
| | | </where> |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | </mapper> |
| | |
| | | select * from mm.basic_warehouse_type where operate_type='领出'; |
| | | </select> |
| | | |
| | | <select id="getBasicWarehouseTypeRework" > |
| | | select * from mm.basic_warehouse_type where operate_type='返工'; |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.example.erp.mapper.mm.FinishedGoodsInventoryMapper"> |
| | | <!--映射成品库存--> |
| | | <!--映射成品库存--> |
| | | <resultMap id="selectFinishedGoodsInventory" type="com.example.erp.entity.mm.FinishedGoodsInventory"> |
| | | <id column="fid" property="id"/> |
| | | <result column="inventory" property="inventory"/> |
| | |
| | | <result column="product_id" property="orderDetail.productId"/> |
| | | |
| | | </resultMap> |
| | | <!--映射成品入库--> |
| | | <!--映射成品入库--> |
| | | <resultMap id="selectFlowCard" type="com.example.erp.entity.pp.FlowCard"> |
| | | <id column="id" property="id"/> |
| | | <result column="order_number" property="orderNumber"/> |
| | |
| | | <result column="quantity" property="orderDetail.quantity"/> |
| | | </resultMap> |
| | | |
| | | <!--映射成品出库--> |
| | | <!--映射成品出库--> |
| | | <resultMap id="selectDelivery" type="com.example.erp.entity.sd.OrderDetail"> |
| | | <id column="id" property="id"/> |
| | | <result column="building_number" property="buildingNumber"/> |
| | |
| | | |
| | | </resultMap> |
| | | |
| | | <!--映射订单调拨--> |
| | | <!--映射订单调拨--> |
| | | <resultMap id="selectDeliveryFinishedGoodsInventory" type="com.example.erp.entity.sd.OrderDetail"> |
| | | |
| | | <result column="width" property="width"/> |
| | |
| | | update mm.finished_goods_inventory |
| | | set inventory=inventory-#{quantity},quantity_available=quantity_available-#{quantity}, |
| | | update_time=now(),area=actual_signal_area*quantity_available |
| | | where order_number=#{orderNumber} and order_id=#{orderId} |
| | | </update> |
| | | |
| | | <update id="updateInventoryquantityInt"> |
| | | update mm.finished_goods_inventory |
| | | set quantity_available=quantity_available+#{quantity}, |
| | | update_time=now(),area=actual_signal_area*quantity_available |
| | | where order_number=#{orderNumber} and order_id=#{orderId} |
| | | </update> |
| | | |
| | | <update id="updateInventoryquantityOut"> |
| | | update mm.finished_goods_inventory |
| | | set quantity_available=quantity_available-#{quantity}, |
| | | update_time=now(),area=actual_signal_area*quantity_available |
| | | where order_number=#{orderNumber} and order_id=#{orderId} |
| | | </update> |
| | | |
| | | <update id="updateInventoryInventoryInt"> |
| | | update mm.finished_goods_inventory |
| | | set inventory=inventory+#{quantity} |
| | | where order_number=#{orderNumber} and order_id=#{orderId} |
| | | </update> |
| | | |
| | | <update id="updateInventoryInventoryOut"> |
| | | update mm.finished_goods_inventory |
| | | set inventory=inventory-#{quantity} |
| | | where order_number=#{orderNumber} and order_id=#{orderId} |
| | | </update> |
| | | |
| | |
| | | from mm.finished_goods_inventory fgi |
| | | left join sd.order_detail od on fgi.order_id = od.order_id and fgi.order_number = od.order_number |
| | | left join sd.`order` o on fgi.order_id = o.order_id |
| | | <where> |
| | | and fgi.quantity_available>0 |
| | | <if test="orderDetail.finishedGoodsInventory.orderId != null and orderDetail.finishedGoodsInventory.orderId != ''"> |
| | | and fgi.order_id regexp #{orderDetail.finishedGoodsInventory.orderId} |
| | | </if> |
| | | <if test="orderDetail.order.project != null and orderDetail.order.project != ''"> |
| | | and o.project regexp #{orderDetail.order.project} |
| | | </if> |
| | | <if test="orderDetail.finishedGoodsInventory.orderNumber != null and orderDetail.finishedGoodsInventory.orderNumber != ''"> |
| | | and fgi.order_number regexp #{orderDetail.finishedGoodsInventory.orderNumber} |
| | | </if> |
| | | <if test="orderDetail.finishedGoodsInventory.quantityAvailable != null and orderDetail.finishedGoodsInventory.quantityAvailable != ''"> |
| | | and fgi.quantity_available regexp #{orderDetail.finishedGoodsInventory.quantityAvailable} |
| | | </if> |
| | | <if test="orderDetail.productId != null and orderDetail.productId != ''"> |
| | | and od.product_id regexp #{orderDetail.productId} |
| | | </if> |
| | | <if test="orderDetail.productName != null and orderDetail.productName != ''"> |
| | | and od.product_name regexp #{orderDetail.productName} |
| | | </if> |
| | | <if test="orderDetail.width != null and orderDetail.width != ''"> |
| | | and od.width regexp #{orderDetail.width} |
| | | </if> |
| | | <if test="orderDetail.height != null and orderDetail.height != ''"> |
| | | and od.height regexp #{orderDetail.height} |
| | | </if> |
| | | <if test="orderDetail.order.customerId != null and orderDetail.order.customerId != ''"> |
| | | and o.customer_id regexp #{orderDetail.order.customerId} |
| | | </if> |
| | | <if test="orderDetail.order.customerName != null and orderDetail.order.customerName != ''"> |
| | | and o.customer_name regexp #{orderDetail.order.customerName} |
| | | </if> |
| | | <if test="orderDetail.finishedGoodsInventory.actualSignalArea != null and orderDetail.finishedGoodsInventory.actualSignalArea != ''"> |
| | | and fgi.actual_signal_area regexp #{orderDetail.finishedGoodsInventory.actualSignalArea} |
| | | </if> |
| | | <if test="orderDetail.finishedGoodsInventory.area != null and orderDetail.finishedGoodsInventory.area != ''"> |
| | | and fgi.area regexp #{orderDetail.finishedGoodsInventory.area} |
| | | </if> |
| | | <if test="orderDetail.finishedGoodsInventory.storageRegion != null and orderDetail.finishedGoodsInventory.storageRegion != ''"> |
| | | and fgi.storage_region regexp #{orderDetail.finishedGoodsInventory.storageRegion} |
| | | </if> |
| | | </where> |
| | | group by fgi.order_id, fgi.order_number) as zu |
| | | |
| | | limit #{offset},#{pageSize}; |
| | |
| | | |
| | | </resultMap> |
| | | |
| | | <update id="updateToExamine"> |
| | | update mm.finished_operate_log set reviewed=#{userName},reviewed_time=now(),status=#{type} where operation_order_number=#{finishedOperateLog.operationOrderNumber}; |
| | | </update> |
| | | |
| | | <select id="getSelectOperateRecord" resultMap="selectFinishedGoodsInventory"> |
| | | select fol.operation_order_number, |
| | | fol.order_id, |
| | |
| | | and fol.remarks regexp #{finishedOperateLog.remarksr} |
| | | </if> |
| | | </where> |
| | | |
| | | order by fol.`status` desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | |
| | | and fol.remarks regexp #{finishedOperateLog.remarksr} |
| | | </if> |
| | | </where> |
| | | order by fol.`status` desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | |
| | | ) |
| | | </insert> |
| | | |
| | | <insert id="insertFinishedOperateLogRework" useGeneratedKeys="true" > |
| | | insert into mm.finished_operate_log(operation_order_number, |
| | | order_id, |
| | | operation_number, |
| | | operate_type, |
| | | operator, |
| | | quantity, |
| | | operate_time, |
| | | status, |
| | | type, |
| | | remarks |
| | | ) |
| | | values ( |
| | | #{oddNumber} ,#{orderDetail.finishedGoodsInventory.orderId},#{orderDetail.finishedGoodsInventory.orderNumber} |
| | | ,"返工",#{userName},#{orderDetail.quantity},now(),"未审核",#{operateType},#{remarks} |
| | | ) |
| | | </insert> |
| | | |
| | | <insert id="insertFinishedOperateLogAllocate" useGeneratedKeys="true" > |
| | | insert into mm.finished_operate_log(operation_order_number, |
| | | order_id, |