gaoluyang
2024-07-31 38e6f27a8082e1173e3c02a33da5da39b6c6872c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<template>
  <div>
    <div style="width: 100%;height: 100%;" v-show="active === 0">
      <div>
        <el-row class="title">
          <el-col :span="12" style="padding-left: 20px;text-align: left;">原材料检验下单</el-col>
          <el-col :span="12" style="text-align: right;">
            <el-button size="medium" type="primary" v-if="tabIndex === 0" @click="openIFS">获取IFS订单</el-button>
            <el-button size="medium" type="primary" v-if="tabIndex === 0" @click="playOrder(1)">报检</el-button>
          </el-col>
        </el-row>
      </div>
      <div class="search">
        <div class="search_thing">
          <div class="search_label">采购订单号:</div>
          <div class="search_input"><el-input size="small" placeholder="请输入" clearable
                                              v-model="componentData.entity.entrustCode" @keyup.enter.native="refreshTable()"></el-input></div>
        </div>
        <div class="search_thing">
          <div class="search_label">样品编号:</div>
          <div class="search_input"><el-input size="small" placeholder="请输入" clearable
                                              v-model="componentData.entity.sample" @keyup.enter.native="refreshTable()"></el-input></div>
        </div>
        <div class="search_thing">
          <div class="search_label">样品名称:</div>
          <div class="search_input"><el-input size="small" placeholder="请输入" clearable
                                              v-model="componentData.entity.sampleModel" @keyup.enter.native="refreshTable()"></el-input></div>
        </div>
        <div class="search_thing" style="padding-left: 30px;">
          <el-button size="small" @click="refresh()">重 置</el-button>
          <el-button size="small" type="primary" @click="refreshTable()">查 询</el-button>
        </div>
      </div>
      <div class="table">
        <ul class="tab">
          <li v-for="(m,i) in tabList" :key="i" :class="{active:i==tabIndex}" @click="handleTab(m,i)">{{m.label}}</li>
        </ul>
        <ValueTable :style="getStyle()" ref="ValueTable"
                    :url="$api.insOrder.selectSampleAndProductByOrderId"
                    :componentData="componentData"
                    :key="'b'+ upIndex"  />
      </div>
    </div>
    <div style="width: 100%;height: 100%;" v-if="active >0">
      <CustomsInspection :active="active" :currentId="currentId" v-if="active<4" />
    </div>
    <el-dialog title="获取IFS订单行" :visible.sync="IFSDialog" width="70%">
      <div class="search">
        <div class="search_thing">
          <div class="search_label">采购订单号:</div>
          <div class="search_input"><el-input size="small" placeholder="请输入" clearable
                                              v-model="componentData.entity.sampleModel" @keyup.enter.native="refreshTable()"></el-input></div>
        </div>
        <div class="search_thing" style="padding-left: 30px;">
          <el-button size="small" @click="refreshIFS()">重 置</el-button>
          <el-button size="small" type="primary" @click="refreshTableIFS()">查 询</el-button>
        </div>
      </div>
      <div style="height: 70vh;overflow-y: auto;">
        <ValueTable ref="ValueTableIFS"
                    :url="$api.insOrder.selectSampleAndProductByOrderId"
                    :componentData="componentDataIFS"/>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-row>
          <el-button @click="IFSDialog=false">取 消</el-button>
          <el-button type="primary" @click="submitPrint" :loading="IFSGetLoading">获取</el-button>
        </el-row>
      </span>
    </el-dialog>
  </div>
</template>
 
<script>
import ValueTable from "../tool/value-table.vue";
import CustomsInspection from "../do/b1-material-ins-order/customs-inspection.vue";
 
export default {
  name: "b1-material-inspection-order",
  // import 引入的组件需要注入到对象中才能使用
  components: {CustomsInspection, ValueTable},
  data() {
    // 这里存放数据
    return {
      componentData: { // 表格数据
        entity: {
          entrustCode: null,
          sample: null,
          sampleModel: null,
        },
        isIndex: true,
        showSelect: true,
        select: true,
        selectMethod:'selectMethod',
        do: [
          {
            id: 'update',
            font: '编辑',
            type: 'text',
            method: 'doDiy',
          },
          {
            id: 'verify',
            font: '查看',
            type: 'text',
            method: 'doDiy',
          },
          {
            id: 'dataLook',
            font: '撤销报检',
            type: 'text',
            method: 'handleDataLook',
          }
        ],
        tagField: {},
        selectField: {},
        requiredAdd: [],
        requiredUp: []
      },
      componentDataIFS: {
        entity: {
          entrustCode: null,
          sample: null,
          sampleModel: null,
        },
        isIndex: true,
        showSelect: true,
        select: true,
        selectMethod:'selectMethod',
        do: [],
        tagField: {},
        selectField: {},
        requiredAdd: [],
        requiredUp: []
      },
      tabList: [{
        label: '待报检',
        value: 0
      }, {
        label: '待制单',
        value: 1
      }],
      upIndex: 0,
      tabIndex: 0,
      multipleSelection:[],
      entityCopy: {},
      entityCopyIFS: {},
      IFSDialog: false,
      IFSGetLoading: false,
      active: 0, //1:报检,2:查看,3:审核,4:光纤配置,默认为0
      currentId: null,
    }
  },
  mounted () {
    this.entityCopy = this.HaveJson(this.componentData.entity)
    this.entityCopyIFS = this.HaveJson(this.componentDataIFS.entity)
  },
  // 方法集合
  methods: {
    refreshTable(e) {
      this.$refs.ValueTable.selectList(e)
    },
    refresh() {
      this.componentData.entity = this.HaveJson(this.entityCopy)
      this.refreshTable()
    },
    refreshIFS() {
      this.componentDataIFS.entity = this.HaveJson(this.entityCopyIFS)
      this.refreshTableIFS()
    },
    refreshTableIFS(e) {
      this.$refs.ValueTableIFS.selectList(e)
    },
    // 获取IFS订单
    submitPrint () {
 
    },
    // 报检
    playOrder(num) {
      // if (this.multipleSelection.length < 1) {
      //   this.$message.error('请选择需要报检的数据')
      //   return
      // }
      this.active = num
      if (num === 0) {
        this.refreshTable('page')
      }
    },
    // 切换tab表格
    handleTab(m, i) {
      this.tabIndex = i;
      this.componentData.entity.state = m.value
      this.refreshTable()
    },
    // 表格选择方法
    selectMethod(val){
      this.multipleSelection = val
    },
    openIFS () {
      this.IFSDialog = true
    },
    getStyle(){
      return 'height: calc(100% - '+(this.more?'94':'44')+'px)'
    }
  },
}
</script>
 
<style scoped>
.title {
  height: 60px;
  line-height: 60px;
}
 
.search {
  background-color: #fff;
  height: 80px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
 
.search_thing {
  display: flex;
  align-items: center;
  height: 50px;
  width: 250px;
}
 
.search_label {
  width: 110px;
  font-size: 14px;
  text-align: right;
}
 
.search_input {
  width: calc(100% - 90px);
}
.table {
  margin-top: 10px;
  background-color: #fff;
  width: calc(100% - 40px);
  height: calc(100% - 60px - 80px - 10px - 40px);
  padding: 20px;
}
.tab {
  list-style-type: none;
  display: flex;
  margin-bottom: 12px;
}
 
.tab li {
  line-height: 24px;
  padding: 6px 14px;
  font-size: 14px;
  color: #333333;
  border: 1px solid #EEEEEE;
  cursor: pointer;
}
 
.tab li:nth-child(1) {
  border-radius: 8px 0 0 8px;
}
 
.tab li:nth-child(2) {
  border-radius: 0 8px 8px 0;
}
 
.tab li.active {
  border-color: #3A7BFA;
  color: #3A7BFA;
}
</style>