123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <template>
- <basic-container>
- <avue-crud
- ref="crud"
- :data="dataList"
- :option="option"
- v-model="form"
- :search.sync="search"
- :table-loading="loading"
- @saveColumn="saveColumn"
- @resetColumn="resetColumn"
- @search-change="searchChange"
- @current-change="currentChange"
- @size-change="sizeChange"
- @refresh-change="refreshChange"
- @on-load="onLoad"
- >
- <template slot="orderNo" slot-scope="{ row, index }">
- <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(row, index)">{{ row.orderNo }}</span>
- </template>
- </avue-crud>
- </basic-container>
- </template>
-
- <script>
- import option from "./config/detail.json";
- import {selectStockInventory} from "@/api/basicData/inventoryAccount";
-
- export default {
- name: "detail",
- data() {
- return {
- option: {},
- dataList: [],
- form: {},
- page: {
- pageSize: 10,
- pagerCount: 5,
- total: 0,
- },
- search: {},
- loading: false,
- params: null,
- }
- },
- async created() {
- // this.option = option
- console.log('打开了');
- this.option = await this.getColumnData(this.getColumnName(67), option);
- this.$store.commit("DOMAS_IN_DETAIL");
- },
- activated() {
- this.$store.commit("DOMAS_IN_DETAIL");
- this.params = {
- goodsId: this.$route.query.goodsId,
- stockId:this.$route.query.stockId
- }
- this.onLoad(this.page)
- },
- methods: {
- onLoad(page, params) {
- if (!this.params) return
- params = {...params, ...this.params}
- this.dataList.forEach(item => {
- this.$refs.crud.toggleRowExpansion(item, false)
- })
- this.loading = true;
- selectStockInventory(params)
- .then(res => {
- console.log('res',res);
- this.dataList = res.data.data? res.data.data : [];
- this.page.total = res.data.data.total;
- if (this.page.total) {
- this.option.height = window.innerHeight - 260;
- }
- })
- .finally(() => {
- this.loading = false;
- });
- },
- searchChange(params, done) {
- this.onLoad(this.page, params);
- done();
- },
- currentChange(val) {
- this.page.currentPage = val;
- },
- sizeChange(val) {
- this.page.currentPage = 1;
- this.page.pageSize = val;
- },
- refreshChange() {
- this.dataList.forEach(item => {
- this.$refs.crud.toggleRowExpansion(item, false)
- })
- this.page.currentPage = 1;
- this.onLoad(this.page, this.search);
- },
- async saveColumn() {
- const inSave = await this.saveColumnData(
- this.getColumnName(67),
- this.option
- );
- if (inSave) {
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs.crud.$refs.dialogColumn.columnBox = false;
- }
- },
- async resetColumn() {
- this.option = option;
- const inSave = await this.delColumnData(
- this.getColumnName(67),
- option
- );
- if (inSave) {
- this.$message.success("重置成功");
- //关闭窗口
- this.$refs.crud.$refs.dialogColumn.columnBox = false;
- }
- },
- // 跳转
- beforeOpenPage(row,index) {
- if (this.$store.getters.domSaleStatus) {
- this.$alert("销售单存在,请保存关闭销售单再进行操作", "温馨提示", {
- confirmButtonText: "确定",
- type: "warning",
- callback: action => {
- console.log(action);
- }
- });
- } else {
- this.$router.$avueRouter.closeTag("/businessManagement/salesOrder/index");
- this.$router.push({
- path: "/businessManagement/salesOrder/index",
- query: {
- id: row.id
- },
- });
- }
- },
- },
- }
- </script>
-
- <style scoped>
-
- </style>
-
|