Commit c5404559 authored by 周远喜's avatar 周远喜

ok

parent cc41c501
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12">
<FormItem :label="l('projectId')" prop="projectId">
<InputNumber v-model="entity.projectId" style="width:240px"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('userId')" prop="userId">
<UserSelect ref="userSelected" v-model="entity.userId" />
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('proceeds')" prop="proceeds">
<InputNumber v-model="entity.proceeds" style="width:240px"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary code="crm.contract.status" v-model="entity.status"></Dictionary>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('accessory')" prop="accessory">
<files ref="refFile" :parms="parms" files />
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('notes')" prop="notes">
<Input v-model="entity.notes" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
disabled: false,
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
},
parms: {
app: 'contract',
eid: null,
name: '',
field: ''
}
}
},
props: {
v: Object
},
methods: {
handleSubmit() {
// alert(this.parms.eid)
this.$refs.form.validate((v) => {
if (v) {
this.entity.accessory = ''
if (this.$refs.refFile.nameList.length > 0) {
let nameList=this.$refs.refFile.nameList
let names=[]
nameList.forEach(e => {
names.push(e.fileName)
});
this.entity.accessory = JSON.stringify(names).replace('[','').replace(']','').replace(/\"/g,'')//附件本地库暂存文件名称
}
this.disabled = true
Api.create(this.entity)
.then((r) => {
this.disabled = false
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
let newId = r.result
this.updateEid(newId) //更新服务器上的id
// this.parms.eid = this.$u.guid() ???????
} else {
this.$Message.error('保存失败')
}
this.$refs.refFile.intFiles()
})
.catch((err) => {
this.disabled = false
this.$Message.error('保存失败')
console.warn(err)
})
}
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'Contract' + '.' + key
return this.$t(key)
},
//新增时将uid转为eid
updateEid(newId) {
let parms = {
eid: this.parms.eid,
id: newId + ''
}
this.$http.sysUser.updateEid(parms).then((res) => {
if (res.status) {
// this.$Message.success('修改成功!')
} else {
//this.$Message.error('修改失败!')
}
})
}
},
mounted() {
this.parms.eid = this.$u.guid()
this.$refs.refFile.intFiles()
},
watch: {
v() {
this.entity = this.$u.clone(this.v)
}
}
}
</script>
import Api from '@/plugins/request'
export default {
index: `${crmUrl}/contract/paged`,
paged(params) {
return Api.post(`${crmUrl}/contract/paged`, params);
},
get(params) {
return Api.get(`${crmUrl}/contract/get`, params);
},
create(params) {
return Api.post(`${crmUrl}/contract/create`, params);
},
update(params) {
return Api.post(`${crmUrl}/contract/update`, params);
},
//删除:
delete(params) {
return Api.delete(`${crmUrl}/contract/delete`, {
params: params
});
},
}
\ No newline at end of file
<template>
<div class="detail">
<Row>
<Filed :span="12" :name="l('projectId')">{{entity.projectId}}</Filed>
<Filed :span="12" :name="l('name')">{{entity.name}} </Filed>
<Filed :span="12" :name="l('userId')"><User :value="entity.userId" /></Filed>
<Filed :span="12" :name="l('proceeds')">{{entity.proceeds}}</Filed>
<Filed :span="24" :name="l('status')"><state code="crm.contract.status" :value="entity.status" type="text"></state></Filed>
<Filed :span="24" :name="l('accessory')"><files ref="refFile" :parms="parms" unClosable style="display:inline" /></Filed>
<Filed :span="24" :name="l('notes')">{{entity.notes}}</Filed>
</Row>
</div>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }],
code: [{ required: true, message: '必填', trigger: 'blur' }]
},
parms: {
app: 'contract',
eid: null,
name: '',
field: ''
},
}
},
props: {
eid: Number
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result
this.parms.eid = r.result.id
this.$refs.refFile.intFiles()
this.$emit('on-load')
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'Contract' + '.' + key
return this.$t(key)
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v)
}
}
}
}
</script>
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12">
<FormItem :label="l('projectId')" prop="projectId">
<InputNumber v-model="entity.projectId" style="width:240px"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('userId')" prop="userId">
<UserSelect ref="userSelected" v-model="entity.userId" />
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('proceeds')" prop="proceeds">
<InputNumber v-model="entity.proceeds" style="width:240px"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary code="crm.contract.status" v-model="entity.status"></Dictionary>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('accessory')" prop="accessory">
<files ref="refFile" :parms="parms" files />
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('notes')" prop="notes">
<Input v-model="entity.notes" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Edit',
data() {
return {
disabled: false,
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
},
parms: {
app: 'contract',
eid: null,
name: '',
field: ''
}
}
},
props: {
eid: Number
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result
this.parms.eid = r.result.id
this.$refs.refFile.intFiles()
this.$emit('on-load')
})
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true
if (this.$refs.refFile.nameList.length > 0) {
let nameList=this.$refs.refFile.nameList
let names=[]
nameList.forEach(e => {
names.push(e.fileName)
});
this.entity.accessory = JSON.stringify(names).replace('[','').replace(']','').replace(/\"/g,'')//附件本地库暂存文件名称
}
else
{
this.entity.accessory = ''
}
Api.update(this.entity)
.then((r) => {
this.disabled = false
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
} else {
this.$Message.error('保存失败')
}
})
.catch((err) => {
this.disabled = false
this.$Message.error('保存失败')
console.warn(err)
})
}
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'Contract' + '.' + key
return this.$t(key)
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v)
}
}
}
}
</script>
<template>
<div>
<DataGrid :columns="columns" ref="grid" :action="action">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input
placeholder="请输入关键字名称/附件/备注"
v-model="easySearch.keys.value"
search
enter-button
@on-search="search"
/>
</FormItem>
</Form>
</template>
<template slot="searchForm">
<Search />
</template>
<template slot="buttons">
<Button type="primary" @click="addModal=true">新增</Button>
</template>
</DataGrid>
<Modal v-model="addModal" title="新增" footer-hide width="1000">
<Add @on-close="cancel" @on-ok="addOk" />
</Modal>
<Modal v-model="editModal" title="编辑" footer-hide width="1000">
<Edit :eid="curId" @on-close="cancel" @on-ok="addOk" />
</Modal>
<Modal v-model="detailModal" title="详情" width="1000">
<Detail :eid="curId" />
</Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
<p>确定删除?</p>
</Modal>
</div>
</template>
<script>
import Api from './api'
import Add from './add'
import Edit from './edit'
import Detail from './detail'
import Search from './search'
export default {
name: 'list',
components: {
Add,
Edit,
Detail,
Search
},
data() {
return {
action: Api.index,
easySearch: {
keys: { op: 'name,accessory,notes', value: null }
},
addModal: false,
editModal: false,
detailModal: false,
deletelModal: false,
curId: 0,
columns: [
{ key: 'id', title: this.l('id'), hide: true, align: 'left' },
{
key: 'creationTime',
title: this.l('creationTime'),
hide: true,
align: 'left'
},
{
key: 'creatorUserId',
title: this.l('creatorUserId'),
hide: true,
align: 'left'
},
{
key: 'lastModificationTime',
title: this.l('lastModificationTime'),
hide: true,
align: 'left'
},
{
key: 'lastModifierUserId',
title: this.l('lastModifierUserId'),
hide: true,
align: 'left'
},
{
key: 'isDeleted',
title: this.l('isDeleted'),
hide: true,
align: 'left'
},
{
key: 'deletionTime',
title: this.l('deletionTime'),
hide: true,
align: 'left'
},
{
key: 'deleterUserId',
title: this.l('deleterUserId'),
hide: true,
align: 'left'
},
{
key: 'projectId',
title: this.l('projectId'),
align: 'left',
high: true,
width: 200
},
{
key: 'name',
title: this.l('name'),
align: 'left',
easy: true,
high: true
},
{
key: 'accessory',
title: this.l('accessory'),
align: 'center',
easy: true,
width: 100,
high: true,
render: (h, params) => {
return h('div', { class: 'action' }, [
h(
'op',
{
attrs: { oprate: 'detail' },
style: {
color: '#19BE6B',
cursor: 'pointer'
},
on: { click: () => this.detail(params.row.id) }
},
params.row.accessory != '' ? '附件' : ''
)
])
}
},
{
key: 'userId',
title: this.l('userId'),
align: 'left',
high: true,
type: 'user',
width: 160
},
{
key: 'proceeds',
title: this.l('proceeds'),
align: 'left',
high: true,
width: 180
},
{
key: 'status',
title: this.l('status'),
align: 'center',
high: true,
code: 'crm.contract.status',
width: 100
},
{
key: 'notes',
title: this.l('notes'),
align: 'left',
easy: true,
high: true
},
{
title: '操作',
key: 'action',
width: 140,
align: 'center',
render: (h, params) => {
return h('div', { class: 'action' }, [
h(
'op',
{
attrs: { oprate: 'detail' },
on: { click: () => this.detail(params.row.id) }
},
'查看'
),
h(
'op',
{
attrs: { oprate: 'edit' },
on: { click: () => this.edit(params.row.id) }
},
'编辑'
),
h(
'op',
{
attrs: { oprate: 'remove' },
on: { click: () => this.remove(params.row.id) }
},
'删除'
)
])
}
}
]
}
},
mounted() {
console.log(this)
},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
methods: {
addOk() {
this.$refs.grid.load()
this.addModal = false
this.detailModal = false
this.editModal = false
this.curId = 0
},
search() {
this.$refs.grid.reload(this.easySearch)
},
detail(id) {
setTimeout(() => {
this.detailModal = true
}, 400)
this.curId = id
},
edit(id) {
setTimeout(() => {
this.editModal = true
}, 400)
this.curId = id
},
remove(id) {
this.deletelModal = true
this.curId = id
},
removeOk() {
Api.delete({ id: this.curId }).then((r) => {
if (r.success) {
this.$refs.grid.load()
this.deletelModal = false
this.$Message.success('删除成功')
}
})
},
removeCancel() {
this.deletelModal = false
},
cancel() {
this.curId = 0
this.addModal = false
this.detailModal = false
this.editModal = false
this.deletedlModal = false
},
l(key) {
let vkey = 'Contract' + '.' + key
return this.$t(vkey) || key
}
}
}
</script>
<style lang="less">
</style>
\ No newline at end of file
<template>
<Form ref="form" :model="condition" :label-width="90">
<Row>
<!-- <Col :span="12" :v-if="condition.id.show">
<FormItem :label="l('id')" prop="id">
<Input v-model="condition.id.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.creationTime.show">
<FormItem :label="l('creationTime')" prop="creationTime">
<DatePicker type="daterange" v-model="condition.creationTime.value"></DatePicker>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.creatorUserId.show">
<FormItem :label="l('creatorUserId')" prop="creatorUserId">
<Input v-model="condition.creatorUserId.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.lastModificationTime.show">
<FormItem :label="l('lastModificationTime')" prop="lastModificationTime">
<DatePicker type="daterange" v-model="condition.lastModificationTime.value"></DatePicker>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.lastModifierUserId.show">
<FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId">
<Input v-model="condition.lastModifierUserId.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.isDeleted.show">
<FormItem :label="l('isDeleted')" prop="isDeleted">
<Input v-model="condition.isDeleted.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.deletionTime.show">
<FormItem :label="l('deletionTime')" prop="deletionTime">
<DatePicker type="daterange" v-model="condition.deletionTime.value"></DatePicker>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.deleterUserId.show">
<FormItem :label="l('deleterUserId')" prop="deleterUserId">
<Input v-model="condition.deleterUserId.value"></Input>
</FormItem>
</Col> -->
<Col :span="12" :v-if="condition.projectId.show">
<FormItem :label="l('projectId')" prop="projectId">
<Input v-model="condition.projectId.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.name.show">
<FormItem :label="l('name')" prop="name">
<Input v-model="condition.name.value"></Input>
</FormItem>
</Col>
<!-- <Col :span="24" :v-if="condition.accessory.show">
<FormItem :label="l('accessory')" prop="accessory">
<Input v-model="condition.accessory.value"></Input>
</FormItem>
</Col> -->
<Col :span="12" :v-if="condition.userId.show">
<FormItem :label="l('userId')" prop="userId">
<UserSelect ref="userSelected" v-model="condition.userId.value" />
</FormItem>
</Col>
<Col :span="12" :v-if="condition.proceeds.show">
<FormItem :label="l('proceeds')" prop="proceeds">
<Input v-model="condition.proceeds.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.status.show">
<FormItem :label="l('status')" prop="status">
<Dictionary code="crm.contract.status" v-model="condition.status.value"></Dictionary>
</FormItem>
</Col>
<Col :span="24" :v-if="condition.notes.show">
<FormItem :label="l('notes')" prop="notes">
<Input v-model="condition.notes.value"></Input>
</FormItem>
</Col>
</Row>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
condition: {
id: { op: 'Equal', value: null, show: false },
creationTime: { op: 'Range', value: null, show: false },
creatorUserId: { op: 'Equal', value: null, show: false },
lastModificationTime: { op: 'Range', value: null, show: false },
lastModifierUserId: { op: 'Equal', value: null, show: false },
isDeleted: { op: 'Equal', value: null, show: false },
deletionTime: { op: 'Range', value: null, show: false },
deleterUserId: { op: 'Equal', value: null, show: false },
projectId: { op: 'Equal', value: null, show: true },
name: { op: 'Equal', value: null, show: true },
accessory: { op: 'Equal', value: null, show: true },
userId: { op: 'Equal', value: null, show: true },
proceeds: { op: 'Equal', value: null, show: true },
status: { op: 'Equal', value: null, show: true },
notes: { op: 'Equal', value: null, show: true }
}
}
},
methods: {
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'Contract' + '.' + key
return this.$t(key)
}
}
}
</script>
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12">
<FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('abbre')" prop="abbre">
<Input v-model="entity.abbre"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('address')" prop="address">
<Input v-model="entity.address" type="textarea" :rows="2"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('principal')" prop="principal">
<Input v-model="entity.principal"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('telephone')" prop="telephone">
<Input v-model="entity.telephone"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('mobile')" prop="mobile">
<Input v-model="entity.mobile"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('type')" prop="type">
<Input v-model="entity.type"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('area')" prop="area">
<Input v-model="entity.area"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isInform')" prop="isInform">
<Dictionary code="crm.customer.isInform" v-model="entity.isInform" type="radio"></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary code="crm.customer.status" v-model="entity.status"></Dictionary>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('notes')" prop="notes">
<Input v-model="entity.notes" type="textarea" :rows="3"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('code')" prop="code">
<Input v-model="entity.code"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('trade')" prop="trade">
<Input v-model="entity.trade"></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
disabled: false,
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
v: Object
},
methods: {
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true
Api.create(this.entity)
.then((r) => {
this.disabled = false
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
} else {
this.$Message.error('保存失败')
}
})
.catch((err) => {
this.disabled = false
this.$Message.error('保存失败')
console.warn(err)
})
}
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'Customer' + '.' + key
return this.$t(key)
}
},
watch: {
v() {
this.entity = this.$u.clone(this.v)
}
}
}
</script>
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12">
<FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('shopName')" prop="shopName">
{{shopName}}
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('duties')" prop="duties">
<Input v-model="entity.duties"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('telephone')" prop="telephone">
<Input v-model="entity.telephone"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('mobile')" prop="mobile">
<Input v-model="entity.mobile"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary code="crm.connector.status" v-model="entity.status"></Dictionary>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('notes')" prop="notes">
<Input v-model="entity.notes" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
disabled: false,
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
v: Object,
shopId:{type:Number,default:0},
shopName:String,
customerId: Number,
},
methods: {
handleSubmit() {
this.entity.shopId=this.shopId
this.entity.customerId=this.customerId
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true
Api.createConnector(this.entity)
.then((r) => {
this.disabled = false
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
} else {
this.$Message.error('保存失败')
}
})
.catch((err) => {
this.disabled = false
this.$Message.error('保存失败')
console.warn(err)
})
}
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'Connector' + '.' + key
return this.$t(key)
}
},
watch: {
v() {
this.entity = this.$u.clone(this.v)
}
}
}
</script>
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12">
<FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"></Input>
</FormItem>
</Col>
<!-- <Col :span="12">
<FormItem :label="l('upId')" prop="upId">
<InputNumber v-model="entity.upId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('customerId')" prop="customerId">
<InputNumber v-model="entity.customerId"></InputNumber>
</FormItem>
</Col>-->
<Col :span="12">
<FormItem :label="l('principal')" prop="principal">
<Input v-model="entity.principal"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('telephone')" prop="telephone">
<Input v-model="entity.telephone"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('mobile')" prop="mobile">
<Input v-model="entity.mobile"></Input>
</FormItem>
</Col>
<!-- <Col :span="12">
<FormItem :label="l('status')" prop="status">
<InputNumber v-model="entity.status"></InputNumber>
</FormItem>
</Col>-->
<Col :span="24">
<FormItem :label="l('notes')" prop="notes">
<Input v-model="entity.notes" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'AddShop',
data() {
return {
disabled: false,
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
v: Object,
objInfo: Object
},
created() {},
mounted() {},
methods: {
load() {},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true
if (JSON.stringify(this.objInfo) != '{}') {
if (this.objInfo.upId == -100) {
this.entity.upId = 0
} else {
this.entity.upId = this.objInfo.upId
}
this.entity.customerId = this.objInfo.customerId
Api.createshoptree(this.entity)
.then((r) => {
this.disabled = false
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
} else {
this.$Message.error('保存失败')
}
})
.catch((err) => {
this.disabled = false
this.$Message.error('保存失败')
console.warn(err)
})
}
}
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'Shop' + '.' + key
return this.$t(key)
},
reset() {
this.entity = {}
}
},
computed: {
listenStore() {
return this.objInfo
}
},
watch: {
// shopid(v) {
// if (v != 0) {
// // this.load(v)
// }
// }
}
}
</script>
import Api from '@/plugins/request'
export default {
index: `${crmUrl}/customer/paged`,
paged(params) {
return Api.post(`${crmUrl}/customer/paged`, params);
},
get(params) {
return Api.get(`${crmUrl}/customer/get`, params);
},
create(params) {
return Api.post(`${crmUrl}/customer/create`, params);
},
update(params) {
return Api.post(`${crmUrl}/customer/update`, params);
},
//删除:
delete(params) {
return Api.delete(`${crmUrl}/customer/delete`, {
params: params
});
},
//---------组织树相关 start -------
getshoptree(params) { //获取组织树
return Api.get(`${crmUrl}/shop/getshoptree`, params);
},
createshoptree(params) { //增加组织树
return Api.post(`${crmUrl}/shop/create`, params);
},
updateshoptree(params) { //编辑组织树
return Api.post(`${crmUrl}/shop/update`, params);
},
deleteshoptree(params) { //删除组织树
return Api.delete(`${crmUrl}/shop/delete`, {
params: params
});
},
batchdeleteshoptree(params) { //批量删除组织树
return Api.post(`${crmUrl}/shop/batchdelete`, params);
},
getshop(params) { //获取某一个组织的信息
return Api.get(`${crmUrl}/shop/get`, params);
},
softdelete(params) { //删除前判断组织树是否可以删除
return Api.post(`${crmUrl}/shop/softdelete`, params);
},
//---------组织树相关 end -------
//---------组织树对应人员信息 start --------
indexConnector: `${crmUrl}/connector/paged`,
pagedConnector(params) {
return Api.post(`${crmUrl}/connector/paged`, params);
},
getConnector(params) {
return Api.get(`${crmUrl}/connector/get`, params);
},
createConnector(params) {
return Api.post(`${crmUrl}/connector/create`, params);
},
updateConnector(params) {
return Api.post(`${crmUrl}/connector/update`, params);
},
//删除:
deleteConnector(params) {
return Api.delete(`${crmUrl}/connector/delete`, params);
},
//批量删除:
batchdeleteConnector(params) {
return Api.post(`${crmUrl}/connector/batchdelete`, params);
},
//---------组织树相关人员信息 end---------
}
\ No newline at end of file
<template>
<div class="detail">
<Row>
<Filed :span="12" :name="l('name')">{{entity.name}}</Filed>
<Filed :span="12" :name="l('abbre')">{{entity.abbre}}</Filed>
<Filed :span="24" :name="l('address')">{{entity.address}}</Filed>
<Filed :span="12" :name="l('principal')">{{entity.principal}}</Filed>
<Filed :span="12" :name="l('telephone')">{{entity.telephone}}</Filed>
<Filed :span="12" :name="l('mobile')">{{entity.mobile}}</Filed>
<Filed :span="12" :name="l('type')">{{entity.type}}</Filed>
<Filed :span="12" :name="l('area')">{{entity.area}}</Filed>
<Filed :span="12" :name="l('isInform')">
<state code="crm.customer.isInform" :value="entity.isInform" type="text"></state>
</Filed>
<Filed :span="12" :name="l('status')">
<state code="crm.customer.status" :value="entity.status" type="text"></state>
</Filed>
<Filed :span="24" :name="l('notes')">{{entity.notes}}</Filed>
<Filed :span="12" :name="l('code')">{{entity.code}}</Filed>
<Filed :span="12" :name="l('trade')">{{entity.trade}}</Filed>
</Row>
</div>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }],
code: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
eid: Number
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result
this.$emit('on-load')
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'Customer' + '.' + key
return this.$t(key)
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v)
}
}
}
}
</script>
<template>
<div class="detail">
<Row>
<Filed :span="12" :name="l('name')">{{entity.name}}</Filed>
<Filed :span="12" :name="l('shopName')">{{shopName}}</Filed>
<Filed :span="12" :name="l('duties')">{{entity.duties}}</Filed>
<Filed :span="12" :name="l('telephone')">{{entity.telephone}}</Filed>
<Filed :span="12" :name="l('mobile')">{{entity.mobile}}</Filed>
<Filed :span="12" :name="l('status')"><state code="crm.connector.status" :value="entity.status" type="text"></state></Filed>
<Filed :span="24" :name="l('notes')">{{entity.notes}}</Filed>
</Row>
</div>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }],
code: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
eid: Number,
shopName: String
},
methods: {
load(v) {
Api.getConnector({ id: v }).then((r) => {
this.entity = r.result
this.$emit('on-load')
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'Connector' + '.' + key
return this.$t(key)
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v)
}
}
}
}
</script>
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12">
<FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('abbre')" prop="abbre">
<Input v-model="entity.abbre"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('address')" prop="address">
<Input v-model="entity.address" type="textarea" :rows="2"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('principal')" prop="principal">
<Input v-model="entity.principal"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('telephone')" prop="telephone">
<Input v-model="entity.telephone"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('mobile')" prop="mobile">
<Input v-model="entity.mobile"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('type')" prop="type">
<Input v-model="entity.type"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('area')" prop="area">
<Input v-model="entity.area"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isInform')" prop="isInform">
<Dictionary code="crm.customer.isInform" v-model="entity.isInform" type="radio"></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary code="crm.customer.status" v-model="entity.status"></Dictionary>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('notes')" prop="notes">
<Input v-model="entity.notes" type="textarea" :rows="3"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('code')" prop="code">
<Input v-model="entity.code"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('trade')" prop="trade">
<Input v-model="entity.trade"></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Edit',
data() {
return {
disabled: false,
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
eid: Number
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result
this.$emit('on-load')
})
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true
Api.update(this.entity)
.then((r) => {
this.disabled = false
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
} else {
this.$Message.error('保存失败')
}
})
.catch((err) => {
this.disabled = false
this.$Message.error('保存失败')
console.warn(err)
})
}
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'Customer' + '.' + key
return this.$t(key)
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v)
}
}
}
}
</script>
\ No newline at end of file
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12">
<FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('shopName')" prop="shopName">
{{shopName}}
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('duties')" prop="duties">
<Input v-model="entity.duties"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('telephone')" prop="telephone">
<Input v-model="entity.telephone"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('mobile')" prop="mobile">
<Input v-model="entity.mobile"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary code="crm.connector.status" v-model="entity.status"></Dictionary>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('notes')" prop="notes">
<Input v-model="entity.notes" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Edit',
data() {
return {
disabled: false,
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
eid: Number,
shopName: String,
},
methods: {
load(v) {
Api.getConnector({ id: v }).then((r) => {
this.entity = r.result
this.$emit('on-load')
})
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true
Api.updateConnector(this.entity)
.then((r) => {
this.disabled = false
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
} else {
this.$Message.error('保存失败')
}
})
.catch((err) => {
this.disabled = false
this.$Message.error('保存失败')
console.warn(err)
})
}
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'Connector' + '.' + key
return this.$t(key)
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v)
}
}
}
}
</script>
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12">
<FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('principal')" prop="principal">
<Input v-model="entity.principal"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('telephone')" prop="telephone">
<Input v-model="entity.telephone"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('mobile')" prop="mobile">
<Input v-model="entity.mobile"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('notes')" prop="notes">
<Input v-model="entity.notes" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'editShop',
data() {
return {
disabled: false,
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
eid: Number
},
created() {},
mounted() {
if (this.eid != 0) {
this.load(this.eid)
}
},
methods: {
load(v) {
Api.getshop({ id: v }).then((r) => {
if (r.success) {
this.entity = r.result
}
})
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true
Api.updateshoptree(this.entity)
.then((r) => {
this.disabled = false
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
} else {
this.$Message.error('保存失败')
}
})
.catch((err) => {
this.disabled = false
this.$Message.error('保存失败')
console.warn(err)
})
}
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'Shop' + '.' + key
return this.$t(key)
},
reset() {
this.entity = {}
}
},
computed: {
listenStore() {
return this.objInfo
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v)
}
}
}
}
</script>
<template>
<div>
<DataGrid :columns="columns" ref="grid" :action="action">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input
placeholder="请输入关键字客户名称/客户简称/邮政地址/负责人/办公电话/手机/客户类型/客户区域/备注/客户编码/行业"
v-model="easySearch.keys.value"
search
enter-button
@on-search="search"
/>
</FormItem>
</Form>
</template>
<template slot="searchForm">
<Search />
</template>
<template slot="buttons">
<Button type="primary" @click="addModal = true">新增</Button>
</template>
</DataGrid>
<Modal v-model="addModal" title="新增" footer-hide width="1000">
<Add @on-close="cancel" @on-ok="addOk" />
</Modal>
<Modal v-model="editModal" title="编辑" footer-hide width="1000">
<Edit :eid="curId" @on-close="cancel" @on-ok="addOk" width="1000" />
</Modal>
<Modal v-model="detailModal" title="详情" width="1000">
<Detail :eid="curId" />
</Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
<p>确定删除?</p>
</Modal>
</div>
</template>
<script>
import Api from './api'
import Add from './add'
import Edit from './edit'
import Detail from './detail'
import Search from './search'
export default {
name: 'list',
components: {
Add,
Edit,
Detail,
Search
},
data() {
return {
action: Api.index,
easySearch: {
keys: {
op:
'name,abbre,address,principal,telephone,mobile,type,area,notes,code,trade',
value: null
}
},
addModal: false,
editModal: false,
detailModal: false,
deletelModal: false,
curId: 0,
columns: [
{ key: 'id', title: this.l('id'), hide: true, align: 'left' },
{
key: 'creationTime',
title: this.l('creationTime'),
hide: true,
align: 'left'
},
{
key: 'creatorUserId',
title: this.l('creatorUserId'),
hide: true,
align: 'left'
},
{
key: 'lastModificationTime',
title: this.l('lastModificationTime'),
hide: true,
align: 'left'
},
{
key: 'lastModifierUserId',
title: this.l('lastModifierUserId'),
hide: true,
align: 'left'
},
{
key: 'isDeleted',
title: this.l('isDeleted'),
hide: true,
align: 'left'
},
{
key: 'deletionTime',
title: this.l('deletionTime'),
hide: true,
align: 'left'
},
{
key: 'deleterUserId',
title: this.l('deleterUserId'),
hide: true,
align: 'left'
},
{
key: 'name',
title: this.l('name'),
align: 'left',
easy: true,
high: true,
width: 160,
tooltip: true
},
{
key: 'abbre',
title: this.l('abbre'),
align: 'left',
easy: true,
high: true
},
{
key: 'address',
title: this.l('address'),
align: 'left',
easy: true,
high: true,
width: 120,
tooltip: true,
hide:true,
},
{
key: 'principal',
title: this.l('principal'),
align: 'left',
easy: true,
high: true
},
{
key: 'telephone',
title: this.l('telephone'),
align: 'left',
easy: true,
high: true
},
{
key: 'mobile',
title: this.l('mobile'),
align: 'left',
easy: true,
high: true
},
{
key: 'type',
title: this.l('type'),
align: 'left',
easy: true,
high: true
},
{
key: 'area',
title: this.l('area'),
align: 'left',
easy: true,
high: true
},
{
key: 'isInform',
title: this.l('isInform'),
align: 'center',
high: true,
code: 'crm.customer.isInform',
width:120,
},
{
key: 'status',
title: this.l('status'),
align: 'center',
high: true,
code: 'crm.customer.status',
width:120,
},
{
key: 'notes',
title: this.l('notes'),
align: 'left',
easy: true,
high: true,
tooltip: true,
hide:true,
},
{
key: 'code',
title: this.l('code'),
align: 'left',
easy: true,
high: true
},
{
key: 'trade',
title: this.l('trade'),
align: 'left',
easy: true,
high: true
},
{
title: '操作',
key: 'action',
width: 180,
align: 'center',
render: (h, params) => {
return h('div', { class: 'action' }, [
h(
'op',
{
attrs: { oprate: 'detail' },
on: { click: () => this.detail(params.row.id) }
},
'查看'
),
h(
'op',
{
attrs: { oprate: 'edit' },
on: { click: () => this.edit(params.row.id) }
},
'编辑'
),
h(
'op',
{
attrs: { oprate: 'remove' },
on: { click: () => this.remove(params.row.id) }
},
'删除'
),
h(
'op',
{
attrs: { oprate: 'detail' },
on: { click: () => this.goShop(params.row.id) }
},
'部门信息'
)
])
}
}
]
}
},
mounted() {
console.log(this)
},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
methods: {
addOk() {
this.$refs.grid.load()
this.addModal = false
this.detailModal = false
this.editModal = false
this.curId = 0
},
search() {
this.$refs.grid.reload(this.easySearch)
},
detail(id) {
setTimeout(() => {
this.detailModal = true
}, 400)
this.curId = id
},
edit(id) {
setTimeout(() => {
this.editModal = true
}, 400)
this.curId = id
},
remove(id) {
this.deletelModal = true
this.curId = id
},
removeOk() {
Api.delete({ id: this.curId }).then((r) => {
if (r.success) {
this.$refs.grid.load()
this.deletelModal = false
this.$Message.success('删除成功')
}
})
},
removeCancel() {
this.deletelModal = false
},
cancel() {
this.curId = 0
this.addModal = false
this.detailModal = false
this.editModal = false
this.deletedlModal = false
},
goShop(id) {
this.$router.push({
name: 'crm-customer-shopIndex',
params: { customerId: id }
})
},
l(key) {
let vkey = 'Customer' + '.' + key
return this.$t(vkey) || key
}
}
}
</script>
<style lang="less"></style>
<template>
<div>
<Grid :columns="columns" ref="grid" :action="action" :colTitle="colTitle" :colSpan="colSpan" card>
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input
placeholder="请输入关键字客户名称/客户简称/邮政地址/负责人/办公电话/手机/客户类型/客户区域/备注/客户编码/行业"
v-model="easySearch.keys.value"
/>
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
<template slot="searchForm">
<Search />
</template>
<template slot="buttons">
<Button type="primary" @click="addModal = true">新增</Button>
</template>
</Grid>
<Modal v-model="addModal" title="新增" footer-hide width="1000">
<Add @on-close="cancel" @on-ok="addOk" />
</Modal>
<Modal v-model="editModal" title="编辑" footer-hide width="1000">
<Edit :eid="curId" @on-close="cancel" @on-ok="addOk" />
</Modal>
<Modal v-model="detailModal" title="详情" width="1000">
<Detail :eid="curId" />
</Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
<p>确定删除?</p>
</Modal>
</div>
</template>
<script>
import Api from './api'
import Add from './add'
import Edit from './edit'
import Detail from './detail'
import Search from './search'
import Grid from '@/components/page/gridNew.vue'
export default {
name: 'list',
components: {
Add,
Edit,
Detail,
Search,
Grid
},
data() {
return {
colTitle: 'abbre',//card显示的标题字段
colSpan:6,//card显示时的col的span值
action: Api.index,
easySearch: {
keys:{op:"name,abbre,address,principal,telephone,mobile,type,area,notes,code,trade",value:null}
},
addModal: false,
editModal: false,
detailModal: false,
deletelModal: false,
curId: 0,
columns: [
{ key: 'id', title: this.l('id'), hide: true, align: 'left' },
{
key: 'creationTime',
title: this.l('creationTime'),
hide: true,
align: 'left'
},
{
key: 'creatorUserId',
title: this.l('creatorUserId'),
hide: true,
align: 'left'
},
{
key: 'lastModificationTime',
title: this.l('lastModificationTime'),
hide: true,
align: 'left'
},
{
key: 'lastModifierUserId',
title: this.l('lastModifierUserId'),
hide: true,
align: 'left'
},
{
key: 'isDeleted',
title: this.l('isDeleted'),
hide: true,
align: 'left'
},
{
key: 'deletionTime',
title: this.l('deletionTime'),
hide: true,
align: 'left'
},
{
key: 'deleterUserId',
title: this.l('deleterUserId'),
hide: true,
align: 'left'
},
{
key: 'name',
title: this.l('name'),
align: 'left',
easy: true,
high: true
},
{
key: 'abbre',
title: this.l('abbre'),
align: 'left',
easy: true,
high: true
},
{
key: 'address',
title: this.l('address'),
align: 'left',
easy: true,
high: true
},
{
key: 'principal',
title: this.l('principal'),
align: 'left',
easy: true,
high: true
},
{
key: 'telephone',
title: this.l('telephone'),
align: 'left',
easy: true,
high: true
},
{
key: 'mobile',
title: this.l('mobile'),
align: 'left',
easy: true,
high: true
},
{
key: 'type',
title: this.l('type'),
align: 'left',
easy: true,
high: true
},
{
key: 'area',
title: this.l('area'),
align: 'left',
easy: true,
high: true
},
{
key: 'isInform',
title: this.l('isInform'),
align: 'left',
high: true
},
{ key: 'status', title: this.l('status'), align: 'left', high: true },
{
key: 'notes',
title: this.l('notes'),
align: 'left',
easy: true,
high: true
},
{
key: 'code',
title: this.l('code'),
align: 'left',
easy: true,
high: true
},
{
key: 'trade',
title: this.l('trade'),
align: 'left',
easy: true,
high: true
},
{
title: '操作',
key: 'action',
width: 140,
align: 'center',
render: (h, params) => {
return h('div', { class: 'action' }, [
h(
'op',
{
attrs: { oprate: 'detail' },
on: { click: () => this.detail(params.row.id) }
},
'查看'
),
h(
'op',
{
attrs: { oprate: 'edit' },
on: { click: () => this.edit(params.row.id) }
},
'编辑'
),
h(
'op',
{
attrs: { oprate: 'remove' },
on: { click: () => this.remove(params.row.id) }
},
'删除'
)
])
}
}
]
}
},
mounted() {
console.log(this)
},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
methods: {
addOk() {
this.$refs.grid.load()
this.addModal = false
this.detailModal = false
this.editModal = false
this.curId = 0
},
search() {
this.$refs.grid.reload(this.easySearch)
},
detail(id) {
this.detailModal = true
this.curId = id
},
edit(id) {
this.editModal = true
this.curId = id
},
remove(id) {
this.deletelModal = true
this.curId = id
},
removeOk() {
Api.delete({ id: this.curId }).then((r) => {
if (r.success) {
this.$refs.grid.load()
this.deletelModal = false
this.$Message.success('删除成功')
}
})
},
removeCancel() {
this.deletelModal = false
},
cancel() {
this.curId = 0
this.addModal = false
this.detailModal = false
this.editModal = false
this.deletedlModal = false
},
l(key) {
let vkey = 'Customer' + '.' + key
return this.$t(vkey) || key
}
}
}
</script>
<style lang="less"></style>
<template>
<div>
<ShopTreeLeft ref="shopTree" @storeIds="storeIds" @treeData="treeData" :CId="CId"></ShopTreeLeft>
<Dropdown
transfer
placement="right-start"
trigger="custom"
ref="contextMenu"
:visible="currentVisible"
@on-clickoutside="handleCancel"
@on-click="changeMenu"
>
<DropdownMenu slot="list">
<DropdownItem name="1">新增顶层部门</DropdownItem>
<DropdownItem name="2">新建子部门</DropdownItem>
<!-- <DropdownItem disabled>修改</DropdownItem> -->
<DropdownItem name="3">修改</DropdownItem>
<DropdownItem divided name="4">删除</DropdownItem>
</DropdownMenu>
</Dropdown>
<Modal v-model="addSonModal" :title="shopTitle" footer-hide width="800">
<Add ref="addShop" @on-close="cancel" @on-ok="addOk" :objInfo="objInfo" />
</Modal>
<Modal v-model="editModal" title="编辑" footer-hide width="800">
<Edit :eid="curId" @on-close="cancel" @on-ok="addOk" />
</Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
<p>确定删除?</p>
</Modal>
</div>
</template>
<script>
import Api from './api'
import ShopTreeLeft from './shopTreeLeft.vue'
import Add from './addShop'
import Edit from './editShop'
export default {
components: {
ShopTreeLeft,
Add,
Edit
},
props: {
CId: {
type: Number,
default: 0
}
},
data() {
return {
posX: 0,
posY: 0,
currentVisible: false,
locator: null,
treeId: [], //选择的树id
treeIdNew: null, //选择的树id
//右键选择结束
addSonModal: false,
editModal: false,
deletelModal: false,
objInfo: {},
selectTreeInfo: [], //选择树后的数据
customerId: this.CId, //临时给1
curId: 0,
shopTitle: '新增子部门',
selectShopId:-1,
}
},
methods: {
createLocator() {
// 获取Dropdown
const contextmenu = this.$refs.contextMenu
// 创建locator
const locator = document.createElement('div')
locator.style.cssText = `position:fixed;left:${this.posX}px;top:${this.posY}px`
document.body.appendChild(locator)
// 将locator绑定到Dropdown的reference上
contextmenu.$refs.reference = locator
this.locator = locator
},
removeLocator() {
if (this.locator) document.body.removeChild(this.locator)
this.locator = null
},
handleContextmenu({ button, clientX, clientY }) {
window.event.returnValue = false //取消浏览器右键
if (this.selectShopId != -1 ) {
if (button === 2) {
if (this.posX !== clientX) this.posX = clientX
if (this.posY !== clientY) this.posY = clientY
if (this.trigger !== 'custom') {
this.createLocator()
this.currentVisible = true
}
}
}
},
changeMenu(value) {
//新建子部门 、新建顶层部门 /修改部门信息
this.objInfo.customerId = this.customerId
this.$refs.addShop.reset()
if (value == 1) {
this.objInfo.upId = 0
this.shopTitle = '新增顶层部门'
this.addSonModal = true
} else if (value == 2) {
this.objInfo.upId = this.selectTreeInfo[0].value
this.shopTitle = '新增子部门'
this.addSonModal = true
} else if (value == 3) {
this.curId = this.selectTreeInfo[0].value
this.editModal = true
} else if (value == 4) {
this.remove(this.selectTreeInfo[0].value)
}
},
remove(id) {
if (this.treeId.length > 1) {
this.$Message.error('当前节点不能删除')
} else {
try {
Api.softdelete({ id: id }).then((r) => {
if (r.result) {
this.deletelModal = true
this.curId = id
} else {
this.$Message.error('当前节点不能删除')
}
})
} catch (e) {
this.$Message.error('连接错误,请重试')
}
}
},
removeOk() {
Api.deleteshoptree({ id: this.curId }).then((r) => {
if (r.success) {
this.$refs.shopTree.loadTree()
this.deletelModal = false
this.$emit('getShopId', [-1])
this.$Message.success('删除成功')
}
})
},
removeCancel() {
this.deletelModal = false
},
handleCancel() {
//点击外部时关闭
this.currentVisible = false
this.removeLocator()
},
storeIds(val) {
//获取该节点及该节点一下的所有id
if (val[0] == -1) {
//如果取消节点选择,则从新刷新树,然后重新加载数据
this.$refs.shopTree.loadTree()
}
if(val.length>1)
{
this.$emit('getSelectShopId', -1)
}
this.treeId = val
//this.selectShopId=val[0]
this.$emit('getShopId', val)
},
treeData(val) {
//alert(JSON.stringify(val))
//获取改节点及之下的几点信息
this.selectTreeInfo = val
let shopName = '根目录'
this.selectShopId = -1
if (val.length > 0) {
shopName = val[0].title
this.selectShopId = val[0].value
} else {
shopName = '根目录'
this.selectShopId = -1
}
this.$emit('getSelectShopName', shopName)
this.$emit('getSelectShopId', this.selectShopId)
},
addOk() {
this.$refs.shopTree.loadTree()
this.treeId = [-1]
this.addSonModal = false
this.editModal = false
},
cancel() {
this.curId = 0
this.addSonModal = false
this.editModal = false
this.deletelModal = false
}
},
mounted() {
document.addEventListener('contextmenu', this.handleContextmenu, true)
document.addEventListener('mouseup', this.handleContextmenu, true)
},
destroyed() {
document.removeEventListener('contextmenu', this.handleContextmenu, true)
document.removeEventListener('mouseup', this.handleContextmenu, true)
}
}
</script>
<template>
<Form ref="form" :model="condition" :label-width="90">
<Row>
<Col :span="12" :v-if="condition.name.show">
<FormItem :label="l('name')" prop="name">
<Input v-model="condition.name.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.abbre.show">
<FormItem :label="l('abbre')" prop="abbre">
<Input v-model="condition.abbre.value"></Input>
</FormItem>
</Col>
<Col :span="24" :v-if="condition.address.show">
<FormItem :label="l('address')" prop="address">
<Input v-model="condition.address.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.principal.show">
<FormItem :label="l('principal')" prop="principal">
<Input v-model="condition.principal.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.telephone.show">
<FormItem :label="l('telephone')" prop="telephone">
<Input v-model="condition.telephone.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.mobile.show">
<FormItem :label="l('mobile')" prop="mobile">
<Input v-model="condition.mobile.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.type.show">
<FormItem :label="l('type')" prop="type">
<Input v-model="condition.type.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.area.show">
<FormItem :label="l('area')" prop="area">
<Input v-model="condition.area.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.isInform.show">
<FormItem :label="l('isInform')" prop="isInform">
<Dictionary code="crm.customer.isInform" v-model="condition.isInform.value" type="radio"></Dictionary>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.status.show">
<FormItem :label="l('status')" prop="status">
<Dictionary code="crm.customer.status" v-model="condition.status.value"></Dictionary>
</FormItem>
</Col>
<Col :span="24" :v-if="condition.notes.show">
<FormItem :label="l('notes')" prop="notes">
<Input v-model="condition.notes.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.code.show">
<FormItem :label="l('code')" prop="code">
<Input v-model="condition.code.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.trade.show">
<FormItem :label="l('trade')" prop="trade">
<Input v-model="condition.trade.value"></Input>
</FormItem>
</Col>
</Row>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
condition: {
id: { op: 'Equal', value: null, show: false },
creationTime: { op: 'Range', value: null, show: false },
creatorUserId: { op: 'Equal', value: null, show: false },
lastModificationTime: { op: 'Range', value: null, show: false },
lastModifierUserId: { op: 'Equal', value: null, show: false },
isDeleted: { op: 'Equal', value: null, show: false },
deletionTime: { op: 'Range', value: null, show: false },
deleterUserId: { op: 'Equal', value: null, show: false },
name: { op: 'Equal', value: null, show: true },
abbre: { op: 'Equal', value: null, show: true },
address: { op: 'Equal', value: null, show: true },
principal: { op: 'Equal', value: null, show: true },
telephone: { op: 'Equal', value: null, show: true },
mobile: { op: 'Equal', value: null, show: true },
type: { op: 'Equal', value: null, show: true },
area: { op: 'Equal', value: null, show: true },
isInform: { op: 'Equal', value: null, show: true },
status: { op: 'Equal', value: null, show: true },
notes: { op: 'Equal', value: null, show: true },
code: { op: 'Equal', value: null, show: true },
trade: { op: 'Equal', value: null, show: true }
}
}
},
methods: {
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'Customer' + '.' + key
return this.$t(key)
}
}
}
</script>
<template>
<Form ref="form" :model="condition" :label-width="90">
<Row>
<Col :span="12" :v-if="condition.customerId.show" v-show="false">
<FormItem :label="l('customerId')" prop="customerId">
<Input v-model="condition.customerId.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.name.show">
<FormItem :label="l('name')" prop="name">
<Input v-model="condition.name.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.duties.show">
<FormItem :label="l('duties')" prop="duties">
<Input v-model="condition.duties.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.telephone.show">
<FormItem :label="l('telephone')" prop="telephone">
<Input v-model="condition.telephone.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.mobile.show">
<FormItem :label="l('mobile')" prop="mobile">
<Input v-model="condition.mobile.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.status.show">
<FormItem :label="l('status')" prop="status">
<Dictionary code="crm.connector.status" v-model="condition.status.value"></Dictionary>
</FormItem>
</Col>
<Col :span="24" :v-if="condition.notes.show">
<FormItem :label="l('notes')" prop="notes">
<Input v-model="condition.notes.value"></Input>
</FormItem>
</Col>
</Row>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
props: {
customerId: {
type: Number,
default: 0
}
},
data() {
return {
condition: {
id: { op: 'Equal', value: null, show: false },
creationTime: { op: 'Range', value: null, show: false },
creatorUserId: { op: 'Equal', value: null, show: false },
lastModificationTime: { op: 'Range', value: null, show: false },
lastModifierUserId: { op: 'Equal', value: null, show: false },
isDeleted: { op: 'Equal', value: null, show: false },
deletionTime: { op: 'Range', value: null, show: false },
deleterUserId: { op: 'Equal', value: null, show: false },
name: { op: 'Equal', value: null, show: true },
shopId: { op: 'Equal', value: null, show: true },
duties: { op: 'Equal', value: null, show: true },
telephone: { op: 'Equal', value: null, show: true },
mobile: { op: 'Equal', value: null, show: true },
status: { op: 'Equal', value: null, show: true },
notes: { op: 'Equal', value: null, show: true },
customerId: { op: 'Equal', value: this.customerId, show: true },
}
}
},
methods: {
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'Connector' + '.' + key
return this.$t(key)
}
}
}
</script>
<template>
<Layout class="full">
<Sider hide-trigger :style="{background: '#fff'}" class="menu" width="240" style=" flex:0;">
<ShopLeftTree
ref="shopLeftTree"
@getShopId="getShopId"
@getSelectShopName="getSelectShopName"
@getSelectShopId="getSelectShopId"
:CId="customerId"
></ShopLeftTree>
</Sider>
<Content class="content manyTabs">
<Tabs :animated="false">
<TabPane label="组织信息">
<DataGrid
:columns="columns"
ref="grid"
:action="action"
:conditions="easySearch"
style="margin-top: 45px;"
>
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input
placeholder="请输入关键字人员名称/职务/办公电话/手机/备注"
v-model="easySearch.keys.value"
search
enter-button
@on-search="search"
/>
</FormItem>
</Form>
</template>
<template slot="searchForm">
<Search :customerId="customerId" />
</template>
<template slot="buttons">
<Button type="primary" @click="openAddModal">新增</Button>
<Button @click="goShopIndex">返回</Button>
</template>
</DataGrid>
</TabPane>
</Tabs>
<Modal v-model="addModal" title="新增" footer-hide width="1000">
<Add
@on-close="cancel"
@on-ok="addOk"
:customerId="customerId"
:shopId="shopSelectId"
:shopName="shopName"
/>
</Modal>
<Modal v-model="editModal" title="编辑" footer-hide width="1000">
<Edit
:eid="curId"
:customerId="customerId"
:shopName="curShopName"
@on-close="cancel"
@on-ok="addOk"
/>
</Modal>
<Modal v-model="detailModal" title="详情" width="1000">
<Detail :eid="curId1" :shopName="curShopName1" />
</Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
<p>确定删除?</p>
</Modal>
</Content>
</Layout>
</template>
<script>
import Api from './api'
import Add from './addConnector'
import Edit from './editConnector'
import Detail from './detailConnector'
import Search from './searchConnector'
import ShopLeftTree from './newTree'
const root = {
id: 0,
typeId: -1,
title: '顶级节点',
code: ''
}
export default {
name: 'shopIndex',
components: {
Add,
Edit,
Detail,
Search,
ShopLeftTree
},
data() {
return {
action: Api.indexConnector,
easySearch: {
keys: { op: 'name,duties,telephone,mobile,notes', value: null },
shopId: { op: 'In', value: -100 },
customerId: { op: 'Equal', value: this.$route.params.customerId }
},
addModal: false,
editModal: false,
detailModal: false,
deletelModal: false,
curId: 0,
curId1: 0,
curShopName: '',
curShopName1: '',
customerId: this.$route.params.customerId,
columns: [
{ key: 'id', title: this.l('id'), hide: true, align: 'left' },
{
key: 'creationTime',
title: this.l('creationTime'),
hide: true,
align: 'left'
},
{
key: 'creatorUserId',
title: this.l('creatorUserId'),
hide: true,
align: 'left'
},
{
key: 'lastModificationTime',
title: this.l('lastModificationTime'),
hide: true,
align: 'left'
},
{
key: 'lastModifierUserId',
title: this.l('lastModifierUserId'),
hide: true,
align: 'left'
},
{
key: 'isDeleted',
title: this.l('isDeleted'),
hide: true,
align: 'left'
},
{
key: 'deletionTime',
title: this.l('deletionTime'),
hide: true,
align: 'left'
},
{
key: 'deleterUserId',
title: this.l('deleterUserId'),
hide: true,
align: 'left'
},
{
key: 'name',
title: this.l('name'),
align: 'left',
easy: true,
high: true
},
// { key: 'shopId', title: this.l('shopId'), align: 'left', high: true },
{
key: 'duties',
title: this.l('duties'),
align: 'left',
easy: true,
high: true
},
{
key: 'shopName',
title: this.l('shopName'),
align: 'left',
easy: true,
high: true
},
{
key: 'telephone',
title: this.l('telephone'),
align: 'left',
easy: true,
high: true
},
{
key: 'mobile',
title: this.l('mobile'),
align: 'left',
easy: true,
high: true
},
{
key: 'status',
title: this.l('status'),
align: 'center',
width: 120,
high: true,
code: 'crm.connector.status'
},
{
key: 'notes',
title: this.l('notes'),
align: 'left',
easy: true,
high: true,
tooltip: true
},
{
title: '操作',
key: 'action',
width: 140,
align: 'center',
render: (h, params) => {
return h('div', { class: 'action' }, [
h(
'op',
{
attrs: { oprate: 'detail' },
on: {
click: () => this.detail(params.row.id, params.row.shopName)
}
},
'查看'
),
h(
'op',
{
attrs: { oprate: 'edit' },
on: {
click: () => this.edit(params.row.id, params.row.shopName)
}
},
'编辑'
),
h(
'op',
{
attrs: { oprate: 'remove' },
on: { click: () => this.remove(params.row.id) }
},
'删除'
)
])
}
}
],
shopId: 0, //当前组织id
shopName: '', //当前组织名称
shopSelectId: 0
}
},
mounted() {
this.loadData()
},
created() {},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
methods: {
loadData() {
if (this.customerId == 0 || this.customerId == undefined) {
this.$router.push({ name: 'crm-customer' })
}
},
openAddModal() {
if (this.shopSelectId == -1) {
this.$Message.error('请选择组织信息节点')
} else if (this.shopSelectId == -100) {
this.$Message.error('请创建组织信息节点')
} else {
this.addModal = true
}
},
addOk() {
this.$refs.grid.load()
this.addModal = false
this.detailModal = false
this.editModal = false
this.curId = 0
},
search() {
this.$refs.grid.reload(this.easySearch)
},
detail(id, shopName) {
setTimeout(() => {
this.detailModal = true
}, 400)
this.curId1 = id
this.curShopName1 = shopName
},
edit(id, shopName) {
setTimeout(() => {
this.editModal = true
}, 400)
this.curId = id
this.curShopName = shopName
},
remove(id) {
this.deletelModal = true
this.curId = id
},
removeOk() {
let params = []
params.push(this.curId)
Api.batchdeleteConnector(params).then((r) => {
if (r.success) {
this.$refs.grid.load()
this.deletelModal = false
this.$Message.success('删除成功')
}
})
},
removeCancel() {
this.deletelModal = false
},
cancel() {
this.curId = 0
this.addModal = false
this.detailModal = false
this.editModal = false
this.deletedlModal = false
},
l(key) {
let vkey = 'Connector' + '.' + key
return this.$t(vkey) || key
},
getShopId(val) {
//alert('getshopId:'+val)
//点击树查询及赋值shopid\
if (val.length > 1) {
this.shopId = -1
} else {
this.shopId = Number(val[0])
}
setTimeout(() => {
this.easySearch.shopId.value = val
this.$refs.grid.easySearch()
}, 400)
},
getSelectShopName(val) {
this.shopName = val
},
getSelectShopId(val) {
this.shopSelectId = Number(val)
},
goShopIndex() {
this.$router.push({ name: 'crm-customer' })
}
},
computed: {}
}
</script>
<style lang="less" scoped>
.full {
margin-top: 0;
}
</style>
\ No newline at end of file
<template>
<div>
<h3 class="title">
部门组织信息
<ButtonGroup class="fr" size="small">
<Button>
<Icon
:type="!expand ? 'md-arrow-dropright' : 'md-arrow-dropdown'"
size="16"
@click="toggle"
title="展开/合并"
/>
</Button>
<Button>
<Icon type="md-refresh" size="16" @click="loadTree" title="刷新" />
</Button>
</ButtonGroup>
</h3>
<div class="tree">
<Tree ref="tree" :data="tree" @on-select-change="change" :render="renderContent" />
</div>
</div>
</template>
<script>
import Api from './api'
export default {
name: 'shopTreeLeft',
data() {
return {
expand: true,
ids: [],
tree: []
}
},
props: {
CId: {
type: Number,
default: 0
}
},
mounted() {},
created() {
this.loadTree()
},
methods: {
toggle() {
this.expand = !this.expand
this.getTrees(this.tree)
//this.loadTree()
},
async loadTree() {
//alert(this.CId)
Api.getshoptree({ Id: this.CId }).then((r) => {
if (r.success) {
if (r.result.length > 0) {
this.tree = r.result
this.change1(this.tree)
} else {
this.tree = [
{ title: '暂无组织信息', value: -100, expand: true, children: [] }
],
this.$emit('storeIds', [-100])
this.$emit('treeData', r.result)
}
}
})
},
//重构左侧树
getTrees(trees) {
var expand = this.expand
trees.forEach((data, index) => {
var that = this
data.expand = expand
if (data.children.length > 0) {
this.getTrees(data.children)
}
})
return trees
},
renderContent(h, { root, node, data }) {
return h(
'span',
{
style: {
color: '#000', //根据选中状态设置样式
cursor: 'pointer',
background: node.node.selected ? '#AAD8D4' : '#ffffff',
paddingLeft: '10px',
paddingRight: '10px',
paddingTop: '3px',
paddingBottom: '3px'
},
on: {
// click: () => {
// if (!node.node.selected) {
// this.$refs.tree.handleSelect(node.nodeKey) //手动选择树节点
// }
// }
}
},
data.title
)
},
//得到此树节点下所有是产品的Id
getAllIds(trees) {
trees.forEach((data, index) => {
var that = this
this.ids.push(data.value)
if (data.children.length > 0) {
this.getAllIds(data.children)
}
})
},
change(value) {
if (value.length > 0) {
this.ids = []
this.getAllIds(value)
if (this.ids.length > 0) {
this.$emit('storeIds', this.ids)
//this.easySearch.storeId.value = this.ids
} else {
this.$emit('storeIds', [-1])
}
} else {
this.$emit('storeIds', [-1])
}
this.$emit('treeData', value)
},
change1(value) {
if (value.length > 0) {
this.ids = []
this.getAllIds(value)
if (this.ids.length > 0) {
this.$emit('storeIds', this.ids)
} else {
this.$emit('storeIds', [-1])
}
} else {
this.$emit('storeIds', [-1])
}
}
}
}
</script>
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12">
<FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('shopId')" prop="shopId">
<Select v-model="entity.shopId" placeholder="请选择">
<Option
v-for="(item,index) in list"
:key="index"
:value="item.value"
:label="item.label"
style="display:none"
></Option>
<Tree key="mytree" :data="data1" ref="mytree" :render="renderContent"></Tree>
</Select>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('stage')" prop="stage">
<Dictionary
code="crm.project.stage"
v-model="entity.stage"
type="select"
:value="entity.stage"
:key="entity.stage"
></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('principal')" prop="principal">
<!-- <Input v-model="entity.principal"></Input> -->
<Select v-model="entity.principal">
<Option v-for="item in principalList" :value="item.id" :key="item.id">{{ item.name }}</Option>
</Select>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isInform')" prop="isInform">
<Dictionary
code="crm.project.isInform"
v-model="entity.isInform"
type="radio"
:value="entity.isInform"
:key="entity.isInform"
></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<!-- <InputNumber v-model="entity.status"></InputNumber> -->
<Dictionary
code="crm.project.status"
v-model="entity.status"
type="radio"
:value="entity.status"
:key="entity.status"
></Dictionary>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('notes')" prop="notes">
<Input v-model="entity.notes" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('budget')" prop="budget">
<Input v-model="entity.budget"></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
disabled: false,
entity: {
name: '',
customerId: 0,
isInform: 0,
status: 0,
shopId: null
},
principalList: [],
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
},
list: [],
data1: [],
treeData: []
}
},
props: {
v: Object,
customerId: Number
},
methods: {
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true
Api.create(this.entity)
.then((r) => {
this.disabled = false
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
} else {
this.$Message.error('保存失败')
}
})
.catch((err) => {
this.disabled = false
this.$Message.error('保存失败')
console.warn(err)
})
}
})
},
initTree(v) {
var sumData = []
Api.getshoptree({ id: v })
.then((r) => {
console.log(r)
if (r.result) {
this.data1 = r.result
} else {
this.$Message.error('加载部门失败!')
}
})
.catch((err) => {})
},
renderContent(h, { root, node, data }) {
//渲染树的样式
return h(
'span',
{
style: {
cursor: 'pointer'
},
on: {
click: () => {
this.handleSelect(data) //手动选择树节点
}
}
},
data.title
)
},
handleSelect(data) {
let obj = {
label: data.title,
value: data.value
}
this.list = []
this.list.push(obj)
this.entity.shopId = this.list[0].value
},
principals(id) {
//根据主管部选择负责人
Api.customerconnectors({ id: id }).then((r) => {
this.principalList = r.result
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'Project' + '.' + key
return this.$t(key)
}
},
watch: {
customerId(v) {
if (v > 0) {
this.entity.name = ''
this.entity.stage = ''
this.entity.notes = ''
this.entity.budget = ''
this.entity.customerId = v
this.initTree(v)
this.principals(v)
}
}
}
}
</script>
\ No newline at end of file
import Api from '@/plugins/request'
export default {
index: `${crmUrl}/project/paged`,
paged(params) {
return Api.post(`${crmUrl}/project/paged`, params);
},
list(params) {
return Api.post(`${crmUrl}/customer/list`, params);
},
get(params) {
return Api.get(`${crmUrl}/project/get`, params);
},
create(params) {
return Api.post(`${crmUrl}/project/create`, params);
},
update(params) {
return Api.post(`${crmUrl}/project/update`, params);
},
//删除:
delete(params) {
return Api.delete(`${crmUrl}/project/delete`, { params: params });
},
getshoptree(params) { //获取组织树
return Api.get(`${crmUrl}/shop/getshoptree`, params);
},
customerconnectors(params) { //客户下所以联系人
return Api.get(`${crmUrl}/connector/customerconnectors`, params);
},
}
\ No newline at end of file
<template>
<div class="detail">
<Row>
<Filed :span="12" :name="l('name')">{{entity.name}}</Filed>
<Filed :span="12" :name="l('shopId')">{{entity.shopId}}</Filed>
<Filed :span="12" :name="l('stage')">
<state code="crm.project.stage" :value="entity.stage" />
</Filed>
<Filed :span="12" :name="l('principal')">{{entity.principal}}</Filed>
<Filed :span="12" :name="l('isInform')">
<state code="crm.project.isInform" :value="entity.isInform" />
</Filed>
<Filed :span="12" :name="l('status')">
<state code="crm.project.status" :value="entity.status" />
</Filed>
<Filed :span="24" :name="l('budget')">{{entity.budget}}</Filed>
<Filed :span="24" :name="l('notes')">{{entity.notes}}</Filed>
</Row>
</div>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
entity: {}
}
},
props: {
eid: Number
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result
this.$emit('on-load')
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'Project' + '.' + key
return this.$t(key)
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v)
}
}
}
}
</script>
\ No newline at end of file
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12">
<FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"></Input>
</FormItem>
</Col>
<!-- <Col :span="12">
<FormItem :label="l('customerId')" prop="customerId">
<InputNumber v-model="entity.customerId"></InputNumber>
</FormItem>
</Col>-->
<Col :span="12">
<FormItem :label="l('shopId')" prop="shopId">
<InputNumber v-model="entity.shopId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('stage')" prop="stage">
<Dictionary
code="crm.project.stage"
v-model="entity.stage"
type="select"
:value="entity.stage"
:key="entity.stage"
></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('principal')" prop="principal">
<Input v-model="entity.principal"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isInform')" prop="isInform">
<Dictionary
code="crm.project.isInform"
v-model="entity.isInform"
type="radio"
:value="entity.isInform"
:key="entity.isInform"
></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary
code="crm.project.status"
v-model="entity.status"
type="radio"
:value="entity.status"
:key="entity.status"
></Dictionary>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('notes')" prop="notes">
<Input v-model="entity.notes" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('budget')" prop="budget">
<Input v-model="entity.budget"></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Edit',
data() {
return {
disabled: false,
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
eid: Number
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result
this.$emit('on-load')
})
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true
Api.update(this.entity)
.then((r) => {
this.disabled = false
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
} else {
this.$Message.error('保存失败')
}
})
.catch((err) => {
this.disabled = false
this.$Message.error('保存失败')
console.warn(err)
})
}
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'Project' + '.' + key
return this.$t(key)
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v)
}
}
}
}
</script>
\ No newline at end of file
<template>
<div class="project-steps">
<div class="aps-l">
<h4 class="title mr10">企业列表</h4>
<Input v-model="keys" search placeholder="请输入客户名称" clearable />
<div
class="left-body click-a"
v-for="(li,index) in projectList"
:key="index"
@click="listData(li,index)"
:class="isactive == index ? 'addclass' : '' "
>
<Row class="title-i">
<Col :span="24" class="order-code">客户名称:{{li.name}}</Col>
</Row>
<div class="down-text">
<div class="fa">负责人:{{li.principal}}</div>
<div class="fa">办公电话:{{li.telephone}}</div>
<div class="fa">手机:{{li.mobile}}</div>
<div class="fa">客户区域:{{li.area}}</div>
</div>
</div>
</div>
<div class="aps-r">
<h4 class="title mr10">项目列表</h4>
<DataGrid
:columns="columns"
ref="grid"
:action="action"
type="card"
:high="false"
:span="6"
:lazy="true"
>
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input
search
enter-button
placeholder="请输入关键字项目名称"
v-model="easySearch.keys.value"
@on-search="search"
/>
</FormItem>
</Form>
</template>
<template slot="buttons">
<Button type="primary" @click="add">新增</Button>
</template>
<template slot="card" slot-scope="{row}">
<div class="body">
<Row class="title-i">
<Col :span="18" class="order-code">项目名称:{{row.name}}</Col>
<Col :span="6" class="btn-click">
<a @click="edit(row.id)">
<Icon type="ios-create" @click="edit(row.id)" />
</a>
<a @click="detail(row.id)">
<Icon type="ios-paper" />
</a>
<a @click="remove(row.id)">
<Icon type="ios-trash" />
</a>
</Col>
</Row>
<div class="down-text">
<Row class="row">
<Col span="12" class="fa">主管部门:{{row.shopId}}</Col>
<Col span="12" class="fa">负责人:{{row.principal}}</Col>
</Row>
<Row class="row">
<Col span="12" class="fa">
销售阶段:
<state code="crm.project.stage" :value="row.stage" />
</Col>
<Col span="12" class="fa">
是否报备:
<state code="crm.project.isInform" :value="row.isInform" />
</Col>
</Row>
<Row class="row">
<Col span="12" class="fa">
状态:
<state code="crm.project.status" :value="row.status" />
</Col>
<Col span="12" class="fa">预算:{{row.budget}}</Col>
</Row>
</div>
</div>
</template>
</DataGrid>
</div>
<Modal v-model="addModal" title="新增" footer-hide>
<Add @on-close="cancel" @on-ok="addOk" :customerId="customerId" ref="add" />
</Modal>
<Modal v-model="editModal" title="编辑" footer-hide>
<Edit :eid="curId" @on-close="cancel" @on-ok="addOk" />
</Modal>
<Modal v-model="detailModal" title="详情" footer-hide>
<Detail :eid="curId" />
</Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
<p>确定删除?</p>
</Modal>
</div>
</template>
<script>
import Api from "./api";
import Add from "./add";
import Edit from "./edit";
import Detail from "./detail";
export default {
name: "list",
components: {
Add,
Edit,
Detail
},
data() {
return {
action: Api.index,
list: [
{
name: "jjk"
}
],
isactive: null,
keys: "",
easySearch: {
keys: { op: "name", value: null },
customerId: { op: "Equal", value: null }
},
addModal: false,
editModal: false,
detailModal: false,
deletelModal: false,
curId: 0,
customerId: 0,
columns: [{ key: "id", title: this.l("id"), hide: true, align: "left" }],
name: "",
getlists: {
conditions: [
{
fieldName: "",
fieldValue: "",
conditionalType: "Equal"
}
],
pageSize: 1000
}
};
},
computed: {
projectList() {
return this.list.filter(u => {
return u.name.indexOf(this.keys) > -1;
});
}
},
mounted() {
this.getList();
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
clickSearch() {
this.getlists.conditions[0].fieldName = "name";
this.getlists.conditions[0].fieldValue = this.name;
this.getList();
},
listData(li, index) {
this.easySearch.customerId.value = li.id;
this.isactive = index;
this.customerId = li.id;
this.search();
},
getList() {
Api.list(this.getlists).then(r => {
if (r.success) {
this.list = r.result;
// this.easySearch.customerId.value = r.result[0].id
this.search();
}
});
},
easySearchs() {},
addOk() {
this.$refs.grid.load();
this.addModal = false;
this.detailModal = false;
this.editModal = false;
this.curId = 0;
},
add() {
if (this.isactive !== null) {
this.addModal = true;
} else {
this.$Message.info("请选择企业");
}
},
search() {
this.$refs.grid.reload(this.easySearch);
},
detail(id) {
this.detailModal = true;
this.curId = id;
},
edit(id) {
this.editModal = true;
this.curId = id;
},
remove(id) {
this.deletelModal = true;
this.curId = id;
},
removeOk() {
Api.delete({ id: this.curId }).then(r => {
if (r.success) {
this.$refs.grid.load();
this.deletelModal = false;
this.$Message.success("删除成功");
}
});
},
removeCancel() {
this.deletelModal = false;
},
cancel() {
this.curId = 0;
this.addModal = false;
this.detailModal = false;
this.editModal = false;
this.deletedlModal = false;
},
l(key) {
let vkey = "Project" + "." + key;
return this.$t(vkey) || key;
}
}
};
</script>
<style lang="less">
.addclass {
border-color: #249e91 !important;
.title-i {
background: #249e91 !important;
}
}
.project-steps {
display: flex;
display: -webkit-flex;
height: 85vh;
overflow: hidden;
border-top: 1px solid #e4e6ed;
h4 {
margin-bottom: 5px;
}
.aps-l {
width: 20%;
border-right: 1px solid #e4e6ed;
height: 100%;
padding: 15px 18px 15px 10px;
overflow: auto;
.row-p {
.chan-chi {
font-size: 14px;
font-weight: bold;
margin-top: 3px;
}
.search-r {
text-align: right;
}
}
.click-a:hover {
cursor: pointer;
}
.left-body:hover {
border: 1px solid #249e91;
.title-i {
background: #249e91 !important;
}
}
.left-body {
margin-top: 15px;
border: 1px solid #e4e6ed;
border-radius: 4px;
.title-i {
padding: 0 8px;
height: 35px;
line-height: 35px;
color: #fff;
background: rgba(36, 158, 145, 0.5);
font-size: 15px;
}
.down-text {
background: rgba(167, 184, 204, 0.2);
padding: 5px 8px;
.fa {
height: 30px;
line-height: 30px;
color: #515a6e;
}
}
}
}
.aps-r {
width: 80%;
height: 100%;
overflow: auto;
padding: 15px 0 15px 15px;
.body {
border: 1px solid #e4e6ed;
border-radius: 4px;
margin-right: 8px;
margin-bottom: 8px;
.title-i {
padding: 0 8px;
height: 35px;
line-height: 35px;
color: #fff;
background: #a7b8cc;
font-size: 15px;
.btn-click {
text-align: right;
a {
color: #fff;
}
a:hover {
color: #249e91;
}
}
}
.down-text {
background: rgba(167, 184, 204, 0.2);
padding: 5px 8px;
.row {
height: 28px;
line-height: 28px;
.fa {
color: #515a6e;
}
}
}
}
}
}
</style>
\ No newline at end of file
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<!-- <Col :span="12">
<FormItem :label="l('projectId')" prop="projectId">
<InputNumber v-model="entity.projectId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('customerId')" prop="customerId">
<InputNumber v-model="entity.customerId"></InputNumber>
</FormItem>
</Col>-->
<!-- <Col :span="12">
<FormItem :label="l('userId')" prop="userId">
<InputNumber v-model="entity.userId"></InputNumber>
</FormItem>
</Col>-->
<Col :span="12">
<FormItem :label="l('type')" prop="type">
<Dictionary
code="crm.sales.type"
v-model="entity.type"
type="select"
:value="entity.type"
:key="entity.type"
></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('time')" prop="time">
<DatePicker type="date" v-model="entity.time"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('principal')" prop="principal">
<Input v-model="entity.principal"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary
code="crm.sales.status"
v-model="entity.status"
type="radio"
:value="entity.status"
:key="entity.status"
></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('accessory')" prop="accessory">
<files ref="refFile" :parms="parms" files />
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('deliverable')" prop="deliverable">
<Input v-model="entity.deliverable" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('arrange')" prop="arrange">
<Input v-model="entity.arrange" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('notes')" prop="notes">
<Input v-model="entity.notes" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from "./api";
export default {
name: "Add",
data() {
return {
disabled: false,
entity: {
userId: 1, //销售人员id默认为1
projectId: 0,
customerId: 0,
status: 1,
principal: 0,
stage: 1
},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }]
},
parms: {
app: "Follow",
eid: null,
name: "",
field: ""
}
};
},
props: {
v: Object,
addId: {
projectId: Number,
customerId: Number,
principal: String
}
},
mounted() {
this.parms.eid = this.$u.guid();
this.$refs.refFile.intFiles();
},
methods: {
handleSubmit() {
this.$refs.form.validate(v => {
if (v) {
this.entity.accessory = "";
if (this.$refs.refFile.nameList.length > 0) {
let nameList = this.$refs.refFile.nameList;
let names = [];
nameList.forEach(e => {
names.push(e.fileName);
});
this.entity.accessory = JSON.stringify(names)
.replace("[", "")
.replace("]", "")
.replace(/\"/g, ""); //附件本地库暂存文件名称
}
this.disabled = true;
Api.create(this.entity)
.then(r => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
this.$refs.refFile.intFiles();
})
.catch(err => {
this.disabled = false;
this.$Message.error("保存失败");
console.warn(err);
});
}
});
},
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "Follow" + "." + key;
return this.$t(key);
}
},
watch: {
"addId.projectId"(v) {
if (v > 0) {
this.entity.projectId = v;
}
},
"addId.customerId"(v) {
if (v > 0) {
this.entity.customerId = v;
}
},
"addId.principal"(v) {
this.entity.principal = v;
}
}
};
</script>
\ No newline at end of file
import Api from '@/plugins/request'
export default {
index: `${crmUrl}/follow/paged`,
paged(params) {
return Api.post(`${crmUrl}/follow/paged`, params);
},
pagedList(params) {
return Api.post(`${crmUrl}/project/list`, params);
},
get(params) {
return Api.get(`${crmUrl}/follow/get`, params);
},
create(params) {
return Api.post(`${crmUrl}/follow/create`, params);
},
update(params) {
return Api.post(`${crmUrl}/follow/update`, params);
},
//删除:
delete(params) {
return Api.delete(`${crmUrl}/follow/delete`, { params: params });
},
}
\ No newline at end of file
<template>
<div class="detail">
<Row>
<!-- <Filed :span="12" :name="l('projectId')">{{entity.projectId}}</Filed>
<Filed :span="12" :name="l('customerId')">{{entity.customerId}}</Filed>-->
<Filed :span="12" :name="l('userId')">{{entity.userId}}</Filed>
<Filed :span="12" :name="l('type')">
<state code="crm.sales.type" :value="entity.type" />
</Filed>
<Filed :span="12" :name="l('time')">{{entity.time}}</Filed>
<Filed :span="12" :name="l('principal')">{{entity.principal}}</Filed>
<Filed :span="12" :name="l('status')">
<state code="crm.sales.status" :value="entity.status" />
</Filed>
<Filed :span="12" :name="l('deliverable')">{{entity.deliverable}}</Filed>
<Filed :span="24" :name="l('arrange')">{{entity.arrange}}</Filed>
<Filed :span="24" :name="l('notes')">{{entity.notes}}</Filed>
</Row>
</div>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }],
code: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
eid: Number
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result
this.$emit('on-load')
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'Follow' + '.' + key
return this.$t(key)
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v)
}
}
}
}
</script>
\ No newline at end of file
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<!-- <Col :span="12">
<FormItem :label="l('projectId')" prop="projectId">
<InputNumber v-model="entity.projectId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('customerId')" prop="customerId">
<InputNumber v-model="entity.customerId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('userId')" prop="userId">
<InputNumber v-model="entity.userId"></InputNumber>
</FormItem>
</Col>-->
<Col :span="12">
<FormItem :label="l('type')" prop="type">
<Dictionary
code="crm.sales.type"
v-model="entity.type"
type="select"
:value="entity.type"
:key="entity.type"
></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('time')" prop="time">
<DatePicker type="date" v-model="entity.time"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('principal')" prop="principal">
<Input v-model="entity.principal"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary
code="crm.sales.status"
v-model="entity.status"
type="radio"
:value="entity.status"
:key="entity.status"
></Dictionary>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('deliverable')" prop="deliverable">
<Input v-model="entity.deliverable" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('arrange')" prop="arrange">
<Input v-model="entity.arrange" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('notes')" prop="notes">
<Input v-model="entity.notes" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Edit',
data() {
return {
disabled: false,
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
eid: Number
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result
this.$emit('on-load')
})
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true
Api.update(this.entity)
.then((r) => {
this.disabled = false
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
} else {
this.$Message.error('保存失败')
}
})
.catch((err) => {
this.disabled = false
this.$Message.error('保存失败')
console.warn(err)
})
}
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'Follow' + '.' + key
return this.$t(key)
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v)
}
}
}
}
</script>
\ No newline at end of file
<template>
<div class="sales">
<div class="steps-k">
<Steps :current="current">
<Step title="目标客户" class="title-c" @click.native="next(1)"></Step>
<Step title="意向阶段" class="title-c" @click.native="next(2)"></Step>
<Step title="商务阶段" class="title-c" @click.native="next(3)"></Step>
<Step title="成交阶段" class="title-c" @click.native="next(4)"></Step>
</Steps>
</div>
<Project-List :stage="stage"></Project-List>
</div>
</template>
<script>
import ProjectList from "./projectList.vue";
export default {
components: {
ProjectList
},
data() {
return {
current: 0,
stage: 1
};
},
methods: {
next(name) {
if (name == 1) {
this.current = 0;
this.stage = 1;
} else if (name == 2) {
this.current = 1;
this.stage = 2;
} else if (name == 3) {
this.current = 2;
this.stage = 3;
} else if (name == 4) {
this.current = 3;
this.stage = 4;
}
}
}
};
</script>
<style lang='less' scoped>
.sales {
height: 90%;
padding-top: 8px;
.steps-k {
margin: 10px 30px;
.title-c {
cursor: pointer;
}
}
}
</style>
\ No newline at end of file
This diff is collapsed.
<template>
<Form ref="form" :model="condition" :label-width="90">
<Row>
<Col :span="12" :v-if="condition.id.show">
<FormItem :label="l('id')" prop="id">
<Input v-model="condition.id.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.creationTime.show">
<FormItem :label="l('creationTime')" prop="creationTime">
<DatePicker type="daterange" v-model="condition.creationTime.value"></DatePicker>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.creatorUserId.show">
<FormItem :label="l('creatorUserId')" prop="creatorUserId">
<Input v-model="condition.creatorUserId.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.lastModificationTime.show">
<FormItem :label="l('lastModificationTime')" prop="lastModificationTime">
<DatePicker type="daterange" v-model="condition.lastModificationTime.value"></DatePicker>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.lastModifierUserId.show">
<FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId">
<Input v-model="condition.lastModifierUserId.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.isDeleted.show">
<FormItem :label="l('isDeleted')" prop="isDeleted">
<Input v-model="condition.isDeleted.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.deletionTime.show">
<FormItem :label="l('deletionTime')" prop="deletionTime">
<DatePicker type="daterange" v-model="condition.deletionTime.value"></DatePicker>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.deleterUserId.show">
<FormItem :label="l('deleterUserId')" prop="deleterUserId">
<Input v-model="condition.deleterUserId.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.projectId.show">
<FormItem :label="l('projectId')" prop="projectId">
<Input v-model="condition.projectId.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.customerId.show">
<FormItem :label="l('customerId')" prop="customerId">
<Input v-model="condition.customerId.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.userId.show">
<FormItem :label="l('userId')" prop="userId">
<Input v-model="condition.userId.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.type.show">
<FormItem :label="l('type')" prop="type">
<Input v-model="condition.type.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.time.show">
<FormItem :label="l('time')" prop="time">
<DatePicker type="daterange" v-model="condition.time.value"></DatePicker>
</FormItem>
</Col>
<Col :span="24" :v-if="condition.deliverable.show">
<FormItem :label="l('deliverable')" prop="deliverable">
<Input v-model="condition.deliverable.value"></Input>
</FormItem>
</Col>
<Col :span="24" :v-if="condition.arrange.show">
<FormItem :label="l('arrange')" prop="arrange">
<Input v-model="condition.arrange.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.principal.show">
<FormItem :label="l('principal')" prop="principal">
<Input v-model="condition.principal.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.status.show">
<FormItem :label="l('status')" prop="status">
<Input v-model="condition.status.value"></Input>
</FormItem>
</Col>
<Col :span="24" :v-if="condition.notes.show">
<FormItem :label="l('notes')" prop="notes">
<Input v-model="condition.notes.value"></Input>
</FormItem>
</Col>
</Row>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
condition: {
id: { op: 'Equal', value: null, show: false },
creationTime: { op: 'Range', value: null, show: false },
creatorUserId: { op: 'Equal', value: null, show: false },
lastModificationTime: { op: 'Range', value: null, show: false },
lastModifierUserId: { op: 'Equal', value: null, show: false },
isDeleted: { op: 'Equal', value: null, show: false },
deletionTime: { op: 'Range', value: null, show: false },
deleterUserId: { op: 'Equal', value: null, show: false },
projectId: { op: 'Equal', value: null, show: true },
customerId: { op: 'Equal', value: null, show: true },
userId: { op: 'Equal', value: null, show: true },
type: { op: 'Equal', value: null, show: true },
time: { op: 'Range', value: null, show: true },
deliverable: { op: 'Equal', value: null, show: true },
arrange: { op: 'Equal', value: null, show: true },
principal: { op: 'Equal', value: null, show: true },
status: { op: 'Equal', value: null, show: true },
notes: { op: 'Equal', value: null, show: true }
}
}
},
methods: {
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'Follow' + '.' + key
return this.$t(key)
}
}
}
</script>
\ No newline at end of file
import Api from '@/plugins/request'
export default {
getUserInfo(params) {
return Api.get(`${systemUrl}/user/getuserinfo`, params);
},
// 获取打你审批数据
getpaged(params) {
return Api.post(`${workflowUrl}/instance/getpaged`, params);
},
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
import Api from '@/plugins/request'
export default {
index:`${resourceUrl}/materialpowder/itempaged`,
paged(params){
return Api.post(`${resourceUrl}/materialpowder/itempaged`,params);
},
get(params){
return Api.get(`${resourceUrl}/materialpowder/get`,params);
},
create(params){
return Api.post(`${resourceUrl}/materialpowder/create`,params);
},
update(params){
return Api.post(`${resourceUrl}/materialpowder/update`,params);
},
//删除:
delete(params) {
return Api.delete(`${resourceUrl}/materialpowder/delete`,{params:params});
},
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment