Showing
9 changed files
with
56 additions
and
7 deletions
| ... | @@ -130,6 +130,31 @@ export function downloadCertificate(id,filename) { | ... | @@ -130,6 +130,31 @@ export function downloadCertificate(id,filename) { |
| 130 | }); | 130 | }); |
| 131 | }); | 131 | }); |
| 132 | } | 132 | } |
| 133 | +//下载青岛证书 | ||
| 134 | +export function downloadQingdaoCertificate(id,filename) { | ||
| 135 | + return new Promise((resolve, reject) => { | ||
| 136 | + var url = baseUrl + '/bus-customer/customers/getQingDaoCertificate/'+id; | ||
| 137 | + request({ | ||
| 138 | + url: url, | ||
| 139 | + method: 'get', | ||
| 140 | + responseType: 'blob', // 确保响应类型为 blob | ||
| 141 | + params: id, | ||
| 142 | + }) | ||
| 143 | + .then((res) => { | ||
| 144 | + const aLink = document.createElement("a"); | ||
| 145 | + aLink.href = URL.createObjectURL(res); | ||
| 146 | + aLink.setAttribute("download", filename); // 设置下载文件名称 | ||
| 147 | + document.body.appendChild(aLink); | ||
| 148 | + aLink.click(); | ||
| 149 | + document.body.removeChild(aLink); | ||
| 150 | + resolve(res); | ||
| 151 | + | ||
| 152 | + }) | ||
| 153 | + .catch((err) => { | ||
| 154 | + reject(err); | ||
| 155 | + }); | ||
| 156 | + }); | ||
| 157 | +} | ||
| 133 | 158 | ||
| 134 | // 修改客户数据 | 159 | // 修改客户数据 |
| 135 | /** | 160 | /** | ... | ... |
| ... | @@ -144,9 +144,8 @@ | ... | @@ -144,9 +144,8 @@ |
| 144 | <template slot="optionColumn"> | 144 | <template slot="optionColumn"> |
| 145 | <el-table-column align="left" label="操作" width="150"> | 145 | <el-table-column align="left" label="操作" width="150"> |
| 146 | <template slot-scope="scope"> | 146 | <template slot-scope="scope"> |
| 147 | - <el-button type="text" @click="downloadFile(scope.row)" :disabled="!scope.row.certificare"> | 147 | + <el-button type="text" @click="downloadFile(scope.row)" :disabled="!scope.row.certificare">下载证书</el-button> |
| 148 | - 下载证书 | 148 | + <!-- <el-button type="text" @click="downloadQingdaoFile(scope.row)" :disabled="!scope.row.certificare">下载青岛证书</el-button> --> |
| 149 | - </el-button> | ||
| 150 | <el-button type="text" @click="update(scope.row)"> 修改 </el-button> | 149 | <el-button type="text" @click="update(scope.row)"> 修改 </el-button> |
| 151 | </template> | 150 | </template> |
| 152 | </el-table-column> | 151 | </el-table-column> |
| ... | @@ -163,7 +162,7 @@ | ... | @@ -163,7 +162,7 @@ |
| 163 | </template> | 162 | </template> |
| 164 | 163 | ||
| 165 | <script> | 164 | <script> |
| 166 | -import { getCustomerList,downloadCertificate } from "@/api/system/customer-ai.js"; | 165 | +import { getCustomerList,downloadCertificate, downloadQingdaoCertificate } from "@/api/system/customer-ai.js"; |
| 167 | import { getPortList } from "@/api/system/user.js"; | 166 | import { getPortList } from "@/api/system/user.js"; |
| 168 | import DialogVue from "./dialog.vue"; | 167 | import DialogVue from "./dialog.vue"; |
| 169 | export default { | 168 | export default { |
| ... | @@ -323,6 +322,15 @@ export default { | ... | @@ -323,6 +322,15 @@ export default { |
| 323 | this.alertErrorMsg("证书下载失败,请联系管理员!"); | 322 | this.alertErrorMsg("证书下载失败,请联系管理员!"); |
| 324 | }) | 323 | }) |
| 325 | }, | 324 | }, |
| 325 | + //下载青岛证书 | ||
| 326 | + downloadQingdaoFile(val) { | ||
| 327 | + downloadQingdaoCertificate(val.id,val.certificare).then((res)=>{ | ||
| 328 | + | ||
| 329 | + }).catch((err)=>{ | ||
| 330 | + console.log(err); | ||
| 331 | + this.alertErrorMsg("证书下载失败,请联系管理员!"); | ||
| 332 | + }) | ||
| 333 | + }, | ||
| 326 | addCustomer() { | 334 | addCustomer() { |
| 327 | this.dialogTitle = "新增客户"; | 335 | this.dialogTitle = "新增客户"; |
| 328 | this.editType = "add"; | 336 | this.editType = "add"; | ... | ... |
| ... | @@ -416,7 +416,7 @@ | ... | @@ -416,7 +416,7 @@ |
| 416 | v-for="(item, index) in $store.getters.dict.PACKAGE_TYPE_CODE" | 416 | v-for="(item, index) in $store.getters.dict.PACKAGE_TYPE_CODE" |
| 417 | :key="index" | 417 | :key="index" |
| 418 | :label="item.itemChineseName" | 418 | :label="item.itemChineseName" |
| 419 | - :value="item.itemValue" | 419 | + :value="item.itemCode" |
| 420 | ></el-option> | 420 | ></el-option> |
| 421 | </el-select> | 421 | </el-select> |
| 422 | </Formitem> | 422 | </Formitem> |
| ... | @@ -799,10 +799,20 @@ | ... | @@ -799,10 +799,20 @@ |
| 799 | }, | 799 | }, |
| 800 | methods: { | 800 | methods: { |
| 801 | mapDicDatas(dicArr, code){ | 801 | mapDicDatas(dicArr, code){ |
| 802 | - return dicArr.filter(item => item.itemCode == code)[0].itemChineseName | 802 | + if (code != "") { |
| 803 | + return dicArr.filter(item => item.itemCode == code)[0].itemChineseName | ||
| 804 | + } else { | ||
| 805 | + return '' | ||
| 806 | + } | ||
| 807 | + | ||
| 803 | }, | 808 | }, |
| 804 | mapCurrencyDatas(dicArr, code){ | 809 | mapCurrencyDatas(dicArr, code){ |
| 805 | - return dicArr.filter(item => item.itemValue == code)[0].itemChineseName | 810 | + if (code != "") { |
| 811 | + return dicArr.filter(item => item.itemValue == code)[0].itemChineseName | ||
| 812 | + } else { | ||
| 813 | + return '' | ||
| 814 | + } | ||
| 815 | + | ||
| 806 | }, | 816 | }, |
| 807 | //获取客户下拉列表数据 | 817 | //获取客户下拉列表数据 |
| 808 | queryCustomerList(){ | 818 | queryCustomerList(){ | ... | ... |
| ... | @@ -349,6 +349,7 @@ export default { | ... | @@ -349,6 +349,7 @@ export default { |
| 349 | }) | 349 | }) |
| 350 | .finally(() => { | 350 | .finally(() => { |
| 351 | this.$nextTick(() => { | 351 | this.$nextTick(() => { |
| 352 | + this.$store.dispatch('setLoadingState', false) | ||
| 352 | this.$refs.returnStatusPopover.tableLoading = false; | 353 | this.$refs.returnStatusPopover.tableLoading = false; |
| 353 | }); | 354 | }); |
| 354 | }); | 355 | }); | ... | ... |
| ... | @@ -415,6 +415,7 @@ export default { | ... | @@ -415,6 +415,7 @@ export default { |
| 415 | }) | 415 | }) |
| 416 | .finally(() => { | 416 | .finally(() => { |
| 417 | this.$nextTick(() => { | 417 | this.$nextTick(() => { |
| 418 | + this.$store.dispatch('setLoadingState', false) | ||
| 418 | this.$refs.returnStatusPopover.tableLoading = false; | 419 | this.$refs.returnStatusPopover.tableLoading = false; |
| 419 | }); | 420 | }); |
| 420 | }); | 421 | }); | ... | ... |
| ... | @@ -322,6 +322,7 @@ export default { | ... | @@ -322,6 +322,7 @@ export default { |
| 322 | }) | 322 | }) |
| 323 | .finally(() => { | 323 | .finally(() => { |
| 324 | this.$nextTick(() => { | 324 | this.$nextTick(() => { |
| 325 | + this.$store.dispatch('setLoadingState', false) | ||
| 325 | this.$refs.returnStatusPopover.tableLoading = false; | 326 | this.$refs.returnStatusPopover.tableLoading = false; |
| 326 | }); | 327 | }); |
| 327 | }); | 328 | }); | ... | ... |
| ... | @@ -337,6 +337,7 @@ export default { | ... | @@ -337,6 +337,7 @@ export default { |
| 337 | }) | 337 | }) |
| 338 | .finally(() => { | 338 | .finally(() => { |
| 339 | this.$nextTick(() => { | 339 | this.$nextTick(() => { |
| 340 | + this.$store.dispatch('setLoadingState', false) | ||
| 340 | this.$refs.returnStatusPopover.tableLoading = false; | 341 | this.$refs.returnStatusPopover.tableLoading = false; |
| 341 | }); | 342 | }); |
| 342 | }); | 343 | }); | ... | ... |
| ... | @@ -331,6 +331,7 @@ export default { | ... | @@ -331,6 +331,7 @@ export default { |
| 331 | }) | 331 | }) |
| 332 | .finally(() => { | 332 | .finally(() => { |
| 333 | this.$nextTick(() => { | 333 | this.$nextTick(() => { |
| 334 | + this.$store.dispatch('setLoadingState', false) | ||
| 334 | this.$refs.returnStatusPopover.tableLoading = false; | 335 | this.$refs.returnStatusPopover.tableLoading = false; |
| 335 | }); | 336 | }); |
| 336 | }); | 337 | }); | ... | ... |
| ... | @@ -362,6 +362,7 @@ export default { | ... | @@ -362,6 +362,7 @@ export default { |
| 362 | }) | 362 | }) |
| 363 | .finally(() => { | 363 | .finally(() => { |
| 364 | this.$nextTick(() => { | 364 | this.$nextTick(() => { |
| 365 | + this.$store.dispatch('setLoadingState', false) | ||
| 365 | this.$refs.returnStatusPopover.tableLoading = false; | 366 | this.$refs.returnStatusPopover.tableLoading = false; |
| 366 | }); | 367 | }); |
| 367 | }); | 368 | }); | ... | ... |
-
Please register or login to post a comment