feat(customerConfig): 重构客户配置对话框
- 重新设计了客户配置对话框的布局和逻辑 - 新增了口岸选择功能 - 优化了表单验证和数据处理流程 - 改进了文件上传和证书管理 - 统一了样式和组件使用
Showing
3 changed files
with
581 additions
and
503 deletions
| ... | @@ -24,7 +24,7 @@ router.beforeEach((to, from, next) => { | ... | @@ -24,7 +24,7 @@ router.beforeEach((to, from, next) => { |
| 24 | store.dispatch('GetInfo').then((res) => { | 24 | store.dispatch('GetInfo').then((res) => { |
| 25 | // if (res.success) { | 25 | // if (res.success) { |
| 26 | store.dispatch('GenerateRoutes').then(accessRoutes => { | 26 | store.dispatch('GenerateRoutes').then(accessRoutes => { |
| 27 | - store.dispatch("GetDict", ['DECLARE_F_FLAG', 'MEASUREMENT_UNIT','TEMPLATE_TYPE','PACKAGE_TYPE_CODE', 'RECEIPT_STATUS', 'DECLARE_APPTYPE', 'CURRENCY','COUNTRY_REGION_CODE', 'DECLARE_STATISTICS_FLAG', 'ORDER_DECLARATION_PARTY','APP_STATUS','METHOD_OF_SIGNATURE']); | 27 | + store.dispatch("GetDict", ['DECLARE_F_FLAG', 'MEASUREMENT_UNIT','TEMPLATE_TYPE','PACKAGE_TYPE_CODE', 'RECEIPT_STATUS', 'DECLARE_APPTYPE', 'CURRENCY','COUNTRY_REGION_CODE', 'DECLARE_STATISTICS_FLAG', 'ORDER_DECLARATION_PARTY','APP_STATUS','METHOD_OF_SIGNATURE','METHOD_OF_SIGNATURE']); |
| 28 | // 根据roles权限生成可访问的路由表 | 28 | // 根据roles权限生成可访问的路由表 |
| 29 | router.addRoutes(accessRoutes) // 动态添加可访问路由表 | 29 | router.addRoutes(accessRoutes) // 动态添加可访问路由表 |
| 30 | next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 | 30 | next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 | ... | ... |
| ... | @@ -77,206 +77,240 @@ | ... | @@ -77,206 +77,240 @@ |
| 77 | placeholder="" | 77 | placeholder="" |
| 78 | > | 78 | > |
| 79 | <el-option | 79 | <el-option |
| 80 | - v-for="(item, index) in $store.getters.dict.ORDER_DECLARATION_PARTY" | 80 | + v-for="(item, index) in $store.getters.dict.ORDER_DECLARATION_PARTY" |
| 81 | - :key="index" | 81 | + :key="index" |
| 82 | - :label="item.itemChineseName" | 82 | + :label="item.itemChineseName" |
| 83 | - :value="item.itemValue" | 83 | + :value="item.itemValue" |
| 84 | - ></el-option> | 84 | + ></el-option> |
| 85 | </el-select> | 85 | </el-select> |
| 86 | </Formitem> | 86 | </Formitem> |
| 87 | </el-col> | 87 | </el-col> |
| 88 | - </el-row> | 88 | + <!-- 口岸选择--> |
| 89 | - <div v-if="formData.orderRequester=='2'"> | 89 | + <el-col :span="8" v-if="formData.orderRequester === '2'"> |
| 90 | - <div class="checkTitle"> | 90 | + <Formitem label="申报地区" prop="choosePortCode" type="edit"> |
| 91 | - <el-checkbox v-model="formData.qdCheck" @change="changeQDCheckBox()"></el-checkbox>青岛 | 91 | + <el-select |
| 92 | - </div> | ||
| 93 | - <el-row :gutter="5"> | ||
| 94 | -<!-- <div v-if="isCipherMachine">--> | ||
| 95 | - <!-- 公服DXPID --> | ||
| 96 | - <el-col :span="8"> | ||
| 97 | - <Formitem label="公服DXPID" prop="qingdaoUserDxpid" type="edit"> | ||
| 98 | - <el-input | ||
| 99 | - type="text" | ||
| 100 | - class="inputShadow" | ||
| 101 | - id="inputInner-edit-qingdaoUserDxpid" | ||
| 102 | - resize="none" | ||
| 103 | - v-model="formData.qingdaoUserDxpid" | ||
| 104 | - clearable | ||
| 105 | - placeholder="" | ||
| 106 | - :disabled="!formData.qdCheck" | ||
| 107 | - ></el-input> | ||
| 108 | - </Formitem> | ||
| 109 | - </el-col> | ||
| 110 | - <!-- User ID --> | ||
| 111 | - <el-col :span="8"> | ||
| 112 | - <Formitem label="User ID" prop="qingdaoUserId" type="edit"> | ||
| 113 | - <el-input | ||
| 114 | - type="text" | ||
| 115 | - class="inputShadow" | ||
| 116 | - id="inputInner-edit-qingdaoUserId" | ||
| 117 | - resize="none" | ||
| 118 | - v-model="formData.qingdaoUserId" | ||
| 119 | - clearable | ||
| 120 | - placeholder="" | ||
| 121 | - :disabled="!formData.qdCheck" | ||
| 122 | - ></el-input> | ||
| 123 | - </Formitem> | ||
| 124 | - </el-col> | ||
| 125 | - <!-- Key --> | ||
| 126 | - <el-col :span="8"> | ||
| 127 | - <Formitem label="Key" prop="qingdaoKey" type="edit"> | ||
| 128 | - <el-input | ||
| 129 | - type="text" | ||
| 130 | - class="inputShadow" | ||
| 131 | - id="inputInner-edit-qingdaoKey" | ||
| 132 | - resize="none" | ||
| 133 | - v-model="formData.qingdaoKey" | ||
| 134 | - clearable | ||
| 135 | - placeholder="" | ||
| 136 | - :disabled="!formData.qdCheck" | ||
| 137 | - ></el-input> | ||
| 138 | - </Formitem> | ||
| 139 | - </el-col> | ||
| 140 | -<!-- </div>--> | ||
| 141 | - <el-col :span="8"> | ||
| 142 | - <Formitem label="山电DXPID" prop="qingdaoDanyiUserDxpid" type="edit"> | ||
| 143 | - <el-input | ||
| 144 | - type="text" | ||
| 145 | - class="inputShadow" | ||
| 146 | - id="inputInner-edit-qingdaoDanyiUserDxpid" | ||
| 147 | - resize="none" | ||
| 148 | - v-model="formData.qingdaoDanyiUserDxpid" | ||
| 149 | - clearable | ||
| 150 | - placeholder="" | ||
| 151 | - :disabled="!formData.qdCheck" | ||
| 152 | - ></el-input> | ||
| 153 | - </Formitem> | ||
| 154 | - </el-col> | ||
| 155 | - <el-col :span="8"> | ||
| 156 | - <Formitem label="山电用户名" prop="qingdaoUserName" type="edit"> | ||
| 157 | - <el-input | ||
| 158 | - type="text" | ||
| 159 | - class="inputShadow" | ||
| 160 | - id="inputInner-edit-qingdaoUserName" | ||
| 161 | - resize="none" | ||
| 162 | - v-model="formData.qingdaoUserName" | ||
| 163 | - clearable | ||
| 164 | - placeholder="" | ||
| 165 | - :disabled="!formData.qdCheck" | ||
| 166 | - ></el-input> | ||
| 167 | - </Formitem> | ||
| 168 | - </el-col> | ||
| 169 | - <el-col :span="8"> | ||
| 170 | - <Formitem label="山电用户密码" prop="qingdaoUserPassword" type="edit"> | ||
| 171 | - <el-input | ||
| 172 | type="text" | 92 | type="text" |
| 173 | - class="inputShadow" | 93 | + id="inputInner-edit-choosePortCode" |
| 174 | - id="inputInner-edit-qingdaoUserPassword" | 94 | + v-model="choosePortCode" |
| 175 | - resize="none" | ||
| 176 | - v-model="formData.qingdaoUserPassword" | ||
| 177 | clearable | 95 | clearable |
| 96 | + multiple | ||
| 97 | + maxlength="4" | ||
| 178 | placeholder="" | 98 | placeholder="" |
| 179 | - :disabled="!formData.qdCheck" | 99 | + > |
| 180 | - ></el-input> | 100 | + <el-option |
| 101 | + v-for="(item, index) in portCodeList" | ||
| 102 | + :key="index" | ||
| 103 | + :label="item" | ||
| 104 | + :value="item" | ||
| 105 | + ></el-option> | ||
| 106 | + </el-select> | ||
| 181 | </Formitem> | 107 | </Formitem> |
| 182 | </el-col> | 108 | </el-col> |
| 183 | - <el-col :span="16" style="padding-right: 5px;"> | 109 | + </el-row> |
| 184 | - <div class="uploadItem"> | 110 | + <div v-if="choosePortCode.includes('TAO')"> |
| 185 | - <div class="uploadbox"> | 111 | + <div class="dlTitle"> |
| 186 | - <el-button | 112 | + <!-- <el-checkbox v-model="formData.qdCheck" @change="changeQDCheckBox()"></el-checkbox>--> |
| 187 | - size="mini" | 113 | + 青岛 |
| 188 | - type="text" | ||
| 189 | - v-loading="loadings.qingdaoUploadLoading" | ||
| 190 | - @click="qingdaoUploadFile" | ||
| 191 | - >上传文件 | ||
| 192 | - </el-button> | ||
| 193 | - <el-upload | ||
| 194 | - class="upload-demo" | ||
| 195 | - ref="qingdaoUploadFile" | ||
| 196 | - action="/manager-server/attachment/picImg" | ||
| 197 | - :http-request="qingdaoFileUpload" | ||
| 198 | - :auto-upload="true" | ||
| 199 | - :show-file-list="false" | ||
| 200 | - :data="{}" | ||
| 201 | - :before-upload="qingdaoBeforeUpload" | ||
| 202 | - :on-remove="qingdaoHandleRemove" | ||
| 203 | - :on-success="qingdaoHandleSuccess" | ||
| 204 | - :on-change="qingdaoFileChange" | ||
| 205 | - :file-list="qingdaoFileList" | ||
| 206 | - @clearFiles="clearqingdaoFile" | ||
| 207 | - > | ||
| 208 | - </el-upload> | ||
| 209 | </div> | 114 | </div> |
| 210 | - <div class="fileList" v-if="formData.qingdaoFile != null || formData.qingdaoCertificatePath"> | 115 | + <el-row :gutter="5"> |
| 211 | - <div class="fileList-item"> | 116 | + <!-- <div v-if="isCipherMachine">--> |
| 212 | - <div class="uploadbox-fileName" > | 117 | + <!-- 公服DXPID --> |
| 213 | - <svg-icon | 118 | + <el-col :span="8"> |
| 214 | - class="el-icon-user-solid" | 119 | + <Formitem label="公服DXPID" prop="qingdaoUserDxpid" type="edit"> |
| 215 | - icon-class="exl" | 120 | + <el-input |
| 216 | - style="font-size: 18px; color: #de002e" | 121 | + type="text" |
| 217 | - /> | 122 | + class="inputShadow" |
| 218 | - <Tooltip | 123 | + id="inputInner-edit-qingdaoUserDxpid" |
| 219 | - :content="formData.qingdaoFile ? formData.qingdaoFile.name : formData.qingdaoCertificatePath.split('/').pop()" | 124 | + resize="none" |
| 220 | - :refName="formData.qingdaoFile ? formData.qingdaoFile.name : formData.qingdaoCertificatePath.split('/').pop()" | 125 | + v-model="portConfig.TAO.dxpId" |
| 221 | - /> | 126 | + clearable |
| 127 | + placeholder="" | ||
| 128 | + ></el-input> | ||
| 129 | + </Formitem> | ||
| 130 | + </el-col> | ||
| 131 | + <!-- User ID --> | ||
| 132 | + <el-col :span="8"> | ||
| 133 | + <Formitem label="User ID" prop="qingdaoUserId" type="edit"> | ||
| 134 | + <el-input | ||
| 135 | + type="text" | ||
| 136 | + class="inputShadow" | ||
| 137 | + id="inputInner-edit-qingdaoUserId" | ||
| 138 | + resize="none" | ||
| 139 | + v-model="portConfig.TAO.userId" | ||
| 140 | + clearable | ||
| 141 | + placeholder="" | ||
| 142 | + ></el-input> | ||
| 143 | + </Formitem> | ||
| 144 | + </el-col> | ||
| 145 | + <!-- Key --> | ||
| 146 | + <el-col :span="8"> | ||
| 147 | + <Formitem label="Key" prop="qingdaoKey" type="edit"> | ||
| 148 | + <el-input | ||
| 149 | + type="text" | ||
| 150 | + class="inputShadow" | ||
| 151 | + id="inputInner-edit-qingdaoKey" | ||
| 152 | + resize="none" | ||
| 153 | + v-model="portConfig.TAO.key" | ||
| 154 | + clearable | ||
| 155 | + placeholder="" | ||
| 156 | + ></el-input> | ||
| 157 | + </Formitem> | ||
| 158 | + </el-col> | ||
| 159 | + <!-- </div>--> | ||
| 160 | + <el-col :span="8"> | ||
| 161 | + <Formitem label="山电DXPID" prop="qingdaoDanyiUserDxpid" type="edit"> | ||
| 162 | + <el-input | ||
| 163 | + type="text" | ||
| 164 | + class="inputShadow" | ||
| 165 | + id="inputInner-edit-qingdaoDanyiUserDxpid" | ||
| 166 | + resize="none" | ||
| 167 | + v-model="portConfig.TAO.danyiDxpId" | ||
| 168 | + clearable | ||
| 169 | + placeholder="" | ||
| 170 | + ></el-input> | ||
| 171 | + </Formitem> | ||
| 172 | + </el-col> | ||
| 173 | + <el-col :span="8"> | ||
| 174 | + <Formitem label="山电用户名" prop="qingdaoUserName" type="edit"> | ||
| 175 | + <el-input | ||
| 176 | + type="text" | ||
| 177 | + class="inputShadow" | ||
| 178 | + id="inputInner-edit-qingdaoUserName" | ||
| 179 | + resize="none" | ||
| 180 | + v-model="portConfig.TAO.userName" | ||
| 181 | + clearable | ||
| 182 | + placeholder="" | ||
| 183 | + ></el-input> | ||
| 184 | + </Formitem> | ||
| 185 | + </el-col> | ||
| 186 | + <el-col :span="8"> | ||
| 187 | + <Formitem label="山电用户密码" prop="qingdaoUserPassword" type="edit"> | ||
| 188 | + <el-input | ||
| 189 | + type="text" | ||
| 190 | + class="inputShadow" | ||
| 191 | + id="inputInner-edit-qingdaoUserPassword" | ||
| 192 | + resize="none" | ||
| 193 | + v-model="portConfig.TAO.password" | ||
| 194 | + clearable | ||
| 195 | + placeholder="" | ||
| 196 | + ></el-input> | ||
| 197 | + </Formitem> | ||
| 198 | + </el-col> | ||
| 199 | + <el-col :span="16" style="padding-right: 5px;"> | ||
| 200 | + <div class="uploadItem"> | ||
| 201 | + <div class="uploadbox"> | ||
| 202 | + <el-button | ||
| 203 | + size="mini" | ||
| 204 | + type="text" | ||
| 205 | + v-loading="loadings.qingdaoUploadLoading" | ||
| 206 | + @click="qingdaoUploadFile" | ||
| 207 | + >上传文件 | ||
| 208 | + </el-button> | ||
| 209 | + <el-upload | ||
| 210 | + class="upload-demo" | ||
| 211 | + ref="qingdaoUploadFile" | ||
| 212 | + action="/manager-server/attachment/picImg" | ||
| 213 | + :http-request="qingdaoFileUpload" | ||
| 214 | + :auto-upload="true" | ||
| 215 | + :show-file-list="false" | ||
| 216 | + :data="{}" | ||
| 217 | + :file-list="qingdaoFileList" | ||
| 218 | + > | ||
| 219 | + </el-upload> | ||
| 220 | + </div> | ||
| 221 | + <div class="fileList" v-if="portConfig.TAO.certificateBase64 != '' || portConfig.TAO.certificateName"> | ||
| 222 | + <div class="fileList-item"> | ||
| 223 | + <div class="uploadbox-fileName"> | ||
| 224 | + <svg-icon | ||
| 225 | + class="el-icon-user-solid" | ||
| 226 | + icon-class="exl" | ||
| 227 | + style="font-size: 18px; color: #de002e" | ||
| 228 | + /> | ||
| 229 | + <Tooltip | ||
| 230 | + :content="portConfig.TAO.certificateName" | ||
| 231 | + :refName="portConfig.TAO.certificateName" | ||
| 232 | + /> | ||
| 233 | + </div> | ||
| 234 | + <div class="uploadbox-option"> | ||
| 235 | + <el-popconfirm | ||
| 236 | + :title="$t('entry.upload.delTip')" | ||
| 237 | + @confirm="delQingdaoTypeDFile" | ||
| 238 | + > | ||
| 239 | + <el-button slot="reference" type="text">{{ | ||
| 240 | + $t("entry.upload.del") | ||
| 241 | + }} | ||
| 242 | + </el-button> | ||
| 243 | + </el-popconfirm> | ||
| 244 | + </div> | ||
| 245 | + </div> | ||
| 246 | + </div> | ||
| 222 | </div> | 247 | </div> |
| 223 | - <div class="uploadbox-option"> | 248 | + </el-col> |
| 224 | - <el-popconfirm | 249 | + <!-- 加签方式 --> |
| 225 | - :title="$t('entry.upload.delTip')" | 250 | + <el-col :span="8"> |
| 226 | - @confirm="delQingdaoTypeDFile" | 251 | + <Formitem label="加签方式" prop="methodOfSignature" type="edit"> |
| 252 | + <el-select | ||
| 253 | + type="text" | ||
| 254 | + id="inputInner-edit-methodOfSignature" | ||
| 255 | + v-model="portConfig.TAO.methodOfSignature" | ||
| 256 | + clearable | ||
| 257 | + maxlength="4" | ||
| 258 | + placeholder="" | ||
| 227 | > | 259 | > |
| 228 | - <el-button slot="reference" type="text">{{ | 260 | + <el-option |
| 229 | - $t("entry.upload.del") | 261 | + v-for="(item, index) in $store.getters.dict.METHOD_OF_SIGNATURE" |
| 230 | - }}</el-button> | 262 | + :key="index" |
| 231 | - </el-popconfirm> | 263 | + :label="item.itemChineseName" |
| 232 | - </div> | 264 | + :value="item.itemValue" |
| 233 | - </div> | 265 | + ></el-option> |
| 234 | - </div> | 266 | + </el-select> |
| 235 | - </div> | 267 | + </Formitem> |
| 236 | - </el-col> | 268 | + </el-col> |
| 237 | <!-- 加密方式 --> | 269 | <!-- 加密方式 --> |
| 238 | -<!-- <el-col :span="8">--> | 270 | + <!-- <el-col :span="8">--> |
| 239 | -<!-- <Formitem label="加密方式" prop="methodOfSignature" type="edit">--> | 271 | + <!-- <Formitem label="加密方式" prop="methodOfSignature" type="edit">--> |
| 240 | -<!-- <el-select--> | 272 | + <!-- <el-select--> |
| 241 | -<!-- type="text"--> | 273 | + <!-- type="text"--> |
| 242 | -<!-- id="inputInner-edit-methodOfSignature"--> | 274 | + <!-- id="inputInner-edit-methodOfSignature"--> |
| 243 | -<!-- v-model="formData.methodOfSignature"--> | 275 | + <!-- v-model="formData.methodOfSignature"--> |
| 244 | -<!-- clearable--> | 276 | + <!-- clearable--> |
| 245 | -<!-- maxlength="4"--> | 277 | + <!-- maxlength="4"--> |
| 246 | -<!-- :disabled="!formData.qdCheck"--> | 278 | + <!-- :disabled="!formData.qdCheck"--> |
| 247 | -<!-- placeholder=""--> | 279 | + <!-- placeholder=""--> |
| 248 | -<!-- >--> | 280 | + <!-- >--> |
| 249 | -<!-- <el-option--> | 281 | + <!-- <el-option--> |
| 250 | -<!-- v-for="(item, index) in $store.getters.dict.METHOD_OF_SIGNATURE"--> | 282 | + <!-- v-for="(item, index) in $store.getters.dict.METHOD_OF_SIGNATURE"--> |
| 251 | -<!-- :key="index"--> | 283 | + <!-- :key="index"--> |
| 252 | -<!-- :label="item.itemChineseName"--> | 284 | + <!-- :label="item.itemChineseName"--> |
| 253 | -<!-- :value="item.itemValue"--> | 285 | + <!-- :value="item.itemValue"--> |
| 254 | -<!-- ></el-option>--> | 286 | + <!-- ></el-option>--> |
| 255 | -<!-- </el-select>--> | 287 | + <!-- </el-select>--> |
| 256 | -<!-- </Formitem>--> | 288 | + <!-- </Formitem>--> |
| 257 | -<!-- </el-col>--> | 289 | + <!-- </el-col>--> |
| 258 | - </el-row> | 290 | + </el-row> |
| 259 | - <div class="checkTitle"> | 291 | + </div> |
| 260 | - <el-checkbox v-model="formData.bjCheck" @change="changeBJCheckBox()"></el-checkbox>北京 | 292 | + <div v-if="choosePortCode.includes('PEK')"> |
| 293 | + <div class="dlTitle"> | ||
| 294 | + <!-- <el-checkbox v-model="formData.bjCheck" @change="changeBJCheckBox()"></el-checkbox>--> | ||
| 295 | + 北京 | ||
| 296 | + </div> | ||
| 297 | + <el-row :gutter="5"> | ||
| 298 | + <!-- DXPID --> | ||
| 299 | + <el-col :span="8"> | ||
| 300 | + <Formitem label="DXPID" prop="beijingDxpid" type="edit"> | ||
| 301 | + <el-input | ||
| 302 | + type="text" | ||
| 303 | + class="inputShadow" | ||
| 304 | + id="inputInner-edit-beijingDxpid" | ||
| 305 | + resize="none" | ||
| 306 | + v-model="portConfig.PEK.dxpId" | ||
| 307 | + clearable | ||
| 308 | + placeholder="" | ||
| 309 | + ></el-input> | ||
| 310 | + </Formitem> | ||
| 311 | + </el-col> | ||
| 312 | + </el-row> | ||
| 261 | </div> | 313 | </div> |
| 262 | - <el-row :gutter="5"> | ||
| 263 | - <!-- DXPID --> | ||
| 264 | - <el-col :span="8"> | ||
| 265 | - <Formitem label="DXPID" prop="beijingDxpid" type="edit"> | ||
| 266 | - <el-input | ||
| 267 | - type="text" | ||
| 268 | - class="inputShadow" | ||
| 269 | - id="inputInner-edit-beijingDxpid" | ||
| 270 | - resize="none" | ||
| 271 | - v-model="formData.beijingDxpid" | ||
| 272 | - clearable | ||
| 273 | - placeholder="" | ||
| 274 | - :disabled="!formData.bjCheck" | ||
| 275 | - ></el-input> | ||
| 276 | - </Formitem> | ||
| 277 | - </el-col> | ||
| 278 | - </el-row> | ||
| 279 | - | ||
| 280 | 314 | ||
| 281 | <section class="dlTitle"> | 315 | <section class="dlTitle"> |
| 282 | <h3>密码机管理</h3> | 316 | <h3>密码机管理</h3> |
| ... | @@ -308,64 +342,59 @@ | ... | @@ -308,64 +342,59 @@ |
| 308 | ></el-input> | 342 | ></el-input> |
| 309 | </Formitem> | 343 | </Formitem> |
| 310 | </el-col> | 344 | </el-col> |
| 311 | - <el-col :span="16" style="padding-right: 5px;"> | 345 | + <el-col :span="16" style="padding-right: 5px;"> |
| 312 | - <div class="uploadItem"> | 346 | + <div class="uploadItem"> |
| 313 | - <div class="uploadbox"> | 347 | + <div class="uploadbox"> |
| 314 | - <el-button | 348 | + <el-button |
| 315 | - size="mini" | 349 | + size="mini" |
| 316 | - type="text" | 350 | + type="text" |
| 317 | - v-loading="loadings.uploadLoading" | 351 | + v-loading="loadings.uploadLoading" |
| 318 | - @click="uploadFile" | 352 | + @click="uploadFile" |
| 319 | - >上传文件 | 353 | + >上传文件 |
| 320 | - </el-button> | 354 | + </el-button> |
| 321 | - <el-upload | 355 | + <el-upload |
| 322 | - class="upload-demo" | 356 | + class="upload-demo" |
| 323 | - ref="uploadFile" | 357 | + ref="uploadFile" |
| 324 | - action="/manager-server/attachment/picImg" | 358 | + action="/manager-server/attachment/picImg" |
| 325 | - :http-request="fileUpload" | 359 | + :http-request="fileUpload" |
| 326 | - :auto-upload="true" | 360 | + :auto-upload="true" |
| 327 | - :show-file-list="false" | 361 | + :show-file-list="false" |
| 328 | - :data="{}" | 362 | + :data="{}" |
| 329 | - :before-upload="beforeUpload" | 363 | + :file-list="fileList" |
| 330 | - :on-remove="handleRemove" | ||
| 331 | - :on-success="handleSuccess" | ||
| 332 | - :on-change="fileChange" | ||
| 333 | - :file-list="fileList" | ||
| 334 | - @clearFiles="clearFile" | ||
| 335 | - > | ||
| 336 | - </el-upload> | ||
| 337 | - </div> | ||
| 338 | - <!-- 1{{ formData.file }} --> | ||
| 339 | - <div class="fileList" v-if="formData.file != null || formData.certificare"> | ||
| 340 | - <div class="fileList-item"> | ||
| 341 | - <div class="uploadbox-fileName" > | ||
| 342 | - <svg-icon | ||
| 343 | - class="el-icon-user-solid" | ||
| 344 | - icon-class="exl" | ||
| 345 | - style="font-size: 18px; color: #de002e" | ||
| 346 | - /> | ||
| 347 | - <Tooltip | ||
| 348 | - :content="formData.file ? formData.file.name : formData.certificare" | ||
| 349 | - :refName="formData.file ? formData.file.name : formData.certificare" | ||
| 350 | - /> | ||
| 351 | - </div> | ||
| 352 | - <div class="uploadbox-option"> | ||
| 353 | - <el-popconfirm | ||
| 354 | - :title="$t('entry.upload.delTip')" | ||
| 355 | - @confirm="delTypeDFile" | ||
| 356 | > | 364 | > |
| 357 | - <el-button slot="reference" type="text">{{ | 365 | + </el-upload> |
| 358 | - $t("entry.upload.del") | 366 | + </div> |
| 359 | - }}</el-button> | 367 | + <!-- 1{{ formData.file }} --> |
| 360 | - </el-popconfirm> | 368 | + <div class="fileList" v-if="formData.file != null || formData.certificare"> |
| 369 | + <div class="fileList-item"> | ||
| 370 | + <div class="uploadbox-fileName"> | ||
| 371 | + <svg-icon | ||
| 372 | + class="el-icon-user-solid" | ||
| 373 | + icon-class="exl" | ||
| 374 | + style="font-size: 18px; color: #de002e" | ||
| 375 | + /> | ||
| 376 | + <Tooltip | ||
| 377 | + :content="formData.file ? formData.file.name : formData.certificare" | ||
| 378 | + :refName="formData.file ? formData.file.name : formData.certificare" | ||
| 379 | + /> | ||
| 380 | + </div> | ||
| 381 | + <div class="uploadbox-option"> | ||
| 382 | + <el-popconfirm | ||
| 383 | + :title="$t('entry.upload.delTip')" | ||
| 384 | + @confirm="delTypeDFile" | ||
| 385 | + > | ||
| 386 | + <el-button slot="reference" type="text">{{ | ||
| 387 | + $t("entry.upload.del") | ||
| 388 | + }} | ||
| 389 | + </el-button> | ||
| 390 | + </el-popconfirm> | ||
| 391 | + </div> | ||
| 392 | + </div> | ||
| 361 | </div> | 393 | </div> |
| 362 | </div> | 394 | </div> |
| 363 | - </div> | 395 | + </el-col> |
| 364 | - </div> | ||
| 365 | - </el-col> | ||
| 366 | 396 | ||
| 367 | - </el-row> | 397 | + </el-row> |
| 368 | - </div> | ||
| 369 | </el-form> | 398 | </el-form> |
| 370 | </div> | 399 | </div> |
| 371 | <div class="dialogOption entrySave"> | 400 | <div class="dialogOption entrySave"> |
| ... | @@ -373,13 +402,15 @@ | ... | @@ -373,13 +402,15 @@ |
| 373 | class="entrySaveButton" | 402 | class="entrySaveButton" |
| 374 | :disabled="loadings.submitLoading" | 403 | :disabled="loadings.submitLoading" |
| 375 | @click="submit" | 404 | @click="submit" |
| 376 | - >确 定</el-button | 405 | + >确 定 |
| 406 | + </el-button | ||
| 377 | > | 407 | > |
| 378 | <el-button | 408 | <el-button |
| 379 | class="entrySaveButton" | 409 | class="entrySaveButton" |
| 380 | :disabled="loadings.uploadLoading" | 410 | :disabled="loadings.uploadLoading" |
| 381 | @click="close" | 411 | @click="close" |
| 382 | - >关 闭</el-button | 412 | + >关 闭 |
| 413 | + </el-button | ||
| 383 | > | 414 | > |
| 384 | </div> | 415 | </div> |
| 385 | </el-dialog> | 416 | </el-dialog> |
| ... | @@ -394,6 +425,7 @@ import { | ... | @@ -394,6 +425,7 @@ import { |
| 394 | delCertificate, | 425 | delCertificate, |
| 395 | delQingdaoCertificate | 426 | delQingdaoCertificate |
| 396 | } from "@/api/system/customer-ai.js"; | 427 | } from "@/api/system/customer-ai.js"; |
| 428 | + | ||
| 397 | export default { | 429 | export default { |
| 398 | props: { | 430 | props: { |
| 399 | outerVisible: { | 431 | outerVisible: { |
| ... | @@ -412,6 +444,7 @@ export default { | ... | @@ -412,6 +444,7 @@ export default { |
| 412 | type: Object, | 444 | type: Object, |
| 413 | default: null, | 445 | default: null, |
| 414 | }, | 446 | }, |
| 447 | + portCodeList: [] | ||
| 415 | // dict: { | 448 | // dict: { |
| 416 | // type: Array, | 449 | // type: Array, |
| 417 | // default() { | 450 | // default() { |
| ... | @@ -421,28 +454,36 @@ export default { | ... | @@ -421,28 +454,36 @@ export default { |
| 421 | }, | 454 | }, |
| 422 | data() { | 455 | data() { |
| 423 | return { | 456 | return { |
| 457 | + //配置模板 | ||
| 458 | + portConfig: { | ||
| 459 | + PEK: { | ||
| 460 | + dxpId: '', | ||
| 461 | + }, | ||
| 462 | + TAO: { | ||
| 463 | + dxpId: '', | ||
| 464 | + userId: '', | ||
| 465 | + key: '', | ||
| 466 | + danyiDxpId: '', | ||
| 467 | + userName: '', | ||
| 468 | + password: '', | ||
| 469 | + certificateName: '', | ||
| 470 | + certificateBase64: '', | ||
| 471 | + methodOfSignature: '' | ||
| 472 | + } | ||
| 473 | + }, | ||
| 474 | + choosePortCode: [], | ||
| 424 | formData: { | 475 | formData: { |
| 476 | + config: {}, | ||
| 425 | id: null, | 477 | id: null, |
| 426 | - beijingDxpid: "", | ||
| 427 | certificare: "", | 478 | certificare: "", |
| 428 | - qingdaoCertificare: "", | ||
| 429 | clientId: "", | 479 | clientId: "", |
| 430 | ecomEntCode: "", | 480 | ecomEntCode: "", |
| 431 | ecomEntEmail: "", | 481 | ecomEntEmail: "", |
| 432 | ecomEntName: "", | 482 | ecomEntName: "", |
| 433 | orderRequester: "", | 483 | orderRequester: "", |
| 434 | - //methodOfSignature: this.getDefaultMethodOfSignature(), // 设置默认值 | ||
| 435 | certificateSerialNumber: "", | 484 | certificateSerialNumber: "", |
| 436 | certificateIndexNumber: "", | 485 | certificateIndexNumber: "", |
| 437 | - qingdaoKey: "", | ||
| 438 | - qingdaoUserDxpid: "", | ||
| 439 | - qingdaoDanyiUserDxpid:"", | ||
| 440 | - qingdaoUserId: "", | ||
| 441 | - qdCheck: false, | ||
| 442 | - bjCheck: false, | ||
| 443 | - checkboxState:"",//后端要求 北京 和青岛 用这种方式传 第一个是青岛 第二个是北京 | ||
| 444 | file: null, | 486 | file: null, |
| 445 | - qingdaoFile: null, | ||
| 446 | }, | 487 | }, |
| 447 | rules: { | 488 | rules: { |
| 448 | ecomEntCode: [ | 489 | ecomEntCode: [ |
| ... | @@ -463,7 +504,7 @@ export default { | ... | @@ -463,7 +504,7 @@ export default { |
| 463 | orderRequester: [ | 504 | orderRequester: [ |
| 464 | { | 505 | { |
| 465 | required: true, | 506 | required: true, |
| 466 | - trigger: "change", | 507 | + trigger: "blur", |
| 467 | message: "订单申报方不能为空!", | 508 | message: "订单申报方不能为空!", |
| 468 | }, | 509 | }, |
| 469 | ], | 510 | ], |
| ... | @@ -534,17 +575,23 @@ export default { | ... | @@ -534,17 +575,23 @@ export default { |
| 534 | if (this.type == "update") { | 575 | if (this.type == "update") { |
| 535 | this.formData = this.active; | 576 | this.formData = this.active; |
| 536 | // this.formData.file=null; | 577 | // this.formData.file=null; |
| 537 | - this.parseCheckboxState(this.active.checkboxState); | 578 | + // this.parseCheckboxState(this.active.checkboxState); |
| 538 | - }else{ | 579 | + } else { |
| 539 | - this.formData.orderRequester="1"; | 580 | + // this.formData.orderRequester = "1"; |
| 540 | } | 581 | } |
| 541 | } | 582 | } |
| 542 | - }, | 583 | + if (this.active?.config != null) { |
| 543 | - type(newVal) { | 584 | + this.choosePortCode = Object.keys(this.active.config) |
| 544 | - if (newVal === "add") { | 585 | + Object.keys(this.active.config).forEach(key => { |
| 545 | - this.setDefaultMethodOfSignature(); // 确保默认值被设置 | 586 | + this.portConfig[key] = this.active.config[key] |
| 587 | + }) | ||
| 546 | } | 588 | } |
| 547 | }, | 589 | }, |
| 590 | + // type(newVal) { | ||
| 591 | + // if (newVal === "add") { | ||
| 592 | + // this.setDefaultMethodOfSignature(); // 确保默认值被设置 | ||
| 593 | + // } | ||
| 594 | + // }, | ||
| 548 | }, | 595 | }, |
| 549 | // computed: { | 596 | // computed: { |
| 550 | // isCipherMachine() { | 597 | // isCipherMachine() { |
| ... | @@ -554,47 +601,47 @@ export default { | ... | @@ -554,47 +601,47 @@ export default { |
| 554 | 601 | ||
| 555 | created() { | 602 | created() { |
| 556 | // 确保字典数据已加载 | 603 | // 确保字典数据已加载 |
| 557 | - if (this.$store.getters.dict.METHOD_OF_SIGNATURE.length > 0) { | 604 | + // if (this.$store.getters.dict.METHOD_OF_SIGNATURE.length > 0) { |
| 558 | - this.setDefaultMethodOfSignature(); | 605 | + // this.setDefaultMethodOfSignature(); |
| 559 | - } else { | 606 | + // } else { |
| 560 | - // 监听字典数据变化 | 607 | + // // 监听字典数据变化 |
| 561 | - this.$store.watch( | 608 | + // this.$store.watch( |
| 562 | - (state) => state.dict.METHOD_OF_SIGNATURE, | 609 | + // (state) => state.dict.METHOD_OF_SIGNATURE, |
| 563 | - (newVal) => { | 610 | + // (newVal) => { |
| 564 | - if (newVal.length > 0) { | 611 | + // if (newVal.length > 0) { |
| 565 | - this.setDefaultMethodOfSignature(); | 612 | + // this.setDefaultMethodOfSignature(); |
| 566 | - } | 613 | + // } |
| 567 | - } | 614 | + // } |
| 568 | - ); | 615 | + // ); |
| 569 | - } | 616 | + // } |
| 570 | }, | 617 | }, |
| 571 | methods: { | 618 | methods: { |
| 572 | - getDefaultMethodOfSignature() { | 619 | + // getDefaultMethodOfSignature() { |
| 573 | - const methodOfSignatureDict = this.$store.getters.dict.METHOD_OF_SIGNATURE; | 620 | + // const methodOfSignatureDict = this.$store.getters.dict.METHOD_OF_SIGNATURE; |
| 574 | - if (methodOfSignatureDict.length > 0) { | 621 | + // if (methodOfSignatureDict.length > 0) { |
| 575 | - return methodOfSignatureDict[0].itemValue; | 622 | + // return methodOfSignatureDict[0].itemValue; |
| 576 | - } | 623 | + // } |
| 577 | - return ""; | 624 | + // return ""; |
| 578 | - }, | 625 | + // }, |
| 579 | - setDefaultMethodOfSignature() { | 626 | + // setDefaultMethodOfSignature() { |
| 580 | - this.formData.methodOfSignature = this.getDefaultMethodOfSignature(); | 627 | + // this.formData.methodOfSignature = this.getDefaultMethodOfSignature(); |
| 581 | - }, | 628 | + // }, |
| 582 | - changeQDCheckBox(){ | 629 | + // changeQDCheckBox() { |
| 583 | - this.$forceUpdate() | 630 | + // this.$forceUpdate() |
| 584 | - if(!this.formData.qdCheck){ | 631 | + // if (!this.formData.qdCheck) { |
| 585 | - this.formData.qingdaoDanyiUserDxpid=""; | 632 | + // this.formData.qingdaoDanyiUserDxpid = ""; |
| 586 | - this.formData.qingdaoKey=""; | 633 | + // this.formData.qingdaoKey = ""; |
| 587 | - this.formData.qingdaoUserDxpid=""; | 634 | + // this.formData.qingdaoUserDxpid = ""; |
| 588 | - this.formData.qingdaoUserId=""; | 635 | + // this.formData.qingdaoUserId = ""; |
| 589 | - } | 636 | + // } |
| 590 | - }, | 637 | + // }, |
| 591 | - changeBJCheckBox(){ | 638 | + // changeBJCheckBox() { |
| 592 | - this.$forceUpdate() | 639 | + // this.$forceUpdate() |
| 593 | - if(!this.formData.bjCheck){ | 640 | + // if (!this.formData.bjCheck) { |
| 594 | - this.formData.beijingDxpid=""; | 641 | + // this.formData.beijingDxpid = ""; |
| 595 | - this.formData.changeBJCheckBox=""; | 642 | + // this.formData.changeBJCheckBox = ""; |
| 596 | - } | 643 | + // } |
| 597 | - }, | 644 | + // }, |
| 598 | uploadFile() { | 645 | uploadFile() { |
| 599 | this.$refs.uploadFile.$refs["upload-inner"].handleClick(); | 646 | this.$refs.uploadFile.$refs["upload-inner"].handleClick(); |
| 600 | }, | 647 | }, |
| ... | @@ -602,60 +649,69 @@ export default { | ... | @@ -602,60 +649,69 @@ export default { |
| 602 | this.$refs.qingdaoUploadFile.$refs["upload-inner"].handleClick(); | 649 | this.$refs.qingdaoUploadFile.$refs["upload-inner"].handleClick(); |
| 603 | }, | 650 | }, |
| 604 | //文件校验 | 651 | //文件校验 |
| 605 | - beforeUpload(val) { | 652 | + // beforeUpload(val) { |
| 606 | - // if ( | 653 | + // // if ( |
| 607 | - // val.type != | 654 | + // // val.type != |
| 608 | - // "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | 655 | + // // "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" |
| 609 | - // ) { | 656 | + // // ) { |
| 610 | - // this.alertWarningMsg("请上传Excel文件!"); | 657 | + // // this.alertWarningMsg("请上传Excel文件!"); |
| 611 | - // return false; | 658 | + // // return false; |
| 612 | - // } else { | 659 | + // // } else { |
| 613 | - return true; | 660 | + // return true; |
| 614 | - // } | 661 | + // // } |
| 615 | - }, | 662 | + // }, |
| 616 | - qingdaoBeforeUpload(val) { | 663 | + // qingdaoBeforeUpload(val) { |
| 617 | - return true; | 664 | + // return true; |
| 618 | - }, | 665 | + // }, |
| 619 | - fileUpload({ file }) { | 666 | + fileUpload({file}) { |
| 620 | - | ||
| 621 | - const reader = new FileReader(); | ||
| 622 | - reader.readAsDataURL(file); | ||
| 623 | - reader.onload = (e) => { | ||
| 624 | - console.log(e); | ||
| 625 | - let obj = { | ||
| 626 | - file: e.target.result, | ||
| 627 | - name:file.name, | ||
| 628 | - }; | ||
| 629 | - this.formData.file = obj; | ||
| 630 | - }; | ||
| 631 | 667 | ||
| 632 | - }, | 668 | + const reader = new FileReader(); |
| 633 | - qingdaoFileUpload({ file }) { | 669 | + reader.readAsDataURL(file); |
| 634 | - | 670 | + reader.onload = (e) => { |
| 635 | - const reader = new FileReader(); | 671 | + console.log(e); |
| 636 | - reader.readAsDataURL(file); | 672 | + let obj = { |
| 637 | - reader.onload = (e) => { | 673 | + file: e.target.result, |
| 638 | - console.log(e); | 674 | + name: file.name, |
| 639 | - let obj = { | 675 | + }; |
| 640 | - file: e.target.result, | 676 | + this.formData.file = obj; |
| 641 | - name:file.name, | ||
| 642 | }; | 677 | }; |
| 643 | - this.formData.qingdaoFile = obj; | ||
| 644 | - }; | ||
| 645 | 678 | ||
| 646 | }, | 679 | }, |
| 647 | - fileChange(val) {}, | 680 | + qingdaoFileUpload({file}) { |
| 648 | - qingdaoFileChange(val) {}, | 681 | + |
| 649 | - handleSuccess() {}, | 682 | + const reader = new FileReader(); |
| 650 | - qingdaoHandleSuccess() {}, | 683 | + reader.readAsDataURL(file); |
| 651 | - clearFile() {}, | 684 | + console.log(file); |
| 652 | - clearqingdaoFile() {}, | 685 | + reader.onload = (e) => { |
| 653 | - handleRemove() { | 686 | + console.log(e); |
| 654 | - this.fileList = []; | 687 | + this.portConfig.TAO.certificateName = file.name |
| 655 | - }, | 688 | + this.portConfig.TAO.certificateBase64 = e.target.result |
| 656 | - qingdaoHandleRemove() { | 689 | + // let obj = { |
| 657 | - this.qingdaoFileList = []; | 690 | + // file: e.target.result, |
| 691 | + // name: file.name, | ||
| 692 | + // }; | ||
| 693 | + // this.formData.qingdaoFile = obj; | ||
| 694 | + }; | ||
| 695 | + | ||
| 658 | }, | 696 | }, |
| 697 | + // fileChange(val) { | ||
| 698 | + // }, | ||
| 699 | + // qingdaoFileChange(val) { | ||
| 700 | + // }, | ||
| 701 | + // handleSuccess() { | ||
| 702 | + // }, | ||
| 703 | + // qingdaoHandleSuccess() { | ||
| 704 | + // }, | ||
| 705 | + // clearFile() { | ||
| 706 | + // }, | ||
| 707 | + // clearqingdaoFile() { | ||
| 708 | + // }, | ||
| 709 | + // handleRemove() { | ||
| 710 | + // this.fileList = []; | ||
| 711 | + // }, | ||
| 712 | + // qingdaoHandleRemove() { | ||
| 713 | + // this.qingdaoFileList = []; | ||
| 714 | + // }, | ||
| 659 | //删除文件 | 715 | //删除文件 |
| 660 | delTypeDFile() { | 716 | delTypeDFile() { |
| 661 | this.delCertificate(); | 717 | this.delCertificate(); |
| ... | @@ -665,50 +721,52 @@ export default { | ... | @@ -665,50 +721,52 @@ export default { |
| 665 | }, | 721 | }, |
| 666 | 722 | ||
| 667 | //删除证书 | 723 | //删除证书 |
| 668 | - delCertificate(){ | 724 | + delCertificate() { |
| 669 | - if(this.formData.id && this.formData.certificare){ | 725 | + if (this.formData.id && this.formData.certificare) { |
| 670 | - delCertificate(this.formData.id,this.formData.certificare).then((res)=>{ | 726 | + delCertificate(this.formData.id, this.formData.certificare).then((res) => { |
| 671 | - if(res.code==200){ | 727 | + if (res.code == 200) { |
| 672 | - this.formData.file = null; | 728 | + this.formData.file = null; |
| 673 | - this.formData.certificare=""; | 729 | + this.formData.certificare = ""; |
| 674 | - // this.msgSuccess("证书删除成功!"); | 730 | + // this.msgSuccess("证书删除成功!"); |
| 675 | - }else{ | 731 | + } else { |
| 732 | + this.alertErrorMsg("证书删除失败,请联系管理员!"); | ||
| 733 | + } | ||
| 734 | + }).catch((err) => { | ||
| 735 | + console.log(err); | ||
| 676 | this.alertErrorMsg("证书删除失败,请联系管理员!"); | 736 | this.alertErrorMsg("证书删除失败,请联系管理员!"); |
| 677 | - } | 737 | + }) |
| 678 | - }).catch((err)=>{ | 738 | + } else { |
| 679 | - console.log(err); | ||
| 680 | - this.alertErrorMsg("证书删除失败,请联系管理员!"); | ||
| 681 | - }) | ||
| 682 | - }else{ | ||
| 683 | this.formData.file = null; | 739 | this.formData.file = null; |
| 684 | - this.formData.certificare=""; | 740 | + this.formData.certificare = ""; |
| 685 | } | 741 | } |
| 686 | }, | 742 | }, |
| 687 | 743 | ||
| 688 | //删除青岛证书 | 744 | //删除青岛证书 |
| 689 | - delQingdaoCertificate(){ | 745 | + delQingdaoCertificate() { |
| 690 | - if(this.formData.id && this.formData.qingdaoCertificatePath){ | 746 | + // if (this.formData.id && this.formData.qingdaoCertificatePath) { |
| 691 | - delQingdaoCertificate(this.formData.id,this.formData.qingdaoCertificatePath).then((res)=>{ | 747 | + // delQingdaoCertificate(this.formData.id, this.formData.qingdaoCertificatePath).then((res) => { |
| 692 | - if(res.code==200){ | 748 | + // if (res.code == 200) { |
| 693 | - this.formData.qingdaoFile = null; | 749 | + // this.formData.qingdaoFile = null; |
| 694 | - this.formData.qingdaoCertificatePath=""; | 750 | + // this.formData.qingdaoCertificatePath = ""; |
| 695 | - // this.msgSuccess("证书删除成功!"); | 751 | + // // this.msgSuccess("证书删除成功!"); |
| 696 | - }else{ | 752 | + // } else { |
| 697 | - this.alertErrorMsg("证书删除失败,请联系管理员!"); | 753 | + // this.alertErrorMsg("证书删除失败,请联系管理员!"); |
| 698 | - } | 754 | + // } |
| 699 | - }).catch((err)=>{ | 755 | + // }).catch((err) => { |
| 700 | - console.log(err); | 756 | + // console.log(err); |
| 701 | - this.alertErrorMsg("证书删除失败,请联系管理员!"); | 757 | + // this.alertErrorMsg("证书删除失败,请联系管理员!"); |
| 702 | - }) | 758 | + // }) |
| 703 | - }else{ | 759 | + // } else { |
| 704 | - this.formData.qingdaoFile = null; | 760 | + // this.formData.qingdaoFile = null; |
| 705 | - this.formData.qingdaoCertificatePath=""; | 761 | + // this.formData.qingdaoCertificatePath = ""; |
| 706 | - } | 762 | + // } |
| 763 | + this.portConfig.TAO.certificateBase64 = null; | ||
| 764 | + this.portConfig.TAO.certificateName = null; | ||
| 707 | }, | 765 | }, |
| 708 | //查询用户信息详情 | 766 | //查询用户信息详情 |
| 709 | searchUserData(id) { | 767 | searchUserData(id) { |
| 710 | this.loadings.dialogLoading = true; | 768 | this.loadings.dialogLoading = true; |
| 711 | - getUserDetailData({ id: id }) | 769 | + getUserDetailData({id: id}) |
| 712 | .then((res) => { | 770 | .then((res) => { |
| 713 | if (res.code === "200") { | 771 | if (res.code === "200") { |
| 714 | this.formData = res.data; | 772 | this.formData = res.data; |
| ... | @@ -724,91 +782,98 @@ export default { | ... | @@ -724,91 +782,98 @@ export default { |
| 724 | }, | 782 | }, |
| 725 | //数据保存 | 783 | //数据保存 |
| 726 | submit() { | 784 | submit() { |
| 727 | - this.loadings.dialogLoading = true; | 785 | + this.handlePortConfigJson() |
| 728 | - let obj = {}; | 786 | + this.loadings.dialogLoading = true; |
| 729 | - this.formData.checkboxState=this.checkboxState(); | 787 | + let obj = {}; |
| 730 | - if (this.type == "add") { | 788 | + // this.formData.checkboxState = this.checkboxState(); |
| 731 | - this.$refs.formData.validate((valid) => { | 789 | + if (this.type == "add") { |
| 732 | - if (valid) { | 790 | + this.$refs.formData.validate((valid) => { |
| 733 | - obj = this.formData; | 791 | + if (valid) { |
| 734 | - this.addApi(obj); | 792 | + obj = this.formData; |
| 735 | - } else { | 793 | + this.addApi(obj); |
| 736 | - this.loadings.dialogLoading = false; | 794 | + } else { |
| 737 | - } | 795 | + this.loadings.dialogLoading = false; |
| 738 | - }); | ||
| 739 | - } else if (this.type == "update") { | ||
| 740 | - this.$refs.formData.validate((valid) => { | ||
| 741 | - if (valid) { | ||
| 742 | - obj = this.formData; | ||
| 743 | - this.clearData(); //清除值 | ||
| 744 | - this.updateapi(obj); | ||
| 745 | - if(this.formData.orderRequester==1){ | ||
| 746 | - this.delCertificate(); //删除证书 | ||
| 747 | - } | ||
| 748 | - } else { | ||
| 749 | - this.loadings.dialogLoading = false; | ||
| 750 | - } | ||
| 751 | - }); | ||
| 752 | - } | ||
| 753 | - }, | ||
| 754 | - addApi(val) { | ||
| 755 | - addCustomerData(val) | ||
| 756 | - .then((res) => { | ||
| 757 | - if (res.code === "200") { | ||
| 758 | - if (this.formData.file) { | ||
| 759 | - this.uploadCertificate(val.ecomEntCode, this.base64ConvertFile(this.formData.file.file,this.formData.file.name)); | ||
| 760 | } | 796 | } |
| 761 | - if (this.formData.qingdaoFile) { | 797 | + }); |
| 762 | - this.uploadQingdaoCertificate(val.ecomEntCode, this.base64ConvertFile(this.formData.qingdaoFile.file,this.formData.qingdaoFile.name)); | 798 | + } else if (this.type == "update") { |
| 799 | + this.$refs.formData.validate((valid) => { | ||
| 800 | + if (valid) { | ||
| 801 | + obj = this.formData; | ||
| 802 | + this.clearData(); //清除值 | ||
| 803 | + this.updateapi(obj); | ||
| 804 | + if (this.formData.orderRequester == 1) { | ||
| 805 | + this.delCertificate(); //删除证书 | ||
| 806 | + } | ||
| 807 | + } else { | ||
| 808 | + this.loadings.dialogLoading = false; | ||
| 763 | } | 809 | } |
| 764 | - this.msgSuccess("客户添加成功!"); | 810 | + }); |
| 765 | - this.close(); | 811 | + } |
| 812 | + }, | ||
| 813 | + handlePortConfigJson() { | ||
| 814 | + this.formData.config = {} | ||
| 815 | + this.choosePortCode.forEach(portCode => { | ||
| 816 | + this.formData.config[portCode] = JSON.stringify(this.portConfig[portCode]) | ||
| 817 | + }) | ||
| 818 | + }, | ||
| 819 | + addApi(val) { | ||
| 820 | + addCustomerData(val) | ||
| 821 | + .then((res) => { | ||
| 822 | + if (res.code === "200") { | ||
| 823 | + if (this.formData.file) { | ||
| 824 | + this.uploadCertificate(val.ecomEntCode, this.base64ConvertFile(this.formData.file.file, this.formData.file.name)); | ||
| 825 | + } | ||
| 826 | + if (this.formData.qingdaoFile) { | ||
| 827 | + this.uploadQingdaoCertificate(val.ecomEntCode, this.base64ConvertFile(this.formData.qingdaoFile.file, this.formData.qingdaoFile.name)); | ||
| 828 | + } | ||
| 829 | + this.msgSuccess("客户添加成功!"); | ||
| 830 | + this.close(); | ||
| 766 | 831 | ||
| 767 | - } else { | 832 | + } else { |
| 768 | - this.alertWarningMsg(res.message); | 833 | + this.alertWarningMsg(res.message); |
| 834 | + this.loadings.dialogLoading = false; | ||
| 835 | + } | ||
| 836 | + }) | ||
| 837 | + .catch((err) => { | ||
| 838 | + console.log(err); | ||
| 769 | this.loadings.dialogLoading = false; | 839 | this.loadings.dialogLoading = false; |
| 770 | - } | 840 | + }); |
| 771 | - }) | 841 | + }, |
| 772 | - .catch((err) => { | 842 | + uploadCertificate(ecomEntCode, file) { |
| 773 | - console.log(err); | ||
| 774 | - this.loadings.dialogLoading = false; | ||
| 775 | - }); | ||
| 776 | - }, | ||
| 777 | - uploadCertificate(ecomEntCode, file) { | ||
| 778 | 843 | ||
| 779 | - uploadCertificate(ecomEntCode, file) | 844 | + uploadCertificate(ecomEntCode, file) |
| 780 | - .then((uploadRes) => { | 845 | + .then((uploadRes) => { |
| 781 | - if (uploadRes.code === "200") { | 846 | + if (uploadRes.code === "200") { |
| 782 | - // this.msgSuccess("客户添加和证书上传成功!"); | 847 | + // this.msgSuccess("客户添加和证书上传成功!"); |
| 783 | - this.close(); | 848 | + this.close(); |
| 784 | - } else { | 849 | + } else { |
| 785 | - this.alertWarningMsg(uploadRes.message); | 850 | + this.alertWarningMsg(uploadRes.message); |
| 786 | - } | 851 | + } |
| 787 | - this.loadings.dialogLoading = false; | 852 | + this.loadings.dialogLoading = false; |
| 788 | - }) | 853 | + }) |
| 789 | - .catch((err) => { | 854 | + .catch((err) => { |
| 790 | - console.log(err); | 855 | + console.log(err); |
| 791 | - this.loadings.dialogLoading = false; | 856 | + this.loadings.dialogLoading = false; |
| 792 | - }); | 857 | + }); |
| 793 | - }, | 858 | + }, |
| 794 | 859 | ||
| 795 | - uploadQingdaoCertificate(ecomEntCode, file) { | 860 | + uploadQingdaoCertificate(ecomEntCode, file) { |
| 796 | 861 | ||
| 797 | - uploadQingdaoCertificate(ecomEntCode, file) | 862 | + uploadQingdaoCertificate(ecomEntCode, file) |
| 798 | - .then((uploadRes) => { | 863 | + .then((uploadRes) => { |
| 799 | - if (uploadRes.code === "200") { | 864 | + if (uploadRes.code === "200") { |
| 800 | - // this.msgSuccess("客户添加和证书上传成功!"); | 865 | + // this.msgSuccess("客户添加和证书上传成功!"); |
| 801 | - this.close(); | 866 | + this.close(); |
| 802 | - } else { | 867 | + } else { |
| 803 | - this.alertWarningMsg(uploadRes.message); | 868 | + this.alertWarningMsg(uploadRes.message); |
| 804 | - } | 869 | + } |
| 805 | - this.loadings.dialogLoading = false; | 870 | + this.loadings.dialogLoading = false; |
| 806 | - }) | 871 | + }) |
| 807 | - .catch((err) => { | 872 | + .catch((err) => { |
| 808 | - console.log(err); | 873 | + console.log(err); |
| 809 | - this.loadings.dialogLoading = false; | 874 | + this.loadings.dialogLoading = false; |
| 810 | - }); | 875 | + }); |
| 811 | - }, | 876 | + }, |
| 812 | //修改 | 877 | //修改 |
| 813 | updateapi(val) { | 878 | updateapi(val) { |
| 814 | updateCustomerData(val) | 879 | updateCustomerData(val) |
| ... | @@ -817,10 +882,10 @@ export default { | ... | @@ -817,10 +882,10 @@ export default { |
| 817 | // this.msgSuccess(res.message); | 882 | // this.msgSuccess(res.message); |
| 818 | // this.close(); | 883 | // this.close(); |
| 819 | if (this.formData.file) { | 884 | if (this.formData.file) { |
| 820 | - this.uploadCertificate(val.ecomEntCode, this.base64ConvertFile(this.formData.file.file,this.formData.file.name)); | 885 | + this.uploadCertificate(val.ecomEntCode, this.base64ConvertFile(this.formData.file.file, this.formData.file.name)); |
| 821 | } | 886 | } |
| 822 | if (this.formData.qingdaoFile) { | 887 | if (this.formData.qingdaoFile) { |
| 823 | - this.uploadQingdaoCertificate(val.ecomEntCode, this.base64ConvertFile(this.formData.qingdaoFile.file,this.formData.qingdaoFile.name)); | 888 | + this.uploadQingdaoCertificate(val.ecomEntCode, this.base64ConvertFile(this.formData.qingdaoFile.file, this.formData.qingdaoFile.name)); |
| 824 | } | 889 | } |
| 825 | this.msgSuccess("客户修改成功!"); | 890 | this.msgSuccess("客户修改成功!"); |
| 826 | this.close(); | 891 | this.close(); |
| ... | @@ -836,56 +901,61 @@ export default { | ... | @@ -836,56 +901,61 @@ export default { |
| 836 | }); | 901 | }); |
| 837 | }, | 902 | }, |
| 838 | //后端要求的 | 903 | //后端要求的 |
| 839 | - checkboxState() { | 904 | + // checkboxState() { |
| 840 | - return `${this.formData.qdCheck},${this.formData.bjCheck}`; | 905 | + // return `${this.formData.qdCheck},${this.formData.bjCheck}`; |
| 841 | - }, | 906 | + // }, |
| 842 | //后端要求的 | 907 | //后端要求的 |
| 843 | - parseCheckboxState(checkboxStateString) { | 908 | + // parseCheckboxState(checkboxStateString) { |
| 844 | - if(checkboxStateString){ | 909 | + // if (checkboxStateString) { |
| 845 | - let checkboxStateArray = checkboxStateString.split(','); | 910 | + // let checkboxStateArray = checkboxStateString.split(','); |
| 846 | - let checkboxStateBooleans = checkboxStateArray.map(value => value === 'true'); | 911 | + // let checkboxStateBooleans = checkboxStateArray.map(value => value === 'true'); |
| 847 | - this.formData.qdCheck=checkboxStateBooleans[0]; | 912 | + // this.formData.qdCheck = checkboxStateBooleans[0]; |
| 848 | - this.formData.bjCheck=checkboxStateBooleans[1]; | 913 | + // this.formData.bjCheck = checkboxStateBooleans[1]; |
| 849 | - } | 914 | + // } |
| 850 | - | 915 | + // |
| 851 | - }, | 916 | + // }, |
| 852 | close() { | 917 | close() { |
| 853 | this.formData = { | 918 | this.formData = { |
| 854 | id: null, | 919 | id: null, |
| 855 | - beijingDxpid: "", | ||
| 856 | certificare: "", | 920 | certificare: "", |
| 857 | clientId: "", | 921 | clientId: "", |
| 858 | ecomEntCode: "", | 922 | ecomEntCode: "", |
| 859 | ecomEntEmail: "", | 923 | ecomEntEmail: "", |
| 860 | ecomEntName: "", | 924 | ecomEntName: "", |
| 861 | orderRequester: "", | 925 | orderRequester: "", |
| 862 | - //methodOfSignature: this.getDefaultMethodOfSignature(), // 重置默认值 | ||
| 863 | certificateSerialNumber: "", | 926 | certificateSerialNumber: "", |
| 864 | certificateIndexNumber: "", | 927 | certificateIndexNumber: "", |
| 865 | - qingdaoKey: "", | ||
| 866 | - qingdaoUserDxpid: "", | ||
| 867 | - qingdaoDanyiUserDxpid:"", | ||
| 868 | - qingdaoUserId: "", | ||
| 869 | - qdCheck: false, | ||
| 870 | - bjCheck: false, | ||
| 871 | file: null, | 928 | file: null, |
| 872 | }; | 929 | }; |
| 873 | - this.handleRemove(); | 930 | + this.choosePortCode = [] |
| 931 | + this.clearPortConfig(this.portConfig) | ||
| 932 | + // this.handleRemove(); | ||
| 874 | this.$emit("close"); | 933 | this.$emit("close"); |
| 875 | }, | 934 | }, |
| 876 | - clearData(){ | 935 | + clearPortConfig(obj) { |
| 877 | - if(this.formData.orderRequester==1){ | 936 | + for (let key in obj) { |
| 878 | - this.formData.beijingDxpid=""; | 937 | + if (obj.hasOwnProperty(key)) { |
| 879 | - this.formData.bjCheck=""; | 938 | + if (typeof obj[key] === 'object' && obj[key] !== null) { |
| 880 | - this.formData.checkboxState=""; | 939 | + this.clearPortConfig(obj[key]); // 递归处理嵌套对象 |
| 881 | - this.formData.qingdaoKey=""; | 940 | + } else { |
| 882 | - this.formData.qingdaoUserDxpid=""; | 941 | + obj[key] = ''; // 设置为一个空字符串 |
| 883 | - this.formData.qingdaoDanyiUserDxpid=""; | 942 | + } |
| 884 | - this.formData.qingdaoUserId=""; | 943 | + } |
| 885 | - this.formData.qdCheck=""; | ||
| 886 | - this.formData.file=null; | ||
| 887 | - // this.delCertificate(); //删除证书 | ||
| 888 | } | 944 | } |
| 945 | + }, | ||
| 946 | + clearData() { | ||
| 947 | + // if (this.formData.orderRequester == 1) { | ||
| 948 | + // this.formData.beijingDxpid = ""; | ||
| 949 | + // this.formData.bjCheck = ""; | ||
| 950 | + // this.formData.checkboxState = ""; | ||
| 951 | + // this.formData.qingdaoKey = ""; | ||
| 952 | + // this.formData.qingdaoUserDxpid = ""; | ||
| 953 | + // this.formData.qingdaoDanyiUserDxpid = ""; | ||
| 954 | + // // this.formData.qingdaoUserId=""; | ||
| 955 | + // this.formData.qdCheck = ""; | ||
| 956 | + // this.formData.file = null; | ||
| 957 | + // // this.delCertificate(); //删除证书 | ||
| 958 | + // } | ||
| 889 | } | 959 | } |
| 890 | }, | 960 | }, |
| 891 | }; | 961 | }; |
| ... | @@ -893,6 +963,7 @@ export default { | ... | @@ -893,6 +963,7 @@ export default { |
| 893 | 963 | ||
| 894 | <style lang="scss" scoped> | 964 | <style lang="scss" scoped> |
| 895 | @import "@/assets/styles/variables.scss"; | 965 | @import "@/assets/styles/variables.scss"; |
| 966 | + | ||
| 896 | .uploadItem { | 967 | .uploadItem { |
| 897 | margin-bottom: 5px; | 968 | margin-bottom: 5px; |
| 898 | 969 | ||
| ... | @@ -960,18 +1031,21 @@ export default { | ... | @@ -960,18 +1031,21 @@ export default { |
| 960 | font-size: 14px; | 1031 | font-size: 14px; |
| 961 | color: #333 !important; | 1032 | color: #333 !important; |
| 962 | margin: 5px; | 1033 | margin: 5px; |
| 1034 | + | ||
| 963 | .el-checkbox { | 1035 | .el-checkbox { |
| 964 | display: inline-block; | 1036 | display: inline-block; |
| 965 | margin-right: 10px; | 1037 | margin-right: 10px; |
| 966 | } | 1038 | } |
| 967 | } | 1039 | } |
| 968 | -.dlTitle{ | 1040 | + |
| 1041 | +.dlTitle { | ||
| 969 | border-bottom: 2px solid #000000; | 1042 | border-bottom: 2px solid #000000; |
| 970 | - color:#000000; | 1043 | + color: #000000; |
| 971 | margin-bottom: 12px; | 1044 | margin-bottom: 12px; |
| 972 | - h3{ | 1045 | + |
| 973 | - margin-bottom: 8px; | 1046 | + h3 { |
| 974 | - font-weight: 500; | 1047 | + margin-bottom: 8px; |
| 1048 | + font-weight: 500; | ||
| 975 | } | 1049 | } |
| 976 | } | 1050 | } |
| 977 | </style> | 1051 | </style> | ... | ... |
| ... | @@ -156,6 +156,7 @@ | ... | @@ -156,6 +156,7 @@ |
| 156 | :title="dialogTitle" | 156 | :title="dialogTitle" |
| 157 | :type="editType" | 157 | :type="editType" |
| 158 | :active="activeData" | 158 | :active="activeData" |
| 159 | + :portCodeList="dict.port" | ||
| 159 | @close="dialogClose" | 160 | @close="dialogClose" |
| 160 | /> | 161 | /> |
| 161 | </div> | 162 | </div> |
| ... | @@ -248,6 +249,9 @@ export default { | ... | @@ -248,6 +249,9 @@ export default { |
| 248 | align: "left", | 249 | align: "left", |
| 249 | }, | 250 | }, |
| 250 | ], | 251 | ], |
| 252 | + dict:{ | ||
| 253 | + port:[] | ||
| 254 | + }, | ||
| 251 | // dict: { | 255 | // dict: { |
| 252 | // orderRequester: [ | 256 | // orderRequester: [ |
| 253 | // { name: "企业", code: "ENTERPRISE_DECLARATION", value: "1" }, | 257 | // { name: "企业", code: "ENTERPRISE_DECLARATION", value: "1" }, | ... | ... |
-
Please register or login to post a comment