This commit is contained in:
parent
3f3638bcab
commit
dc44e00aec
|
|
@ -3,7 +3,8 @@
|
||||||
<canvas class="scroll-view" id="mycanvas" canvas-id="mycanvas"
|
<canvas class="scroll-view" id="mycanvas" canvas-id="mycanvas"
|
||||||
@touchstart="touchstart"
|
@touchstart="touchstart"
|
||||||
@touchmove="touchmove"
|
@touchmove="touchmove"
|
||||||
@touchend="touchend"/>
|
@touchend="touchend"
|
||||||
|
disable-scroll="true"/>
|
||||||
<view class="fun-box">
|
<view class="fun-box">
|
||||||
<view class="fun-box-btn clear flex" @click="clear">
|
<view class="fun-box-btn clear flex" @click="clear">
|
||||||
<text>清空</text>
|
<text>清空</text>
|
||||||
|
|
@ -76,31 +77,67 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//绘制路径
|
//绘制路径
|
||||||
|
// const draw = ()=> {
|
||||||
|
// let point1 = points[0]
|
||||||
|
// let point2 = points[1]
|
||||||
|
// points.shift()
|
||||||
|
// canvaCtx.moveTo(point1.X, point1.Y)
|
||||||
|
// canvaCtx.lineTo(point2.X, point2.Y)
|
||||||
|
// canvaCtx.stroke()
|
||||||
|
// canvaCtx.draw(true)
|
||||||
|
// }
|
||||||
const draw = () => {
|
const draw = () => {
|
||||||
let point1 = points[0]
|
if (points.length < 2) return;
|
||||||
let point2 = points[1]
|
|
||||||
points.shift()
|
canvaCtx.beginPath();
|
||||||
canvaCtx.moveTo(point1.X, point1.Y)
|
canvaCtx.moveTo(points[0].X, points[0].Y);
|
||||||
canvaCtx.lineTo(point2.X, point2.Y)
|
for (let i = 1; i < points.length; i++) {
|
||||||
canvaCtx.stroke()
|
canvaCtx.lineTo(points[i].X, points[i].Y);
|
||||||
canvaCtx.draw(true)
|
}
|
||||||
|
canvaCtx.stroke();
|
||||||
|
canvaCtx.draw(true);
|
||||||
|
|
||||||
|
// 绘制后清空已绘制点
|
||||||
|
points = [points[points.length - 1]]; // 保留最后一个点作为下一次起点
|
||||||
}
|
}
|
||||||
// 触摸结束,将未绘制的点清空防止对后续路径产生干扰
|
// 触摸结束,将未绘制的点清空防止对后续路径产生干扰
|
||||||
const touchend = e=>{
|
const touchend = e=>{
|
||||||
points = [];
|
points = [];
|
||||||
}
|
}
|
||||||
// 清空画布
|
// 清空画布
|
||||||
|
// const clear = ()=>{
|
||||||
|
// return uni.getSystemInfo()
|
||||||
|
// .then(res=>{
|
||||||
|
// canvaCtx.clearRect(0, 0, res.windowWidth, res.windowHeight);
|
||||||
|
// canvaCtx.draw(true);
|
||||||
|
// return res
|
||||||
|
// })
|
||||||
|
// .catch(err=>{
|
||||||
|
// // console.log(err);
|
||||||
|
// })
|
||||||
|
// }
|
||||||
const clear = () => {
|
const clear = () => {
|
||||||
return uni.getSystemInfo()
|
return new Promise((resolve, reject) => {
|
||||||
.then(res=>{
|
uni.createSelectorQuery()
|
||||||
canvaCtx.clearRect(0, 0, res.windowWidth, res.windowHeight);
|
.in(_this)
|
||||||
canvaCtx.draw(true);
|
.select('#mycanvas') // 确保 id 和 canvas 的一致性
|
||||||
return res
|
.fields({ size: true, rect: true }, data => {
|
||||||
|
if (!data) {
|
||||||
|
reject('Canvas not found')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const { width, height } = data
|
||||||
|
|
||||||
|
// 真正按 canvas 实际尺寸清除
|
||||||
|
canvaCtx.clearRect(0, 0, width, height)
|
||||||
|
canvaCtx.draw(true)
|
||||||
|
resolve()
|
||||||
})
|
})
|
||||||
.catch(err=>{
|
.exec()
|
||||||
// console.log(err);
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 确认
|
// 确认
|
||||||
const confirm = ()=>{
|
const confirm = ()=>{
|
||||||
uni.canvasToTempFilePath({ canvasId: 'mycanvas', }, _this, _this.parent)
|
uni.canvasToTempFilePath({ canvasId: 'mycanvas', }, _this, _this.parent)
|
||||||
|
|
|
||||||
|
|
@ -257,7 +257,7 @@ const uploadSignUrl = async (base64Data) => {
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.img {
|
.img {
|
||||||
height: 300px;
|
height: 500px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
@ -294,7 +294,7 @@ const uploadSignUrl = async (base64Data) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.signature-page {
|
.signature-page {
|
||||||
min-height: 99vh;
|
min-height: 94vh;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
|
||||||
|
|
@ -79,24 +79,24 @@
|
||||||
<div class="cont">{{ item.leasePerson }}</div>
|
<div class="cont">{{ item.leasePerson }}</div>
|
||||||
</uni-col>
|
</uni-col>
|
||||||
</uni-row>
|
</uni-row>
|
||||||
<uni-row :gutter="24">
|
<!-- <uni-row :gutter="24">
|
||||||
<uni-col :span="6">预领数量:</uni-col>
|
<uni-col :span="6">预领数量:</uni-col>
|
||||||
<uni-col :span="18">
|
<uni-col :span="18">
|
||||||
<div class="cont">{{ item.preCountNum }}</div>
|
<div class="cont">{{ item.preCountNum }}</div>
|
||||||
</uni-col>
|
</uni-col>
|
||||||
</uni-row>
|
</uni-row> -->
|
||||||
<uni-row :gutter="24">
|
<uni-row :gutter="24">
|
||||||
<uni-col :span="6">已领数量:</uni-col>
|
<uni-col :span="6">出库数量:</uni-col>
|
||||||
<uni-col :span="18">
|
<uni-col :span="18">
|
||||||
<div class="cont">{{ item.alNum }}</div>
|
<div class="cont">{{ item.alNum }}</div>
|
||||||
</uni-col>
|
</uni-col>
|
||||||
</uni-row>
|
</uni-row>
|
||||||
<uni-row :gutter="24">
|
<!-- <uni-row :gutter="24">
|
||||||
<uni-col :span="6">待领数量:</uni-col>
|
<uni-col :span="6">待领数量:</uni-col>
|
||||||
<uni-col :span="18">
|
<uni-col :span="18">
|
||||||
<div class="cont">{{ item.preCountNum - item.alNum }}</div>
|
<div class="cont">{{ item.preCountNum - item.alNum }}</div>
|
||||||
</uni-col>
|
</uni-col>
|
||||||
</uni-row>
|
</uni-row> -->
|
||||||
</uni-swipe-action-item>
|
</uni-swipe-action-item>
|
||||||
</uni-swipe-action>
|
</uni-swipe-action>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -116,11 +116,14 @@ import { onBackPress } from '@dcloudio/uni-app'
|
||||||
const total = ref(0) // 数据总量
|
const total = ref(0) // 数据总量
|
||||||
const active = ref(1) // tap索引
|
const active = ref(1) // tap索引
|
||||||
const tableList = ref([]) // 列表数据源
|
const tableList = ref([]) // 列表数据源
|
||||||
const dateArray = ref([]) // 日期范围
|
const dateArray = ref([
|
||||||
|
new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000).toISOString().split('T')[0],
|
||||||
|
new Date().toISOString().split('T')[0],
|
||||||
|
]) // 日期范围
|
||||||
// 查询参数
|
// 查询参数
|
||||||
const queryParams = ref({
|
const queryParams = ref({
|
||||||
startTime: '', // 开始时间
|
startTime: dateArray.value[0] || '', // 开始时间
|
||||||
endTime: '', // 结束时间
|
endTime: dateArray.value[1] || '', // 结束时间
|
||||||
keyWord: '', // 关键字
|
keyWord: '', // 关键字
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ export const getBackInfo = (id,keyWord) => {
|
||||||
export const getProjectList = (data) => {
|
export const getProjectList = (data) => {
|
||||||
return http({
|
return http({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: '/material/select/getProjectInfo',
|
url: '/material/select/getProjectList',
|
||||||
data:data,
|
data:data,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue