From d6a0abe9024f87fc517a2b71df0f17c5cadc41a0 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 29 Jul 2022 16:02:25 +0800
Subject: [PATCH] 合并冲突
---
src/views/soldrecord/soldrecord.vue | 491 +++++++++++++++++++++++++++---------------------------
1 files changed, 247 insertions(+), 244 deletions(-)
diff --git a/src/views/soldrecord/soldrecord.vue b/src/views/soldrecord/soldrecord.vue
index f4b4d56..5adb66c 100644
--- a/src/views/soldrecord/soldrecord.vue
+++ b/src/views/soldrecord/soldrecord.vue
@@ -1,260 +1,263 @@
<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.soldrecord_delete"
- @click="handleDelete">删 除
- </el-button>
- </template>
- </avue-crud>
- </basic-container>
+ <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.soldrecord_delete"
+ @click="handleDelete"
+ >删 除</el-button>
+ </template>
+ </avue-crud>
+ </basic-container>
</template>
<script>
- import {getList, getDetail, add, update, remove,getListbg} from "@/api/soldrecord/soldrecord";
- import {mapGetters} from "vuex";
+import { getList, getDetail, add, update, remove, getListbg } from "@/api/soldrecord/soldrecord"
+import { mapGetters } from "vuex"
- 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,
- align: "center",
- menu:false,
- dialogClickModal: false,
- column: [
- {
- label: "农资",
- prop: "stockId1",
- span: 23,
- type: "select",
- dicUrl: "/api/stockfactory/stockfactory/selectStockFa",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- rules: [{
- required: true,
- message: "请输入农资",
- trigger: "blur"
- }]
+export default {
+ data () {
+ return {
+ form: {},
+ query: {},
+ loading: true,
+ page: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0
},
- {
- label: "农资类型",
- prop: "stype",
- searchLabelWidth: 80,
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=stockType",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- dataType: "number",
+ selectionList: [],
+ option: {
+ height: 'auto',
+ calcHeight: 30,
+ tip: false,
+ searchShow: true,
+ searchMenuSpan: 6,
+ border: true,
+ index: true,
+ viewBtn: true,
+ selection: true,
+ align: "center",
+ menu: false,
+ dialogClickModal: false,
+ column: [
+ {
+ label: "农资",
+ prop: "stockId1",
+ span: 23,
+ type: "select",
+ dicUrl: "/api/stockfactory/stockfactory/selectStockFa",
+ props: {
+ label: "dictValue",
+ value: "dictKey"
+ },
+ rules: [{
+ required: true,
+ message: "请输入农资",
+ trigger: "blur"
+ }]
+ },
+ {
+ label: "农资类型",
+ prop: "stype",
+ searchLabelWidth: 80,
+ type: "select",
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=stockType",
+ props: {
+ label: "dictValue",
+ value: "dictKey"
+ },
+ dataType: "number",
+ },
+ {
+ label: "厂家名称",
+ prop: "factoryName",
+ addDisplay: false,
+ },
+ {
+ label: "出库类型",
+ prop: "dic3",
+ addDisplay: false,
+ },
+ {
+ label: "规格",
+ disabled: true,
+ span: 6,
+ prop: "spn",
+ addDisplay: false,
+ },
+ {
+ label: "数量",
+ disabled: true,
+ span: 6,
+ prop: "amount1",
+ },
+ {
+ label: "变更时间",
+ disabled: true,
+ span: 6,
+ prop: "createTime"
+ }
+ ]
},
- {
- label: "厂家名称",
- prop: "factoryName",
- addDisplay: false,
- },
- {
- label: "出库类型",
- prop: "dic3",
- addDisplay: false,
- },
- {
- label: "规格",
- disabled: true,
- span: 6,
- prop: "spn",
- addDisplay: false,
- },
- {
- label: "数量",
- disabled: true,
- span: 6,
- prop: "amount1",
- },
- {
- label:"变更时间",
- disabled:true,
- span:6,
- prop:"createTime"
- }
- ]
- },
- data: []
- };
+ data: []
+ }
},
computed: {
- ...mapGetters(["permission"]),
- permissionList() {
- return {
- addBtn: this.vaildData(this.permission.soldrecord_add, false),
- viewBtn: this.vaildData(this.permission.soldrecord_view, false),
- delBtn: this.vaildData(this.permission.soldrecord_delete, false),
- editBtn: this.vaildData(this.permission.soldrecord_edit, false)
- };
- },
- ids() {
- let ids = [];
- this.selectionList.forEach(ele => {
- ids.push(ele.id);
- });
- return ids.join(",");
- }
+ ...mapGetters(["permission"]),
+ permissionList () {
+ return {
+ addBtn: this.vaildData(this.permission.soldrecord_add, false),
+ viewBtn: this.vaildData(this.permission.soldrecord_view, false),
+ delBtn: this.vaildData(this.permission.soldrecord_delete, false),
+ editBtn: this.vaildData(this.permission.soldrecord_edit, false)
+ }
+ },
+ ids () {
+ let ids = []
+ this.selectionList.forEach(ele => {
+ ids.push(ele.id)
+ })
+ return ids.join(",")
+ }
},
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: "操作成功!"
- });
- });
- },
- handleDelete() {
- if (this.selectionList.length === 0) {
- this.$message.warning("请选择至少一条数据");
- return;
+ 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: "操作成功!"
+ })
+ })
+ },
+ handleDelete () {
+ if (this.selectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据")
+ return
+ }
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ })
+ .then(() => {
+ return remove(this.ids)
+ })
+ .then(() => {
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ 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
+ var datas = this.$route.query
+ params.stockId1 = datas.sid
+ getListbg(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.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- return remove(this.ids);
- })
- .then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- 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;
- var datas = this.$route.query;
- params.stockId1=datas.sid;
- getListbg(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();
- });
- }
}
- };
+};
</script>
<style>
--
Gitblit v1.9.3