123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- <template>
- <div>
- <basic-container v-show="isShow" class="page-crad">
- <avue-crud
- ref="crud"
- :option="option"
- :data="dataList"
- :before-open="beforeOpen"
- :page.sync="page"
- :search.sync="search"
- @search-change="searchChange"
- @current-change="currentChange"
- @size-change="sizeChange"
- @refresh-change="refreshChange"
- @on-load="onLoad"
- :table-loading="loading"
- @saveColumn="saveColumn"
- @resetColumn="resetColumn"
- :cell-style="cellStyle"
- >
- <template slot-scope="{ row }" slot="updateUser">
- <span>{{ row.updateUserName }}</span>
- </template>
- <template slot-scope="{ row, index }" slot="menu">
- <el-button type="text" size="small" @click.stop="editOpen(row, 1)">
- 查看
- </el-button>
- <el-button type="text" size="small" @click.stop="editOpen(row, 2)">
- 编辑
- </el-button>
- <el-button type="text" size="small" @click.stop="rowDel(row, index)">
- 删除
- </el-button>
- </template>
- </avue-crud>
- </basic-container>
- </div>
- </template>
- <script>
- import { getList, remove } from "@/api/salaryManagement/primarySchool";
- export default {
- name: "index",
- data() {
- return {
- form: {},
- dataList: [],
- loading: false,
- isShow: true,
- detailData: {},
- page: {
- pageSize: 10,
- currentPage: 1
- },
- option: {
- searchShow: true,
- searchMenuSpan: 16,
- align: "center",
- searchSpan: 8,
- border: true,
- index: true,
- addBtn: false,
- viewBtn: false,
- editBtn: false,
- delBtn: false,
- menuWidth: 120,
- searchLabelWidth: 100,
- searchIcon: true,
- searchIndex: 2,
- column: [
- {
- label: "合同号",
- prop: "",
- overHidden: true,
- width: 100,
- search: true
- },
- {
- label: "客户名称",
- prop: "",
- overHidden: true,
- width: 100,
- search: true
- },
- {
- label: "合同日期",
- prop: "",
- type: "date",
- valueFormat: "yyyy-MM-dd",
- overHidden: true,
- width: 100
- },
- {
- label: "合同日期开始",
- prop: "DateStart",
- type: "date",
- valueFormat: "yyyy-MM-dd",
- search: true,
- hide: true,
- showColumn: false,
- span: 8
- },
- {
- label: "合同日期结束",
- prop: "DateEnd",
- type: "date",
- valueFormat: "yyyy-MM-dd",
- search: true,
- hide: true,
- showColumn: false,
- span: 8
- },
- {
- label: "起运港",
- prop: "",
- overHidden: true,
- width: 100
- },
- {
- label: "目的港",
- prop: "",
- overHidden: true,
- width: 100
- },
- {
- label: "运输条款",
- prop: "",
- overHidden: true,
- width: 100
- },
- {
- label: "采购报价",
- prop: "",
- overHidden: true,
- width: 100
- },
- {
- label: "销售金额",
- prop: "",
- overHidden: true,
- width: 100
- },
- {
- label: "产品毛利",
- prop: "",
- overHidden: true,
- width: 100
- },
- {
- label: "产品利率",
- prop: "",
- overHidden: true,
- width: 100
- },
- {
- label: "单票利润",
- prop: "",
- overHidden: true,
- width: 100
- }
- ]
- }
- };
- },
- methods: {
- cellStyle() {
- return "padding:0;height:40px;";
- },
- //点击搜索按钮触发
- searchChange(params, done) {
- this.page.currentPage = 1;
- this.onLoad(this.page, params);
- done();
- },
- refreshChange() {
- this.onLoad(this.page, this.search);
- },
- currentChange(val) {
- this.page.currentPage = val;
- },
- sizeChange(val) {
- this.page.currentPage = 1;
- this.page.pageSize = val;
- },
- onLoad(page, params) {
- this.loading = true;
- getList(page.currentPage, page.pageSize, params)
- .then(res => {
- this.dataList = res.data.data.records ? res.data.data.records : [];
- this.page.total = res.data.data.total;
- if (this.page.total) {
- this.option.height = window.innerHeight - 260;
- }
- })
- .finally(() => {
- this.loading = false;
- });
- },
- //新增跳转页面
- beforeOpen() {
- this.isShow = false;
- },
- editOpen(row, status) {
- this.detailData = {
- id: row.id,
- status: status
- };
- this.isShow = false;
- },
- rowDel(row, index, done) {
- this.$confirm("确定删除数据?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- remove(row.id).then(res => {
- if (res.data.code == 200) {
- this.$message({
- type: "success",
- message: "删除成功!"
- });
- this.onLoad(this.page, this.search);
- }
- });
- });
- },
- goBack() {
- this.detailData = this.$options.data().detailData;
- this.isShow = true;
- }
- }
- };
- </script>
- <style scoped>
- .page-crad ::v-deep .basic-container__card {
- height: 94.2vh;
- }
- </style>
|