jiangping
2023-10-24 349bcef9a96391d22522a3409adf5a89e7e70a95
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
<template>
  <GlobalWindow
    :title="title"
    width="900px"
    :visible.sync="visible"
    :confirm-working="isWorking"
    @confirm="confirm"
  >
    <div class="massage-style">
      <el-form :model="form" ref="form" label-width="120px" label-suffix=":" inline>
        <div class="property-title">{{type == 1 ? '入库信息' : '出库信息'}}</div>
        <el-form-item :label="type == 1 ? '入库单号' : '出库单号'" class="count-style" >
          {{ form.code }}
        </el-form-item>
        <el-form-item :label="type == 1 ? '入库仓库' : '出库仓库'" class="count-style">
          <span style="max-width: 130px;" class="long-title-style" :title="form.warehouseCode + '|' + form.warehouseName">{{ form.warehouseCode + '|' + form.warehouseName }}</span>
        </el-form-item>
        <el-form-item label="单据状态" class="count-style">
          {{ statusToStr(form.status) }}
        </el-form-item>
        <el-form-item label="单据类型" class="count-style">
          {{ billToStr(form.billType) }}
        </el-form-item>
        <el-form-item :label="type == 1 ? '计划入库日期' : '计划出库日期'" class="count-style">
          {{ form.planDate }}
        </el-form-item>
        
        <!-- <el-form-item :label="type == 1 ? '申请工序' : '申领工序'" class="count-style">
          -
        </el-form-item> -->
        <el-form-item :label="type == 1 ? '申请人员' : '申领人员'" class="count-style">
          <span style="width: 140px;" class="long-title-style" :title="applyStr(form)">{{ applyStr(form) }}</span>
        </el-form-item>
        <el-form-item label="创建时间" class="count-style">
          {{ form.createTime }}
        </el-form-item>
        <el-form-item label="单据摘要" class="count-style">
          <span style="width: 140px;" class="long-title-style" :title="form.abstracts">{{ form.abstracts || '-' }}</span>
        </el-form-item>
        <div v-if="form.status == 2">
          <el-form-item label="取消原因" class="count-style">
            <span style="width: 140px;" class="long-title-style" :title="form.cancelInfo">{{ form.cancelInfo  || '-'}}</span>
          </el-form-item>
          <el-form-item label="操作人" class="count-style">
            {{ form.updateName + '-' + form.updateMobile }}
          </el-form-item>
          <el-form-item label="操作时间" class="count-style">
            {{ form.updateTime }}
          </el-form-item>
        </div>
      </el-form>
    </div>
    <div style="height:10px; background:0xf7f7f7"></div>
    <div v-if="didArray&&didArray.length">
      <div style="margin:10px">
        <div class="property-title" style="margin-bottom:10px">{{type == 1 ? '待入库物料' : '待出库物料'}}</div>
        <el-table
          :data="didArray"
          border
          stripe
        >
          <el-table-column align="center" label="序号" fixed="left" type="index" />
          <el-table-column prop="materialName" align="center" label="物料名称" min-width="100px"></el-table-column>
          <el-table-column prop="materialCode" align="center" label="物料编码" min-width="160px"></el-table-column>
          <el-table-column prop="batch" align="center" label="批次号" min-width="100px">
            <template slot-scope="{row}">
              <span >{{ row.batch || '-' }}</span>
            </template>
          </el-table-column>
          <el-table-column align="center" prop="procedureName" label="工序" min-width="100px">
            <template slot-scope="{row}">
              <span >{{ row.procedureName || '-' }}</span>
            </template>
          </el-table-column>
          <el-table-column align="center" label="质量属性" min-width="100px">
            <template slot-scope="{row}">
              <span v-if="row.qualityType==0" class="valid-style">合格</span>
              <span v-else-if="row.qualityType==1" class="unvalid-style">不良</span>
              <span v-else-if="row.qualityType==2" class="scrap-style">报废</span>
              <span v-else>-</span>
            </template>
          </el-table-column>
          <el-table-column v-if="type==0" prop="locationName" align="center" label="货位" min-width="100px"></el-table-column>
          <!-- <el-table-column prop="unitName" align="center" label="单位" min-width="100px"></el-table-column> -->
          <el-table-column prop="num" :label="type == 1 ? '待入库数量' : '待出库数量'" align="center" min-width="100px">
            <template slot-scope="{row}">
              {{ row.num + row.unitName }}
            </template>
          </el-table-column>
        </el-table>
      </div>
    </div>
    <div v-if="notArray&&notArray.length">
      <div style="margin:10px">
        <div class="property-title" style="margin-bottom:10px">{{type == 1 ? '已入库物料' : '已出库物料'}}</div>
        <el-table
          :data="notArray"
          border
          stripe
        >
          <el-table-column align="center" label="序号" fixed="left" type="index" />
          <el-table-column prop="materialName" align="center" label="物料名称" min-width="100px"></el-table-column>
          <el-table-column prop="materialCode" align="center" label="物料编码" min-width="160px"></el-table-column>
          <el-table-column prop="batch" align="center" label="批次号" min-width="100px"></el-table-column>
          <el-table-column align="center" prop="procedureName" label="工序" min-width="100px">
            <template slot-scope="{row}">
              <span >{{ row.procedureName || '-' }}</span>
            </template>
          </el-table-column>
          <el-table-column align="center" prop="procedureName" label="货位" show-overflow-tooltip min-width="130px">
            <template slot-scope="{row}">
              <span class="long-title-type">{{ row.locationName || '-' }}</span>
            </template>
          </el-table-column>
          <el-table-column align="center" label="质量属性" min-width="100px">
            <template slot-scope="{row}">
              <span v-if="row.qualityType==0" class="valid-style">合格</span>
              <span v-else-if="row.qualityType==1" class="unvalid-style">不良</span>
              <span v-else-if="row.qualityType==2" class="scrap-style">报废</span>
              <span v-else>-</span>
            </template>
          </el-table-column>
          <!-- <el-table-column prop="unitName" align="center" label="单位" min-width="100px"></el-table-column> -->
          <el-table-column prop="num" :label="type == 1 ? '已入库数量' : '已出库数量'" align="center" min-width="100px">
            <template slot-scope="{row}">
              {{ row.doneNum + row.unitName }}
            </template>
          </el-table-column>
        </el-table>
      </div>
    </div>
    <div slot="footer" class="window__header">
      <el-button type="primary" @click="cancel">返回</el-button>
    </div>
  </GlobalWindow>
</template>
 
<script>
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
export default {
  name: 'OperaWboundDetailExtWindow',
  extends: BaseOpera,
  components: { GlobalWindow },
  data () {
    return {
      // 表单数据
      form: {
        abstracts: null,
        code: null,
        warehouseCode: null,
        warehouseName: null,
        planDate: null,
        userName: null,
        userDepartName: null,
        createTime: null,
        cancelInfo: null,
        updateName: null,
        updateMobile: null,
        updateTime: null,
        billType: null,
        status: 0
      },
      didArray: [],
      notArray: [],
      type: 0, // 0出库 1入库
      billType: [
        { name: '车间领料', id: 1 },
        { name: '计划领料', id: 2 },
        { name: '机台备料', id: 3 },
        { name: '完工入库', id: 4 },
        { name: '车间转库', id: 5 },
        { name: '外协领料转库', id: 6 },
        { name: '外协完工转库', id: 7 },
        { name: '产品入库', id: 8 },
        { name: '产品转库', id: 9 },
        { name: '让步放行入库', id: 10 },
        { name: '让步放行转库', id: 11 },
        { name: '客返返修领料', id: 12 },
        { name: '客返返修入库', id: 13 },
        { name: '跨组织转库', id: 14 },
        { name: '工序报废', id: 15 },
        { name: '客退返修领料', id: 16 },
        { name: '客退返修入库', id: 17 },
        { name: '销售出库', id: 18 },
        { name: '让步销售', id: 19 },
        { name: '工单投料', id: 20 },
        { name: '仓库报废', id: 21 },
        { name: '客退检验领料', id: 22 },
        { name: '客返检验领料', id: 23 },
        { name: '工单产出', id: 24 },
        { name: '采购入库', id: 25 },
        { name: '客退检验入库', id: 26 },
        { name: '客返检验入库', id: 27 },
        { name: '库存调整', id: 28 },
        { name: '废品入库', id: 30 },
      ],
    }
  },
  created () {
    this.config({
      api: '/ext/materialExt',
      'field.id': 'id'
    })
  },
  methods: {
    open (title, target, type) {
      // console.log(title, target, type)
      this.title = title
      this.type = type
      this.visible = true
      this.notArray = target.woutboundDetailsOut
      this.didArray = target.woutboundDetailsWait
      // console.log(this.didArray)
      // 编辑
      // console.log('target', target)
      this.$nextTick(() => {
        for (const key in this.form) {
          this.form[key] = target[key]
        }
        // console.log('this.form', this.form)
      })
    },
    statusToStr (status) {
      switch (status) {
      case 0:
        return this.type === 1 ? '未入库' : '未出库'
      case 1:
        return this.type === 1 ? '已入库' : '已出库'
      case 2:
        return '已取消'
      default:
        return ''
      }
    },
    cancel () {
      this.$refs.form.resetFields()
      this.visible = false
      // let that = this
    },
    applyStr (row) {
      return `${row.userName}/${row.userDepartName}`
    },
    billToStr (type) {
      // console.log('billToStr', type)
      for (const item of this.billType) {
        if (item.id === type) return item.name
      }
      return '-'
    }
  }
}
</script>
 
<style lang="scss" scoped>
.count-style {
  display: inline-block;
  width: 30%;
  height: 30px;
}
.massage-style {
  .el-form-item {
    margin-bottom: 0px !important;
  }
}
 
</style>