检验入库
This commit is contained in:
parent
2020570835
commit
4173d5dbce
3
App.vue
3
App.vue
|
|
@ -40,4 +40,7 @@ page {
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
::v-deep .uni-system-preview-image {
|
||||||
|
z-index: 10080 !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -43,4 +43,58 @@ export function getRecordList(params) {
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 退料清点记录详情
|
||||||
|
export function getDetail(params) {
|
||||||
|
return request({
|
||||||
|
url: '/app/returnCheck/getDetail',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 退料清点记录详情-列表
|
||||||
|
export function getDetailList(params) {
|
||||||
|
return request({
|
||||||
|
url: '/app/returnCheck/getDetailList',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检验入库-列表
|
||||||
|
export function getCheckList(params) {
|
||||||
|
return request({
|
||||||
|
url: '/app/checkStore/getCheckList',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检验鉴定-提交
|
||||||
|
export function checkAppraise(data) {
|
||||||
|
return request({
|
||||||
|
url: '/app/checkStore/checkAppraise',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检验记录-列表
|
||||||
|
export function getCheckRecordList(params) {
|
||||||
|
return request({
|
||||||
|
url: '/app/checkStore/getCheckRecordList',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检验记录-详情
|
||||||
|
export function getCheckRecordDetail(params) {
|
||||||
|
return request({
|
||||||
|
url: '/app/checkStore/getCheckRecordDetail',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -4,6 +4,8 @@ module.exports = {
|
||||||
baseUrl: 'http://192.168.0.39:21995',
|
baseUrl: 'http://192.168.0.39:21995',
|
||||||
baseUrl2: 'http://localhost:8080',
|
baseUrl2: 'http://localhost:8080',
|
||||||
uploadFileUrl: '/app/common/appUploadFile',
|
uploadFileUrl: '/app/common/appUploadFile',
|
||||||
|
fileUrl: 'http://192.168.0.39:21995/statics', // 图片预览
|
||||||
|
// fileUrl: 'http://127.0.0.1:21995/statics', // 图片预览
|
||||||
// 应用信息
|
// 应用信息
|
||||||
appInfo: {
|
appInfo: {
|
||||||
// 应用名称
|
// 应用名称
|
||||||
|
|
|
||||||
27
pages.json
27
pages.json
|
|
@ -105,6 +105,33 @@
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "退料清点记录"
|
"navigationBarTitleText": "退料清点记录"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/returnInventory/details",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "退料清点详情"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/inspectionEntry/index",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/inspectionEntry/inspectionRecord",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText": "检验记录"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/stockTaking/index",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"tabBar": {
|
"tabBar": {
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,11 @@ export default {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'star',
|
name: 'star',
|
||||||
title: '星星'
|
title: '检验入库'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'hourglass',
|
name: 'hourglass',
|
||||||
title: '沙漏'
|
title: '库存盘点'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'home',
|
name: 'home',
|
||||||
|
|
@ -50,6 +50,10 @@ export default {
|
||||||
url = '/pages/inventory/index'
|
url = '/pages/inventory/index'
|
||||||
} else if (index === 1) {
|
} else if (index === 1) {
|
||||||
url = '/pages/returnInventory/index'
|
url = '/pages/returnInventory/index'
|
||||||
|
} else if (index === 2) {
|
||||||
|
url = '/pages/inspectionEntry/index'
|
||||||
|
} else if (index === 3) {
|
||||||
|
url = '/pages/stockTaking/index'
|
||||||
}
|
}
|
||||||
uni.navigateTo({ url })
|
uni.navigateTo({ url })
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,407 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<Navbar title="检验入库" :showRightText="true" :isBack="false" :text="'已检验'" @chickIcon="handleRightText" />
|
||||||
|
<div class="cont">
|
||||||
|
<!-- 搜索 -->
|
||||||
|
<div class="search">
|
||||||
|
<u-input
|
||||||
|
v-model="keyWord"
|
||||||
|
placeholder="请输入搜索内容"
|
||||||
|
suffixIcon="search"
|
||||||
|
suffixIconStyle="color: #666"
|
||||||
|
shape="circle"
|
||||||
|
@blur="handleSearch"
|
||||||
|
></u-input>
|
||||||
|
</div>
|
||||||
|
<!-- 列表 -->
|
||||||
|
<div class="list-cont" v-for="(item, index) in tableList" :key="index" @click="handleCheck(item)">
|
||||||
|
<u-row justify="space-between" customStyle="margin-bottom: 10px; padding: 0 15px;">
|
||||||
|
<u-col span="6">
|
||||||
|
<div>{{ item.name }}</div>
|
||||||
|
</u-col>
|
||||||
|
<u-col span="6">
|
||||||
|
<div style="text-align: end; color: #999">{{ item.model }}</div>
|
||||||
|
</u-col>
|
||||||
|
</u-row>
|
||||||
|
<u-line style="margin-bottom: 5px"></u-line>
|
||||||
|
<div class="list-item">
|
||||||
|
<span>退 回 量:</span>
|
||||||
|
<span style="color: #5ae725">{{ item.backNum }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<u-loadmore :status="status" line v-if="tableList.length > 10" />
|
||||||
|
|
||||||
|
<!-- 空状态 -->
|
||||||
|
<u-empty v-if="tableList.length == 0" mode="data"></u-empty>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 弹出层 -->
|
||||||
|
<u-popup :show="showType" mode="center" :closeOnClickOverlay="false" round="8">
|
||||||
|
<div class="uPopup">
|
||||||
|
<div class="pop-title">检验鉴定</div>
|
||||||
|
<div class="top-box">
|
||||||
|
<u-row justify="space-between" customStyle="margin-bottom: 10px;">
|
||||||
|
<u-col span="6">
|
||||||
|
<div>{{ pop.name }}</div>
|
||||||
|
</u-col>
|
||||||
|
<u-col span="6">
|
||||||
|
<div style="text-align: end">{{ pop.model }}</div>
|
||||||
|
</u-col>
|
||||||
|
</u-row>
|
||||||
|
<div class="list-item">
|
||||||
|
<span>退 回 量:</span>
|
||||||
|
<span>{{ pop.backNum }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<u-line style="margin-bottom: 10px"></u-line>
|
||||||
|
<u-form :model="formData" :rules="rules" ref="uForm" labelWidth="auto" labelPosition="left">
|
||||||
|
<u-form-item label="经办人" prop="manager" borderBottom required>
|
||||||
|
<u-input v-model="formData.manager" placeholder="请输入经办人" border="none" inputAlign="right"></u-input>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="经办日期" prop="checkTime" borderBottom required>
|
||||||
|
<u-cell-group :border="false">
|
||||||
|
<u-cell
|
||||||
|
isLink
|
||||||
|
:label="formData.checkTime ? '' : '请选择发现日期'"
|
||||||
|
:value="formData.checkTime"
|
||||||
|
:border="false"
|
||||||
|
@click="showPickerTime = true"
|
||||||
|
></u-cell>
|
||||||
|
</u-cell-group>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="可继续使用数量" prop="goodNum" borderBottom required>
|
||||||
|
<u-input
|
||||||
|
v-model="formData.goodNum"
|
||||||
|
type="number"
|
||||||
|
placeholder="请输入可继续使用数量"
|
||||||
|
border="none"
|
||||||
|
inputAlign="right"
|
||||||
|
></u-input>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="待报废量" prop="backNum" borderBottom required>
|
||||||
|
<u-input
|
||||||
|
v-model="formData.backNum"
|
||||||
|
type="number"
|
||||||
|
placeholder="请输入待报废量"
|
||||||
|
border="none"
|
||||||
|
inputAlign="right"
|
||||||
|
></u-input>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="备注" prop="remark" required>
|
||||||
|
<u-textarea v-model="formData.remark" placeholder="请输入备注" :rows="5" maxlength="300" count></u-textarea>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="附件" prop="fileList">
|
||||||
|
<uni-file-picker
|
||||||
|
v-model="formData.fileList"
|
||||||
|
:auto-upload="false"
|
||||||
|
ref="files"
|
||||||
|
limit="9"
|
||||||
|
@select="selectImg"
|
||||||
|
@delete="deleteImg"
|
||||||
|
:readonly="false"
|
||||||
|
/>
|
||||||
|
</u-form-item>
|
||||||
|
</u-form>
|
||||||
|
<div style="height: 35px"></div>
|
||||||
|
<div class="btn">
|
||||||
|
<u-button plain text="取消" style="margin: 8px 0" @click="showType = false"></u-button>
|
||||||
|
<u-button type="success" plain text="确定" style="margin: 8px 0" @click="submit"></u-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</u-popup>
|
||||||
|
|
||||||
|
<!-- 日期 -->
|
||||||
|
<u-datetime-picker
|
||||||
|
v-if="showPickerTime"
|
||||||
|
:show="showPickerTime"
|
||||||
|
v-model="dataTime"
|
||||||
|
mode="date"
|
||||||
|
@cancel="showPickerTime = false"
|
||||||
|
@confirm="confirmTime"
|
||||||
|
></u-datetime-picker>
|
||||||
|
<!-- loading -->
|
||||||
|
<u-loading-page :loading="isLoading" icon-size="39" style="z-index: 99999"></u-loading-page>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import config from '@/config'
|
||||||
|
import { getCheckList, checkAppraise } from '@/api/aqSafety'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
actionUrl: config.baseUrl + config.uploadFileUrl,
|
||||||
|
token: uni.getStorageSync('App-Token'),
|
||||||
|
isLoading: false,
|
||||||
|
showPickerTime: false,
|
||||||
|
dataTime: Number(new Date()),
|
||||||
|
keyWord: '',
|
||||||
|
status: 'loadmore',
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
total: 0,
|
||||||
|
tableList: [],
|
||||||
|
showType: false,
|
||||||
|
inventoryPopList: [],
|
||||||
|
typePopName: '',
|
||||||
|
pop: {},
|
||||||
|
formData: {
|
||||||
|
modelId: '', // 安全工器具id
|
||||||
|
manager: '', // 经办人
|
||||||
|
checkTime: '', // 经办日期
|
||||||
|
goodNum: '', // 可继续使用数量
|
||||||
|
backNum: '', // 待报废量
|
||||||
|
remark: '', // 备注
|
||||||
|
fileList: [], // 上传图片-处理前
|
||||||
|
uploadPaths: [] // 上传图片-处理后
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
manager: [{ required: true, message: '请输入经办人', trigger: 'blur' }],
|
||||||
|
checkTime: [{ required: true, message: '请选择经办日期', trigger: 'blur' }],
|
||||||
|
goodNum: [
|
||||||
|
{ required: true, message: '请输入可继续使用数量', trigger: 'blur' },
|
||||||
|
// 正则校验 正整数
|
||||||
|
{
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
if (!/^[0-9]\d*$/.test(value)) {
|
||||||
|
callback(new Error('请输入正整数'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
backNum: [
|
||||||
|
{ required: true, message: '请输入待报废量', trigger: 'blur' },
|
||||||
|
// 正则校验 正整数
|
||||||
|
{
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
if (!/^[0-9]\d*$/.test(value)) {
|
||||||
|
callback(new Error('请输入正整数'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
remark: [{ required: true, message: '请输入备注', trigger: 'blur' }]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleSearch() {
|
||||||
|
this.pageSize = 10
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
async getList() {
|
||||||
|
try {
|
||||||
|
const params = {
|
||||||
|
encryptedData: JSON.stringify({ keyWord: this.keyWord }),
|
||||||
|
pageNum: this.pageNum,
|
||||||
|
pageSize: this.pageSize
|
||||||
|
}
|
||||||
|
console.log('🚀 ~ getList ~ params', params)
|
||||||
|
const res = await getCheckList(params)
|
||||||
|
console.log('🚀 ~ getList ~ res', res)
|
||||||
|
this.tableList = res.data.list
|
||||||
|
this.total = res.data.total
|
||||||
|
} catch (error) {
|
||||||
|
console.log('🚀 ~ getList ~ error', error)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
console.log('🚀 ~ onReachBottom ~ ')
|
||||||
|
if (this.total < 10 || this.total == this.tableList.length) {
|
||||||
|
this.status = 'nomore'
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.status = 'loading'
|
||||||
|
setTimeout(() => {
|
||||||
|
this.pageSize += 10
|
||||||
|
this.getList()
|
||||||
|
if (this.tableList.length != this.total) this.status = 'loadmore'
|
||||||
|
else this.status = 'nomore'
|
||||||
|
}, 500)
|
||||||
|
console.log('加载..', this.pageSize)
|
||||||
|
},
|
||||||
|
handleRightText() {
|
||||||
|
console.log('🚀 ~ handleRightText ~ ')
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/inspectionEntry/inspectionRecord'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleCheck(item) {
|
||||||
|
console.log('🚀 ~ handleCheck ~ item:', item)
|
||||||
|
this.pop = item
|
||||||
|
this.showType = true
|
||||||
|
// 清空表单
|
||||||
|
this.$nextTick(() => {
|
||||||
|
// this.$refs.uForm.resetFields()
|
||||||
|
this.formData = {
|
||||||
|
modelId: item.id,
|
||||||
|
manager: '', // 经办人
|
||||||
|
checkTime: '', // 经办日期
|
||||||
|
goodNum: '', // 可继续使用数量
|
||||||
|
backNum: '', // 待报废量
|
||||||
|
remark: '', // 备注
|
||||||
|
fileList: [], // 上传图片-处理前
|
||||||
|
uploadPaths: [] // 上传图片-处理后
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 日期选择器
|
||||||
|
confirmTime(e) {
|
||||||
|
console.log('🚀 ~ confirmTime ~ e', e)
|
||||||
|
this.formData.checkTime = this.formatTimestamp(e.value)
|
||||||
|
console.log('🚀 ~ confirmTime ~ this.formData.checkTime:', this.formData.checkTime)
|
||||||
|
this.showPickerTime = false
|
||||||
|
},
|
||||||
|
// 将时间戳转换为日期格式 yyyy-MM-dd
|
||||||
|
formatTimestamp(timestamp) {
|
||||||
|
const date = new Date(timestamp)
|
||||||
|
const year = date.getFullYear()
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||||
|
const day = String(date.getDate()).padStart(2, '0')
|
||||||
|
return `${year}-${month}-${day}`
|
||||||
|
},
|
||||||
|
selectImg(e) {
|
||||||
|
console.log('🚀 ~ selectImg ~ e:', e)
|
||||||
|
e.tempFiles.forEach(file => {
|
||||||
|
this.formData.fileList.push(file)
|
||||||
|
})
|
||||||
|
console.log('🚀 ~ selectImg ~ this.formData:', this.formData)
|
||||||
|
},
|
||||||
|
deleteImg(e) {
|
||||||
|
console.log('🚀 ~ deleteImg ~ e:', e)
|
||||||
|
this.formData.fileList.splice(e.index, 1)
|
||||||
|
console.log('🚀 ~ deleteImg ~ this.formData.fileList:', this.formData.fileList)
|
||||||
|
},
|
||||||
|
upload(path) {
|
||||||
|
uni.uploadFile({
|
||||||
|
url: this.actionUrl,
|
||||||
|
filePath: path,
|
||||||
|
name: 'file',
|
||||||
|
header: {
|
||||||
|
Authorization: this.token
|
||||||
|
},
|
||||||
|
success: res => {
|
||||||
|
console.log('🚀 ~ selectImg ~ res:', res)
|
||||||
|
console.log('🚀 ~ selectImg ~ res--data:', JSON.parse(res.data).data)
|
||||||
|
this.formData.uploadPaths.push(JSON.parse(res.data).data)
|
||||||
|
// console.log('🚀 ~ upload ~ this.handlePhotoList:', this.formData.handlePhotoList)
|
||||||
|
},
|
||||||
|
fail: err => {
|
||||||
|
console.log('🚀 ~ selectImg ~ err:', err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 提交
|
||||||
|
submit() {
|
||||||
|
console.log('🚀 ~ submit ~ ')
|
||||||
|
console.log('🚀 ~ submit ~ this.formData:', this.formData)
|
||||||
|
// 校验表单
|
||||||
|
this.$refs.uForm.validate().then(res => {
|
||||||
|
console.log('🚀 ~ submit ~ 提交-校验通过')
|
||||||
|
this.isLoading = true
|
||||||
|
this.formData.uploadPaths = []
|
||||||
|
const uploadPromises = this.formData.fileList.map(async file => {
|
||||||
|
console.log('🚀 ~ uploadFile ~ file:', file)
|
||||||
|
return this.upload(file.path)
|
||||||
|
})
|
||||||
|
|
||||||
|
Promise.all(uploadPromises)
|
||||||
|
.then(() => {
|
||||||
|
console.log('所有文件上传完成')
|
||||||
|
setTimeout(async () => {
|
||||||
|
try {
|
||||||
|
const params = {
|
||||||
|
...this.formData,
|
||||||
|
modelId: this.pop.id
|
||||||
|
}
|
||||||
|
delete params.fileList
|
||||||
|
console.log('🚀 ~ submit ~ params:', params)
|
||||||
|
const encryptedData = JSON.stringify(params)
|
||||||
|
const res = await checkAppraise({ encryptedData })
|
||||||
|
console.log('🚀 ~ submit ~ res:', res)
|
||||||
|
this.isLoading = false
|
||||||
|
this.$modal.msg('提交成功')
|
||||||
|
this.showType = false
|
||||||
|
setTimeout(() => {
|
||||||
|
// 刷新页面
|
||||||
|
this.getList()
|
||||||
|
}, 200)
|
||||||
|
} catch (error) {
|
||||||
|
console.log('🚀 ~ submit ~ error', error)
|
||||||
|
this.isLoading = false
|
||||||
|
}
|
||||||
|
}, 600)
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('文件上传过程中出现错误:', error)
|
||||||
|
this.isLoading = false
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
page {
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
}
|
||||||
|
.cont {
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
.search {
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
.list-cont {
|
||||||
|
padding: 15px 0;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
|
||||||
|
|
||||||
|
.list-item {
|
||||||
|
padding: 5px 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.uPopup {
|
||||||
|
width: 90vw;
|
||||||
|
min-height: 80vh;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 15px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.pop-title {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 800;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
text-align: center;
|
||||||
|
color: #777;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-box {
|
||||||
|
padding: 15px;
|
||||||
|
background-color: #7dd5a9;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0px;
|
||||||
|
width: calc(90vw - 30px);
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,310 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<div class="cont">
|
||||||
|
<!-- 搜索 -->
|
||||||
|
<div class="search">
|
||||||
|
<u-input
|
||||||
|
v-model="keyWord"
|
||||||
|
placeholder="请输入搜索内容"
|
||||||
|
suffixIcon="search"
|
||||||
|
suffixIconStyle="color: #666"
|
||||||
|
shape="circle"
|
||||||
|
@blur="handleSearch"
|
||||||
|
></u-input>
|
||||||
|
</div>
|
||||||
|
<!-- 列表 -->
|
||||||
|
<div class="list-cont" v-for="(item, index) in tableList" :key="index" @click="handleCheck(item)">
|
||||||
|
<u-row justify="space-between" customStyle="margin-bottom: 10px; padding: 0 15px;">
|
||||||
|
<u-col span="6">
|
||||||
|
<div>{{ item.name }}</div>
|
||||||
|
</u-col>
|
||||||
|
<u-col span="6">
|
||||||
|
<div style="text-align: end; color: #999">{{ item.model }}</div>
|
||||||
|
</u-col>
|
||||||
|
</u-row>
|
||||||
|
<u-line style="margin-bottom: 5px"></u-line>
|
||||||
|
<div class="list-item">
|
||||||
|
<span>可继续使用量:</span>
|
||||||
|
<span style="color: #5ae725">{{ item.goodNum }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="list-item">
|
||||||
|
<span>待 报 废 量:</span>
|
||||||
|
<span style="color: #f9ae3d">{{ item.scrapNum }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="list-item">
|
||||||
|
<span>检 验 日 期:</span>
|
||||||
|
<span>{{ item.checkTime }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<u-loadmore :status="status" line v-if="tableList.length > 10" />
|
||||||
|
|
||||||
|
<!-- 空状态 -->
|
||||||
|
<u-empty v-if="tableList.length == 0" mode="data"></u-empty>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 弹出层 -->
|
||||||
|
<u-popup :show="showType" mode="center" :closeOnClickOverlay="false" round="8" zIndex="10070">
|
||||||
|
<div class="uPopup">
|
||||||
|
<div class="pop-title">检验鉴定</div>
|
||||||
|
<div class="top-box">
|
||||||
|
<u-row justify="space-between" customStyle="margin-bottom: 10px;">
|
||||||
|
<u-col span="6">
|
||||||
|
<div>{{ pop.name }}</div>
|
||||||
|
</u-col>
|
||||||
|
<u-col span="6">
|
||||||
|
<div style="text-align: end">{{ pop.model }}</div>
|
||||||
|
</u-col>
|
||||||
|
</u-row>
|
||||||
|
<u-row justify="space-between" customStyle="margin-bottom: 10px;">
|
||||||
|
<u-col span="6">
|
||||||
|
<div>可继续使用量:{{ pop.goodNum }}</div>
|
||||||
|
</u-col>
|
||||||
|
<u-col span="6">
|
||||||
|
<div style="text-align: end">待报废量:{{ pop.scrapNum }}</div>
|
||||||
|
</u-col>
|
||||||
|
</u-row>
|
||||||
|
</div>
|
||||||
|
<u-line style="margin-bottom: 10px"></u-line>
|
||||||
|
<u-form :model="formData" :rules="rules" ref="uForm" labelWidth="auto" labelPosition="left">
|
||||||
|
<u-form-item label="经办人" prop="manager" borderBottom>
|
||||||
|
<u-input
|
||||||
|
v-model="formData.manager"
|
||||||
|
placeholder="请输入经办人"
|
||||||
|
border="none"
|
||||||
|
inputAlign="right"
|
||||||
|
readonly
|
||||||
|
></u-input>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="经办日期" prop="checkTime" borderBottom>
|
||||||
|
<u-input
|
||||||
|
v-model="formData.checkTime"
|
||||||
|
placeholder="请输入经办日期"
|
||||||
|
border="none"
|
||||||
|
inputAlign="right"
|
||||||
|
readonly
|
||||||
|
></u-input>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="备注" prop="remark">
|
||||||
|
<u-textarea
|
||||||
|
v-model="formData.remark"
|
||||||
|
placeholder="请输入备注"
|
||||||
|
:rows="5"
|
||||||
|
maxlength="300"
|
||||||
|
count
|
||||||
|
disabled
|
||||||
|
></u-textarea>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="附件" prop="fileList">
|
||||||
|
<uni-file-picker v-model="formData.fileList" :auto-upload="false" ref="files" limit="9" readonly />
|
||||||
|
</u-form-item>
|
||||||
|
</u-form>
|
||||||
|
<div class="btn">
|
||||||
|
<u-button plain text="关 闭" style="margin: 8px 0" @click="showType = false"></u-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</u-popup>
|
||||||
|
|
||||||
|
<!-- 日期 -->
|
||||||
|
<u-datetime-picker
|
||||||
|
v-if="showPickerTime"
|
||||||
|
:show="showPickerTime"
|
||||||
|
v-model="dataTime"
|
||||||
|
mode="date"
|
||||||
|
@cancel="showPickerTime = false"
|
||||||
|
@confirm="confirmTime"
|
||||||
|
></u-datetime-picker>
|
||||||
|
<!-- loading -->
|
||||||
|
<u-loading-page :loading="isLoading" icon-size="39" style="z-index: 99999"></u-loading-page>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import config from '@/config'
|
||||||
|
import { getCheckRecordList, getCheckRecordDetail } from '@/api/aqSafety'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
actionUrl: config.baseUrl + config.uploadFileUrl,
|
||||||
|
token: uni.getStorageSync('App-Token'),
|
||||||
|
isLoading: false,
|
||||||
|
showPickerTime: false,
|
||||||
|
dataTime: Number(new Date()),
|
||||||
|
keyWord: '',
|
||||||
|
status: 'loadmore',
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
total: 0,
|
||||||
|
tableList: [],
|
||||||
|
showType: false,
|
||||||
|
inventoryPopList: [],
|
||||||
|
typePopName: '',
|
||||||
|
pop: {},
|
||||||
|
formData: {
|
||||||
|
modelId: '', // 安全工器具id
|
||||||
|
manager: '', // 经办人
|
||||||
|
checkTime: '', // 经办日期
|
||||||
|
goodNum: '', // 可继续使用数量
|
||||||
|
backNum: '', // 待报废量
|
||||||
|
remark: '', // 备注
|
||||||
|
fileList: [], // 上传图片-处理前
|
||||||
|
uploadPaths: [] // 上传图片-处理后
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
manager: [{ required: true, message: '请输入经办人', trigger: 'blur' }],
|
||||||
|
checkTime: [{ required: true, message: '请选择经办日期', trigger: 'blur' }],
|
||||||
|
goodNum: [
|
||||||
|
{ required: true, message: '请输入可继续使用数量', trigger: 'blur' },
|
||||||
|
// 正则校验 正整数
|
||||||
|
{
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
if (!/^[1-9]\d*$/.test(value)) {
|
||||||
|
callback(new Error('请输入正整数'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
backNum: [
|
||||||
|
{ required: true, message: '请输入待报废量', trigger: 'blur' },
|
||||||
|
// 正则校验 正整数
|
||||||
|
{
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
if (!/^[1-9]\d*$/.test(value)) {
|
||||||
|
callback(new Error('请输入正整数'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
remark: [{ required: true, message: '请输入备注', trigger: 'blur' }]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleSearch() {
|
||||||
|
this.pageSize = 10
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
async getList() {
|
||||||
|
try {
|
||||||
|
const params = {
|
||||||
|
encryptedData: JSON.stringify({ keyWord: this.keyWord }),
|
||||||
|
pageNum: this.pageNum,
|
||||||
|
pageSize: this.pageSize
|
||||||
|
}
|
||||||
|
console.log('🚀 ~ getList ~ params', params)
|
||||||
|
const res = await getCheckRecordList(params)
|
||||||
|
console.log('🚀 ~ getList ~ res', res)
|
||||||
|
this.tableList = res.data.list
|
||||||
|
this.total = res.data.total
|
||||||
|
} catch (error) {
|
||||||
|
console.log('🚀 ~ getList ~ error', error)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
console.log('🚀 ~ onReachBottom ~ ')
|
||||||
|
if (this.total < 10 || this.total == this.tableList.length) {
|
||||||
|
this.status = 'nomore'
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.status = 'loading'
|
||||||
|
setTimeout(() => {
|
||||||
|
this.pageSize += 10
|
||||||
|
this.getList()
|
||||||
|
if (this.tableList.length != this.total) this.status = 'loadmore'
|
||||||
|
else this.status = 'nomore'
|
||||||
|
}, 500)
|
||||||
|
console.log('加载..', this.pageSize)
|
||||||
|
},
|
||||||
|
// 获取详情
|
||||||
|
async getDetail() {
|
||||||
|
try {
|
||||||
|
const params = {
|
||||||
|
encryptedData: JSON.stringify({ id: this.pop.id })
|
||||||
|
}
|
||||||
|
console.log('🚀 ~ getDetail ~ params', params)
|
||||||
|
const res = await getCheckRecordDetail(params)
|
||||||
|
console.log('🚀 ~ getDetail ~ res', res)
|
||||||
|
this.formData = res.data
|
||||||
|
if (this.formData.fileList && this.formData.fileList.length > 0) {
|
||||||
|
this.formData.fileList.forEach(item => {
|
||||||
|
item.url = config.fileUrl + item.fileUrl + '?token=' + this.token
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log('🚀 ~ getDetail ~ error', error)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 查看详情
|
||||||
|
handleCheck(item) {
|
||||||
|
console.log('🚀 ~ handleCheck ~ item:', item)
|
||||||
|
this.pop = item
|
||||||
|
this.getDetail()
|
||||||
|
this.showType = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
page {
|
||||||
|
/* padding: 15px; */
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
}
|
||||||
|
.cont {
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
.search {
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
.list-cont {
|
||||||
|
padding: 15px 0;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
|
||||||
|
|
||||||
|
.list-item {
|
||||||
|
padding: 5px 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.uPopup {
|
||||||
|
width: 90vw;
|
||||||
|
min-height: 80vh;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 15px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.pop-title {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 800;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
text-align: center;
|
||||||
|
color: #777;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-box {
|
||||||
|
padding: 15px;
|
||||||
|
background-color: #7dd5a9;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0px;
|
||||||
|
width: calc(90vw - 30px);
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<u-loadmore :status="status" line v-if="tableList.length > 0" />
|
<u-loadmore :status="status" line v-if="tableList.length > 10" />
|
||||||
|
|
||||||
<!-- 空状态 -->
|
<!-- 空状态 -->
|
||||||
<u-empty v-if="tableList.length == 0" mode="data"></u-empty>
|
<u-empty v-if="tableList.length == 0" mode="data"></u-empty>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,223 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<!-- <Navbar title="退料清点" :showRightText="true" :isBack="false" :text="'退料记录'" @chickIcon="handleRightText" /> -->
|
||||||
|
<uni-section title="退料信息填写" type="line"></uni-section>
|
||||||
|
<div class="cont">
|
||||||
|
<u-form :model="formData" ref="uForm" labelWidth="auto" labelPosition="left">
|
||||||
|
<u-form-item label="退料工程" prop="proName" borderBottom>
|
||||||
|
<u-input
|
||||||
|
v-model="formData.proName"
|
||||||
|
placeholder="退料工程"
|
||||||
|
border="none"
|
||||||
|
disabled
|
||||||
|
inputAlign="right"
|
||||||
|
></u-input>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="退料日期" prop="backTime" borderBottom>
|
||||||
|
<u-input
|
||||||
|
v-model="formData.backTime"
|
||||||
|
placeholder="退料日期"
|
||||||
|
border="none"
|
||||||
|
disabled
|
||||||
|
inputAlign="right"
|
||||||
|
></u-input>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="经办人" prop="manager" borderBottom>
|
||||||
|
<u-input
|
||||||
|
v-model="formData.manager"
|
||||||
|
placeholder="请输入经办人"
|
||||||
|
border="none"
|
||||||
|
inputAlign="right"
|
||||||
|
disabled
|
||||||
|
></u-input>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="经办人电话" prop="phone" borderBottom>
|
||||||
|
<u-input
|
||||||
|
v-model="formData.phone"
|
||||||
|
placeholder="经办人电话"
|
||||||
|
border="none"
|
||||||
|
inputAlign="right"
|
||||||
|
maxlength="11"
|
||||||
|
disabled
|
||||||
|
></u-input>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="备注" prop="remark">
|
||||||
|
<u-textarea
|
||||||
|
v-model="formData.remark"
|
||||||
|
placeholder="请输入备注"
|
||||||
|
:rows="5"
|
||||||
|
maxlength="300"
|
||||||
|
count
|
||||||
|
disabled
|
||||||
|
></u-textarea>
|
||||||
|
</u-form-item>
|
||||||
|
<u-form-item label="附件上传" prop="fileList">
|
||||||
|
<uni-file-picker v-model="formData.fileList" :auto-upload="false" ref="files" limit="9" readonly />
|
||||||
|
</u-form-item>
|
||||||
|
</u-form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<uni-section title="退料物资明细" type="line"></uni-section>
|
||||||
|
<div class="cont">
|
||||||
|
<div>
|
||||||
|
<div class="top-cont">
|
||||||
|
<u-input
|
||||||
|
v-model="typeName"
|
||||||
|
placeholder="请输入名称"
|
||||||
|
suffixIcon="search"
|
||||||
|
suffixIconStyle="color: #666"
|
||||||
|
shape="circle"
|
||||||
|
@blur="handleSearch"
|
||||||
|
></u-input>
|
||||||
|
</div>
|
||||||
|
<u-row justify="space-around" customStyle="margin: 10px 0;" gutter="6">
|
||||||
|
<u-col span="2" textAlign="center">
|
||||||
|
<div>序号</div>
|
||||||
|
</u-col>
|
||||||
|
<u-col span="3" textAlign="center">
|
||||||
|
<div>名称</div>
|
||||||
|
</u-col>
|
||||||
|
<u-col span="4" textAlign="center">
|
||||||
|
<div>规格</div>
|
||||||
|
</u-col>
|
||||||
|
<u-col span="3" textAlign="right">
|
||||||
|
<div>退回数量</div>
|
||||||
|
</u-col>
|
||||||
|
</u-row>
|
||||||
|
<div class="list-item" v-for="(item, index) in detailList" :key="index">
|
||||||
|
<u-row justify="space-around" customStyle="margin-bottom: 10px;" gutter="6">
|
||||||
|
<u-col span="2" textAlign="center">
|
||||||
|
<div>{{ index + 1 }}</div>
|
||||||
|
</u-col>
|
||||||
|
<u-col span="3" textAlign="center">
|
||||||
|
<div>{{ item.name }}</div>
|
||||||
|
</u-col>
|
||||||
|
<u-col span="4" textAlign="center">
|
||||||
|
<div>{{ item.model }}</div>
|
||||||
|
</u-col>
|
||||||
|
<u-col span="3" textAlign="center">
|
||||||
|
<div style="color: #5ae725">{{ item.num }}</div>
|
||||||
|
</u-col>
|
||||||
|
</u-row>
|
||||||
|
</div>
|
||||||
|
<!-- 空状态 -->
|
||||||
|
<u-empty v-if="detailList.length == 0" mode="data"></u-empty>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="height: 20px"></div>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import config from '@/config'
|
||||||
|
import { getDetail, getDetailList } from '@/api/aqSafety'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
opt: {},
|
||||||
|
actionUrl: config.baseUrl + config.uploadFileUrl,
|
||||||
|
token: uni.getStorageSync('App-Token'),
|
||||||
|
isLoading: false,
|
||||||
|
showPicker: false,
|
||||||
|
columns: [],
|
||||||
|
showPickerTime: false,
|
||||||
|
dataTime: Number(new Date()),
|
||||||
|
showType: false, // 退料类型弹框
|
||||||
|
formData: {
|
||||||
|
projectName: '', // 退料工程
|
||||||
|
projectId: '', // 退料工程id
|
||||||
|
backTime: '', // 退料日期
|
||||||
|
manager: '', // 经办人
|
||||||
|
phone: '', // 经办人电话
|
||||||
|
remark: '', // 备注
|
||||||
|
fileList: [], // 附件
|
||||||
|
uploadPaths: [] // 上传文件
|
||||||
|
},
|
||||||
|
// 退料物资明细-列表
|
||||||
|
detailList: [],
|
||||||
|
typeName: '', // 退料物资明细-搜索名称
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(opt) {
|
||||||
|
console.log('🚀 ~ onLoad ~ opt', opt)
|
||||||
|
this.opt = JSON.parse(opt.params)
|
||||||
|
console.log('🚀 ~ onLoad ~ this.opt:', this.opt)
|
||||||
|
this.getDetail()
|
||||||
|
this.getDetailList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleSearch() {
|
||||||
|
console.log('🚀 ~ handleSearch ~ ', this.typeName)
|
||||||
|
// 前端搜索, 根据typeName搜索
|
||||||
|
this.getDetailList()
|
||||||
|
},
|
||||||
|
// 获取详情
|
||||||
|
async getDetail() {
|
||||||
|
try {
|
||||||
|
const params = {
|
||||||
|
encryptedData: JSON.stringify({ id: this.opt.id })
|
||||||
|
}
|
||||||
|
console.log('🚀 ~ getDetail ~ params', params)
|
||||||
|
const res = await getDetail(params)
|
||||||
|
console.log('🚀 ~ getDetail ~ res', res)
|
||||||
|
this.formData = res.data
|
||||||
|
if (this.formData.fileList && this.formData.fileList.length > 0) {
|
||||||
|
this.formData.fileList.forEach(item => {
|
||||||
|
item.url = config.fileUrl + item.fileUrl + '?token=' + this.token
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log('🚀 ~ getDetail ~ error', error)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 获取详情列表
|
||||||
|
async getDetailList() {
|
||||||
|
try {
|
||||||
|
const params = {
|
||||||
|
encryptedData: JSON.stringify({ id: this.opt.id, keyWord: this.typeName }),
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 9999
|
||||||
|
}
|
||||||
|
console.log('🚀 ~ getDetailList ~ params', params)
|
||||||
|
const res = await getDetailList(params)
|
||||||
|
console.log('🚀 ~ getDetailList ~ res', res)
|
||||||
|
this.detailList = res.data.list
|
||||||
|
} catch (error) {
|
||||||
|
console.log('🚀 ~ getDetailList ~ error', error)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.cont {
|
||||||
|
padding: 0 15px;
|
||||||
|
|
||||||
|
.list-no {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-cont {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin: 10px 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bt-btn {
|
||||||
|
padding-bottom: 8px;
|
||||||
|
width: calc(100% - 30px);
|
||||||
|
background: #fff;
|
||||||
|
// 固定底部
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 15px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
<u-cell-group :border="false">
|
<u-cell-group :border="false">
|
||||||
<u-cell
|
<u-cell
|
||||||
isLink
|
isLink
|
||||||
:label="formData.backTime ? '' : '请选择发现日期'"
|
:label="formData.backTime ? '' : '请选择退料日期'"
|
||||||
:value="formData.backTime"
|
:value="formData.backTime"
|
||||||
:border="false"
|
:border="false"
|
||||||
@click="showPickerTime = true"
|
@click="showPickerTime = true"
|
||||||
|
|
@ -130,7 +130,7 @@
|
||||||
placeholder="返回数量"
|
placeholder="返回数量"
|
||||||
border="surround"
|
border="surround"
|
||||||
v-model="item.num"
|
v-model="item.num"
|
||||||
@blur="handleNum"
|
@blur="handleNum(item)"
|
||||||
></u-input>
|
></u-input>
|
||||||
</div>
|
</div>
|
||||||
</u-col>
|
</u-col>
|
||||||
|
|
@ -213,7 +213,7 @@
|
||||||
placeholder="返回数量"
|
placeholder="返回数量"
|
||||||
border="surround"
|
border="surround"
|
||||||
v-model="item.num"
|
v-model="item.num"
|
||||||
@blur="handleNum"
|
@blur="handleNum(item)"
|
||||||
></u-input>
|
></u-input>
|
||||||
</div>
|
</div>
|
||||||
</u-col>
|
</u-col>
|
||||||
|
|
@ -221,6 +221,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div style="height: 35px"></div>
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
<u-button plain text="取消" style="margin: 8px 0" @click="showType = false"></u-button>
|
<u-button plain text="取消" style="margin: 8px 0" @click="showType = false"></u-button>
|
||||||
<u-button type="primary" plain text="确定" style="margin: 8px 0" @click="selectType"></u-button>
|
<u-button type="primary" plain text="确定" style="margin: 8px 0" @click="selectType"></u-button>
|
||||||
|
|
@ -324,7 +325,7 @@ export default {
|
||||||
},
|
},
|
||||||
// 日期选择器
|
// 日期选择器
|
||||||
confirmTime(e) {
|
confirmTime(e) {
|
||||||
console.log('🚀 ~ confirmTime ~ e', e)
|
console.log('🚀 ~ confirmTime ~ e', e)
|
||||||
this.formData.backTime = this.formatTimestamp(e.value)
|
this.formData.backTime = this.formatTimestamp(e.value)
|
||||||
console.log('🚀 ~ confirmTime ~ this.formData.backTime:', this.formData.backTime)
|
console.log('🚀 ~ confirmTime ~ this.formData.backTime:', this.formData.backTime)
|
||||||
this.showPickerTime = false
|
this.showPickerTime = false
|
||||||
|
|
@ -356,15 +357,14 @@ export default {
|
||||||
this.formData.fileList.splice(e.index, 1)
|
this.formData.fileList.splice(e.index, 1)
|
||||||
console.log('🚀 ~ deleteImg ~ this.formData.fileList:', this.formData.fileList)
|
console.log('🚀 ~ deleteImg ~ this.formData.fileList:', this.formData.fileList)
|
||||||
},
|
},
|
||||||
handleNum() {
|
handleNum(item) {
|
||||||
// 校验退回数量-只能是正整数
|
// 校验退回数量-只能是正整数
|
||||||
this.detailList.forEach(item => {
|
const reg = /^[1-9]\d*$/
|
||||||
if (!/^[1-9]\d*$/.test(item.num)) {
|
if (!reg.test(item.num)) {
|
||||||
this.$modal.msg('退回数量只能是正整数')
|
this.$modal.msg('退回数量只能是正整数')
|
||||||
// 去除.后面的数字
|
// 去除.后面的数字
|
||||||
item.num = item.num.replace(/\.\d+/, '')
|
item.num = item.num.replace(/\.\d+/, '')
|
||||||
}
|
}
|
||||||
})
|
|
||||||
},
|
},
|
||||||
upload(path) {
|
upload(path) {
|
||||||
uni.uploadFile({
|
uni.uploadFile({
|
||||||
|
|
@ -458,23 +458,28 @@ export default {
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log('所有文件上传完成')
|
console.log('所有文件上传完成')
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
const params = {
|
try {
|
||||||
...this.formData,
|
const params = {
|
||||||
detailList: this.detailList
|
...this.formData,
|
||||||
|
detailList: this.detailList
|
||||||
|
}
|
||||||
|
delete params.fileList
|
||||||
|
console.log('🚀 ~ submit ~ params:', params)
|
||||||
|
const encryptedData = JSON.stringify(params)
|
||||||
|
const res = await addData({ encryptedData })
|
||||||
|
console.log('🚀 ~ submit ~ res:', res)
|
||||||
|
this.isLoading = false
|
||||||
|
this.$modal.msg('提交成功')
|
||||||
|
setTimeout(() => {
|
||||||
|
// 刷新页面
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/returnInventory/index'
|
||||||
|
})
|
||||||
|
}, 200)
|
||||||
|
} catch (error) {
|
||||||
|
console.log('🚀 ~ submit ~ error', error)
|
||||||
|
this.isLoading = false
|
||||||
}
|
}
|
||||||
delete params.fileList
|
|
||||||
console.log('🚀 ~ submit ~ params:', params)
|
|
||||||
const encryptedData = JSON.stringify(params)
|
|
||||||
const res = await addData({ encryptedData })
|
|
||||||
console.log('🚀 ~ submit ~ res:', res)
|
|
||||||
this.isLoading = false
|
|
||||||
this.$modal.msg('提交成功')
|
|
||||||
setTimeout(() => {
|
|
||||||
// 刷新页面
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pages/returnInventory/index'
|
|
||||||
})
|
|
||||||
}, 200)
|
|
||||||
}, 600)
|
}, 600)
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
|
@ -521,7 +526,7 @@ export default {
|
||||||
}
|
}
|
||||||
.uPopup {
|
.uPopup {
|
||||||
width: 90vw;
|
width: 90vw;
|
||||||
height: 80vh;
|
min-height: 80vh;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
></u-input>
|
></u-input>
|
||||||
</div>
|
</div>
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<div class="list-cont" v-for="(item, index) in tableList" :key="index">
|
<div class="list-cont" v-for="(item, index) in tableList" :key="index" @click="goDetail(item)">
|
||||||
<u-row justify="space-between" customStyle="margin-bottom: 10px; padding: 0 15px;">
|
<u-row justify="space-between" customStyle="margin-bottom: 10px; padding: 0 15px;">
|
||||||
<u-col span="6">
|
<u-col span="6">
|
||||||
<div>{{ item.proName }}</div>
|
<div>{{ item.proName }}</div>
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<u-loadmore :status="status" line v-if="tableList.length > 0" />
|
<u-loadmore :status="status" line v-if="tableList.length > 10" />
|
||||||
|
|
||||||
<!-- 空状态 -->
|
<!-- 空状态 -->
|
||||||
<u-empty v-if="tableList.length == 0" mode="data"></u-empty>
|
<u-empty v-if="tableList.length == 0" mode="data"></u-empty>
|
||||||
|
|
@ -95,7 +95,15 @@ export default {
|
||||||
else this.status = 'nomore'
|
else this.status = 'nomore'
|
||||||
}, 500)
|
}, 500)
|
||||||
console.log('加载..', this.pageSize)
|
console.log('加载..', this.pageSize)
|
||||||
}
|
},
|
||||||
|
goDetail(item) {
|
||||||
|
const params = {
|
||||||
|
...item
|
||||||
|
}
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/returnInventory/details?params=${JSON.stringify(params)}`
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<Navbar title="库存盘点" :showRightText="true" :isBack="false" :text="'盘点记录'" @chickIcon="handleRightText" />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleRightText() {
|
||||||
|
console.log('🚀 ~ handleRightText ~ ')
|
||||||
|
// uni.navigateTo({
|
||||||
|
// url: '/pages/inspectionEntry/inspectionList'
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
@ -99,7 +99,9 @@ const request = config => {
|
||||||
// res = JSON.parse(decryptCBC(res.data))
|
// res = JSON.parse(decryptCBC(res.data))
|
||||||
console.log('🚀 ~ request.js ~ line 100 ~ res', res)
|
console.log('🚀 ~ request.js ~ line 100 ~ res', res)
|
||||||
const code = res.data.code || 200
|
const code = res.data.code || 200
|
||||||
|
console.log('🚀 ~ ~ code', code)
|
||||||
const msg = errorCode[code] || res.data.msg || errorCode['default']
|
const msg = errorCode[code] || res.data.msg || errorCode['default']
|
||||||
|
console.log('🚀 ~ ~ msg', msg)
|
||||||
if (code === 401) {
|
if (code === 401) {
|
||||||
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
|
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue