|
@@ -0,0 +1,255 @@
|
|
|
+<template>
|
|
|
+ <basic-container>
|
|
|
+ <avue-crud
|
|
|
+ :key="key"
|
|
|
+ ref="crud"
|
|
|
+ :option="option"
|
|
|
+ :data="data"
|
|
|
+ :search.sync="search"
|
|
|
+ @on-load="onLoad"
|
|
|
+ @search-reset="query={}"
|
|
|
+ :page.sync="page"
|
|
|
+ @search-change="searchChange"
|
|
|
+ @search-criteria-switch="searchCriteriaSwitch"
|
|
|
+ @resetColumn="resetColumn"
|
|
|
+ @saveColumn="saveColumn"
|
|
|
+ >
|
|
|
+ <template slot="cname" slot-scope="{row,index}">
|
|
|
+ {{row.goodsName}}
|
|
|
+ </template>
|
|
|
+ <template slot="storageId" slot-scope="{row,index}">
|
|
|
+ {{row.warehouse}}
|
|
|
+ </template>
|
|
|
+ <template slot="corpNameSearch">
|
|
|
+ <crop-select v-model="search.corpId" corpType="GYS" :refresh="false"></crop-select>
|
|
|
+ </template>
|
|
|
+ <template slot="purchaserSearch">
|
|
|
+ <crop-select v-model="search.purchaserId" corpType="KH" :refresh="false"></crop-select>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ </basic-container>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {getList} from "@/api/purchasingManagement/inventoryAccount";
|
|
|
+
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ key:0,
|
|
|
+ search: {},
|
|
|
+ data: [],
|
|
|
+ query:{},
|
|
|
+ page: {
|
|
|
+ pageSize: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0,
|
|
|
+ pageSizes: [10, 50, 100, 200, 300]
|
|
|
+ },
|
|
|
+ option: {
|
|
|
+ align: 'center',
|
|
|
+ stripe: true,
|
|
|
+ index: true,
|
|
|
+ menu: false,
|
|
|
+ height: "auto",
|
|
|
+ searchSpan: 8,
|
|
|
+ searchIcon: true,
|
|
|
+ searchIndex: 2,
|
|
|
+ highlightCurrentRow: true,
|
|
|
+ addBtn: false,
|
|
|
+ column: [{
|
|
|
+ label: '品名',
|
|
|
+ // searchProp: 'goodsName',
|
|
|
+ prop: 'itemId',
|
|
|
+ dicUrl: '/api/blade-client/goodsdesc/descListAll',
|
|
|
+ props: {
|
|
|
+ label: "cname",
|
|
|
+ value: "id",
|
|
|
+ },
|
|
|
+ filterable: true,
|
|
|
+ type: "select",
|
|
|
+ overHidden: true,
|
|
|
+ index: 1,
|
|
|
+ search:true
|
|
|
+ }, {
|
|
|
+ label: '长',
|
|
|
+ prop: 'length',
|
|
|
+ index: 2,
|
|
|
+ search:true
|
|
|
+ }, {
|
|
|
+ label: '宽',
|
|
|
+ prop: 'width',
|
|
|
+ index: 3,
|
|
|
+ search:true
|
|
|
+ }, {
|
|
|
+ label: '宽度明细',
|
|
|
+ prop: 'widthItem',
|
|
|
+ index: 4,
|
|
|
+ search:true
|
|
|
+ }, {
|
|
|
+ label: '厚',
|
|
|
+ prop: 'thickness',
|
|
|
+ index: 5,
|
|
|
+ search:true
|
|
|
+ }, {
|
|
|
+ label: '捆包号',
|
|
|
+ prop: 'billNo',
|
|
|
+ index: 6,
|
|
|
+ width: 100,
|
|
|
+ search:true
|
|
|
+ }, {
|
|
|
+ label: '可用片数',
|
|
|
+ prop: 'sliceNumber',
|
|
|
+ index: 7
|
|
|
+ }, {
|
|
|
+ label: '可用库存',
|
|
|
+ prop: 'balanceNumber',
|
|
|
+ index: 8
|
|
|
+ }, {
|
|
|
+ label: '库存单价',
|
|
|
+ prop: 'price',
|
|
|
+ index: 9
|
|
|
+ }, {
|
|
|
+ label: '库存金额',
|
|
|
+ prop: 'balanceMoney',
|
|
|
+ index: 10
|
|
|
+ }, {
|
|
|
+ label: '仓库',
|
|
|
+ prop: 'storageId',
|
|
|
+ type: "tree",
|
|
|
+ dicUrl: "/api/blade-client/storagetype/tree",
|
|
|
+ index: 11,
|
|
|
+ props: {
|
|
|
+ "label": "title",
|
|
|
+ "value": "value"
|
|
|
+ },
|
|
|
+ "checkStrictly": true,
|
|
|
+ "showAllLevels": false,
|
|
|
+ "emitPath": false,
|
|
|
+ "width": 120,
|
|
|
+ "searchSpan": 8,
|
|
|
+ "overHidden": true,
|
|
|
+ search:true
|
|
|
+ }, {
|
|
|
+ label: '库位',
|
|
|
+ prop: 'storageName',
|
|
|
+ index: 12
|
|
|
+ }, {
|
|
|
+ label: '品牌',
|
|
|
+ prop: 'itemType',
|
|
|
+ index: 13,
|
|
|
+ search:true
|
|
|
+ }, {
|
|
|
+ label: '等级',
|
|
|
+ prop: 'grade',
|
|
|
+ index: 14,
|
|
|
+ search:true
|
|
|
+ }, {
|
|
|
+ label: '产地',
|
|
|
+ prop: 'itemProp',
|
|
|
+ index: 15,
|
|
|
+ search:true
|
|
|
+ }, {
|
|
|
+ label: '供应商',
|
|
|
+ prop: 'corpName',
|
|
|
+ index: 16,
|
|
|
+ search:true
|
|
|
+ }, {
|
|
|
+ label: '车船号',
|
|
|
+ prop: 'vehicleShipNumber',
|
|
|
+ index: 17,
|
|
|
+ search:true
|
|
|
+ }, {
|
|
|
+ label: '货权人',
|
|
|
+ prop: 'purchaser',
|
|
|
+ index: 18,
|
|
|
+ search:true
|
|
|
+ }, {
|
|
|
+ label: '提单号',
|
|
|
+ prop: 'morderNo',
|
|
|
+ index: 19,
|
|
|
+ search:true
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ let i = 0;
|
|
|
+ this.option.column.forEach(item => {
|
|
|
+ if (item.search) i++
|
|
|
+ })
|
|
|
+ if (i % 3 !== 0) {
|
|
|
+ const num = 3 - Number(i % 3)
|
|
|
+ this.option.searchMenuSpan = num * 8;
|
|
|
+ this.option.searchMenuPosition = "right";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ onLoad(page, params = {}){
|
|
|
+ let queryParams = {
|
|
|
+ size: page.pageSize,
|
|
|
+ current: page.currentPage,
|
|
|
+ ...Object.assign(params, this.query)
|
|
|
+ }
|
|
|
+ getList(queryParams).then(res=>{
|
|
|
+ this.data = res.data.data.records
|
|
|
+ this.page.total = res.data.data.total
|
|
|
+ this.option.height = window.innerHeight - 230;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //搜索
|
|
|
+ searchChange(params, done) {
|
|
|
+ let data = params
|
|
|
+ if (params.arrivalTime) {
|
|
|
+ data.beginArrivalTime = params.arrivalTime[0]
|
|
|
+ data.endArrivalTime = params.arrivalTime[1]
|
|
|
+ }
|
|
|
+ if (params.createTime) {
|
|
|
+ data.beginCrateTime = params.createTime[0]
|
|
|
+ data.endCrateTime = params.createTime[1]
|
|
|
+ }
|
|
|
+ delete data.arrivalTime
|
|
|
+ delete data.createTime
|
|
|
+ this.query = data;
|
|
|
+ this.onLoad(this.page, data)
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ // 获得高度
|
|
|
+ searchCriteriaSwitch(type) {
|
|
|
+ if (type) {
|
|
|
+ this.option.height = this.option.height - 184
|
|
|
+ } else {
|
|
|
+ this.option.height = this.option.height + 184
|
|
|
+ }
|
|
|
+ this.$refs.crud.getTableHeight()
|
|
|
+ },
|
|
|
+ //自定义列保存
|
|
|
+ async saveColumn() {
|
|
|
+ /**
|
|
|
+ * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
|
|
|
+ * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
|
|
|
+ * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
|
|
|
+ */
|
|
|
+ const inSave = await this.saveColumnData(this.getColumnName(85.7), this.option);
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ //关闭窗口
|
|
|
+ this.$refs.crud.$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //自定义列重置
|
|
|
+ async resetColumn() {
|
|
|
+ this.option = this.optionList;
|
|
|
+ const inSave = await this.delColumnData(this.getColumnName(85.7), this.optionList);
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("重置成功");
|
|
|
+ this.$refs.crud.$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|