guoyuji
2024-06-18 e827178c2b6b9f4883a5bcecc90a8be2c4f525df
打印界面以及添加审核人信息
11个文件已修改
208 ■■■■■ 已修改文件
north-glass-erp/northglass-erp/package-lock.json 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/package.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet1.vue 66 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet3.vue 55 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/main.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/order/SelectOrder.vue 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/sd/OrderController.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/sd/OrderMapper.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/package-lock.json
@@ -21,6 +21,7 @@
        "vue-draggable-plus": "^0.5.0",
        "vue-i18n": "^9.10.1",
        "vue-router": "^4.2.4",
        "vue3-print-nb": "^0.1.4",
        "vxe-table": "^4.5.15",
        "xe-utils": "^3.5.14",
        "xlsx": "^0.18.5"
@@ -1824,6 +1825,14 @@
        "vue": "^3.2.0"
      }
    },
    "node_modules/vue3-print-nb": {
      "version": "0.1.4",
      "resolved": "https://registry.npmmirror.com/vue3-print-nb/-/vue3-print-nb-0.1.4.tgz",
      "integrity": "sha512-LExI7viEzplR6ZKQ2b+V4U0cwGYbVD4fut/XHvk3UPGlT5CcvIGs6VlwGp107aKgk6P8Pgx4rco3Rehv2lti3A==",
      "dependencies": {
        "vue": "^3.0.5"
      }
    },
    "node_modules/vxe-table": {
      "version": "4.5.15",
      "resolved": "https://registry.npmjs.org/vxe-table/-/vxe-table-4.5.15.tgz",
@@ -3078,6 +3087,14 @@
        "@vue/devtools-api": "^6.5.0"
      }
    },
    "vue3-print-nb": {
      "version": "0.1.4",
      "resolved": "https://registry.npmmirror.com/vue3-print-nb/-/vue3-print-nb-0.1.4.tgz",
      "integrity": "sha512-LExI7viEzplR6ZKQ2b+V4U0cwGYbVD4fut/XHvk3UPGlT5CcvIGs6VlwGp107aKgk6P8Pgx4rco3Rehv2lti3A==",
      "requires": {
        "vue": "^3.0.5"
      }
    },
    "vxe-table": {
      "version": "4.5.15",
      "resolved": "https://registry.npmjs.org/vxe-table/-/vxe-table-4.5.15.tgz",
north-glass-erp/northglass-erp/package.json
@@ -21,6 +21,7 @@
    "vue-draggable-plus": "^0.5.0",
    "vue-i18n": "^9.10.1",
    "vue-router": "^4.2.4",
    "vue3-print-nb": "^0.1.4",
    "vxe-table": "^4.5.15",
    "xe-utils": "^3.5.14",
    "xlsx": "^0.18.5"
north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet1.vue
@@ -2,6 +2,24 @@
import request from "@/utils/request"
import {computed, onMounted, ref} from "vue"
//这里是打印的配置项
const  print=ref({
  id: 'printBox',//这里的id就是上面我们的打印区域id,实现指哪打哪
  popTitle: '配置页眉标题', // 打印配置页上方的标题
  extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割
  preview: false, // 是否启动预览模式,默认是false
  previewTitle: '预览的标题', // 打印预览的标题
  previewPrintBtnLabel: '预览结束,开始打印', // 打印预览的标题下方的按钮文本,点击可进入打印
  zIndex: 20002, // 预览窗口的z-index,默认是20002,最好比默认值更高
  previewBeforeOpenCallback() { console.log('正在加载预览窗口!'); }, // 预览窗口打开之前的callback
  previewOpenCallback() { console.log('已经加载完预览窗口,预览打开了!') }, // 预览窗口打开时的callback
  beforeOpenCallback() { console.log('开始打印之前!') }, // 开始打印之前的callback
  openCallback() { console.log('执行打印了!') }, // 调用打印时的callback
  closeCallback() { console.log('关闭了打印工具!') }, // 关闭打印的callback(无法区分确认or取消)
  clickMounted() { console.log('点击v-print绑定的按钮了!') },
})
let props = defineProps({
  orderId:null
})
@@ -63,6 +81,22 @@
  return parseFloat(perimeter.toFixed(3))
}
const printSheet = () => {
  // printJS({
  //   printable:'sheet',
  //   type:'html',
  //   //style:styleAll(),
  //   targetStyles: ['*']
  //   //scanStyles:false
  // })
}
defineExpose({
  printSheet
});
</script>
@@ -70,8 +104,13 @@
  <div id="sheet">
    <el-row style="margin-bottom: 0.5rem;">
      <img src="../../../assets/northGlass.ico" alt="" style="max-width: 60px;max-height: 60px">
      <h1>天津北玻玻璃工业技术有限公司(THBB-QR7.1-01)</h1>
      <el-col :span="24">
        <h1>
          <img src="../../../assets/northGlass.ico" alt="" style="float: left;max-width: 60px;max-height: 60px">
          天津北玻玻璃工业技术有限公司(THBB-QR7.1-01)
        </h1>
      </el-col>
    </el-row >
    <el-row style="text-align: left">
      <el-col :span="2" ></el-col>
@@ -84,35 +123,36 @@
    <hr class="hr-border">
    <el-row >
       <h3>玻璃加工单</h3>
      <el-col :span="24"><h3>玻璃加工单</h3></el-col>
    </el-row>
    <table border="1">
    <table >
      <tr>
        <th class="title-1">客户名称</th>
        <th colspan="3"></th>
        <th colspan="3">{{data.order.customerName}}</th>
        <th class="title-1">工程名称</th>
        <th colspan="3"></th>
        <th colspan="3">{{data.order.project}}</th>
      </tr>
      <tr>
        <th class="title-1">生产单号</th>
        <th></th>
        <th>{{data.order.orderId}}</th>
        <th class="title-1">下单日期</th>
        <th></th>
        <th>{{data.order.createTime}}</th>
        <th class="title-1">订单类型</th>
        <th></th>
        <th>{{data.order.orderType}}</th>
        <th class="title-1">跟单员</th>
        <th></th>
        <th>{{data.order.creator}}</th>
      </tr>
      <tr>
        <th>磨边</th>
        <th></th>
        <th>完工日期</th>
        <th></th>
        <th>{{data.order.deliveryDate}}</th>
        <th>商标</th>
        <th></th>
        <th>{{data.order.icon}}</th>
        <th>包装</th>
        <th></th>
        <th>{{data.order.packType}}</th>
      </tr>
    </table>
north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet3.vue
@@ -1,45 +1,16 @@
<script setup>
</script>
<template>
  <div>
    <table border="1">
      <tr v-for="(outerItem, outerIndex) in outerArray" :key="outerIndex">
        <td :rowspan="outerItem.rowspan">{{ outerItem.name }}</td>
        <template v-for="(middleItem, middleIndex) in outerItem.middleArray">
          <tr v-for="(innerItem, innerIndex) in middleItem.innerArray" :key="innerIndex">
            <td v-for="(deepItem, deepIndex) in innerItem.deepArray" :key="deepIndex">
              {{ deepItem }}
            </td>
          </tr>
        </template>
      </tr>
    </table>
  </div>
</template>
<script>
export default {
  data() {
    return {
      outerArray: [
        {
          name: 'Outer 1',
          middleArray: [
            {
              innerArray: [
                { deepArray: ['Deep 1.1', 'Deep 1.2', 'Deep 1.3'] },
                { deepArray: ['Deep 1.4', 'Deep 1.5', 'Deep 1.6'] }
              ]
            },
            {
              innerArray: [
                { deepArray: ['Deep 2.1', 'Deep 2.2', 'Deep 2.3'] },
                { deepArray: ['Deep 2.4', 'Deep 2.5', 'Deep 2.6'] }
              ]
            }
          ]
        },
        // ... 更多 outer items
      ]
    };
  }
};
</script>
<style scoped>
</style>
north-glass-erp/northglass-erp/src/main.js
@@ -11,6 +11,7 @@
import VXETable from 'vxe-table'
import 'vxe-table/lib/style.css'
import i18n from "@/lang"
import print from 'vue3-print-nb'
@@ -24,5 +25,6 @@
    locale: zhCn,
})
app.use(i18n)
app.use(print)
app.mount('#app')
north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue
@@ -58,8 +58,8 @@
  otherMoneyRemarks:'',
  processingNote:'',
  createOrder:0,
  creatorId:userStore.user.userName,
  creator:userStore.user.userId,
  creatorId:userStore.user.userId,
  creator:userStore.user.userName,
})
//定义接收加载表头下拉数据
const titleSelectJson = ref({
@@ -139,7 +139,7 @@
  },//表头参数
  columns:[
    {type: 'seq',fixed:"left", title: t('basicData.Number'), width: 80 },
    // {field: 'buildingNumber',width:120,  title: '楼号',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter'}, sortable: true,filterMethod:filterChanged},
    {field: 'buildingNumber',width:120,  title: '楼号',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter'}, sortable: true,filterMethod:filterChanged},
    {field: 'productId',width:140,  title: t('order.productId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
    {field: 'productName',width:300,  title: t('order.product'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
    {field: 'price',width:140,  title: t('order.price'),editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
@@ -701,7 +701,7 @@
// 审核订单
const reviewOrder = (state) => {
  request.post(`/order/reviewOrderById/${titleUploadData.value.orderId}/${state}`).then(res =>{
  request.post(`/order/reviewOrderById/${titleUploadData.value.orderId}/${state}/${userStore.user.userId}/${userStore.user.userName}`).then(res =>{
    if(res.code==200){
      gridOptions.toolbarConfig.buttons[2].disabled = true
      if(state==2){
north-glass-erp/northglass-erp/src/views/sd/order/SelectOrder.vue
@@ -1,12 +1,11 @@
<script setup>
  import {Search} from "@element-plus/icons-vue"
  import {useRouter} from "vue-router"
  import {computed, nextTick, onUnmounted, reactive, ref} from "vue"
  import ProcessCardProgress from '@/views/pp/report/ProcessCardProgress.vue'
  import {computed, reactive, ref} from "vue"
  import request from "@/utils/request"
  import deepClone from "@/utils/deepClone"
  import {ElMessage} from "element-plus"
  import {VXETable} from "vxe-table"
  import {Edit, VXETable} from "vxe-table"
  import  useUserInfoStore from '@/stores/userInfo'
  import footSum from "@/hook/footSum"
  import OrderDetail from "@/components/sd/order/OrderDetail.vue"
@@ -16,7 +15,7 @@
  import PrintSheet2 from "@/components/sd/order/PrintSheet2.vue"
  import PrintSheet3 from "@/components/sd/order/PrintSheet3.vue"
  import {useI18n} from "vue-i18n"
  import {columnDrop2, sortable2} from "@/hook/columnMove";
  import {Download, Printer} from "@element-plus/icons-vue/global";
  const { t } = useI18n()
  const userStore = useUserInfoStore()
  const tabsValue=ref('1')
@@ -348,20 +347,9 @@
  // let initTime = null
  // nextTick(() => {
  //   // 加载完成之后在绑定拖动事件
  //   initTime = setTimeout(() => {
  //     columnDrop2(xGrid.value)
  //   }, 500)
  // })
  //
  // onUnmounted(() => {
  //   clearTimeout(initTime)
  //   if (sortable2) {
  //     sortable2.destroy()
  //   }
  // })
  const printContent = ref({
    id: 'child',
  })
</script>
@@ -498,9 +486,14 @@
        destroy-on-close
        style="width: 75%;height:75% "
    >
      <print-sheet1 v-if="sheetIndex===1" :orderId="rowClickIndex.orderId" />
      <print-sheet2 v-else-if="sheetIndex===2" :orderId="rowClickIndex.orderId" />
      <print-sheet3 v-else :orderId="rowClickIndex.orderId" />
      <template #header="{ close, titleId, titleClass }">
        <el-button v-print="printContent"  :icon="Printer" circle />
        <el-button  :icon="Download" circle />
      </template>
      <print-sheet1 id="child"  v-if="sheetIndex===1" :orderId="rowClickIndex.orderId" />
      <print-sheet2 id="child" v-else-if="sheetIndex===2" :orderId="rowClickIndex.orderId" />
      <print-sheet3 id="child" v-else :orderId="rowClickIndex.orderId" />
    </el-dialog>
@@ -519,7 +512,7 @@
  height: 100%;
}
:deep(#print .el-dialog__body){
  height: 90%;
  height: 85%;
  width: 100%;
  overflow-y: auto;
}
north-glass-erp/src/main/java/com/example/erp/controller/sd/OrderController.java
@@ -90,9 +90,11 @@
    }
    @ApiOperation("审核订单")
    @SaCheckPermission("createOrder.review")
    @PostMapping("/reviewOrderById/{id}/{status}")
    public Result reviewOrderById(@PathVariable String id,@PathVariable Integer status)  {
        return  Result.seccess(orderService.reviewOrderById(id,status));
    @PostMapping("/reviewOrderById/{id}/{status}/{userId}/{userName}")
    public Result reviewOrderById(@PathVariable String id,
                                  @PathVariable Integer status
                                      ,@PathVariable String userId,@PathVariable String userName)  {
        return  Result.seccess(orderService.reviewOrderById(id,status,userId,userName));
    }
    @ApiOperation("审核工艺")
north-glass-erp/src/main/java/com/example/erp/mapper/sd/OrderMapper.java
@@ -2,11 +2,9 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.erp.entity.sd.Order;
import com.example.erp.entity.sd.Product;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;
@@ -19,7 +17,7 @@
    List<Order> getOrderList(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 reviewOrderById(String id, Integer status, String userId, String userName);
    boolean reviewProcessById(String id, Integer status);
north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java
@@ -15,7 +15,6 @@
import com.example.erp.exception.ServiceException;
import com.example.erp.mapper.sd.*;
import com.example.erp.service.userInfo.SysErrorService;
import com.sun.org.apache.regexp.internal.RE;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
@@ -236,12 +235,12 @@
        return map;
    }
    //订单审核
    public boolean reviewOrderById(String id,Integer status) {
    public boolean reviewOrderById(String id, Integer status, String userId, String userName) {
        Order order = orderMapper.selectOne(new QueryWrapper<Order>().eq("order_id",id));
        if(order.getProcessReview()!=2){
            throw  new ServiceException(Constants.Code_600,"该订单还未审核");
        }
        return orderMapper.reviewOrderById(id,status);
        return orderMapper.reviewOrderById(id,status,userId,userName);
    }
    //工艺审核界面审核更新数据
    public boolean reviewProcessById(String id, Integer status,List<OrderGlassDetail> orderGlassDetails) {
north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml
@@ -181,7 +181,10 @@
    </select>
    
    <update id="reviewOrderById">
        update `order` set order_review = #{status} where order_id = #{id}
        update `order` set order_review = #{status},
                           verifier_id = #{userId},
                           verifier = #{userName}
                           where order_id = #{id}
    </update>
    <update id="reviewProcessById">