工单报备按钮加防重复点击,提交报备做必填项的判断
This commit is contained in:
@ -37,15 +37,17 @@
|
||||
</van-radio>
|
||||
</van-radio-group>
|
||||
<textarea class="multiple" id="text-input" rows="4" cols="50" placeholder="报备描述" v-model="decscripTxt"></textarea><br>
|
||||
<common-btn @submitClick="submit" />
|
||||
<common-btn @submitClick="noMultipleClicks(submit)" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {orderReporting} from "@/api/order"
|
||||
import {myMixins} from "@/utils/myMixins"
|
||||
import CommonBtn from "@/components/commonBtn.vue"
|
||||
export default {
|
||||
name: "reportingView",
|
||||
mixins:[myMixins],
|
||||
data(){
|
||||
return{
|
||||
decscripTxt:'',
|
||||
@ -54,38 +56,48 @@ export default {
|
||||
inactiveIcon: require('@/assets/uncheck.png'),
|
||||
queryType:'',
|
||||
userOrderId:'',
|
||||
orderCode:''
|
||||
orderCode:'',
|
||||
noClick:true,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.radio)
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
this.queryType = urlParams.get('queryType');
|
||||
this.userOrderId = urlParams.get('userOrderId');
|
||||
this.orderCode = urlParams.get('orderCode')
|
||||
},
|
||||
computed:{
|
||||
isRadio(){
|
||||
return this.radio ? true : false
|
||||
},
|
||||
isTxt(){
|
||||
return this.decscripTxt ? true : false
|
||||
},
|
||||
},
|
||||
methods:{
|
||||
submit(){
|
||||
console.log("提交1111111111")
|
||||
this.goReporting();
|
||||
},
|
||||
change(e){
|
||||
this.radio=e
|
||||
console.log("可以拿到选中的是哪个值",this.radio)
|
||||
},
|
||||
async goReporting(){
|
||||
let result = await orderReporting({
|
||||
queryType:this.queryType,
|
||||
userOrderId:this.userOrderId,
|
||||
orderCode:this.orderCode,
|
||||
reportingItem:this.radio ? this.radio : "",
|
||||
reportingDesc:this.decscripTxt ? this.decscripTxt : ""
|
||||
})
|
||||
if(result.code === 200){
|
||||
this.$toast(result.msg)
|
||||
setTimeout(()=>{
|
||||
window.android.sendMessage("goBack");
|
||||
},2000)
|
||||
if(this.isRadio || this.isTxt){
|
||||
let result = await orderReporting({
|
||||
queryType:this.queryType,
|
||||
userOrderId:this.userOrderId,
|
||||
orderCode:this.orderCode,
|
||||
reportingItem:this.radio ? this.radio : "",
|
||||
reportingDesc:this.decscripTxt ? this.decscripTxt : ""
|
||||
})
|
||||
if(result.code === 200){
|
||||
this.$toast(result.msg)
|
||||
setTimeout(()=>{
|
||||
window.android.sendMessage("goBack");
|
||||
},2000)
|
||||
}
|
||||
}else{
|
||||
this.$toast("报备事项和报备描述必填一项")
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user