seatonwan9
2025-08-14 a0fc5b1e703769a8936fd8671ec9cdd9adfda20a
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
<template>
  <div class="wrapbox">
    <newApprovalView
      ref="newProApprovalViewAllRef"
      @setDraftDisable="handleSetDraftDisable"
      @setSubmitDisable="handleSetSubmitDisable"
      @returnCurrentApproStatus="getCurrentApproStatus"
    ></newApprovalView>
 
    <div class="footerbtns">
      <el-button
        type="primary"
        class="footerbtn"
        size="large"
        plain
        @click="goBackList"
        >返回</el-button
      >
      <el-button
        type="primary"
        class="footerbtn"
        size="large"
        v-if="state.routeData?.informationEditType != 'view'"
        :disabled="state.draftDisabled"
        plain
        @click="saveBasicDraft"
        >{{ isSaveName() }}</el-button
      >
      <el-button
        v-if="isVisiteSubmit()"
        type="primary"
        @click="submitClick"
        class="footerbtn"
        :disabled="state.submitDisabled"
        size="large"
        >提交</el-button
      >
    </div>
  </div>
</template>
 
<script lang="ts">
export default {
  name: 'meritRatingNewDetail',
}
</script>
<script setup lang="ts">
import productService from '@/api/zhongjian/productApi' // 接口文件
import Base64 from '@/utils/base64'
import { useRoute } from 'vue-router'
import { useUserInfo } from '@/stores/modules/userInfo'
import newApprovalView from './components/newApprovalView.vue' //增删改查组件
const userStore = useUserInfo() // 用户相关的状态管理器
const route = useRoute()
const state = reactive<any>({
  formData: {
    businessProcessIdList: [],
    businessProcessNameList: [],
    businessTypeId: '',
    businessTypeName: '',
    constructionUnit: '',
    contactJob: '',
    contactNumber: '',
    contactUnit: '',
    contacts: '',
    id: '',
    importantAreaIdList: [],
    importantAreaNameList: [],
    industrialChainIdList: [],
    industrialChainNameList: [],
    name: '',
    technologyTypeId: '',
    technologyTypeName: '',
    productDetailInfos: [],
    ownershipId: '',
    ownershipName: '',
  },
  productionTecknCategory: [], //产品技术类型
  productTechnologyCategory: [],
  productOwnershipOption: [],
  productionBusinessCategory: [],
  classifyInfoType: [], //行业领域
  importantAreaType: [], //单位工程
  importantAreaTypeywhj: [], //业务环节
  dictObj: {
    ProductDifficulty: [],
    AwardGrade: [],
    ResourceCategory: [],
  },
  currentRichData: '',
  isSaveSubmit: false,
  disabled: false,
  draftDisabled: false,
  srcData: '',
  routeData: {
    informationEditType: '',
    id: '',
  },
  defaultCheckedAreaIds: [],
  currentAproStatus: '',
})
const newProApprovalViewAllRef = ref()
const currentCreatUserId = ref()
const getCurrentApproStatus = (val: any) => {
  state.currentAproStatus = val
  currentCreatUserId.value = userStore.getUserId
}
const isVisiteSubmit = computed(() => {
  return function () {
    if (state.routeData?.informationEditType != 'view') {
      if (
        state.routeData?.informationEditType == 'add' ||
        (state.routeData?.informationEditType == 'edit' &&
          state.routeData?.createUserId == currentCreatUserId.value &&
          (state.currentAproStatus == 3 || state.currentAproStatus == 4))
      ) {
        return true
      } else {
        return false
      }
    } else {
      return false
    }
  }
})
const isSaveName = computed(() => {
  return function () {
    if (
      state.currentAproStatus == 3 ||
      state.currentAproStatus == 4 ||
      state.currentAproStatus == null ||
      state.currentAproStatus == '' ||
      state.currentAproStatus == undefined
    ) {
      return '存草稿'
    } else {
      return '保存'
    }
  }
})
 
const handleSetSubmitDisable = (val: boolean) => {
  state.submitDisabled = val
}
const handleSetDraftDisable = (val: boolean) => {
  state.draftDisabled = val
}
const submitClick = () => {
  state.submitDisabled = true
  newProApprovalViewAllRef.value.submitClick(true)
}
const goBackList = () => {
  newProApprovalViewAllRef.value.goBackList()
}
// 保存草稿
const saveBasicDraft = () => {
  state.draftDisabled = true
  newProApprovalViewAllRef.value.saveBasicDraft()
}
// dictObj当前的字典下拉数据源;id:是选择框选择的id
const returnContentName = (dictObj: any, selectId: any) => {
  if (dictObj.id == selectId) {
    return dictObj.name
  }
  if (dictObj.children && dictObj.children.length > 0) {
    dictObj.children.forEach((sub: any) => {
      returnContentName(sub, selectId)
    })
  }
}
const returnContentLabel = (dictObj: any, selectId: any) => {
  if (dictObj.value == selectId) {
    return dictObj.label
  }
  if (dictObj.children && dictObj.children.length > 0) {
    for (let i = 0; i < dictObj.children.length; i++) {
      let name: any = returnContentLabel(dictObj.children[i], selectId)
      if (name) return name
    }
  }
}
onMounted(() => {
  state.routeData = JSON.parse(Base64.decode(route.query.info))
  newProApprovalViewAllRef.value.setData(state.routeData)
  if (state.routeData.informationEditType == 'add') {
    state.currentAproStatus = null
  }
  state.draftDisabled = false
  state.submitDisabled = false
})
onActivated(() => {
  state.routeData = JSON.parse(Base64.decode(route.query.info))
  if (state.routeData.informationEditType == 'add') {
    state.currentAproStatus = null
  }
  newProApprovalViewAllRef.value.setData(state.routeData)
  state.submitDisabled = false
  state.draftDisabled = false
})
</script>
<style scoped lang="scss">
.wrapbox {
  border: 1px solid #dce6f4;
  border-radius: 4px;
}
.viewbox-cont {
  padding: 10px;
  h2 {
    padding: 6px 15px;
    background-color: #dce6f4;
    color: #5b6ad8;
    font-size: 17px;
    border: 1px solid #bbc6fc;
    border-radius: 4px;
  }
}
.formitem {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.item-desc {
  display: flex;
  margin-top: 12px;
  font-weight: 600;
  align-items: center;
  position: relative;
  height: 25px;
  .xing {
    font-size: 24px;
    color: rgb(247, 23, 23);
    padding-right: 5px;
    padding-top: 9px;
    display: flex;
  }
  .titletxt {
    padding-bottom: 5px;
  }
  .xing-tb {
    font-size: 24px;
    color: rgb(247, 23, 23);
    padding-right: 5px;
    padding-top: 5px;
  }
}
.borderbox {
  border: 1px solid #dddddd;
  padding: 0px 10px;
  width: 100%;
  border-radius: 4px;
  .el-radio-group {
    .el-radio--large {
    }
  }
}
.customTh {
  display: flex;
  justify-content: center;
  align-items: center;
  .xing-tb {
    display: inline-block;
    font-size: 24px;
    color: rgb(247, 23, 23);
    padding-right: 5px;
  }
}
:deep(.el-tag.el-tag--info) {
  border: 1px solid #e4e4e4;
  border-radius: 3px;
  background-color: #f8f8f8;
}
:deep(.el-form-item) {
  margin-bottom: 0px;
}
.table {
  width: 100%;
}
.btnicon {
  cursor: pointer;
  &:hover {
    color: #5b6ad8;
  }
}
.rowBtnDiv {
  display: flex;
  justify-content: center;
}
.addbtn {
  margin-top: 10px;
}
.footerbtns {
  display: flex;
  justify-content: center;
}
.footerbtn {
  margin: 10px 10px;
}
</style>