guoyuji
2024-01-23 57976ad3ec3ea505ceb9dee7bc96d53da73a4546
加上相关注释
6个文件已修改
30 ■■■■ 已修改文件
north-glass-erp/northglass-erp/src/views/sd/product/SelectProduct.vue 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/ErpApplication.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/sd/ProductController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/sd/ProductService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/userInfo/UserService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/sd/Product.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/product/SelectProduct.vue
@@ -14,10 +14,17 @@
let router=useRouter()
//监听玻璃类型改变
let productList = ref([])
let date=ref(['',''])
let glassType = ref([])
watch(productGlassTypeStore,(newVal,oldVal) => {
  request.post("/product/1/100/"+productGlassTypeStore.GlassType,filterData.value).then((res) => {
})
const getProduct = () => {
  request.post(`/product/1/100/${productGlassTypeStore.GlassType}`,filterData.value).then((res) => {
    if(res.code==200){
      pageTotal.value=res.data.total
      xGrid.value.loadData(res.data.data)
@@ -26,9 +33,13 @@
      ElMessage.warning(res.msg)
    }
  })
}
})
//定义滚动条高度
let scrollTop =ref(null)
let scrollHeight =ref(null)
let clientHeight =ref(null)
@@ -38,6 +49,7 @@
  scrollHeight.value = row.$event.target.scrollHeight
  clientHeight.value = row.$event.target.clientHeight
}
//筛选条件,有外键需要先定义明细里面的数据
let filterData = ref({
  basicGlassType:{
    typeName:''
@@ -124,6 +136,7 @@
//第一次加载数据
request.post("/product/1/100/"+productGlassTypeStore.GlassType,filterData.value).then((res) => {
  if(res.code==200){
    console.log(res.data.data)
    pageTotal.value=res.data.total
    produceList = produceList.value.concat(deepClone(res.data.data))
    xGrid.value.reloadData(produceList)
@@ -323,6 +336,7 @@
  <div style="width: 100%;height: 100%">
      <glass-type   style="float: left" />
      <el-button
          @click="getProduct"
          id="select"
          type="primary" :icon="Search">查询</el-button>
north-glass-erp/src/main/java/com/example/erp/ErpApplication.java
@@ -4,10 +4,14 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.transaction.annotation.Transactional;
//springboot 启动入口
@SpringBootApplication
@EnableCaching
@EnableTransactionManagement//事务注解
//@Transactional//在service里面有多表操作,开启事务注解
public class ErpApplication {
    public static void main(String[] args) {
        SpringApplication.run(ErpApplication.class, args);
north-glass-erp/src/main/java/com/example/erp/controller/sd/ProductController.java
@@ -17,7 +17,6 @@
    @PostMapping  ("/{pageNum}/{pageSize}/{glassType}")
    public Result defaultDateProduct(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @PathVariable List<String> glassType, @RequestBody Product product){
        return Result.seccess(productService.defaultDateProduct(pageNum,pageSize,glassType,product));
    }
}
north-glass-erp/src/main/java/com/example/erp/service/sd/ProductService.java
@@ -26,4 +26,6 @@
        map.put("total",productMapper.getPageTotal(offset,pageSize,glassTypeId,product));
        return map;
    }
}
north-glass-erp/src/main/java/com/example/erp/service/userInfo/UserService.java
@@ -13,6 +13,7 @@
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@@ -54,7 +55,7 @@
        return userMapper.getUserByID(userId);
    }
    @Transactional
    public User register(User user) {
        User returnUser = new User();
        if(userMapper.register(user)){
north-glass-erp/src/main/resources/mapper/sd/Product.xml
@@ -15,10 +15,12 @@
        <result column="creator" property="creator"/>
        <result column="create_time" property="createTime"/>
        <result column="update_time" property="updateTime"/>
        <!--接收其他外键实体类数据-->
        <association property="basicGlassType" javaType="com.example.erp.entity.sd.BasicGlassType">
            <result column="type_id" property="typeID"/>
            <result column="type_name" property="typeName"/>
        </association>
        <!--<result column="g_typeId" property="glassTypes.typeId"/>
        <result column="g_type" property="glassTypes.type"/>-->