|
@@ -619,51 +619,59 @@ export default {
|
|
|
},
|
|
|
//提交按钮
|
|
|
submit() {
|
|
|
- for (var i = this.index; i < this.deptBudgetList.tranCarInfoList.length; i++) {
|
|
|
- if (!this.deptBudgetList.tranCarInfoList[i].driver) {
|
|
|
- this.$message({
|
|
|
- message: '姓名不能为空!',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- for(var j = 0 ; j < this.carList.length ; j++){
|
|
|
- if (this.carList[j].driverName == this.deptBudgetList.tranCarInfoList[i].driver && this.carList[j].disableStatusFlag == 1) {
|
|
|
+ if(!this.deptBudgetList.tranPrice){
|
|
|
+ this.$message({
|
|
|
+ message: '请设置运输单价!',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ for (var i = this.index; i < this.deptBudgetList.tranCarInfoList.length; i++) {
|
|
|
+ if (!this.deptBudgetList.tranCarInfoList[i].driver) {
|
|
|
this.$message({
|
|
|
- message: this.deptBudgetList.tranCarInfoList[i].driver+'该司机已被禁用!',
|
|
|
+ message: '姓名不能为空!',
|
|
|
type: 'warning',
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- }
|
|
|
- }
|
|
|
- this.$confirm(`提交成功后,任务将下发给司机,是否确定提交?`, {
|
|
|
- cancelButtonText: '取消',
|
|
|
- confirmButtonText: '确定',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.$refs.deptBudgetList.validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- var tranCarInfo = {}
|
|
|
- tranCarInfo.id = this.deptBudgetList.id
|
|
|
- tranCarInfo.infoId = this.deptBudgetList.infoId
|
|
|
- tranCarInfo.tranCarInfoList = this.deptBudgetList.tranCarInfoList
|
|
|
- dispatchCat(tranCarInfo)
|
|
|
- .toPromise()
|
|
|
- .then((response) => {
|
|
|
- this.$message.success('提交成功')
|
|
|
- this.$router.go(-1)
|
|
|
- })
|
|
|
- } else {
|
|
|
- EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
|
|
|
- return false
|
|
|
+ for(var j = 0 ; j < this.carList.length ; j++){
|
|
|
+ if (this.carList[j].driverName == this.deptBudgetList.tranCarInfoList[i].driver && this.carList[j].disableStatusFlag == 1) {
|
|
|
+ this.$message({
|
|
|
+ message: this.deptBudgetList.tranCarInfoList[i].driver+'该司机已被禁用!',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
}
|
|
|
- })
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$confirm(`提交成功后,任务将下发给司机,是否确定提交?`, {
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ type: 'warning',
|
|
|
})
|
|
|
+ .then(() => {
|
|
|
+ this.$refs.deptBudgetList.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ var tranCarInfo = {}
|
|
|
+ tranCarInfo.id = this.deptBudgetList.id
|
|
|
+ tranCarInfo.infoId = this.deptBudgetList.infoId
|
|
|
+ tranCarInfo.tranCarInfoList = this.deptBudgetList.tranCarInfoList
|
|
|
+ dispatchCat(tranCarInfo)
|
|
|
+ .toPromise()
|
|
|
+ .then((response) => {
|
|
|
+ this.$message.success('提交成功')
|
|
|
+ this.$router.go(-1)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ return false
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
handleClose() {
|