Commit 4f53420e authored by zhengyi's avatar zhengyi

跟进列表批量修改跟进状态业务补充

parent 916412da
......@@ -91,6 +91,13 @@ export function editCustomerFollow(data) {
data
})
}
export function updateCustomerFollowupStatus(data) {
return request({
url: "/customer/followup/update-status",
method: "put",
data
})
}
export function exportCustomerFollow(params) {
return request({
......
<template>
<el-dialog
center
:title="$t('修改跟进状态')"
:visible="show"
@close="close"
width="30%">
<div style="width: 100%;min-height: 60px;text-align: center">
<el-form label-width="120px">
<el-col :span="20">
<el-form-item :label="$t('跟进状态')">
<el-select v-model="status" :placeholder="$t('请选择')" size="small">
<el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FOLLOWUP_STATUS)" :key="dict.value"
:label="isChinese ? dict.label : dict.labelEn" :value="parseInt(dict.value)"/>
</el-select>
</el-form-item>
</el-col>
</el-form>
<!-- <el-select clearable v-model="status" :placeholder="$t('请选择')" size="small" >-->
<!-- <el-option v-for="dict in getDictDatas(DICT_TYPE.CUSTOMER_FOLLOWUP_STATUS)" :key="dict.value" :label="isChinese ? dict.label : dict.labelEn" :value="dict.value" />-->
<!-- </el-select>-->
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="$emit('update:show',false)">{{ $t('取 消') }}</el-button>
<el-button type="primary" @click="submit">{{ $t('确 定') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import {DICT_TYPE, getDictDatas, getDictDatas2} from "@/utils/dict";
import {updateCustomerFollowupStatus} from "@/api/ecw/customerFollow";
export default {
name: "customerFollowUpdateStatus",
props: {
show: {
type: Boolean,
default: false
},
followupIds: [Array, String],
tableName: String
},
computed: {
isChinese() {
return this.$i18n.locale === "zh_CN"
},
getFollowupIds() {
console.log(this.followupIds, 'this.followupIds')
if (this.followupIds instanceof Array) return this.followupIds
else return this.followupIds.split(',')
}
},
data() {
return {
getDictDatas,
getDictDatas2,
DICT_TYPE,
status: null
}
},
methods: {
submit() {
if (!this.status) {
return this.$message.warning(this.$t('请选择修改的状态!'));
}
console.log(this.followupIds, 'this.followupIds')
updateCustomerFollowupStatus({
ids: this.getFollowupIds,
status: this.status
}).then(r => {
if (r.code === 0) {
if (r.data) {
this.$message.success(r.data)
this.$emit('update:show', false)
this.$emit('update:followupIds', [])
this.status = '';
} else {
this.$emit('update:show', false)
this.$emit('update:followupIds', [])
this.status = null;
this.$message.success(this.$t('修改成功!'))
}
}
})
},
close() {
this.status = null;
this.$emit('update:show', false)
},
}
}
</script>
<style scoped>
</style>
......@@ -738,7 +738,6 @@ export default {
},
data() {
return {
customerFollowVisible: false,
env: process.env.NODE_ENV,
getDictDatas,
getDictDatas2,
......
......@@ -48,17 +48,31 @@
<div class="flex-c-c">
<el-button type="primary" icon="el-icon-search" @click="getCustomerFollowList">{{ $t("搜索") }} </el-button>
<el-button type="primary" @click="reset">{{ $t("重置") }} </el-button>
<el-button type="success" @click="handleAdd" v-hasPermi="['ecw:customer:follow-create']">{{ $t("新增") }} </el-button>
<el-button type="warning" @click="handleExport" v-hasPermi="['ecw:customer:follow-export']">
{{ $t("导出") }}
</el-button>
</div>
</el-form-item>
</div>
</el-form>
</div>
<el-table :data="customerFollowList" style="width: 100%">
<el-table-column prop="number" :label="$t('编号')" width="120">
<!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button :disabled="selectCustomerFollowList.length === 0" type="primary" @click="updateStatus = true" v-hasPermi="['ecw:customer:followup:batch-update-status']">{{ $t("修改状态") }}</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" @click="handleAdd" v-hasPermi="['ecw:customer:follow-create']">{{ $t("新增") }} </el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" @click="handleExport" v-hasPermi="['ecw:customer:follow-export']">
{{ $t("导出") }}
</el-button>
</el-col>
</el-row>
<el-table ref="multipleTable" :data="customerFollowList" v-loading="loading" @selection-change="handleSelectionChange" style="width: 100%">
<el-table-column type="selection" width="55" fixed></el-table-column>
<el-table-column prop="number" :label="$t('编号')" align="center" fixed>
<template slot-scope="scope">
<a href="javascript:void(0)" @click="handleCustomerFollowLink(scope.row)" class="link-type">{{ scope.row.number }}</a>
</template>
......@@ -112,22 +126,32 @@
<pagination :total="customerFollowTotal" :page.sync="followForm.pageNo" :limit.sync="followForm.pageSize" @pagination="getCustomerFollowList" />
</el-card>
<customer-follow ref="customerFollow" @handleCustomerFollowAdd="handleCustomerFollowAdd" @refresh="handleQuery" v-if="customerFollowVisible" :customer-id="customerId" :customerService="customerService" :customerNumber="customerNumber" />
<customer-follow-update-status :show.sync="updateStatus" :followup-ids.sync="selectCustomerFollowList"></customer-follow-update-status>
</div>
</template>
<script>
import { getCustomerFollowList, exportCustomerFollow } from "@/api/ecw/customerFollow"
import { getDictDatas, DICT_TYPE, getDictDatas2 } from "@/utils/dict"
import CustomerFollow from "@/views/ecw/customer/components/customerFollow"
import UserSelector from "@/components/UserSelector"
import customerFollowUpdateStatus from "@/views/ecw/customer/components/customerFollowUpdateStatus.vue";
export default {
name: "logListCommon",
components: { UserSelector, CustomerFollow },
components: {customerFollowUpdateStatus, UserSelector, CustomerFollow },
props: ["customerId", "offerId", "customerService", "customerNumber"],
data() {
return {
// 遮罩层
loading: true,
getDictDatas,
getDictDatas2,
DICT_TYPE,
updateStatus: false,
customerFollowVisible: false,
customerFollowTotal: 0,
customerFollowList: [],
selectCustomerFollowList: [],
followForm: {
pageNo: 1,
pageSize: 10
......@@ -140,7 +164,20 @@ export default {
created() {
this.handleQuery()
},
updated() {
this.$nextTick(() => {
this.$refs.multipleTable.doLayout()
})
},
computed: {
// selectAuthorityFn() {
// return (val) => {
// let t = val.split(":")
// t[t.length - 1] = this.authorityFn + t[t.length - 1]
// console.log(t.join(":"))
// return t.join(":")
// }
// },
isChinese() {
return this.$i18n.locale === "zh_CN"
},
......@@ -149,11 +186,20 @@ export default {
}
},
watch: {
selectCustomerFollowList(val) {
if (val.length === 0) {
this.getCustomerFollowList()
this.$refs.multipleTable.clearSelection()
}
},
customerId_offerId() {
this.handleQuery()
}
},
methods: {
handleSelectionChange(val) {
this.selectCustomerFollowList = val.map((i) => i.id)
},
handleCustomerFollowAdd(row) {
this.customerFollowVisible = false
setTimeout(() => {
......@@ -216,12 +262,14 @@ export default {
})
},
getCustomerFollowList() {
this.loading = true
getCustomerFollowList({
...this.followForm,
...this.formatQuery()
}).then((r) => {
this.customerFollowList = r.data.list
this.customerFollowTotal = r.data.total
this.loading = false
})
},
reset() {
......
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