123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443 |
- <template>
- <div class="app-container">
- <formComponent
- :formOption="formOption"
- :dataList="dataList"
- :inDex="inDex"
- ref="avatar"
- @submitForm="submitForm"
- @returnToForm="returnToForm"
- />
- <listComponent
- :tableData="tableData"
- @modify="modification"
- @deletion="deletion"
- @buttonList="buttonList"
- @showSearch="showSearch"
- @feedback="feedback"
- @getList="getList"
- :hasPermi="hasPermi"
- :tatolLabel="tatolLabel"
- :isItHidden="isItHidden"
- :customButton="customButton"
- :listStyle="listStyle"
- :queryList="queryList"
- :setRowList="setRowList"
- />
- <!-- <el-pagination-->
- <!-- style="float: right;margin-top: 10px"-->
- <!-- @size-change="handleSizeChange"-->
- <!-- @current-change="handleCurrentChange"-->
- <!-- :page-sizes="[10, 20, 30, 50]"-->
- <!-- :page-size="this.formDataList.pageSize"-->
- <!-- background-->
- <!-- layout="sizes, prev, pager, next"-->
- <!-- :total="total">-->
- <!-- </el-pagination>-->
- <div style="float: right">
- <pagination
- v-show="total > 0"
- :total="total"
- :page.sync="formDataList.pageNum"
- :limit.sync="formDataList.pageSize"
- :page-sizes="[10,100,200,500,1000]"
- @pagination="getList"
- />
- </div>
- </div>
- </template>
- <script>
- import { select } from '@/api/system/set'
- import{ queryData, company, productName, listExport} from '@/api/reportAnalysis/inoutStatistics'
- import Cookies from 'js-cookie'
- export default {
- name: 'salesStatistics',
- data(){
- return{
- tatolLabel:['数量'],
- dataList:{
- fBilltype:[{ label: '出库',value:'CK'},{ label: '入库',value:'RK'}],
- fFeeType:[],
- fFeeid:[],
- fCorpid:[],
- fBillstatus:[{label:'全部',value:''},{label:'入账',value:'1'},{label:'未入账',value:'2'},]
- },
- tableData:[],
- setRowList:[],
- isItHidden: true,
- queryList: {
- tableName: '出入库统计',
- columnList: []
- },
- hasPermi:{
- lookup:['anpin:stockControl:query'],
- disappear:['anpin:stockControl:remove']
- },
- customButton: [
- {
- type: 'primary',
- size: 'mini',
- icon: 'el-icon-edit',
- name: '导出',
- disabled: false,
- hasPermi:['anpin:stockControl:tWarehouseInorOutExcePorrt']
- }
- ],
- inDex: 4,
- total:0,
- formDataList:{
- pageSize:10,
- pageNum:1,
- },
- listStyle: [
- {
- surface: '1',
- label: 'serialNumber',
- name: '序号',
- checked: 0,
- width: 100,
- onabort: ''
- },{
- surface: '2',
- label: 'fBilltypeName',
- name: '出入库类别',
- checked: 0,
- width: 100,
- onabort: ''
- },
- {
- surface: '3',
- label: 'fBsdate',
- name: '进货时间',
- checked: 0,
- width: 100,
- onabort: ''
- },
- {
- surface: '4',
- label: 'fFeetype',
- name: '货物类别',
- checked: 0,
- width: 100,
- onabort: ''
- },{
- surface: '5',
- label: 'feeName',
- name: '产品名称',
- checked: 0,
- width: 100,
- onabort: ''
- },
- {
- surface: '6',
- label: 'fCurrencyName',
- name: '规格',
- checked: 0,
- width: 100,
- onabort: ''
- },
- {
- surface: '7',
- label: 'fQty',
- name: '数量',
- checked: 0,
- width: 100,
- onabort: ''
- },
- {
- surface: '8',
- label: 'corpName',
- name: '供货商',
- checked: 0,
- width: 100,
- onabort: ''
- },
- {
- surface: '9',
- label: 'fManage',
- name: '供货人',
- checked: 0,
- width: 100,
- onabort: ''
- },
- {
- surface: '10',
- label: 'fTel',
- name: '联系电话',
- checked: 0,
- width: 100,
- onabort: ''
- },
- {
- surface: '11',
- label: 'tProductdate',
- name: '生产日期',
- checked: 0,
- width: 100,
- onabort: ''
- },{
- surface: '12',
- label: 'fLotno',
- name: '批号',
- checked: 0,
- width: 100,
- onabort: ''
- },
- {
- surface: '13',
- label: 'quality',
- name: '保质期限',
- checked: 0,
- width: 100,
- onabort: ''
- },
- {
- surface: '14',
- label: 'fStoreEnvName',
- name: '保存条件',
- checked: 0,
- width: 100,
- onabort: ''
- },
- {
- surface: '15',
- label: 'fIsfillesName',
- name: '索证索票',
- checked: 0,
- width: 100,
- onabort: ''
- },
- {
- surface: '16',
- label: 'purchaseName',
- name: '采购人',
- checked: 0,
- width: 100,
- onabort: ''
- },
- {
- surface: '17',
- label: 'checkoutName',
- name: '感官',
- checked: 0,
- width: 100,
- onabort: ''
- },
- {
- surface: '18',
- label: 'checkoutName',
- name: '数量',
- checked: 0,
- width: 100,
- onabort: ''
- },
- {
- surface: '19',
- label: 'checkName',
- name: '验收人',
- checked: 0,
- width: 100,
- onabort: ''
- }
- ],
- formOption:[
- {
- span: 6,
- label: 'fBilltype',
- name: '统计类型',
- inputType: 1,
- width: 200,
- labelSize: '80',
- rules: [{ required: false, message: ' ' }]
- },
- {
- span: 6,
- label: 'fCorpid',
- name: '供应商',
- inputType: 1,
- width: 200,
- labelSize: '80',
- rules: [{ required: false, message: ' ' }]
- },
- {
- span: 6,
- label: 'cLoadDate',
- name: '统计期间',
- inputType: 3,
- width: 240,
- labelSize: '82',
- rules: [{ required: false, message: ' ' }]
- },
- {
- span: 6,
- label: 'fFeeType',
- name: '物资类别',
- inputType: 1,
- width: 200,
- labelSize: '80',
- rules: [{ required: false, message: ' ' }]
- },
- {
- span: 6,
- label: 'fFeeid',
- name: '产品名称',
- inputType: 1,
- width: 200,
- labelSize: '80',
- rules: [{ required: false, message: ' ' }]
- },
- {
- span: 6,
- label: 'fBillstatus',
- name: '状态',
- inputType: 1,
- width: 200,
- labelSize: '80',
- rules: [{ required: false, message: ' ' }]
- },
- ]
- }
- },
- created() {
- this.queryList.columnList = this.listStyle
- this.getDicts("data_cost_attribute").then((response) => {
- for(let item in response.data){
- this.dataList.fFeeType.push({
- value: response.data[item].dictValue,
- label:response.data[item].dictLabel
- })
- }
- });
- company(1).then(res => {
- for (let item in res.data) {
- this.dataList.fCorpid.push({
- label: res.data[item].fName,
- value: res.data[item].fId
- })
- }
- console.log(this.dataList)
- })
- productName().then(res => {
- console.log(res)
- if (res.code === 200) {
- for (let item in res.rows) {
- this.dataList.fFeeid.push({
- label: res.rows[item].fName,
- value: res.rows[item].fId,
- })
- }
- }
- })
- let data = {
- tableName: this.queryList.tableName,
- userId: Cookies.get('userName')
- }
- this.getRow(data)
- this.getList()
- },
- methods:{
- getRow(data,list) {
- select(data).then((res) => {
- if (res.data.length != 0) {
- this.queryList.columnList = res.data.filter((e) => e.checked == 0)
- this.queryList.columnList = res.data
- this.setRowList = res.data
- this.queryList.columnList = this.queryList.columnList.filter((e) => e.checked == 0)
- // this.waitFor = true
- } else {
- this.$set(this.queryList, 'columnList', this.$options.data().listStyle)
- this.setRowList = this.$options.data().listStyle
- }
- this.isItHidden = true
- // this.inDex = this.formOption.length
- this.inDex = 4
- })
- },
- //修改
- modification(scope) {
- console.log(scope)
- },
- //删除
- deletion(scope){},
- //所以按钮
- buttonList(row){
- console.log(row)
- switch (row.name){
- case '导出':
- const queryParams = this.formDataList;
- this.$confirm("是否确认导出所有出入库数据项?", "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(function () {
- return listExport(queryParams);
- })
- .then((response) => {
- this.download(response.msg);
- });
- break
- }
- },
- // 显示搜索条件、点击后会调用此方法
- showSearch() {
- console.log('到我了')
- this.searchWhether = !this.searchWhether
- },
- //搜索、重置、展开
- feedback(res) {
- console.log(res)
- if (res == '展开') {
- if (this.inDex == 4) {
- this.inDex = this.formOption.length
- } else {
- this.inDex = 4
- }
- } else if (res == '搜索') {
- this.$refs.avatar.submitForm()
- } else if (res == '重置') {
- this.$refs.avatar.form = {}
- this.$refs.avatar.submitForm()
- }
- },
- //点击刷新会调用此方法
- getList() {
- console.log('到我了2')
- // this.feedback('重置')
- this.query(this.formDataList)
- },
- //查询主页列数据
- query(data) {
- queryData(data).then(res => {
- this.tableData = res.rows
- this.total = res.total
- console.log(this.total)
- })
- },
- submitForm() {
- this.formDataList = this.$refs.avatar.form
- this.query(this.formDataList)
- },
- returnToForm(row) {
- console.log(row, 111)
- },
- //分页
- handleSizeChange(val) {
- this.formDataList.pageSize = val
- this.query(this.formDataList)
- },
- handleCurrentChange(val) {
- this.formDataList.pageNum = val
- this.query(this.formDataList)
- },
- }
- }
- </script>
- <style scoped lang="scss">
- .app-container ::v-deep .el-form-item {
- margin-bottom: 4px;
- }
- </style>
|