|
@@ -2,13 +2,23 @@
|
|
|
<div class="app-container">
|
|
|
<!-- 查询和其他操作 -->
|
|
|
<div>
|
|
|
- <span >公司名称:</span>
|
|
|
- <el-select style="margin-bottom:20px" @focus="oncityList" v-model="customerName" size="medium" clearable value-key="areaId" filterable placeholder="请选择公司名称" >
|
|
|
+ <span style="font-size:14px">公司名称:</span>
|
|
|
+ <el-input
|
|
|
+ v-model="customerName"
|
|
|
+ clearable
|
|
|
+ placeholder="请输入公司名称"
|
|
|
+ style="width: 200px;margin-bottom:20px"
|
|
|
+ size="small"
|
|
|
+ class="filter-item"
|
|
|
+ />
|
|
|
+
|
|
|
+ <span style="font-size:14px">公司类型:</span>
|
|
|
+ <el-select style="margin-bottom:20px" v-model="typeId" size="medium" clearable value-key="areaId" filterable placeholder="请选择公司名称" >
|
|
|
<el-option
|
|
|
- v-for="item in areaList"
|
|
|
- :key="item.customerId"
|
|
|
- :label="item.linkmanName"
|
|
|
- :value="item.customerId">
|
|
|
+ v-for="item in customerType"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
|
|
@@ -25,74 +35,93 @@
|
|
|
</div>
|
|
|
<el-table v-loading="loading" :data="tableData" border style="width: 100%">
|
|
|
|
|
|
- <el-table-column label="公司编号" align="center">
|
|
|
+ <el-table-column label="公司编号" align="center" :show-overflow-tooltip="true">
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{ scope.row.customerId }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="公司公司名称" width="300" align="center">
|
|
|
+ <el-table-column label="客户名称" width="300" align="center" :show-overflow-tooltip="true">
|
|
|
<template slot-scope="scope">
|
|
|
- <span>{{ scope.row.linkmanName }}</span>
|
|
|
+ <span>{{ scope.row.customerName }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column label="公司联系人" width="200" align="center">
|
|
|
+ <el-table-column label="联系电话" width="200" align="center" :show-overflow-tooltip="true">
|
|
|
<template slot-scope="scope">
|
|
|
- <span>{{ scope.row.linkmanMobile }}</span>
|
|
|
+ <span>{{ scope.row.phone }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column label="公司邮箱" width="250" align="center">
|
|
|
+ <el-table-column label="邮箱" width="250" align="center" :show-overflow-tooltip="true">
|
|
|
<template slot-scope="scope">
|
|
|
- <span>{{ scope.row.linkmanEmail }}</span>
|
|
|
+ <span>{{ scope.row.email }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column label="状态" align="center">
|
|
|
+ <el-table-column label="公司类型" align="center" width="250" :show-overflow-tooltip="true">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-tag v-if="scope.row.status === 1" size="small">商用</el-tag>
|
|
|
- <el-tag v-if="scope.row.status === 2" size="small" type="danger">暂停</el-tag>
|
|
|
+ <span>{{scope.row.customerTypeDetails}}</span>
|
|
|
+ <!-- <span v-if="scope.row.customerTypeDetails === 1" size="small">有限责任公司(自然人独资)</span>
|
|
|
+ <span v-if="scope.row.customerTypeDetails === 2" size="small">有限责任公司(自然人投资或控股)</span>
|
|
|
+ <span v-if="scope.row.customerTypeDetails === 3" size="small">股份有限公司</span>
|
|
|
+ <span v-if="scope.row.customerTypeDetails === 4" size="small">有限合伙企业</span>
|
|
|
+ <span v-if="scope.row.customerTypeDetails === 5" size="small">外商独资公司</span>
|
|
|
+ <span v-if="scope.row.customerTypeDetails === 6" size="small">个人独资企业</span>
|
|
|
+ <span v-if="scope.row.customerTypeDetails === 7" size="small">国有独资公司</span>
|
|
|
+ <span v-if="scope.row.customerTypeDetails === 8" size="small">其他</span> -->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
-
|
|
|
- <!-- <el-table-column label="地址">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div v-for="(item,index) in scope.row.customerUsers" :key="index"> -->
|
|
|
- <el-table-column label="客户名称" align="center">
|
|
|
+ <el-table-column label="法定代表人" width="250" align="center" :show-overflow-tooltip="true">
|
|
|
<template slot-scope="scope">
|
|
|
- <div v-for="(item,index) in scope.row.customerUsers" :key="index">
|
|
|
- <span>{{ item.customerName}}</span>
|
|
|
- </div>
|
|
|
+ <span>{{ scope.row.legalPerson}}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
-
|
|
|
- <el-table-column label="客户电话" width="250" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div v-for="(item,index) in scope.row.customerUsers" :key="index">
|
|
|
- <span>{{item.customerTel}}</span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
+ <el-table-column label="经营范围" width="250" align="center" :show-overflow-tooltip="true">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.businessScope}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="注册资本" width="250" align="center" :show-overflow-tooltip="true">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.registeredCapital}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="成立日期" width="250" align="center" :show-overflow-tooltip="true">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.dateOfEstablishment}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="营业日期" width="250" align="center" :show-overflow-tooltip="true">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.businessDate}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="住所" width="250" align="center" :show-overflow-tooltip="true">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.residence}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="创建日期" width="250" align="center" :show-overflow-tooltip="true">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.createDate}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="修改日期" width="250" align="center" :show-overflow-tooltip="true">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.updateTime}}</span>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
+
|
|
|
<!-- </div>
|
|
|
</template>
|
|
|
</el-table-column> -->
|
|
|
|
|
|
|
|
|
- <el-table-column label="操作" fixed="right" width="235" min-width="150" align="center" v-if="type == 0">
|
|
|
+ <el-table-column label="操作" fixed="right" width="235" min-width="150" align="center" >
|
|
|
<template slot-scope="scope">
|
|
|
- <el-dropdown placement="bottom-start" trigger="click" class="dropdown" @command="handleCommand" >
|
|
|
- <span class="el-dropdown-link" @click="onuser">
|
|
|
- <i class="el-icon-aim"></i> 绑定账号<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
- </span>
|
|
|
- <el-dropdown-menu slot="dropdown">
|
|
|
- <el-scrollbar style="height:150px; max-height: 300px;" :wrapStyle="[{'overflow-x':'hidden'}]">
|
|
|
- <el-dropdown-item style="width:150px;text-align:center" v-for="(item,index) in orderlist" :key="index" :command="beforeHandleCommand(scope.row,item.userId)">{{item.username}}</el-dropdown-item>
|
|
|
- </el-scrollbar>
|
|
|
- </el-dropdown-menu>
|
|
|
- </el-dropdown>
|
|
|
<!-- <el-button type="text" icon="el-icon-view" @click="lookRecord(scope.row)">查看</el-button> -->
|
|
|
- <!-- <el-button type="text" icon="el-icon-edit" @click="handleEdit(scope.row)">编辑</el-button> -->
|
|
|
- <!-- <el-button type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button> -->
|
|
|
+ <el-button type="text" icon="el-icon-edit" @click="handleEdit(scope.row)">编辑</el-button>
|
|
|
+ <el-button type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -123,7 +152,7 @@
|
|
|
<!-- 新增修改界面 -->
|
|
|
<el-dialog
|
|
|
:title="isEditForm ? '编辑' : '新增'"
|
|
|
- width="50%"
|
|
|
+ width="45%"
|
|
|
:visible.sync="dialogVisible"
|
|
|
:close-on-click-modal="false"
|
|
|
>
|
|
@@ -136,37 +165,44 @@
|
|
|
style="text-align:left;"
|
|
|
@keyup.enter.native="submitForm()"
|
|
|
>
|
|
|
- <el-form-item width="50px" label="客户名称" prop="name" :label-width="formLabelWidth">
|
|
|
- <el-input style="width:50%" v-model="dataForm.customerName" placeholder="请输入优惠券名称" />
|
|
|
+ <el-form-item label="客户名称" prop="customerName" :label-width="formLabelWidth">
|
|
|
+ <el-input style="width:65%" v-model="dataForm.customerName" placeholder="请输入客户名称" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item style="width:50%" label="手机" prop="name" :label-width="formLabelWidth">
|
|
|
- <el-input style="width:50%" v-model="dataForm.phone" placeholder="请输入优惠券名称" />
|
|
|
+ <el-form-item label="手机" prop="phone" :label-width="formLabelWidth">
|
|
|
+ <el-input style="width:65%" v-model="dataForm.phone" placeholder="请输入手机" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="邮箱" prop="coupon" :label-width="formLabelWidth">
|
|
|
- <el-input style="width:50%" v-model="dataForm.email" placeholder="请输入优惠券金额" />
|
|
|
+ <el-form-item label="邮箱" prop="email" :label-width="formLabelWidth">
|
|
|
+ <el-input style="width:65%" v-model="dataForm.email" placeholder="请输入邮箱" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="公司类型" prop="coupon" :label-width="formLabelWidth">
|
|
|
- <el-input style="width:50%" v-model="dataForm.email" placeholder="请输入优惠券金额" />
|
|
|
+ <el-form-item label="公司类型" prop="type" :label-width="formLabelWidth">
|
|
|
+ <el-select style="width:65%" v-model="dataForm.type" size="medium" clearable value-key="areaId" filterable placeholder="请选择公司类型" >
|
|
|
+ <el-option
|
|
|
+ v-for="item in customerType"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="法定代表人" prop="coupon" :label-width="formLabelWidth">
|
|
|
- <el-input style="width:50%" v-model="dataForm.legalPerson" placeholder="请输入优惠券金额" />
|
|
|
+ <el-form-item label="法定代表人" prop="legalPerson" :label-width="formLabelWidth">
|
|
|
+ <el-input style="width:65%" v-model="dataForm.legalPerson" placeholder="请输入优惠券金额" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="经营范围" prop="coupon" :label-width="formLabelWidth">
|
|
|
- <el-input style="width:50%" v-model="dataForm.businessScope" placeholder="请输入优惠券金额" />
|
|
|
+ <el-form-item label="经营范围" prop="businessScope" :label-width="formLabelWidth">
|
|
|
+ <el-input style="width:65%" v-model="dataForm.businessScope" placeholder="请输入优惠券金额" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="注册资本" prop="coupon" :label-width="formLabelWidth">
|
|
|
- <el-input style="width:50%" v-model="dataForm.registeredCapital" placeholder="请输入优惠券金额" />
|
|
|
+ <el-form-item label="注册资本" prop="registeredCapital" :label-width="formLabelWidth">
|
|
|
+ <el-input style="width:65%" v-model="dataForm.registeredCapital" placeholder="请输入优惠券金额" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="住所" prop="coupon" :label-width="formLabelWidth">
|
|
|
- <el-input style="width:50%" v-model="dataForm.residence" placeholder="请输入优惠券金额" />
|
|
|
+ <el-form-item label="住所" prop="residence" :label-width="formLabelWidth">
|
|
|
+ <el-input style="width:65%" v-model="dataForm.residence" placeholder="请输入优惠券金额" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="成立日期" prop="dateOfEstablishment" :label-width="formLabelWidth">
|
|
|
<el-date-picker
|
|
|
v-model="dataForm.dateOfEstablishment"
|
|
|
type="datetime"
|
|
|
- style="width:50%"
|
|
|
+ style="width:65%"
|
|
|
format="yyyy-MM-dd HH:mm:ss"
|
|
|
- value-format="yyyy-MM-ddTHH:mm:ss"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
placeholder="选择开始日期时间"
|
|
|
/>
|
|
|
</el-form-item>
|
|
@@ -174,16 +210,16 @@
|
|
|
<el-date-picker
|
|
|
v-model="dataForm.businessDate"
|
|
|
type="datetime"
|
|
|
- style="width:50%"
|
|
|
+ style="width:65%"
|
|
|
format="yyyy-MM-dd HH:mm:ss"
|
|
|
- value-format="yyyy-MM-ddTHH:mm:ss"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
placeholder="选择结束日期时间"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button :size="size" @click="dialogVisible = false">取消</el-button>
|
|
|
- <el-button :size="size" type="primary" :loading="editLoading" @click="submitEditForm">确定</el-button>
|
|
|
+ <el-button :size="size" type="primary" @click="submitEditForm">确定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
|
|
@@ -192,8 +228,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {Listarea} from '@/api/dataForm'
|
|
|
-import { getList,addRecord,editRecord,deleteRecord,priceList,deletePrice,editperform,userOrder,editOrder} from '@/api/record'
|
|
|
+import {Listarea,} from '@/api/dataForm'
|
|
|
+import { customerList,addCustomer,editCustomer,deleteCustomer} from '@/api/record'
|
|
|
import { parseTime } from '@/utils/index'
|
|
|
import { getUserInfo} from '@/api/user'
|
|
|
|
|
@@ -204,47 +240,61 @@ export default {
|
|
|
tableData: [],
|
|
|
priceData:[],
|
|
|
customerName:"",
|
|
|
+ typeId:"",
|
|
|
+ customerType:[
|
|
|
+ {id:1,name:"有限责任公司(自然人独资)"},
|
|
|
+ {id:2,name: "有限责任公司(自然人投资或控股)"},
|
|
|
+ {id:3,name: "股份有限公司"},
|
|
|
+ {id:4,name: "有限合伙企业"},
|
|
|
+ {id:5,name: "外商独资公司"},
|
|
|
+ {id:6,name: "个人独资企业"},
|
|
|
+ {id:7,name: "国有独资公司"},
|
|
|
+ {id:8,name: "其他"}
|
|
|
+
|
|
|
+ ],
|
|
|
areaList:[],
|
|
|
query: {
|
|
|
name: ''
|
|
|
},
|
|
|
- title: '',
|
|
|
- dialogFormVisible: false, // 控制弹出框
|
|
|
- recordVisible:false,
|
|
|
formLabelWidth: '120px',
|
|
|
isEditForm: false,
|
|
|
currentPage: "1",
|
|
|
pageSize: 10,
|
|
|
total: 0, // 总数量
|
|
|
- // 分类菜单列表
|
|
|
- deptData: [],
|
|
|
- lookCord:[], //查看
|
|
|
- // tree配置项
|
|
|
- deptTreeProps: {
|
|
|
- label: 'name',
|
|
|
- children: 'children'
|
|
|
- },
|
|
|
- applyTime:null,
|
|
|
- editable:[],
|
|
|
dataForm: {
|
|
|
},
|
|
|
// 表单校验
|
|
|
- dataRule: {},
|
|
|
+ dataRule: {
|
|
|
+ customerName: [
|
|
|
+ { required: true, message: "请输入客户名称", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ // phone: [
|
|
|
+ // { required: true, message: "请输入手机号", trigger: "blur" },
|
|
|
+ // { validator: checkTel, trigger: "change" },
|
|
|
+ // ],
|
|
|
+ email: [
|
|
|
+ // { required: true, message: "请输入邮箱", trigger: "blur" },
|
|
|
+ {
|
|
|
+ pattern:
|
|
|
+ /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/,
|
|
|
+ message: "输入邮箱不合法",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ // type: [
|
|
|
+ // { required: true, message: "请选择用户类型", trigger: "change" },
|
|
|
+ // ],
|
|
|
+ // roleList: [
|
|
|
+ // { required: true, message: "请选择角色", trigger: "change" },
|
|
|
+ // ],
|
|
|
+ },
|
|
|
loading: false,
|
|
|
dialogVisible: false,
|
|
|
- editLoading: false,
|
|
|
- priceVisible:false,
|
|
|
- appId:"",
|
|
|
- partnerId:"",
|
|
|
- onOpen:false,
|
|
|
- userId:"",
|
|
|
- type:"",
|
|
|
- orderlist:[]
|
|
|
+
|
|
|
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- this.findUserInfo()
|
|
|
+ this.getTenantList()
|
|
|
console.log("res")
|
|
|
},
|
|
|
methods: {
|
|
@@ -252,13 +302,11 @@ export default {
|
|
|
getTenantList: function() {
|
|
|
this.loading = true
|
|
|
const params = new URLSearchParams()
|
|
|
- params.append('customerId', this.customerName)
|
|
|
+ params.append('type', this.typeId)
|
|
|
+ params.append('customerName', this.customerName)
|
|
|
params.append('current', this.currentPage)
|
|
|
params.append('size', this.pageSize)
|
|
|
- params.append('appName', this.query.name)
|
|
|
- params.append('type', this.type)
|
|
|
- params.append('userId', this.userId)
|
|
|
- getList(params).then(response => {
|
|
|
+ customerList(params).then(response => {
|
|
|
// console.log("code")
|
|
|
console.log(response)
|
|
|
this.loading = false
|
|
@@ -267,62 +315,8 @@ export default {
|
|
|
this.total = response.data.data.total;
|
|
|
})
|
|
|
},
|
|
|
- oncityList(){
|
|
|
- const params = new URLSearchParams()
|
|
|
- params.append('userId', this.userId)
|
|
|
- params.append('type', this.type)
|
|
|
- Listarea(params).then(res=>{
|
|
|
- this.areaList=res.data.data
|
|
|
- })
|
|
|
- },
|
|
|
- // 加载用户个人信息
|
|
|
- findUserInfo: function() {
|
|
|
- getUserInfo().then((res) => {
|
|
|
- this.userId=res.data.data.userId
|
|
|
- this.type=res.data.data.type
|
|
|
- this.getTenantList()
|
|
|
- })
|
|
|
|
|
|
- },
|
|
|
- //绑定账号
|
|
|
- userinfo:function(){
|
|
|
- userOrder().then(res=>{
|
|
|
- this.orderlist=res.data.data
|
|
|
- if(res.data.data == [] && res.data.data == null ){
|
|
|
- this.$message({
|
|
|
- message: '无绑定账号',
|
|
|
- type: 'warning'
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- beforeHandleCommand(row,id){
|
|
|
- return {
|
|
|
- areaManagerId: id, //key 是你自己想要的字段,值自己定义
|
|
|
- row: row,
|
|
|
- };
|
|
|
- },
|
|
|
- onuser:function(){
|
|
|
- this.userinfo()
|
|
|
- },
|
|
|
- handleCommand:function(command){
|
|
|
- console.log(command)
|
|
|
- console.log(this.dataForm)
|
|
|
- let value={"customerId":command.row.customerId,"userId":command.areaManagerId}
|
|
|
- console.log(value)
|
|
|
- this.$confirm('确认提交吗?', '提示', {}).then(() => {
|
|
|
- editOrder(value).then((res) => {
|
|
|
- if (res.data.code === 200) {
|
|
|
- this.$message({ message: '操作成功', type: 'success' })
|
|
|
- this.getTenantList()
|
|
|
- } else {
|
|
|
- this.$message({ message: res.data.msg, type: 'error' })
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
- // 查找
|
|
|
+
|
|
|
handleFind: function() {
|
|
|
this.currentPage="1"
|
|
|
this.getTenantList()
|
|
@@ -348,83 +342,35 @@ export default {
|
|
|
this.isEditForm = false
|
|
|
this.dialogVisible = true
|
|
|
this.dataForm = {}
|
|
|
+ if(this.$refs['dataForm']){
|
|
|
+ this.$refs["dataForm"].resetFields();
|
|
|
+ }
|
|
|
},
|
|
|
// 编辑界面
|
|
|
handleEdit: function(row) {
|
|
|
this.isEditForm = true
|
|
|
this.dialogVisible = true
|
|
|
- this.dataForm = row
|
|
|
- },
|
|
|
- //价格调整
|
|
|
- // priceRecord(row){
|
|
|
- // this.priceVisible=true
|
|
|
- // this.onOpen=false
|
|
|
- // this.appId=row.appId,
|
|
|
- // this.partnerId=row.partnerId
|
|
|
- // priceList({
|
|
|
- // appId:row.appId,
|
|
|
- // partnerId:row.partnerId
|
|
|
- // }).then(res=>{
|
|
|
- // this.priceData=res.data.data
|
|
|
- // console.log(this.priceData)
|
|
|
- // let len = this.priceData.length;
|
|
|
- // new Array(len)
|
|
|
- // this.editable = new Array(len);
|
|
|
- // })
|
|
|
-
|
|
|
- // },
|
|
|
-
|
|
|
- //文本框失去焦点
|
|
|
- onBurl(value,number){
|
|
|
- if(value && number){
|
|
|
- this.onOpen=false
|
|
|
- }
|
|
|
- },
|
|
|
- //添加价格
|
|
|
- priceAdd(row){
|
|
|
- this.priceData.push({
|
|
|
- appId: this.appId,
|
|
|
- facePrice: "",
|
|
|
- partnerId: this.partnerId,
|
|
|
- payPrice: "",
|
|
|
- })
|
|
|
- let len = this.priceData.length;
|
|
|
- new Array(len)
|
|
|
- this.editable = new Array(len);
|
|
|
- this.priceEdit(this.priceData.length-1)
|
|
|
- this.onOpen=true
|
|
|
- // console.log(this.priceData.slice(-2))
|
|
|
+ this.dataForm = JSON.parse(JSON.stringify(row))
|
|
|
+ if(this.$refs['dataForm']){
|
|
|
+ this.$refs["dataForm"].resetFields();
|
|
|
+ }
|
|
|
},
|
|
|
- //删除价格
|
|
|
- priceDelete(row,index){
|
|
|
- if(row.id==undefined){
|
|
|
- this.priceData.splice(index)
|
|
|
- this.onOpen=false
|
|
|
- console.log(index)
|
|
|
- console.log(this.priceData)
|
|
|
- }else{
|
|
|
- this.$confirm('此操作将删除该价格, 是否继续?', '提示', {
|
|
|
+ //删除
|
|
|
+ handleDelete(row,index){
|
|
|
+
|
|
|
+ this.$confirm('此操作将删除该公司, 是否继续?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
})
|
|
|
.then(() => {
|
|
|
- deletePrice(row.id).then(response => {
|
|
|
+ deleteCustomer(row.customerId).then(response => {
|
|
|
if (response.data.code === 200) {
|
|
|
this.$message({
|
|
|
type: 'success',
|
|
|
message: '操作成功'
|
|
|
})
|
|
|
- priceList({
|
|
|
- appId:this.appId,
|
|
|
- partnerId:this.partnerId
|
|
|
- }).then(res=>{
|
|
|
- this.priceData=res.data.result
|
|
|
- console.log(this.priceData)
|
|
|
- let len = this.priceData.length;
|
|
|
- new Array(len)
|
|
|
- this.editable = new Array(len);
|
|
|
- })
|
|
|
+ this.getTenantList()
|
|
|
} else {
|
|
|
this.$message({
|
|
|
type: 'error',
|
|
@@ -439,128 +385,40 @@ export default {
|
|
|
message: '已取消删除'
|
|
|
})
|
|
|
})
|
|
|
- }
|
|
|
|
|
|
},
|
|
|
- //编辑
|
|
|
- priceEdit(row,index){
|
|
|
-
|
|
|
- this.editable[row]==true
|
|
|
- // console.log(this.editable[row])
|
|
|
- this.editable[row] == !this.editable[row]
|
|
|
- if(this.editable[row]==undefined || this.editable[row]==false){
|
|
|
- this.editable[row] = true;
|
|
|
- this.$set(this.editable,row,true)
|
|
|
- this.editable[row] == !this.editable[row]
|
|
|
- // console.log(this.editable[row])
|
|
|
- }
|
|
|
- else{
|
|
|
- this.$set(this.editable,row,false)
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
- //完成修改
|
|
|
- perform(){
|
|
|
- console.log(this.priceData)
|
|
|
- this.$confirm('确认提交吗?', '提示', {}).then(() => {
|
|
|
- this.editLoading = true
|
|
|
- console.log("11223"+ JSON.stringify(this.dataForm))
|
|
|
- editperform(this.priceData).then((res) => {
|
|
|
- if (res.data.code === 200) {
|
|
|
- this.$message({ message: '操作成功', type: 'success' })
|
|
|
- } else {
|
|
|
- this.$message({ message: res.data.msg, type: 'error' })
|
|
|
- }
|
|
|
- this.editLoading = false
|
|
|
- this.priceVisible = false
|
|
|
- })
|
|
|
- this.editLoading = false
|
|
|
- this.priceVisible = false
|
|
|
+
|
|
|
+ submitEditForm(){
|
|
|
+ this.$refs['dataForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.isEditForm) {
|
|
|
+ // 更新字典
|
|
|
+ editCustomer(this.dataForm).then((res) => {
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ this.$message({ message: '操作成功', type: 'success' })
|
|
|
+ } else {
|
|
|
+ this.$message({ message: res.data.msg, type: 'error' })
|
|
|
+ }
|
|
|
+ this.dialogVisible = false
|
|
|
+ this.getTenantList()
|
|
|
})
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- handleDelete: function(row) {
|
|
|
- const that = this
|
|
|
- this.$confirm('此操作将删除该商户, 是否继续?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- deleteRecord(row.uuid).then(response => {
|
|
|
- if (response.data.code === 200) {
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '操作成功'
|
|
|
- })
|
|
|
- that.getTenantList()
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- type: 'error',
|
|
|
- message: response.data.msg
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- this.$message({
|
|
|
- type: 'info',
|
|
|
- message: '已取消删除'
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
- submitEditForm: function() {
|
|
|
- this.dataForm.activityStatus=false
|
|
|
- console.log(this.dataForm)
|
|
|
- if (this.isEditForm) {
|
|
|
- console.log("编辑")
|
|
|
- this.$refs['dataForm'].validate((valid) => {
|
|
|
- console.log("11" + valid)
|
|
|
- if (valid) {
|
|
|
- this.$confirm('确认提交吗?', '提示', {}).then(() => {
|
|
|
- this.editLoading = true
|
|
|
- console.log("11223"+ JSON.stringify(this.dataForm))
|
|
|
- editRecord(this.dataForm).then((res) => {
|
|
|
- if (res.data.code === 200) {
|
|
|
- this.$message({ message: '操作成功', type: 'success' })
|
|
|
- } else {
|
|
|
- this.$message({ message: res.data.msg, type: 'error' })
|
|
|
- }
|
|
|
- this.editLoading = false
|
|
|
- this.dataForm = {}
|
|
|
- this.recordVisible = false
|
|
|
- this.getTenantList()
|
|
|
- })
|
|
|
+ } else {
|
|
|
+ // 新增字典
|
|
|
+ addCustomer(this.dataForm).then((res) => {
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ this.$message({ message: '操作成功', type: 'success' })
|
|
|
+ } else {
|
|
|
+ this.$message({ message: res.data.msg, type: 'error' })
|
|
|
+ }
|
|
|
+ this.dialogVisible = false
|
|
|
+ this.getTenantList()
|
|
|
+ this.$refs['dataForm'].resetFields()
|
|
|
})
|
|
|
}
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.$refs['dataForm'].validate((valid) => {
|
|
|
- console.log("11223"+ JSON.stringify(this.dataForm))
|
|
|
- console.log("新增")
|
|
|
- if (valid) {
|
|
|
- this.$confirm('确认提交吗?', '提示', {}).then(() => {
|
|
|
- console.log("新增加商户"+this.dataForm)
|
|
|
- addRecord(this.dataForm).then((res) => {
|
|
|
- this.editLoading = true
|
|
|
- if (res.data.code === 200) {
|
|
|
- this.$message({ message: '操作成功', type: 'success' })
|
|
|
- } else {
|
|
|
- this.$message({ message: res.data.msg, type: 'error' })
|
|
|
- }
|
|
|
- this.editLoading = false
|
|
|
- this.$refs['dataForm'].resetFields()
|
|
|
- this.recordVisible = false
|
|
|
- this.getTenantList()
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|