🦄 refactor: 票据审核页面代码重构

This commit is contained in:
ycy 2024-04-09 09:50:38 +08:00
parent 7407d6afa2
commit dc27f047f3
2 changed files with 14 additions and 10 deletions

View File

@ -122,12 +122,8 @@
style="margin-bottom: 0.5rem" style="margin-bottom: 0.5rem"
> >
<t-radio-group v-model="dialogData.Status"> <t-radio-group v-model="dialogData.Status">
<t-radio value="1" @change="refuse === false" <t-radio value="1" @click="refuse = false">审核通过</t-radio>
>审核通过</t-radio <t-radio value="2" @click="refuse = true">审核拒绝</t-radio>
>
<t-radio value="2" @change="refuse === true"
>审核拒绝</t-radio
>
</t-radio-group> </t-radio-group>
</t-form-item> </t-form-item>
<t-form-item /> <t-form-item />
@ -172,6 +168,7 @@ const destroyList = useDestroy();
const tableData = ref([]); const tableData = ref([]);
const data = ref([]); const data = ref([]);
const headerTitle = ref(""); const headerTitle = ref("");
const rowItem = ref({});
// //
const columns = ref([ const columns = ref([
{ {
@ -254,7 +251,7 @@ const refresh = () => {
// //
const dialogData = ref({ const dialogData = ref({
refuseInfo: "", refuseInfo: "",
status: "", Status: "",
}); });
// //
@ -322,7 +319,7 @@ const breakageAdd = () => {
visiblePost.value = true; visiblePost.value = true;
dialogData.value = { dialogData.value = {
refuseInfo: "", refuseInfo: "",
status: "", Status: "",
}; };
}; };
@ -339,8 +336,10 @@ const FORM_RULES = {
// //
const breakSub = async ({ validateResult, firstError }) => { const breakSub = async ({ validateResult, firstError }) => {
if (validateResult === true) { if (validateResult === true) {
dialogData.value.breakStatus = 0; dialogData.value = {
await breakageList.addBreakageList(dialogData.value); ...rowItem.row.value,
};
await destroyList.auditDestroyList(dialogData.value);
getNewTable(); getNewTable();
MessagePlugin.success("提交成功"); MessagePlugin.success("提交成功");
visiblePost.value = false; visiblePost.value = false;
@ -352,6 +351,7 @@ const breakSub = async ({ validateResult, firstError }) => {
// //
const breakEdit = (item) => { const breakEdit = (item) => {
visiblePost.value = true; visiblePost.value = true;
rowItem.value = item;
}; };
// //

View File

@ -14,6 +14,10 @@ export const useDestroy = defineStore("destroyList", {
console.log(this.destroyList); console.log(this.destroyList);
return this.destroyList; return this.destroyList;
}, },
auditDestroyList(item) {
console.log(item);
// let arr = thisz
},
}, },
persist: true, persist: true,
}); });