| | |
| | | // 查询客户列表 |
| | | export function selectCustomPageList(query) { |
| | | return request({ |
| | | url: '/system/user/selectCustomPageList', |
| | | url: '/system/custom/selectCustomPageList', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | |
| | | // 新增客户 |
| | | export function addCustom(query) { |
| | | return request({ |
| | | url: '/system/user/addCustom', |
| | | url: '/system/custom/addCustom', |
| | | method: 'post', |
| | | params: query |
| | | data: query |
| | | }) |
| | | } |
| | | // 修改客户 |
| | | export function upCustom(query) { |
| | | return request({ |
| | | url: '/system/user/upCustom', |
| | | url: '/system/custom/upCustom', |
| | | method: 'post', |
| | | params: query |
| | | data: query |
| | | }) |
| | | } |
| | | // 删除客户 |
| | | export function delCustomById(query) { |
| | | return request({ |
| | | url: '/system/user/delCustomById', |
| | | url: '/system/custom/delCustomById', |
| | | method: 'post', |
| | | params: query |
| | | }) |
| | |
| | | // 获取单位 |
| | | export function selectCustomEnum() { |
| | | return request({ |
| | | url: '/user/selectCustomEnum', |
| | | url: '/system/custom/selectCustomEnum', |
| | | method: 'get', |
| | | }) |
| | | } |
| | |
| | | |
| | | <script> |
| | | import limsTable from '@/components/Table/lims-table.vue' |
| | | import {addCustom, selectCustomPageList, upCustom} from "@/api/system/customer"; |
| | | import {addCustom, delCustomById, selectCustomPageList, upCustom} from "@/api/system/customer"; |
| | | export default { |
| | | components: { |
| | | limsTable |
| | |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.openFormDia('edit', row); |
| | | }, |
| | | },{ |
| | | name: '删除', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.delete(row); |
| | | }, |
| | | }, |
| | | ] |
| | |
| | | selectCustomPageList({...this.queryParams, ...this.page}).then(res => { |
| | | this.tableLoading = false |
| | | if (res.code === 200) { |
| | | this.tableData = res.data |
| | | this.page.total = res.total |
| | | this.tableData = res.data.records |
| | | this.page.total = res.data.total |
| | | } |
| | | }).catch(err => { |
| | | this.tableLoading = false |
| | |
| | | this.addDia = true |
| | | this.formTitle = type === 'add' ? '新增客户' : '编辑客户' |
| | | this.operationType = type |
| | | if (type === 'edit') { |
| | | this.user = row |
| | | } |
| | | }, |
| | | customAdd() { |
| | | this.$refs['userForm'].validate((valid) => { |
| | |
| | | reset () { |
| | | this.addDia = false |
| | | this.resetForm("userForm"); |
| | | }, |
| | | delete (row) { |
| | | this.$confirm('是否删除当前数据?', "警告", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }).then(() => { |
| | | delCustomById({id: row.id}).then(res => { |
| | | if (res.code === 500) { |
| | | return |
| | | } |
| | | this.$message.success('删除成功') |
| | | this.getList() |
| | | }).catch(e => { |
| | | this.$message.error('删除失败') |
| | | }) |
| | | }).catch(() => {}) |
| | | } |
| | | } |
| | | } |
| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="单位" prop="company"> |
| | | <el-select v-model="form.company" placeholder="请选择岗位" style="width: 100%" clearable> |
| | | <el-option v-for="item in postOptions" :key="item.postId" :label="item.postName" :value="item.postId"></el-option> |
| | | <el-select v-model="form.company" placeholder="请选择单位" style="width: 100%" clearable> |
| | | <el-option v-for="item in postOptions" :key="item.id" :label="item.company" :value="item.id"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |