|
@@ -1,203 +1,203 @@
|
|
|
-<template>
|
|
|
- <el-dialog
|
|
|
- title="接收物料"
|
|
|
- width="1200px"
|
|
|
- :append-to-body="true"
|
|
|
- :visible.sync="isVisible"
|
|
|
- class="tenant-view"
|
|
|
- >
|
|
|
- <div>
|
|
|
- <!-- 列表数据 -->
|
|
|
- <el-table
|
|
|
- :key="tableKey"
|
|
|
- ref="table"
|
|
|
- v-loading="loading"
|
|
|
- :data="tableData.records"
|
|
|
- border
|
|
|
- fit
|
|
|
- row-key="id"
|
|
|
- style="width: 100%;"
|
|
|
- @selection-change="onSelectChange"
|
|
|
- @cell-click="cellClick"
|
|
|
- >
|
|
|
- <!-- 序号 -->
|
|
|
- <el-table-column :label='$t("common.serialNo")' width="55px" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <div>
|
|
|
- {{scope.$index+(queryParams.current - 1) * queryParams.size + 1}}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- CheckBox -->
|
|
|
- <el-table-column align="center" type="selection" width="50" :reserve-selection="true" />
|
|
|
- <el-table-column prop="furnaceBatchNo" label='原炉(批)号' :show-overflow-tooltip="true" width="150px"></el-table-column>
|
|
|
- <el-table-column prop="meterialCode" label='物料编码' :show-overflow-tooltip="true" width="200px"></el-table-column>
|
|
|
- <el-table-column prop="tradeMark" label='材料牌号' :show-overflow-tooltip="true" width="150px"></el-table-column>
|
|
|
- <el-table-column prop="heatNo" label='供应方名称' :show-overflow-tooltip="true" width="150px"></el-table-column>
|
|
|
- <el-table-column prop="meterialBatchNo" label='毛坯批号' :show-overflow-tooltip="true" width="150px"></el-table-column>
|
|
|
- <el-table-column prop="factoryDate" label='入厂日期' :show-overflow-tooltip="true" width="150px"></el-table-column>
|
|
|
- <el-table-column prop="batchStand" label='接收数量' :show-overflow-tooltip="true" width="150px"></el-table-column>
|
|
|
- <el-table-column prop="createUser" label='操作人员' :show-overflow-tooltip="true" width="150px"></el-table-column>
|
|
|
- <el-table-column prop="createTime" label='操作时间' :show-overflow-tooltip="true" width="150px"></el-table-column>
|
|
|
- <el-table-column prop="bomBatchNo" label='订单消耗数量' :show-overflow-tooltip="true" width="150px"></el-table-column>
|
|
|
- </el-table>
|
|
|
-
|
|
|
- <!-- 分页组件 -->
|
|
|
- <pagination
|
|
|
- v-show="tableData.total > 0"
|
|
|
- :limit.sync="queryParams.size"
|
|
|
- :page.sync="queryParams.current"
|
|
|
- :total="Number(tableData.total)"
|
|
|
- @pagination="fetch"
|
|
|
- />
|
|
|
-
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
-</template>
|
|
|
-<script>
|
|
|
- // 【分页】组件
|
|
|
- import Pagination from "@/components/Pagination"
|
|
|
- // 【原材料管理】-API
|
|
|
- import MaterialApi from "@/api/prepareProductMgr/material"
|
|
|
- // 【原材料接收管理】-API
|
|
|
- import ReceiveApi from "@/api/prepareProductMgr/receive"
|
|
|
- // 【共通-工具】
|
|
|
- import { initQueryParams } from '@/utils/commons'
|
|
|
- export default {
|
|
|
- name: 'TenantView',
|
|
|
- components: { Pagination },
|
|
|
- props: {
|
|
|
- dialogVisible: {
|
|
|
- type: Boolean,
|
|
|
- default: false
|
|
|
- }
|
|
|
- },
|
|
|
- data () {
|
|
|
- return {
|
|
|
- screenWidth: 0,
|
|
|
- width: this.initWidth(),
|
|
|
- tenant: {},
|
|
|
- tableKey: 0,
|
|
|
- queryParams: initQueryParams({}),
|
|
|
- selection: [],
|
|
|
- loading: false,
|
|
|
- tableData: {
|
|
|
- total: 0
|
|
|
- },
|
|
|
- }
|
|
|
- },
|
|
|
- computed: {
|
|
|
- // 定义【可存储变量】
|
|
|
- isVisible: {
|
|
|
- get () {
|
|
|
- return this.dialogVisible
|
|
|
- },
|
|
|
- set () {
|
|
|
- this.close()
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- mounted () {
|
|
|
- // 页面大小变化,自动变化
|
|
|
- window.onresize = () => {
|
|
|
- return (() => {
|
|
|
- this.width = this.initWidth()
|
|
|
- })()
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- // 初始化页面的宽度
|
|
|
- initWidth () {
|
|
|
- this.screenWidth = document.body.clientWidth
|
|
|
- if (this.screenWidth < 550) {
|
|
|
- return '95%'
|
|
|
- } else if (this.screenWidth < 990) {
|
|
|
- return '580px'
|
|
|
- } else if (this.screenWidth < 1400) {
|
|
|
- return '600px'
|
|
|
- } else {
|
|
|
- return '650px'
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- // 接收来自其他组件的-函数
|
|
|
- setTenant (val) {
|
|
|
- this.tenant = { ...val }
|
|
|
- // 获取列表数据
|
|
|
- this.fetch();
|
|
|
- },
|
|
|
-
|
|
|
- // 【关闭】当前弹出框
|
|
|
- close () {
|
|
|
- this.$emit('close')
|
|
|
- },
|
|
|
-
|
|
|
- // checkbox选择-事件
|
|
|
- onSelectChange (selection) {
|
|
|
- this.selection = selection
|
|
|
- },
|
|
|
-
|
|
|
- // 分页列表
|
|
|
- fetch (params = {}) {
|
|
|
- this.loading = true
|
|
|
- if (this.queryParams.timeRange) {
|
|
|
- this.queryParams.map.createTime_st = this.queryParams.timeRange[0]
|
|
|
- this.queryParams.map.createTime_ed = this.queryParams.timeRange[1]
|
|
|
- }
|
|
|
- //
|
|
|
- this.queryParams.current = params.current ? params.current : this.queryParams.current
|
|
|
- this.queryParams.size = params.size ? params.size : this.queryParams.size
|
|
|
- // 搜索条件添加-材料的id
|
|
|
- this.queryParams.model.meterialId = this.tenant.id;
|
|
|
- ReceiveApi.page(this.queryParams).then(response => {
|
|
|
- const res = response.data
|
|
|
- if (res.isSuccess) {
|
|
|
- this.tableData = res.data
|
|
|
- }
|
|
|
- // eslint-disable-next-line no-return-assign
|
|
|
- }).finally(() => this.loading = false)
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- // Table的cell点击事件
|
|
|
- cellClick (row, column) {
|
|
|
- if (column['columnKey'] === "operation") {
|
|
|
- return
|
|
|
- }
|
|
|
- let flag = false
|
|
|
- this.selection.forEach((item) => {
|
|
|
- if (item.id === row.id) {
|
|
|
- flag = true
|
|
|
- this.$refs.table.toggleRowSelection(row)
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- if (!flag) {
|
|
|
- this.$refs.table.toggleRowSelection(row, true)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-</script>
|
|
|
-<style lang="scss" scoped>
|
|
|
-.tenant-view {
|
|
|
- .img-wrapper {
|
|
|
- text-align: center;
|
|
|
- margin-top: -1.5rem;
|
|
|
- margin-bottom: 10px;
|
|
|
- img {
|
|
|
- width: 4rem;
|
|
|
- border-radius: 50%;
|
|
|
- }
|
|
|
- }
|
|
|
- .view-item {
|
|
|
- margin: 7px;
|
|
|
- i {
|
|
|
- font-size: 0.97rem;
|
|
|
- }
|
|
|
- span {
|
|
|
- margin-left: 5px;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-</style>
|
|
|
+<template>
|
|
|
+ <el-dialog
|
|
|
+ title="接收物料"
|
|
|
+ width="1200px"
|
|
|
+ :append-to-body="true"
|
|
|
+ :visible.sync="isVisible"
|
|
|
+ class="tenant-view"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ <!-- 列表数据 -->
|
|
|
+ <el-table
|
|
|
+ :key="tableKey"
|
|
|
+ ref="table"
|
|
|
+ v-loading="loading"
|
|
|
+ :data="tableData.records"
|
|
|
+ border
|
|
|
+ fit
|
|
|
+ row-key="id"
|
|
|
+ style="width: 100%;"
|
|
|
+ @selection-change="onSelectChange"
|
|
|
+ @cell-click="cellClick"
|
|
|
+ >
|
|
|
+ <!-- 序号 -->
|
|
|
+ <el-table-column :label='$t("common.serialNo")' width="55px" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ {{scope.$index+(queryParams.current - 1) * queryParams.size + 1}}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- CheckBox -->
|
|
|
+ <el-table-column align="center" type="selection" width="50" :reserve-selection="true" />
|
|
|
+ <el-table-column prop="furnaceBatchNo" label='原炉(批)号' :show-overflow-tooltip="true" width="150px"></el-table-column>
|
|
|
+ <el-table-column prop="meterialCode" label='物料编码' :show-overflow-tooltip="true" width="200px"></el-table-column>
|
|
|
+ <el-table-column prop="tradeMark" label='材料牌号' :show-overflow-tooltip="true" width="150px"></el-table-column>
|
|
|
+ <el-table-column prop="factory" label='供应方名称' :show-overflow-tooltip="true" width="150px"></el-table-column>
|
|
|
+ <el-table-column prop="meterialBatchNo" label='毛坯批号' :show-overflow-tooltip="true" width="150px"></el-table-column>
|
|
|
+ <el-table-column prop="factoryDate" label='入厂日期' :show-overflow-tooltip="true" width="150px"></el-table-column>
|
|
|
+ <el-table-column prop="batchStand" label='接收数量' :show-overflow-tooltip="true" width="150px"></el-table-column>
|
|
|
+ <el-table-column prop="createUser" label='操作人员' :show-overflow-tooltip="true" width="150px"></el-table-column>
|
|
|
+ <el-table-column prop="createTime" label='操作时间' :show-overflow-tooltip="true" width="150px"></el-table-column>
|
|
|
+ <el-table-column prop="" label='订单消耗数量' :show-overflow-tooltip="true" width="150px"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <!-- 分页组件 -->
|
|
|
+ <pagination
|
|
|
+ v-show="tableData.total > 0"
|
|
|
+ :limit.sync="queryParams.size"
|
|
|
+ :page.sync="queryParams.current"
|
|
|
+ :total="Number(tableData.total)"
|
|
|
+ @pagination="fetch"
|
|
|
+ />
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+ // 【分页】组件
|
|
|
+ import Pagination from "@/components/Pagination"
|
|
|
+ // 【原材料管理】-API
|
|
|
+ import MaterialApi from "@/api/prepareProductMgr/material"
|
|
|
+ // 【原材料接收管理】-API
|
|
|
+ import ReceiveApi from "@/api/prepareProductMgr/receive"
|
|
|
+ // 【共通-工具】
|
|
|
+ import { initQueryParams } from '@/utils/commons'
|
|
|
+ export default {
|
|
|
+ name: 'TenantView',
|
|
|
+ components: { Pagination },
|
|
|
+ props: {
|
|
|
+ dialogVisible: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ screenWidth: 0,
|
|
|
+ width: this.initWidth(),
|
|
|
+ tenant: {},
|
|
|
+ tableKey: 0,
|
|
|
+ queryParams: initQueryParams({}),
|
|
|
+ selection: [],
|
|
|
+ loading: false,
|
|
|
+ tableData: {
|
|
|
+ total: 0
|
|
|
+ },
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ // 定义【可存储变量】
|
|
|
+ isVisible: {
|
|
|
+ get () {
|
|
|
+ return this.dialogVisible
|
|
|
+ },
|
|
|
+ set () {
|
|
|
+ this.close()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ // 页面大小变化,自动变化
|
|
|
+ window.onresize = () => {
|
|
|
+ return (() => {
|
|
|
+ this.width = this.initWidth()
|
|
|
+ })()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 初始化页面的宽度
|
|
|
+ initWidth () {
|
|
|
+ this.screenWidth = document.body.clientWidth
|
|
|
+ if (this.screenWidth < 550) {
|
|
|
+ return '95%'
|
|
|
+ } else if (this.screenWidth < 990) {
|
|
|
+ return '580px'
|
|
|
+ } else if (this.screenWidth < 1400) {
|
|
|
+ return '600px'
|
|
|
+ } else {
|
|
|
+ return '650px'
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 接收来自其他组件的-函数
|
|
|
+ setTenant (val) {
|
|
|
+ this.tenant = { ...val }
|
|
|
+ // 获取列表数据
|
|
|
+ this.fetch();
|
|
|
+ },
|
|
|
+
|
|
|
+ // 【关闭】当前弹出框
|
|
|
+ close () {
|
|
|
+ this.$emit('close')
|
|
|
+ },
|
|
|
+
|
|
|
+ // checkbox选择-事件
|
|
|
+ onSelectChange (selection) {
|
|
|
+ this.selection = selection
|
|
|
+ },
|
|
|
+
|
|
|
+ // 分页列表
|
|
|
+ fetch (params = {}) {
|
|
|
+ this.loading = true
|
|
|
+ if (this.queryParams.timeRange) {
|
|
|
+ this.queryParams.map.createTime_st = this.queryParams.timeRange[0]
|
|
|
+ this.queryParams.map.createTime_ed = this.queryParams.timeRange[1]
|
|
|
+ }
|
|
|
+ //
|
|
|
+ this.queryParams.current = params.current ? params.current : this.queryParams.current
|
|
|
+ this.queryParams.size = params.size ? params.size : this.queryParams.size
|
|
|
+ // 搜索条件添加-材料的id
|
|
|
+ this.queryParams.model.meterialId = this.tenant.id;
|
|
|
+ ReceiveApi.page(this.queryParams).then(response => {
|
|
|
+ const res = response.data
|
|
|
+ if (res.isSuccess) {
|
|
|
+ this.tableData = res.data
|
|
|
+ }
|
|
|
+ // eslint-disable-next-line no-return-assign
|
|
|
+ }).finally(() => this.loading = false)
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ // Table的cell点击事件
|
|
|
+ cellClick (row, column) {
|
|
|
+ if (column['columnKey'] === "operation") {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let flag = false
|
|
|
+ this.selection.forEach((item) => {
|
|
|
+ if (item.id === row.id) {
|
|
|
+ flag = true
|
|
|
+ this.$refs.table.toggleRowSelection(row)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ if (!flag) {
|
|
|
+ this.$refs.table.toggleRowSelection(row, true)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.tenant-view {
|
|
|
+ .img-wrapper {
|
|
|
+ text-align: center;
|
|
|
+ margin-top: -1.5rem;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ img {
|
|
|
+ width: 4rem;
|
|
|
+ border-radius: 50%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .view-item {
|
|
|
+ margin: 7px;
|
|
|
+ i {
|
|
|
+ font-size: 0.97rem;
|
|
|
+ }
|
|
|
+ span {
|
|
|
+ margin-left: 5px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|