ソースを参照

订单功能补充

chris 2 年 前
コミット
0f096be365

+ 9 - 0
src/api/sale.js

@@ -178,3 +178,12 @@ export function getSupplierDetail (id) {
     method: 'get'
   })
 }
+
+// 撤回订单
+export function revokeOrder (data) {
+  return request({
+    url: request.adornUrl(`/biz-service/order/revoke`),
+    method: 'post',
+    data
+  })
+}

+ 26 - 1
src/views/modules/order/order.vue

@@ -140,7 +140,8 @@
           label="操作">
           <template slot-scope="scope">
             <el-button v-if="isAuth('order:ctl:info')" type="text" size="small" @click="detailHandle(scope.row.orderId)">查看</el-button>
-            <el-button v-if="isAuth('order:ctl:editor') && Number(scope.row.state) === 1" type="text" size="small" @click="addOrUpdateHandle(scope.row.orderId,false)">编辑</el-button>
+            <el-button v-if="isAuth('order:ctl:editor') && Number(scope.row.state) === 2" type="text" size="small" @click="addOrUpdateHandle(scope.row.orderId,false)">编辑</el-button>
+            <el-button v-if="isAuth('order:clt:revoke') && Number(scope.row.state) === 1" type="text" size="small" @click="cancelOrder(scope.row)">撤回</el-button>
             <el-button v-if="isAuth('order:ctl:determine') && Number(scope.row.state) === 3 && Number(scope.row.orderState) === 6" type="text" size="small" @click="techConfirm(scope.row)">技术确定</el-button>
 <!--            <el-button v-if="isAuth('order:ctl:deliver') && Number(scope.row.orderState) === 3" type="text" size="small" @click="deliverHandle(scope.row.orderId)">发货</el-button>-->
 <!--            <el-button v-if="isAuth('order:ctl:arrived') && Number(scope.row.orderState) === 4 " type="text" size="small" @click="arrivedHandle(scope.row)">送达</el-button>-->
@@ -172,6 +173,7 @@
   import CusComponent from '../common/cus-component'
   import DispatchArrived from './dispatch-arrived'
   import NoticeChangeSetting from './order-notice-change-setting'
+  import {revokeOrder} from '@/api/sale'
   export default {
     name: 'order',
     components: {
@@ -343,6 +345,29 @@
         this.$nextTick(() => {
           this.$refs.noticeChangeSetting.init()
         })
+      },
+      // 撤回订单
+      cancelOrder (row) {
+        this.$confirm(`确定撤回订单${row.orderCode}?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          revokeOrder({id: row.orderId}).then(({data}) => {
+            if (data && data.code === '200') {
+              this.$message({
+                message: '撤回成功',
+                type: 'success',
+                duration: 1500,
+                onClose: () => {
+                  this.getDataList()
+                }
+              })
+            } else {
+              this.$message.error(data.msg)
+            }
+          })
+        }).catch(() => {})
       }
     }
   }

+ 9 - 9
src/views/modules/product/template-add-or-update.vue

@@ -1,10 +1,10 @@
 <template>
-  <el-dialog
-    :title="!isModify ? '新增':'修改'"
-    width="50%"
-    :close-on-click-modal="false"
-    :visible.sync="visible">
-    <div class="product-template">
+  <div class="product-template">
+    <el-dialog
+      :title="!isModify ? '新增':'修改'"
+      width="50%"
+      :close-on-click-modal="false"
+      :visible.sync="visible">
       <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
         <el-row class="my-row">
           <el-form-item label="产品名称" prop="productName">
@@ -55,9 +55,9 @@
       <span slot="footer">
           <el-button @click="onChose">取消</el-button>
           <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
-        </span>
-    </div>
-  </el-dialog>
+      </span>
+    </el-dialog>
+  </div>
 </template>
 
 <script>

+ 2 - 2
src/views/modules/production/damage-details.vue

@@ -77,7 +77,7 @@
       onChose () {
         this.$emit('onChose')
       },
-      async init (id,businessType) {
+      async init (id, businessType) {
         this.visible = true
         this.isFlow = !!(businessType && businessType !== '')
         this.id = id || 0
@@ -120,7 +120,7 @@
       approveFinished () {
         this.onChose()
         this.$emit('approveFinished')
-      },
+      }
     }
   }
 </script>

+ 34 - 1
src/views/modules/sale/purchase-detail.vue

@@ -101,6 +101,39 @@
             :show-tooltip-when-overflow="true"
             label="批次号/用途">
           </el-table-column>
+          <el-table-column
+            prop="price"
+            header-align="center"
+            align="center"
+            min-width="100"
+            label="不含税单价">
+          </el-table-column>
+          <el-table-column
+            prop="taxPrice"
+            header-align="center"
+            align="center"
+            label="含税单价">
+          </el-table-column>
+          <el-table-column
+            prop="taxAmount"
+            header-align="center"
+            align="center"
+            label="含税总价">
+            <template slot-scope="scope">
+              <span>{{ (scope.row.cnt*scope.row.taxPrice).toFixed(2) }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="taxRate"
+            header-align="center"
+            align="center"
+            label="税率">
+            <template slot-scope="scope">
+              <span>
+                {{scope.row.taxRate}} %
+              </span>
+            </template>
+          </el-table-column>
           <el-table-column
             prop="notes"
             header-align="center"
@@ -196,7 +229,7 @@
       // 百分比
       formatPercent (row) {
         if (!row.taxRate) return ''
-        let str = (Number(row.taxRate * 100)).toFixed(0)
+        let str = (Number(row.taxRate)).toFixed(0)
         str += '%'
         return str
       },