|
@@ -1,662 +1,365 @@
|
|
|
<!--仓库管理-->
|
|
|
<template>
|
|
|
<div>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <div class="bg-left title"><span class="top_title">全部仓库</span></div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" class="bg-right">
|
|
|
+ <el-button class="bg-bottom" type="primary" size="small" @click="returnsales()"><img width="6" height="10" style="vertical-align: bottom; margin-right: 3px" src="../../../public/img/lujing.png" alt="" />返回</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
<BaseHeaderLayout :leftSpan="15">
|
|
|
<template slot="left">
|
|
|
- <div>
|
|
|
+ <div class="top_select">
|
|
|
<ws-select
|
|
|
- v-model="warehouseName"
|
|
|
- placeholder="请选择仓库名称"
|
|
|
- class="typeselect"
|
|
|
- @change="selectpackingMethod"
|
|
|
- >
|
|
|
+ v-model="warehouseName1"
|
|
|
+ placeholder="请选择仓库名称"
|
|
|
+ class="typeselect"
|
|
|
+ @change="selectpackingMethod"
|
|
|
+ >
|
|
|
+ <ws-option key="" label="全部仓库" value="" />
|
|
|
<ws-option
|
|
|
- key=""
|
|
|
- label="全部仓库"
|
|
|
- value=""
|
|
|
- />
|
|
|
- <ws-option
|
|
|
- v-for="item in packtypeList"
|
|
|
- :key="item.constKey"
|
|
|
- :label="item.warehouseName"
|
|
|
- :value="item.warehouseName"
|
|
|
- />
|
|
|
- </ws-select>
|
|
|
- <ws-select
|
|
|
- v-model="goodsName"
|
|
|
- placeholder="请选择类型"
|
|
|
- class="typeselect"
|
|
|
- @change="selectgoodsName"
|
|
|
- >
|
|
|
+ v-for="(item,index) in packtypeList"
|
|
|
+ :key="item.constKey"
|
|
|
+ :label="item.warehouseName"
|
|
|
+ :value="index"
|
|
|
+ />
|
|
|
+ </ws-select>
|
|
|
+ <ws-select
|
|
|
+ v-model="goodsName"
|
|
|
+ placeholder="请选择类型"
|
|
|
+ class="typeselect"
|
|
|
+ @change="selectgoodsName"
|
|
|
+ >
|
|
|
+ <ws-option key="" label="全部粮食" value="" />
|
|
|
<ws-option
|
|
|
- key=""
|
|
|
- label="全部粮食"
|
|
|
- value=""
|
|
|
- />
|
|
|
- <ws-option
|
|
|
- v-for="item in goodsnameList"
|
|
|
- :key="item.constKey"
|
|
|
- :label="item.constValue"
|
|
|
- :value="item.constValue"
|
|
|
- />
|
|
|
- </ws-select>
|
|
|
+ v-for="item in goodsnameList"
|
|
|
+ :key="item.constKey"
|
|
|
+ :label="item.constValue"
|
|
|
+ :value="item.constValue"
|
|
|
+ />
|
|
|
+ </ws-select>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <template slot="right">
|
|
|
-
|
|
|
- </template>
|
|
|
+ <template slot="right"> </template>
|
|
|
</BaseHeaderLayout>
|
|
|
- <el-table ref='table' show-summary :summary-method="getSummaries" class="wenzi" :data="warehouseList"
|
|
|
- style="width: 100%; margin-top: 20px" height="calc(100% - 45px)">
|
|
|
- <el-table-column prop="warehouseName" label="仓库名">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="binNumber" label="仓位编号">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="capacity" label="容量(吨)">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div v-if="scope.row.capacity != 'null' && scope.row.capacity != null">
|
|
|
- {{ scope.row.capacity }}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="品种">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div style="height: 24px" v-for="(item, i) in scope.row.warehouseNumViewList">
|
|
|
- {{ item.goodsName }}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="入库量(吨)">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div style="height: 24px" v-for="(item, i) in scope.row.warehouseNumViewList">
|
|
|
- {{item.inNetWeight}}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="出库量(吨)">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div style="height: 24px" v-for="(item, i) in scope.row.warehouseNumViewList">
|
|
|
- {{ item.outNetWeight }}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="应余量(吨)">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div style="height: 24px" v-for="(item, i) in scope.row.warehouseNumViewList">
|
|
|
- {{ item.storage }}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- </el-table>
|
|
|
- <!-- <el-table class="wenzi" :data="warehouseList" style="width: 100%; margin-top: 20px" height="780">
|
|
|
- <el-table-column type="index" label="序号" width="80">
|
|
|
- <template scope="scope">
|
|
|
- <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
|
|
|
- <span v-else>{{ scope.$index + 1 }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="warehouseName" label="仓库名" width="80">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="address" label="临时仓库地址">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div v-if="scope.row.address != 'null' && scope.row.address != null">
|
|
|
- {{ scope.row.address }}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column label="入库量(吨)">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div style="height: 24px" v-for="(item, i) in scope.row.warehouseNumViewList">
|
|
|
- {{ item.goodsName}}({{item.inNetWeight == null ? 0 : item.inNetWeight}})
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="出库量(吨)">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div style="height: 24px" v-for="(item, i) in scope.row.warehouseNumViewList">
|
|
|
- {{ item.goodsName}}({{item.outNetWeight == null ? 0:item.outNetWeight}})
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="应余量(吨)">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div style="height: 24px" v-for="(item, i) in scope.row.warehouseNumViewList">{{ item.goodsName}}
|
|
|
- ({{ item.surplus}})
|
|
|
- {{item.storage }}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="seller" label="出入库" width="300">
|
|
|
- <template slot-scope="scope">
|
|
|
- <ws-button class="completed" @click="nocomplete(scope.row)">
|
|
|
- 待完成({{ scope.row.number }})
|
|
|
- </ws-button>
|
|
|
- <ws-button class="putstorage" @click="warehousing(scope.row)">
|
|
|
- 入库
|
|
|
- </ws-button>
|
|
|
- <ws-button class="deliverystorage" v-if="scope.row.clearStatusFlag != 3" @click="delivery(scope.row)">
|
|
|
- 出库
|
|
|
- </ws-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table> -->
|
|
|
+ <el-table
|
|
|
+ ref="table"
|
|
|
+ :data="warehouseList"
|
|
|
+ show-summary
|
|
|
+ :summary-method="getSummaries"
|
|
|
+ style="width: 100%; margin-top: 20px"
|
|
|
+ height="calc(100% - 45px)"
|
|
|
+ >
|
|
|
+ <el-table-column prop="warehouseName" label="仓库名"> </el-table-column>
|
|
|
+ <el-table-column prop="binNumber" label="仓位编号"> </el-table-column>
|
|
|
+ <el-table-column prop="capacity" label="容量(吨)">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div
|
|
|
+ v-if="scope.row.capacity != 'null' && scope.row.capacity != null"
|
|
|
+ >
|
|
|
+ {{ scope.row.capacity }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="货名">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div
|
|
|
+ style="height: 24px"
|
|
|
+ v-for="(item, i) in scope.row.warehouseNumViewList"
|
|
|
+ :key="i"
|
|
|
+ >
|
|
|
+ {{ item.goodsName }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="入库量(吨)">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div
|
|
|
+ style="height: 24px"
|
|
|
+ v-for="(item, i) in scope.row.warehouseNumViewList"
|
|
|
+ :key="i"
|
|
|
+ >
|
|
|
+ {{ item.inNetWeight }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="出库量(吨)">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div
|
|
|
+ style="height: 24px"
|
|
|
+ v-for="(item, i) in scope.row.warehouseNumViewList"
|
|
|
+ :key="i"
|
|
|
+ >
|
|
|
+ {{ item.outNetWeight }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="应余量(吨)">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div
|
|
|
+ style="height: 24px"
|
|
|
+ v-for="(item, i) in scope.row.warehouseNumViewList"
|
|
|
+ :key="i"
|
|
|
+ >
|
|
|
+ {{ item.storage }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
- import {
|
|
|
- getList,
|
|
|
- getwarehousetask,
|
|
|
- export1,
|
|
|
- editstatus,
|
|
|
- billoperatehis,
|
|
|
- getsponsible,
|
|
|
- clearancee,
|
|
|
- xiala,
|
|
|
- } from '@/model/warehouse/index'
|
|
|
- import {
|
|
|
- packList,
|
|
|
- } from '@/model/contarct/index'
|
|
|
- import {
|
|
|
- downloadFile
|
|
|
- } from '@/utils/batchDown'
|
|
|
- import Pagination from '@/components/Pagination'
|
|
|
- import WsUpload from '@/components/WsUpload'
|
|
|
- // import { EventBus } from 'base-core-lib'
|
|
|
- import {
|
|
|
- dayjs,
|
|
|
- EventBus
|
|
|
- } from 'base-core-lib'
|
|
|
- export default {
|
|
|
- name: 'viewSpareMoney',
|
|
|
- components: {
|
|
|
- WsUpload,
|
|
|
- Pagination,
|
|
|
+import {
|
|
|
+ getList,
|
|
|
+ getwarehousetask,
|
|
|
+ export1,
|
|
|
+ editstatus,
|
|
|
+ billoperatehis,
|
|
|
+ getsponsible,
|
|
|
+ clearancee,
|
|
|
+ getWarehouseAll,
|
|
|
+ xiala,
|
|
|
+} from '@/model/warehouse/index'
|
|
|
+import { packList } from '@/model/contarct/index'
|
|
|
+import { downloadFile } from '@/utils/batchDown'
|
|
|
+import Pagination from '@/components/Pagination'
|
|
|
+import WsUpload from '@/components/WsUpload'
|
|
|
+// import { EventBus } from 'base-core-lib'
|
|
|
+import { dayjs, EventBus } from 'base-core-lib'
|
|
|
+export default {
|
|
|
+ name: 'viewSpareMoney',
|
|
|
+ components: {
|
|
|
+ WsUpload,
|
|
|
+ Pagination,
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ vesselId(val) {
|
|
|
+ this.getList()
|
|
|
},
|
|
|
- watch: {
|
|
|
- vesselId(val) {
|
|
|
- this.getList()
|
|
|
- },
|
|
|
- isShow(val) {
|
|
|
- this.showType = val
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 年
|
|
|
+ year: '',
|
|
|
+ goodsnameList: [],
|
|
|
+ goodsName: '',
|
|
|
+ warehouseName: '',
|
|
|
+ warehouseName1:'',
|
|
|
+ compId: localStorage.getItem('ws-pf_compId'),
|
|
|
+ warehouseList: [],
|
|
|
+ packtypeList: [], //仓库列表
|
|
|
+ date: {
|
|
|
+ year: dayjs().format('YYYY'),
|
|
|
+ month: dayjs().format('MM'),
|
|
|
},
|
|
|
+ }
|
|
|
+ },
|
|
|
+ activated() {
|
|
|
+ this.goodsName = ""
|
|
|
+ this.warehouseName = ""
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ selectgoodsName(e) {
|
|
|
+ this.getList()
|
|
|
},
|
|
|
- data() {
|
|
|
- return {
|
|
|
- //弹出框
|
|
|
- dialogViewSpareMoney: false,
|
|
|
- dialogApproveFormVisible: false,
|
|
|
- // 船舶类型
|
|
|
- monetaryKey: null,
|
|
|
- // 表格显示数据
|
|
|
- tableDate: [],
|
|
|
- list: [],
|
|
|
- // 是否显示
|
|
|
- showType: true,
|
|
|
- // 年
|
|
|
- year: '',
|
|
|
- goodsnameList:[],
|
|
|
- goodsName:'',
|
|
|
- searchType: 1,
|
|
|
- searchTypeText: '未完成',
|
|
|
- searchKeyWord: '',
|
|
|
- contractType: 2,
|
|
|
- warehouseType: '1',
|
|
|
- // 提交类型
|
|
|
- submitType: true,
|
|
|
- size: 10,
|
|
|
- spanArr: [],
|
|
|
- warehouseName: '',
|
|
|
- compId: localStorage.getItem('ws-pf_compId'),
|
|
|
- deptCircularPage: {},
|
|
|
- warehouseList: [],
|
|
|
- deptBudgetList: {},
|
|
|
- historyList: [],
|
|
|
- deptBudgetTotal: 0,
|
|
|
- pickerBeginDateBefore: {
|
|
|
- disabledDate: (time) => {
|
|
|
- return time.getTime() > Date.now()
|
|
|
- },
|
|
|
- },
|
|
|
- accessoryTFs: false,
|
|
|
- isShowPrintType: false, //打印
|
|
|
- headerText: '',
|
|
|
- packtypeList: [], //仓库列表
|
|
|
- parameter: {
|
|
|
- radio: 3,
|
|
|
- startDate: '',
|
|
|
- endDate: '',
|
|
|
- proportion: ''
|
|
|
- },
|
|
|
- date: {
|
|
|
- year: dayjs().format('YYYY'),
|
|
|
- month: dayjs().format('MM'),
|
|
|
- },
|
|
|
+ dateFormat(fmt, date) {
|
|
|
+ let ret
|
|
|
+ const opt = {
|
|
|
+ 'Y+': date.getFullYear().toString(), // 年
|
|
|
+ 'm+': (date.getMonth() + 1).toString(), // 月
|
|
|
+ 'd+': date.getDate().toString(), // 日
|
|
|
+ 'H+': date.getHours().toString(), // 时
|
|
|
+ // "M+": date.getMinutes().toString(), // 分
|
|
|
+ // "S+": date.getSeconds().toString() // 秒
|
|
|
+ // 有其他格式化字符需求可以继续添加,必须转化成字符串
|
|
|
}
|
|
|
+ for (let k in opt) {
|
|
|
+ ret = new RegExp('(' + k + ')').exec(fmt)
|
|
|
+ if (ret) {
|
|
|
+ fmt = fmt.replace(
|
|
|
+ ret[1],
|
|
|
+ ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return fmt
|
|
|
},
|
|
|
- activated() {
|
|
|
+
|
|
|
+ handleSizeChange(val) {
|
|
|
+ console.log(`每页 ${val} 条`)
|
|
|
+ this.pageSize = val
|
|
|
this.getList()
|
|
|
- this.showType = this.isShow
|
|
|
},
|
|
|
-
|
|
|
- methods: {
|
|
|
- getSummaries(param) {
|
|
|
- const {
|
|
|
- columns,
|
|
|
- data
|
|
|
- } = param
|
|
|
- const sums = []
|
|
|
- columns.forEach((column, index) => {
|
|
|
- if (index === 0) {
|
|
|
- sums[index] = '合计'
|
|
|
- } else if (
|
|
|
- index === 4 ||
|
|
|
- index === 5 ||
|
|
|
- index === 6
|
|
|
- ) {
|
|
|
- const values = data.map((item) => {
|
|
|
- var val = item.warehouseNumViewList.map((items) => {
|
|
|
- if (column.label == '入库量(吨)') {
|
|
|
- return items.inNetWeight
|
|
|
- } else if (column.label == '出库量(吨)') {
|
|
|
- return items.outNetWeight
|
|
|
- } else if (column.label == '应余量(吨)') {
|
|
|
- return items.storage
|
|
|
- }
|
|
|
- })
|
|
|
- return val
|
|
|
- })
|
|
|
- if (!values.every((value) => isNaN(value))) {
|
|
|
- sums[index] = values.reduce((prev, curr) => {
|
|
|
- if (curr.length > 1) {
|
|
|
- var num = 0
|
|
|
- for (let i = 0; i < curr.length; i++) {
|
|
|
- num += Number(curr[i])
|
|
|
- }
|
|
|
- return Number(prev) + num
|
|
|
- } else {
|
|
|
- const value = Number(curr)
|
|
|
- if (!isNaN(value)) {
|
|
|
- return Number(prev) + Number(curr)
|
|
|
- } else {
|
|
|
- return Number(prev)
|
|
|
- }
|
|
|
- }
|
|
|
- }, 0)
|
|
|
- } else {
|
|
|
- sums[index] = '--'
|
|
|
- }
|
|
|
- } else {
|
|
|
- sums[index] = '--'
|
|
|
- }
|
|
|
- })
|
|
|
- if (typeof sums[4] == 'number') {
|
|
|
- sums[4] = sums[4].toFixed(3)
|
|
|
- }
|
|
|
- if (typeof sums[5] == 'number') {
|
|
|
- sums[5] = sums[5].toFixed(3)
|
|
|
- }
|
|
|
- if (typeof sums[6] == 'number') {
|
|
|
- sums[6] = sums[6].toFixed(3)
|
|
|
- }
|
|
|
- // sums[5]=sums[5].toFixed(2)
|
|
|
- // sums[6]=sums[6].toFixed(2)
|
|
|
- // sums[sums.length-7]=sums[sums.length-7].toFixed(2)
|
|
|
- // sums[sums.length-9]=sums[sums.length-9].toFixed(2)
|
|
|
- // sums[sums.length-12]=sums[sums.length-12].toFixed(2)
|
|
|
- // sums[sums.length-13]=sums[sums.length-13].toFixed(2)
|
|
|
- return sums
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
- getSpanArr(data) {
|
|
|
- let that = this
|
|
|
-
|
|
|
- //页面展示的数据,不一定是全部的数据,所以每次都清空之前存储的 保证遍历的数据是最新的数据。以免造成数据渲染混乱
|
|
|
-
|
|
|
- that.spanArr = []
|
|
|
-
|
|
|
- that.pos = 0
|
|
|
-
|
|
|
- //遍历数据
|
|
|
-
|
|
|
- data.forEach((item, index) => {
|
|
|
- //判断是否是第一项
|
|
|
-
|
|
|
- // if (index === 0) {
|
|
|
- // this.spanArr.push(1)
|
|
|
- // this.pos = 0
|
|
|
- // } else {
|
|
|
- //不是第一项时,就根据标识去存储
|
|
|
- if (data[index].warehouseNumViewList.length > 1) {
|
|
|
- // 查找到符合条件的数据时每次要把之前存储的数据+1
|
|
|
- this.spanArr[this.pos] = data[index].warehouseNumViewList.length
|
|
|
- this.spanArr.push(0)
|
|
|
- } else {
|
|
|
- // 没有符合的数据时,要记住当前的index
|
|
|
- this.spanArr.push(1)
|
|
|
- this.pos = index
|
|
|
- }
|
|
|
- // }
|
|
|
- })
|
|
|
- },
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ this.currentPage = val
|
|
|
+ console.log(`当前页: ${val}`)
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ selectpackingMethod(e) {
|
|
|
+ if(this.packtypeList[e].warehouseType == "1"){
|
|
|
+ this.warehouseName = this.packtypeList[e].warehouseName
|
|
|
+ }else if(this.packtypeList[e].warehouseType == "2"){
|
|
|
+ this.warehouseName = this.packtypeList[e].warehouseName1
|
|
|
+ }
|
|
|
|
|
|
- changeradio(e) {
|
|
|
- this.getList()
|
|
|
- },
|
|
|
- selectgoodsName(e){
|
|
|
- this.getList()
|
|
|
- },
|
|
|
- dateFormat(fmt, date) {
|
|
|
- let ret
|
|
|
- const opt = {
|
|
|
- 'Y+': date.getFullYear().toString(), // 年
|
|
|
- 'm+': (date.getMonth() + 1).toString(), // 月
|
|
|
- 'd+': date.getDate().toString(), // 日
|
|
|
- 'H+': date.getHours().toString(), // 时
|
|
|
- // "M+": date.getMinutes().toString(), // 分
|
|
|
- // "S+": date.getSeconds().toString() // 秒
|
|
|
- // 有其他格式化字符需求可以继续添加,必须转化成字符串
|
|
|
- }
|
|
|
- for (let k in opt) {
|
|
|
- ret = new RegExp('(' + k + ')').exec(fmt)
|
|
|
- if (ret) {
|
|
|
- fmt = fmt.replace(
|
|
|
- ret[1],
|
|
|
- ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
|
|
|
- )
|
|
|
- }
|
|
|
- }
|
|
|
- return fmt
|
|
|
- },
|
|
|
- handleClose() {
|
|
|
- this.accessoryTFs = false
|
|
|
- },
|
|
|
- handleSizeChange(val) {
|
|
|
- console.log(`每页 ${val} 条`)
|
|
|
- this.pageSize = val
|
|
|
- this.getList()
|
|
|
- },
|
|
|
- handleCurrentChange(val) {
|
|
|
- this.currentPage = val
|
|
|
- console.log(`当前页: ${val}`)
|
|
|
- this.getList()
|
|
|
- },
|
|
|
- selectpackingMethod(e) {
|
|
|
- this.getList()
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ returnsales() {
|
|
|
+ this.$router.go(-1)
|
|
|
},
|
|
|
- getList() {
|
|
|
- xiala({
|
|
|
+ getList() {
|
|
|
+ xiala({
|
|
|
compId: localStorage.getItem('ws-pf_compId'),
|
|
|
- // warehouseType: this.warehouseType,
|
|
|
})
|
|
|
.toPromise()
|
|
|
.then((response) => {
|
|
|
-
|
|
|
this.packtypeList = response
|
|
|
+ for(var i = 0 ; i < response.length ; i++){
|
|
|
+ if(response[i].warehouseType == '2'){
|
|
|
+ response[i].warehouseName1 = response[i].warehouseName
|
|
|
+ response[i].warehouseName = response[i].warehouseName + " (临)"
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
- // 货名
|
|
|
- packList({
|
|
|
- constId: 'CON2'
|
|
|
- })
|
|
|
- .toPromise()
|
|
|
- .then((response) => {
|
|
|
- this.goodsnameList = response
|
|
|
+ // 货名
|
|
|
+ packList({
|
|
|
+ constId: 'CON2',
|
|
|
+ })
|
|
|
+ .toPromise()
|
|
|
+ .then((response) => {
|
|
|
+ this.goodsnameList = response
|
|
|
+ })
|
|
|
+ // 列表
|
|
|
+ getWarehouseAll({
|
|
|
+ compId: this.compId,
|
|
|
+ warehouseName: this.warehouseName,
|
|
|
+ goodsName: this.goodsName,
|
|
|
+ })
|
|
|
+ .toPromise()
|
|
|
+ .then((response) => {
|
|
|
+ const results = this.makeGroupData(response, function (item) {
|
|
|
+ return [item.binNumberId]
|
|
|
})
|
|
|
- getList({
|
|
|
- compId: localStorage.getItem('ws-pf_compId'),
|
|
|
- warehouseName: this.warehouseName,
|
|
|
- goodsName:this.goodsName
|
|
|
- // warehouseType: this.warehouseType,
|
|
|
+ let _lastList = []
|
|
|
+ for (let i = 0; i < results.length; i++) {
|
|
|
+ let _cw = {}
|
|
|
+ _cw.warehouseName = results[i][0].warehouseName
|
|
|
+ _cw.binNumber = results[i][0].binNumber
|
|
|
+ _cw.capacity = results[i][0].capacity
|
|
|
+ _cw.warehouseNumViewList = results[i]
|
|
|
+ _lastList.push(_cw)
|
|
|
+ }
|
|
|
+ this.warehouseList = _lastList
|
|
|
+ })
|
|
|
+ },
|
|
|
+ makeGroupData(array, fn) {
|
|
|
+ const groups = {}
|
|
|
+ array.forEach(function (item) {
|
|
|
+ const group = JSON.stringify(fn(item))
|
|
|
+ groups[group] = groups[group] || []
|
|
|
+ groups[group].push(item)
|
|
|
+ })
|
|
|
+ return Object.keys(groups).map(function (group) {
|
|
|
+ return groups[group]
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getSummaries(param) {
|
|
|
+ const { columns, data } = param
|
|
|
+ const sums = []
|
|
|
+ columns.forEach((column, index) => {
|
|
|
+ if (index === 0) {
|
|
|
+ sums[index] = '合计'
|
|
|
+ } else if (index === 4 || index === 5 || index === 6) {
|
|
|
+ const values = data.map((item) => {
|
|
|
+ var val = item.warehouseNumViewList.map((items) => {
|
|
|
+ if (column.label == '入库量(吨)') {
|
|
|
+ return items.inNetWeight
|
|
|
+ } else if (column.label == '出库量(吨)') {
|
|
|
+ return items.outNetWeight
|
|
|
+ } else if (column.label == '应余量(吨)') {
|
|
|
+ return items.storage
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return val
|
|
|
})
|
|
|
- .toPromise()
|
|
|
- .then((response) => {
|
|
|
- for (let i = 0; i < response.length; i++) {
|
|
|
- if (response[i].warehouseNumViewList) {
|
|
|
- for (let q = 0; q < response[i].warehouseNumViewList.length; q++) {
|
|
|
- // console.log(response[i].warehouseNumViewList[q])
|
|
|
- if (response[i].warehouseNumViewList[q].inNetWeight) {
|
|
|
- response[i].warehouseNumViewList[q].inNetWeight = Number(response[i].warehouseNumViewList[q]
|
|
|
- .inNetWeight).toFixed(3)
|
|
|
- }
|
|
|
- if (response[i].warehouseNumViewList[q].outNetWeight) {
|
|
|
- response[i].warehouseNumViewList[q].outNetWeight = Number(response[i].warehouseNumViewList[q]
|
|
|
- .outNetWeight).toFixed(3)
|
|
|
- }
|
|
|
- if (response[i].warehouseNumViewList[q].storage) {
|
|
|
- response[i].warehouseNumViewList[q].storage = Number(response[i].warehouseNumViewList[q].storage)
|
|
|
- .toFixed(3)
|
|
|
- }
|
|
|
- if (response[i].warehouseNumViewList[q].inNetWeight && response[i].warehouseNumViewList[q]
|
|
|
- .outNetWeight) {
|
|
|
- response[i].warehouseNumViewList[q].surplus = (response[i].warehouseNumViewList[q].inNetWeight -
|
|
|
- response[i].warehouseNumViewList[q].outNetWeight).toFixed(3)
|
|
|
- } else if (response[i].warehouseNumViewList[q].inNetWeight) {
|
|
|
- response[i].warehouseNumViewList[q].surplus = response[i].warehouseNumViewList[q].inNetWeight
|
|
|
- }
|
|
|
+ if (!values.every((value) => isNaN(value))) {
|
|
|
+ sums[index] = values.reduce((prev, curr) => {
|
|
|
+ if (curr.length > 1) {
|
|
|
+ var num = 0
|
|
|
+ for (let i = 0; i < curr.length; i++) {
|
|
|
+ num += Number(curr[i])
|
|
|
+ }
|
|
|
+ return Number(prev) + num
|
|
|
+ } else {
|
|
|
+ const value = Number(curr)
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ return Number(prev) + Number(curr)
|
|
|
+ } else {
|
|
|
+ return Number(prev)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- this.warehouseList = response
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.table.doLayout();
|
|
|
- // el-table加ref="multipleTable"
|
|
|
- });
|
|
|
- })
|
|
|
- getsponsible({
|
|
|
- compId: localStorage.getItem('ws-pf_compId')
|
|
|
- }).toPromise()
|
|
|
- .then((response) => {
|
|
|
-
|
|
|
- this.list = response
|
|
|
- // console.log(response)
|
|
|
- })
|
|
|
- },
|
|
|
- selecttaskType(e) {
|
|
|
- for (var i = 0; i < this.taskTypeList.length; i++) {
|
|
|
- if (this.taskTypeList[i].value == e) {
|
|
|
- this.searchType = this.taskTypeList[i].type
|
|
|
+ }, 0)
|
|
|
+ } else {
|
|
|
+ sums[index] = '--'
|
|
|
}
|
|
|
+ } else {
|
|
|
+ sums[index] = '--'
|
|
|
}
|
|
|
- },
|
|
|
- // 关闭 dialog时 处理文件url 初始化upload组件
|
|
|
- handleCloe() {
|
|
|
- this.dialogViewSpareMoney = false
|
|
|
- },
|
|
|
-
|
|
|
- history(row) {
|
|
|
- billoperatehis({
|
|
|
- id: row.id
|
|
|
- })
|
|
|
- .toPromise()
|
|
|
- .then((response) => {
|
|
|
- this.historyList = response
|
|
|
- })
|
|
|
- },
|
|
|
- find() {
|
|
|
- this.currentPage = 1
|
|
|
- this.getList()
|
|
|
- },
|
|
|
- // async exportlist() {
|
|
|
- // const { data } = await postExport(
|
|
|
- // this.parameter,
|
|
|
- // {},
|
|
|
- // { responseType: 'blob' }
|
|
|
- // ).toPromise()
|
|
|
- // downloadFile({
|
|
|
- // res: data,
|
|
|
- // fileName: `${
|
|
|
- // this.date.year + (this.date.month ? `-${this.date.month}` : '')
|
|
|
- // }_采购合同1`,
|
|
|
- // type: 'xls',
|
|
|
- // })
|
|
|
- // },
|
|
|
+ })
|
|
|
+ if (typeof sums[4] == 'number') {
|
|
|
+ sums[4] = sums[4].toFixed(3)
|
|
|
+ }
|
|
|
+ if (typeof sums[5] == 'number') {
|
|
|
+ sums[5] = sums[5].toFixed(3)
|
|
|
+ }
|
|
|
+ if (typeof sums[6] == 'number') {
|
|
|
+ sums[6] = sums[6].toFixed(3)
|
|
|
+ }
|
|
|
+ return sums
|
|
|
},
|
|
|
- }
|
|
|
+ },
|
|
|
+}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
- .connert {
|
|
|
- width: 90%;
|
|
|
- margin: 0 auto;
|
|
|
- }
|
|
|
-
|
|
|
- .vertical-text-left {
|
|
|
- width: 62px;
|
|
|
- text-align: right;
|
|
|
- }
|
|
|
-
|
|
|
- .el-button--primary {
|
|
|
- background-color: #5878e8;
|
|
|
- border-color: #5878e8;
|
|
|
- }
|
|
|
-
|
|
|
- .el-button--default {
|
|
|
- color: #8890b1;
|
|
|
- border-color: #e8eaf1;
|
|
|
- }
|
|
|
-
|
|
|
- /deep/.base_header_layout .grid-content.right .find.el-button--primary {
|
|
|
- width: 30px;
|
|
|
- margin-left: 0;
|
|
|
- border-top-left-radius: 0px;
|
|
|
- border-bottom-left-radius: 0px;
|
|
|
- }
|
|
|
-
|
|
|
- /deep/.findValue .el-input__inner {
|
|
|
- border-top-right-radius: 0px;
|
|
|
- border-bottom-right-radius: 0px;
|
|
|
- }
|
|
|
-
|
|
|
- .completed.el-button--default {
|
|
|
- border-color: #5878e8;
|
|
|
- background-color: #f6f7fc;
|
|
|
- color: #5878e8;
|
|
|
- }
|
|
|
-
|
|
|
- .putstorage.el-button--default,
|
|
|
- .deliverystorage.el-button--default {
|
|
|
- border-color: #8890b1;
|
|
|
- background-color: #fff;
|
|
|
- color: #8890b1;
|
|
|
- }
|
|
|
-
|
|
|
- /deep/.el-table td,
|
|
|
- /deep/.el-table th.is-leaf {
|
|
|
- border-right: 1px solid #e9ecf7;
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
-
|
|
|
- /deep/.el-table tr td:first-child,
|
|
|
- /deep/.el-table tr th.is-leaf:first-child {
|
|
|
- border-left: 1px solid #e9ecf7;
|
|
|
- }
|
|
|
-
|
|
|
- /deep/.el-table .el-table__header .cell,
|
|
|
- /deep/.el-table .el-table__body .cell {
|
|
|
- -webkit-line-clamp: 10;
|
|
|
- max-height: 400px;
|
|
|
- }
|
|
|
-
|
|
|
- .record,
|
|
|
- .adjustment {
|
|
|
- display: inline-block;
|
|
|
- color: #5878e8;
|
|
|
- padding: 0 4px !important;
|
|
|
- position: relative;
|
|
|
- }
|
|
|
-
|
|
|
- .record:after {
|
|
|
- position: absolute;
|
|
|
- content: '';
|
|
|
- display: block;
|
|
|
- top: 5px;
|
|
|
- right: -2px;
|
|
|
- width: 1px;
|
|
|
- height: 12px;
|
|
|
- background: #e9ecf7;
|
|
|
- }
|
|
|
-
|
|
|
- /deep/.el-radio-button:first-child .el-radio-button__inner {
|
|
|
- margin-left: 10px;
|
|
|
- }
|
|
|
-
|
|
|
- //分页
|
|
|
- .el-pagination {
|
|
|
- text-align: center;
|
|
|
- white-space: nowrap;
|
|
|
- padding: 2px 5px;
|
|
|
- color: #303133;
|
|
|
- font-weight: 700;
|
|
|
- margin-bottom: 20px;
|
|
|
- }
|
|
|
-
|
|
|
- .main_css {
|
|
|
- height: calc(100% - 40px);
|
|
|
- }
|
|
|
-
|
|
|
- //打印弹窗
|
|
|
- .mask {
|
|
|
- background: black;
|
|
|
- width: 100vw;
|
|
|
- height: 100vh;
|
|
|
- position: fixed;
|
|
|
- top: 0;
|
|
|
- z-index: 99;
|
|
|
- opacity: 0.3;
|
|
|
- }
|
|
|
-
|
|
|
- .count {
|
|
|
- text-align: center;
|
|
|
- margin-bottom: 10px;
|
|
|
- }
|
|
|
-
|
|
|
- .print-type {
|
|
|
- position: absolute;
|
|
|
- top: 0;
|
|
|
- bottom: 0;
|
|
|
- left: 0;
|
|
|
- right: 0;
|
|
|
- margin: auto;
|
|
|
- width: 340px;
|
|
|
- height: 400px;
|
|
|
- background: white;
|
|
|
- border-radius: 10px;
|
|
|
- z-index: 999;
|
|
|
-
|
|
|
- .bottom-btn {
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .print-type-title {
|
|
|
- text-align: center;
|
|
|
- font-size: 18px;
|
|
|
- // margin: 20px;
|
|
|
- margin: 20px 20px 10px;
|
|
|
- }
|
|
|
-
|
|
|
- .print-type-checkbox {
|
|
|
- padding-left: 20px;
|
|
|
-
|
|
|
- .el-date-editor.el-input {
|
|
|
- width: 85% !important;
|
|
|
- }
|
|
|
-
|
|
|
- .proportion_css {
|
|
|
- width: 85%;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .page2-content {
|
|
|
- border: 1px solid #d8dce6;
|
|
|
- margin-top: 20px;
|
|
|
- padding: 10px;
|
|
|
- box-sizing: border-box;
|
|
|
- text-align: center;
|
|
|
- border-radius: 4px;
|
|
|
- padding-bottom: 20px;
|
|
|
- }
|
|
|
+/deep/.el-table .el-table__header .cell,
|
|
|
+/deep/.el-table td {
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+.title {
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+
|
|
|
+.title::before {
|
|
|
+ content: '';
|
|
|
+ display: inline-block;
|
|
|
+ width: 5px;
|
|
|
+ height: 30px;
|
|
|
+ background: #5473e8;
|
|
|
+ position: absolute;
|
|
|
+ top: 16px;
|
|
|
+}
|
|
|
+.top_title {
|
|
|
+ font-size: 20px;
|
|
|
+ font-weight: 600;
|
|
|
+ margin-left: 20px;
|
|
|
+}
|
|
|
+.bg-right {
|
|
|
+ padding-right: 10px;
|
|
|
+ text-align: right;
|
|
|
+}
|
|
|
+
|
|
|
+.bg-bottom {
|
|
|
+ margin: 15px 0px;
|
|
|
+}
|
|
|
+.bg-left,
|
|
|
+.bg-right {
|
|
|
+ background: #f6f7fc;
|
|
|
+ line-height: 60px;
|
|
|
+}
|
|
|
+/deep/.top_select .el-input{
|
|
|
+ width: 220px;
|
|
|
+}
|
|
|
</style>
|