退料清点
This commit is contained in:
parent
7ae500dde2
commit
2020570835
|
|
@ -7,4 +7,40 @@ export function getInventoryList(params) {
|
|||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
// 退料工程-下拉
|
||||
export function getProList(params) {
|
||||
return request({
|
||||
url: '/app/common/getProList',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
// 退料物资列表
|
||||
export function getMaTypeByReturnCheck(params) {
|
||||
return request({
|
||||
url: '/app/common/getMaTypeByReturnCheck',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
// 退料清点-提交
|
||||
export function addData(data) {
|
||||
return request({
|
||||
url: '/app/returnCheck/addData',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 退料清点记录
|
||||
export function getRecordList(params) {
|
||||
return request({
|
||||
url: '/app/returnCheck/getRecordList',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ module.exports = {
|
|||
// baseUrl: 'https://vue.ruoyi.vip/prod-api',
|
||||
baseUrl: 'http://192.168.0.39:21995',
|
||||
baseUrl2: 'http://localhost:8080',
|
||||
uploadFileUrl: '/app/common/appUploadFile',
|
||||
// 应用信息
|
||||
appInfo: {
|
||||
// 应用名称
|
||||
|
|
|
|||
202
pages.json
202
pages.json
|
|
@ -1,109 +1,131 @@
|
|||
{
|
||||
"easycom": {
|
||||
"^u-(.*)": "uni_modules/uview-ui/components/u-$1/u-$1.vue"
|
||||
},
|
||||
"pages": [{
|
||||
"path": "pages/login",
|
||||
"style": {
|
||||
"navigationBarTitleText": "登录"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/register",
|
||||
"style": {
|
||||
"navigationBarTitleText": "注册"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "首页"
|
||||
// "navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/work/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "工作台"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/avatar/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "修改头像"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/info/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "个人信息"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/info/edit",
|
||||
"style": {
|
||||
"navigationBarTitleText": "编辑资料"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/pwd/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "修改密码"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/setting/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "应用设置"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/help/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "常见问题"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/mine/about/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "关于我们"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/common/webview/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "浏览网页"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/common/textview/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "浏览文本"
|
||||
}
|
||||
"^u-(.*)": "uni_modules/uview-ui/components/u-$1/u-$1.vue"
|
||||
},
|
||||
{
|
||||
"path" : "pages/inventory/index",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : "库存查询"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/returnInventory/index",
|
||||
"style" :
|
||||
{
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}],
|
||||
"pages": [
|
||||
{
|
||||
"path": "pages/login",
|
||||
"style": {
|
||||
"navigationBarTitleText": "登录"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/register",
|
||||
"style": {
|
||||
"navigationBarTitleText": "注册"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "首页"
|
||||
// "navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/work/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "工作台"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/mine/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/mine/avatar/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "修改头像"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/mine/info/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "个人信息"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/mine/info/edit",
|
||||
"style": {
|
||||
"navigationBarTitleText": "编辑资料"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/mine/pwd/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "修改密码"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/mine/setting/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "应用设置"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/mine/help/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "常见问题"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/mine/about/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "关于我们"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/webview/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "浏览网页"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/textview/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "浏览文本"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/inventory/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "库存查询"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/returnInventory/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/returnInventory/returnInventoryRecord",
|
||||
"style": {
|
||||
"navigationBarTitleText": "退料清点记录"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tabBar": {
|
||||
"color": "#000000",
|
||||
"selectedColor": "#000000",
|
||||
"borderStyle": "white",
|
||||
"backgroundColor": "#ffffff",
|
||||
"list": [{
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/index",
|
||||
"iconPath": "static/images/tabbar/home.png",
|
||||
"selectedIconPath": "static/images/tabbar/home_.png",
|
||||
"text": "首页"
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/work/index",
|
||||
"iconPath": "static/images/tabbar/work.png",
|
||||
"selectedIconPath": "static/images/tabbar/work_.png",
|
||||
"text": "工作台"
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/mine/index",
|
||||
"iconPath": "static/images/tabbar/mine.png",
|
||||
"selectedIconPath": "static/images/tabbar/mine_.png",
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ export default {
|
|||
url: this.goTo
|
||||
})
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
uni.reLaunch({
|
||||
url: '/pages/index'
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
<div>{{ item.name }}</div>
|
||||
</u-col>
|
||||
<u-col span="6">
|
||||
<div style="text-align: end; color: #999">{{ item.code }}</div>
|
||||
<div style="text-align: end; color: #999">{{ item.model }}</div>
|
||||
</u-col>
|
||||
</u-row>
|
||||
<u-line style="margin-bottom: 5px"></u-line>
|
||||
|
|
@ -28,15 +28,15 @@
|
|||
</div>
|
||||
<div class="list-item">
|
||||
<span>库存数量:</span>
|
||||
<span style="color: #5ae725">{{ item.storageNum }}</span>
|
||||
<span style="color: #5ae725">{{ item.kcNum }}</span>
|
||||
</div>
|
||||
<div class="list-item">
|
||||
<span>报废数量:</span>
|
||||
<span style="color: #f9ae3d">{{ item.scrapNum }}</span>
|
||||
<span style="color: #f9ae3d">{{ item.dbfNum }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<u-loadmore :status="status" line />
|
||||
<u-loadmore :status="status" line v-if="tableList.length > 0" />
|
||||
|
||||
<!-- 空状态 -->
|
||||
<u-empty v-if="tableList.length == 0" mode="data"></u-empty>
|
||||
|
|
@ -54,52 +54,12 @@ export default {
|
|||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
tableList: [
|
||||
{
|
||||
name: '针式资绝缘子',
|
||||
code: 'JKLYJ-10kV-120',
|
||||
type: '安全用品',
|
||||
storageNum: 1000,
|
||||
scrapNum: 100
|
||||
},
|
||||
{
|
||||
name: '针式资绝缘子',
|
||||
code: 'JKLYJ-10kV-120',
|
||||
type: '安全用品',
|
||||
storageNum: 1000,
|
||||
scrapNum: 100
|
||||
},
|
||||
{
|
||||
name: '针式资绝缘子',
|
||||
code: 'JKLYJ-10kV-120',
|
||||
type: '安全用品',
|
||||
storageNum: 1000,
|
||||
scrapNum: 100
|
||||
},
|
||||
{
|
||||
name: '针式资绝缘子',
|
||||
code: 'JKLYJ-10kV-120',
|
||||
type: '安全用品',
|
||||
storageNum: 1000,
|
||||
scrapNum: 100
|
||||
},
|
||||
{
|
||||
name: '针式资绝缘子',
|
||||
code: 'JKLYJ-10kV-120',
|
||||
type: '安全用品',
|
||||
storageNum: 1000,
|
||||
scrapNum: 100
|
||||
},
|
||||
{
|
||||
name: '针式资绝缘子',
|
||||
code: 'JKLYJ-10kV-120',
|
||||
type: '安全用品',
|
||||
storageNum: 1000,
|
||||
scrapNum: 100
|
||||
}
|
||||
]
|
||||
tableList: []
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
handleSearch() {
|
||||
this.pageSize = 10
|
||||
|
|
@ -108,15 +68,15 @@ export default {
|
|||
async getList() {
|
||||
try {
|
||||
const params = {
|
||||
keyWord: this.keyWord,
|
||||
encryptedData: JSON.stringify({ keyWord: this.keyWord }),
|
||||
pageNum: this.pageNum,
|
||||
pageSize: this.pageSize
|
||||
}
|
||||
console.log('🚀 ~ getList ~ params', params)
|
||||
const res = await getInventoryList
|
||||
const res = await getInventoryList(params)
|
||||
console.log('🚀 ~ getList ~ res', res)
|
||||
// this.tableList =
|
||||
// this.total = res.
|
||||
this.tableList = res.data.list
|
||||
this.total = res.data.total
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ getList ~ error', error)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,26 +1,26 @@
|
|||
<template>
|
||||
<view>
|
||||
<Navbar title="退料清点" :showRightText="true" :text="'退料记录'" @chickIcon="handleRightText" />
|
||||
<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="returnPro" borderBottom required>
|
||||
<u-form-item label="退料工程" prop="projectName" borderBottom required>
|
||||
<u-cell-group :border="false">
|
||||
<u-cell
|
||||
:value="formData.returnPro"
|
||||
:value="formData.projectName"
|
||||
isLink
|
||||
:label="formData.returnPro ? '' : '请选择退料工程'"
|
||||
:label="formData.projectName ? '' : '请选择退料工程'"
|
||||
:border="false"
|
||||
@click="showPicker = true"
|
||||
></u-cell>
|
||||
</u-cell-group>
|
||||
</u-form-item>
|
||||
<u-form-item label="退料日期" prop="returnTime" borderBottom required>
|
||||
<u-form-item label="退料日期" prop="backTime" borderBottom required>
|
||||
<u-cell-group :border="false">
|
||||
<u-cell
|
||||
isLink
|
||||
:label="formData.returnTime ? '' : '请选择发现日期'"
|
||||
:value="formData.returnTime"
|
||||
:label="formData.backTime ? '' : '请选择发现日期'"
|
||||
:value="formData.backTime"
|
||||
:border="false"
|
||||
@click="showPickerTime = true"
|
||||
></u-cell>
|
||||
|
|
@ -36,6 +36,8 @@
|
|||
placeholder="请输入经办人电话"
|
||||
border="none"
|
||||
inputAlign="right"
|
||||
maxlength="11"
|
||||
@blur="handlePhone"
|
||||
></u-input>
|
||||
</u-form-item>
|
||||
<u-form-item label="备注" prop="remark" required>
|
||||
|
|
@ -57,7 +59,7 @@
|
|||
|
||||
<uni-section title="退料物资明细" type="line"></uni-section>
|
||||
<div class="cont">
|
||||
<div class="list-no" v-if="inventoryList.length == 0">
|
||||
<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>
|
||||
|
|
@ -84,7 +86,7 @@
|
|||
</div>
|
||||
<div class="top-cont-item">
|
||||
<u-button
|
||||
type="primary"
|
||||
type="success"
|
||||
plain
|
||||
icon="coupon-fill"
|
||||
text="选择退料类型"
|
||||
|
|
@ -119,11 +121,17 @@
|
|||
<div>{{ item.name }}</div>
|
||||
</u-col>
|
||||
<u-col span="4" textAlign="center">
|
||||
<div>{{ item.code }}</div>
|
||||
<div>{{ item.model }}</div>
|
||||
</u-col>
|
||||
<u-col span="3" textAlign="right">
|
||||
<div>
|
||||
<u-input placeholder="返回数量" border="surround" v-model="item.returnNum"></u-input>
|
||||
<u-input
|
||||
type="number"
|
||||
placeholder="返回数量"
|
||||
border="surround"
|
||||
v-model="item.num"
|
||||
@blur="handleNum"
|
||||
></u-input>
|
||||
</div>
|
||||
</u-col>
|
||||
</u-row>
|
||||
|
|
@ -132,7 +140,7 @@
|
|||
</div>
|
||||
|
||||
<div style="height: 60px"></div>
|
||||
<div class="bt-btn" v-if="inventoryList.length > 0">
|
||||
<div class="bt-btn" v-if="detailList.length > 0">
|
||||
<u-button type="primary" text="保 存" style="margin: 8px 0" @click="submit"></u-button>
|
||||
</div>
|
||||
|
||||
|
|
@ -196,11 +204,17 @@
|
|||
<div>{{ item.name }}</div>
|
||||
</u-col>
|
||||
<u-col span="4" textAlign="center">
|
||||
<div>{{ item.code }}</div>
|
||||
<div>{{ item.model }}</div>
|
||||
</u-col>
|
||||
<u-col span="3" textAlign="right">
|
||||
<div>
|
||||
<u-input placeholder="返回数量" border="surround" v-model="item.returnNum"></u-input>
|
||||
<u-input
|
||||
type="number"
|
||||
placeholder="返回数量"
|
||||
border="surround"
|
||||
v-model="item.num"
|
||||
@blur="handleNum"
|
||||
></u-input>
|
||||
</div>
|
||||
</u-col>
|
||||
</u-row>
|
||||
|
|
@ -220,95 +234,99 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import config from '@/config'
|
||||
import { getProList, getMaTypeByReturnCheck, addData } from '@/api/aqSafety'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
actionUrl: '',
|
||||
actionUrl: config.baseUrl + config.uploadFileUrl,
|
||||
token: uni.getStorageSync('App-Token'),
|
||||
isLoading: false,
|
||||
showPicker: false,
|
||||
columns: [
|
||||
{
|
||||
label: '工程1',
|
||||
value: '1'
|
||||
},
|
||||
{
|
||||
label: '工程2',
|
||||
value: '2'
|
||||
},
|
||||
{
|
||||
label: '工程3',
|
||||
value: '3'
|
||||
}
|
||||
],
|
||||
columns: [],
|
||||
showPickerTime: false,
|
||||
dataTime: new Date().getTime(),
|
||||
dataTime: Number(new Date()),
|
||||
showType: false, // 退料类型弹框
|
||||
formData: {
|
||||
returnPro: '', // 退料工程
|
||||
returnProId: '', // 退料工程id
|
||||
returnTime: '', // 退料日期
|
||||
projectName: '', // 退料工程
|
||||
projectId: '', // 退料工程id
|
||||
backTime: '', // 退料日期
|
||||
manager: '', // 经办人
|
||||
phone: '', // 经办人电话
|
||||
remark: '', // 备注
|
||||
fileList: [] // 附件
|
||||
fileList: [], // 附件
|
||||
uploadPaths: [] // 上传文件
|
||||
},
|
||||
rules: {
|
||||
returnPro: [{ required: true, message: '请选择退料工程', trigger: 'change' }],
|
||||
returnTime: [{ required: true, message: '请选择退料日期', trigger: 'change' }],
|
||||
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' }]
|
||||
},
|
||||
// 退料物资明细-列表
|
||||
inventoryList: [],
|
||||
detailList: [],
|
||||
searchList: [], // 搜索列表
|
||||
inventoryPopList: [
|
||||
{
|
||||
name: '针式资绝缘子',
|
||||
code: 'JKLYJ-10kV-120',
|
||||
returnNum: 100
|
||||
},
|
||||
{
|
||||
name: '针式资绝缘子1',
|
||||
code: 'JKLYJ-10kV-120',
|
||||
returnNum: 100
|
||||
},
|
||||
{
|
||||
name: '针式资绝缘子2',
|
||||
code: 'JKLYJ-10kV-120',
|
||||
returnNum: 100
|
||||
},
|
||||
{
|
||||
name: '针式资绝缘子3',
|
||||
code: 'JKLYJ-10kV-120',
|
||||
returnNum: 100
|
||||
},
|
||||
{
|
||||
name: '针式资绝缘子4',
|
||||
code: 'JKLYJ-10kV-120',
|
||||
returnNum: 100
|
||||
},
|
||||
{
|
||||
name: '针式资绝缘子5',
|
||||
code: 'JKLYJ-10kV-120',
|
||||
returnNum: 100
|
||||
}
|
||||
], // 退料物资明细弹框列表
|
||||
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/returnInventoryRecord/index'
|
||||
// })
|
||||
uni.navigateTo({
|
||||
url: '/pages/returnInventory/returnInventoryRecord'
|
||||
})
|
||||
},
|
||||
// 日期选择器
|
||||
confirmTime() {
|
||||
this.formData.returnTime = this.formatTimestamp(this.dataTime)
|
||||
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
|
||||
|
|
@ -322,8 +340,8 @@ export default {
|
|||
// 选择器
|
||||
confirm(e) {
|
||||
console.log('🚀 ~ confirm ~ e', e)
|
||||
this.formData.returnPro = e.value[0].label
|
||||
this.formData.returnProId = e.value[0].value
|
||||
this.formData.projectName = e.value[0].label
|
||||
this.formData.projectId = e.value[0].value
|
||||
this.showPicker = false
|
||||
},
|
||||
selectImg(e) {
|
||||
|
|
@ -338,20 +356,29 @@ export default {
|
|||
this.formData.fileList.splice(e.index, 1)
|
||||
console.log('🚀 ~ deleteImg ~ this.formData.fileList:', this.formData.fileList)
|
||||
},
|
||||
handleNum() {
|
||||
// 校验退回数量-只能是正整数
|
||||
this.detailList.forEach(item => {
|
||||
if (!/^[1-9]\d*$/.test(item.num)) {
|
||||
this.$modal.msg('退回数量只能是正整数')
|
||||
// 去除.后面的数字
|
||||
item.num = item.num.replace(/\.\d+/, '')
|
||||
}
|
||||
})
|
||||
},
|
||||
upload(path) {
|
||||
uni.uploadFile({
|
||||
url: this.actionUrl,
|
||||
filePath: path,
|
||||
name: 'photoType',
|
||||
name: 'file',
|
||||
header: {
|
||||
Authorization: this.token,
|
||||
tokenType: 'APP'
|
||||
Authorization: this.token
|
||||
},
|
||||
success: res => {
|
||||
console.log('🚀 ~ selectImg ~ res:', res)
|
||||
console.log('🚀 ~ selectImg ~ res--data:', decryptCBC(JSON.parse(res.data).data))
|
||||
this.formData.handlePhotoList.push(JSON.parse(res.data).data[0])
|
||||
console.log('🚀 ~ upload ~ this.handlePhotoList:', this.formData.handlePhotoList)
|
||||
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)
|
||||
|
|
@ -362,36 +389,37 @@ export default {
|
|||
console.log('🚀 ~ handleSearch ~ ', this.typeName)
|
||||
// 前端搜索, 根据typeName搜索
|
||||
if (this.typeName == '') {
|
||||
this.searchList = this.inventoryList
|
||||
this.searchList = this.detailList
|
||||
} else {
|
||||
this.searchList = this.inventoryList.filter(item => item.name.includes(this.typeName))
|
||||
this.searchList = this.detailList.filter(item => item.name.includes(this.typeName))
|
||||
}
|
||||
},
|
||||
handlePopSearch() {
|
||||
console.log('🚀 ~ handlePopSearch ~ ')
|
||||
this.getMaTypeByReturnCheck()
|
||||
},
|
||||
// 选择退料类型
|
||||
selectType() {
|
||||
console.log('🚀 ~ selectType ~ ')
|
||||
// 根据 inventoryPopList 中的 returnNum 有值则为选择的退料类型, 将其添加到 inventoryList 中
|
||||
this.inventoryList = []
|
||||
// 根据 inventoryPopList 中的 num 有值则为选择的退料类型, 将其添加到 detailList 中
|
||||
this.detailList = []
|
||||
this.inventoryPopList.forEach(item => {
|
||||
if (item.returnNum) {
|
||||
this.inventoryList.push(item)
|
||||
if (item.num) {
|
||||
this.detailList.push(item)
|
||||
}
|
||||
})
|
||||
this.searchList = this.inventoryList
|
||||
console.log('🚀 ~ selectType ~ this.inventoryList:', this.inventoryList)
|
||||
this.searchList = this.detailList
|
||||
console.log('🚀 ~ selectType ~ this.detailList:', this.detailList)
|
||||
this.showType = false
|
||||
},
|
||||
// 显示退料类型弹框
|
||||
handleShowType() {
|
||||
// 如果 inventoryList 有值, 则回显到弹框中
|
||||
if (this.inventoryList.length > 0) {
|
||||
// 如果 detailList 有值, 则回显到弹框中
|
||||
if (this.detailList.length > 0) {
|
||||
this.inventoryPopList.forEach(item => {
|
||||
this.inventoryList.forEach(list => {
|
||||
if (item.name === list.name) {
|
||||
item.returnNum = list.returnNum
|
||||
this.detailList.forEach(list => {
|
||||
if (item.modelId === list.modelId) {
|
||||
item.num = list.num
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
@ -404,21 +432,59 @@ export default {
|
|||
submit() {
|
||||
console.log('🚀 ~ submit ~ ')
|
||||
console.log('🚀 ~ submit ~ this.formData:', this.formData)
|
||||
console.log('🚀 ~ submit ~ this.inventoryList:', this.inventoryList)
|
||||
console.log('🚀 ~ submit ~ this.detailList:', this.detailList)
|
||||
// 校验表单
|
||||
this.$refs.uForm.validate().then(res => {
|
||||
let valid = true
|
||||
// 校验退料物资明细
|
||||
this.inventoryList.forEach(item => {
|
||||
if (!item.returnNum) {
|
||||
this.$modal.msgError('请填写退回数量')
|
||||
valid = false
|
||||
return
|
||||
}
|
||||
})
|
||||
if (!valid) return
|
||||
console.log('🚀 ~ submit ~ 提交-校验通过')
|
||||
this.isLoading = true
|
||||
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 () => {
|
||||
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)
|
||||
}, 600)
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('文件上传过程中出现错误:', error)
|
||||
this.isLoading = false
|
||||
})
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ submit ~ error', error)
|
||||
this.isLoading = false
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,122 @@
|
|||
<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.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 > 0" />
|
||||
|
||||
<!-- 空状态 -->
|
||||
<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)
|
||||
}
|
||||
}
|
||||
}
|
||||
</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>
|
||||
|
|
@ -45,11 +45,11 @@ const user = {
|
|||
password: userInfo.password,
|
||||
// code: userInfo.code,
|
||||
// uuid: userInfo.uuid
|
||||
}
|
||||
};
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log('🚀 ~ login ~ formData11:', formData)
|
||||
console.log('🚀 ~ login ~ formData11:', formData);
|
||||
login(formData).then(res => {
|
||||
console.log('🚀 ~ login ~ res:', res)
|
||||
console.log('🚀 ~ login ~ res:', res);
|
||||
setToken(res.token);
|
||||
commit('SET_TOKEN', res.token);
|
||||
resolve();
|
||||
|
|
@ -84,16 +84,22 @@ const user = {
|
|||
// 退出系统
|
||||
LogOut({ commit, state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
logout(state.token).then(() => {
|
||||
commit('SET_TOKEN', '');
|
||||
commit('SET_ROLES', []);
|
||||
commit('SET_PERMISSIONS', []);
|
||||
removeToken();
|
||||
storage.clean();
|
||||
resolve();
|
||||
}).catch(error => {
|
||||
reject(error);
|
||||
});
|
||||
// logout(state.token).then(() => {
|
||||
// commit('SET_TOKEN', '');
|
||||
// commit('SET_ROLES', []);
|
||||
// commit('SET_PERMISSIONS', []);
|
||||
// removeToken();
|
||||
// storage.clean();
|
||||
// resolve();
|
||||
// }).catch(error => {
|
||||
// reject(error);
|
||||
// });
|
||||
commit('SET_TOKEN', '');
|
||||
commit('SET_ROLES', []);
|
||||
commit('SET_PERMISSIONS', []);
|
||||
removeToken();
|
||||
storage.clean();
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,52 +19,54 @@ const request = config => {
|
|||
config.header['Authorization'] = 'Bearer ' + getToken()
|
||||
}
|
||||
// get请求映射params参数
|
||||
if (config.params) {
|
||||
let url = config.url + '?' + tansParams(config.params)
|
||||
url = url.slice(0, -1)
|
||||
config.url = url
|
||||
}
|
||||
// if (config.method == 'get' && config.params) {
|
||||
// let param = tansParams(config.params)
|
||||
// if (param) {
|
||||
// param = param.slice(0, -1)
|
||||
// param = AES.encryptCBC(param)
|
||||
// }
|
||||
// let url = config.url + '?' + param
|
||||
// if (config.params) {
|
||||
// let url = config.url + '?' + tansParams(config.params)
|
||||
// url = url.slice(0, -1)
|
||||
// config.url = url
|
||||
// }
|
||||
// // post请求
|
||||
// if (config.method === 'post') {
|
||||
// config.header = {
|
||||
// ...config.header
|
||||
// }
|
||||
// config.data = AES.encryptCBC(JSON.stringify(config.data))
|
||||
// }
|
||||
// // put请求
|
||||
// if (config.method === 'put' && config.data) {
|
||||
// config.header = {
|
||||
// ...config.header
|
||||
// }
|
||||
// config.data = AES.encryptCBC(JSON.stringify(config.data))
|
||||
// } else if (config.method === 'put' && config.params) {
|
||||
// let params = tansParams(config.params)
|
||||
// params = AES.encryptCBC(params)
|
||||
// config.url = config.url + '?' + params
|
||||
// }
|
||||
// // delete请求
|
||||
// if (config.method === 'delete') {
|
||||
// config.header = {
|
||||
// ...config.header
|
||||
// }
|
||||
// config.data = AES.encryptCBC(JSON.stringify(config.data))
|
||||
// }
|
||||
// // post请求参数加密
|
||||
if (config.method == 'get' && config.params) {
|
||||
let param = tansParams(config.params)
|
||||
if (param) {
|
||||
param = param.slice(0, -1)
|
||||
// param = AES.encryptCBC(param)
|
||||
}
|
||||
// console.log('🚀 ~ file: request.js ~ line 108 ~ request ~ config.params', config.params)
|
||||
let url = config.url + '?' + param
|
||||
config.url = url
|
||||
}
|
||||
// post请求
|
||||
if (config.method === 'post') {
|
||||
config.header = {
|
||||
...config.header,
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
// config.data = AES.encryptCBC(JSON.stringify(config.data))
|
||||
}
|
||||
// put请求
|
||||
if (config.method === 'put' && config.data) {
|
||||
config.header = {
|
||||
...config.header
|
||||
}
|
||||
// config.data = AES.encryptCBC(JSON.stringify(config.data))
|
||||
} else if (config.method === 'put' && config.params) {
|
||||
let params = tansParams(config.params)
|
||||
// params = AES.encryptCBC(params)
|
||||
config.url = config.url + '?' + params
|
||||
}
|
||||
// delete请求
|
||||
if (config.method === 'delete') {
|
||||
config.header = {
|
||||
...config.header
|
||||
}
|
||||
// config.data = AES.encryptCBC(JSON.stringify(config.data))
|
||||
}
|
||||
// post请求参数加密
|
||||
// if (config.headers && config.headers['Content-Type'] == 'application/json') {
|
||||
// if (typeof config.data == 'object') {
|
||||
// config.data = AES.encryptCBC(JSON.stringify(config.data))
|
||||
// // config.data = AES.encryptCBC(JSON.stringify(config.data))
|
||||
// }
|
||||
// }
|
||||
// //对下载请求进行数据参数拦截加密
|
||||
//对下载请求进行数据参数拦截加密
|
||||
// if (config.headers && config.headers['Content-Type'] == 'application/x-www-form-urlencoded') {
|
||||
// if (typeof config.data == 'object') {
|
||||
// // console.log(config.data)
|
||||
|
|
@ -95,6 +97,7 @@ const request = config => {
|
|||
return
|
||||
}
|
||||
// res = JSON.parse(decryptCBC(res.data))
|
||||
console.log('🚀 ~ request.js ~ line 100 ~ res', res)
|
||||
const code = res.data.code || 200
|
||||
const msg = errorCode[code] || res.data.msg || errorCode['default']
|
||||
if (code === 401) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue