bug
This commit is contained in:
parent
d05c5d8efb
commit
b1b8797ad0
28
fuintAdmin/src/api/staff/user/creditunit.js
Normal file
28
fuintAdmin/src/api/staff/user/creditunit.js
Normal file
@ -0,0 +1,28 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询挂账信息列表
|
||||
export function listCreditUnit(query) {
|
||||
return request({
|
||||
url: '/business/creditUnit/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询挂账信息列表
|
||||
export function listsCreditUnit(query) {
|
||||
return request({
|
||||
url: '/business/creditUnit/queryList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 新增挂账记录
|
||||
export function addCreditUnit(data) {
|
||||
return request({
|
||||
url: '/business/creditUnit',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
@ -632,6 +632,7 @@ export default {
|
||||
if (recovery==1){
|
||||
name = "确定要将此商品移至回收站吗?移出后将无法售卖当前商品!"
|
||||
prompt = "商品已移至回收站,收银台商品信息页面刷新后实时生效!"
|
||||
form.status = 'jy'
|
||||
}else {
|
||||
name = "确定要将此商品从回收站移至商品档案里吗?移出后将可售卖当前商品!"
|
||||
prompt = "商品已移至商品档案,收银台商品信息页面刷新后实时生效!"
|
||||
|
@ -101,7 +101,7 @@
|
||||
<span>{{ getName(supplierList, scope.row.supplierId) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="分类名称" align="center" prop="cvsGoodId">
|
||||
<el-table-column label="分类名称" align="center" prop="cvsGoodId" width="160">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getName(cvsGoodList, scope.row.cvsGoodId) }}</span>
|
||||
</template>
|
||||
@ -116,8 +116,8 @@
|
||||
<el-table-column label="成本金额" align="center" prop="costAmount" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status=='qy'">启用</el-tag>
|
||||
<el-tag type="info" v-if="scope.row.status=='jy'">禁用</el-tag>
|
||||
<el-tag v-if="scope.row.status=='qy'">上架</el-tag>
|
||||
<el-tag type="info" v-if="scope.row.status=='jy'">下架</el-tag>
|
||||
<!-- <dict-tag :options="dict.type.zhzt" :value="scope.row.status"/>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -288,6 +288,15 @@ export default {
|
||||
this.getTree();
|
||||
},
|
||||
methods: {
|
||||
getName(list,id){
|
||||
let name = ""
|
||||
list.forEach(item => {
|
||||
if (item.id==id){
|
||||
name = item.name;
|
||||
}
|
||||
})
|
||||
return name;
|
||||
},
|
||||
// 获取分类菜单
|
||||
getTree(){
|
||||
cvsGoodsTree().then(response => {
|
||||
|
221
fuintAdmin/src/views/member/creditIndex.vue
Normal file
221
fuintAdmin/src/views/member/creditIndex.vue
Normal file
@ -0,0 +1,221 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card >
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
|
||||
<el-form-item label="会员号" prop="userNo">
|
||||
<el-input
|
||||
v-model="queryParams.userNo"
|
||||
placeholder="请输入会员号"
|
||||
clearable
|
||||
style="width: 240px;"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="mobile">
|
||||
<el-input
|
||||
v-model="queryParams.mobile"
|
||||
placeholder="请输入会员手机号"
|
||||
clearable
|
||||
style="width: 240px;"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card style="margin-top: 20px">
|
||||
<div>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="handleAdd"
|
||||
>新增挂账单位</el-button>
|
||||
</div>
|
||||
|
||||
<el-table ref="tables" v-loading="loading" :data="list">
|
||||
<el-table-column type="index" width="80" align="center" label="序号"/>
|
||||
<el-table-column label="单位名称" prop="unitName" align="center" width="120"/>
|
||||
<el-table-column label="挂账人" prop="personCredit" align="center" width="160"/>
|
||||
<el-table-column label="联系电话" prop="contactMobile" align="center" width="120"/>
|
||||
<el-table-column label="预设挂账额度" prop="creditLimit" align="center" width="160"/>
|
||||
<el-table-column label="已使用挂账额度" prop="usedCreditLimit" align="center" width="160"/>
|
||||
<el-table-column label="剩余可挂账额度" prop="residueCreditLimit" align="center" width="160"/>
|
||||
<el-table-column label="备注" prop="remark" align="center" width="120"/>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status=='qy'">启用</el-tag>
|
||||
<el-tag type="info" v-if="scope.row.status=='jy'">禁用</el-tag>
|
||||
<!-- <dict-tag :options="dict.type.zhzt" :value="scope.row.status"/>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" width="160" prop="createTime">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="190" fixed='right'>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row,1)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.page"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
<!-- 新增挂账单位信息-->
|
||||
<el-dialog title="新增挂账单位" :visible.sync="open1" width="700px" append-to-body>
|
||||
<el-form ref="formName" :model="form1" :rules="rules1" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="挂账单位" prop="unitName">
|
||||
<el-input v-model="form1.unitName" show-word-limit placeholder="请输入挂账单位名称" maxlength="50" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="负责人" prop="personCredit">
|
||||
<el-input v-model="form1.personCredit" show-word-limit placeholder="请输入挂账单位负责人姓名" maxlength="10" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="联系电话" prop="contactMobile">
|
||||
<el-input v-model="form1.contactMobile" show-word-limit placeholder="请输入挂账单位联系电话" maxlength="15" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="挂账额度" prop="creditLimit">
|
||||
<el-input v-model="form1.creditLimit" placeholder="请输入挂账额度,为0则不限额" maxlength="30">
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
<span style="font-size: 12px;color: grey">
|
||||
0为不限额,额度为当前单位最大可挂账金额,如已挂账金额归还,额度将也同步返还
|
||||
</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="备注信息" prop="remark">
|
||||
<el-input v-model="form1.remark" type="textarea" placeholder="请输入内容"></el-input>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="单位状态" prop="status">
|
||||
<el-radio-group v-model="form1.status">
|
||||
<el-radio label="qy" value="qy">启用</el-radio>
|
||||
<el-radio label="jy" value="jy">禁用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="open1 = false">取 消</el-button>
|
||||
<el-button type="primary" @click="addCredit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {addCreditUnit, listsCreditUnit} from "@/api/staff/user/creditunit";
|
||||
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
list:[],
|
||||
loading:false,
|
||||
total:0,
|
||||
form1:{},
|
||||
open1:false,
|
||||
queryParams:{
|
||||
page:1,
|
||||
pageSize: 10,
|
||||
},
|
||||
rules1: {
|
||||
unitName: [ { required: true, message: "请填写挂账单位名称", trigger: "blur" }, ],
|
||||
personCredit: [{ required: true, message: "请填写挂账单位负责人姓名", trigger: "blur" }],
|
||||
contactMobile: [ { required: true, message: "请填写挂账单位联系电话", trigger: "blur" }, ],
|
||||
creditLimit: [ { required: true, message: "请填写挂账额度", trigger: "blur" }, ],
|
||||
status: [ { required: true, message: "请选择挂账单位状态", trigger: "blur" }, ],
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList(){
|
||||
this.loading = true;
|
||||
listsCreditUnit(this.queryParams).then(res => {
|
||||
this.list = res.data.records;
|
||||
this.total = res.data.total;
|
||||
this.loading = false;
|
||||
})
|
||||
},
|
||||
handleAdd(){
|
||||
|
||||
},
|
||||
handleUpdate(){
|
||||
|
||||
},
|
||||
handleDelete(){
|
||||
|
||||
},
|
||||
// 添加挂账单位信息
|
||||
addCredit(){
|
||||
this.$refs["formName"].validate((valid) => {
|
||||
if (valid) {
|
||||
addCreditUnit(this.form1).then( response => {
|
||||
this.$modal.msgSuccess("挂账单位信息创建成功");
|
||||
this.open1 = false;
|
||||
this.getList();
|
||||
})
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
})
|
||||
},
|
||||
// 搜索按钮操作
|
||||
handleQuery() {
|
||||
this.queryParams.page = 1;
|
||||
this.getList();
|
||||
},
|
||||
// 重置按钮操作
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.order.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.order.entity.CreditUnit;
|
||||
import com.fuint.business.order.service.CreditUnitService;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
@ -14,6 +15,18 @@ public class CreditUnitController extends BaseController {
|
||||
@Autowired
|
||||
private CreditUnitService creditUnitService;
|
||||
|
||||
/**
|
||||
* 查询所有挂账单位信息
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryList")
|
||||
private ResponseObject queryList(CreditUnit creditUnit,
|
||||
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
|
||||
Page page =new Page(pageNo,pageSize);
|
||||
return getSuccessResult(creditUnitService.selectCreditUnitList(page,creditUnit));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有挂账单位信息
|
||||
* @return
|
||||
|
@ -53,6 +53,14 @@ public class CreditUnit extends BaseEntity implements Serializable {
|
||||
* 挂账额度
|
||||
*/
|
||||
private Double creditLimit;
|
||||
/**
|
||||
* 挂账额度
|
||||
*/
|
||||
private Double usedCreditLimit;
|
||||
/**
|
||||
* 挂账额度
|
||||
*/
|
||||
private Double residueCreditLimit;
|
||||
/**
|
||||
* 单据备注
|
||||
*/
|
||||
|
@ -1,10 +1,20 @@
|
||||
package com.fuint.business.order.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.order.entity.CreditUnit;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 挂账单位信息 mapper层
|
||||
*/
|
||||
public interface CreditUnitMapper extends BaseMapper<CreditUnit> {
|
||||
/**
|
||||
* 根据条件分页查询挂账单位信息
|
||||
* @param page
|
||||
* @param creditUnit
|
||||
* @return
|
||||
*/
|
||||
public IPage<CreditUnit> selectCreditUnitList(Page page,@Param("creditUnit") CreditUnit creditUnit);
|
||||
}
|
||||
|
@ -0,0 +1,25 @@
|
||||
<?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.fuint.business.order.mapper.CreditUnitMapper">
|
||||
|
||||
<select id="selectCreditUnitList" resultType="com.fuint.business.order.entity.CreditUnit">
|
||||
select * from credit_unit
|
||||
<where>
|
||||
<if test="creditUnit.storeId != null and creditUnit.storeId != ''">
|
||||
and store_id = #{creditUnit.storeId}
|
||||
</if>
|
||||
<if test="creditUnit.status != null and creditUnit.status != ''">
|
||||
and status = #{creditUnit.status}
|
||||
</if>
|
||||
<if test="creditUnit.unitName != null and creditUnit.unitName != ''">
|
||||
and unit_name like concat('%', #{creditUnit.unitName}, '%')
|
||||
</if>
|
||||
<if test="creditUnit.personCredit != null and creditUnit.personCredit != ''">
|
||||
and person_credit like concat('%', #{creditUnit.personCredit}, '%')
|
||||
</if>
|
||||
<if test="creditUnit.contactMobile != null and creditUnit.contactMobile != ''">
|
||||
and contact_mobile like concat('%', #{creditUnit.contactMobile}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
@ -1,5 +1,7 @@
|
||||
package com.fuint.business.order.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.fuint.business.order.entity.CreditUnit;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -11,6 +13,14 @@ import java.util.List;
|
||||
*/
|
||||
@Transactional
|
||||
public interface CreditUnitService extends IService<CreditUnit> {
|
||||
/**
|
||||
* 根据条件分页查询挂账单位信息
|
||||
* @param page
|
||||
* @param creditUnit
|
||||
* @return
|
||||
*/
|
||||
public IPage<CreditUnit> selectCreditUnitList(Page page, CreditUnit creditUnit);
|
||||
|
||||
/**
|
||||
* 查询所有挂账单位信息
|
||||
* @return
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.fuint.business.order.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.order.entity.CreditUnit;
|
||||
import com.fuint.business.order.mapper.CreditUnitMapper;
|
||||
@ -18,13 +20,20 @@ import java.util.List;
|
||||
public class CreditUnitServiceImpl extends ServiceImpl<CreditUnitMapper, CreditUnit> implements CreditUnitService {
|
||||
@Autowired
|
||||
private ILJStoreService storeService;
|
||||
|
||||
@Override
|
||||
public IPage<CreditUnit> selectCreditUnitList(Page page, CreditUnit creditUnit) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
creditUnit.setStoreId(nowAccountInfo.getStoreId());
|
||||
return baseMapper.selectCreditUnitList(page,creditUnit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CreditUnit> selectCreditUnitList() {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
LJStore store = storeService.selectStoreByStoreId(nowAccountInfo.getStoreId());
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("status","qy");
|
||||
queryWrapper.eq("chain_store_id",store.getChainStoreId());
|
||||
queryWrapper.eq("store_id",nowAccountInfo.getStoreId());
|
||||
List<CreditUnit> list = baseMapper.selectList(queryWrapper);
|
||||
return list;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user