| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, getDetail, add, update, remove} from "@/api/stockrecord/stockrecord"; |
| | | import {getList, getDetail, add1, update, remove} from "@/api/stockrecord/stockrecord"; |
| | | import {mapGetters} from "vuex"; |
| | | |
| | | export default { |
| | |
| | | border: true, |
| | | index: true, |
| | | viewBtn: true, |
| | | align: "center", |
| | | selection: true, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "农资", |
| | | prop: "stockId", |
| | | prop: "stockId1", |
| | | span: 23, |
| | | type: "select", |
| | | dicUrl: "/api/stockfactory/stockfactory/selectStockFa", |
| | |
| | | }] |
| | | }, |
| | | { |
| | | label: "数量", |
| | | prop: "amount", |
| | | }, |
| | | { |
| | | label: "时间", |
| | | prop: "time", |
| | | label: "分类", |
| | | prop: "stype", |
| | | type: "select", |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=stockType", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey" |
| | | }, |
| | | dataType: "number", |
| | | search: true, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入时间", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "类型 (0:出库 1:入库)", |
| | | prop: "type", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入类型 (0:出库 1:入库)", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "操作人", |
| | | prop: "operator", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入操作人", |
| | | message: "请输入类型", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "规格", |
| | | prop: "spn", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入规格", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "农资类型", |
| | | prop: "stockType", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入农资类型", |
| | | trigger: "blur" |
| | | }] |
| | | label: "类型", |
| | | prop: "type1", |
| | | span: 12, |
| | | searchSpan: 4, |
| | | }, |
| | | { |
| | | label: "图片", |
| | | prop: "picture", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入图片", |
| | | trigger: "blur" |
| | | }] |
| | | label: "数量", |
| | | prop: "count", |
| | | }, |
| | | { |
| | | label: "备注", |
| | | prop: "remarks", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入备注", |
| | | trigger: "blur" |
| | | }] |
| | | label: "时间", |
| | | prop: "time1", |
| | | }, |
| | | { |
| | | label: "操作人", |
| | | prop: "czr", |
| | | }, |
| | | ] |
| | | }, |
| | |
| | | return { |
| | | addBtn: this.vaildData(this.permission.stockrecord_add, false), |
| | | viewBtn: this.vaildData(this.permission.stockrecord_view, false), |
| | | delBtn: this.vaildData(this.permission.stockrecord_delete, false), |
| | | delBtn: this.vaildData(this.permission.stockrecord_delete, true), |
| | | editBtn: this.vaildData(this.permission.stockrecord_edit, false) |
| | | }; |
| | | }, |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | loading(); |
| | | window.console.log(error); |
| | | }); |
| | | }, |
| | | // 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); |
| | |
| | | }, |
| | | 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; |