报表申报智能运输页面完成
This commit is contained in:
@@ -11,23 +11,23 @@
|
||||
<!-- 列表 -->
|
||||
<z-paging ref="pagingRef" class="containerBox" v-model="infoList" @query="getTechnicalList">
|
||||
<uni-list class="listBox">
|
||||
<uni-list-item v-for="item in infoList" :key="item.id" clickable @click="onChecked(item)">
|
||||
<uni-list-item v-for="item in infoList" :key="item.id" clickable @tap="onChecked(item)">
|
||||
<template v-slot:body>
|
||||
<view style="display: flex; flex-direction: column; width: 100%;">
|
||||
<view class="line title">
|
||||
<!-- <view class="line title">
|
||||
<p>技术鉴定表</p>
|
||||
<p>{{ item?.appraisalNo }}</p>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="line content">
|
||||
<uv-upload :fileList="item?.fileUrlList" name="3" multiple :maxCount="6"
|
||||
:previewFullImage="true"></uv-upload>
|
||||
<uv-upload :fileList="item?.fileUrlList" name="3" multiple
|
||||
:maxCount="item?.fileUrlList?.length" :previewFullImage="true"></uv-upload>
|
||||
</view>
|
||||
|
||||
<view class="line content">
|
||||
<p>备注</p>
|
||||
<p>
|
||||
<span v-if="item?.appraisalDesc">{{ item?.appraisalDesc }}</span>
|
||||
<span v-else class="empty">未填写</span>
|
||||
<text v-if="item?.remark">{{ item?.remark }}</text>
|
||||
<text v-else class="empty">未填写</text>
|
||||
</p>
|
||||
</view>
|
||||
<view class="line content">
|
||||
@@ -69,7 +69,8 @@ const infoList = ref([])
|
||||
// 选中技术鉴定表
|
||||
const onChecked = (item) => {
|
||||
if (item.appraisalNo) {
|
||||
uni.setStorageSync('app_technical', item);
|
||||
|
||||
uni.setStorageSync('app_technical', { ...item, appraisalNo: undefined });
|
||||
uni.navigateTo({
|
||||
url: backUrl.value
|
||||
});
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<view class="contentBox">
|
||||
<!-- 技术鉴定表 -->
|
||||
<uv-form ref="formRef" class="form" :model="technicalEvaluationList" label-width="150rpx">
|
||||
<uv-form-item label="技术鉴定表" prop="fileList" @click="toTechnical">
|
||||
<uv-form-item label="技术鉴定表" prop="fileList" @tap="toTechnical">
|
||||
<u-cell>
|
||||
<view slot="title" class="u-slot-title">
|
||||
<text class="u-cell-text" v-if="technicalEvaluationList">
|
||||
@@ -24,7 +24,7 @@
|
||||
<material-list ref="materialRef" :formData="formData" isEdit="5" backStr="stockOut" :pathParams="pathParams" />
|
||||
<!-- 底部操作栏 -->
|
||||
<view class="bottom">
|
||||
<uv-button type="primary" @click="submitForm">出库</uv-button>
|
||||
<uv-button type="primary" @tap="submitForm">出库</uv-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -124,7 +124,7 @@ onMounted(() => {
|
||||
getMaterialList()
|
||||
})
|
||||
const toTechnical = () => {
|
||||
const query = objectToQuery(pathParams.value)
|
||||
const query = objectToQuery(pathParams?.value)
|
||||
|
||||
uni.navigateTo({
|
||||
url: `/pages/warehousing/stockOut/components/technicalEvaluation${query}`
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<navigation title="技术鉴定表详情" :back-url="backUrl">
|
||||
<template #right>
|
||||
<my-link @click="toMyTechnicalList" style="font-size: 14px;">我的</my-link>
|
||||
<my-link @tap="toMyTechnicalList" style="font-size: 14px;">我的</my-link>
|
||||
</template>
|
||||
</navigation>
|
||||
<view class="contentBox">
|
||||
@@ -17,7 +17,8 @@
|
||||
|
||||
</uv-form>
|
||||
<view class="bottom">
|
||||
<uv-button type="primary" @click="submitForm">提交信息</uv-button>
|
||||
<uv-button type="primary" v-if="!formModel?.appraisalNo" @tap="submitForm">提交信息</uv-button>
|
||||
<uv-button type="error" v-else @tap="delForm">删除</uv-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -27,36 +28,33 @@ import { ref } from 'vue';
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { objectToQuery } from '../../../until';
|
||||
import Navigation from '../../../components/Navigation.vue';
|
||||
import { uploadTechnicalFile, addWithFiles } from '@/api/stockOut'
|
||||
import { uploadTechnicalFile, addWithFiles, deleteAppraisal } from '@/api/stockOut'
|
||||
import _ from 'lodash';
|
||||
const queryParams = ref('')
|
||||
const formModel = ref({
|
||||
billNo: null,
|
||||
remark: '',
|
||||
appraisalNo: '',
|
||||
id: '',
|
||||
fileList: [],
|
||||
})
|
||||
const backUrl = ref('')
|
||||
const afterRead = async (event) => {
|
||||
// scene = outbound
|
||||
// bizType = technical_appraisal
|
||||
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
||||
console.log(event, '上传')
|
||||
let files = event.file?.map(file => file.url);
|
||||
// console.log('files', files);
|
||||
|
||||
let formData = {
|
||||
scene: 'OUTBOUND',
|
||||
bizType: 'TECHNICAL_APPRAISAL',
|
||||
}
|
||||
// files = files.map(p => ({ name: "files", uri: p }))
|
||||
uploadTechnicalFile(files, formData).then(res => {
|
||||
const some = _.some(res, { success: false })
|
||||
console.log(some,'上传接口调取成功', res)
|
||||
console.log(some, '上传接口调取成功', res)
|
||||
if (some) return;
|
||||
if (!formModel.value.fileList || formModel.value.fileList.length == 0) {
|
||||
formModel.value.fileList = []
|
||||
}
|
||||
res?.data?.fileUrlList.forEach(item => {
|
||||
res?.forEach(item => {
|
||||
formModel.value.fileList.push({ url: item?.url, name: item?.name, scene: 'OUTBOUND', bizType: 'TECHNICAL_APPRAISAL' })
|
||||
})
|
||||
})
|
||||
@@ -67,15 +65,49 @@ const deleteImg = (index, type) => {
|
||||
}
|
||||
// 提交
|
||||
const submitForm = () => {
|
||||
console.log(formModel, 'formModel==>');
|
||||
addWithFiles({ ...formModel.value, billNo: queryParams.value.billNo }).then((res) => {
|
||||
const params = {
|
||||
remark: formModel.value.remark,
|
||||
billNo: queryParams.value.billNo,
|
||||
fileList: formModel.value.fileList,
|
||||
}
|
||||
addWithFiles(params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
console.log(res.data);
|
||||
uni.setStorageSync('app_technical', {
|
||||
remark: res.data?.remark,
|
||||
appraisalNo: res.data.appraisalNo,
|
||||
id: res.data.id,
|
||||
createTime: res.data.createTime,
|
||||
fileList: res.data?.fileUrlList || [],
|
||||
});
|
||||
uni.navigateTo({
|
||||
url: backUrl.value
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
const delForm = () => {
|
||||
deleteAppraisal({ id: formModel.value?.id }).then((res) => {
|
||||
console.log(res, '删除');
|
||||
formModel.value = {
|
||||
billNo: null,
|
||||
remark: '',
|
||||
appraisalNo: '',
|
||||
id: '',
|
||||
fileList: [],
|
||||
}
|
||||
uni.removeStorageSync("app_technical");
|
||||
})
|
||||
}
|
||||
// 数据:获取缓存信息
|
||||
const getMaterialList = () => {
|
||||
// 获取技术鉴定表数据
|
||||
const list = uni.getStorageSync('app_technical') || {};
|
||||
formModel.value = list
|
||||
}
|
||||
getMaterialList()
|
||||
// 数据:路径参数
|
||||
onLoad((options) => {
|
||||
const query = objectToQuery(options)
|
||||
@@ -84,7 +116,6 @@ onLoad((options) => {
|
||||
|
||||
})
|
||||
const toMyTechnicalList = () => {
|
||||
console.log('1111111111');
|
||||
const query = objectToQuery(queryParams.value)
|
||||
uni.navigateTo({
|
||||
url: `/pages/warehousing/stockOut/components/myTechnicalEvaluation${query}`
|
||||
@@ -93,7 +124,7 @@ const toMyTechnicalList = () => {
|
||||
// 获取技术鉴定编数据
|
||||
const getTechnicalList = () => {
|
||||
const list = uni.getStorageSync('app_technical');
|
||||
formModel.value.fileList = list?.fileList
|
||||
formModel.value.fileList = list?.fileList || []
|
||||
formModel.value.remark = list?.remark
|
||||
}
|
||||
getTechnicalList()
|
||||
|
||||
Reference in New Issue
Block a user