zhongtianhaoyuan vor 2 Jahren
Ursprung
Commit
285c4a1dde

+ 1 - 1
README.md

@@ -34,7 +34,7 @@ npm install
 npm run dev
 ```
 
-This will automatically open http://localhost:9528
+This will automatically open http://0.0.0.0:9528
 
 ## Build
 

+ 16 - 0
src/api/orderManagement.js

@@ -57,4 +57,20 @@ export function travelpath(data) {
     method: 'get',
     params: data,
   })
+}
+//预付
+export function preMoney(data) {
+  return request({
+    url: '/freightInfo/api/advance',
+    method: 'post',
+    data: data,
+  })
+}
+//尾款
+export function tailMoney(data) {
+  return request({
+    url: '/freightInfo/api/balance',
+    method: 'post',
+    data: data,
+  })
 }

+ 2 - 2
src/views/cargoOwnerManagement/merchantVerification.vue

@@ -51,9 +51,9 @@
 				<el-table-column prop="status" label="状态"></el-table-column>
 				<el-table-column label="操作" min-width="350">
 					<template slot-scope="scope">
-						<el-link  target="_blank" @click="adopt(scope.row)" type="primary" :underline="false" :disabled="scope.row.status != '审核中'">通过</el-link>
+						<el-link  target="_blank" @click="adopt(scope.row)" type="primary" :underline="false" :disabled="scope.row.status != '平台审核中'">通过</el-link>
 						<el-divider direction="vertical"></el-divider>
-						<el-link target="_blank" @click="reject(scope.row)" type="primary" :underline="false" :disabled="scope.row.status != '审核中'">驳回</el-link>
+						<el-link target="_blank" @click="reject(scope.row)" type="primary" :underline="false" :disabled="scope.row.status != '平台审核中'">驳回</el-link>
 					</template>
 				</el-table-column>
 			</el-table>

+ 63 - 5
src/views/orderManagement/orderAudit.vue

@@ -122,18 +122,20 @@
                 </el-dropdown-item>
                 <el-dropdown-item>
                   <el-link target="_blank" @click="see(scope.row)" type="primary" :underline="false"
-                    :disabled="scope.row.cargoOwnerStatusKey != 29">完结</el-link>
+                    :disabled="scope.row.freightAdvance =='非垫付' && scope.row.cargoOwnerStatusKey != 29">完结</el-link>
                   <!-- 完结:支付完尾款后从未进行过完结操作前显示的操作。 -->
                 </el-dropdown-item>
                 <el-dropdown-item>
                   <!-- v-if="scope.row.freightAdvance == 1" -->
-                  <el-link target="_blank" type="primary" :underline="false"
-                    :disabled="scope.row.freightAdvance != 1 && scope.row.cargoOwnerStatusKey < 9">预付</el-link>
+                  <el-link target="_blank" type="primary" :underline="false" v-if="scope.row.freightAdvance == '垫付'"
+                    :disabled="scope.row.cargoOwnerStatusKey != 13  && scope.row.payabled " @click="preMoneyChange(scope.row)">预付{{scope.row.cargoOwnerStatusKey}}</el-link>
                   <!-- 垫付类型的订单,平台确认装车后从未进行过预付操作(即预付款=0)时显示的按钮。 -->
                 </el-dropdown-item>
+                <!-- 货主订单状态key(1待接单3未装车5待确认装车7已驳回装车信息9待平台确认装车11平台驳回装车信息13运输中15待收货17已驳回卸车信息19待平台确认卸车21平台驳回卸车信息
+                 * 23待结算25已结算27待还款29已还款31已完结33已终止) -->
                 <el-dropdown-item>
                   <el-link target="_blank" type="primary" :underline="false"
-                    :disabled="scope.row.freightAdvance != 1 && scope.row.cargoOwnerStatusKey < 19">尾款</el-link>
+                    :disabled="scope.row.freightAdvance == '非垫付' && scope.row.cargoOwnerStatusKey < 19 " @click="tailmoneyChange(scope.row)">尾款</el-link>
                   <!-- 垫付类型的订单,平台确认卸车后从未进行过尾款操作(即尾款=0)时显示的按钮。 -->
                 </el-dropdown-item>
                 <el-dropdown-item>
@@ -288,7 +290,9 @@
     auditData,
     endData,
     editEndData,
-    batchData
+    batchData,
+    preMoney,
+    tailMoney
   } from '@/api/orderManagement'
   export default {
     components: {
@@ -329,6 +333,60 @@
       this.getList()
     },
     methods: {
+      //预付
+      preMoneyChange(val){
+        this.$confirm('垫付预付款'+val.advanceCharge+'元?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          })
+          .then(() => {
+            this.listLoading = true
+            preMoney({
+                id: val.freightId,
+                prepaidFreight:val.advanceCharge
+              }).then(response => {
+                 this.$notify({
+                  title: '成功',
+                  message: '操作成功!',
+                  type: 'success'
+                });
+                this.getList()
+                this.listLoading = false
+              })
+              .catch(() => {
+                this.listLoading = false
+              })
+          })
+      },
+      tailmoneyChange(val){
+        // 合计运费-预付款-司机服务费=尾款
+        let money = Number(val.actualFreight) - Number(val.prepaidFreight) - Number(val.driverServiceCharge)
+        this.$confirm('确定垫付尾款:'+ money+'元?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          })
+          .then(() => {
+            this.listLoading = true
+            tailMoney({
+                id: val.freightId,
+                freightBalance:money
+              }).then(response => {
+                 this.$notify({
+                  title: '成功',
+                  message: '操作成功!',
+                  type: 'success'
+                });
+                this.getList()
+                this.listLoading = false
+              })
+              .catch(() => {
+                this.listLoading = false
+              })
+          })
+
+      },
       closeImgViewer() {
         this.srcList = []
         this.imgsVisible = false;