工单报备按钮加防重复点击,提交报备做必填项的判断

This commit is contained in:
2023-08-22 18:05:12 +08:00
parent 37e4b8d514
commit 2b5e3a7396
9 changed files with 104 additions and 46 deletions

View File

@ -51,12 +51,14 @@
</div>
</div>
<common-btn class="btn" @submitClick="submit" />
</div>
</template>
<script>
import CommonBtn from "@/components/commonBtn.vue"
import {updateOrderSettlement} from "@/api/order"
import {leftCopy} from "@/utils/common"
import {getOrderSettlement, updateOrderSettlement} from "@/api/order"
export default {
name: "supplySettlement",
data(){
@ -78,23 +80,32 @@ export default {
}
}
},
mounted() {
const urlParams = new URLSearchParams(window.location.search);
this.taskOrderId = urlParams.get('taskOrderId');
this.userOrderId = urlParams.get('userOrderId');
this.orderCode = urlParams.get('orderCode')
async mounted() {
const urlParams = new URLSearchParams(window.location.search);
this.taskOrderId = urlParams.get('taskOrderId');
this.userOrderId = urlParams.get('userOrderId');
this.orderCode = urlParams.get('orderCode')
await this.getDetail()
},
methods:{
submit() {
console.log("提交")
this.updatSettlement()
},
async getDetail(){
let res = await getOrderSettlement({
userOrderId: this.userOrderId,
orderCode: this.orderCode,
taskOrderId: this.taskOrderId
})
leftCopy(this.form,{...res.data})
},
async updatSettlement(){
let result =await updateOrderSettlement({
...this.form,
userOrderId:this.userOrderId,
orderCode:this.orderCode,
taskOrderId:this.taskOrderId
userOrderId: this.userOrderId,
orderCode: this.orderCode,
taskOrderId: this.taskOrderId
})
if(result.code !== 200){
this.$toast(result.msg)
@ -104,7 +115,6 @@ export default {
window.android.sendMessage("goBack");
},2000)
}
console.log("result",result)
}
},
components:{