更新代码
This commit is contained in:
parent
56ae63493d
commit
d8036252db
@ -27,3 +27,10 @@ export function deleteOther(id){
|
||||
method: "delete"
|
||||
})
|
||||
}
|
||||
|
||||
export function getOtherByName(name){
|
||||
return request({
|
||||
url: preUrl + "/getByName?name=" + name,
|
||||
method: "get"
|
||||
})
|
||||
}
|
||||
|
@ -51,3 +51,10 @@ export function exportRepairProjectExcel(params) {
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
export function getProjectByName(name){
|
||||
return request({
|
||||
url: "/repair/project/getByName?name=" + name,
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
@ -43,3 +43,10 @@ export function getWaresPage(params) {
|
||||
})
|
||||
}
|
||||
|
||||
export function getWaresByName(name){
|
||||
return request({
|
||||
url: "/repair/wares/getByName?name=" + name,
|
||||
method: "get"
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ export default {
|
||||
try {
|
||||
await updateOther(this.formData)
|
||||
this.$modal.msgSuccess(this.formData.id ? "修改成功" : "新增成功")
|
||||
this.$emit("success")
|
||||
this.$emit("success", this.formData.name)
|
||||
} finally {
|
||||
this.dialogVisible = false
|
||||
this.formLoading = false
|
||||
|
@ -197,7 +197,7 @@ export default {
|
||||
await RepairProjectApi.updateRepairProject(data);
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.dialogVisible = false;
|
||||
this.$emit('success');
|
||||
this.$emit('success', this.formData.name);
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
|
@ -128,6 +128,10 @@ import RepairProjectForm from "@/views/repair/project/form/RepairProjectForm.vue
|
||||
import ProjectChoose from "@/views/repair/Components/ProjectChoose.vue";
|
||||
import OtherChoose from "@/views/repair/Components/OtherChoose.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 {
|
||||
name: "TicketItem",
|
||||
@ -143,12 +147,16 @@ export default {
|
||||
},
|
||||
inListData: {
|
||||
type: Array,
|
||||
default: () => {return []},
|
||||
default: () => {
|
||||
return []
|
||||
},
|
||||
required: false
|
||||
},
|
||||
couponList: {
|
||||
type: Array,
|
||||
default: () => {return []},
|
||||
default: () => {
|
||||
return []
|
||||
},
|
||||
required: false
|
||||
}
|
||||
},
|
||||
@ -333,15 +341,41 @@ export default {
|
||||
break
|
||||
}
|
||||
},
|
||||
returnProject(row) {
|
||||
// this.list.push(row)
|
||||
|
||||
},
|
||||
returnPart(row) {
|
||||
async returnProject(name) {
|
||||
const res = await getProjectByName(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)
|
||||
},
|
||||
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) {
|
||||
// this.
|
||||
|
@ -290,7 +290,7 @@ export default {
|
||||
await WaresApi.updateWares(data);
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.dialogVisible = false;
|
||||
this.$emit('success');
|
||||
this.$emit('success', this.formData.name);
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
|
Loading…
Reference in New Issue
Block a user