123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364 |
- <template>
- <div>
- <basic-container v-if="isShow">
- <avue-crud
- ref="crud"
- id="out-table"
- :option="option"
- :table-loading="loading"
- :data="data"
- :page.sync="page"
- :search.sync="query"
- @search-change="searchChange"
- @search-reset="searchReset"
- @selection-change="selectionChange"
- @current-change="currentChange"
- @size-change="sizeChange"
- @refresh-change="refreshChange"
- @on-load="onLoad"
- >
- <template slot="menuLeft">
- <el-button
- type="primary"
- size="small"
- icon="el-icon-plus"
- @click="addButton"
- >创建单据
- </el-button>
- </template>
- <template slot="menu" slot-scope="{ row, index }">
- <el-button
- size="small"
- icon="el-icon-edit"
- type="text"
- @click="rowEdit(row)"
- >编辑
- </el-button>
- <el-button
- size="small"
- icon="el-icon-delete"
- type="text"
- @click="rowDel(row, index)"
- :disabled="row.count > 0"
- >删 除
- </el-button>
- </template>
- <template slot="contractNo" slot-scope="{ row }">
- <span style="color: #1e9fff;cursor: pointer;" @click="rowEdit(row)">
- {{ row.contractNo }}
- </span>
- </template>
- </avue-crud>
- </basic-container>
- <detailsPage
- v-if="!isShow"
- :detailData="detailData"
- @goBack="goBack"
- ></detailsPage>
- </div>
- </template>
- <script>
- import { getList, remove } from '@/api/claimSettlement/index';
- import detailsPage from './detailsPage.vue';
- import { getToken } from '@/util/auth';
- export default {
- data() {
- return {
- isShow: true,
- form: {},
- query: {},
- loading: false,
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0
- },
- selectionList: [],
- option: {
- height: 'auto',
- calcHeight: 30,
- menuWidth: 140,
- tip: false,
- searchShow: true,
- searchMenuSpan: 24,
- border: true,
- index: true,
- addBtn: false,
- viewBtn: false,
- editBtn: false,
- delBtn: false,
- selection: true,
- searchIcon: true,
- align: 'center',
- searchIndex: 3,
- column: [
- {
- label: '理赔单号',
- prop: 'claimNo',
- search: true,
- overHidden: true
- },
- {
- label: '来源类型',
- prop: 'claimSourceType',
- search: true,
- type: 'select',
- dicData: [
- {
- label: '经销商',
- value: 1
- },
- {
- label: '门店',
- value: 2
- },
- {
- label: '终端消费者',
- value: 3
- }
- ],
- overHidden: true
- },
- {
- label: '来源方名称',
- prop: 'sourceName',
- width: 90,
- search: true,
- overHidden: true
- },
- {
- label: '消费者姓名',
- prop: 'consumerName',
- width: 90,
- search: true,
- overHidden: true
- },
- {
- label: '消费者电话',
- prop: 'consumerPhone',
- width: 90,
- overHidden: true
- },
- {
- label: '胎号',
- prop: 'tyreNo',
- overHidden: true
- },
- {
- label: '规格型号',
- prop: 'tyreSpecs',
- overHidden: true
- },
- {
- label: '购买日期',
- prop: 'purchaseDate',
- overHidden: true
- },
- {
- label: '装车日期',
- prop: 'mountDate',
- overHidden: true
- },
- {
- label: '行驶里程(km)',
- prop: 'runMileage',
- width: 100,
- overHidden: true
- },
- {
- label: '理赔原因',
- prop: 'claimReason',
- overHidden: true
- },
- {
- label: '索赔金额',
- prop: 'claimAmount',
- overHidden: true
- },
- {
- label: '审核状态',
- prop: 'auditStatus',
- type: 'select',
- dicData: [
- {
- label: '待审核',
- value: 0
- },
- {
- label: '审核中',
- value: 1
- },
- {
- label: '已通过',
- value: 2
- },
- {
- label: '已拒绝',
- value: 3
- }
- ],
- overHidden: true
- },
- {
- label: '提交时间',
- prop: 'submitTime',
- overHidden: true
- },
- {
- label: '备注',
- prop: 'remark',
- overHidden: true
- },
- {
- label: '制单人',
- prop: 'createUserName',
- overHidden: true,
- width: 80
- },
- {
- label: '制单日期',
- prop: 'createTime',
- type: 'date',
- overHidden: true,
- width: 100,
- format: 'yyyy-MM-dd',
- valueFormat: 'yyyy-MM-dd HH:mm:ss'
- },
- {
- label: '修改人',
- prop: 'updateUserName',
- overHidden: true,
- width: 80
- },
- {
- label: '修改日期',
- prop: 'updateTime',
- type: 'date',
- overHidden: true,
- width: 100,
- format: 'yyyy-MM-dd',
- valueFormat: 'yyyy-MM-dd HH:mm:ss'
- }
- ]
- },
- data: []
- };
- },
- components: {
- detailsPage
- },
- created() {
- },
- methods: {
- addButton() {
- this.isShow = false;
- },
- /**
- * @param {{ id: any; }} row
- */
- rowEdit(row) {
- this.detailData = {
- id: row.id
- };
- this.isShow = false;
- },
- // 删除
- /**
- * @param {{ item: number; id: any; }} row
- * @param {any} index
- */
- rowDel(row, index) {
- if (row.item == 1) {
- return this.$message.error('存在明细不允许删除');
- }
- this.$confirm('确定将选择数据删除?', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- remove({ ids: row.id }).then(res => {
- this.onLoad(this.page, this.query);
- this.$message.success('成功删除');
- });
- });
- },
- searchReset() {
- this.query = this.$options.data().query;
- this.onLoad(this.page);
- },
- // 搜索按钮点击
- /**
- * @param {any} params
- * @param {() => void} done
- */
- searchChange(params, done) {
- this.page.currentPage = 1;
- this.onLoad(this.page, this.query);
- done();
- },
- /**
- * @param {any} list
- */
- selectionChange(list) {
- this.selectionList = list;
- },
- /**
- * @param {any} currentPage
- */
- currentChange(currentPage) {
- this.page.currentPage = currentPage;
- },
- /**
- * @param {any} pageSize
- */
- sizeChange(pageSize) {
- this.page.pageSize = pageSize;
- },
- refreshChange() {
- this.onLoad(this.page, this.query);
- },
- /**
- * @param {{ currentPage: any; pageSize: any; }} page
- */
- onLoad(page, params = {}) {
- let obj = {};
- obj = {
- ...Object.assign(params, this.query)
- };
- this.loading = true;
- getList(page.currentPage, page.pageSize, obj)
- .then(res => {
- this.data = res.data.data.records;
- this.page.total = res.data.data.total;
- this.$nextTick(() => {
- this.$refs.crud.doLayout();
- // this.$refs.crud.dicInit();
- });
- })
- .finally(() => {
- this.loading = false;
- });
- },
- // 详情的返回列表
- goBack() {
- // 初始化数据
- if (JSON.stringify(this.$route.query) != '{}') {
- this.$router.$avueRouter.closeTag();
- this.$router.push({
- path: '/boxManagement/buyContainer/index'
- });
- }
- this.detailData = {};
- this.isShow = true;
- this.onLoad(this.page, this.query);
- },
- }
- };
- </script>
- <style lang="scss" scoped>
- ::v-deep .el-col-md-8 {
- width: 24.33333%;
- }
- </style>
|