diff --git a/src/views/crm/business/Detail.vue b/src/views/crm/business/Detail.vue index 38c721b..c529dfe 100644 --- a/src/views/crm/business/Detail.vue +++ b/src/views/crm/business/Detail.vue @@ -113,7 +113,7 @@ :record-id="detailData.flow_id" :owner-user-id="detailData.owner_user_id" class="examine-info" - examine-type="crm_contract" + examine-type="crm_business" @on-handle="examineHandle"/> @@ -177,7 +177,7 @@ import { crmBusinessAdvanceAPI, crmBusinessStatusByIdAPI } from '@/api/crm/business' - +import { userListAPI } from '@/api/common' import SlideView from '@/components/SlideView' import CRMDetailHead from '../components/CRMDetailHead' import Activity from '../components/Activity' // 活动 @@ -190,7 +190,7 @@ import RelativeTeam from '../components/RelativeTeam' // 团队成员 import RelativeProduct from '../components/RelativeProduct' // 团队成员 import RelativeFiles from '../components/RelativeFiles' // 相关附件 import RelativePrint from '../components/RelativePrint' // 相关打印 - +import ExamineInfo from '@/components/Examine/ExamineInfo' import CRMAllCreate from '../components/CRMAllCreate' // 新建页面 import DetailMixin from '../mixins/Detail' import { separator } from '@/filters/vueNumeralFilter/filters' @@ -211,6 +211,7 @@ export default { RelativeProduct, RelativeFiles, RelativePrint, + ExamineInfo, CRMAllCreate }, mixins: [DetailMixin], @@ -241,6 +242,9 @@ export default { data() { return { // 展示加载loading + userOptions: [], + value: '', + inputValue: '', loading: false, crmType: 'business', headDetails: [ @@ -397,11 +401,36 @@ export default { }] } }, - mounted() {}, + mounted() { + this.getUserList() + }, methods: { /** * 详情 */ + getUserList() { + this.userLoading = true + let request = userListAPI + let params = {} + if (this.userRequest) { + request = this.userRequest + params = this.userParams || {} + } else { + params = { pageType: 0 } + } + request(params) + .then(res => { + const userList = res.data.list || res.data + console.log(userList) + this.userOptions = userList.map(item => { + return item + }) + this.userLoading = false + }) + .catch(() => { + this.userLoading = false + }) + }, getDetial() { this.firstContactsId = '' this.loading = true @@ -566,21 +595,52 @@ export default { } /** 输单 和 无效 */ if (item.type == 2 || item.type == 3) { - var message = '请填写' + item.name + '原因:' + var message = '请填写' + item.name + '原因:' var title = item.name + '原因' - // this.$prompt(message, title, { - // inputType: 'text', - // confirmButtonText: '确定', - // cancelButtonText: '取消' - // }) const h = this.$createElement + const msgBoxContent = h('div', [ + h('p', message), + h('textarea', { + attrs: { + class: 'el-textarea__inner', + type: 'textarea', + autocomplete: 'off', + rows: 4 + }, + value: this.inputValue + }), + h('p', '审核人:'), + h('el-select', { + ref: 'selectView', + props: { + clearable: true, + filterable: true, + placeholder: '请选择', + value: this.value + }, + on: { + input: val => { + this.value = val + console.log(val) + }, + change: e => { + this.value = e + this.$refs['selectView'].value = e + } + } + }, this.userOptions.map(option => { + return h('el-option', { + props: { + value: option.id, + label: option.username + } + }) + })) + ]) this.$msgbox({ title: title, - message: h('p', message, [ - h('i', { style: 'color: teal' }, 'VNode'), - h('') - ]), + message: msgBoxContent, showCancelButton: true, confirmButtonText: '确定', cancelButtonText: '取消' @@ -634,6 +694,16 @@ export default { .catch(() => {}) } }, + /** + * 审核操作 + */ + examineHandle(data) { + // 1 审核通过 2 审核拒绝 4 已撤回 + if (data.type == 1) { + this.getDetial() + } + this.$emit('handle', { type: 'examine' }) + }, /** * 新建 */ @@ -652,6 +722,12 @@ export default { console.log('ok') this.$emit('handle', { type: 'save-success' }) this.getDetial() + }, + /** + * 刷新value的值 + */ + updateVal(val) { + this.value = val } } } @@ -870,5 +946,9 @@ export default { .state-handel-item:hover { background-color: #f7f8fa; } + .el-textarea__inner{ + width: max-content; + border: 1px solid #C0C4CC; + } } diff --git a/src/views/crm/customer/Detail.vue b/src/views/crm/customer/Detail.vue index 144b58c..d440d4e 100644 --- a/src/views/crm/customer/Detail.vue +++ b/src/views/crm/customer/Detail.vue @@ -32,6 +32,7 @@ @close="hideView">