This commit is contained in:
binbin_pan 2025-01-03 12:15:58 +08:00
parent 80a575b7d1
commit 9b437ea9c8
18 changed files with 93 additions and 3985 deletions

View File

@ -101,72 +101,6 @@
"navigationBarTitleText": "浏览文本"
}
},
{
"path": "pages/inventory/index",
"style": {
"navigationBarTitleText": "库存查询"
}
},
{
"path": "pages/returnInventory/index",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/returnInventory/returnInventoryRecord",
"style": {
"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"
}
},
{
"path": "pages/stockTaking/takingRecord",
"style": {
"navigationBarTitleText": "盘点记录"
}
},
{
"path": "pages/arrivalConfirmation/index",
"style": {
"navigationBarTitleText": "到货确认单上传"
}
},
{
"path": "pages/sendACarSystem/index",
"style": {
"navigationBarTitleText": "派车管理"
}
},
{
"path": "pages/sendACarSystem/details",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/amendPassword",
"style": {

View File

@ -10,28 +10,47 @@
<span class="right-item" :class="{ active: active == 2 }" @click="active = 2">外卖</span>
</div>
</div>
<div class="balance-area" v-for="(book, index) in cookbook" :key="index">
<div class="left-balance" :class="{ active: current == index }" @click="scrollToDetail(index)">
{{ handleRecipeType(book.recipeType) }}
</div>
<div
class="right-balance"
:ref="'detail-' + index + '-' + itemIndex"
v-for="(item, itemIndex) in book.recipeDetailList"
:key="itemIndex"
>
<div class="top-name">{{ item.intervalName }}</div>
<div v-for="(food, foodIndex) in item.mealList">
{{ food.mealName }}
</div>
</div>
<!-- <div class="top-cont-wrap">
</div>
<div style="height: 55px;"></div> -->
<u-row class="footer-cont" align="top">
<u-col :span="3" class="left-wrap">
<div v-for="(book, index) in cookbook" :key="index">
<div class="left-balance" :class="{ active: current == index }" @click="scrollToDetail(index)">
{{ handleRecipeType(book.recipeType) }}
</div>
</div>
</u-col>
<u-col :span="9">
<div class="right-wrap" v-for="(book, index) in cookbook" :key="index">
<!-- <div class="left-balance" :class="{ active: current == index }" @click="scrollToDetail(index)">
{{ handleRecipeType(book.recipeType) }}
</div> -->
<div
class="right-balance"
:ref="'detail-' + index + '-' + itemIndex"
v-for="(item, itemIndex) in book.recipeDetailList"
:key="itemIndex"
>
<div class="top-name">{{ item.intervalName }}</div>
<div class="cont-list" v-for="(food, foodIndex) in item.mealList">
<div>
<u-image :src="food.imageUrl" width="80px" height="80px" />
</div>
</div>
</div>
</div>
</u-col>
</u-row>
</view>
</template>
<script>
import uImage from '../../uni_modules/uview-ui/components/u--image/u--image.vue'
import URow from '../../uni_modules/uview-ui/components/u-row/u-row.vue'
export default {
components: { uImage, URow },
data() {
return {
current: 0,
@ -200,14 +219,39 @@ export default {
return '按月'
}
},
scrollToDetail(index) {
console.log('🚀 ~ scrollToDetail ~ index', index)
this.current = index
const detailElement = this.$refs['detail-' + index + '-0'][0]
if (detailElement) {
detailElement.scrollIntoView({ behavior: 'smooth' })
}
}
// scrollToDetail(index) {
// console.log('🚀 ~ scrollToDetail ~ index', index)
// this.current = index
// this.$nextTick(() => {
// const detailElement = this.$refs['detail-' + index + '-0'][0]
// if (detailElement) {
// setTimeout(() => {
// detailElement.scrollIntoView({ behavior: 'smooth' })
// }, 100)
// }
// })
// }
// scrollToDetail(index) {
// console.log('🚀 ~ scrollToDetail ~ index', index)
// this.current = index
// this.$nextTick(() => {
// const query = uni.createSelectorQuery().in(this)
// const targetElement = this.$refs['detail-' + index + '-0'][0]
// if (targetElement) {
// query
// .select(`#${targetElement.id}`)
// .boundingClientRect(rect => {
// if (rect) {
// uni.pageScrollTo({
// scrollTop: rect.top + uni.getSystemInfoSync().statusBarHeight, //
// duration: 300 //
// })
// }
// })
// .exec()
// }
// })
// }
}
}
</script>
@ -216,9 +260,11 @@ export default {
page {
/* padding-top: env(safe-area-inset-top); */
background: #f9fbff;
position: relative;
}
.top-cont {
padding: 0 16px 16px;
height: 55px;
padding: 0 16px;
background: #fff;
.top-right-cont {
background: rgba(15, 39, 75, 0.05);
@ -238,9 +284,16 @@ page {
}
}
}
.balance-area {
display: flex;
.footer-cont {
height: calc(100vh - 115px);
overflow: auto;
}
.left-wrap {
position: fixed;
top: 55px;
height: calc(100vh - 115px);
overflow: auto;
.left-balance {
width: 88px;
height: 44px;
@ -250,16 +303,16 @@ page {
font-weight: 500;
font-size: 14px;
color: #0f274b;
&.active {
background: #fff;
}
}
}
.right-wrap {
margin-left: 88px;
width: calc(100vw - 88px);
overflow: auto;
.right-balance {
width: calc(100vw - 88px);
/* min-height: 90vh; */
overflow: auto;
padding: 0 8px;
background-color: #fff;
.top-name {
@ -270,6 +323,11 @@ page {
display: flex;
align-items: center;
}
.cont-list {
display: flex;
padding: 8px;
/* border-bottom: 1px solid #f0f0f0; */
}
}
}
</style>

View File

@ -1,241 +0,0 @@
<template>
<view>
<!-- 搜索 -->
<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="handleDetail(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="display: flex; justify-content: flex-end">
<u-tag text="已上传" type="success" v-if="item.imgList && item.imgList.length > 0"></u-tag>
<u-tag text="待上传" type="warning" v-else></u-tag>
</div>
</u-col>
</u-row>
<u-line style="margin-bottom: 5px"></u-line>
<div class="list-item">
<span>工程名称</span>
<span>{{ item.proName }}</span>
</div>
<div class="list-item df-item">
<div>
<span>派车数量</span>
<span style="color: #5ae725">{{ item.pcNum }}</span>
</div>
<div>
<u-tag
v-if="item.imgList && item.imgList.length > 0"
text="查看到货确认单"
type="info"
@click="openImgModal(item)"
></u-tag>
<u-tag v-else type="primary" text="上传到货确认单" @click="openImgModal"></u-tag>
</div>
</div>
<div class="list-item">
<span>派车时间</span>
<span style="color: #f9ae3d">{{ item.time }}</span>
</div>
</div>
<!-- 上传图片 -->
<u-modal :show="imgModal" :title="imgModelTitle" showCancelButton @cancel="imgModal = false" @confirm="uploadImg">
<view class="slot-content" style="display: flex; flex-direction: column; align-items: center">
<uni-file-picker
v-model="imgList"
:auto-upload="false"
ref="files"
limit="3"
@select="selectImg"
@delete="deleteImg"
:readonly="readonly"
style="height: 100px; width: 260px"
/>
</view>
</u-modal>
<u-loadmore :status="status" line v-if="tableList.length > 10" />
<!-- 空状态 -->
<u-empty v-if="tableList.length == 0" mode="data"></u-empty>
</view>
</template>
<script>
import { getInventoryList } from '@/api/aqSafety'
export default {
data() {
return {
imgModal: false,
readonly: false,
imgModelTitle: '',
imgList: [],
uploadPaths: [],
keyWord: '',
status: 'loadmore',
pageNum: 1,
pageSize: 10,
total: 0,
tableList: [
{
name: '张三',
proName: '项目名称',
pcNum: 10,
time: '2021-08-01',
imgList: []
},
{
name: '李四',
proName: '项目名称',
pcNum: 20,
time: '2021-08-01',
imgList: [
{
url: 'https://img.yzcdn.cn/vant/cat.jpeg'
}
]
}
]
}
},
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 getInventoryList(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)
},
//
openImgModal(item) {
this.imgModal = true
if (item) {
this.readonly = true
this.imgModelTitle = '查看到货确认单'
this.imgList = item.imgList
} else {
this.readonly = false
this.imgModelTitle = '上传到货确认单'
this.imgList = []
}
},
selectImg(e) {
console.log('🚀 ~ selectImg ~ e:', e)
e.tempFiles.forEach(file => {
this.imgList.push(file)
})
console.log('🚀 ~ selectImg ~ this.imgList:', this.imgList)
},
deleteImg(e) {
console.log('🚀 ~ deleteImg ~ e:', e)
this.imgList.splice(e.index, 1)
console.log('🚀 ~ deleteImg ~ this.imgList:', this.imgList)
},
uploadImg() {
console.log('🚀 ~ uploadImg ~ this.imgList:', this.imgList)
this.imgModal = false
},
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.uploadPaths.push(JSON.parse(res.data).data)
},
fail: err => {
console.log('🚀 ~ selectImg ~ err:', err)
}
})
},
handleDetail(item) {
console.log('🚀 ~ handleDetail ~ item', item)
const params = {
isDetail: true,
//
isArrival: true,
active: 1
}
uni.navigateTo({
url: `/pages/sendACarSystem/details?params=${JSON.stringify(params)}`
})
}
}
}
</script>
<style lang="scss">
page {
padding: 15px;
background-color: #f8f8f8;
}
.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;
}
.df-item {
display: flex;
justify-content: space-between;
align-items: center;
}
}
</style>

View File

@ -3,7 +3,7 @@
<u-navbar
:title="title"
@leftClick="goBack"
@rightClick="chickIcon"
@rightClick="clickIcon"
:autoBack="true"
placeholder
titleStyle="font-size: 16px;font-weight: 700;"
@ -70,7 +70,7 @@ export default {
}
}
},
chickIcon() {
clickIcon() {
this.$emit('chickIcon')
}
}

View File

@ -1,414 +0,0 @@
<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="scrapNum" borderBottom required>
<u-input
v-model="formData.scrapNum"
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="200" 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="3"
@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"
:max-date="Number(new Date())"
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: '', // 使
scrapNum: '', //
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'
}
],
scrapNum: [
{ 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: '', // 使
scrapNum: '', //
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)
// 使+ 退
if (Number(this.formData.goodNum) + Number(this.formData.scrapNum) > this.pop.backNum) {
this.$modal.msg('可继续使用量、待报废量总数不能超过退回量')
return
}
//
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,
backNum: this.pop.backNum,
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>

View File

@ -1,277 +0,0 @@
<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" 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="200"
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: [] // -
},
}
},
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>

View File

@ -1,122 +0,0 @@
<template>
<view>
<!-- 搜索 -->
<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">
<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>{{ item.type }}</span>
</div>
<div class="list-item">
<span>库存数量</span>
<span style="color: #5ae725">{{ item.kcNum }}</span>
</div>
<div class="list-item">
<span>报废数量</span>
<span style="color: #f9ae3d">{{ item.dbfNum }}</span>
</div>
</div>
<u-loadmore :status="status" line v-if="tableList.length > 10" />
<!-- 空状态 -->
<u-empty v-if="tableList.length == 0" mode="data"></u-empty>
</view>
</template>
<script>
import { getInventoryList } from '@/api/aqSafety'
export default {
data() {
return {
keyWord: '',
status: 'loadmore',
pageNum: 1,
pageSize: 10,
total: 0,
tableList: []
}
},
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 getInventoryList(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)
}
}
}
</script>
<style lang="scss">
page {
padding: 15px;
background-color: #f8f8f8;
}
.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;
}
}
</style>

View File

@ -1,6 +1,6 @@
<template>
<view>
<Navbar title="余额/充值" :showRightText="true" :isBack="false" :text="'充值记录'" @chickIcon="handleRightText" />
<Navbar title="余额/充值" :showRightText="true" :isBack="false" :text="'充值记录'" @clickIcon="handleRightText" />
<div class="content">
<div class="top-cont">
<div>总余额()</div>

View File

@ -1,223 +0,0 @@
<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="200"
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>

View File

@ -1,552 +0,0 @@
<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" :rules="rules" ref="uForm" labelWidth="auto" labelPosition="left" errorType="toast">
<u-form-item label="退料工程" prop="projectName" borderBottom required>
<u-cell-group :border="false">
<u-cell
:value="formData.projectName"
isLink
:label="formData.projectName ? '' : '请选择退料工程'"
:border="false"
@click="showPicker = true"
></u-cell>
</u-cell-group>
</u-form-item>
<u-form-item label="退料日期" prop="backTime" borderBottom required>
<u-cell-group :border="false">
<u-cell
isLink
:label="formData.backTime ? '' : '请选择退料日期'"
:value="formData.backTime"
:border="false"
@click="showPickerTime = true"
></u-cell>
</u-cell-group>
</u-form-item>
<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="phone" borderBottom required>
<u-input
v-model="formData.phone"
type="number"
placeholder="请输入经办人电话"
border="none"
inputAlign="right"
maxlength="11"
@blur="handlePhone"
></u-input>
</u-form-item>
<u-form-item label="备注" prop="remark" required>
<u-textarea v-model="formData.remark" placeholder="请输入备注" :rows="5" maxlength="200" 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="3"
@select="selectImg"
@delete="deleteImg"
:readonly="false"
/>
</u-form-item>
</u-form>
</div>
<uni-section title="退料物资明细" type="line"></uni-section>
<div class="cont">
<div class="list-no" v-if="detailList.length == 0">
<u-icon name="/static/images/no_data_icon.png" width="98" height="64"></u-icon>
<span style="font-weight: 800; margin: 8px 0">您还没有选择退料的类型</span>
<span style="color: #999">需要选择类型后才能进行退料</span>
<u-button
type="primary"
plain
icon="coupon-fill"
text="选择退料类型"
style="margin: 8px 0"
@click="showType = true"
></u-button>
</div>
<div v-else>
<div class="top-cont">
<div class="top-cont-item">
<u-input
v-model="typeName"
placeholder="请输入名称"
suffixIcon="search"
suffixIconStyle="color: #666"
shape="circle"
@blur="handleSearch"
></u-input>
</div>
<div class="top-cont-item">
<u-button
type="success"
plain
icon="coupon-fill"
text="选择退料类型"
style="margin: 8px 0"
@click="handleShowType"
></u-button>
</div>
</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>
<span style="color: red">*</span>
退回数量
</div>
</u-col>
</u-row>
<div class="list-item" v-for="(item, index) in searchList" :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="right">
<div>
<u-input
type="number"
placeholder="返回数量"
border="surround"
v-model="item.num"
@blur="handleNum(item)"
></u-input>
</div>
</u-col>
</u-row>
</div>
</div>
</div>
<div v-if="detailList.length > 0" style="height: 60px"></div>
<div class="bt-btn" v-if="detailList.length > 0">
<u-button type="primary" text="保 存" style="margin: 8px 0" @click="submit"></u-button>
</div>
<!-- 选择器 -->
<u-picker
v-if="showPicker"
:show="showPicker"
:columns="[columns]"
keyName="label"
@cancel="showPicker = false"
@confirm="confirm"
></u-picker>
<!-- 日期 -->
<u-datetime-picker
v-if="showPickerTime"
:show="showPickerTime"
v-model="dataTime"
:max-date="Number(new Date())"
mode="date"
@cancel="showPickerTime = false"
@confirm="confirmTime"
></u-datetime-picker>
<!-- 类型弹出层 -->
<u-popup :show="showType" mode="center" :closeOnClickOverlay="false" round="8">
<div class="uPopup">
<div class="pop-title">选择退回的名称</div>
<u-input
v-model="typePopName"
placeholder="请输入名称"
suffixIcon="search"
suffixIconStyle="color: #666"
shape="circle"
@blur="handlePopSearch"
></u-input>
<!-- 列表 -->
<div class="type-list">
<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>
<span style="color: red">*</span>
退回数量
</div>
</u-col>
</u-row>
<div class="list-item" v-for="(item, index) in inventoryPopList" :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="right">
<div>
<u-input
type="number"
placeholder="返回数量"
border="surround"
v-model="item.num"
@blur="handleNum(item)"
></u-input>
</div>
</u-col>
</u-row>
</div>
</div>
<div style="height: 35px"></div>
<div class="btn">
<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>
</div>
</div>
</u-popup>
<!-- loading -->
<u-loading-page :loading="isLoading" icon-size="39" style="z-index: 99999"></u-loading-page>
</view>
</template>
<script>
import config from '@/config'
import { getProList, getMaTypeByReturnCheck, addData } from '@/api/aqSafety'
export default {
data() {
return {
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: [] //
},
rules: {
projectName: [{ required: true, message: '请选择退料工程', trigger: 'change' }],
backTime: [{ required: true, message: '请选择退料日期', trigger: 'change' }],
manager: [{ required: true, message: '请输入经办人', trigger: 'change' }],
phone: [{ required: true, message: '请输入经办人电话', trigger: 'change' }],
remark: [{ required: true, message: '请输入备注', trigger: 'change' }]
},
// 退-
detailList: [],
searchList: [], //
inventoryPopList: [], // 退
typeName: '', // 退-
typePopName: '' // 退-
}
},
onLoad() {
this.getProList()
this.getMaTypeByReturnCheck()
},
methods: {
// 退
async getProList() {
try {
const res = await getProList()
console.log('🚀 ~ getProList ~ res', res)
this.columns = res.data.map(item => {
return {
label: item.name,
value: item.id
}
})
} catch (error) {
console.log('🚀 ~ getProList ~ error', error)
}
},
//
handlePhone() {
if (!/^1[3456789]\d{9}$/.test(this.formData.phone)) {
this.$modal.msg('请输入正确的手机号')
this.formData.phone = ''
}
},
// -
async getMaTypeByReturnCheck() {
try {
const params = {
encryptedData: JSON.stringify({ keyWord: this.typePopName }),
pageNum: 1,
pageSize: 9999
}
const res = await getMaTypeByReturnCheck(params)
console.log('🚀 ~ getMaTypeByReturnCheck ~ res', res)
this.inventoryPopList = res.data.list
} catch (error) {
console.log('🚀 ~ getMaTypeByReturnCheck ~ error', error)
}
},
//
handleRightText() {
console.log('🚀 ~ handleRightText ~ ')
uni.navigateTo({
url: '/pages/returnInventory/returnInventoryRecord'
})
},
//
confirmTime(e) {
console.log('🚀 ~ confirmTime ~ e', e)
this.formData.backTime = this.formatTimestamp(e.value)
console.log('🚀 ~ confirmTime ~ this.formData.backTime:', this.formData.backTime)
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}`
},
//
confirm(e) {
console.log('🚀 ~ confirm ~ e', e)
this.formData.projectName = e.value[0].label
this.formData.projectId = e.value[0].value
this.showPicker = false
},
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)
},
handleNum(item) {
// 退-
const reg = /^[1-9]\d*$/
if (!reg.test(item.num)) {
this.$modal.msg('退回数量只能是正整数')
// .
item.num = item.num.replace(/\.\d+/, '')
}
},
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)
}
})
},
handleSearch() {
console.log('🚀 ~ handleSearch ~ ', this.typeName)
// , typeName
if (this.typeName == '') {
this.searchList = this.detailList
} else {
this.searchList = this.detailList.filter(item => item.name.includes(this.typeName))
}
},
handlePopSearch() {
console.log('🚀 ~ handlePopSearch ~ ')
this.getMaTypeByReturnCheck()
},
// 退
selectType() {
console.log('🚀 ~ selectType ~ ')
// inventoryPopList num 退, detailList
this.detailList = []
this.inventoryPopList.forEach(item => {
if (item.num) {
this.detailList.push(item)
}
})
this.searchList = this.detailList
console.log('🚀 ~ selectType ~ this.detailList:', this.detailList)
this.showType = false
},
// 退
handleShowType() {
// detailList ,
if (this.detailList.length > 0) {
this.inventoryPopList.forEach(item => {
this.detailList.forEach(list => {
if (item.modelId === list.modelId) {
item.num = list.num
}
})
})
}
setTimeout(() => {
this.showType = true
}, 200)
},
//
submit() {
console.log('🚀 ~ submit ~ ')
console.log('🚀 ~ submit ~ this.formData:', this.formData)
console.log('🚀 ~ submit ~ this.detailList:', this.detailList)
//
this.$refs.uForm.validate().then(res => {
try {
let valid = true
// 退
this.detailList.forEach(item => {
if (!item.num) {
this.$modal.msg('请填写退回数量')
valid = false
return
}
})
if (!valid) return
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,
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
}
}, 600)
})
.catch(error => {
console.error('文件上传过程中出现错误:', error)
this.isLoading = false
})
} catch (error) {
console.log('🚀 ~ submit ~ error', error)
this.isLoading = false
}
})
}
}
}
</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;
}
.uPopup {
width: 90vw;
height: 80vh;
background-color: #fff;
border-radius: 8px;
padding: 15px;
box-sizing: border-box;
overflow-y: auto;
.pop-title {
font-size: 16px;
font-weight: 800;
margin-bottom: 10px;
text-align: center;
color: #777;
}
.btn {
position: absolute;
bottom: 0px;
width: calc(90vw - 30px);
display: flex;
background-color: #fff;
}
}
</style>

View File

@ -1,130 +0,0 @@
<template>
<view>
<!-- 搜索 -->
<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="goDetail(item)">
<u-row justify="space-between" customStyle="margin-bottom: 10px; padding: 0 15px;">
<u-col span="6">
<div>{{ item.proName }}</div>
</u-col>
<u-col span="6">
<div style="text-align: end; color: #999">{{ item.code }}</div>
</u-col>
</u-row>
<u-line style="margin-bottom: 5px"></u-line>
<div class="list-item">
<span>数量</span>
<span>{{ item.num }}</span>
</div>
<div class="list-item">
<span>日期</span>
<span>{{ item.backTime }}</span>
</div>
<div class="list-item">
<span>备注</span>
<span>{{ item.remark }}</span>
</div>
</div>
<u-loadmore :status="status" line v-if="tableList.length > 10" />
<!-- 空状态 -->
<u-empty v-if="tableList.length == 0" mode="data"></u-empty>
</view>
</template>
<script>
import { getRecordList } from '@/api/aqSafety'
export default {
data() {
return {
keyWord: '',
status: 'loadmore',
pageNum: 1,
pageSize: 10,
total: 0,
tableList: []
}
},
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 getRecordList(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)
},
goDetail(item) {
const params = {
...item
}
uni.navigateTo({
url: `/pages/returnInventory/details?params=${JSON.stringify(params)}`
})
}
}
}
</script>
<style lang="scss">
page {
padding: 15px;
background-color: #f8f8f8;
}
.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;
}
}
</style>

View File

@ -1,128 +0,0 @@
<template>
<div>
<uni-section title="审核记录" type="line"></uni-section>
<div class="cont">
<div class="list-cont" v-for="(item, index) in tableList" :key="index">
<div class="top-item">
<div class="left-item">
<div class="circle"></div>
<div class="date">{{ item.date }}</div>
</div>
<div class="time">
<u-icon name="clock" style="margin-right: 5px"></u-icon>
{{ item.time }}
</div>
</div>
<div class="item-cont">
<div><u-icon name="/static/images/user.png" size="36" style="margin-right: 5px"></u-icon></div>
<div>
<div style="margin-bottom: 15px;">
<span>{{ item.name }}</span>
<span style="margin-right: 10px">{{ item.phone }}</span>
<span style="color: #bbb;">{{ item.company }}</span>
</div>
<div style="margin-bottom: 6px;">{{ item.content }}</div>
<div>备注{{ item.remark }}</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
opt: {
type: Object,
default: () => {}
}
},
data() {
return {
tableList: [
{
date: '08-01',
time: '2021-08-01 08:00',
content: '审核通过',
remark: '这是备注111',
name: '张三',
phone: '13888888888',
company: '机具公司'
},
{
date: '08-01',
time: '2021-08-01 08:00',
content: '审核通过',
remark: '这是备注222',
name: '李四',
phone: '13888888888',
company: '机具公司'
},
{
date: '08-01',
time: '2021-08-01 08:00',
content: '审核通过',
remark: '这是备注333',
name: '王五',
phone: '13888888888',
company: '机具公司'
},
{
date: '08-01',
time: '2021-08-01 08:00',
content: '审核通过',
remark: '这是备注444',
name: '赵六',
phone: '13888888888',
company: '机具公司'
}
]
}
},
mounted() {
console.log('🚀 ~ 详情 ~ this.opt', this.opt)
}
}
</script>
<style lang="scss" scoped>
.cont {
padding: 15px;
.top-item {
display: flex;
justify-content: space-between;
align-items: center;
color: #666;
.left-item {
display: flex;
align-items: center;
}
.circle {
width: 8px;
height: 8px;
border: 3px solid #409eff;
border-radius: 50%;
margin-right: 15px;
}
.time {
margin-right: 15px;
display: flex;
align-items: center;
}
}
.item-cont {
margin: 20px 0 20px 50px;
padding: 10px;
background-color: #fff;
color: #666;
border-radius: 8px;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
display: flex;
align-items: flex-start;
}
}
</style>

View File

@ -1,345 +0,0 @@
<template>
<div>
<uni-section title="派车明细" type="line"></uni-section>
<div
class="list-cont"
v-for="(item, index) in tableList"
:key="index"
:style="{ background: index == 0 ? '#E3EDF5' : '#E4EAF5' }"
>
<div
class="list-item top-item"
:style="{ background: index == 0 ? '#71BFF0' : '#7D9FF3', color: '#fff', borderRadius: '8px 8px 0 0' }"
>
<span class="mr-15" style="font-size: 21px; font-weight: 800">{{ index + 1 }}</span>
<u-icon
class="mr-15"
:color="index == 0 ? '#71BFF0' : '#7D9FF3'"
:name="index == 0 ? '/static/images/car.png' : '/static/images/car2.png'"
size="21"
></u-icon>
<span class="mr-15">{{ item.carName }}</span>
<span>{{ item.carType }}</span>
</div>
<div style="padding-left: 20px">
<div class="list-item">
<span>{{ item.name }}</span>
</div>
<div style="padding-left: 20px">
<div class="list-item">
<span class="mr-15">{{ item.carNum }}</span>
<span class="mr-15">{{ item.carType }}</span>
<span>{{ item.carLoad }}</span>
</div>
<div class="list-item">
<span>{{ item.tool }}</span>
</div>
<div class="list-item">
<span>{{ item.distance }}</span>
</div>
<div class="list-item">
<span>{{ item.company }}</span>
</div>
<div class="list-item">
<span>{{ item.address }}</span>
</div>
<div class="list-item">
<span class="mr-15">附件数量</span>
<span class="mr-15" style="color: #3c9cff">{{ (item.fileList && item.fileList.length) || 0 }}</span>
<span style="color: #3c9cff" @click="handleFile(item)">查看附件>></span>
</div>
</div>
</div>
</div>
<!-- btn -->
<div class="btn-wrap" v-if="opt.isAudit">
<div style="margin: 0 15px">
<u-button type="primary" @click="showModal = true"> </u-button>
</div>
</div>
<u-modal :show="showModal" title="派车审核" showCancelButton @cancel="showModal = false" @confirm="submit">
<view class="slot-content">
<div>
<div class="item-wrap">
<div class="item" :class="{ active: isPass }" @click="isPass = true">通过</div>
<div class="item" :class="{ active: !isPass }" @click="isPass = false">不通过</div>
</div>
<u-textarea
v-model="opinion"
placeholder="不通过必须填写审核不通过意见"
:rows="5"
maxlength="200"
count
></u-textarea>
</div>
</view>
</u-modal>
<!-- 附件弹出层 -->
<u-popup :show="showPop" mode="center" round="8" @close="showPop = false">
<div class="uPopup">
<div class="pop-title">{{ imgList && imgList.length > 0 ? imgList[current].title : '' }}</div>
<div class="content">
<u-swiper v-if="imgList.length > 0" :list="imgList" @change="e => (current = e.current)" :autoplay="false" @click="handleSwiper">
<view slot="indicator" class="indicator">
<view
class="indicator__dot"
v-for="(item, index) in imgList"
:key="index"
:class="[index === current && 'indicator__dot--active']"
></view>
</view>
</u-swiper>
</div>
<u-empty v-if="imgList.length == 0 || !imgList" mode="data"></u-empty>
</div>
</u-popup>
<!-- 空状态 -->
<u-empty v-if="tableList.length == 0" mode="data"></u-empty>
<!-- loading -->
<u-loading-page :loading="isLoading" icon-size="39" style="z-index: 99999"></u-loading-page>
</div>
</template>
<script>
export default {
props: {
opt: {
type: Object,
default: () => {}
}
},
data() {
return {
showModal: false,
isPass: true,
opinion: '', //
isLoading: false,
pageNum: 1,
pageSize: 10,
total: 0,
tableList: [
{
carName: '车辆名称',
carType: '车辆类型',
name: '姓名',
carNum: '车牌号',
carLoad: '车辆载重',
tool: '工具',
distance: '距离',
company: '公司',
address: '地址',
fileList: []
},
{
carName: '车辆名称',
carType: '车辆类型',
name: '姓名',
carNum: '车牌号',
carLoad: '车辆载重',
tool: '工具',
distance: '距离',
company: '公司',
address: '地址',
fileList: [
{
url: 'https://cdn.uviewui.com/uview/swiper/swiper1.png',
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
},
{
url: 'https://cdn.uviewui.com/uview/swiper/swiper2.png',
title: '身无彩凤双飞翼,心有灵犀一点通'
},
{
url: 'https://cdn.uviewui.com/uview/swiper/swiper3.png',
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
}
]
},
{
carName: '车辆名称',
carType: '车辆类型',
name: '姓名',
carNum: '车牌号',
carLoad: '车辆载重',
tool: '工具',
distance: '距离',
company: '公司',
address: '地址',
fileList: [
{
url: 'https://cdn.uviewui.com/uview/swiper/swiper1.png',
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
},
{
url: 'https://cdn.uviewui.com/uview/swiper/swiper2.png',
title: '身无彩凤双飞翼,心有灵犀一点通'
},
{
url: 'https://cdn.uviewui.com/uview/swiper/swiper3.png',
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
}
]
}
],
showPop: false,
imgList: [],
current: 0
}
},
mounted() {
console.log('🚀 ~ 计划审核 ~ this.opt', this.opt)
},
methods: {
//
handleFile(item) {
this.imgList = item.fileList
this.showPop = true
this.current = 0
console.log('🚀 ~ 查看附件 ~ item', item)
},
handleSwiper() {
//
uni.previewImage({
current: this.imgList[this.current].url,
urls: this.imgList.map((item) => item.url)
})
},
submit() {
console.log('🚀 ~ 提交 ~ submit ~ this.isPass', this.isPass)
console.log('🚀 ~ 提交 ~ submit ~ this.opinion', this.opinion)
}
}
}
</script>
<style lang="scss" scoped>
page {
padding-bottom: 70px;
white-space: pre-wrap;
word-wrap: break-word;
}
.list-cont {
color: #666;
margin: 15px;
margin-bottom: 15px;
border-radius: 8px;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
.list-item {
padding: 5px 15px;
.title {
color: #999;
}
div {
line-height: 1.9;
}
span {
line-height: 1.5;
}
}
.top-item {
display: flex;
align-items: center;
}
}
.btn-wrap {
width: 100%;
position: fixed;
bottom: 0;
left: 0;
background-color: #fff;
padding: 15px 0 20px;
}
.mr-15 {
margin-right: 15px;
}
.slot-content {
width: 100%;
height: 100%;
.item-wrap {
margin-bottom: 15px;
width: 100%;
height: 100%;
display: flex;
justify-content: space-between;
align-items: center;
.item {
width: 45%;
height: 30px;
display: flex;
justify-content: center;
align-items: center;
border: 1px solid #e8e8e8;
border-radius: 30px;
background-color: #f8f8f8;
color: #666;
font-size: 16px;
font-weight: 500;
transition: color 0.3s ease, background-color 0.3s ease, border 0.3s ease;
&.active {
color: $u-primary;
background-color: #f8f8f8;
border: 1px solid $u-primary;
}
}
}
}
.uPopup {
width: 90vw;
/* min-height: 30vh; */
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;
}
.content {
/* 居中*/
margin: 5vh auto;
}
}
.indicator {
@include flex(row);
justify-content: center;
&__dot {
height: 6px;
width: 6px;
border-radius: 100px;
background-color: rgba(255, 255, 255, 0.35);
margin: 0 5px;
transition: background-color 0.3s;
&--active {
background-color: #ffffff;
}
}
}
.indicator-num {
padding: 2px 0;
background-color: rgba(0, 0, 0, 0.35);
border-radius: 100px;
width: 35px;
@include flex;
justify-content: center;
&__text {
color: #ffffff;
font-size: 12px;
}
}
</style>

View File

@ -1,237 +0,0 @@
<template>
<div>
<uni-section title="基本信息" type="line"></uni-section>
<div class="list-cont">
<div class="list-item">
<div class="title">计划类型</div>
<div>{{ formData.planType }}</div>
</div>
<div class="list-item">
<div class="title">项目名称</div>
<div>{{ formData.proName }}</div>
</div>
<div class="list-item">
<div class="title">项目部分</div>
<div>{{ formData.proPart }}</div>
</div>
<div class="list-item">
<div class="title">工作内容</div>
<div>{{ formData.jobContent }}</div>
</div>
<div class="list-item">
<div class="title">需要日期</div>
<div>{{ formData.needDate }}</div>
</div>
<div class="list-item">
<div class="title">计划说明</div>
<div>{{ formData.explain }}</div>
</div>
</div>
<uni-section title="申请明细" type="line"></uni-section>
<div class="list-cont" v-for="(item, index) in tableList" :key="index">
<div class="list-item">
<span class="title"> &nbsp; &nbsp;</span>
<span>{{ item.type }}</span>
</div>
<div class="list-item">
<span class="title"> &nbsp; &nbsp;</span>
<span>{{ item.name }}</span>
</div>
<div class="list-item">
<span class="title"> &nbsp; &nbsp;</span>
<span>{{ item.specification }}</span>
</div>
<div class="list-item">
<span class="title"> &nbsp; &nbsp;</span>
<span>{{ item.unit }}</span>
</div>
<div class="list-item">
<span class="title"> </span>
<span>{{ item.num }}</span>
</div>
<div class="list-item">
<span class="title">需要天数</span>
<span>{{ item.date }}</span>
</div>
<div class="list-item">
<span class="title"> &nbsp; &nbsp;</span>
<span>{{ item.remark }}</span>
</div>
</div>
<!-- btn -->
<div class="btn-wrap" v-if="opt.isPlan">
<div style="margin: 0 15px">
<u-button type="primary" @click="showModal = true"> </u-button>
</div>
</div>
<!-- 弹框 -->
<u-modal :show="showModal" title="指定派车供应商" showCancelButton @cancel="showModal = false" @confirm="submit">
<view class="slot-content">
<div>
<u-radio-group v-model="radioValue" placement="column">
<u-radio
:customStyle="{ marginBottom: '8px' }"
v-for="(item, index) in radioList"
:key="index"
:label="item.name"
:name="item.value"
></u-radio>
</u-radio-group>
</div>
</view>
</u-modal>
<!-- 空状态 -->
<u-empty v-if="tableList.length == 0" mode="data"></u-empty>
</div>
</template>
<script>
export default {
props: {
opt: {
type: Object,
default: () => {}
}
},
data() {
return {
showModal: false,
radioValue: '',
formData: {
planType: '计划类型', //
proName: '项目名称', //
proPart: '项目部分', //
jobContent: '工作内容', //
needDate: '2025-01-01', //
explain: '这是计划说明' //
},
pageNum: 1,
pageSize: 10,
total: 0,
tableList: [
{
type: '类型1',
name: '名称1',
specification: '规格1',
unit: '单位1',
num: '数量1',
date: '需要天数1',
remark: '备注1'
},
{
type: '类型2',
name: '名称2',
specification: '规格2',
unit: '单位2',
num: '数量2',
date: '需要天数2',
remark: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
}
],
radioList: [
{
name: '苹果',
value: '1',
disabled: false
},
{
name: '香蕉',
value: '2',
disabled: false
},
{
name: '橙子',
value: '3',
disabled: false
},
{
name: '榴莲',
value: '4',
disabled: false
}
]
}
},
mounted() {
console.log('🚀 ~ 计划详情 ~ this.opt', this.opt)
},
methods: {
submit() {
console.log('🚀 ~ submit ~ this.radioValue', this.radioValue)
}
}
}
</script>
<style lang="scss" scoped>
page {
padding-bottom: 70px;
}
.list-cont {
margin: 15px;
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;
.title {
color: #999;
}
div {
line-height: 1.9;
}
span {
line-height: 1.5;
}
}
}
.btn-wrap {
width: 100%;
position: fixed;
bottom: 0;
left: 0;
background-color: #fff;
padding: 15px 0 20px;
}
.slot-content {
width: 100%;
height: 100%;
.item-wrap {
margin-bottom: 15px;
width: 100%;
height: 100%;
display: flex;
justify-content: space-between;
align-items: center;
.item {
width: 45%;
height: 30px;
display: flex;
justify-content: center;
align-items: center;
border: 1px solid #e8e8e8;
border-radius: 30px;
background-color: #f8f8f8;
color: #666;
font-size: 16px;
font-weight: 500;
transition: color 0.3s ease, background-color 0.3s ease, border 0.3s ease;
&.active {
color: $u-primary;
background-color: #f8f8f8;
border: 1px solid $u-primary;
}
}
}
}
</style>

View File

@ -1,85 +0,0 @@
<template>
<view>
<Navbar :title="navbarTitle" />
<div class="tabs" v-if="opt.isDetail">
<div class="item" :class="{ active: active == 1 }" @click="handleTab(1)">计划详情</div>
<div class="item" :class="{ active: active == 2 }" @click="handleTab(2)">派车详情</div>
<div class="item" :class="{ active: active == 3 }" @click="handleTab(3)" v-if="!opt.isArrival">审核记录</div>
</div>
<!-- <div v-if="opt.isDetail" style="height: 45px"></div> -->
<PlanDetails v-if="active == 1" :opt="opt" />
<PlanAuditDetails v-if="active == 2" :opt="opt" />
<AuditRecord v-if="active == 3" :opt="opt" />
</view>
</template>
<script>
import AuditRecord from './components/AuditRecord'
import PlanDetails from './components/PlanDetails'
import PlanAuditDetails from './components/PlanAuditDetails'
export default {
components: { AuditRecord, PlanDetails, PlanAuditDetails },
data() {
return {
opt: {},
navbarTitle: '详情',
active: 1
}
},
onLoad(opt) {
this.opt = JSON.parse(opt.params)
console.log('🚀 ~ onLoad ~ this.opt', this.opt)
this.active = this.opt.active
if (this.opt.isPlan) {
this.navbarTitle = '计划详情'
} else if (this.opt.isAudit) {
this.navbarTitle = '派车详情'
} else if (this.opt.isDetail && !this.opt.isArrival) {
this.navbarTitle = '派车详情'
} else {
this.navbarTitle = '详情'
}
},
methods: {
handleTab(index) {
this.active = index
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f8f8f8;
}
.tabs {
width: 100%;
/* position: fixed;
top: 44px;
left: 0; */
background-color: #fff;
z-index: 99;
display: flex;
justify-content: space-between;
background-color: #fff;
.item {
flex: 1;
text-align: center;
padding: 10px 0;
color: #666;
font-size: 16px;
font-weight: 500;
border-bottom: 2px solid #dcdcdc; //
transition: color 0.3s ease, border-bottom 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
//
&.active {
color: $u-primary;
border-bottom: 2px solid $u-primary;
background-color: #f8f8f8;
}
}
}
</style>

View File

@ -1,417 +0,0 @@
<template>
<view>
<div class="tabs">
<div class="item" :class="{ active: active == 1 }" @click="handleTab(1)">派车分配</div>
<div class="item" :class="{ active: active == 2 }" @click="handleTab(2)">派车审核</div>
</div>
<div style="height: 45px"></div>
<!-- 搜索 -->
<div class="search">
<div v-if="active == 2" style="width: 30%">
<u-cell-group :border="false">
<u-cell
:value="checkStatus"
isLink
:label="checkStatus ? '' : '审核状态'"
:border="false"
@click="showPicker = true"
></u-cell>
</u-cell-group>
</div>
<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="handleDetail(item)">
<u-row justify="space-between" customStyle="margin-bottom: 10px; padding: 0 15px;">
<u-col span="6">
<div>{{ item.code }}</div>
</u-col>
<u-col span="6" v-if="active == 1">
<div style="display: flex; justify-content: flex-end">
<u-tag text="已派车" type="success" v-if="item.isSend"></u-tag>
<u-tag text="待派车" type="warning" v-else></u-tag>
</div>
</u-col>
</u-row>
<u-line style="margin-bottom: 5px"></u-line>
<div class="list-item">
<span>工程名称</span>
<span>{{ item.proName }}</span>
</div>
<div class="list-item df-item">
<div>
<span>计划类型</span>
<span>{{ item.plan }}</span>
</div>
<div>
<u-tag v-if="active == 1 && !item.isSend" type="primary" text="派车分配" @click="openModal"></u-tag>
<u-tag v-else-if="active == 2 && item.status == 0" type="warning" text="审核" @click="openModal"></u-tag>
<u-tag text="已通过" type="success" v-else-if="active == 2 && item.status == 1"></u-tag>
</div>
</div>
<div class="list-item">
<span> </span>
<span>{{ item.sub }}</span>
</div>
</div>
<!-- 弹框 -->
<u-modal :show="showModal" :title="modalTitle" showCancelButton @cancel="showModal = false" @confirm="submit">
<view class="slot-content">
<div v-if="active == 1">
<u-radio-group v-model="radioValue" placement="column" @change="groupChange">
<u-radio
:customStyle="{ marginBottom: '8px' }"
v-for="(item, index) in radioList"
:key="index"
:label="item.name"
:name="item.value"
></u-radio>
</u-radio-group>
</div>
<div v-else>
<div class="item-wrap">
<div class="item" :class="{ active: isPass }" @click="isPass = true">通过</div>
<div class="item" :class="{ active: !isPass }" @click="isPass = false">不通过</div>
</div>
<u-textarea
v-model="opinion"
placeholder="不通过必须填写审核不通过意见"
:rows="5"
maxlength="200"
count
></u-textarea>
</div>
</view>
</u-modal>
<!-- 选择器 -->
<u-picker
v-if="showPicker"
:show="showPicker"
:columns="[columns]"
keyName="label"
@cancel="showPicker = false"
@confirm="confirm"
></u-picker>
<u-loadmore :status="status" line v-if="tableList.length > 10" />
<!-- 空状态 -->
<u-empty v-if="tableList.length == 0" mode="data"></u-empty>
</view>
</template>
<script>
import { getInventoryList } from '@/api/aqSafety'
export default {
data() {
return {
active: 1,
showModal: false,
modalTitle: '',
readonly: false,
keyWord: '',
status: 'loadmore',
pageNum: 1,
pageSize: 10,
total: 0,
tableList: [],
checkStatus: '', //
checkStatusId: '', // id
showPicker: false,
columns: [
{
label: '已审核',
value: 1
},
{
label: '待审核',
value: 0
}
],
//
radioList: [
{
name: '苹果',
value: '1',
disabled: false
},
{
name: '香蕉',
value: '2',
disabled: false
},
{
name: '橙子',
value: '3',
disabled: false
},
{
name: '榴莲',
value: '4',
disabled: false
}
],
radioValue: '', //
opinion: '', //
isPass: true //
}
},
computed: {
justifyContent() {
return this.active == 1 ? 'flex-start' : 'center'
}
},
onLoad() {
// this.getList()
},
methods: {
handleTab(index) {
this.active = index
if (index == 1) {
this.tableList = [
{
code: '20210801',
proName: '项目名称',
plan: '计划1',
sub: '供应商1',
//
isSend: true
},
{
code: '20210802',
proName: '项目名称',
plan: '计划2',
sub: '供应商2',
//
isSend: false
}
]
} else {
this.tableList = [
{
code: '20210803',
proName: '项目名称',
plan: '计划1',
sub: '供应商1',
status: 1
},
{
code: '20210804',
proName: '项目名称',
plan: '计划2',
sub: '供应商2',
status: 0
}
]
}
},
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 getInventoryList(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)
},
//
openModal() {
this.showModal = true
if (this.active == 1) {
this.modalTitle = '指定派车供应商'
this.radioValue = ''
} else {
this.modalTitle = '派车审核'
this.isPass = true
this.opinion = ''
}
},
confirm(e) {
console.log('🚀 ~ confirm ~ e', e)
this.checkStatus = e.value[0].label
this.checkStatusId = e.value[0].value
this.showPicker = false
},
groupChange() {
console.log('🚀 ~ radioValue', this.radioValue)
},
//
handleDetail(item) {
console.log('查看详情', item)
let isPlan = false
let isAudit = false
let isDetail = false
let active = null
if (this.active == 1 && !item.isSend) {
isPlan = true
active = 1
} else if (this.active == 2 && item.status == 0) {
isAudit = true
active = 2
} else if (item.isSend || item.status == 1) {
isDetail = true
active = 1
}
const params = {
...item,
isPlan,
isAudit,
isDetail,
active
}
uni.navigateTo({
url: `/pages/sendACarSystem/details?params=${JSON.stringify(params)}`
})
},
//
submit() {
console.log('提交')
if (this.active == 1) {
console.log('派车分配', this.radioValue)
if (!this.radioValue) {
uni.showToast({
title: '请选择派车供应商',
icon: 'none'
})
return
}
} else {
console.log('派车审核', this.isPass, this.opinion)
if (!this.isPass && !this.opinion) {
uni.showToast({
title: '请填写审核不通过意见',
icon: 'none'
})
return
}
}
this.showModal = false
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f8f8f8;
}
.search {
margin: 15px;
display: flex;
}
.list-cont {
margin: 15px;
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;
}
.df-item {
display: flex;
justify-content: space-between;
align-items: center;
}
}
.tabs {
width: 100%;
position: fixed;
top: 44px;
left: 0;
background-color: #fff;
z-index: 99;
display: flex;
justify-content: space-between;
background-color: #fff;
.item {
flex: 1;
text-align: center;
padding: 10px 0;
color: #666;
font-size: 16px;
font-weight: 500;
border-bottom: 2px solid #dcdcdc; //
transition: color 0.3s ease, border-bottom 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
//
&.active {
color: $u-primary;
border-bottom: 2px solid $u-primary;
background-color: #f8f8f8;
}
}
}
.slot-content {
width: 100%;
height: 100%;
.item-wrap {
margin-bottom: 15px;
width: 100%;
height: 100%;
display: flex;
justify-content: space-between;
align-items: center;
.item {
width: 45%;
height: 30px;
display: flex;
justify-content: center;
align-items: center;
border: 1px solid #e8e8e8;
border-radius: 30px;
background-color: #f8f8f8;
color: #666;
font-size: 16px;
font-weight: 500;
transition: color 0.3s ease, background-color 0.3s ease, border 0.3s ease;
&.active {
color: $u-primary;
background-color: #f8f8f8;
border: 1px solid $u-primary;
}
}
}
}
</style>

View File

@ -1,440 +0,0 @@
<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.kcNum }}</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.kcNum }}</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="startTime" borderBottom required>
<u-cell-group :border="false">
<u-cell
isLink
:label="formData.startTime ? '' : '请选择盘点日期'"
:value="formData.startTime"
:border="false"
@click="showPickerTime = true"
></u-cell>
</u-cell-group>
</u-form-item>
<u-form-item label="盘盈量" prop="pyNum" borderBottom required>
<u-input
v-model="formData.pyNum"
type="number"
placeholder="请输入盘盈量"
border="none"
inputAlign="right"
@blur="handleNumBlur(1)"
></u-input>
</u-form-item>
<u-form-item label="盘亏量" prop="pkNum" borderBottom required>
<u-input
v-model="formData.pkNum"
type="number"
placeholder="请输入盘亏量"
border="none"
inputAlign="right"
@blur="handleNumBlur(2)"
></u-input>
</u-form-item>
<u-form-item label="备注" prop="remark" required>
<u-textarea v-model="formData.remark" placeholder="请输入备注" :rows="5" maxlength="200" 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="3"
@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"
:max-date="Number(new Date())"
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 { getInventoryCountList, takeStock } 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
name: '',
model: '',
manager: '', //
startTime: '', //
endTime: '', //
pyNum: '', //
pkNum: '', //
remark: '', //
fileList: [], // -
uploadPaths: [] // -
},
rules: {
manager: [{ required: true, message: '请输入盘点人', trigger: 'blur' }],
startTime: [{ required: true, message: '请选择盘点日期', trigger: 'blur' }],
pyNum: [
{ required: true, message: '请输入盘盈量', trigger: 'blur' },
//
{
validator: (rule, value, callback) => {
if (!/^[0-9]\d*$/.test(value)) {
callback(new Error('请输入正整数'))
} else {
callback()
}
},
trigger: 'blur'
}
],
pkNum: [
{ 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 getInventoryCountList(params)
console.log('🚀 ~ getList ~ res', res)
this.tableList = res.data.list
this.total = res.data.total
} catch (error) {
console.log('🚀 ~ getList ~ error', error)
}
},
handleNumBlur(type) {
if (type === 1) {
if (this.formData.pyNum > 0) {
this.formData.pkNum = '0'
//
this.$refs.uForm.clearValidate('pkNum')
}
} else {
if (this.formData.pkNum > 0) {
this.formData.pyNum = '0'
//
this.$refs.uForm.clearValidate('pyNum')
}
}
},
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/stockTaking/takingRecord'
})
},
handleCheck(item) {
console.log('🚀 ~ handleCheck ~ item:', item)
this.pop = item
this.showType = true
//
this.$nextTick(() => {
// this.$refs.uForm.resetFields()
this.formData = {
modelId: item.id,
name: item.name,
model: item.model,
manager: '',
startTime: '',
endTime: '',
pyNum: '',
pkNum: '',
remark: '',
fileList: [], // -
uploadPaths: [] // -
}
})
},
//
confirmTime(e) {
console.log('🚀 ~ confirmTime ~ e', e)
this.formData.startTime = this.formData.endTime = this.formatTimestamp(e.value)
console.log('🚀 ~ confirmTime ~ this.formData.startTime:', this.formData.startTime)
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)
//
if (this.formData.pkNum > this.pop.kcNum) {
this.$modal.msg('盘亏量不能大于库存量')
return
}
//
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,
// model: this.pop.model,
// name: this.pop.name,
}
delete params.fileList
console.log('🚀 ~ submit ~ params:', params)
const encryptedData = JSON.stringify(params)
const res = await takeStock({ 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>

View File

@ -1,273 +0,0 @@
<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.pyNum }}</span>
</div>
<div class="list-item">
<span> </span>
<span style="color: #f9ae3d">{{ item.pkNum }}</span>
</div>
<div class="list-item">
<span>盘点日期</span>
<span>{{ item.startTime }}~{{ item.endTime }}</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.pyNum }}</div>
</u-col>
<u-col span="6">
<div style="text-align: end">盘亏量{{ pop.pkNum }}</div>
</u-col>
</u-row>
</div>
<u-line style="margin-bottom: 10px"></u-line>
<u-form :model="formData" 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="time" borderBottom>
<u-input
v-model="formData.time"
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="200"
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>
</view>
</template>
<script>
import config from '@/config'
import { getTakeStockRecordList, getTakeStockRecordDetail } from '@/api/aqSafety'
export default {
data() {
return {
actionUrl: config.baseUrl + config.uploadFileUrl,
token: uni.getStorageSync('App-Token'),
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: '', //
pyNum: '', //
backNum: '', //
remark: '', //
fileList: [], //
},
}
},
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 getTakeStockRecordList(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, applyId: this.pop.applyId })
}
console.log('🚀 ~ getDetail ~ params', params)
const res = await getTakeStockRecordDetail(params)
console.log('🚀 ~ getDetail ~ res', res)
this.formData = res.data
this.formData.time = this.formData.startTime + '~' + this.formData.endTime
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>