|
@ -1,57 +1,56 @@ |
|
|
<template> |
|
|
<template> |
|
|
<!-- <view class="deliver-container">p-deliver</view> --> |
|
|
<!-- <view class="deliver-container">p-deliver</view> --> |
|
|
|
|
|
<!-- TODO: if 是测试用的 --> |
|
|
<view class="my-2 bg-white p-2 rounded-md relative" @longpress="logoTime" v-if="deliverRef"> |
|
|
<view class="my-2 bg-white p-2 rounded-md relative" @longpress.prevent="showMask = true" v-if="deliverRef"> |
|
|
<!-- 插件名称输入和提交 --> |
|
|
<!-- 插件名称输入和提交 --> |
|
|
<view class="flex item-center justify-between py-3 pl-2" :class="inputRef"> |
|
|
<view class="flex item-center justify-between py-3 pl-2" :class="inputRef"> |
|
|
<!-- <u-input v-model="iptValue" type="text" :border="false" placeholder="请编辑交付物名称" /> --> |
|
|
<!-- <u-input v-model="iptValue" type="text" :border="false" placeholder="请编辑交付物名称" /> --> |
|
|
<!-- TODO: 可能会有多个交付物 需要遍历 或者展示第一个 --> |
|
|
<!-- TODO: 可能会有多个交付物 需要遍历 或者展示第一个 --> |
|
|
<!-- TODO: 应该是交付物的名称 --> |
|
|
<!-- TODO: 应该是交付物的名称 --> |
|
|
<view class="self-center flex-1">{{ task.name }}</view> |
|
|
<view :class="viewRef" class="flex-1"> |
|
|
|
|
|
<span class="relative px-1"> |
|
|
|
|
|
<u-badge :is-dot="true" is-center></u-badge> |
|
|
|
|
|
{{ task.name }} |
|
|
|
|
|
</span> |
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
<u-button type="primary" size="mini" @click="submit" class="self-center" :disabled="sbumitState">提交</u-button> |
|
|
<u-button type="primary" size="mini" @click="submit" class="self-center" :disabled="submitState">提交</u-button> |
|
|
|
|
|
|
|
|
<u-icon v-show="historyIcon" name="arrow-right" class="ml-1" @click="historical"></u-icon> |
|
|
<!-- 查看提交历史的按钮 --> |
|
|
</view> |
|
|
<u-icon name="arrow-right" class="ml-3" @click="openDeliverHistory"></u-icon> |
|
|
<view :class="viewRef" class="py-3 pl-2"> |
|
|
|
|
|
<span class="relative px-1"> |
|
|
|
|
|
<u-badge :is-dot="true" is-center></u-badge> |
|
|
|
|
|
{{ textValue }} |
|
|
|
|
|
</span> |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<!-- 插件上传方式 --> |
|
|
<!-- 插件上传方式 --> |
|
|
<view> |
|
|
<view> |
|
|
<u-input v-model="linkValue" type="text" :border="true" placeholder="请输入交付物地址/链接"> </u-input> |
|
|
<u-input v-model="linkValue" type="text" :border="true" placeholder="请输入交付物地址/链接"> </u-input> |
|
|
<view class="btns flexitems-start mt-3"> |
|
|
<view class="mt-3"> |
|
|
<u-button size="mini" :plain="true" style="color: #007aff" class="mr-3" @click="paste">粘贴</u-button> |
|
|
<u-button size="mini" type="primary" :plain="true" class="mr-3" @click="paste">粘贴</u-button> |
|
|
<u-button size="mini" :plain="true" style="color: #007aff" class="mr-3" @click="getfile">文件</u-button> |
|
|
<u-button size="mini" type="primary" :plain="true" class="mr-3" @click="uploadFile">文件</u-button> |
|
|
<u-button size="mini" :plain="true" style="color: #007aff" class="mr-3" @click="photos">拍照</u-button> |
|
|
<u-button size="mini" type="primary" :plain="true" class="mr-3" @click="uploadPhoto">拍照</u-button> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<!-- 提示框 --> |
|
|
<!-- 编辑交付物标题的modal --> |
|
|
|
|
|
<u-mask :show="showEditModal" @click="showEditModal = false"> |
|
|
<!-- 取消和确定 --> |
|
|
|
|
|
<u-mask :show="showRef" @click="showRef = false"> |
|
|
|
|
|
<view class="warp"> |
|
|
<view class="warp"> |
|
|
<view class="rect rounded-md" @tap.stop> |
|
|
<view class="rect rounded-md" @tap.stop> |
|
|
<view class="text-center my-7 font-semibold"> 交付物标题名称 </view> |
|
|
<view class="text-center my-7 font-semibold"> 交付物标题名称 </view> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
<u-input :border="true" class="m-5" placeholder="请输入交付物名称" v-model="newInputRef" /> |
|
|
<u-input :border="true" class="m-5" placeholder="请输入交付物名称" v-model="newInputRef" /> |
|
|
</view> |
|
|
</view> |
|
|
<view class="flex justify-around h-12 mt-7 justify-self-stretch" style="border-top: 1px solid #d1d5db"> |
|
|
<!-- TODO: 边框 --> |
|
|
<view class="leading-12 flex-1 text-center" style="border-right: 1px solid #d1d5db" @click="cancelClick"> 取消 </view> |
|
|
<view class="flex justify-around h-12 mt-7 justify-self-stretch"> |
|
|
<view class="text-blue-700 leading-12 flex-1 text-center" @click="sureClick"> 确定 </view> |
|
|
<view class="leading-12 flex-1 text-center" @click="showEditModal = false"> 取消 </view> |
|
|
|
|
|
<view class="text-blue-700 leading-12 flex-1 text-center" @click="confirmEditDeliverName"> 确定 </view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</u-mask> |
|
|
</u-mask> |
|
|
|
|
|
|
|
|
<!-- 编辑和删除的遮罩层 --> |
|
|
<!-- 编辑和删除的遮罩层 --> |
|
|
<view class="mask flex items-center justify-center bg-grey" :class="maskRef" @click="close"> |
|
|
<view class="mask flex items-center justify-center bg-grey" v-show="showMask" @click="showMask = false"> |
|
|
<view class="bg-yellow-500 text-white w-12 h-12 text-center leading-12 rounded-w-12 mx-8" @click="revisePlugin" @tap.stop>修改</view> |
|
|
<view class="bg-yellow-500 text-white w-12 h-12 text-center leading-12 rounded-w-12 mx-8" @click.stop="showEditModal = true">修改</view> |
|
|
<view class="bg-red-500 text-white w-12 h-12 text-center leading-12 rounded-w-12 mx-8" @click="deletePlugin" @tap.stop>删除</view> |
|
|
<view class="bg-red-500 text-white w-12 h-12 text-center leading-12 rounded-w-12 mx-8" @click.stop="deleteDeliver">删除</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<!-- 插件审核人员选择 --> |
|
|
<!-- 插件审核人员选择 --> |
|
@ -69,10 +68,9 @@ const deliverRef = ref(true); // 交付物插件的显示与销毁 |
|
|
const textValue = ref('入职插件V0.8原型输出'); // 插件名的值 |
|
|
const textValue = ref('入职插件V0.8原型输出'); // 插件名的值 |
|
|
const linkValue = ref(''); // 链接的值 |
|
|
const linkValue = ref(''); // 链接的值 |
|
|
const historyIcon = ref(false); // 查看历史记录的图标 |
|
|
const historyIcon = ref(false); // 查看历史记录的图标 |
|
|
const showRef = ref(false); // 编辑和删除页面 |
|
|
const showMask = ref(false); // 编辑和删除页面 |
|
|
const maskRef = ref('hidden'); // 带模态框的遮罩 |
|
|
const showEditModal = ref(false); // 编辑交付物标题的modal |
|
|
const inputRef = ref('block'); // 未点击提交按钮的状态框 |
|
|
|
|
|
const viewRef = ref('hidden'); // 点击提交按钮后的状态框 |
|
|
|
|
|
const newInputRef = ref(''); // 修改的插件名的值 |
|
|
const newInputRef = ref(''); // 修改的插件名的值 |
|
|
const submitHistory = reactive([]); // 提交的历史记录列表 |
|
|
const submitHistory = reactive([]); // 提交的历史记录列表 |
|
|
const reviewerData = ref(); |
|
|
const reviewerData = ref(); |
|
@ -80,7 +78,7 @@ const reviewerData = ref(); |
|
|
// const aa = this.$reviewer.arrList |
|
|
// const aa = this.$reviewer.arrList |
|
|
|
|
|
|
|
|
// 判断提交按钮的状态 |
|
|
// 判断提交按钮的状态 |
|
|
const sbumitState = computed(() => !linkValue.value); |
|
|
const submitState = computed(() => !linkValue.value); |
|
|
|
|
|
|
|
|
// 获取当前时间 |
|
|
// 获取当前时间 |
|
|
function getTime() { |
|
|
function getTime() { |
|
@ -115,7 +113,7 @@ function submit() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 查看历史记录 |
|
|
// 查看历史记录 |
|
|
function historical() { |
|
|
function openDeliverHistory() { |
|
|
const editItem = submitHistory; |
|
|
const editItem = submitHistory; |
|
|
uni.navigateTo({ url: `/pages/submitList/submitList?editItem=${encodeURIComponent(JSON.stringify(editItem))}` }); |
|
|
uni.navigateTo({ url: `/pages/submitList/submitList?editItem=${encodeURIComponent(JSON.stringify(editItem))}` }); |
|
|
// console.log(editItem) |
|
|
// console.log(editItem) |
|
@ -131,97 +129,52 @@ function paste() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 文件上传 |
|
|
// 文件上传 |
|
|
function getfile() { |
|
|
function uploadFile() { |
|
|
uni.chooseFile({ |
|
|
|
|
|
count: 1, // 默认100 |
|
|
|
|
|
extension: ['.zip', '.doc'], |
|
|
|
|
|
success(res) { |
|
|
|
|
|
linkValue.value = JSON.stringify(res.tempFilePaths); |
|
|
|
|
|
}, |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 拍照上传 |
|
|
|
|
|
function photos() { |
|
|
|
|
|
uni.chooseImage({ |
|
|
|
|
|
count: 1, // 默认9 |
|
|
|
|
|
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 |
|
|
|
|
|
sourceType: ['album', 'camera'], // 从相册选择 |
|
|
|
|
|
success(res) { |
|
|
|
|
|
linkValue.value = JSON.stringify(res.tempFilePaths); |
|
|
|
|
|
}, |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 查看历史记录 |
|
|
|
|
|
function historical() { |
|
|
|
|
|
uni.navigateTo({ url: '/pages/submitList/submitList' }); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 粘贴上传 |
|
|
|
|
|
function paste() { |
|
|
|
|
|
uni.getClipboardData({ |
|
|
|
|
|
success(res) { |
|
|
|
|
|
linkValue.value = res.data; |
|
|
|
|
|
}, |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 文件上传 |
|
|
|
|
|
function getfile() { |
|
|
|
|
|
uni.chooseFile({ |
|
|
uni.chooseFile({ |
|
|
count: 1, // 默认100 |
|
|
count: 1, // 默认100 |
|
|
extension: ['.zip', '.doc'], |
|
|
extension: ['.zip', '.doc'], |
|
|
success(res) { |
|
|
success(res) { |
|
|
|
|
|
// TODO: 发请求上传文件 api返回的url填到输入框 |
|
|
linkValue.value = JSON.stringify(res.tempFilePaths); |
|
|
linkValue.value = JSON.stringify(res.tempFilePaths); |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 拍照上传 |
|
|
// 拍照上传 |
|
|
function photos() { |
|
|
function uploadPhoto() { |
|
|
uni.chooseImage({ |
|
|
uni.chooseImage({ |
|
|
count: 1, // 默认9 |
|
|
count: 1, // 默认9 |
|
|
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 |
|
|
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 |
|
|
sourceType: ['album', 'camera'], // 从相册选择 |
|
|
sourceType: ['album', 'camera'], // 从相册选择 |
|
|
success(res) { |
|
|
success(res) { |
|
|
|
|
|
// TODO: 发请求上传文件 api返回的url填到输入框 |
|
|
linkValue.value = JSON.stringify(res.tempFilePaths); |
|
|
linkValue.value = JSON.stringify(res.tempFilePaths); |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function close() { |
|
|
// 确定修改交付物名称 |
|
|
maskRef.value = 'hidden'; |
|
|
function confirmEditDeliverName() { |
|
|
} |
|
|
// TODO: 发请求 请求成功后更新task里的交付物信息 |
|
|
|
|
|
if (!newInputRef.value) { |
|
|
// 长按出现遮罩(编辑和删除按钮) |
|
|
//TODO: 提示不能为空 |
|
|
function logoTime() { |
|
|
|
|
|
if (viewRef.value === 'block') { |
|
|
|
|
|
maskRef.value = 'block'; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
// 请求成功 才会清空 请求失败保留 |
|
|
// 修改插件按钮 |
|
|
|
|
|
function revisePlugin() { |
|
|
|
|
|
showRef.value = true; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 修改界面的取消按钮事件 |
|
|
|
|
|
function cancelClick() { |
|
|
|
|
|
showRef.value = false; |
|
|
|
|
|
// maskRef.value = 'hidden' |
|
|
|
|
|
} |
|
|
|
|
|
// 修改界面的确定按钮事件 |
|
|
|
|
|
function sureClick() { |
|
|
|
|
|
textValue.value = newInputRef.value; |
|
|
|
|
|
newInputRef.value = ''; |
|
|
newInputRef.value = ''; |
|
|
inputRef.value = 'block'; |
|
|
// |
|
|
viewRef.value = 'hidden'; |
|
|
|
|
|
historyIcon.value = true; |
|
|
historyIcon.value = true; |
|
|
showRef.value = false; |
|
|
|
|
|
maskRef.value = 'hidden'; |
|
|
|
|
|
} |
|
|
} |
|
|
// 删除插件按钮 |
|
|
|
|
|
function deletePlugin() { |
|
|
// 删除交付物按钮 |
|
|
|
|
|
async function deleteDeliver() { |
|
|
|
|
|
// TODO: 删除二次确认 |
|
|
|
|
|
// TODO: 确定后 发删除交付物的请求 |
|
|
|
|
|
try { |
|
|
|
|
|
await uni.$u.api.deleteDeliver(); |
|
|
|
|
|
uni.$ui.showToast("删除交付物成功"); |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.error('error: ', error); |
|
|
|
|
|
} |
|
|
deliverRef.value = false; |
|
|
deliverRef.value = false; |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|