emis-sapp/pages/complaint/edit.vue

130 lines
3.2 KiB
Vue
Raw Normal View History

2023-12-07 04:05:57 +00:00
<template>
2024-08-31 06:13:02 +00:00
<tpx-page>
<tpx-layout>
<template v-slot:body>
2024-08-31 07:08:07 +00:00
<view v-if="!pageLoading" class="com-jianju pos-rlt pb-30" style="padding-top: 2rpx;">
2024-08-31 06:13:02 +00:00
<view class="blcok-white radius-20">
<view class="">
<view class="mt-10">
<tpx-input v-model:value="submitParam.billCode" placeholder="运单号"></tpx-input>
</view>
<view class="mt-30">
<tpx-select
2024-08-31 07:39:51 +00:00
v-model:value="submitParam.cpSiteCode" v-model:text="submitParam.cpSiteName" v-model:resObject="siteRes"
2024-08-31 07:08:07 +00:00
:getListFun="getSendSiteList" :transKeyVal="{valKey: 'siteCode',titleKey: 'siteName'}"
2024-08-31 06:13:02 +00:00
:searchParam="siteSearchParam" placeholder="请选择投诉网点"
></tpx-select>
</view>
<view class="mt-30">
<tpx-select placeholder="投诉原因" v-model:value="submitParam.cpReason" :list="dicData.emis_complaints_type" mode="drop"
></tpx-select>
</view>
<view class="mt-30">
<tpx-textarea v-model:value="submitParam.remark" placeholder="投诉描述"></tpx-textarea>
</view>
2023-12-07 04:05:57 +00:00
</view>
</view>
2024-08-31 06:13:02 +00:00
2023-12-07 04:05:57 +00:00
</view>
2024-08-31 06:13:02 +00:00
</template>
2023-12-07 04:05:57 +00:00
2024-08-31 06:13:02 +00:00
<template v-slot:footer>
2024-08-31 07:08:07 +00:00
<view v-if="!queryOption.cmpId" class="blcok-white-noradius">
2024-08-31 06:13:02 +00:00
<u-button @click="handleSubmit()" type="primary" size="large" shape="circle"
custom-style="height:80rpx;font-size: 30rpx;"
>确定</u-button>
</view>
</template>
</tpx-layout>
</tpx-page>
2023-12-07 04:05:57 +00:00
</template>
<script>
2024-08-31 06:13:02 +00:00
import * as apiService from "@/common/api"
import { checkParams } from "@/common/validate"
//
2023-12-07 04:05:57 +00:00
export default {
props: {
// hasLeftWin: {
// type: Boolean
// }
},
computed: {
2024-08-31 06:13:02 +00:00
dicData() {
return this.$store.getters.dicData
},
siteSearchParam() {
return {}
}
2023-12-07 04:05:57 +00:00
},
data() {
2024-08-31 06:13:02 +00:00
2023-12-07 04:05:57 +00:00
return {
2024-08-31 06:13:02 +00:00
queryOption: {
cmpId: ''
},
// 基础表单数据
2023-12-07 04:05:57 +00:00
submitParam: {
2024-08-31 10:41:45 +00:00
idType: this.$store.getters.dicData?.emis_complaints_type?.[0]?.val,
2024-08-31 06:13:02 +00:00
},
submitValidConfig: {
billCode: { required: true, requiredMsg: '运单号不能为空' },
cpSiteCode: { required: true, requiredMsg: '投诉网点不能为空' },
cpReason: { required: true, requiredMsg: '投诉原因不能为空' },
2024-08-31 07:08:07 +00:00
},
pageLoading: true,
2024-08-31 07:39:51 +00:00
siteRes: { list:[] },
2023-12-07 04:05:57 +00:00
}
},
2024-08-31 06:13:02 +00:00
onLoad(queryOption) {
this.queryOption = queryOption
2023-12-07 04:05:57 +00:00
this.initData();
},
onUnload() {
2024-08-31 06:13:02 +00:00
2023-12-07 04:05:57 +00:00
},
methods: {
2024-08-31 06:13:02 +00:00
getSendSiteList: apiService.getSendSiteList,
2024-08-31 07:08:07 +00:00
async initData() {
if(this.queryOption.cmpId) {
await this.getDetailData()
}
this.pageLoading = false
2023-12-07 04:05:57 +00:00
},
2024-08-31 06:13:02 +00:00
async getDetailData(){
2024-08-31 07:08:07 +00:00
let res = await apiService.getComplainInfo({id: this.queryOption.cmpId, _loading: true })
2024-08-31 06:13:02 +00:00
res.data && (this.submitParam = res.data)
2023-12-07 04:05:57 +00:00
},
2024-08-31 06:13:02 +00:00
handleFormChange() {
2023-12-07 04:05:57 +00:00
},
2024-08-31 06:13:02 +00:00
async handleSubmit() {
let params = { ...this.submitParam }
await checkParams(params, this.submitValidConfig)
let res = await apiService.addComplaints(params)
this.showToast('提交成功')
this.goBack()
2023-12-07 04:05:57 +00:00
},
}
2024-08-31 06:13:02 +00:00
2023-12-07 04:05:57 +00:00
}
</script>
<style lang="scss">
@import '@/common/uni-nvue.scss';
page {
background-color: #F6F6F6;
height: 100% !important;
}
</style>
<style scoped lang="scss">
</style>