141 lines
4.1 KiB
Vue
141 lines
4.1 KiB
Vue
<template>
|
|
<tpx-page>
|
|
<tpx-layout>
|
|
<template v-slot:body>
|
|
|
|
<view class="blcok-white-noradius" style="margin-top: 0;">
|
|
<u-row justify="between">
|
|
<view style="flex:1;">
|
|
<tpx-scan-input v-model:value="submitParam.billCode" placeholder="请输入运单号或扫码"
|
|
@change="handleScanValChange" iconPos="left"></tpx-scan-input>
|
|
</view>
|
|
</u-row>
|
|
</view>
|
|
|
|
<view class="blcok-white-noradius">
|
|
<u-row custom-style="">
|
|
<view style="flex: 1;">
|
|
<tpx-select v-model:resObject="ptypeRes" :getListFun="queryProblemTypeList" :transKeyVal="{valKey: 'id',titleKey: 'typeName'}"
|
|
v-model:value="submitParam.problemType" mode="drop" placeholder="请选择问题类型"
|
|
></tpx-select>
|
|
</view>
|
|
</u-row>
|
|
<u-row custom-style="margin-top:20rpx;">
|
|
<view style="flex: 1;">
|
|
<tpx-select placeholder="请选择网点" v-model:value="submitParam.sendSiteCode" :list="siteList" mode="drop"></tpx-select>
|
|
</view>
|
|
</u-row>
|
|
<view class="mt-20">
|
|
<u-textarea v-model="submitParam.problemCause" border="surround" height="120" placeholder="问题描述"
|
|
maxlength="50" count></u-textarea>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="blcok-white-noradius">
|
|
<bpe-goodphoto-tmp title="拍照上传" :value="submitParam" filedName="filePath"></bpe-goodphoto-tmp>
|
|
</view>
|
|
</template>
|
|
<template v-slot:footer>
|
|
<view class="pos-rlt blcok-white" style="border-radius: 0;margin-top: 0;">
|
|
<u-row>
|
|
<u-button @click="handleSubmit" size="large" shape="circle"
|
|
custom-style="width: 500rpx;height:80rpx;font-size: 30rpx;" type="primary">提交</u-button>
|
|
</u-row>
|
|
</view>
|
|
</template>
|
|
</tpx-layout>
|
|
</tpx-page>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
import { debounce } from "@/common/util"
|
|
import * as apiService from "@/common/api"
|
|
import BpeGoodphotoTmp from "@/components/buns-post-edit-templates/bpe-goodphoto-tmp"
|
|
import { checkParams } from "@/common/validate"
|
|
|
|
export default {
|
|
components:{ BpeGoodphotoTmp },
|
|
props: {
|
|
},
|
|
computed: {
|
|
|
|
},
|
|
data() {
|
|
return {
|
|
ptypeRes: { list: [] },
|
|
siteList: [],
|
|
submitParam: {
|
|
billCode: "", // 运单号
|
|
problemType: '', // 问题类型
|
|
problemCause: "", // 问题件原因
|
|
sendSiteCode: "", // 通知网点代码
|
|
filePath: [], // 图片路径
|
|
},
|
|
submitValidConfig: {
|
|
billCode: { required: true, requiredMsg: '运单号不能为空' },
|
|
problemType: { required: true, requiredMsg: '问题类型不能为空' },
|
|
problemCause: { required: true, requiredMsg: '问题描述不能为空' },
|
|
sendSiteCode: { required: true, requiredMsg: '网点不能为空' },
|
|
filePath: { required: true, requiredMsg: '图片不能为空' },
|
|
},
|
|
}
|
|
},
|
|
onShareAppMessage() {
|
|
return {
|
|
}
|
|
},
|
|
onLoad() {
|
|
this.initData();
|
|
},
|
|
onUnload() {
|
|
|
|
},
|
|
methods: {
|
|
queryProblemTypeList: apiService.queryProblemTypeList,
|
|
initData() {
|
|
|
|
},
|
|
handleScanValChange: debounce(function(val){
|
|
val && (this.handleSearch(val))
|
|
}),
|
|
async handleSearch(val) {
|
|
let res = await apiService.getOrderDetail({billCode: val, _loading: true})
|
|
let { sendSiteName, sendSiteCode, dispatchUnderlingSiteName, dispatchUnderlingSiteCode } = res.data
|
|
this.siteList = [
|
|
{ title: sendSiteName, val: sendSiteCode },
|
|
{ title: dispatchUnderlingSiteName, val: dispatchUnderlingSiteCode },
|
|
]
|
|
},
|
|
async handleSubmit() {
|
|
await checkParams(this.submitParam, this.submitValidConfig)
|
|
let extParams = {}
|
|
extParams.filePath = this.submitParam.filePath?.join?.(",") || ''
|
|
await apiService.registerProblemInfo({ ...this.submitParam, ...extParams, _loading: true })
|
|
this.showToast('操作成功')
|
|
this.resetForm()
|
|
// this.goBack()
|
|
},
|
|
resetForm() {
|
|
this.submitParam.billCode = ''
|
|
this.submitParam.sendSiteCode = ''
|
|
this.submitParam.filePath = []
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
@import '@/common/uni-nvue.scss';
|
|
|
|
page {
|
|
background-color: #F6F6F6;
|
|
height: 100% !important;
|
|
}
|
|
</style>
|
|
<style scoped lang="scss">
|
|
.yditem{
|
|
padding: 20rpx 0;
|
|
border-top: 2px solid #F6F6F6;
|
|
}
|
|
</style> |