emis-sapp/pages/complaint/edit.vue
2024-08-31 15:08:07 +08:00

129 lines
3.2 KiB
Vue

<template>
<tpx-page>
<tpx-layout>
<template v-slot:body>
<view v-if="!pageLoading" class="com-jianju pos-rlt pb-30" style="padding-top: 2rpx;">
<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
v-model:value="submitParam.cpSiteCode" v-model:text="submitParam.siteName" v-model:resObject="wayRes"
:getListFun="getSendSiteList" :transKeyVal="{valKey: 'siteCode',titleKey: 'siteName'}"
: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>
</view>
</view>
</view>
</template>
<template v-slot:footer>
<view v-if="!queryOption.cmpId" class="blcok-white-noradius">
<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>
</template>
<script>
import * as apiService from "@/common/api"
import { checkParams } from "@/common/validate"
//
export default {
props: {
// hasLeftWin: {
// type: Boolean
// }
},
computed: {
dicData() {
return this.$store.getters.dicData
},
siteSearchParam() {
return {}
}
},
data() {
return {
queryOption: {
cmpId: ''
},
// 基础表单数据
submitParam: {
idType: this.$store.getters.dicData?.emis_complaints_type?.[0]?.value,
},
submitValidConfig: {
billCode: { required: true, requiredMsg: '运单号不能为空' },
cpSiteCode: { required: true, requiredMsg: '投诉网点不能为空' },
cpReason: { required: true, requiredMsg: '投诉原因不能为空' },
},
pageLoading: true,
}
},
onLoad(queryOption) {
this.queryOption = queryOption
this.initData();
},
onUnload() {
},
methods: {
getSendSiteList: apiService.getSendSiteList,
async initData() {
if(this.queryOption.cmpId) {
await this.getDetailData()
}
this.pageLoading = false
},
async getDetailData(){
let res = await apiService.getComplainInfo({id: this.queryOption.cmpId, _loading: true })
res.data && (this.submitParam = res.data)
},
handleFormChange() {
},
async handleSubmit() {
let params = { ...this.submitParam }
await checkParams(params, this.submitValidConfig)
let res = await apiService.addComplaints(params)
this.showToast('提交成功')
this.goBack()
},
}
}
</script>
<style lang="scss">
@import '@/common/uni-nvue.scss';
page {
background-color: #F6F6F6;
height: 100% !important;
}
</style>
<style scoped lang="scss">
</style>