From d33eacc1f85ac3a736b33ba4713a19aae466d711 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期五, 05 八月 2022 16:42:53 +0800
Subject: [PATCH] 1.做适应平板显示的内容大小
---
src/views/zzmx/chda.vue | 145 +++++++++++++++++++++++++++++++++++++++++------
1 files changed, 125 insertions(+), 20 deletions(-)
diff --git a/src/views/zzmx/chda.vue b/src/views/zzmx/chda.vue
index 8a2f8b8..ce61cde 100644
--- a/src/views/zzmx/chda.vue
+++ b/src/views/zzmx/chda.vue
@@ -80,7 +80,25 @@
<el-divider />
<div style="margin-left: 10px;display: flex">
<el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
- <el-button type="primary" icon="el-icon-office-building" @click="office">鍗曚綅</el-button>
+ <!-- <el-button type="primary" icon="el-icon-office-building" @click="office">鍗曚綅</el-button>-->
+ <el-button
+ type="primary"
+ icon="el-icon-refresh-right"
+ @click="syncSeaveSearchUnit"
+ >鍚屾璁¢噺鍗曚綅
+ </el-button>
+ <el-button
+ type="primary"
+ icon="el-icon-refresh-right"
+ @click="syncInventoryFileSelect"
+ >鍚屾瀛樿揣妗f
+ </el-button>
+ <el-button
+ type="primary"
+ icon="el-icon-refresh-right"
+ @click="syncStockTypeSelect"
+ >鍚屾瀛樿揣绫诲瀷
+ </el-button>
<!-- <el-button type="primary" icon="el-icon-upload2" @click="upload">瀵煎叆</el-button>-->
</div>
<el-divider />
@@ -104,14 +122,17 @@
prop="RowNum"
width="50"
label="搴忓彿"
+ fixed
/>
<el-table-column
prop="partcode"
label="鐗╂枡缂栫爜"
+ min-width="160"
sortable="custom"
/>
<el-table-column
prop="partname"
+ min-width="160"
label="鐗╂枡鍚嶇О"
sortable="custom"
/>
@@ -131,6 +152,7 @@
prop="stocktypename"
label="瀛樿揣绫诲瀷"
sortable="custom"
+ min-width="110"
/>
<!-- <el-table-column-->
<!-- prop="materialtypename"-->
@@ -141,6 +163,7 @@
prop="stck_name"
label="浠撳簱鍚嶇О"
sortable="custom"
+ min-width="110"
/>
<el-table-column
prop="maxqty"
@@ -174,12 +197,14 @@
<template slot-scope="{row}">
<div class="operationClass">
<i v-if="row.proute_id==='Y'" class="el-icon-share" @click="routeClick(row)" />
- <i v-if="row.proute_id==='N'" style="color: #E4E7ED" class="el-icon-share" @click="routeClick(row)" />
+ <i v-if="row.proute_id==='N'" style="color:rgb(180 ,181, 185)" class="el-icon-share" @click="routeClick(row)" />
</div>
</template>
</el-table-column>
<el-table-column
label="鎿嶄綔"
+ fixed="right"
+ width="120"
>
<template slot-scope="{row}">
<div class="operationClass">
@@ -439,7 +464,7 @@
:visible.sync="dialogVisibleRoute"
width="800px"
top="15vh"
- :fullscreen="isFullscreen"
+ :fullscreen="isIpad"
class="dialogVisibleRoute"
@closed="handleCloseRoute"
@close="handleCloseRoute"
@@ -496,11 +521,11 @@
<div style="margin-bottom: 10px">
<i class="el-icon-s-operation" style="color:#42b983;" /> 宸ュ簭鍒楄〃
</div>
- <div style="height: 400px;overflow-y: scroll">
+ <div style="overflow-y: scroll">
<el-table
:data="projectTableData"
border
- height="300"
+ height="280"
highlight-current-row
:header-cell-style="this.$headerCellStyle"
:cell-style="this.$cellStyle"
@@ -542,11 +567,6 @@
<script>
import Pagination from '@/components/Pagination'
-import {
- AddUpdateOrganization,
- DeleteOrganization
-} from '@/api/jcsz'
-import { getCookie } from '@/utils/auth'
import { WareHouseSelect } from '@/api/wlgl'
import {
AddUpdateInventoryFile, DeleteInventoryFile, InventoryFileAssociationRoute,
@@ -558,6 +578,7 @@
UomSearch, UomSelect
} from '@/api/zzmx'
import $ from 'jquery'
+import { SeaveSearchInventory, SeaveSearchInventoryClass, SeaveSearchUnit } from '@/api/ErpSyncMes'
const SER_HZ = /^[\u4e00-\u9fa5]+$/
export default {
@@ -578,7 +599,7 @@
}
}
return {
- isFullscreen: false,
+ isIpad: false,
mainHeight: 0,
tableHeight: 0,
form: {
@@ -623,9 +644,9 @@
materialname: [
{ required: true, message: '璇疯緭鍏ョ墿鏂欏悕绉�', trigger: ['blur', 'change'] }
],
- materialspec: [
- { required: true, message: '璇疯緭鍏ョ墿鏂欒鏍�', trigger: ['blur', 'change'] }
- ],
+ // materialspec: [//鐗╂枡瑙勬牸鏆傛椂鏀逛负闈炲繀濉�
+ // { required: true, message: '璇疯緭鍏ョ墿鏂欒鏍�', trigger: ['blur', 'change'] }
+ // ],
uomcode: [
{ required: true, message: '璇烽�夋嫨浣跨敤鍗曚綅', trigger: ['blur', 'change'] }
],
@@ -673,19 +694,98 @@
}
},
created() {
- this.getInventoryFileSelect()
- this.getStockTypeSelect()
- this.getWareHouseSelect()
+ this.handleRequest()
},
mounted() {
window.addEventListener('resize', this.getHeight)
this.getHeight()
},
methods: {
+ handleRequest() {
+ this.getInventoryFileSelect().then(res => {
+ if (res.code === '200') {
+ this.getStockTypeSelect()
+ this.getWareHouseSelect()
+ }
+ })
+ },
+
+ // 鍚屾璁¢噺鍗曚綅
+ async syncSeaveSearchUnit() {
+ const loading = this.$loading({
+ lock: true,
+ text: '姝e湪鍚屾璁¢噺鍗曚綅锛岃绋嶇瓑...',
+ spinner: 'el-icon-loading',
+ customClass: 'osloading',
+ background: 'rgba(0, 0, 0, 0.7)'
+ })
+ const res = await SeaveSearchUnit()
+ if (res.code === '200') {
+ setTimeout(() => {
+ // this.getInventoryFileSelect()
+ this.officeTableData = res.data
+ console.log(this.officeTableData, 9)
+ loading.close()
+ this.$message.success('鍚屾鎴愬姛锛�')
+ }, 2000)
+ } else {
+ setTimeout(() => {
+ loading.close()
+ this.$message.error('鍚屾澶辫触锛�')
+ }, 10000)
+ }
+ },
+ // 鍚屾瀛樿揣妗f
+ async syncInventoryFileSelect() {
+ const loading = this.$loading({
+ lock: true,
+ text: '姝e湪鍚屾瀛樿揣妗f锛岃绋嶇瓑...',
+ spinner: 'el-icon-loading',
+ customClass: 'osloading',
+ background: 'rgba(0, 0, 0, 0.7)'
+ })
+ const res = await SeaveSearchInventory()
+ if (res.code === '200') {
+ setTimeout(() => {
+ this.getInventoryFileSelect()
+ loading.close()
+ this.$message.success('鍚屾鎴愬姛锛�')
+ }, 2000)
+ } else {
+ setTimeout(() => {
+ loading.close()
+ this.$message.error('鍚屾澶辫触锛�')
+ }, 10000)
+ }
+ },
+ // 鍚屾瀛樿揣绫诲瀷
+ async syncStockTypeSelect() {
+ const loading = this.$loading({
+ lock: true,
+ text: '姝e湪鍚屾瀛樿揣绫诲瀷锛岃绋嶇瓑...',
+ spinner: 'el-icon-loading',
+ customClass: 'osloading',
+ background: 'rgba(0, 0, 0, 0.7)'
+ })
+ const res = await SeaveSearchInventoryClass()
+ if (res.code === '200') {
+ setTimeout(() => {
+ this.getStockTypeSelect()
+ loading.close()
+ this.$message.success('鍚屾鎴愬姛锛�')
+ }, 2000)
+ } else {
+ setTimeout(() => {
+ loading.close()
+ this.$message.error('鍚屾澶辫触锛�')
+ }, 10000)
+ }
+ },
async getInventoryFileSelect() {
const res = await InventoryFileSelect(this.form)
this.tableData = res.data
this.total = res.count
+ return { code: res.code }
},
async getStockTypeSelect() {
const { data: res } = await StockTypeSelect()
@@ -766,6 +866,7 @@
this.dialogForm.minstockqty = row.maxqty
this.dialogForm.maxstockqty = row.minqty
})
+ await this.getuomSelect()
},
// 鍒犻櫎鎸夐挳
async del(row) {
@@ -803,6 +904,10 @@
},
// 瀵硅瘽妗嗙‘璁�
dialogVisibleConfirm() {
+ if (this.defaultroute_codeArr.length > 0 && this.defaultroute_code === '') {
+ return this.$message.info('榛樿宸ヨ壓璺嚎涓嶈兘涓虹┖锛�')
+ }
+
this.$refs.dialogForm.validate(valid => {
if (valid) {
const data = {
@@ -834,11 +939,11 @@
getHeight() {
this.$nextTick(() => {
this.mainHeight = window.innerHeight - 250
- this.tableHeight = this.mainHeight - 100
- // this.isFullscreen = window.innerHeight < 800
- if (window.innerHeight < 800) {
+ this.tableHeight = this.mainHeight - 50
+ if (window.innerHeight < 769) {
this.tableHeight = this.tableHeight - 50
}
+ this.isIpad = window.innerHeight < 769 && window.innerWidth < 1367
})
},
/* 鐐瑰嚮鍏宠仈宸ヨ壓璺嚎妯″潡*/
--
Gitblit v1.9.3