haoxuan
2023-09-18 40fc2783a9c4b102ca298fb91aa1e04614405af8
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
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
<template>
  <div class="add-common">
    <el-dialog
      :title="editCommonConfig.title + '位置'"
      :visible.sync="editConfig.visible"
      :width="dialogWidth"
      :before-close="handleClose"
    >
      <!-- 头 -->
      <div slot="title" class="dialog-header">
        <span>{{ editCommonConfig.title + "位置" }}</span>
        <div class="header_btns">
          <span class="btn">
            <i class="el-icon-printer"></i>
            <span>打印</span>
          </span>
          <span class="btn" style="margin-left: 15px">
            <i class="el-icon-s-tools"></i>
            <span>动作</span>
          </span>
          <el-button v-if="showEdit" plain size="mini" style="margin-left: 15px" @click="editClick">编辑</el-button>
        </div>
      </div>
      <!-- 内容 -->
      <el-form
        ref="form"
        :model="editConfig.infomation"
        :rules="rules"
        label-position="left"
        label-width="110px"
        size="mini"
        style="height: 60vh; overflow-x: hidden"
      >
        <div>
          <!-- <div>aaa</div> -->
          <FormBtnsView :showPosition="true" :showWarehouse=false @productClick="productClick" />
        </div>
        <div class="basic-info">
          <div class="basic-info-view">
 
            <el-row>
              <el-col :span="24" class="line_height_30px">
                <el-form-item label="位置名称" prop="client_name">
                  <el-input
                  :disabled="showEdit"
                    v-model="editConfig.infomation.inspectionScale"
                    placeholder="请输入"
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item label="上级位置" prop="client_name">
                  <el-input
                  :disabled="showEdit"
                    v-model="editConfig.infomation.inspectionScale"
                    placeholder="请输入"
                  ></el-input>
                </el-form-item>
              </el-col>
            </el-row>
          </div>
          <div class="bottom">
              <div class="left">
                <div class="second-label">其他信息</div>
                <el-form-item label="位置类型" prop="desc">
                  <el-select
                   v-model="editConfig.value1"
                    filterable
                    :disabled="showEdit"
                    clearable
                    placeholder="请选择"
                    style="width: 100%"
                    no-data-text="暂无数据"
                  >
                    <el-option
                      v-for="item in wareList"
                      :key="item.id"
                      :label="item.name"
                      :value="item.id"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="是一个报废位置" prop="desc">
                  <el-checkbox
                  :disabled="showEdit"
                  v-model="editConfig.value2"
                  >
                  </el-checkbox>
                </el-form-item>
                <el-form-item label="是一个退回位置" prop="desc">
                  <el-checkbox
                  :disabled="showEdit"
                  v-model="editConfig.value2"
                  >
                  </el-checkbox>
                </el-form-item>
                <el-form-item label="补充位置" prop="desc">
                  <el-checkbox
                  :disabled="showEdit"
                  v-model="editConfig.value2"
                  >
                  </el-checkbox>
                </el-form-item>
              </div>
              <div class="left">
                <div class="second-label">循环计数</div>
                <el-form-item label="盘点频率(天)" prop="desc">
                  <el-input
                    :disabled="showEdit"
                    v-model="editConfig.infomation.inspectionScale"
                    placeholder="请输入"
                  ></el-input>
                </el-form-item>
                <el-form-item label="最近有效盘点" prop="desc">
                  <el-input
                    :disabled="showEdit"
                    v-model="editConfig.infomation.inspectionScale"
                    placeholder="请输入"
                  ></el-input>
                </el-form-item>
                <el-form-item label="预计下一次盘点" prop="desc">
                  <el-input
                    :disabled="showEdit"
                    v-model="editConfig.infomation.inspectionScale"
                    placeholder="请输入"
                  ></el-input>
                </el-form-item>
              </div>
          </div>
          <div class="bottom">
            <div class="left">
                <div class="second-label">物流</div>
                <el-form-item label="下载策略" prop="desc">
                  <el-select
                   v-model="editConfig.value1"
                    filterable
                    :disabled="showEdit"
                    clearable
                    placeholder="请选择"
                    style="width: 100%"
                    no-data-text="暂无数据"
                  >
                    <el-option
                      v-for="item in wareList"
                      :key="item.id"
                      :label="item.name"
                      :value="item.id"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="外部备注" prop="desc">
                  <el-input
                     :disabled="showEdit"
                      type="textarea"
                      :autosize="{ minRows: 3, maxRows: 4 }"
                      maxlength="500"
                      clearable
                      v-model="editConfig.value1"
                  ></el-input>
                </el-form-item>
              </div>
          </div>
        </div>
      </el-form>
      <!-- 尾 -->
      <div v-if="showFooter" slot="footer" class="dialog-footer">
        <el-button size="small" @click="editConfig.visible = false">取消</el-button>
        <el-button type="primary" size="small" @click="saveClick('form')">保存</el-button>
      </div>
    </el-dialog>
  </div>
</template>
 
<script>
export default {
  name: "AddScrapDialog",
  props: {
    editCommonConfig: {
      type: Object,
      default: () => {
        return {
          visible: false,
          title: "新建",
          infomation: {}
        }
      }
    }
  },
  components: {},
  computed: {},
  data() {
    return {
      dialogWidth: "50%",
      editConfig: this.editCommonConfig,
      rules: {
      
        number: [{ required: true, message: "请输入退款单编号", trigger: "blur" }],
        refundDate: [{ required: true, message: "请选择退款日期", trigger: "change" }],
        memberId: [{ required: true, message: "请选择销售负责人", trigger: "change" }],
        sale_return_nunber: [{ required: true, message: "请选择销售退货单", trigger: "change" }]
      },
      memberOptions: [],
      paymentTypeListOptions: [],
      showEdit: false, // 是否显示编辑按钮
      showFooter: false, // 是否显示取消保存
      currentState: "todo", // 当前状态
      wareList:[
        {
          name:'直接接收产品(1步收货)',
          id:1,
          disabled:false,
        },
        {
          name:'接到产品到收料区,再入库(2步收货)',
          id:2,
          disabled:true,
        },
        {
          name:'接收产品到收料区,检验,然后入库(3步收货)',
          id:3,
          disabled:true,
        }
      ],
      wareoutList:[
        {
          name:'直接出库(1步)',
          id:1,
          disabled:false,
        },
        {
          name:'送到待出库区,再送货(2步发货)',
          id:2,
          disabled:true,
        },
        {
          name:'包装产品,发送到待出库区,再送货(3步发货)',
          id:3,
          disabled:true,
        }
      ],
    }
  },
  created() {
    this.setBottonView()
  },
  methods: {
    // 路线
    productClick() {
      
    },
    // 设置删除/打印/编辑是否显示
    setBottonView() {
      if (this.editConfig.title === "新建") {
        this.showEdit = false
        this.showFooter = true
      } else if (this.editConfig.infomation.status === "完成") {
        this.showEdit = false
        this.showFooter = false
      } else {
        this.showEdit = true
        this.showFooter = false
      }
    },
    // 关闭
    handleClose() {
      this.editConfig.visible = false
    },
    // 编辑
    editClick() {
      this.showEdit = false
      this.showFooter = true
    },
    // 保存
    saveClick() {}
  }
}
</script>
 
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.dialog-header {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #333;
  .header_btns {
    margin-left: auto;
    margin-right: 60px;
    .btn {
      cursor: no-drop;
    }
  }
}
.content-status {
  display: flex;
}
.basic-info {
  height: calc(100% - 80px);
  overflow: auto;
  margin: 20px;
  border: 1px solid #dcdfe6;
  box-shadow: inset 0 0 2px #dee2e6;
  -moz-box-shadow: inset 0 0 2px #dee2e6;
  -webkit-box-shadow: inset 0 0 2px #dee2e6;
  .basic-info-view {
    margin-top: 20px;
    padding:0 20px;
 
  }
  .bottom{
    display: flex;
    margin-left: 20px;
    .left {
      width: calc(50% - 10px);
      margin-right:20px;
    }
    .right {
      width: calc(50% - 10px);
    }
    .second-label {
      
      border-bottom: 1px solid #d9d9d9;
      margin-bottom: 10px;
    }
    ::v-deep .el-tabs__content{
      padding: 0 20px;
    }
  }
  
}
.purchase-view {
  display: flex;
  .left {
    width: 50%;
  }
  .right {
    width: 50%;
  }
}
 
::v-deep {
  .el-dialog__headerbtn {
    position: absolute;
    top: 18px;
  }
  .el-button {
    &:hover {
      border: 1px solid #dcdfe6;
      color: #333;
    }
  }
  .el-tabs--card > .el-tabs__header .el-tabs__nav {
    margin-left: 20px;
  }
  .el-tabs__item {
    height: 30px;
    line-height: 30px;
    font-size: 13px;
  }
}
</style>