| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project version="4"> |
| | | <component name="dataSourceStorageLocal" created-in="IU-232.8660.185"> |
| | | <component name="dataSourceStorageLocal" created-in="IU-232.9559.62"> |
| | | <data-source name="@localhost [2]" uuid="165c5447-d19a-4aaf-af5f-cee92ae696c2"> |
| | | <database-info product="MySQL" version="8.0.22" jdbc-version="4.2" driver-name="MySQL Connector/J" driver-version="mysql-connector-java-8.0.25 (Revision: 08be9e9b4cba6aa115f9b27b215887af40b159e0)" dbms="MYSQL" exact-version="8.0.22" exact-driver-version="8.0"> |
| | | <extra-name-characters>#@</extra-name-characters> |
| | |
| | | <script lang="ts" setup> |
| | | import {reactive, ref} from "vue" |
| | | import {useRouter} from "vue-router" |
| | | 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" |
| | |
| | | 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,//保持源数据 |
| | |
| | | { |
| | | validator ({ cellValue }) { |
| | | const regex = /^(0|[1-9][0-9]{0,4}([.][0-9]{1,2})?)$/ |
| | | if (cellValue && !regex.test(cellValue)) { |
| | | if ( !regex.test(cellValue) ) { |
| | | return new Error('输入0.00~99999.99的数字') |
| | | } |
| | | } |
| | |
| | | { |
| | | validator ({ cellValue }) { |
| | | const regex = /^(0|[1-9][0-9]{0,4}([.][0-9]{1,2})?)$/ |
| | | if (cellValue && !regex.test(cellValue)) { |
| | | if (!regex.test(cellValue)) { |
| | | return new Error('输入0.00~99999.99的数字') |
| | | } |
| | | } |
| | |
| | | { |
| | | validator ({ cellValue }) { |
| | | const regex = /^(0|[1-9][0-9]{0,4}([.][0-9]{1,2})?)$/ |
| | | if (cellValue && !regex.test(cellValue)) { |
| | | if (!regex.test(cellValue)) { |
| | | return new Error('输入0.00~99999.99的数字') |
| | | } |
| | | } |
| | |
| | | { |
| | | validator ({ cellValue }) { |
| | | const regex = /^(0|[1-9][0-9]{0,4}([.][0-9]{1,2})?)$/ |
| | | if (cellValue && !regex.test(cellValue)) { |
| | | if ( !regex.test(cellValue)) { |
| | | return new Error('输入0.00~99999.99的数字') |
| | | } |
| | | } |
| | |
| | | toolbarConfig: { |
| | | buttons: [ |
| | | {'code': 'remarks', 'name': '加工要求'}, |
| | | {'code': 'Craft', 'name': '工艺',status: 'primary'}, |
| | | {'code': 'add', 'name': '审核',status: 'primary',disabled: true}, |
| | | {'code': 'Craft', 'name': '工艺',status: 'primary',disabled: true}, |
| | | {'code': 'review', 'name': '审核',status: 'primary',disabled: true}, |
| | | {'code': 'saveOrder', 'name': '保存',status: 'primary',icon: 'vxe-icon-save'} |
| | | ], |
| | | slots: { |
| | |
| | | break |
| | | } |
| | | case 'Craft': { |
| | | await router.push({path: '/main/order/updateOrderCraft', query: {orderID: 12123}}) |
| | | 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': { |
| | |
| | | } |
| | | } |
| | | |
| | | // 定义表头上传数据 |
| | | 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:'', |
| | | creatorId:userStore.user.userName, |
| | | creator:userStore.user.userId, |
| | | //初始化判断是否有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) |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | | orderType:[], |
| | | alType:[], |
| | | icon:[], |
| | | orderClassify:[], |
| | | packType:[], |
| | | customer:[], |
| | | saleMan:[] |
| | | }) |
| | | //页面第一次加载执行 |
| | | request.get(`/basicData/orderBasicData`).then((res) => { |
| | | |
| | |
| | | } |
| | | }) |
| | | |
| | | //保存订单方法 |
| | | const saveOrder = (order) => { |
| | | request.post(`/order/saveOrder`,order).then((res) => { |
| | | if(res.code==200){ |
| | |
| | | } |
| | | }) |
| | | } |
| | | // 审核订单 |
| | | 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 |
| | |
| | | </div> |
| | | <div class="order-detail"> |
| | | <vxe-grid |
| | | max-height="97%" |
| | | max-height="100%" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | |
| | | } |
| | | .order-detail{ |
| | | width: 100%; |
| | | height: 80%; |
| | | height: 85%; |
| | | } |
| | | |
| | | </style> |
| | |
| | | <script setup> |
| | | import {ArrowLeftBold, ArrowRight, Search} from "@element-plus/icons-vue" |
| | | import {useRouter} from "vue-router"; |
| | | import {useRouter,useRoute,onBeforeRouteUpdate} from "vue-router"; |
| | | import {watch} from "vue"; |
| | | |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | let indexFlag=$ref(1) |
| | | function changeRouter(index){ |
| | | indexFlag=index |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | </div> |
| | | |
| | | <div id="main-body"> |
| | | <router-view /> |
| | | <router-view :key="route.fullPath" /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | let filterData = ref({}) |
| | | let orderList = ref([]) |
| | | let pageNum=ref(1) |
| | | let pageTotal=ref() |
| | | let dataTotal=ref() |
| | | request.post(`/order/getOrderList/1/100/${orderType.value}/${selectDate.value}`,filterData).then((res) => { |
| | | let total = reactive({ |
| | | pageTotal : 0, |
| | | dataTotal : 0, |
| | | pageSize : 100 |
| | | }) |
| | | //加载请求 |
| | | request.post(`/order/getOrderList/1/${total.pageSize}/${orderType.value}/${selectDate.value}`,filterData).then((res) => { |
| | | if(res.code==200){ |
| | | console.log(res.data) |
| | | pageTotal.value=res.data.total |
| | | selectDate.value=res.data.selectDate |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal= res.data.total.pageTotal |
| | | selectDate.value = res.data.selectDate |
| | | orderList.value = deepClone(res.data.data) |
| | | xGrid.value.loadData(orderList.value) |
| | | }else{ |
| | |
| | | }else{ |
| | | filterData.value[column.property] = value |
| | | } |
| | | request.post(`/order/getOrderList/1/100/${orderType.value}/${selectDate.value}`,filterData.value).then((res) => { |
| | | request.post(`/order/getOrderList/1/${total.pageSize}/${orderType.value}/${selectDate.value}`,filterData.value).then((res) => { |
| | | if(res.code==200){ |
| | | pageTotal.value=parseInt(res.data.total) |
| | | total.pageTotal=parseInt(res.data.total) |
| | | pageNum.value=1 |
| | | orderList.value = deepClone(res.data.data) |
| | | xGrid.value.loadData(orderList.value) |
| | |
| | | dialogTableVisible.value = true |
| | | } |
| | | const selectOrderList = ()=>{ |
| | | request.post(`/order/getOrderList/1/100/${orderType.value}/${selectDate.value}`,filterData).then((res) => { |
| | | request.post(`/order/getOrderList/${pageNum.value}/${total.pageSize}/${orderType.value}/${selectDate.value}` |
| | | ,filterData).then((res) => { |
| | | if(res.code==200){ |
| | | pageTotal.value=res.data.total |
| | | //total.pageTotal = res.data.total.pageTotal |
| | | selectDate.value=res.data.selectDate |
| | | orderList.value = deepClone(res.data.data) |
| | | xGrid.value.loadData(orderList.value) |
| | |
| | | } |
| | | |
| | | const changeOrderType = ()=>{ |
| | | pageNum.value=1 |
| | | selectOrderList() |
| | | } |
| | | const changeDate = ()=>{ |
| | | pageNum.value=1 |
| | | selectOrderList() |
| | | } |
| | | |
| | | //页脚跳转 |
| | | const handlePageChange = ({ currentPage, pageSize }) => { |
| | | pageNum.value=currentPage |
| | | total.pageTotal = pageSize |
| | | selectOrderList() |
| | | } |
| | | |
| | | //页面跳转更新或者删除订单 |
| | | const getTableRow = (row,type) => { |
| | | switch (type) { |
| | | case 'edit': { |
| | | router.push({path:'/main/order/createOrder',query:{orderId:row.orderId}}) |
| | | break |
| | | } |
| | | case 'delete': { |
| | | request.post(`/order/deleteOrder/${row.orderId}`).then((res) => { |
| | | if(res.code==200){ |
| | | ElMessage.success('删除成功') |
| | | location.reload() |
| | | }else{ |
| | | ElMessage.warning('删除失败') |
| | | } |
| | | }) |
| | | break |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | </script> |
| | |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">编辑</el-button> |
| | | <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">删除</el-button> |
| | | <el-popconfirm @confirm="getTableRow(row,'delete')" title="确认删除订单?"> |
| | | <template #reference> |
| | | <el-button link type="primary" size="small">删除</el-button> |
| | | </template> |
| | | </el-popconfirm> |
| | | </template> |
| | | |
| | | <template #num1_filter="{ column, $panel }"> |
| | |
| | | <template #pager> |
| | | <!--使用 pager 插槽--> |
| | | <vxe-pager |
| | | @page-change="handlePageChange" |
| | | :layouts="[ 'PrevJump', 'PrevPage', 'Jump','PageCount', 'NextPage', 'NextJump', 'Total']" |
| | | v-model:current-page="pageNum" |
| | | v-model:page-size="pageTotal" |
| | | :total="dataTotal" |
| | | v-model:page-size="total.pageSize" |
| | | v-model:pager-count="total.pageTotal" |
| | | :total="total.dataTotal" |
| | | > |
| | | </vxe-pager> |
| | | </template> |
| | |
| | | <artifactId>spring-data-commons</artifactId> |
| | | <version>2.5.8</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.hibernate</groupId> |
| | | <artifactId>hibernate-core</artifactId> |
| | | <version>4.3.5.Final</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | |
| | | public Result getOrderList(@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable Integer orderType, @PathVariable List<String> selectDate, @RequestBody Order order) { |
| | | return Result.seccess(orderService.getOrderList(pageNum, pageSize, selectDate, order,orderType)); |
| | | } |
| | | |
| | | @PostMapping("/deleteOrder/{id}") |
| | | public Result deleteOrder(@PathVariable String id) { |
| | | return Result.seccess(orderService.deleteOrder(id)); |
| | | } |
| | | |
| | | @PostMapping("/getOrderById/{id}") |
| | | public Result getOrderById(@PathVariable String id) { |
| | | return Result.seccess(orderService.getOrderById(id)); |
| | | } |
| | | |
| | | @PostMapping("/reviewOrderById/{id}/{status}") |
| | | public Result reviewOrderById(@PathVariable String id,@PathVariable Integer status) { |
| | | return Result.seccess(orderService.reviewOrderById(id,status)); |
| | | } |
| | | |
| | | @PostMapping("/reviewProcessById/{id}/{status}") |
| | | public Result reviewProcessById(@PathVariable String id,@PathVariable Integer status) { |
| | | return Result.seccess(orderService.reviewProcessById(id,status)); |
| | | } |
| | | } |
| | |
| | | package com.example.erp.entity.sd; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | |
| | | private Long id; |
| | | private String orderId; |
| | | private String project; |
| | | private String customerId; |
| | | private Integer customerId; |
| | | private String customerName; |
| | | private String orderType; |
| | | private String orderClassify; |
| | |
| | | private String deliveryDate; |
| | | private String batch; |
| | | private Integer calculateType; |
| | | private String salesmanId; |
| | | private Integer salesmanId; |
| | | private String salesman; |
| | | private String alType; |
| | | private Double money; |
| | |
| | | private LocalDate createTime; |
| | | private LocalDate updateTime; |
| | | |
| | | @TableField(value = "customer_id") |
| | | private Customer customer; |
| | | |
| | | } |
| | |
| | | package com.example.erp.entity.sd; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.example.erp.entity.mm.FinishedGoodsInventory; |
| | | import lombok.Data; |
| | |
| | | private Integer state; |
| | | private LocalDate createTime; |
| | | private LocalDate updateTime; |
| | | @TableField(select = false) |
| | | private Order order; |
| | | @TableField(select = false) |
| | | private Delivery delivery; |
| | | @TableField(select = false) |
| | | private DeliveryDetail deliveryDetail; |
| | | @TableField(select = false) |
| | | private FinishedGoodsInventory finishedGoodsInventory; |
| | | //private Product product; |
| | | |
| | |
| | | boolean updateOrderParameter(@Param("orderId") String orderId); |
| | | |
| | | List<Order> getOrderList(Integer offset, Integer pageSize, String startDate, String endDate, Order order, Integer orderType); |
| | | Integer getPageTotal(Integer offset, Integer pageSize, String startDate, String endDate, Order order , Integer orderType); |
| | | Map<String,Integer> getPageTotal(Integer offset, Integer pageSize, String startDate, String endDate, Order order , Integer orderType); |
| | | |
| | | boolean reviewOrderById(String id,Integer status); |
| | | |
| | | boolean reviewProcessById(String id, Integer status); |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.example.erp.entity.sd.Order; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | |
| | | map.put("selectDate",list); |
| | | return map; |
| | | } |
| | | |
| | | public Integer deleteOrder(String id) { |
| | | return orderMapper.delete( |
| | | new QueryWrapper<Order>().eq("order_id",id) |
| | | ); |
| | | } |
| | | |
| | | |
| | | //查询订单主表与副表信息 |
| | | public Map<String,Object> getOrderById(String id) { |
| | | Order order = orderMapper.selectOne(new QueryWrapper<Order>().eq("order_id",id)); |
| | | List<OrderDetail> orderDetails = orderDetailMapper.selectList(new QueryWrapper<OrderDetail>().eq("order_id",id)); |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("order",order); |
| | | map.put("orderDetails",orderDetails); |
| | | return map; |
| | | } |
| | | |
| | | public boolean reviewOrderById(String id,Integer status) { |
| | | return orderMapper.reviewOrderById(id,status); |
| | | } |
| | | |
| | | public boolean reviewProcessById(String id, Integer status) { |
| | | return orderMapper.reviewProcessById(id,status); |
| | | } |
| | | } |
| | |
| | | |
| | | <select id="getPageTotal"> |
| | | select |
| | | CEILING(count(o.id)/#{pageSize}) |
| | | CEILING(count(o.id)/#{pageSize}) as 'pageTotal', |
| | | count(o.id) as 'total' |
| | | from |
| | | `order` as o |
| | | where o.create_time>=#{startDate} and o.create_time <= #{endDate} |
| | | where date (o.create_time)>=#{startDate} and date(o.create_time) <= #{endDate} |
| | | <if test="orderType!= null and orderType != ''"> |
| | | and o.create_order = #{orderType} |
| | | </if> |
| | |
| | | <if test="order.deliveryAddress != null and order.deliveryAddress != ''"> |
| | | and o.delivery_address REGEXP #{order.deliveryAddress} |
| | | </if> |
| | | |
| | | order by o.id desc |
| | | limit #{offset},#{pageSize} |
| | | </select> |
| | | |
| | | <update id="reviewOrderById"> |
| | | update `order` set order_review = #{status} where order_id = #{id} |
| | | </update> |
| | | |
| | | <update id="reviewProcessById"> |
| | | update `order` set process_review = #{status} where order_id = #{id} |
| | | </update> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | <select id="getPageTotal"> |
| | | select |
| | | CEILING(count(o.id)/#{pageSize}) |
| | | CEILING(count(o.id)/#{pageSize}) as 'pageTotal', |
| | | count(o.id) as 'total' |
| | | from |
| | | `order` as o |
| | | where o.create_time>=#{startDate} and o.create_time <= #{endDate} |
| | | where date (o.create_time)>=#{startDate} and date(o.create_time) <= #{endDate} |
| | | <if test="orderType!= null and orderType != ''"> |
| | | and o.create_order = #{orderType} |
| | | </if> |
| | |
| | | <if test="order.deliveryAddress != null and order.deliveryAddress != ''"> |
| | | and o.delivery_address REGEXP #{order.deliveryAddress} |
| | | </if> |
| | | |
| | | order by o.id desc |
| | | limit #{offset},#{pageSize} |
| | | </select> |
| | | |
| | | <update id="reviewOrderById"> |
| | | update `order` set order_review = #{status} where order_id = #{id} |
| | | </update> |
| | | |
| | | <update id="reviewProcessById"> |
| | | update `order` set process_review = #{status} where order_id = #{id} |
| | | </update> |
| | | |
| | | </mapper> |