|
@@ -1,83 +1,352 @@
|
|
|
<template>
|
|
|
- <div class="app-container">
|
|
|
- <el-form :model="form" ref="form" label-width="68px">
|
|
|
- <el-form-item label="客户项目" prop="fCorpid">
|
|
|
- <el-select
|
|
|
- v-model="form.fCorpid"
|
|
|
- filterable
|
|
|
- remote
|
|
|
- clearable
|
|
|
- style="width: 200px"
|
|
|
- size="small"
|
|
|
- placeholder="请选择货权方"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(dict, index) in fMblnoOptions"
|
|
|
- :key="index.fId"
|
|
|
- :label="dict.fName"
|
|
|
- :value="dict.fId"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="物资类别" prop="fMblno">
|
|
|
- <el-select
|
|
|
- v-model="form.fMblno"
|
|
|
- placeholder="请输入提单号"
|
|
|
- clearable
|
|
|
- style="width: 200px"
|
|
|
- size="small"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="年" prop="fToCorpid">
|
|
|
- <el-date-picker
|
|
|
- v-model="form.fToCorpid"
|
|
|
- type="year"
|
|
|
- style="width: 200px"
|
|
|
- format="yyyy"
|
|
|
- value-format="yyyy"
|
|
|
- placeholder="选择年">
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="开始月" prop="fProductName">
|
|
|
- <el-date-picker
|
|
|
- v-model="form.fProductName"
|
|
|
- type="month"
|
|
|
- format="MM"
|
|
|
- style="width: 200px"
|
|
|
- value-format="MM"
|
|
|
- placeholder="选择月">
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="结束月" prop="fMarks">
|
|
|
- <el-date-picker
|
|
|
- v-model="form.fProductName"
|
|
|
- type="month"
|
|
|
- format="MM"
|
|
|
- style="width: 200px"
|
|
|
- value-format="MM"
|
|
|
- placeholder="选择月">
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
-<!-- <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>-->
|
|
|
-<!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>-->
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
+ <div class="app-container">
|
|
|
+ <el-form label-width="80px" :model="form" ref="form">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="供应商" prop="">
|
|
|
+ <el-input>
|
|
|
+
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="物资类别" prop="">
|
|
|
+ <el-input>
|
|
|
+
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="物资名称" prop="">
|
|
|
+ <el-input>
|
|
|
+
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="仓库" prop="">
|
|
|
+ <el-input>
|
|
|
+
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="期间" prop="">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="form.data"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <div class="tabSetting">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ icon="el-icon-download"
|
|
|
+ size="mini"
|
|
|
+ @click="handleExport"
|
|
|
+ v-hasPermi="['warehouseBusiness:profit:export']"
|
|
|
+ >导出
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ <div style="margin: 0 12px">
|
|
|
+ <el-button
|
|
|
+ icon="el-icon-setting"
|
|
|
+ size="mini"
|
|
|
+ circle
|
|
|
+ @click="showSetting = !showSetting"
|
|
|
+ ></el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-row>
|
|
|
+ <el-dialog title="自定义列显示" :visible.sync="showSetting" width="700px">
|
|
|
+ <div>配置排序列数据(拖动调整顺序)</div>
|
|
|
+ <div style="margin-left: 17px">
|
|
|
+ <el-checkbox
|
|
|
+ v-model="allCheck"
|
|
|
+ label="全选"
|
|
|
+ @change="allChecked"
|
|
|
+ ></el-checkbox>
|
|
|
+ </div>
|
|
|
+ <div style="padding: 4px; display: flex; justify-content: center">
|
|
|
+ <draggable
|
|
|
+ v-model="setRowList"
|
|
|
+ group="site"
|
|
|
+ animation="300"
|
|
|
+ @start="onStart"
|
|
|
+ @end="onEnd"
|
|
|
+ handle=".indraggable"
|
|
|
+ >
|
|
|
+ <transition-group>
|
|
|
+ <div
|
|
|
+ v-for="item in setRowList"
|
|
|
+ :key="item.surface"
|
|
|
+ class="listStyle"
|
|
|
+ >
|
|
|
+ <div style="width: 500px" class="indraggable">
|
|
|
+ <div class="progress" :style="{ width: item.width + 'px' }">
|
|
|
+ <el-checkbox
|
|
|
+ :label="item.name"
|
|
|
+ v-model="item.checked"
|
|
|
+ :true-label="0"
|
|
|
+ :false-label="1"
|
|
|
+ >{{ item.name }}
|
|
|
+ </el-checkbox>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-input-number
|
|
|
+ v-model.number="item.width"
|
|
|
+ controls-position="right"
|
|
|
+ :min="1"
|
|
|
+ :max="500"
|
|
|
+ size="mini"
|
|
|
+ ></el-input-number>
|
|
|
+ </div>
|
|
|
+ </transition-group>
|
|
|
+ </draggable>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="showSetting = false">取 消</el-button>
|
|
|
+ <el-button @click="delRow" type="danger">重 置</el-button>
|
|
|
+ <el-button type="primary" @click="save()">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ <el-table v-loading="loading" :data="dataList" show-summary :summary-method="getSum">
|
|
|
+ <!-- <el-table-column type="selection" width="55" align="center" /> -->
|
|
|
+ <el-table-column type="index" label="行号" align="center" width="100"/>
|
|
|
+ <el-table-column
|
|
|
+ v-for="(item, index) in getRowList"
|
|
|
+ :key="index"
|
|
|
+ :label="item.name"
|
|
|
+ :width="item.width"
|
|
|
+ :prop="item.label"
|
|
|
+ align="center"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ sortable
|
|
|
+ :fixed="item.fixed"
|
|
|
+ />
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="form.pageNum"
|
|
|
+ :limit.sync="form.pageSize"
|
|
|
+ :page-sizes="[50,100, 200, 500, 1000]"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
-
|
|
|
<script>
|
|
|
+import draggable from 'vuedraggable'
|
|
|
+import Cookies from 'js-cookie'
|
|
|
+import { addSet, resetModule, select } from '@/api/system/set'
|
|
|
+
|
|
|
export default {
|
|
|
- name: 'inventoryAccount',
|
|
|
+ name: 'profitGeneralLedger',
|
|
|
+ components: { draggable },
|
|
|
data(){
|
|
|
return{
|
|
|
form:{},
|
|
|
- fMblnoOptions:[]
|
|
|
+ total:0,
|
|
|
+ dataList:[],
|
|
|
+ showSetting: false,
|
|
|
+ setRowList: [],
|
|
|
+ getRowList: [],
|
|
|
+ tableDate: [
|
|
|
+ {
|
|
|
+ surface: "1",
|
|
|
+ label: "fName",
|
|
|
+ name: "年",
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: "2",
|
|
|
+ label: "fFeesName",
|
|
|
+ name: "月",
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: "3",
|
|
|
+ label: "fMblno",
|
|
|
+ name: "供应商",
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: "4",
|
|
|
+ label: "fProductName",
|
|
|
+ name: "货物",
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: "5",
|
|
|
+ label: "fProductName",
|
|
|
+ name: "货物",
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: "6",
|
|
|
+ label: "fProductName",
|
|
|
+ name: "货物",
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: "7",
|
|
|
+ label: "fProductName",
|
|
|
+ name: "货物",
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: "8",
|
|
|
+ label: "fProductName",
|
|
|
+ name: "货物",
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: "4",
|
|
|
+ label: "fProductName",
|
|
|
+ name: "货物",
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: "4",
|
|
|
+ label: "fProductName",
|
|
|
+ name: "货物",
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ surface: "4",
|
|
|
+ label: "fProductName",
|
|
|
+ name: "货物",
|
|
|
+ checked: 0,
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ allCheck: false,
|
|
|
}
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ getList(){
|
|
|
+
|
|
|
+ },
|
|
|
+ allChecked() {
|
|
|
+ if (this.allCheck == true) {
|
|
|
+ this.setRowList.map((e) => {
|
|
|
+ return (e.checked = 0);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.setRowList.map((e) => {
|
|
|
+ return (e.checked = 1);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //查询列数据
|
|
|
+ getRow() {
|
|
|
+ let that = this;
|
|
|
+ this.data = {
|
|
|
+ tableName: "利润总账",
|
|
|
+ userId: Cookies.get("userName"),
|
|
|
+ };
|
|
|
+ select(this.data).then((res) => {
|
|
|
+ if (res.data.length != 0) {
|
|
|
+ this.getRowList = res.data.filter((e) => e.checked == 0);
|
|
|
+ this.setRowList = res.data;
|
|
|
+ this.setRowList = this.setRowList.reduce((res, item) => {
|
|
|
+ res.push({
|
|
|
+ surface: item.surface,
|
|
|
+ label: item.label,
|
|
|
+ name: item.name,
|
|
|
+ checked: item.checked,
|
|
|
+ width: item.width,
|
|
|
+ fixed: item.fixed,
|
|
|
+ });
|
|
|
+ return res;
|
|
|
+ }, []);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ delRow() {
|
|
|
+ this.data = {
|
|
|
+ tableName: "利润总账",
|
|
|
+ userId: Cookies.get("userName"),
|
|
|
+ };
|
|
|
+ resetModule(this.data).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.showSetting = false;
|
|
|
+ this.setRowList = this.tableDate;
|
|
|
+ this.getRowList = this.tableDate;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //保存列设置
|
|
|
+ save() {
|
|
|
+ this.showSetting = false;
|
|
|
+ this.data = {
|
|
|
+ tableName: "利润总账",
|
|
|
+ userId: Cookies.get("userName"),
|
|
|
+ sysTableSetList: this.setRowList,
|
|
|
+ };
|
|
|
+ addSet(this.data).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.showSetting = false;
|
|
|
+ this.getRowList = this.setRowList.filter((e) => e.checked == 0);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //开始拖拽事件
|
|
|
+ onStart() {
|
|
|
+ this.drag = true;
|
|
|
+ },
|
|
|
+ //拖拽结束事件
|
|
|
+ onEnd() {
|
|
|
+ this.drag = false;
|
|
|
+ },
|
|
|
+ getSum(param) {
|
|
|
+ const { columns, data } = param
|
|
|
+ const sums = []
|
|
|
+ columns.forEach((column, index) => {
|
|
|
+ if (index === 0) {
|
|
|
+ sums[index] = '总计'
|
|
|
+ } else if (index === 7 || index === 8 || index === 9) {
|
|
|
+ const values = data.map(item => Number(item[column.property]))
|
|
|
+ if (!values.every(value => isNaN(value))) {
|
|
|
+ sums[index] = values.reduce((prev, curr) => {
|
|
|
+ const value = Number(curr)
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ return prev + curr
|
|
|
+ } else {
|
|
|
+ return prev
|
|
|
+ }
|
|
|
+ }, 0)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return sums
|
|
|
+ },
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
-
|
|
|
<style scoped lang="scss">
|
|
|
|
|
|
</style>
|