123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- <template>
- <view class="content">
- <u-form :model="queryData" ref="uForm">
- <u-row>
- <u-col span="5">
- <u-form-item label="库区名称" label-width="80px">
- <u--input placeholder="请输入库区名称" border="surround" v-model="queryData.orgName" />
- </u-form-item>
- </u-col>
- <u-col span="5">
- <u-form-item label="计划类型" label-width="80px">
- <uni-data-select placeholder="请选择计划类型" v-model="queryData.planType" :localdata="range" />
- </u-form-item>
- </u-col>
- <u-col span="2">
- <u-form-item>
- <u-button type="primary" @click="getTableData">查询</u-button>
- <u-button type="info" @click="reset">重置</u-button>
- </u-form-item>
- </u-col>
- </u-row>
- </u-form>
- <view class="tableBox">
- <uni-table border stripe emptyText="暂无更多数据" :loading="this.loading">
- <!-- 表头行 -->
- <uni-tr>
- <uni-th align="center" width="60">序号</uni-th>
- <uni-th align="center">当日日期</uni-th>
- <uni-th align="center">库区名称</uni-th>
- <uni-th align="center">仓房名称</uni-th>
- <uni-th align="center">计划类型</uni-th>
- <uni-th align="center">计划数量</uni-th>
- <uni-th align="center">完成数量</uni-th>
- <uni-th align="center">计划完成百分比</uni-th>
- <uni-th align="center" width="80">操作</uni-th>
- </uni-tr>
- <uni-tr v-for="(item,index) in tableData" :key="item.id">
- <uni-td align="center" width="60">{{index + 1}}</uni-td>
- <uni-td align="center">{{item.currentDate}}</uni-td>
- <uni-td align="center">{{item.orgName}}</uni-td>
- <uni-td align="center">{{item.storehouseName}}</uni-td>
- <uni-td align="center">{{filtrationData(item.planType)}}</uni-td>
- <uni-td align="center">{{item.planQuantity}}</uni-td>
- <uni-td align="center">{{item.completedQuantity}}</uni-td>
- <uni-td align="center">{{percentile(item.completedQuantity,item.planQuantity)}}</uni-td>
- <uni-td align="center">
- <u-button size='mini' type='primary' @click="lookDetails(item)">查看</u-button>
- </uni-td>
- </uni-tr>
- </uni-table>
- <uni-pagination show-icon="true" :total="queryData.total" :current="queryData.current"
- @change="changePage" />
- </view>
- </view>
- </template>
- <script>
- import * as api from "@/api/statisticalQuery.js"
- export default {
- data() {
- return {
- queryData: {
- total: 0,
- size: 10,
- current: 1,
- },
- loading: false,
- tableData: [],
- range: [{
- "value": 1,
- "text": "粮食轮换计划"
- }, {
- "value": 2,
- "text": "油料轮换计划"
- }]
- }
- },
- onLoad() {
- this.getTableData()
- },
- methods: {
- getTableData() {
- this.loading = true
- api.findCurrentPlanPage(this.queryData).then(res => {
- this.tableData = res.data.records
- this.queryData.total = res.data.total
- this.loading = false
- })
- },
- lookDetails(data) {
- uni.navigateTo({
- url: `/pages/queryStatistics/todayInfo/details?id=${data.id}&warehouseId=${data.warehouseId}`
- })
- },
- filtrationData(code) {
- let str = ''
- this.range.map(item => {
- if (code == item.value) {
- str = item.text
- }
- })
- return str
- },
- percentile(val1, val2) {
- let num = ''
- num = (val1 / val2) * 100 + '%'
- return num
- },
- changePage(page) {
- this.queryData.current = page.current
- this.getTableData()
- },
- reset() {
- this.queryData = {
- total: 0,
- size: 10,
- current: 1,
- }
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .content {
- margin: 10px 20px;
- /deep/.u-form {
- margin-bottom: 20px;
- .u-form-item {
- .u-input {
- margin-right: 10px;
- }
- .uni-select {
- height: 38px;
- font-size: 15px;
- color: #303133;
- .uni-select__input-placeholder {
- font-size: 15px;
- color: #c1c4cc;
- }
- }
- .u-button {
- width: 80px;
- height: 35px;
- margin: 0 5px;
- }
- }
- }
- .tableBox {
- .uni-table {
- .uni-table-td {
- .u-button {
- width: 60px;
- float: left;
- margin: 0 5px;
- }
- }
- }
- .uni-pagination {
- float: right;
- margin: 10px 0;
- }
- }
- }
- </style>
|