|
|
@@ -1,374 +1,182 @@
|
|
|
<template>
|
|
|
- <basic-container>
|
|
|
- <avue-crud :option="option"
|
|
|
- :table-loading="loading"
|
|
|
- :data="data"
|
|
|
- :page.sync="page"
|
|
|
- :permission="permissionList"
|
|
|
- :before-open="beforeOpen"
|
|
|
- v-model="form"
|
|
|
- ref="crud"
|
|
|
- @row-update="rowUpdate"
|
|
|
- @row-save="rowSave"
|
|
|
- @row-del="rowDel"
|
|
|
- @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="danger"
|
|
|
- size="small"
|
|
|
- icon="el-icon-delete"
|
|
|
- plain
|
|
|
- v-if="permission.agreement_delete"
|
|
|
- @click="handleDelete">删 除
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </avue-crud>
|
|
|
- </basic-container>
|
|
|
+ <div>
|
|
|
+ <basic-container v-show="show" class="page-crad">
|
|
|
+ <avue-crud ref="crud" :option="option" :data="dataList" :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" @search-criteria-switch="searchCriteriaSwitch">
|
|
|
+ <template slot="menuLeft">
|
|
|
+ <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="newAdd()">新增
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row,index}" slot="billNo">
|
|
|
+ <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 2)">{{ row.billNo }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row,index}" slot="corpId">
|
|
|
+ <span>{{ row.corpName }}</span>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row, index }" slot="menu">
|
|
|
+ <el-button type="text" size="small" @click.stop="rowDel(row, index)">
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ </basic-container>
|
|
|
+ <details-page v-if="!show" @goBack="backToList" :detailData="detailData" />
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import {getList, getDetail, add, update, remove} from "@/api/basicData/agreement";
|
|
|
- import {mapGetters} from "vuex";
|
|
|
+import detailsPage from "./detailsPage";
|
|
|
+import { option } from "./js/optionList";
|
|
|
+import { getList, remove } from "@/api/basicData/agreement";
|
|
|
|
|
|
- export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- form: {},
|
|
|
- query: {},
|
|
|
- loading: true,
|
|
|
- page: {
|
|
|
- pageSize: 10,
|
|
|
- currentPage: 1,
|
|
|
- total: 0
|
|
|
- },
|
|
|
- selectionList: [],
|
|
|
- option: {
|
|
|
- height:'auto',
|
|
|
- calcHeight: 30,
|
|
|
- tip: false,
|
|
|
- searchShow: true,
|
|
|
- searchMenuSpan: 6,
|
|
|
- border: true,
|
|
|
- index: true,
|
|
|
- viewBtn: true,
|
|
|
- selection: true,
|
|
|
- dialogClickModal: false,
|
|
|
- column: [
|
|
|
- {
|
|
|
- label: "业务编号",
|
|
|
- prop: "billNo",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入业务编号",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "合同编号",
|
|
|
- prop: "contractNo",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入合同编号",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "制单部门",
|
|
|
- prop: "deptId",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入制单部门",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "客户名称",
|
|
|
- prop: "corpId",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入客户名称",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "货物品名",
|
|
|
- prop: "goodsId",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入货物品名",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "结算方式",
|
|
|
- prop: "stltypeId",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入结算方式",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "费用类型",
|
|
|
- prop: "feetypeId",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入费用类型",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "货物类别",
|
|
|
- prop: "packages",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入货物类别",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "贸易方式",
|
|
|
- prop: "trademodeId",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入贸易方式",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "免堆天数",
|
|
|
- prop: "freedays",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入免堆天数",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "有效期起",
|
|
|
- prop: "beginDate",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入有效期起",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "有效期至",
|
|
|
- prop: "enddate",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入有效期至",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "备注",
|
|
|
- prop: "remark",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入备注",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "作业费类型",
|
|
|
- prop: "taskType",
|
|
|
- width:"150",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入作业费类型",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "收付款方式",
|
|
|
- prop: "dc",
|
|
|
- width:"150",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入收付款方式",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "业务类型",
|
|
|
- prop: "billType",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入业务类型",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "业务类型名称",
|
|
|
- prop: "billTypeName",
|
|
|
- width:"150",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入业务类型名称",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "仓库",
|
|
|
- prop: "warehouseId",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入仓库",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "状态",
|
|
|
- prop: "billStatus",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入状态",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- ]
|
|
|
- },
|
|
|
- data: []
|
|
|
- };
|
|
|
- },
|
|
|
- computed: {
|
|
|
- ...mapGetters(["permission"]),
|
|
|
- permissionList() {
|
|
|
- return {
|
|
|
- addBtn: this.vaildData(this.permission.agreement_add, false),
|
|
|
- viewBtn: this.vaildData(this.permission.agreement_view, false),
|
|
|
- delBtn: this.vaildData(this.permission.agreement_delete, false),
|
|
|
- editBtn: this.vaildData(this.permission.agreement_edit, false)
|
|
|
- };
|
|
|
+export default {
|
|
|
+ name: "index",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ show: true,
|
|
|
+ loading: false,
|
|
|
+ form: {},
|
|
|
+ search: {},
|
|
|
+ detailData: {},
|
|
|
+ dataList: [],
|
|
|
+ selectionList: [],
|
|
|
+ page: {
|
|
|
+ pageSize: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0,
|
|
|
+ pageSizes: [10, 50, 100, 200, 300, 400, 500]
|
|
|
},
|
|
|
- ids() {
|
|
|
- let ids = [];
|
|
|
- this.selectionList.forEach(ele => {
|
|
|
- ids.push(ele.id);
|
|
|
- });
|
|
|
- return ids.join(",");
|
|
|
+ option: {},
|
|
|
+ };
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ detailsPage
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ this.option = await this.getColumnData(this.getColumnName(192), option);
|
|
|
+ this.getWorkDicts("in_section").then(res => {
|
|
|
+ this.findObject(this.option.column, "inSection").dicData = res.data.data;
|
|
|
+ this.$refs.crud.init();
|
|
|
+ });
|
|
|
+ this.option.height = window.innerHeight - 210;
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ searchCriteriaSwitch(type) {
|
|
|
+ if (type) {
|
|
|
+ this.option.height = this.option.height - 46;
|
|
|
+ } else {
|
|
|
+ this.option.height = this.option.height + 46;
|
|
|
}
|
|
|
+ this.$refs.crud.getTableHeight();
|
|
|
},
|
|
|
- methods: {
|
|
|
- rowSave(row, done, loading) {
|
|
|
- add(row).then(() => {
|
|
|
- this.onLoad(this.page);
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- done();
|
|
|
- }, error => {
|
|
|
- loading();
|
|
|
- window.console.log(error);
|
|
|
- });
|
|
|
- },
|
|
|
- rowUpdate(row, index, done, loading) {
|
|
|
- update(row).then(() => {
|
|
|
- this.onLoad(this.page);
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- done();
|
|
|
- }, error => {
|
|
|
- loading();
|
|
|
- console.log(error);
|
|
|
- });
|
|
|
- },
|
|
|
- rowDel(row) {
|
|
|
- this.$confirm("确定将选择数据删除?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- return remove(row.id);
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.onLoad(this.page);
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
+ 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);
|
|
|
+ },
|
|
|
+ newAdd() {
|
|
|
+ this.show = false;
|
|
|
+ },
|
|
|
+ onLoad(page, params = {}) {
|
|
|
+ this.loading = true;
|
|
|
+ this.dataList.forEach(item => {
|
|
|
+ this.$refs.crud.toggleRowExpansion(item, false);
|
|
|
+ });
|
|
|
+ getList(
|
|
|
+ page.currentPage,
|
|
|
+ page.pageSize,
|
|
|
+ Object.assign(params, this.search)
|
|
|
+ )
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.data.records) {
|
|
|
+ res.data.data.records.forEach(e => {
|
|
|
+ e.itemLoading = true;
|
|
|
});
|
|
|
- });
|
|
|
- },
|
|
|
- handleDelete() {
|
|
|
- if (this.selectionList.length === 0) {
|
|
|
- this.$message.warning("请选择至少一条数据");
|
|
|
- return;
|
|
|
- }
|
|
|
- this.$confirm("确定将选择数据删除?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
+ }
|
|
|
+ this.dataList = res.data.data.records ? res.data.data.records : [];
|
|
|
+ this.page.total = res.data.data.total;
|
|
|
})
|
|
|
- .then(() => {
|
|
|
- return remove(this.ids);
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.onLoad(this.page);
|
|
|
+ .finally(() => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ editOpen(row, status) {
|
|
|
+ this.detailData = {
|
|
|
+ id: row.id,
|
|
|
+ status: status
|
|
|
+ };
|
|
|
+ this.show = false;
|
|
|
+ },
|
|
|
+ currentChange(val) {
|
|
|
+ this.page.currentPage = val;
|
|
|
+ },
|
|
|
+ sizeChange(val) {
|
|
|
+ this.page.currentPage = 1;
|
|
|
+ this.page.pageSize = val;
|
|
|
+ },
|
|
|
+ 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: "操作成功!"
|
|
|
+ message: "删除成功!"
|
|
|
});
|
|
|
- this.$refs.crud.toggleSelection();
|
|
|
- });
|
|
|
- },
|
|
|
- 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();
|
|
|
+ this.onLoad(this.page, this.search);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ async saveColumn() {
|
|
|
+ const inSave = await this.saveColumnData(
|
|
|
+ this.getColumnName(192),
|
|
|
+ this.option
|
|
|
+ );
|
|
|
+ if (inSave) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.crud.doLayout();
|
|
|
});
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ //关闭窗口
|
|
|
+ this.$refs.crud.$refs.dialogColumn.columnBox = false;
|
|
|
}
|
|
|
+ },
|
|
|
+ async resetColumn() {
|
|
|
+ this.option = option;
|
|
|
+ const inSave = await this.delColumnData(this.getColumnName(192), option);
|
|
|
+ if (inSave) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.crud.doLayout();
|
|
|
+ });
|
|
|
+ this.$message.success("重置成功");
|
|
|
+ this.$refs.crud.$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //返回列表
|
|
|
+ backToList() {
|
|
|
+ this.detailData = this.$options.data().detailData;
|
|
|
+ this.show = true;
|
|
|
+ this.onLoad(this.page, this.search);
|
|
|
}
|
|
|
- };
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
-<style>
|
|
|
+<style scoped>
|
|
|
+.page-crad ::v-deep .basic-container__card {
|
|
|
+ height: 94.2vh;
|
|
|
+}
|
|
|
</style>
|