|
@@ -0,0 +1,402 @@
|
|
|
+<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"
|
|
|
+ :isItHidden="isItHidden"
|
|
|
+ :customButton="customButton"
|
|
|
+ :listStyle="listStyle"
|
|
|
+ :queryList="queryList"
|
|
|
+ :setRowList="setRowList"
|
|
|
+ :tatolLabel="tatolLabel"
|
|
|
+ />
|
|
|
+ <div style="float: right;margin-bottom: 10px">
|
|
|
+
|
|
|
+ <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>
|
|
|
+<!-- <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>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { queryItem, productName,queryData,listExport } from '@/api/reportAnalysis/purchaseRequest'
|
|
|
+import Cookies from 'js-cookie'
|
|
|
+import { select } from '@/api/system/set'
|
|
|
+import { company } from '@/api/purchaseRequest'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'salesStatistics',
|
|
|
+ data(){
|
|
|
+ return{
|
|
|
+ tatolLabel:['数量','金额'],
|
|
|
+ dataList:{
|
|
|
+ fCorpid:[],
|
|
|
+ fSbu: [],
|
|
|
+ fFeeTypeList:[],
|
|
|
+ fFeeid:[],
|
|
|
+ groupDate:[{label:'是',value:0},{label: '否',value: 1}],
|
|
|
+ fBillstatus:[{label:'全部',value:''},{label:'暂存',value:'2'},{label:'审核中',value:'5'},{label:'审核通过',value:'6'},]
|
|
|
+ },
|
|
|
+ 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:purchaseRequestExPorrt']
|
|
|
+ }],
|
|
|
+ inDex: 4,
|
|
|
+ total:0,
|
|
|
+ formDataList:{
|
|
|
+ pageSize:10,
|
|
|
+ pageNum:1,
|
|
|
+ },
|
|
|
+ listStyle: [
|
|
|
+ {
|
|
|
+ surface: '1',
|
|
|
+ label: 'serialNumber',
|
|
|
+ name: '序1号',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },{
|
|
|
+ surface: '2',
|
|
|
+ label: 'fBsdate',
|
|
|
+ name: '出库日期',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: '3',
|
|
|
+ label: 'fCorpidName',
|
|
|
+ name: '供应商',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },{
|
|
|
+ surface: '4',
|
|
|
+ label: 'fsbuName',
|
|
|
+ name: '开票公司',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },{
|
|
|
+ surface: '5',
|
|
|
+ label: 'ffeetypeName',
|
|
|
+ name: '物资类别',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },{
|
|
|
+ surface: '6',
|
|
|
+ label: 'fname',
|
|
|
+ name: '物资',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },{
|
|
|
+ surface: '7',
|
|
|
+ label: 'fcurrency',
|
|
|
+ name: '规格',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },{
|
|
|
+ surface: '8',
|
|
|
+ label: 'fqty',
|
|
|
+ name: '数量',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },{
|
|
|
+ surface: '9',
|
|
|
+ label: 'ffeeunitidName',
|
|
|
+ name: '计量单位',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },{
|
|
|
+ surface: '10',
|
|
|
+ label: 'price',
|
|
|
+ name: '单价',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ },{
|
|
|
+ surface: '11',
|
|
|
+ label: 'famount',
|
|
|
+ name: '金额',
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ onabort: ''
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ formOption:[
|
|
|
+ {
|
|
|
+ span: 6,
|
|
|
+ label: 'fCorpid',
|
|
|
+ name: '供应商',
|
|
|
+ inputType: 1,
|
|
|
+ width: 200,
|
|
|
+ labelSize: '80',
|
|
|
+ rules: [{ required: false, message: ' ' }]
|
|
|
+ },{
|
|
|
+ span: 6,
|
|
|
+ label: 'fFeeTypeList',
|
|
|
+ name: '物资类别',
|
|
|
+ inputType: 1,
|
|
|
+ width: 200,
|
|
|
+ labelSize: '80',
|
|
|
+ multiple:true,
|
|
|
+ rules: [{ required: false, message: ' ' }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ span: 6,
|
|
|
+ label: 'fSbu',
|
|
|
+ name: '开票公司',
|
|
|
+ inputType: 1,
|
|
|
+ width: 200,
|
|
|
+ labelSize: '80',
|
|
|
+ rules: [{ required: false, message: ' ' }]
|
|
|
+ },{
|
|
|
+ span: 6,
|
|
|
+ label: 'cLoadDate',
|
|
|
+ name: '出库日期',
|
|
|
+ inputType: 3,
|
|
|
+ width: 240,
|
|
|
+ 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: ' ' }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ span: 6,
|
|
|
+ label: 'groupDate',
|
|
|
+ name: '是否按照日期分组',
|
|
|
+ inputType: 1,
|
|
|
+ clearable:true,
|
|
|
+ width: 200,
|
|
|
+ labelSize: '140',
|
|
|
+ rules: [{ required: false, message: ' ' }]
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.queryList.columnList = this.listStyle
|
|
|
+ this.setRowList = this.listStyle
|
|
|
+ company(1).then(res => {
|
|
|
+ for (let item in res.data) {
|
|
|
+ this.dataList.fCorpid.push({
|
|
|
+ label: res.data[item].fName,
|
|
|
+ value: res.data[item].fId
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.getDicts("data_cost_attribute").then((response) => {
|
|
|
+ for(let item in response.data){
|
|
|
+ this.dataList.fFeeTypeList.push({
|
|
|
+ value: response.data[item].dictValue,
|
|
|
+ label:response.data[item].dictLabel
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ 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,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.getList()
|
|
|
+ let data = {
|
|
|
+ tableName: this.queryList.tableName,
|
|
|
+ userId: Cookies.get('userName')
|
|
|
+ }
|
|
|
+ company(2).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ this.dataList.fSbu = []
|
|
|
+ for (let item in res.data) {
|
|
|
+ this.dataList.fSbu.push({
|
|
|
+ label: res.data[item].fName,
|
|
|
+ value: res.data[item].fId
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.getRow(data,'S')
|
|
|
+
|
|
|
+ },
|
|
|
+ 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
|
|
|
+ if (list == 'S'){
|
|
|
+ this.$set(this.$refs.avatar.form,'groupDate',1)
|
|
|
+ }
|
|
|
+ this.$refs.avatar.form = this.formDataList
|
|
|
+ this.$set(this.$refs.avatar.form,'groupDate',0)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //修改
|
|
|
+ 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.formDataList = this.$refs.avatar.form
|
|
|
+ this.$refs.avatar.submitForm(1)
|
|
|
+ } else if (res == '重置') {
|
|
|
+ let list ={
|
|
|
+ pageNum:this.formDataList.pageNum,
|
|
|
+ pageSize:this.formDataList.pageSize
|
|
|
+ }
|
|
|
+ this.$refs.avatar.form = {}
|
|
|
+ this.$refs.avatar.form = this.formDataList = list
|
|
|
+ console.log(this.formDataList,this.$refs.avatar.form)
|
|
|
+ this.$refs.avatar.submitForm(2)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //点击刷新会调用此方法
|
|
|
+ getList() {
|
|
|
+ console.log('到我了2')
|
|
|
+ console.log(this.formDataList)
|
|
|
+ queryData(this.formDataList).then(res=>{
|
|
|
+ this.tableData = res.rows
|
|
|
+ this.total = res.total
|
|
|
+ })
|
|
|
+ console.log(this.formDataList.pageSize)
|
|
|
+ },
|
|
|
+ submitForm(res) {
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ returnToForm(row) {
|
|
|
+ console.log(row, 111)
|
|
|
+ },
|
|
|
+ //分页
|
|
|
+ handleSizeChange(val) {
|
|
|
+ // console.log(`每页 ${val} 条`);
|
|
|
+ this.formDataList.pageSize = val
|
|
|
+ this.query(this.formDataList)
|
|
|
+ },
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ // console.log(`当前页: ${val}`);
|
|
|
+ this.formDataList.pageNum = val
|
|
|
+ this.query(this.formDataList)
|
|
|
+ },
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|