|  | @@ -1,127 +1,124 @@
 | 
	
		
			
				|  |  |  <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="billno" slot-scope="{ row, index }">
 | 
	
		
			
				|  |  | -          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(row, index)">{{ row.billno }}</span>
 | 
	
		
			
				|  |  | -        </template>
 | 
	
		
			
				|  |  | -      </avue-crud>
 | 
	
		
			
				|  |  | -    </basic-container>
 | 
	
		
			
				|  |  | -  </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="billno" slot-scope="{ row, index }">
 | 
	
		
			
				|  |  | +        <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(row, index)">{{ row.billno }}</span>
 | 
	
		
			
				|  |  | +      </template>
 | 
	
		
			
				|  |  | +    </avue-crud>
 | 
	
		
			
				|  |  | +  </basic-container>
 | 
	
		
			
				|  |  | +</template>
 | 
	
		
			
				|  |  |    
 | 
	
		
			
				|  |  | -  <script>
 | 
	
		
			
				|  |  | -  import option from "./config/detail.json";
 | 
	
		
			
				|  |  | -  import {stockDataDetails} 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,
 | 
	
		
			
				|  |  | -      }
 | 
	
		
			
				|  |  | +<script>
 | 
	
		
			
				|  |  | +import option from "./config/detail.json";
 | 
	
		
			
				|  |  | +import { stockDataDetails } 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(279), 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;
 | 
	
		
			
				|  |  | +      stockDataDetails(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;
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | -    async created() {
 | 
	
		
			
				|  |  | -      // this.option = option
 | 
	
		
			
				|  |  | -      console.log('打开了');
 | 
	
		
			
				|  |  | -      this.option = await this.getColumnData(this.getColumnName(279), option);
 | 
	
		
			
				|  |  | -      this.$store.commit("DOMAS_IN_DETAIL");
 | 
	
		
			
				|  |  | +    searchChange(params, done) {
 | 
	
		
			
				|  |  | +      this.onLoad(this.page, params);
 | 
	
		
			
				|  |  | +      done();
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | -    activated() {
 | 
	
		
			
				|  |  | -    this.$store.commit("DOMAS_IN_DETAIL");
 | 
	
		
			
				|  |  | -      this.params = {
 | 
	
		
			
				|  |  | -        goodsId: this.$route.query.goodsId,
 | 
	
		
			
				|  |  | -        stockId:this.$route.query.stockId
 | 
	
		
			
				|  |  | +    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(279),
 | 
	
		
			
				|  |  | +        this.option
 | 
	
		
			
				|  |  | +      );
 | 
	
		
			
				|  |  | +      if (inSave) {
 | 
	
		
			
				|  |  | +        this.$message.success("保存成功");
 | 
	
		
			
				|  |  | +        //关闭窗口
 | 
	
		
			
				|  |  | +        this.$refs.crud.$refs.dialogColumn.columnBox = false;
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  | -      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;
 | 
	
		
			
				|  |  | -        stockDataDetails(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(279),
 | 
	
		
			
				|  |  | -          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(279),
 | 
	
		
			
				|  |  | -          option
 | 
	
		
			
				|  |  | -        );
 | 
	
		
			
				|  |  | -        if (inSave) {
 | 
	
		
			
				|  |  | -          this.$message.success("重置成功");
 | 
	
		
			
				|  |  | -          //关闭窗口
 | 
	
		
			
				|  |  | -          this.$refs.crud.$refs.dialogColumn.columnBox = false;
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -      },
 | 
	
		
			
				|  |  | -      // 跳转
 | 
	
		
			
				|  |  | -      beforeOpenPage(row,index) {
 | 
	
		
			
				|  |  | -        if(row.bizTypeName == '出库'){
 | 
	
		
			
				|  |  | +    async resetColumn() {
 | 
	
		
			
				|  |  | +      this.option = option;
 | 
	
		
			
				|  |  | +      const inSave = await this.delColumnData(
 | 
	
		
			
				|  |  | +        this.getColumnName(279),
 | 
	
		
			
				|  |  | +        option
 | 
	
		
			
				|  |  | +      );
 | 
	
		
			
				|  |  | +      if (inSave) {
 | 
	
		
			
				|  |  | +        this.$message.success("重置成功");
 | 
	
		
			
				|  |  | +        //关闭窗口
 | 
	
		
			
				|  |  | +        this.$refs.crud.$refs.dialogColumn.columnBox = false;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    // 跳转
 | 
	
		
			
				|  |  | +    beforeOpenPage(row, index) {
 | 
	
		
			
				|  |  | +      if (this.$store.getters.inboundAndOutbound) {
 | 
	
		
			
				|  |  | +        this.$alert("明细账已存在,请保存关闭明细账再进行操作", "温馨提示", {
 | 
	
		
			
				|  |  | +          confirmButtonText: "确定",
 | 
	
		
			
				|  |  | +          type: "warning",
 | 
	
		
			
				|  |  | +          callback: action => {
 | 
	
		
			
				|  |  | +            console.log(action);
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  | +      } else {
 | 
	
		
			
				|  |  | +        if (row.bizTypeName == '出库') {
 | 
	
		
			
				|  |  |            this.$router.$avueRouter.closeTag("/tirePartsMall/salesManagement/outboundWorkOrder/index");
 | 
	
		
			
				|  |  |            this.$router.push({
 | 
	
		
			
				|  |  |              path: "/tirePartsMall/salesManagement/outboundWorkOrder/index",
 | 
	
	
		
			
				|  | @@ -129,7 +126,7 @@
 | 
	
		
			
				|  |  |                id: row.id
 | 
	
		
			
				|  |  |              },
 | 
	
		
			
				|  |  |            });
 | 
	
		
			
				|  |  | -        }else{
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  |            this.$router.$avueRouter.closeTag("/tirePartsMall/purchasingManagement/warehouseEntryOrder/index");
 | 
	
		
			
				|  |  |            this.$router.push({
 | 
	
		
			
				|  |  |              path: "/tirePartsMall/purchasingManagement/warehouseEntryOrder/index",
 | 
	
	
		
			
				|  | @@ -138,31 +135,30 @@
 | 
	
		
			
				|  |  |              },
 | 
	
		
			
				|  |  |            });
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        console.log(row);
 | 
	
		
			
				|  |  | -        return
 | 
	
		
			
				|  |  | -        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
 | 
	
		
			
				|  |  | -            },
 | 
	
		
			
				|  |  | -          });
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -      },
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      return
 | 
	
		
			
				|  |  | +      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>
 | 
	
		
			
				|  |  | +  },
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +</script>
 | 
	
		
			
				|  |  |    
 | 
	
		
			
				|  |  | -  </style>
 | 
	
		
			
				|  |  | +<style scoped></style>
 | 
	
		
			
				|  |  |    
 |