forked from BaoKaiWms/202501-Wms-Kate-Wuxi
1. 回退goods.vue的代码
This commit is contained in:
parent
0244078642
commit
3a2386347b
|
|
@ -10,7 +10,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import {ref, reactive} from 'vue';
|
import {ref, reactive} from 'vue';
|
||||||
import {uploadExcelBaseGoods, uploadExcelInventoryRequest} from '@/api/excel.js'
|
import {uploadExcelInventoryRequest} from '@/api/excel.js'
|
||||||
import {ElMessage} from 'element-plus'
|
import {ElMessage} from 'element-plus'
|
||||||
import {errorBox} from '@/utils/myMessageBox';
|
import {errorBox} from '@/utils/myMessageBox';
|
||||||
import {sizeFormatter} from '@/utils/formatter.js'
|
import {sizeFormatter} from '@/utils/formatter.js'
|
||||||
|
|
|
||||||
|
|
@ -1,180 +1,105 @@
|
||||||
<template>
|
<template>
|
||||||
<el-config-provider :locale="zhCn">
|
<el-config-provider :locale="zhCn">
|
||||||
<el-container class="content">
|
<el-container class="content">
|
||||||
<div class="work-area">
|
<div class="work-area">
|
||||||
<fieldset class="search-area">
|
<fieldset class="search-area">
|
||||||
<el-form ref="searchQueryFormRef" :model="searchQueryFormEntity" :label-position="labelPosition"
|
<el-form ref="searchQueryFormRef" :model="searchQueryFormEntity" :label-position="labelPosition"
|
||||||
label-width="158px" style="max-width: 100%" status-icon>
|
label-width="158px" style="max-width: 100%" status-icon>
|
||||||
<div style="display: flex;justify-content: space-between;">
|
<div style="display: flex;justify-content: space-between;">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-form-item label="料号">
|
<el-form-item label="料号">
|
||||||
<el-input v-model="searchQueryFormEntity.goodsId" @keyup.enter="search()"
|
<el-input v-model="searchQueryFormEntity.goodsId" @keyup.enter="search()"
|
||||||
clearable />
|
clearable/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="描述">
|
<el-form-item label="描述">
|
||||||
<el-input v-model="searchQueryFormEntity.goodsDesc" @keyup.enter="search()"
|
<el-input v-model="searchQueryFormEntity.goodsDesc" @keyup.enter="search()"
|
||||||
clearable />
|
clearable/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div style="align-content: center;">
|
<div style="align-content: center;">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-button type="primary" class="btn-search" @click="search()">查询</el-button>
|
<el-button type="primary" class="btn-search" @click="search()">查询</el-button>
|
||||||
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
<el-row>
|
||||||
</div>
|
<el-button style="background-color: #00CED1;" class="btn-search"
|
||||||
</el-form>
|
@click="openUploadDialog()">导入数据
|
||||||
</fieldset>
|
</el-button>
|
||||||
<div class="table-area">
|
<el-button type="success" class="btn-search"
|
||||||
<el-table :data="tableData" stripe border v-loading="tableLoading" class="table-class"
|
@click="exportExcel()">导出excel
|
||||||
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow"
|
</el-button>
|
||||||
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
</el-row>
|
||||||
@sort-change="handleSortChange">
|
</div>
|
||||||
<el-table-column width="65px" fixed="left">
|
|
||||||
<template v-slot="scope">
|
|
||||||
<el-radio :label="scope.row.goodsId" v-model="goodsId"> </el-radio>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="goodsId" label="料号" fixed="left" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="goodsDescription" label="描述" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="plant" label="工厂" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="vendorName" label="供应商" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="isSled" label="SLED管理" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="sledDays" label="SLED天数" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="feedingType" label="补料类型" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="boxQty" label="每盒数量" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="maxBoxNum" label="最大盒数" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="putArea" label="存放区域" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="hotPoint" label="热点区域" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column fixed="right" label="操作" width="170px">
|
|
||||||
<template v-slot="scope">
|
|
||||||
<div style="display: inline-block; align-content: center;">
|
|
||||||
<el-button type="primary"
|
|
||||||
@click="editCurrentRowFormEntity(scope.row)">编辑</el-button>
|
|
||||||
<el-button type="danger" @click="closeGoods(scope.row)">关闭</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<br />
|
|
||||||
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
|
||||||
v-model:page-size="baseTableQuery.pageSize" :page-sizes="[10, 25, 50]" :small="false"
|
|
||||||
:disabled="false" :background="false" :default-page-size="10" @size-change="search"
|
|
||||||
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
|
||||||
:total="baseTableQuery.total" />
|
|
||||||
</div>
|
|
||||||
<el-dialog v-model="rowEditFlag" title="物料信息" width="60%" draggable :show-close="false">
|
|
||||||
<el-form ref="rowEditFormRef" :model="rowFormEntity" :label-position="labelPosition"
|
|
||||||
label-width="100px" style="max-width: 100%" status-icon>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="料号">
|
|
||||||
<el-input v-model="rowFormEntity.goodsId" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="描述">
|
|
||||||
<el-input v-model="rowFormEntity.goodsDescription" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="工厂">
|
|
||||||
<el-input v-model="rowFormEntity.plant" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="供应商">
|
|
||||||
<el-input v-model="rowFormEntity.vendorName" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="SLED管理">
|
|
||||||
<el-input v-model="rowFormEntity.isSled" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="SLED天数">
|
|
||||||
<el-input v-model="rowFormEntity.sledDays" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="补料类型">
|
|
||||||
<el-input v-model="rowFormEntity.feedingType" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<!-- 可编辑字段 -->
|
|
||||||
<el-divider>可编辑字段</el-divider>
|
|
||||||
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="每盒数量">
|
|
||||||
<el-input-number v-model="rowFormEntity.boxQty" controls-position="right"
|
|
||||||
:min="0" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="最大盒数">
|
|
||||||
<el-input-number v-model="rowFormEntity.maxBoxNum" controls-position="right"
|
|
||||||
:min="0" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="存放区域">
|
|
||||||
<el-input v-model="rowFormEntity.putArea" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="热点区域">
|
|
||||||
<el-input v-model="rowFormEntity.hotPoint" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<span class="dialog-footer">
|
|
||||||
<el-button type="primary" @click="rowEditFlag = false">取消</el-button>
|
|
||||||
<el-button type="success" @click="submitUpdateRow(rowFormEntity)">
|
|
||||||
确定
|
|
||||||
</el-button>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</el-container>
|
</el-form>
|
||||||
</el-config-provider>
|
</fieldset>
|
||||||
|
<div class="table-area">
|
||||||
|
<el-table :data="tableData" stripe border v-loading="tableLoading" class="table-class"
|
||||||
|
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow"
|
||||||
|
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
||||||
|
@sort-change="handleSortChange">
|
||||||
|
<el-table-column width="65px" fixed="left">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-radio :label="scope.row.goodsId" v-model="goodsId"> </el-radio>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="goodsId" label="料号" fixed="left" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="goodsDescription" label="描述" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="plant" label="工厂" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="vendorName" label="供应商" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="isSled" label="SLED管理" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="sledDays" label="SLED天数" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="feedingType" label="补料类型" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="boxQty" label="每盒数量" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="maxBoxNum" label="最大盒数" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="putArea" label="存放区域" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="hotPoint" label="热点区域" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
</el-table>
|
||||||
|
<br/>
|
||||||
|
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
||||||
|
v-model:page-size="baseTableQuery.pageSize" :page-sizes="[10, 25, 50]" :small="false"
|
||||||
|
:disabled="false" :background="false" :default-page-size="10" @size-change="search"
|
||||||
|
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="baseTableQuery.total"/>
|
||||||
|
</div>
|
||||||
|
<el-dialog v-model="showUploadDialog" title="上传物料信息" width="40%" draggable :show-close="true">
|
||||||
|
<fieldset class="search-area">
|
||||||
|
<legend>导入基础信息</legend>
|
||||||
|
<UploadExcelBaseGoods></UploadExcelBaseGoods>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset class="search-area">
|
||||||
|
<legend>导入看板信息</legend>
|
||||||
|
<UploadExcelKanban></UploadExcelKanban>
|
||||||
|
</fieldset>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</el-container>
|
||||||
|
</el-config-provider>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
import { getGoodsInfoByPage, updateGoodsInfo, closeGoodsInfo } from '@/api/goods.js'
|
import {getGoodsInfoByPage} from '@/api/goods.js'
|
||||||
import { timeFormatter, wmsTaskTypeFormatter, wmsTaskStatusFormatter } from '@/utils/formatter.js'
|
import {ref, reactive, onMounted, nextTick, onBeforeUnmount} from 'vue'
|
||||||
import { ref, reactive, onMounted, nextTick, onBeforeUnmount } from 'vue'
|
import {ElMessage} from 'element-plus'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import {genTableRequest} from '@/utils/generator.js'
|
||||||
import { genTableRequest } from '@/utils/generator.js'
|
import {labelPosition} from '@/constant/form.js'
|
||||||
import { labelPosition } from '@/constant/form.js'
|
import UploadExcelBaseGoods from '@/excel/UploadExcelBaseGoods.vue'
|
||||||
import { loading } from '@/utils/loading'
|
import UploadExcelKanban from '@/excel/UploadExcelKanban.vue'
|
||||||
|
import {exportGoodsExcel} from "@/api/excel";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 常量定义
|
* 常量定义
|
||||||
*/
|
*/
|
||||||
|
|
@ -187,247 +112,210 @@ let maxHeight = ref(window.innerHeight * 0.55)
|
||||||
let tableLoading = ref(false)
|
let tableLoading = ref(false)
|
||||||
let tableData = ref([])
|
let tableData = ref([])
|
||||||
let baseTableQuery = reactive({
|
let baseTableQuery = reactive({
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 0,
|
total: 0,
|
||||||
sortBy: new Map([['goodsId', true]]),// 按照料号顺序排序
|
sortBy: new Map([['goodsId', true]]),// 按照料号顺序排序
|
||||||
standId: STAND_ID,
|
standId: STAND_ID,
|
||||||
userName: USER_NAME
|
userName: USER_NAME
|
||||||
})
|
})
|
||||||
let searchQueryFormEntity = reactive({
|
let searchQueryFormEntity = reactive({
|
||||||
goodsId: '',
|
goodsId: '',
|
||||||
goodsDesc: ''
|
goodsDesc: ''
|
||||||
})
|
})
|
||||||
let searchQueryFormRef = ref()
|
let searchQueryFormRef = ref()
|
||||||
let rowEditFlag = ref(false)
|
let rowEditFlag = ref(false)
|
||||||
let goodsId = ''
|
let goodsId = ''
|
||||||
let rowEditFormRef = ref()
|
let rowEditFormRef = ref()
|
||||||
let rowFormEntity = reactive({})
|
let rowFormEntity = reactive({})
|
||||||
|
let showUploadDialog = ref(false)
|
||||||
/**
|
/**
|
||||||
* 系统方法
|
* 系统方法
|
||||||
*/
|
*/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
window.addEventListener('resize', resizeHeight)
|
window.addEventListener('resize', resizeHeight)
|
||||||
search()
|
search()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
window.removeEventListener('resize', resizeHeight)
|
window.removeEventListener('resize', resizeHeight)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
const resizeHeight = () => {
|
const resizeHeight = () => {
|
||||||
maxHeight.value = window.innerHeight * 0.55
|
maxHeight.value = window.innerHeight * 0.55
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 自定义方法
|
* 自定义方法
|
||||||
*/
|
*/
|
||||||
// 查询
|
// 查询
|
||||||
const search = () => {
|
const search = () => {
|
||||||
tableLoading.value = true
|
tableLoading.value = true
|
||||||
let request = genTableRequest(baseTableQuery)
|
let request = genTableRequest(baseTableQuery)
|
||||||
// 设定查询参数
|
// 设定查询参数
|
||||||
request.goodsId = searchQueryFormEntity.goodsId.trim()
|
request.goodsId = searchQueryFormEntity.goodsId.trim()
|
||||||
request.goodsDesc = searchQueryFormEntity.goodsDesc.trim()
|
request.goodsDesc = searchQueryFormEntity.goodsDesc.trim()
|
||||||
getGoodsInfoByPage(request).then((res) => {
|
getGoodsInfoByPage(request).then((res) => {
|
||||||
const response = res.data
|
const response = res.data
|
||||||
if (response.code == 0) {
|
if (response.code === 0) {
|
||||||
const data = response.data
|
const data = response.data
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
tableData.value = data.lists
|
tableData.value = data.lists
|
||||||
baseTableQuery.total = data.total
|
baseTableQuery.total = data.total
|
||||||
} else {
|
} else {
|
||||||
tableData.value = []
|
tableData.value = []
|
||||||
baseTableQuery.total = 0
|
baseTableQuery.total = 0
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(response.message)
|
ElMessage.error(response.message)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
ElMessage.error('查询数据异常。')
|
ElMessage.error('查询数据异常。')
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
tableLoading.value = false
|
tableLoading.value = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const clearQuery = () => {
|
const clearQuery = () => {
|
||||||
searchQueryFormEntity.goodsId = ''
|
searchQueryFormEntity.goodsId = ''
|
||||||
searchQueryFormEntity.goodsDesc = ''
|
searchQueryFormEntity.goodsDesc = ''
|
||||||
}
|
}
|
||||||
const handleSortChange = (data) => {
|
const handleSortChange = (data) => {
|
||||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||||
baseTableQuery.sortBy.delete(data.prop)
|
baseTableQuery.sortBy.delete(data.prop)
|
||||||
}
|
}
|
||||||
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
baseTableQuery.sortBy.set(data.prop, data.order.toLowerCase() === 'ascending')
|
||||||
search()
|
search()
|
||||||
|
}
|
||||||
|
const openUploadDialog = () => {
|
||||||
|
showUploadDialog.value = true
|
||||||
}
|
}
|
||||||
const getCurrentRow = (row) => {
|
const getCurrentRow = (row) => {
|
||||||
goodsId = row.goodsId
|
goodsId = row.goodsId
|
||||||
}
|
}
|
||||||
const timeFormat = (row, column, cellValue, index) => {
|
const exportExcel = () => {
|
||||||
return timeFormatter(cellValue)
|
const params = {
|
||||||
}
|
goodsId: searchQueryFormEntity.goodsId,
|
||||||
const taskTypeFormat = (row, column, cellValue, index) => {
|
goodsDesc: searchQueryFormEntity.goodsDesc,
|
||||||
return wmsTaskTypeFormatter(cellValue)
|
userName: USER_NAME
|
||||||
}
|
}
|
||||||
const taskStatusFormat = (row, column, cellValue, index) => {
|
exportGoodsExcel(params).then(res => {
|
||||||
return wmsTaskStatusFormatter(cellValue)
|
const link = document.createElement('a');//创建a标签
|
||||||
}
|
try {
|
||||||
// 编辑弹框
|
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||||
const editCurrentRowFormEntity = (row) => {
|
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||||
// 设置form值,复制所有字段
|
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
||||||
Object.assign(rowFormEntity, row)
|
let _fileName = '物料基础信息' + dateFormatter(new Date) + '.xlsx'
|
||||||
// 弹出框
|
link.style.display = 'none'//隐藏
|
||||||
rowEditFlag.value = true
|
|
||||||
}
|
// 兼容不同浏览器的URL对象
|
||||||
// 关闭物料
|
const url = window.URL || window.webkitURL || window.moxURL
|
||||||
const closeGoods = (row) => {
|
link.href = url.createObjectURL(blob)
|
||||||
ElMessageBox.confirm(`确定要关闭物料(${row.goodsId})吗?`, '提示', {
|
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
||||||
confirmButtonText: '确定',
|
document.body.appendChild(link)
|
||||||
cancelButtonText: '取消',
|
link.click()
|
||||||
type: 'warning'
|
document.body.removeChild(link)
|
||||||
}).then(() => {
|
url.revokeObjectURL(link.href)//移除url对象
|
||||||
const request = {
|
} catch (e) {
|
||||||
goodsId: row.goodsId,
|
console.log(e)
|
||||||
standId: STAND_ID,
|
ElMessage.error('下载文件失败')
|
||||||
userName: USER_NAME
|
|
||||||
};
|
|
||||||
loading.open('关闭中...');
|
|
||||||
closeGoodsInfo(request).then(res => {
|
|
||||||
const response = res.data;
|
|
||||||
if (response.code == 0) {
|
|
||||||
ElMessage.success(response.message);
|
|
||||||
search();
|
|
||||||
} else {
|
|
||||||
ElMessage.error(response.message);
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
ElMessage.error('请求异常。');
|
|
||||||
}).finally(() => {
|
|
||||||
loading.close();
|
|
||||||
});
|
|
||||||
}).catch(err => {
|
|
||||||
ElMessage.info('已取消关闭操作');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// 更新当前行数据
|
|
||||||
const submitUpdateRow = (rowFormEntity) => {
|
|
||||||
const request = {
|
|
||||||
goodsId: rowFormEntity.goodsId,
|
|
||||||
boxQty: rowFormEntity.boxQty,
|
|
||||||
maxBoxNum: rowFormEntity.maxBoxNum,
|
|
||||||
putArea: rowFormEntity.putArea,
|
|
||||||
hotPoint: rowFormEntity.hotPoint,
|
|
||||||
standId: STAND_ID,
|
|
||||||
userName: USER_NAME
|
|
||||||
}
|
}
|
||||||
loading.open('更新中...')
|
}).catch(err => {
|
||||||
updateGoodsInfo(request).then(res => {
|
console.log(err)
|
||||||
if (res.data.code == 0) {
|
ElMessage.error('导出失败')
|
||||||
ElMessage.success('更新数据成功。')
|
})
|
||||||
rowEditFlag.value = false
|
|
||||||
search()
|
|
||||||
} else {
|
|
||||||
ElMessage.error('更新数据失败。')
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
ElMessage.error('更新数据异常。')
|
|
||||||
}).finally(() => {
|
|
||||||
loading.close()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.content {
|
.content {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.work-area {
|
.work-area {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
/* padding: 5px; */
|
/* padding: 5px; */
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-area {
|
.search-area {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
min-height: fit-content;
|
min-height: fit-content;
|
||||||
max-height: 40%;
|
max-height: 40%;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
min-width: inherit;
|
min-width: inherit;
|
||||||
border: solid 1px;
|
border: solid 1px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
box-shadow: 0px 15px 10px -15px #000;
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-area {
|
.table-area {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
min-height: fit-content;
|
min-height: fit-content;
|
||||||
max-height: 60%;
|
max-height: 60%;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
min-width: inherit;
|
min-width: inherit;
|
||||||
border: solid 1px;
|
border: solid 1px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
box-shadow: 0px 15px 10px -15px #000;
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item {
|
.el-form-item {
|
||||||
margin: 5px 5px 5px 5px;
|
margin: 5px 5px 5px 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item .el-input {
|
.el-form-item .el-input {
|
||||||
width: 196px;
|
width: 196px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item .el-input-number {
|
.el-form-item .el-input-number {
|
||||||
width: 196px;
|
width: 196px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-class {
|
.table-class {
|
||||||
margin: 5px 5px 5px 5px;
|
margin: 5px 5px 5px 5px;
|
||||||
width: inherit;
|
width: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-pagination {
|
.el-pagination {
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li {
|
.my-autocomplete li {
|
||||||
width: 196px;
|
width: 196px;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
padding: 7px;
|
padding: 7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .name {
|
.my-autocomplete li .name {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .addr {
|
.my-autocomplete li .addr {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #b4b4b4;
|
color: #b4b4b4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .highlighted .addr {
|
.my-autocomplete li .highlighted .addr {
|
||||||
color: #ddd;
|
color: #ddd;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .goods_id {
|
.my-autocomplete li .goods_id {
|
||||||
color: brown;
|
color: brown;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .goods_name {
|
.my-autocomplete li .goods_name {
|
||||||
color: cornflowerblue;
|
color: cornflowerblue;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-search {
|
.btn-search {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
width: 80px;
|
width: 80px;
|
||||||
margin: auto 5px 5px auto;
|
margin: auto 5px 5px auto;
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
Loading…
Reference in New Issue
Block a user