添加画作确认
This commit is contained in:
parent
f7c561866b
commit
60fb549d44
@ -55,3 +55,11 @@ export const bind = (data) => {
|
||||
data,
|
||||
});
|
||||
};
|
||||
//画桶添加或者更换画作
|
||||
export const add = (data) => {
|
||||
return request({
|
||||
url: "/containeradm/v1/painting_bucket/add_replace",
|
||||
method: "POST",
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
@ -27,7 +27,7 @@
|
||||
<span style="color:#BCBCBC;font-size: 16px;">平尺(寸):{{ painting.Ruler }}</span>
|
||||
</span>
|
||||
<up-radio-group
|
||||
v-model="painting.ArtistUuid"
|
||||
v-model="painting.checked"
|
||||
style="position: absolute;
|
||||
left: 550rpx;
|
||||
bottom: 150rpx;
|
||||
@ -35,7 +35,7 @@
|
||||
placement="right"
|
||||
@change="groupChange"
|
||||
>
|
||||
<up-radio :name="painting.ArtistUuid"></up-radio>
|
||||
<up-radio :name="painting.ArtworkUuid"></up-radio>
|
||||
</up-radio-group>
|
||||
</span>
|
||||
</view>
|
||||
@ -50,11 +50,12 @@
|
||||
>取消</up-button
|
||||
>
|
||||
<up-button
|
||||
style="width: 456rpx; margin: auto; height: 86rpx;"
|
||||
style="width: 336rpx; margin: auto; height: 80rpx;"
|
||||
color="#EFC54E"
|
||||
throttleTime="5"
|
||||
:loading="loading"
|
||||
:disabled="isButtonDisabled"
|
||||
@click="doneSet"
|
||||
> {{ buttonText }}</up-button
|
||||
>
|
||||
</view>
|
||||
@ -65,9 +66,8 @@
|
||||
import { ref, reactive, onBeforeMount } from "vue";
|
||||
import useToast from "@/hooks/toast/useToast.js";
|
||||
import { onLoad,onReachBottom } from "@dcloudio/uni-app";
|
||||
import { creChangepainting } from "@/api/login.js";
|
||||
import { creChangepainting,add } from "@/api/login.js";
|
||||
const { showMessage } = useToast();
|
||||
const value = ref(null)
|
||||
const loading = ref(false);
|
||||
const isButtonDisabled = ref(false);
|
||||
const buttonText = ref("确认");
|
||||
@ -77,6 +77,7 @@ const state = reactive({
|
||||
tableData:[],
|
||||
page:1,
|
||||
pageSize:10,
|
||||
selectedUuid:"",
|
||||
});
|
||||
onLoad((options) => {
|
||||
state.id = options.id;
|
||||
@ -84,7 +85,11 @@ state.pid = options.pid;
|
||||
paintingList()
|
||||
});
|
||||
const groupChange =(e) =>{
|
||||
console.log(e)
|
||||
state.tableData.forEach((item) =>{
|
||||
if(item.ArtworkUuid!==e){
|
||||
item.checked =''
|
||||
}
|
||||
})
|
||||
}
|
||||
// 获取可添加的画作列表
|
||||
const paintingList = async (param) => {
|
||||
@ -100,12 +105,49 @@ const paintingList = async (param) => {
|
||||
});
|
||||
if (res.status === 0) {
|
||||
loading.value = false
|
||||
state.tableData = res.data.Data
|
||||
state.tableData = res.data.Data.map((item) =>{
|
||||
return {
|
||||
...item,
|
||||
checked:''
|
||||
}
|
||||
})||[]
|
||||
console.log(1111,state.tableData)
|
||||
} else {
|
||||
showMessage({ type: "error", message: res.msg });
|
||||
}
|
||||
loading.value = false
|
||||
}
|
||||
//添加画作
|
||||
const doneSet = async () => {
|
||||
loading.value = true;
|
||||
const selectedPainting = state.tableData.find((item) => item.checked);
|
||||
if (selectedPainting) {
|
||||
const res = await add({
|
||||
type: "add",
|
||||
id: state.id,
|
||||
pid: state.pid,
|
||||
drawUid: selectedPainting.ArtworkUuid,
|
||||
drawName: selectedPainting.ArtworkName,
|
||||
drawerName: selectedPainting.ArtistName,
|
||||
drawerUid: selectedPainting.ArtistUuid,
|
||||
rulerNum:selectedPainting.Ruler,
|
||||
drawThumbnai:selectedPainting.HdPic,
|
||||
drawNum:selectedPainting.Tnum,
|
||||
drawerNum:selectedPainting.Tfnum,
|
||||
});
|
||||
if (res.status === 0) {
|
||||
showMessage({ type: "sucess", message: "添加画作成功" });
|
||||
isButtonDisabled.value = true;
|
||||
buttonText.value = "已添加";
|
||||
paintingList();
|
||||
} else {
|
||||
showMessage({ type: "error", message: res.msg });
|
||||
}
|
||||
} else {
|
||||
showMessage({ type: "error", message: "请先选择要添加的画作" });
|
||||
}
|
||||
loading.value = false;
|
||||
};
|
||||
const lower=() =>{
|
||||
console.log(888888)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user