parent
a8ce879d9e
commit
1dbc7f2fa2
|
@ -22,6 +22,11 @@ export function addWorkFlow(data) {
|
|||
return postData('workflow/addWorkFlow',data);
|
||||
}
|
||||
// 项目列表维护查询
|
||||
export function commonDate(data) {
|
||||
return postData('project/findProjectList',data);
|
||||
export function commonPost(url,data) {
|
||||
try {
|
||||
return postData(url,data);
|
||||
} catch (error) {
|
||||
return { code:500, message:'接口连接错误' }
|
||||
}
|
||||
|
||||
}
|
|
@ -107,7 +107,7 @@
|
|||
|
||||
</template>
|
||||
<script>
|
||||
import { commonDate } from "../../api/api.js"
|
||||
import { commonPost } from "../../api/api.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -119,24 +119,15 @@ export default {
|
|||
queryFrom: {projectName:'',createdStartDt:'',createdEndDt:''},
|
||||
selectShow: false,
|
||||
showTime: false,
|
||||
columns: [['全部', '针灸', '拔火罐']],
|
||||
columns: [],
|
||||
time: '',
|
||||
tableData: [{
|
||||
"sid": 5,
|
||||
"createdBy": "带头大哥",
|
||||
"createdDt": "2024-04-06T11:27:11.000+00:00",
|
||||
"projectName": "针灸1225",
|
||||
"unitPrice": 1750.00,
|
||||
"updateBy": "带头大哥",
|
||||
"updateDt": "2024-04-08 15:06:42",
|
||||
"createdDtFormatted": "2024-04-06 11:27:11"
|
||||
}]
|
||||
tableData: []
|
||||
}
|
||||
|
||||
},
|
||||
async onShow() {
|
||||
this.queryFunc()
|
||||
const res = await commonDate('project/findProjectNameList',{})
|
||||
const res = await commonPost('project/findProjectNameList',{})
|
||||
this.columns = res.data
|
||||
|
||||
},
|
||||
|
@ -162,7 +153,7 @@ export default {
|
|||
},
|
||||
async queryFunc() {
|
||||
this.showPop = false
|
||||
const res = await commonDate(this.queryFrom)
|
||||
const res = await commonPost(this.queryFrom)
|
||||
// console.log(res)
|
||||
if(res.code == 200){
|
||||
this.tableData = res.data
|
||||
|
@ -191,10 +182,13 @@ export default {
|
|||
this.addAndEditShow = true
|
||||
},
|
||||
async delItem(item) {
|
||||
const res = await commonDate('project/delProject',{sid:item.sid})
|
||||
const res = await commonPost('project/delProject',{sid:item.sid})
|
||||
if(res.code == 200){
|
||||
this.queryFunc()
|
||||
}
|
||||
if(res.code == 500){
|
||||
console.log(res.message)
|
||||
}
|
||||
},
|
||||
async commitInfo(){
|
||||
const {projectName,unitPrice,sid} = this.selectRow
|
||||
|
@ -207,17 +201,23 @@ export default {
|
|||
return
|
||||
}
|
||||
if(sid){
|
||||
const res = await commonDate('project/editProject',this.selectRow)
|
||||
const res = await commonPost('project/editProject',this.selectRow)
|
||||
if(res.code == 200){
|
||||
this.addAndEditShow = false
|
||||
this.queryFunc()
|
||||
}
|
||||
if(res.code == 500){
|
||||
console.log(res.message)
|
||||
}
|
||||
}else{
|
||||
const res = await commonDate('project/addProject',this.selectRow)
|
||||
const res = await commonPost('project/addProject',this.selectRow)
|
||||
if(res.code == 200){
|
||||
this.addAndEditShow = false
|
||||
this.queryFunc()
|
||||
}
|
||||
if(res.code == 500){
|
||||
console.log(res.message)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue