|
|
@@ -0,0 +1,119 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <!-- 闭环弹窗 -->
|
|
|
+ <el-dialog append-to-body :title="title" :visible.sync="visible" width="900px" @close="close">
|
|
|
+ <el-form ref="form" :model="form" :rules="rules">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="闭环方式" prop="closeMethod">
|
|
|
+ <el-select v-model="form.closeMethod" placeholder="请选择闭环方式">
|
|
|
+ <el-option label="已创建项目" value="已创建项目" />
|
|
|
+ <el-option label="已创建经销商" value="已创建经销商" />
|
|
|
+ <el-option label="无法跟进" value="无法跟进" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col v-if="form.closeMethod == '已创建项目'" :span="24">
|
|
|
+ <el-form-item label="项目名称" prop="businessName">
|
|
|
+ <el-select v-model="form.businessName" filterable placeholder="请选择项目" style="width: 100%">
|
|
|
+ <el-option v-for="item in businessOptions" :key="item.id" :label="item.nboName" :value="item.nboName" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col v-if="form.closeMethod == '已创建经销商'" :span="24">
|
|
|
+ <el-form-item label="经销商名称" prop="distributorName">
|
|
|
+ <el-select v-model="form.distributorName" filterable placeholder="请选择经销商" style="width: 100%">
|
|
|
+ <el-option
|
|
|
+ v-for="item in distributorOptions"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.distName"
|
|
|
+ :value="item.distName" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-form-item label="申请原因" prop="closeReason">
|
|
|
+ <el-input
|
|
|
+ v-model="form.closeReason"
|
|
|
+ maxlength="500"
|
|
|
+ placeholder="请输入备注"
|
|
|
+ resize="none"
|
|
|
+ :rows="5"
|
|
|
+ show-word-limit
|
|
|
+ type="textarea" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer">
|
|
|
+ <el-button type="primary" @click="closeLoop">闭环</el-button>
|
|
|
+ <el-button @click="visible = false">取消</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import to from 'await-to-js'
|
|
|
+ import bidApi from '@/api/customer/bid'
|
|
|
+ import distributorApi from '@/api/base/distr'
|
|
|
+ import businessApi from '@/api/proj/business'
|
|
|
+
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ title: '申请闭环',
|
|
|
+ visible: false,
|
|
|
+ businessOptions: [],
|
|
|
+ distributorOptions: [],
|
|
|
+ form: {
|
|
|
+ closeMethod: '',
|
|
|
+ businessName: '',
|
|
|
+ distributorName: '',
|
|
|
+ closeReason: '',
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ closeMethod: [{ required: true, trigger: ['blur', 'change'], message: '请选择闭环方式' }],
|
|
|
+ businessName: [{ required: true, trigger: ['blur', 'change'], message: '请选择项目' }],
|
|
|
+ distributorName: [{ required: true, trigger: ['blur', 'change'], message: '请选择经销商' }],
|
|
|
+ closeReason: [{ required: true, trigger: ['blur', 'change'], message: '请输入闭环原因' }],
|
|
|
+ },
|
|
|
+ theBid: {},
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async init(row) {
|
|
|
+ this.theBid = row
|
|
|
+ this.visible = true
|
|
|
+ businessApi.getList({ pageNum: 1, pageSize: 99999 }).then((response) => {
|
|
|
+ this.businessOptions = response.data.list || []
|
|
|
+ })
|
|
|
+ distributorApi.getList({ pageNum: 1, pageSize: 99999 }).then((response) => {
|
|
|
+ this.distributorOptions = response.data.list || []
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async closeLoop() {
|
|
|
+ this.$refs.form.validate(async (valid) => {
|
|
|
+ if (valid) {
|
|
|
+ let params = { ...this.form }
|
|
|
+ params.id = this.theBid.id
|
|
|
+ const [err, res] = await to(bidApi.closeLoop(params))
|
|
|
+ if (err) return
|
|
|
+ this.$message.success(res.msg)
|
|
|
+ this.visible = false
|
|
|
+ this.$emit('doRefesh')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ close() {
|
|
|
+ this.form = {
|
|
|
+ closeMethod: '',
|
|
|
+ businessName: '',
|
|
|
+ distributorName: '',
|
|
|
+ closeReason: '',
|
|
|
+ }
|
|
|
+ this.$refs['form'].resetFields()
|
|
|
+ },
|
|
|
+ },
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style></style>
|