| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- <template>
- <basic-container v-if="show">
- <avue-crud
- ref="crud"
- :data="data"
- :option="option"
- :page.sync="page"
- :search.sync="search"
- :table-loading="loading"
- @row-del="rowDel"
- @size-change="sizeChange"
- @current-change="currentChange"
- @search-change="searchChange"
- @refresh-change="refreshChange"
- @on-load="getList"
- @saveColumn="saveColumn"
- >
- <template slot="corpIdSearch">
- <select-component
- v-model="search.corpId"
- :configuration="configuration"
- ></select-component>
- </template>
- <template slot-scope="{row,index}" slot="menuLeft">
- <el-button
- icon="el-icon-printer"
- size="small"
- type="primary"
- @click.stop=""
- >报 表
- </el-button>
- </template>
- <template slot-scope="scope" slot="menu">
- <el-button
- type="text"
- icon="el-icon-edit"
- size="small"
- @click.stop="settleAccounts(scope.row, scope.index)"
- >编 辑
- </el-button>
- </template>
- </avue-crud>
- </basic-container>
- <detail-page
- ref="detail"
- @goBack="goBack"
- :detailData="detailData"
- v-else
- ></detail-page>
- </template>
- <script>
- import option from "./configuration/settleAccounts.json";
- import { getList } from "@/api/workManagement/mainProject";
- import detailPage from "./settleAccountsDetailsPage.vue";
- export default {
- data() {
- return {
- loading: false,
- show:true,
- detailData:{},
- data: [],
- option: option,
- search:{},
- configuration:{
- multipleChoices:false,
- multiple:false,
- disabled:false,
- searchShow:true,
- collapseTags:false,
- clearable:true,
- placeholder:'请点击右边按钮选择',
- dicData:[]
- },
- page: {
- currentPage: 1,
- total: 0,
- pageSize: 10
- }
- };
- },
- components:{
- detailPage
- },
- mounted() {
- // option.height = window.innerHeight - 340 ;
- },
- methods: {
- getList(page,params={}) {
- this.loading = true;
- params.flag = 1;
- if(params){
- if (params.createTime != undefined) { //发货
- params.createStartDate = params.createTime[0]+ " " + "00:00:00";
- params.createEndDate = params.createTime[1] + " " + "23:59:59";
- this.$delete(params,'createTime')
- }
- }
- getList(page.currentPage, page.pageSize,params).then(res =>{
- this.data = res.data.data.records
- this.page.total = res.data.data.total
- this.loading = false
- })
- },
- //结算
- settleAccounts(row){
- this.detailData = {
- id: row.id
- };
- this.show = false;
- },
- searchChange(params, done) {
- this.getList(this.page, params);
- done();
- },
- sizeChange(val) {
- this.page.pageSize = val;
- this.getList();
- },
- currentChange(val) {
- this.page.currentPage = val;
- this.getList();
- },
- refreshChange() {
- this.page.currentPage = 1;
- this.getList();
- },
- //删除列表后面的删除按钮触发触发(row, index, done)
- rowDel(row, index, done) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- // 数据回调进行刷新
- done(row);
- });
- },
- saveColumn(row, column) {
- console.log(row, column);
- },
- goBack() {
- this.detailData=this.$options.data().detailData
- this.show = true;
- },
- }
- };
- </script>
- <style></style>
|