13 changed files with 484 additions and 38 deletions
-
16src/pages.json
-
10src/pages/menu/forth.vue
-
33src/store/actions.js
-
4src/subpackage/message/components/edit/fixed_button.vue
-
78src/subpackage/message/components/edit/info_edit.vue
-
104src/subpackage/message/components/edit/upload_img.vue
-
2src/subpackage/message/components/fixed_button.vue
-
21src/subpackage/message/components/message_item.vue
-
11src/subpackage/message/js/api.js
-
9src/subpackage/message/js/server.js
-
73src/subpackage/message/pages/complaint/edit.vue
-
62src/subpackage/message/pages/complaint/list.vue
-
99src/subpackage/message/pages/work_order/edit.vue
@ -0,0 +1,11 @@ |
|||||
|
import { ORIGIN } from '@/js/api'; |
||||
|
|
||||
|
export const MESSAGE_API = { |
||||
|
zs_message_imgs:`${ORIGIN}/upload/file/zs_message_imgs`, // 投诉/工单图片
|
||||
|
complaintSubmit:`${ORIGIN}/admin/assistant/complaint/submit`, // 投诉提交
|
||||
|
complaintList:`${ORIGIN}/admin/assistant/complaint/list`, // 投诉列表
|
||||
|
workorderSubmit:`${ORIGIN}/admin/assistant/workorder/submit`, // 工单提交
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
export default { ORIGIN, MESSAGE_API }; |
@ -0,0 +1,9 @@ |
|||||
|
import { Server } from '@/js/server'; |
||||
|
|
||||
|
class _server extends Server { |
||||
|
constructor(props){ |
||||
|
super(props) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
export default new _server(); |
@ -0,0 +1,99 @@ |
|||||
|
<template> |
||||
|
<view class="work-order-edit"> |
||||
|
<info-edit |
||||
|
ref="infoEdit" |
||||
|
is-stadium |
||||
|
is-type |
||||
|
></info-edit> |
||||
|
<view style="height: 24rpx;"></view> |
||||
|
<upload-img ref="uploadImg"></upload-img> |
||||
|
<fixed-button |
||||
|
@click:cancel="cancelBtn" |
||||
|
@click:submit="submitBtn" |
||||
|
></fixed-button> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import infoEdit from "../../components/edit/info_edit.vue"; |
||||
|
import uploadImg from "../../components/edit/upload_img.vue"; |
||||
|
import fixedButton from "../../components/edit/fixed_button.vue"; |
||||
|
import { routeTo, debounce, showLoad, hideLoad, showModal, showNone } from "@/utils/util.js"; |
||||
|
import { MESSAGE_API } from "../../js/api.js"; |
||||
|
import server from "../../js/server.js"; |
||||
|
export default { |
||||
|
components: { infoEdit, uploadImg, fixedButton }, |
||||
|
data() { |
||||
|
return { |
||||
|
brand_id: '', |
||||
|
} |
||||
|
}, |
||||
|
onLoad(options) { |
||||
|
let _bid = options?.brand_id ?? ''; |
||||
|
this.brand_id = _bid; |
||||
|
this.$nextTick(_=>{ |
||||
|
this.$refs?.infoEdit?.initStadiumLs?.({ |
||||
|
brand_id: _bid, |
||||
|
stadium_id: +(options?.stadium_id ?? '') |
||||
|
}); |
||||
|
}) |
||||
|
}, |
||||
|
methods: { |
||||
|
cancelBtn: routeTo, |
||||
|
submitBtn: debounce(async function(){ |
||||
|
try{ |
||||
|
let { brand_id } = this; |
||||
|
let _infoData = await this.$refs?.infoEdit?.getData?.(); |
||||
|
let { urls, temps } = await this.$refs?.uploadImg?.getUrls?.(); |
||||
|
this.workorderSubmit({ |
||||
|
brand_id, |
||||
|
stadium_id: _infoData?.stadium_id ?? '', |
||||
|
type: _infoData?.type ?? '', |
||||
|
title: _infoData?.title ?? '', |
||||
|
content: _infoData?.content ?? '', |
||||
|
showimgs: urls ?? [], |
||||
|
}) |
||||
|
}catch(err){ |
||||
|
hideLoad(); |
||||
|
console.warn('subpackage message pages work order edit submitBtn err --->', err); |
||||
|
} |
||||
|
}, 300, true), |
||||
|
|
||||
|
// 投诉提交 |
||||
|
workorderSubmit({ brand_id, stadium_id, type, title = '', content = '', showimgs = [] }){ |
||||
|
showLoad(); |
||||
|
return server.post({ |
||||
|
url: MESSAGE_API.workorderSubmit, |
||||
|
data: { brand_id: +brand_id, stadium_id, type, title, content, showimgs }, |
||||
|
isDefaultGet: false, |
||||
|
}) |
||||
|
.then(res => { |
||||
|
hideLoad(); |
||||
|
let _data = res?.data || {}; |
||||
|
if(_data.code === 0){ |
||||
|
showNone(_data?.message ?? '操作成功!'); |
||||
|
setTimeout(routeTo, 1000); |
||||
|
}else{ |
||||
|
return Promise.reject(_data); |
||||
|
} |
||||
|
}) |
||||
|
.catch(err => { |
||||
|
hideLoad(); |
||||
|
showModal({ |
||||
|
title: '提示', |
||||
|
content: err.message || '操作失败!' |
||||
|
}) |
||||
|
console.warn('subpackage message pages work order edit workorderSubmit err --->', err); |
||||
|
// return Promise.reject(err); |
||||
|
}) |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
.work-order-edit{ |
||||
|
padding: 24upx; |
||||
|
@include isPd(120upx); |
||||
|
} |
||||
|
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue