fix
This commit is contained in:
parent
772b6c6bc4
commit
71807e8b76
@ -45,6 +45,7 @@
|
|||||||
color="#BABABA"
|
color="#BABABA"
|
||||||
throttleTime="5"
|
throttleTime="5"
|
||||||
v-if="state.boxRelBucketStatus == 1"
|
v-if="state.boxRelBucketStatus == 1"
|
||||||
|
@click="backScan"
|
||||||
>取消</up-button
|
>取消</up-button
|
||||||
>
|
>
|
||||||
<up-button
|
<up-button
|
||||||
|
@ -2,47 +2,73 @@
|
|||||||
<view class="content">
|
<view class="content">
|
||||||
<navBar> 添加画作 </navBar>
|
<navBar> 添加画作 </navBar>
|
||||||
<view class="container-box">
|
<view class="container-box">
|
||||||
<span style="font-weight: bold">
|
<span style="font-weight: bold"> 已扫画筒号:{{ state.pid }} </span>
|
||||||
已扫画筒号:{{state.pid }}
|
<view style="display: flex; align-items: center">
|
||||||
</span>
|
<up-input
|
||||||
<view style="display: flex; align-items: center;">
|
class="login-input"
|
||||||
<up-input class="login-input" placeholder="画家姓名/画作名称" v-model="state.searchValue" style="flex: 1; margin-right: 10rpx;" clearable>
|
placeholder="画家姓名/画作名称"
|
||||||
|
v-model="state.searchValue"
|
||||||
|
style="flex: 1; margin-right: 10rpx"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
</up-input>
|
</up-input>
|
||||||
|
|
||||||
<up-button style="width: 120rpx;
|
<up-button
|
||||||
height: 80rpx;
|
style="
|
||||||
margin-top: 15rpx;
|
width: 120rpx;
|
||||||
margin-left: 15rpx;"
|
height: 80rpx;
|
||||||
color="#EFC54E"
|
margin-top: 15rpx;
|
||||||
throttleTime="5"
|
margin-left: 15rpx;
|
||||||
:loading="loading"
|
"
|
||||||
@click="paintingList(state.page=1)">搜索</up-button>
|
color="#EFC54E"
|
||||||
|
throttleTime="5"
|
||||||
|
:loading="loading"
|
||||||
|
@click="paintingList((state.page = 1))"
|
||||||
|
>搜索</up-button
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<up-list @scrolltolower="scrolltolower" style="height:1120rpx">
|
<up-list @scrolltolower="scrolltolower" style="height: 1120rpx">
|
||||||
<up-list-item class="painting-box" v-for="(painting,index) in state.tableData" :key="index">
|
<up-list-item
|
||||||
<span style="display: flex; align-items: center;position: relative;" >
|
class="painting-box"
|
||||||
<up-image :show-loading="true" :src="painting.HdPic" width="100px" height="100px" @click = "enlarge(painting.HdPic)"></up-image>
|
v-for="(painting, index) in state.tableData"
|
||||||
<span style="display: flex; flex-direction: column; margin-left: 10px;">
|
:key="index"
|
||||||
<span style="font-weight: bold;" >{{painting.ArtworkName}}</span>
|
>
|
||||||
<span style="color:#BCBCBC;font-size: 16px;">画作编号:{{ painting.Tfnum }}</span>
|
<span style="display: flex; align-items: center; position: relative">
|
||||||
<span style="color:#BCBCBC;font-size: 16px;">画家编号:{{ painting.Tnum }}</span>
|
<up-image
|
||||||
<span style="color:#BCBCBC;font-size: 16px;">画家姓名:{{ painting.ArtistName }}</span>
|
:show-loading="true"
|
||||||
<span style="color:#BCBCBC;font-size: 16px;">平尺(寸):{{ painting.Ruler }}</span>
|
:src="painting.HdPic"
|
||||||
</span>
|
width="100px"
|
||||||
<up-radio-group
|
height="100px"
|
||||||
v-model="painting.checked"
|
@click="enlarge(painting.HdPic)"
|
||||||
style="position: absolute;
|
></up-image>
|
||||||
left: 550rpx;
|
<span
|
||||||
bottom: 150rpx;
|
style="display: flex; flex-direction: column; margin-left: 10px"
|
||||||
"
|
|
||||||
placement="right"
|
|
||||||
@change="groupChange"
|
|
||||||
>
|
>
|
||||||
<up-radio :name="painting.ArtworkUuid"></up-radio>
|
<span style="font-weight: bold">{{ painting.ArtworkName }}</span>
|
||||||
</up-radio-group>
|
<span style="color: #bcbcbc; font-size: 16px"
|
||||||
</span>
|
>画作编号:{{ painting.Tfnum }}</span
|
||||||
</up-list-item>
|
>
|
||||||
</up-list>
|
<span style="color: #bcbcbc; font-size: 16px"
|
||||||
|
>画家编号:{{ painting.Tnum }}</span
|
||||||
|
>
|
||||||
|
<span style="color: #bcbcbc; font-size: 16px"
|
||||||
|
>画家姓名:{{ painting.ArtistName }}</span
|
||||||
|
>
|
||||||
|
<span style="color: #bcbcbc; font-size: 16px"
|
||||||
|
>平尺(寸):{{ painting.Ruler }}</span
|
||||||
|
>
|
||||||
|
</span>
|
||||||
|
<up-radio-group
|
||||||
|
v-model="painting.checked"
|
||||||
|
style="position: absolute; left: 550rpx; bottom: 150rpx"
|
||||||
|
placement="right"
|
||||||
|
@change="groupChange"
|
||||||
|
>
|
||||||
|
<up-radio :name="painting.ArtworkUuid"></up-radio>
|
||||||
|
</up-radio-group>
|
||||||
|
</span>
|
||||||
|
</up-list-item>
|
||||||
|
</up-list>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="button-container">
|
<view class="button-container">
|
||||||
@ -50,26 +76,27 @@
|
|||||||
style="width: 336rpx; margin: auto; height: 80rpx"
|
style="width: 336rpx; margin: auto; height: 80rpx"
|
||||||
color="#BABABA"
|
color="#BABABA"
|
||||||
throttleTime="5"
|
throttleTime="5"
|
||||||
|
@click="backScan"
|
||||||
>取消</up-button
|
>取消</up-button
|
||||||
>
|
>
|
||||||
<up-button
|
<up-button
|
||||||
style="width: 336rpx; margin: auto; height: 80rpx;"
|
style="width: 336rpx; margin: auto; height: 80rpx"
|
||||||
color="#EFC54E"
|
color="#EFC54E"
|
||||||
throttleTime="5"
|
throttleTime="5"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:disabled="isButtonDisabled"
|
:disabled="isButtonDisabled"
|
||||||
@click="doneSet"
|
@click="doneSet"
|
||||||
> {{ buttonText }}</up-button
|
>
|
||||||
>
|
{{ buttonText }}</up-button
|
||||||
</view>
|
>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onBeforeMount } from "vue";
|
import { ref, reactive, onBeforeMount } from "vue";
|
||||||
import useToast from "@/hooks/toast/useToast.js";
|
import useToast from "@/hooks/toast/useToast.js";
|
||||||
import { onLoad,onReachBottom } from "@dcloudio/uni-app";
|
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
|
||||||
import { creChangepainting,add } from "@/api/login.js";
|
import { creChangepainting, add } from "@/api/login.js";
|
||||||
const { showMessage } = useToast();
|
const { showMessage } = useToast();
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const isButtonDisabled = ref(false);
|
const isButtonDisabled = ref(false);
|
||||||
@ -77,92 +104,92 @@ const buttonText = ref("确认");
|
|||||||
const state = reactive({
|
const state = reactive({
|
||||||
id: "",
|
id: "",
|
||||||
pid: "",
|
pid: "",
|
||||||
tableData:[],
|
tableData: [],
|
||||||
page:1,
|
page: 1,
|
||||||
pageSize:10,
|
pageSize: 10,
|
||||||
selectedUuid:"",
|
selectedUuid: "",
|
||||||
searchValue:"",
|
searchValue: "",
|
||||||
});
|
});
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
state.id = options.id;
|
state.id = options.id;
|
||||||
state.pid = options.pid;
|
state.pid = options.pid;
|
||||||
paintingList()
|
paintingList();
|
||||||
});
|
});
|
||||||
const groupChange =(e) =>{
|
const groupChange = (e) => {
|
||||||
state.tableData.forEach((item) =>{
|
state.tableData.forEach((item) => {
|
||||||
if(item.ArtworkUuid!==e){
|
if (item.ArtworkUuid !== e) {
|
||||||
item.checked =''
|
item.checked = "";
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
// 获取可添加的画作列表
|
// 获取可添加的画作列表
|
||||||
const paintingList = async (param) => {
|
const paintingList = async (param) => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const res = await creChangepainting({
|
const res = await creChangepainting({
|
||||||
Tfnum: "",
|
Tfnum: "",
|
||||||
ArtworkName: "",
|
ArtworkName: "",
|
||||||
Tnum: "",
|
Tnum: "",
|
||||||
ArtistName: "",
|
ArtistName: "",
|
||||||
page: state.page,
|
page: state.page,
|
||||||
pageSize: state.pageSize,
|
pageSize: state.pageSize,
|
||||||
keywords: state.searchValue,
|
keywords: state.searchValue,
|
||||||
...param,
|
...param,
|
||||||
});
|
});
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
if (res.status === 0) {
|
if (res.status === 0) {
|
||||||
if (res.data.Data !== null) {
|
if (res.data.Data !== null) {
|
||||||
state.tableData = res.data.Data.map((item) => {
|
state.tableData = res.data.Data.map((item) => {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
checked: ''
|
checked: "",
|
||||||
}
|
};
|
||||||
});
|
});
|
||||||
console.log(1111, state.tableData);
|
console.log(1111, state.tableData);
|
||||||
} else {
|
|
||||||
state.tableData = [];
|
|
||||||
showMessage({ type: "error", message: "查询失败,暂无画作!" });
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
showMessage({ type: "error", message: res.msg });
|
state.tableData = [];
|
||||||
|
showMessage({ type: "error", message: "查询失败,暂无画作!" });
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
showMessage({ type: "error", message: res.msg });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
//添加画作
|
//添加画作
|
||||||
const doneSet = async () => {
|
const doneSet = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const selectedPainting = state.tableData.find((item) => item.checked);
|
const selectedPainting = state.tableData.find((item) => item.checked);
|
||||||
if (selectedPainting) {
|
if (selectedPainting) {
|
||||||
const res = await add({
|
const res = await add({
|
||||||
type: "add",
|
type: "add",
|
||||||
id: state.id,
|
id: state.id,
|
||||||
pid: state.pid,
|
pid: state.pid,
|
||||||
drawUid: selectedPainting.ArtworkUuid,
|
drawUid: selectedPainting.ArtworkUuid,
|
||||||
drawName: selectedPainting.ArtworkName,
|
drawName: selectedPainting.ArtworkName,
|
||||||
drawerName: selectedPainting.ArtistName,
|
drawerName: selectedPainting.ArtistName,
|
||||||
drawerUid: selectedPainting.ArtistUuid,
|
drawerUid: selectedPainting.ArtistUuid,
|
||||||
rulerNum:selectedPainting.Ruler,
|
rulerNum: selectedPainting.Ruler,
|
||||||
drawThumbnail:selectedPainting.HdPic,
|
drawThumbnail: selectedPainting.HdPic,
|
||||||
drawerNum:selectedPainting.Tnum,//画家编号
|
drawerNum: selectedPainting.Tnum, //画家编号
|
||||||
drawNum:selectedPainting.Tfnum,
|
drawNum: selectedPainting.Tfnum,
|
||||||
});
|
});
|
||||||
if (res.status === 0) {
|
if (res.status === 0) {
|
||||||
showMessage({ type: "sucess", message: "添加画作成功" });
|
showMessage({ type: "sucess", message: "添加画作成功" });
|
||||||
isButtonDisabled.value = true;
|
isButtonDisabled.value = true;
|
||||||
buttonText.value = "已添加";
|
buttonText.value = "已添加";
|
||||||
state.searchValue = "";
|
state.searchValue = "";
|
||||||
// 重新获取初始画作列表
|
// 重新获取初始画作列表
|
||||||
paintingList({
|
paintingList({
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
keywords: ""
|
keywords: "",
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
showMessage({ type: "error", message: res.msg });
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
showMessage({ type: "error", message: "请先选择要添加的画作" });
|
showMessage({ type: "error", message: res.msg });
|
||||||
}
|
}
|
||||||
loading.value = false;
|
} else {
|
||||||
|
showMessage({ type: "error", message: "请先选择要添加的画作" });
|
||||||
|
}
|
||||||
|
loading.value = false;
|
||||||
};
|
};
|
||||||
//下拉刷新数据
|
//下拉刷新数据
|
||||||
const scrolltolower = async () => {
|
const scrolltolower = async () => {
|
||||||
@ -174,33 +201,37 @@ const scrolltolower = async () => {
|
|||||||
ArtistName: "",
|
ArtistName: "",
|
||||||
page: state.page,
|
page: state.page,
|
||||||
pageSize: state.pageSize,
|
pageSize: state.pageSize,
|
||||||
keywords: state.searchValue
|
keywords: state.searchValue,
|
||||||
});
|
});
|
||||||
if (res.status === 0) {
|
if (res.status === 0) {
|
||||||
if(res.data.Data!==null){ const newData = res.data.Data.map((item) => {
|
if (res.data.Data !== null) {
|
||||||
return {
|
const newData = res.data.Data.map((item) => {
|
||||||
...item,
|
return {
|
||||||
checked: ''
|
...item,
|
||||||
}
|
checked: "",
|
||||||
});
|
};
|
||||||
const uniqueData = newData.filter((newItem) => {
|
});
|
||||||
return!state.tableData.some((existingItem) => existingItem.ArtworkUuid === newItem.ArtworkUuid);
|
const uniqueData = newData.filter((newItem) => {
|
||||||
});
|
return !state.tableData.some(
|
||||||
state.tableData = state.tableData.concat(uniqueData);
|
(existingItem) => existingItem.ArtworkUuid === newItem.ArtworkUuid
|
||||||
} }
|
);
|
||||||
else {
|
});
|
||||||
showMessage({type: "error", message: res.msg});
|
state.tableData = state.tableData.concat(uniqueData);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
showMessage({ type: "error", message: res.msg });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
//点击照片预览
|
//点击照片预览
|
||||||
const enlarge=(src) =>{
|
const enlarge = (src) => {
|
||||||
uni.previewImage({
|
uni.previewImage({
|
||||||
urls: [src],
|
urls: [src],
|
||||||
current: src
|
current: src,
|
||||||
});
|
});
|
||||||
|
};
|
||||||
}
|
const backScan = () => {
|
||||||
|
closeWebview();
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@ -217,7 +248,7 @@ page {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
.container-box {
|
.container-box {
|
||||||
height: auto;
|
height: auto;
|
||||||
width: 95%;
|
width: 95%;
|
||||||
@ -250,18 +281,17 @@ page {
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
box-shadow: 0 0 6px rgba(219, 218, 218, 0.5);
|
box-shadow: 0 0 6px rgba(219, 218, 218, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
.button-container {
|
.button-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 1rpx;
|
bottom: 1rpx;
|
||||||
left: 0;
|
left: 0;
|
||||||
padding: 0 20rpx;
|
padding: 0 20rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
height: 8%;
|
height: 8%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -120,6 +120,7 @@ const closeFn = async () => {
|
|||||||
showMessage({ type: "error", message: "取消入库" });
|
showMessage({ type: "error", message: "取消入库" });
|
||||||
closeButton.value = true;
|
closeButton.value = true;
|
||||||
isButtonDisabled.value = true;
|
isButtonDisabled.value = true;
|
||||||
|
closeWebview();
|
||||||
} else {
|
} else {
|
||||||
showMessage({ type: "error", message: res.msg });
|
showMessage({ type: "error", message: res.msg });
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user