| | |
| | | <el-row style="margin-top: 15px"> |
| | | <el-col> |
| | | <!--列表--> |
| | | <my-table-v2 ref="myTable" :filter="filterFrom" :table="table" /> |
| | | <my-table-v2 ref="myTable" :filter="filterFrom" :table="table"/> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | |
| | | import MyTableV2 from '@/components/myTable/myTableV2'; |
| | | import MyButton from '@/components/myButton/myButton'; |
| | | import SettingIplatform from '@/utils/settingIplatform'; |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant'; |
| | | import { getBaseUrl } from '@/utils/base'; |
| | | import { selectTenantWarehouse, getCategorySelectTree, treeList } from '@/api/baseSetting/finsystenant'; |
| | | import { getDicts } from '@/api/system/dict/data'; |
| | | import { doExport } from '@/api/stock/ledger'; |
| | | import {doExport} from '@/api/stock/ledger'; |
| | | |
| | | export default { |
| | | name: 'index', |
| | | components: { MyButton, MyTableV2 }, |
| | | components: {MyButton, MyTableV2}, |
| | | data() { |
| | | return { |
| | | // 搜索框 |
| | |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [], |
| | | cascader: [{key:'warehouseId',queryKey: 'agencyId'},{key:'goodsTemplateId',queryKey: 'agencyId'}], |
| | | optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null }, |
| | | cascader: [{key: 'warehouseId', queryKey: 'agencyId'}, {key: 'goodsTemplateId', queryKey: 'agencyId'}], |
| | | optionsConfig: {url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null}, |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | placeholder: '请输入', |
| | | defaultValue: '', |
| | | options: [], |
| | | cascader: [{key:'categoryId',queryKey: 'goodsTemplatesId'}], |
| | | cascader: [{key: 'categoryId', queryKey: 'goodsTemplatesId'}], |
| | | optionsConfig: { |
| | | label: 'goodsName', |
| | | value: 'id', |
| | |
| | | label: 'label', |
| | | value: 'id', |
| | | url: SettingIplatform.apiBaseURL + '/pc/base/category/select/tree', |
| | | props:{checkStrictly:false} |
| | | props: {checkStrictly: false, emitPath: false, value: 'id'} |
| | | }, |
| | | }, |
| | | { |
| | |
| | | placeholder: '请选择', |
| | | defaultValue: '', |
| | | options: [{ |
| | | label:'A', |
| | | value:'1' |
| | | },{ |
| | | label:'B', |
| | | value:'2' |
| | | },{ |
| | | label:'C', |
| | | value:'3' |
| | | label: 'A', |
| | | value: '1' |
| | | }, { |
| | | label: 'B', |
| | | value: '2' |
| | | }, { |
| | | label: 'C', |
| | | value: '3' |
| | | }], |
| | | }, |
| | | ], |
| | |
| | | treeDataList: [], |
| | | // 搜索条件 |
| | | filterFrom: { |
| | | warehouseType:0 |
| | | warehouseType: 0 |
| | | }, |
| | | // 表格数据 |
| | | table: { |
| | |
| | | }, |
| | | // 列信息 |
| | | columns: [ |
| | | { title: '机构', field: 'agencyName', align: 'left', minWidth: 130 }, |
| | | { title: '仓库', field: 'warehouseName', align: 'left', minWidth: 130 }, |
| | | { title: '分类', field: 'categoryName', align: 'left', minWidth: 130 }, |
| | | { title: '所属类别', field: 'costType', align: 'center', width:80 }, |
| | | { title: '物品名称', field: 'goodsTemplateName', align: 'left', minWidth: 140 }, |
| | | { title: '规格型号', field: 'baseGoodsModelsName', align: 'left', minWidth: 130 }, |
| | | { title: '单位', field: 'unit', align: 'center', width:80 }, |
| | | { title: '当前库存', field: 'kucun', align: 'center' }, |
| | | {title: '机构', field: 'agencyName', align: 'left', minWidth: 130}, |
| | | {title: '仓库', field: 'warehouseName', align: 'left', minWidth: 130}, |
| | | {title: '分类', field: 'categoryName', align: 'left', minWidth: 130}, |
| | | {title: '所属类别', field: 'costType', align: 'center', width: 80}, |
| | | {title: '物品名称', field: 'goodsTemplateName', align: 'left', minWidth: 140}, |
| | | {title: '规格型号', field: 'baseGoodsModelsName', align: 'left', minWidth: 130}, |
| | | {title: '单位', field: 'unit', align: 'center', width: 80}, |
| | | {title: '当前库存', field: 'kucun', align: 'center'}, |
| | | ], |
| | | paging: { |
| | | show: true, // 显示分页 |
| | |
| | | background: 'rgba(0, 0, 0, 0.7)', |
| | | }); |
| | | // 判断总条数是否大于最大支持条数 |
| | | doExport({ ...this.filterFrom }) |
| | | .then((res) => { |
| | | const blob = new Blob([res], { type: 'application/vnd.ms-excel' }); |
| | | const fileName = `库存查询.xls`; |
| | | if ('download' in document.createElement('a')) { |
| | | // 非IE下载 |
| | | const elink = document.createElement('a'); |
| | | elink.download = fileName; |
| | | elink.style.display = 'none'; |
| | | elink.href = URL.createObjectURL(blob); |
| | | document.body.appendChild(elink); |
| | | elink.click(); |
| | | URL.revokeObjectURL(elink.href); |
| | | document.body.removeChild(elink); |
| | | } else { |
| | | // IE10+下载 |
| | | navigator.msSaveBlob(blob, fileName); |
| | | } |
| | | this.$message.success('导出成功!'); |
| | | loading.close(); |
| | | }) |
| | | .catch(() => { |
| | | loading.close(); |
| | | }); |
| | | doExport({...this.filterFrom}) |
| | | .then((res) => { |
| | | const blob = new Blob([res], {type: 'application/vnd.ms-excel'}); |
| | | const fileName = `库存查询.xls`; |
| | | if ('download' in document.createElement('a')) { |
| | | // 非IE下载 |
| | | const elink = document.createElement('a'); |
| | | elink.download = fileName; |
| | | elink.style.display = 'none'; |
| | | elink.href = URL.createObjectURL(blob); |
| | | document.body.appendChild(elink); |
| | | elink.click(); |
| | | URL.revokeObjectURL(elink.href); |
| | | document.body.removeChild(elink); |
| | | } else { |
| | | // IE10+下载 |
| | | navigator.msSaveBlob(blob, fileName); |
| | | } |
| | | this.$message.success('导出成功!'); |
| | | loading.close(); |
| | | }) |
| | | .catch(() => { |
| | | loading.close(); |
| | | }); |
| | | }, |
| | | |
| | | // 查询table列表 |