Blame view

ant-design-vue-jeecg/src/views/system/monitor/modules/ExpressDeliveryModal.vue 5.21 KB
xcq authored
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<template>
  <a-modal
    :title="title"
    :width="800"
    :visible="visible"
    :maskClosable="false"
    :confirmLoading="confirmLoading"
    @ok="handleOk"
    @cancel="handleCancel">

    <a-spin :spinning="confirmLoading">
      <a-form-model ref="form" :label-col="labelCol" :wrapper-col="wrapperCol" :model="model">
      <a-tabs defaultActiveKey="1">
        <a-tab-pane tab="物料信息" key="1">
          <div>
16
            <a-row type="flex" style="margin-bottom:10px" :gutter="26">
17
              <a-col :span="5">容器编码</a-col>
18
19
20
              <a-col :span="8">物料编码</a-col>
              <a-col :span="4">库存数量</a-col>
              <a-col :span="4">出库数量</a-col>
21
              <a-col :span="3">操作</a-col>
xcq authored
22
23
24
25
26
27
28
            </a-row>
            <a-row type="flex" style="margin-bottom:-20px" :gutter="24" v-for="(item, index) in quickMainModel.receiptEntityList" :key="index">
              <a-col style="display: none">
                <a-form-model-item>
                  <a-input placeholder="inventoryDetailId" v-model="item.inventoryDetailId"/>
                </a-form-model-item>
              </a-col>
29
30
31
32
33
34

              <a-col :span="5" >
                <a-form-model-item>
                  <a-input :disabled="isSearch" placeholder="containerCode" v-model="item.containerCode"/>
                </a-form-model-item>
              </a-col>
35
              <a-col :span="8">
xcq authored
36
37
38
39
40
41
42
43
44
45
46
                <a-form-model-item>
                  <j-search-select-tag
                    :disabled="isSearch"
                    placeholder="请选择"
                    v-model="item.materialCode"
                    :dict="'material,name,code'"
                    :pageSize="5"
                    :async="true">
                  </j-search-select-tag>
                </a-form-model-item>
              </a-col>
47
              <a-col :span="4">
xcq authored
48
                <a-form-model-item>
49
50
51
52
53
54
                  <a-input disabled="true" placeholder="库存数量" v-model="item.qty" type="number"/>
                </a-form-model-item>
              </a-col>
              <a-col :span="4">
                <a-form-model-item>
                  <a-input placeholder="出库数量" v-model="item.shipQty" type="number"/>
xcq authored
55
56
                </a-form-model-item>
              </a-col>
57
              <a-col :span="3">
xcq authored
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
                <a-form-model-item>
                  <a-icon type="minus-circle" @click="delRowCustom(index)" style="fontSize :20px"/>
                </a-form-model-item>
              </a-col>
            </a-row>
<!--            <a-button type="dashed" style="width: 100%;margin-top: 10px" @click="addRowCustom"><a-icon type="plus"/>添加出库信息</a-button>-->
          </div>
        </a-tab-pane>
      </a-tabs>
      </a-form-model>
    </a-spin>
  </a-modal>
</template>

<script>

import JEditableTable from '@/components/jeecg/JEditableTable'
肖超群 authored
75
import {execute, flatQuickShipment} from '@/api/api'
xcq authored
76
77
78
79
80
81
82
83
84
85
86
import JDate from '@/components/jeecg/JDate'
import JSelectMultiCanUseContainer from "../../../../components/jeecgbiz/JSelectMultiCanUseContainer";


export default {
  name: 'ExpressDeliveryModal',
  components: {
    JDate, JEditableTable,JSelectMultiCanUseContainer
  },
  data() {
    return {
87
      title: '平库出库',
xcq authored
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
      visible: false,
      confirmLoading: false,
      model: {},
      isSearch:true,
      labelCol: {
        xs: {span: 24},
        sm: {span: 4}
      },
      wrapperCol: {
        xs: {span: 24},
        sm: {span: 24}
      },
      activeKey: '1',
      quickMainModel: {
        receiptEntityList: [{}],
        inventoryDetailList: []
      },
      // 客户信息
      url: {
        add: '/test/jeecgOrderMain/add',
        edit: '/test/jeecgOrderMain/edit',
      }
    }
  },
  created() {
  },
  methods: {
    handleOk() {
      this.validateFields()
    },
    handleCancel() {
      this.visible = false
    },

    addRowCustom() {
      this.quickMainModel.receiptEntityList.push({});
      this.$forceUpdate();
    },
    delRowCustom(index) {
      console.log(index)
      this.quickMainModel.receiptEntityList.splice(index, 1);
      this.$forceUpdate();
    },
    addRowTicket() {
      this.quickMainModel.jeecgOrderTicketList.push({});
      console.log(this.quickMainModel.jeecgOrderTicketList)
      this.$forceUpdate();
    },
    delRowTicket(index) {
      console.log(index)
      this.quickMainModel.jeecgOrderTicketList.splice(index, 1);
      this.$forceUpdate();
    },

    edit(record) {
      this.visible = true;
      this.activeKey = '1';
      this.quickMainModel = Object.assign({
        receiptEntityList: record
      }, record);
    },
    /** 触发表单验证 */
    validateFields() {
      // 触发表单验证
      this.$refs.form.validate(valid => {
153
        this.shipment(this.quickMainModel);
xcq authored
154
155
156
      })
    },
157
    shipment(record) {
xcq authored
158
159
160
      debugger
      this.confirmLoading = true
      this.model = Object.assign({}, record);
肖超群 authored
161
      flatQuickShipment(record.receiptEntityList).then((res) => {
xcq authored
162
163
164
165
166
167
168
169
170
171
172
173
174
175
        this.loading = false;
        if (res.success) {
          this.$message.success(res.message);
          this.$emit('ok');
          this.visible = false
        } else {
          this.$message.error(res.message);
        }
        this.confirmLoading = false
      });
    },
  }
}
</script>