From 98250a7cff913563152ae8b313c7f45cc27545ba Mon Sep 17 00:00:00 2001 From: liukangdong <898885815@qq.com> Date: 星期四, 27 二月 2025 09:13:50 +0800 Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/dmvisit --- admin/src/views/business/reportRecord.vue | 142 ++++++++++++++++++++++++++++++++++------------- 1 files changed, 103 insertions(+), 39 deletions(-) diff --git a/admin/src/views/business/reportRecord.vue b/admin/src/views/business/reportRecord.vue index d106678..f9a206d 100644 --- a/admin/src/views/business/reportRecord.vue +++ b/admin/src/views/business/reportRecord.vue @@ -1,32 +1,77 @@ <template> <div class="main_app"> - <QueryForm v-model="filters" :query-form-config="queryFormConfig" @handleQuery="getList(1)" @clear="clear" /> - <div class="query_btns" style="margin: 16px 0 0" - v-permissions="['business:visits:create', 'business:visits:exportExcel']"> - <el-button type="primary" @click="handleEdit()" icon="el-icon-plus" - v-permissions="['business:visits:create']">鏂板缓</el-button> - <el-button type="primary" :loading="exLoading" @click="exportExcel" - v-permissions="['business:visits:exportExcel']">瀵煎嚭</el-button> + <QueryForm + v-model="filters" + :query-form-config="queryFormConfig" + @handleQuery="getList(1)" + @clear="clear" + /> + <div class="query_btns" style="margin: 16px 0 0" v-permissions="['business:visits:create', 'business:visits:exportExcel']"> + <el-button type="primary" @click="handleEdit()" icon="el-icon-plus" v-permissions="['business:visits:create']">鏂板缓</el-button> + <el-button type="primary" :loading="exLoading" @click="exportExcel" v-permissions="['business:visits:exportExcel']">瀵煎嚭</el-button> </div> - <el-table v-loading="loading" :data="dataList" stripe row-key="id" default-expand-all> + <el-table + v-loading="loading" + :data="dataList" + stripe + row-key="id" + default-expand-all + > <el-table-column type="selection" width="55" align="center"></el-table-column> - <el-table-column prop="carNos" label="鍏ュ洯杞﹁締" min-width="100px"></el-table-column> - <el-table-column prop="companyName" label="鍏徃鍚嶇О" min-width="100px"></el-table-column> - <el-table-column prop="name" label="鑱旂郴浜轰俊鎭�" min-width="100px"></el-table-column> - <el-table-column prop="phone" label="鎵嬫満鍙�" min-width="100px"></el-table-column> - <el-table-column prop="receptMemberName" label="琚浜�" min-width="100px"></el-table-column> + <el-table-column + prop="carNos" + label="鍏ュ洯杞﹁締" + min-width="100px" + ></el-table-column> + <el-table-column + prop="companyName" + label="鍏徃鍚嶇О" + min-width="100px" + ></el-table-column> + <el-table-column + prop="name" + label="鑱旂郴浜轰俊鎭�" + min-width="100px" + ></el-table-column> + <el-table-column + prop="phone" + label="鎵嬫満鍙�" + min-width="100px" + ></el-table-column> + <el-table-column + prop="receptMemberName" + label="琚浜�" + min-width="100px" + ></el-table-column> <el-table-column label="鎷滆鏃堕棿" min-width="160px"> <template slot-scope="{ row }"> - <span>璧凤細{{ row.starttime }}</span><br /> + <span>璧凤細{{ row.starttime }}</span + ><br /> <span>姝細{{ row.endtime }}</span> </template> </el-table-column> - <el-table-column prop="reason" label="鎷滆浜嬬敱" min-width="100"></el-table-column> - <el-table-column prop="status" fixed="right" label="鐘舵��" align="center" min-width="100"> + <el-table-column + prop="reason" + label="鎷滆浜嬬敱" + min-width="100" + ></el-table-column> + <el-table-column + prop="status" + fixed="right" + label="鐘舵��" + align="center" + min-width="100" + > <template slot-scope="{ row }"> - <span style="color: rgba(245, 154, 35, 0.996)" v-if="row.status === 0">寰呮彁浜ゅ鎵�</span> - <span v-if="row.status === 1" style="color: rgba(245, 154, 35, 0.996)">澶勭悊涓�</span> - <span v-if="row.status === 2" style="color: rgba(245, 154, 35, 0.996)">宸插悓鎰�</span> + <span style="color: rgba(245, 154, 35, 0.996)" v-if="row.status === 0" + >寰呮彁浜ゅ鎵�</span + > + <span v-if="row.status === 1" style="color: rgba(245, 154, 35, 0.996)" + >澶勭悊涓�</span + > + <span v-if="row.status === 2" style="color: rgba(245, 154, 35, 0.996)" + >宸插悓鎰�</span + > <span style="color: gray" v-if="row.status === 3">宸叉嫆缁�</span> <span v-if="row.status === 4" style="color: gray">鍙栨秷</span> <span v-if="row.status === 5" style="color: green">涓嬪彂鎴愬姛</span> @@ -36,16 +81,23 @@ <span v-if="row.status === 9" style="color: gray">宸插け鏁�</span> </template> </el-table-column> - <el-table-column label="鎿嶄綔" align="center" width="100" fixed="right"> + <el-table-column label="鎿嶄綔" align="center" width="180" fixed="right"> <template slot-scope="{ row }"> - <el-button type="text" @click="handleDetail(row)" v-permissions="['business:company:update']">鏌ョ湅璇︽儏</el-button> + <el-button + type="text" + @click="handleDetail(row)" + v-permissions="['business:company:update']">鏌ョ湅璇︽儏</el-button> + <el-button type="text" icon="el-icon-delete" @click="deleteById(row)" style="color: red" v-permissions="['business:visits:delete']">鍒犻櫎</el-button> </template> </el-table-column> </el-table> - <pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination" /> + <pagination + @size-change="handleSizeChange" + @current-change="getList" + :pagination="pagination" + /> <ReportDetail v-if="isShowReport" ref="VisReportDetailRef" /> - <OperaVisitsReportWindow @close="isShowEdit = false" @success="getList" v-if="isShowEdit" - ref="operaVisitsWindowRef" /> + <OperaVisitsReportWindow @close="isShowEdit = false" @success="getList" v-if="isShowEdit" ref="operaVisitsWindowRef" /> </div> </template> @@ -55,7 +107,7 @@ // import ReportDetail from './page-components/ReportDetail.vue' import ReportDetail from '@/views/task/visReportDetail.vue' import OperaVisitsReportWindow from '@/components/business/operaVisitsReportWindow.vue' -import { fetchList, exportExcel } from '@/api/business/visits' +import { fetchList, exportExcel, deleteById } from '@/api/business/visits' export default { components: { ReportDetail, @@ -63,7 +115,7 @@ Pagination, OperaVisitsReportWindow }, - data() { + data () { return { isShowEdit: false, exLoading: false, @@ -102,11 +154,11 @@ total: 0 } }, - created() { + created () { this.getList() }, methods: { - exportExcel() { + exportExcel () { this.$dialog.exportConfirm('纭瀵煎嚭鍚楋紵') .then(() => { this.exLoading = true @@ -126,13 +178,28 @@ }) }) }, - handleEdit() { + handleEdit () { this.isShowEdit = true this.$nextTick(() => { this.$refs.operaVisitsWindowRef.isShowModal = true }) }, - handleDetail(row) { + deleteById (row) { + this.$confirm('纭畾鍒犻櫎璇ヨ褰曞悧, 鏄惁缁х画?', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + deleteById(row.id) + .then(res => { + this.$message.success('鎿嶄綔鎴愬姛') + this.page = 1 + this.getList() + }) + }).catch(() => { + }) + }, + handleDetail (row) { this.isShowReport = true this.$nextTick(() => { this.$nextTick(() => { @@ -143,28 +210,24 @@ }) }) }, - getList(page) { + getList (page) { const { pagination, filters } = this pagination.page = page || pagination.page - this.loading = true fetchList({ model: { ...filters }, ...pagination }).then(res => { - this.loading = false this.dataList = res.records || [] this.pagination.total = res.total - }, () => { - this.loading = false }) }, - clear() { + clear () { this.filters = { type: 2 } - this.getList(1) + this.getList(0) }, - handleSizeChange(capacity) { + handleSizeChange (capacity) { this.pagination.capacity = capacity this.getList() } @@ -172,4 +235,5 @@ } </script> -<style lang="scss" scoped></style> +<style lang="scss" scoped> +</style> -- Gitblit v1.9.3