|
@@ -0,0 +1,252 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <basic-container v-show="!detailsOpen">
|
|
|
+ <avue-crud :option="option"
|
|
|
+ :table-loading="loading"
|
|
|
+ :data="data"
|
|
|
+ :page.sync="page"
|
|
|
+ :before-open="beforeOpen"
|
|
|
+ v-model="form"
|
|
|
+ ref="crud"
|
|
|
+ @search-change="searchChange"
|
|
|
+ @search-reset="searchReset"
|
|
|
+ @selection-change="selectionChange"
|
|
|
+ @current-change="currentChange"
|
|
|
+ @size-change="sizeChange"
|
|
|
+ @refresh-change="refreshChange"
|
|
|
+ @on-load="onLoad">
|
|
|
+ <template slot-scope="{type,size,row,index}" slot="menu">
|
|
|
+ <el-button v-if="row.status === 0" :size="size" :type="type" @click="audit(row, 2)">通过
|
|
|
+ </el-button>
|
|
|
+ <el-button v-if="row.status === 0" :size="size" :type="type" @click="audit(row, 1)">驳回
|
|
|
+ </el-button>
|
|
|
+ <el-button v-if="row.status === 0" :size="size" type="danger" @click="handleDelete(row)">删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row, index }" slot="customerName">
|
|
|
+ <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row)">{{
|
|
|
+ row.customerName
|
|
|
+ }}</span>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ </basic-container>
|
|
|
+ <detail v-if="detailsOpen" ref="detailRef" :onLoad="form" @backToList="backToList"></detail>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+
|
|
|
+import {getList, getDetail, del, greenRecyclingAudit} from "@/api/tirePartsMall/cycling/cycling";
|
|
|
+import detail from "@/views/tirePartsMall/recycling/detailsPage.vue";
|
|
|
+
|
|
|
+export default {
|
|
|
+ components: {detail},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ form: {},
|
|
|
+ query: {},
|
|
|
+ loading: true,
|
|
|
+ detailsOpen: false,
|
|
|
+ page: {
|
|
|
+ pageSize: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0
|
|
|
+ },
|
|
|
+ selectionList: [],
|
|
|
+ option: {
|
|
|
+ height: 'auto',
|
|
|
+ calcHeight: 30,
|
|
|
+ tip: false,
|
|
|
+ searchShow: true,
|
|
|
+ searchMenuSpan: 6,
|
|
|
+ border: true,
|
|
|
+ index: true,
|
|
|
+ delBtn: false,
|
|
|
+ editBtn: false,
|
|
|
+ addBtn: false,
|
|
|
+ viewBtn: false,
|
|
|
+ selection: false,
|
|
|
+ align: "center",
|
|
|
+ dialogClickModal: false,
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: "客户名称",
|
|
|
+ prop: "customerName",
|
|
|
+ searchSpan: 4,
|
|
|
+ search: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "总金额",
|
|
|
+ prop: "amount"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "总数量",
|
|
|
+ search: true,
|
|
|
+ searchSpan: 4,
|
|
|
+ prop: "quantity"
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: "创建人",
|
|
|
+ prop: "createUserName"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "创建时间",
|
|
|
+ prop: "createTime",
|
|
|
+ search: true,
|
|
|
+ searchProp: "createTimeList",
|
|
|
+ type: "date",
|
|
|
+ unlinkPanels: true,
|
|
|
+ searchRange: true,
|
|
|
+ searchDefaultTime: ["00:00:00", "23:59:59"],
|
|
|
+ format: "yyyy-MM-dd",
|
|
|
+ valueFormat: "yyyy-MM-dd HH:mm:ss"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "更新人",
|
|
|
+ prop: "updateUserName"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "更新时间",
|
|
|
+ prop: "updateTime"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "审核状态",
|
|
|
+ prop: "status",
|
|
|
+ type: 'select',
|
|
|
+ search: true,
|
|
|
+ searchSpan: 4,
|
|
|
+ dicData: [
|
|
|
+ {
|
|
|
+ label: "待审批",
|
|
|
+ value: 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "已通过",
|
|
|
+ value: 2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "已拒绝",
|
|
|
+ value: 1
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ data: []
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ids() {
|
|
|
+ let ids = [];
|
|
|
+ this.selectionList.forEach(ele => {
|
|
|
+ ids.push(ele.id);
|
|
|
+ });
|
|
|
+ return ids.join(",");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ backToList() {
|
|
|
+ this.form = {}
|
|
|
+ this.detailsOpen = false
|
|
|
+ this.$store.commit("OUT_FINACING_DETAIL");
|
|
|
+ this.onLoad(this.page, this.search)
|
|
|
+ },
|
|
|
+ editOpen(row) {
|
|
|
+ this.form = row
|
|
|
+ let rowImg = []
|
|
|
+ if (row.imgs && row.imgs !== "[]") {
|
|
|
+ let uniAppImg = JSON.parse(row.imgs)
|
|
|
+ rowImg = uniAppImg.map(item => {
|
|
|
+ return {
|
|
|
+ label: item.fileName,
|
|
|
+ value: item.url
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.form.imgs = rowImg
|
|
|
+ this.$store.commit("IN_FINACING_DETAIL");
|
|
|
+ this.detailsOpen = true;
|
|
|
+ },
|
|
|
+ handleDelete(row) {
|
|
|
+ this.$confirm("确定要删除该数据?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ del(row.id).then(res => {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: res.data.msg
|
|
|
+ });
|
|
|
+ })
|
|
|
+ this.onLoad(this.page);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ beforeOpen(done, type) {
|
|
|
+ if (["edit", "view"].includes(type)) {
|
|
|
+ getDetail(this.form.id).then(res => {
|
|
|
+ this.form = res.data.data;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ searchReset() {
|
|
|
+ this.query = {};
|
|
|
+ this.onLoad(this.page);
|
|
|
+ },
|
|
|
+ searchChange(params, done) {
|
|
|
+ this.query = params;
|
|
|
+ this.page.currentPage = 1;
|
|
|
+ this.onLoad(this.page, params);
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ selectionChange(list) {
|
|
|
+ this.selectionList = list;
|
|
|
+ },
|
|
|
+ selectionClear() {
|
|
|
+ this.selectionList = [];
|
|
|
+ this.$refs.crud.toggleSelection();
|
|
|
+ },
|
|
|
+ currentChange(currentPage) {
|
|
|
+ this.page.currentPage = currentPage;
|
|
|
+ },
|
|
|
+ sizeChange(pageSize) {
|
|
|
+ this.page.pageSize = pageSize;
|
|
|
+ },
|
|
|
+ refreshChange() {
|
|
|
+ this.onLoad(this.page, this.query);
|
|
|
+ },
|
|
|
+ onLoad(page, params = {}) {
|
|
|
+ this.loading = true;
|
|
|
+ getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
|
|
|
+ const data = res.data.data;
|
|
|
+ this.page.total = data.total;
|
|
|
+ this.data = data.records;
|
|
|
+ this.loading = false;
|
|
|
+ this.selectionClear();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ audit(row, status) {
|
|
|
+ this.$confirm("确认要审核" + (status === 2 ? '通过' : '驳回') + '吗?', {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ greenRecyclingAudit({id: row.id, status: status}).then(res => {
|
|
|
+ console.info('res----', res)
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: res.data.msg
|
|
|
+ });
|
|
|
+ this.onLoad(this.page, this.search)
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+</style>
|