更新代码

This commit is contained in:
xiao-fajia 2024-09-25 18:15:28 +08:00
parent 56ae63493d
commit d8036252db
7 changed files with 82 additions and 27 deletions

View File

@ -27,3 +27,10 @@ export function deleteOther(id){
method: "delete" method: "delete"
}) })
} }
export function getOtherByName(name){
return request({
url: preUrl + "/getByName?name=" + name,
method: "get"
})
}

View File

@ -51,3 +51,10 @@ export function exportRepairProjectExcel(params) {
responseType: 'blob' responseType: 'blob'
}) })
} }
export function getProjectByName(name){
return request({
url: "/repair/project/getByName?name=" + name,
method: "get",
})
}

View File

@ -43,3 +43,10 @@ export function getWaresPage(params) {
}) })
} }
export function getWaresByName(name){
return request({
url: "/repair/wares/getByName?name=" + name,
method: "get"
})
}

View File

@ -45,7 +45,7 @@ export default {
try { try {
await updateOther(this.formData) await updateOther(this.formData)
this.$modal.msgSuccess(this.formData.id ? "修改成功" : "新增成功") this.$modal.msgSuccess(this.formData.id ? "修改成功" : "新增成功")
this.$emit("success") this.$emit("success", this.formData.name)
} finally { } finally {
this.dialogVisible = false this.dialogVisible = false
this.formLoading = false this.formLoading = false

View File

@ -197,7 +197,7 @@ export default {
await RepairProjectApi.updateRepairProject(data); await RepairProjectApi.updateRepairProject(data);
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.dialogVisible = false; this.dialogVisible = false;
this.$emit('success'); this.$emit('success', this.formData.name);
return; return;
} }
// //

View File

@ -128,6 +128,10 @@ import RepairProjectForm from "@/views/repair/project/form/RepairProjectForm.vue
import ProjectChoose from "@/views/repair/Components/ProjectChoose.vue"; import ProjectChoose from "@/views/repair/Components/ProjectChoose.vue";
import OtherChoose from "@/views/repair/Components/OtherChoose.vue"; import OtherChoose from "@/views/repair/Components/OtherChoose.vue";
import OtherForm from "@/views/repair/other/OtherForm.vue"; import OtherForm from "@/views/repair/other/OtherForm.vue";
import request from "@/utils/request";
import {getOtherByName} from "@/api/repair/other";
import {getProjectByName} from "@/api/repair/project";
import {getWares, getWaresByName} from "@/api/repair/wares";
export default { export default {
name: "TicketItem", name: "TicketItem",
@ -143,12 +147,16 @@ export default {
}, },
inListData: { inListData: {
type: Array, type: Array,
default: () => {return []}, default: () => {
return []
},
required: false required: false
}, },
couponList: { couponList: {
type: Array, type: Array,
default: () => {return []}, default: () => {
return []
},
required: false required: false
} }
}, },
@ -333,15 +341,41 @@ export default {
break break
} }
}, },
returnProject(row) { async returnProject(name) {
// this.list.push(row) const res = await getProjectByName(name)
const data = res.data
}, if (data) {
returnPart(row) { this.list.splice(this.list.length - 1, 0, {
...data,
count: 1,
totalPrice: data.price
})
}
// this.list.push(row) // this.list.push(row)
}, },
returnOther() { async returnPart(name) {
const res = await getWaresByName(name)
const data = res.data
if (data) {
this.list.splice(this.list.length - 1, 0, {
...data,
count: 1,
totalPrice: data.price
})
}
// this.list.push(row)
},
async returnOther(name) {
const res = await getOtherByName(name)
const data = res.data
if (data) {
this.list.splice(this.list.length - 1, 0, {
...data,
count: 1,
totalPrice: data.price
})
}
}, },
getCouponName(id) { getCouponName(id) {
// this. // this.

View File

@ -290,7 +290,7 @@ export default {
await WaresApi.updateWares(data); await WaresApi.updateWares(data);
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.dialogVisible = false; this.dialogVisible = false;
this.$emit('success'); this.$emit('success', this.formData.name);
return; return;
} }
// //