فهرست منبع

发货表单页

chrislee 1 سال پیش
والد
کامیت
a3dbf3af45
2فایلهای تغییر یافته به همراه95 افزوده شده و 24 حذف شده
  1. 10 24
      src/views/modules/order/dispatch.vue
  2. 85 0
      src/views/modules/order/dispatching.vue

+ 10 - 24
src/views/modules/order/dispatch.vue

@@ -183,6 +183,8 @@
     <dispatch-arrived v-if="arrivedVisible" ref="arrivedPage" @onChose="onChose" @refreshDataList="getDataList"/>
     <!-- 发货详情 -->
     <prod-management-details v-if="detailVisible" ref="detail" @onChose="onChose"/>
+    <!-- 确定发货 -->
+    <dispatching v-if="dispatchVisible" ref="dispatching" @refreshDataList="getDataList"/>
   </div>
 </template>
 
@@ -194,10 +196,12 @@ import NoticeChangeSetting from './dispatch-notice-change-setting'
 import DispatchArrived from './dispatch-arrived'
 import DispatchDetail from './dispatch-detail'
 import ProdManagementDetails from '@/views/modules/production/prod-management-details'
+import Dispatching from '@/views/modules/order/dispatching'
 export default {
     // 发货管理
   name: 'dispatch',
   components: {
+    Dispatching,
     ProdManagementDetails,
     AttachDetail,
     PreviewComponent,
@@ -221,6 +225,7 @@ export default {
       noticeChangeVisible: false,
       arrivedVisible: false,
       detailVisible: false,
+      dispatchVisible: false,
       optionsState: [
         {
           code: null, value: '全部'
@@ -249,6 +254,7 @@ export default {
       this.noticeChangeVisible = false
       this.arrivedVisible = false
       this.detailVisible = false
+      this.dispatchVisible = false
     },
       // 查询
     queryData () {
@@ -321,30 +327,10 @@ export default {
     },
     // 发货
     sendHandle (deliverId) {
-      this.$confirm(`确定发货`, '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        this.$http({
-          url: this.$http.adornUrl('/biz-service/deliver/deliver'),
-          method: 'post',
-          data: this.$http.adornData({deliverId: deliverId}, false)
-        }).then(({data}) => {
-          if (data && data.code === '200') {
-            this.$message({
-              message: '操作成功',
-              type: 'success',
-              duration: 1500,
-              onClose: () => {
-                this.getDataList()
-              }
-            })
-          } else {
-            this.$message.error(data.msg)
-          }
-        })
-      }).catch(() => {})
+      this.dispatchVisible = true
+      this.$nextTick(() => {
+        this.$refs.dispatching.init(deliverId)
+      })
     },
     // 转换属性“状态”
     stateFormat (row) {

+ 85 - 0
src/views/modules/order/dispatching.vue

@@ -0,0 +1,85 @@
+<template>
+  <div>
+    <el-dialog
+      title="确定发货"
+      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-col>
+            <el-form-item label="发货数量" prop="cnt">
+              <el-input-number v-model="dataForm.cnt" :min="0"></el-input-number>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <span slot="footer" >
+          <el-button @click="onChose">取消</el-button>
+          <el-button type="primary" @click="dataFormSubmit()" v-reClick>确定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  export default {
+    name: 'dispatching',
+    data () {
+      return {
+        visible: false,
+        dataForm: {},
+        dataRule: {
+          cnt: [{ required: true, message: '发货数量不能为空', trigger: 'change' }]
+        }
+      }
+    },
+    methods: {
+      onChose () {
+        this.visible = false
+        this.$emit('onChose')
+      },
+      async init (deliverId) {
+        if (!deliverId) return
+        this.dataForm = {
+          deliverId: deliverId
+        }
+        this.visible = true
+      },
+      validateField (type) {
+        this.$refs.dataForm.validateField(type)
+      },
+      // 表单提交
+      dataFormSubmit () {
+        this.$refs['dataForm'].validate((valid) => {
+          if (valid) {
+            this.$http({
+              url: this.$http.adornUrl(`/biz-service/deliver/deliver`),
+              method: 'post',
+              data: this.$http.adornData({...this.dataForm})
+            }).then(({data}) => {
+              if (data && data.code === '200') {
+                this.$message({
+                  message: '操作成功',
+                  type: 'success',
+                  duration: 1500,
+                  onClose: () => {
+                    this.onChose()
+                    this.$emit('refreshDataList')
+                  }
+                })
+              } else {
+                this.$message.error(data.msg)
+              }
+            })
+          }
+        })
+      }
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>