222 lines
7.6 KiB
Vue
222 lines
7.6 KiB
Vue
|
<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>
|