Commit 9f327fb46e36e3eb6e098a14fc3758e8dfab6924

Authored by 肖超群
1 parent f3008be0

增加合计功能

ant-design-vue-jeecg/src/api/api.js
... ... @@ -167,6 +167,8 @@ export const inventoryPort = (params) => postAction('/cycleCountDetail/cycleCoun
167 167 export const createEmptyIn = (params) => postAction('/task/taskHeader/createEmptyIn', params);
168 168 //创建空托盘出库任务
169 169 export const createEmptyOut = (params) => postAction('/task/taskHeader/createEmptyOut', params);
  170 +//选择空托盘出库整出口
  171 +export const selectEmptyOutPort = (params) => postAction('/task/taskHeader/selectEmptyOutPort', params);
170 172 //选择出库整出口
171 173 export const selectOutPort = (params) => postAction('/task/taskHeader/selectOutPort', params);
172 174 //选择出库分拣口
... ... @@ -191,6 +193,8 @@ export const confirmGapQty = (params) => postAction('/cycleCountDetail/cycleCoun
191 193 export const createManyEmptyIn = (params) => postAction('/task/taskHeader/createManyEmptyIn', params);
192 194 //创建空托盘组出库任务
193 195 export const createManyEmptyOut = (params) => postAction('/task/taskHeader/createManyEmptyOut', params);
  196 +//批量创建空托盘组出库任务
  197 +export const batchCreateEmptyOut = (params) => postAction('/task/taskHeader/batchCreateEmptyOut', params);
194 198 //获取容器打印数据
195 199 export const getPrintContainer = (params) => postAction('/config/container/getPrintContent?ids=' + params, params);
196 200 //获取库位打印数据
... ...
ant-design-vue-jeecg/src/components/jeecgbiz/Pagination.vue 0 → 100644
  1 +<template>
  2 + <a-pagination
  3 + v-model="current"
  4 + :page-size-options="pageSizeOptions"
  5 + :total="total"
  6 + show-size-changer
  7 + :page-size="pageSize"
  8 + @showSizeChange="onShowSizeChange"
  9 + :show-total="(total, range) => `${range[0]}-${range[1]} 共 ${total} 条`"
  10 + >
  11 + </a-pagination>
  12 +</template>
  13 +
  14 +<script>
  15 +export default {
  16 + props: {
  17 + total: {
  18 + type: Number,
  19 + default: 0,
  20 + },
  21 + pageSizeOptions: {
  22 + type: Array,
  23 + default() {
  24 + return ['10', '20', '50', '100']
  25 + },
  26 + },
  27 + },
  28 + data() {
  29 + return {
  30 + pageSize: 10,
  31 + current: 1,
  32 + }
  33 + },
  34 + mounted() {},
  35 + methods: {
  36 + onShowSizeChange(current, pageSize) {
  37 + this.pageSize = pageSize
  38 + this.current = current
  39 + this.$emit('onShowSizeChange', current, pageSize)
  40 + },
  41 + },
  42 + watch: {
  43 + current(val) {
  44 + this.$emit('onShowSizeChange', val, this.pageSize)
  45 + },
  46 + },
  47 +}
  48 +</script>
  49 +
  50 +<style scoped>
  51 +.ant-pagination {
  52 + text-align: right !important;
  53 + margin-top: 20px !important;
  54 +}
  55 +</style>
0 56 \ No newline at end of file
... ...
ant-design-vue-jeecg/src/views/system/inventory/SimpleInventoryDetailList.vue
... ... @@ -162,11 +162,19 @@
162 162 class="j-table-force-nowrap"
163 163 :columns="columns"
164 164 :dataSource="dataSource"
165   - :pagination="ipagination"
  165 + :pagination="false"
166 166 :loading="loading"
167 167 :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
168 168 @change="handleTableChange"
169 169 >
  170 +
  171 + <span slot="action" slot-scope="text, record">
  172 + <span v-if="record.id == '合计'"></span>
  173 + <span v-else>
  174 + <a @click="handleDetail(record)">详情</a>
  175 + </span>
  176 + </span>
  177 +
170 178 <span slot="containerStatus_dictText" slot-scope="containerStatus_dictText">
171 179 <a-tag :key="containerStatus_dictText" :color="getStatusColor(containerStatus_dictText)">
172 180 {{ containerStatus_dictText }}
... ... @@ -222,6 +230,17 @@
222 230 </a-popconfirm>
223 231 </span>
224 232 </a-table>
  233 +
  234 + <!-- 页面使用分页组件 -->
  235 + <Pagination
  236 + v-model="ipagination.current"
  237 + :total="ipagination.total"
  238 + show-size-changer
  239 + :page-size="ipagination.pageSize"
  240 + @onShowSizeChange="onShowSizeChange"
  241 + :pageSizeOptions="ipagination.pageSizeOptions"
  242 + ></Pagination>
  243 +
225 244 </div>
226 245  
227 246 <simple-inventory-detail-modal ref="modalForm" @ok="modalFormOk"></simple-inventory-detail-modal>
... ... @@ -237,9 +256,11 @@ import {JeecgListMixin} from &#39;@/mixins/JeecgListMixin&#39;
237 256 import SimpleInventoryDetailModal from './modules/SimpleInventoryDetailModal'
238 257 import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
239 258 import {getCompanyList, getZoneList,} from "@api/api";
240   -import {postAction} from '@/api/manage'
  259 +import {getAction, postAction} from '@/api/manage'
241 260 import QuickShipmentDetailModal from "@views/system/shipment/modules/QuickShipmentDetailModal";
242 261 import QualityInventoryDetailModal from "@views/system/inventory/modules/QualityInventoryDetailModal";
  262 +import Pagination from '@/components/jeecgbiz/Pagination'
  263 +import ellipsis from "@comp/Ellipsis"; //引入 Pagination组件
243 264  
244 265 export default {
245 266 name: 'SimpleInventoryDetailList',
... ... @@ -247,10 +268,15 @@ export default {
247 268 components: {
248 269 QualityInventoryDetailModal,
249 270 QuickShipmentDetailModal,
  271 + Pagination,
250 272 SimpleInventoryDetailModal
251 273 },
252 274 data() {
253 275 return {
  276 + newArr: [],
  277 + newDataSource: [],
  278 + initDateSource: [],
  279 + initPageSize: 10,
254 280 zoneList: [],
255 281 zoneOptions: [],
256 282 companyList: [],
... ... @@ -264,13 +290,16 @@ export default {
264 290 dataIndex: 'id',
265 291 // fixed: "left",
266 292 // width: 100,
  293 + customRender: function (text, r, index) {
  294 + return text !== '合计' ? parseInt(index) + 1 : text
  295 + },
267 296 },
268 297 {
269 298 title: '货主',
270 299 align: 'center',
271 300 dataIndex: 'companyCode',
272 301 key: 'companyCode',
273   - scopedSlots: {customRender: 'companyCode'}
  302 + scopedSlots: {customRender: 'companyCode'},
274 303 },
275 304 {
276 305 title: '库区',
... ... @@ -410,14 +439,14 @@ export default {
410 439 align: 'center',
411 440 dataIndex: 'updateTime'
412 441 },
413   - // {
414   - // title: '操作',
415   - // dataIndex: 'action',
416   - // align: 'center',
417   - // fixed: 'right',
418   - // width: 147,
419   - // scopedSlots: {customRender: 'action'}
420   - // }
  442 + {
  443 + title: '操作',
  444 + dataIndex: 'action',
  445 + align: 'center',
  446 + fixed: 'right',
  447 + width: 147,
  448 + scopedSlots: {customRender: 'action'}
  449 + }
421 450 ],
422 451 url: {
423 452 list: '/inventory/inventoryDetail/list',
... ... @@ -435,6 +464,8 @@ export default {
435 464 }
436 465 },
437 466 created() {
  467 + this.initPageSize = this.ipagination.pageSize
  468 + this.loadData()
438 469 this.loadFrom()
439 470 this.getSuperFieldList()
440 471 },
... ... @@ -459,6 +490,63 @@ export default {
459 490 }
460 491 },
461 492 methods: {
  493 + loadData(arg) {
  494 + if (!this.url.list) {
  495 + this.$message.error('请设置url.list属性!')
  496 + return
  497 + }
  498 + //加载数据 若传入参数1则加载第一页的内容
  499 + if (arg === 1) {
  500 + this.ipagination.current = 1
  501 + }
  502 + //设置请求的条数为初始值
  503 + this.ipagination.pageSize = this.initPageSize
  504 + var params = this.getQueryParams() //查询条件
  505 + this.loading = true
  506 + getAction(this.url.list, params).then((res) => {
  507 + if (res.success) {
  508 + this.initDateSource = res.result.records || res.result
  509 + this.newDataSource = res.result.records || res.result
  510 + this.dataHandling()
  511 + if (res.result.total) {
  512 + this.ipagination.total = res.result.total
  513 + } else {
  514 + this.ipagination.total = 0
  515 + }
  516 + }
  517 + if (res.code === 510) {
  518 + this.$message.warning(res.message)
  519 + }
  520 + this.loading = false
  521 + })
  522 + },
  523 + /*如果分页走这个方法*/
  524 + dataHandling() {
  525 + //动态新增每页条数
  526 + this.ipagination.pageSize = this.initPageSize + 1
  527 + this.newArr = []
  528 + var arrs = this.newDataSource
  529 + if (arrs.length > 0) {
  530 + let item = {}
  531 + item.id = '合计'
  532 + var qty = 0
  533 + for (let i = 0; i < arrs.length; i++) {
  534 + qty += arrs[i].qty
  535 + }
  536 + item.qty = qty
  537 + this.newDataSource.push(item)
  538 + }
  539 + this.dataSource = Object.values(this.newDataSource)
  540 + },
  541 + // 分页改变时调用组件里的方法
  542 + onShowSizeChange(current, pageSize) {
  543 + this.ipagination.current = current
  544 + this.ipagination.pageSize = pageSize
  545 + //调整每页请求数值
  546 + this.initPageSize = this.ipagination.pageSize
  547 + this.loadData()
  548 + },
  549 +
462 550 handleTableChange(pagination, filters, sorter) {
463 551 //分页、排序、筛选变化时触发
464 552 if (Object.keys(sorter).length > 0) {
... ... @@ -506,7 +594,7 @@ export default {
506 594 this.zoneOptions.splice(0, 1);
507 595 for (let i = 0; i < res.result.length; i++) {
508 596 this.zoneOptions.push({value: res.result[i].code, text: res.result[i].name})
509   - this.columns[2].filters.push({value: res.result[i].code,text:res.result[i].name})
  597 + // this.columns[2].filters.push({value: res.result[i].code,text:res.result[i].name})
510 598 }
511 599 }, 500)
512 600 }
... ...
ant-design-vue-jeecg/src/views/system/task/modules/BatchEmptyOutTaskModal.vue 0 → 100644
  1 +<template>
  2 + <j-modal
  3 + :title="title"
  4 + :width="width"
  5 + :visible="visible"
  6 + :confirmLoading="confirmLoading"
  7 + switchFullscreen
  8 + @ok="handleOk"
  9 + @cancel="handleCancel"
  10 + cancelText="关闭">
  11 + <a-spin :spinning="confirmLoading">
  12 + <a-form-model ref="form" :model="model" :rules="validatorRules">
  13 + <a-row>
  14 + <a-col :span="24">
  15 + <a-form-model-item label="库区" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zoneCode">
  16 + <a-select
  17 + show-search
  18 + placeholder="请选择库区"
  19 + option-filter-prop="children"
  20 + @change="getPortList"
  21 + v-model="model.zoneCode">
  22 + <a-select-option v-for="item in zoneList" :key="item.name" :value="item.code">{{
  23 + item.name
  24 + }}
  25 + </a-select-option>
  26 + </a-select>
  27 + </a-form-model-item>
  28 + </a-col>
  29 + <a-col :span="24">
  30 + <a-form-model-item label="出库口" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toPortCode">
  31 + <a-select
  32 + show-search
  33 + placeholder="请选择出库口"
  34 + option-filter-prop="children"
  35 + v-model="model.toPortCode">
  36 + <a-select-option v-for="item in portList" :key="item.name" :value="item.code">{{
  37 + item.name
  38 + }}
  39 + </a-select-option>
  40 + </a-select>
  41 + </a-form-model-item>
  42 + </a-col>
  43 + <a-col :span="24">
  44 + <a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="number">
  45 + <a-input v-model="model.number" placeholder="请输入数量"></a-input>
  46 + </a-form-model-item>
  47 + </a-col>
  48 + </a-row>
  49 + </a-form-model>
  50 + </a-spin>
  51 + </j-modal>
  52 +</template>
  53 +
  54 +<script>
  55 +
  56 +import {httpAction} from '@/api/manage'
  57 +import {validateDuplicateValue} from '@/utils/util'
  58 +import {
  59 + batchCreateEmptyOut,
  60 + createEmptyOut,
  61 + getCompanyList, getCustomerList,
  62 + getShipmentTypeList,
  63 + getZoneList,
  64 + selectEmptyOutPort
  65 +} from '@/api/api'
  66 +import {selectOutPort} from '@/api/api'
  67 +import JSelectMultiEmptyContainer from "@comp/jeecgbiz/JSelectMultiEmptyContainer";
  68 +
  69 +export default {
  70 + name: "BatchEmptyOutTaskModal",
  71 + components: {JSelectMultiEmptyContainer},
  72 + data() {
  73 + return {
  74 + title: "操作",
  75 + width: 500,
  76 + portList: [],
  77 + zoneList: [],
  78 + querySource: {},
  79 + visible: false,
  80 + model: {},
  81 + labelCol: {
  82 + xs: {span: 24},
  83 + sm: {span: 5},
  84 + },
  85 + wrapperCol: {
  86 + xs: {span: 24},
  87 + sm: {span: 16},
  88 + },
  89 +
  90 + confirmLoading: false,
  91 + validatorRules: {
  92 + containerCode: [
  93 + {required: true, message: '请输入容器编码!'},
  94 + ],
  95 + toPortCode: [
  96 + {required: true, message: '请选择出库口!'},
  97 + ],
  98 + },
  99 + url: {
  100 + add: "/task/taskHeader/createEmptyOut",
  101 + }
  102 +
  103 + }
  104 + },
  105 + created() {
  106 + //备份model原始值
  107 + this.modelDefault = JSON.parse(JSON.stringify(this.model));
  108 + this.loadFrom();
  109 + },
  110 + methods: {
  111 + add() {
  112 + // $("select").change(function() { alert("选项已被改变"); console.log($('select').val());});
  113 + this.edit(this.modelDefault);
  114 + },
  115 + edit() {
  116 + // this.getPortList();
  117 + // this.model = Object.assign({}, record);
  118 + this.visible = true;
  119 + },
  120 + loadFrom() {
  121 + getZoneList().then((res) => {
  122 + if (res.success) {
  123 + this.zoneList = res.result
  124 + }
  125 + });
  126 + },
  127 + close() {
  128 + this.$emit('close');
  129 + this.visible = false;
  130 + this.$refs.form.clearValidate();
  131 + },
  132 + getPortList() {
  133 + this.querySource.zoneCode = this.model.zoneCode;
  134 + selectEmptyOutPort(this.querySource).then((res) => {
  135 + if (res.success) {
  136 + this.portList = res.result;
  137 + this.visible = true;
  138 + }
  139 + });
  140 + },
  141 + handleOk() {
  142 + const that = this;
  143 + // 触发表单验证
  144 + this.$refs.form.validate(valid => {
  145 + if (valid) {
  146 + that.confirmLoading = true;
  147 + batchCreateEmptyOut(this.model).then((res) => {
  148 + if (res.success) {
  149 + that.$message.success(res.message);
  150 + that.$emit('ok');
  151 + that.model.containerCode = '';
  152 + that.model.toPortCode = '';
  153 + } else {
  154 + that.$message.warning(res.message);
  155 + }
  156 + }).finally(() => {
  157 + that.confirmLoading = false;
  158 + that.close();
  159 + })
  160 + } else {
  161 + return false
  162 + }
  163 + })
  164 + },
  165 + handleCancel() {
  166 + this.close()
  167 + },
  168 +
  169 +
  170 + }
  171 +}
  172 +</script>
0 173 \ No newline at end of file
... ...