zouyu
2023-11-17 d8ac6057eaad648687699e25a575f3b7b8c1b102
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
<!--
 * @Descripttion:
 * @version:
 * @Author: zt_lc
 * @Date: 2022-06-08 15:49:37
 * @LastEditors: zt_lc
 * @LastEditTime: 2022-08-18 14:07:40
-->
<template>
  <el-dialog
    width="25%"
    title="是否重新生产"
    :visible.sync="innerVisible"
    append-to-body
    @close="$emit('update:currshowlist', false)"
    :show="currshowlist"
    :close-on-click-modal="false"
    class="is-reproduce-form"
  >
    <div>
      <el-radio v-model="isReproduceStr" label="1">重新生产</el-radio>
      <el-radio v-model="isReproduceStr" label="2">不重新生产</el-radio>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button @click="innerVisible = false">取 消</el-button>
      <el-button type="primary" @click="saveReset">确 定</el-button>
    </div>
  </el-dialog>
</template>
<style></style>
<script>
import { resetSn } from '@/api/plan/segmentmerge'
import ElButton from '../../../../node_modules/element-ui/packages/button/src/button.vue'
export default {
  components: { ElButton },
  props: {
    currshowlist: {
      type: Boolean,
      default: false
    },
    orderSnGenerateIdList: {
      type: Array,
      default: () => {
        return []
      }
    }
  },
  data() {
    return {
      innerVisible: false,
      isReproduceStr: '1'
    }
  },
  methods: {
    saveReset() {
      let isReproduce = true
      if (this.isReproduceStr == '1') {
        isReproduce = true
      } else {
        isReproduce = false
      }
      const paramObj = {
        idList: this.orderSnGenerateIdList,
        isReproduce: isReproduce
      }
      resetSn(paramObj).then((response) => {
        const resData = response.data
        this.innerVisible = false
        this.$emit('refreshTaskDetailInfoList')
      })
    }
  },
  watch: {
    currshowlist() {
      this.innerVisible = this.currshowlist
      if (this.currshowlist) {
        this.isReproduceStr = '1'
        this.$nextTick(() => {})
      }
    }
  }
}
</script>