doctor-admin-components 1.0.11 → 1.0.12-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,247 @@
1
+ <template>
2
+ <div class="upload-file">
3
+ <el-upload
4
+ action=""
5
+ :before-upload="handleBeforeUpload"
6
+ :file-list="fileList"
7
+ :limit="limit"
8
+ :on-exceed="handleExceed"
9
+ :show-file-list="false"
10
+ drag
11
+ class="upload-file-uploader"
12
+ ref="upload"
13
+ multiple
14
+ >
15
+ <!-- 上传按钮 -->
16
+ <i class="el-icon-upload"></i>
17
+ <!-- <div class="el-upload__text">将文件拖到此处</div> -->
18
+ <!-- 上传提示 -->
19
+ <div class="el-upload__tip" slot="tip" v-if="showTip">
20
+ 请上传
21
+ <template v-if="fileSize">
22
+ 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
23
+ </template>
24
+ <template v-if="fileType">
25
+ 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b>
26
+ </template>
27
+ 的文件
28
+ </div>
29
+ </el-upload>
30
+ </div>
31
+ </template>
32
+
33
+ <script>
34
+ import request from "../../utils/request";
35
+ import OSS from "ali-oss";
36
+ import { v2Upload } from "../../api/biz/file";
37
+ export default {
38
+ name: "ApkUpload",
39
+ props: {
40
+ // 值
41
+ value: [String, Object, Array],
42
+ // 数量限制
43
+ limit: {
44
+ type: Number,
45
+ default: 999,
46
+ },
47
+ // 大小限制(MB)
48
+ fileSize: {
49
+ type: Number,
50
+ default: 200,
51
+ },
52
+ fileType: {
53
+ type: Array,
54
+ default: () => [
55
+ "doc",
56
+ "xls",
57
+ "ppt",
58
+ "txt",
59
+ "pdf",
60
+ "png",
61
+ "jpg",
62
+ "JPG",
63
+ "bmp",
64
+ ],
65
+ },
66
+ // 是否显示提示
67
+ isShowTip: {
68
+ type: Boolean,
69
+ default: true,
70
+ },
71
+ buttonText: {
72
+ type: String,
73
+ default: "选取文件",
74
+ },
75
+ drag: {
76
+ type: Boolean,
77
+ default: false,
78
+ },
79
+ },
80
+ data() {
81
+ return {
82
+ fileList: [],
83
+ cdnDomain: "https://hzcdn.doctorscrap.com/",
84
+ stsUrl: "/upload/aliyun/sts",
85
+ client: undefined,
86
+ file: null,
87
+ tempCheckpoint: null, // 用来缓存当前切片内容
88
+ uploadId: "",
89
+ uploadStatus: null, // 进度条上传状态
90
+ percentage: 0, // 进度条百分比
91
+ uploadName: "", //Object所在Bucket的完整路径
92
+ };
93
+ },
94
+ created() {
95
+ // this.getToken();
96
+ },
97
+ watch: {
98
+ value: {
99
+ handler(val) {
100
+ if (val) {
101
+ let temp = 1;
102
+ // 首先将值转为数组
103
+ const list = Array.isArray(val) ? val : this.value.split(",");
104
+ // 然后将数组转为对象数组
105
+ this.fileList = list.map((item) => {
106
+ if (typeof item === "string") {
107
+ item = { name: item, url: item };
108
+ }
109
+ item.uid = item.uid || new Date().getTime() + temp++;
110
+ return item;
111
+ });
112
+ } else {
113
+ this.fileList = [];
114
+ return [];
115
+ }
116
+ },
117
+ deep: true,
118
+ immediate: true,
119
+ },
120
+ },
121
+ computed: {
122
+ // 是否显示提示
123
+ showTip() {
124
+ return this.isShowTip && (this.fileType || this.fileSize);
125
+ },
126
+ },
127
+ methods: {
128
+ async getToken() {
129
+ //获取临时凭证
130
+ await request(this.stsUrl).then((res) => {
131
+ let data = res.data;
132
+ this.client = new OSS({
133
+ // yourRegion填写Bucket所在地域。以华东1(杭州)为例,Region填写为oss-cn-hangzhou。
134
+ region: "oss-cn-hangzhou",
135
+ // 从STS服务获取的临时访问密钥(AccessKey ID和AccessKey Secret)。
136
+ accessKeyId: data.accessKeyId,
137
+ accessKeySecret: data.accessKeySecret,
138
+ // 从STS服务获取的安全令牌(SecurityToken)。
139
+ stsToken: data.securityToken,
140
+ // 填写Bucket名称,例如examplebucket。
141
+ bucket: "hztyzl",
142
+ // 刷新临时访问凭证。
143
+ refreshSTSToken: async () => {
144
+ const refreshToken = await request.get(this.stsUrl);
145
+ return {
146
+ accessKeyId: refreshToken.AccessKeyId,
147
+ accessKeySecret: refreshToken.AccessKeySecret,
148
+ stsToken: refreshToken.SecurityToken,
149
+ };
150
+ },
151
+ });
152
+ });
153
+ },
154
+
155
+ setFileList(list) {
156
+ this.fileList = list;
157
+ },
158
+ // 上传前校检格式和大小
159
+ handleBeforeUpload(file) {
160
+ // 校检文件大小
161
+ if (this.fileSize) {
162
+ const isLt = file.size / 1024 / 1024 < this.fileSize;
163
+ if (!isLt) {
164
+ this.$message.error(`上传文件大小不能超过 ${this.fileSize} MB!`);
165
+ return false;
166
+ }
167
+ }
168
+ this.loading = this.$loading({
169
+ lock: true,
170
+ text: "上传中",
171
+ background: "rgba(0, 0, 0, 0.7)",
172
+ });
173
+ //走阿里云前端直接上传
174
+ this.uploadAliOss(file);
175
+ return false;
176
+ },
177
+ // 文件个数超出
178
+ handleExceed() {
179
+ this.$message.error(`上传文件数量不能超过 ${this.limit} 个!`);
180
+ },
181
+ // 上传失败
182
+ handleUploadError(err) {
183
+ this.$message.error("上传失败, 请重试");
184
+ },
185
+ uploadAliOss(file) {
186
+ this.file = file;
187
+ this.putObject();
188
+ this.loading.close();
189
+ // this.multipartUpload();
190
+ },
191
+ //普通上传
192
+ async putObject() {
193
+ if (!this.file) {
194
+ this.$message.error("请选择文件");
195
+ return;
196
+ }
197
+ try {
198
+ const formData = new FormData();
199
+ formData.append("file", this.file);
200
+ const result = await v2Upload(formData);
201
+ this.$message.success("上传成功");
202
+ let url = result.data.url;
203
+ result.url = url;
204
+ result.originFileName = this.file.name;
205
+ this.$emit("upload", result);
206
+ } catch (e) {
207
+ console.log(e);
208
+ }
209
+ },
210
+ },
211
+ };
212
+ </script>
213
+
214
+ <style scoped lang="scss">
215
+ ::v-deep .el-upload-dragger {
216
+ width: 140px;
217
+ height: 80px;
218
+ }
219
+ .upload-file {
220
+ width: 140px;
221
+ display: flex;
222
+ }
223
+ .upload-file-uploader {
224
+ margin-bottom: 5px;
225
+ }
226
+ .upload-file-list .el-upload-list__item {
227
+ border: 1px solid #e4e7ed;
228
+ line-height: 2;
229
+ margin-bottom: 10px;
230
+ position: relative;
231
+ }
232
+ .upload-file-list .ele-upload-list__item-content {
233
+ display: flex;
234
+ justify-content: space-between;
235
+ align-items: center;
236
+ color: inherit;
237
+ }
238
+ .ele-upload-list__item-content-action .el-link {
239
+ margin-right: 10px;
240
+ }
241
+ .el-upload-dragger .el-icon-upload {
242
+ font-size: 67px;
243
+ color: #c0c4cc;
244
+ margin: 16px 0 16px;
245
+ line-height: 50px;
246
+ }
247
+ </style>
@@ -8,25 +8,28 @@
8
8
  */
9
9
  /* eslint-disable import/prefer-default-export */
10
10
 
11
-
12
11
  // export { default as ZpwComTestSample } from './lib-components/zpw-com-test-sample.vue';
13
12
  // export { default as ZpwButton } from './lib-components/zpw-button.vue';
14
13
  // export { default as ContractTracingDetail } from './views/biz/contractTracing/contractTracingDetail.vue';
15
14
  // // export { default as Test } from './views/test.vue111111111111';
16
15
 
17
- import ContractTracingDetail from './views/biz/contractTracing/contractTracingDetail.vue'
18
- import Claim from './views/biz/claim/Claim.vue'
16
+ import ContractTracingDetail from "./views/biz/contractTracing/contractTracingDetail.vue";
17
+ import Claim from "./views/biz/claim/Claim.vue";
18
+ import PurchaseInvoiceUpload from "./views/biz/contractTracing/purchaseInvoiceUpload.vue";
19
19
 
20
20
  // 为组件提供 install 安装方法,供按需引入
21
21
 
22
22
  ContractTracingDetail.install = function (Vue) {
23
- Vue.component(ContractTracingDetail.name, ContractTracingDetail)
24
- }
23
+ Vue.component(ContractTracingDetail.name, ContractTracingDetail);
24
+ };
25
25
 
26
26
  Claim.install = function (Vue) {
27
- Vue.component(Claim.name, Claim)
28
- }
27
+ Vue.component(Claim.name, Claim);
28
+ };
29
29
 
30
- // 导出组件
31
- export {ContractTracingDetail, Claim}
30
+ PurchaseInvoiceUpload.install = function (Vue) {
31
+ Vue.component(PurchaseInvoiceUpload.name, PurchaseInvoiceUpload);
32
+ };
32
33
 
34
+ // 导出组件
35
+ export { ContractTracingDetail, Claim, PurchaseInvoiceUpload };
@@ -15,7 +15,7 @@ axios.defaults.headers["Content-Type"] = "application/json;charset=utf-8";
15
15
  // 创建axios实例
16
16
  const service = axios.create({
17
17
  // axios中请求配置有baseURL选项,表示请求URL公共部分
18
- baseURL: '/prod-admin',
18
+ baseURL: "/prod-admin",
19
19
  // 超时
20
20
  timeout: 60000,
21
21
  });
@@ -87,7 +87,6 @@ service.interceptors.request.use(
87
87
  // if (config.url.includes('/system/dict/data/type/')) {
88
88
  // config.url = '/prod-api' + config.url
89
89
  // }
90
- console.log('==config.url==', config.url);
91
90
  return config;
92
91
  },
93
92
  (error) => {
@@ -19,7 +19,7 @@
19
19
  {{
20
20
  contract.contractType == "sale"
21
21
  ? $t("contractDetail.saleContract")
22
- : "$t('contractDetail.purchaseContract')"
22
+ : $t("contractDetail.purchaseContract")
23
23
  }}
24
24
  <el-button
25
25
  v-if="channel !== 'official-website'"
@@ -81,20 +81,16 @@
81
81
  ></el-col>
82
82
  </el-row>
83
83
  <el-divider></el-divider>
84
- <div
85
- v-if="channel !== 'official-website'"
86
- class="sub-title">
87
- {{
88
- contract.contractType == "sale"
89
- ? $t("contractDetail.signSaleContract")
90
- : $t("contractDetail.signPuchaseContract")
91
- }}
92
- </div>
93
- <div v-esle class="sub-title">
84
+ <div v-if="channel !== 'official-website'" class="sub-title">
94
85
  {{
95
- $t("contractDetail.signSaleContract")
86
+ contract.contractType == "sale"
87
+ ? $t("contractDetail.signSaleContract")
88
+ : $t("contractDetail.signPuchaseContract")
96
89
  }}
97
90
  </div>
91
+ <div v-else class="sub-title">
92
+ {{ $t("contractDetail.signSaleContract") }}
93
+ </div>
98
94
  <div class="file-list">
99
95
  <file-show
100
96
  @refresh="handleRefresh"
@@ -148,13 +144,27 @@
148
144
  "
149
145
  class="el-icon-success customer-icon-success-color"
150
146
  >
151
- {{channel !== 'official-website' ? '定金已收' : $t('contractDetail.Deposit_Paid')}}
147
+ {{
148
+ channel !== "official-website"
149
+ ? "定金已收"
150
+ : $t("contractDetail.Deposit_Paid")
151
+ }}
152
+ </div>
153
+ <div v-else style="color: red">
154
+ {{
155
+ channel !== "official-website"
156
+ ? "定金未收"
157
+ : $t("contractDetail.Deposit_Unpaid")
158
+ }}
152
159
  </div>
153
- <div v-else style="color: red">{{channel !== 'official-website' ? '定金未收' : $t('contractDetail.Deposit_Unpaid')}}</div>
154
160
  </el-col>
155
161
  </el-row>
156
162
  <el-row v-else>
157
- <el-col :span="2"><div style="color: #1890ff">{{$t('contractDetail.Deposit')}}</div> </el-col>
163
+ <el-col :span="2"
164
+ ><div style="color: #1890ff">
165
+ {{ $t("contractDetail.Deposit") }}
166
+ </div>
167
+ </el-col>
158
168
  <el-col :span="2">
159
169
  <div
160
170
  v-if="
@@ -248,7 +258,9 @@
248
258
  type="primary"
249
259
  size="mini"
250
260
  @click="handleGenerate"
251
- v-if="channel !== 'official-website' && contract.contractType == 'sale'"
261
+ v-if="
262
+ channel !== 'official-website' && contract.contractType == 'sale'
263
+ "
252
264
  >生成船运</el-button
253
265
  >
254
266
  <el-tabs v-model="activeName">
@@ -266,7 +278,12 @@
266
278
  :type="shipmentFileInfo ? 'primary' : ''"
267
279
  size="large"
268
280
  >
269
- <div v-if="channel !== 'official-website'" style="color: #1890ff">首批货运</div>
281
+ <div
282
+ v-if="channel !== 'official-website'"
283
+ style="color: #1890ff"
284
+ >
285
+ 首批货运
286
+ </div>
270
287
  <div>
271
288
  <div class="sub-title">
272
289
  {{ $t("contractDetail.bookingConfirmation") }}
@@ -483,7 +500,7 @@
483
500
  :key="i"
484
501
  />
485
502
  <contract-file-drag-upload
486
- v-if="channel !== 'official-website'"
503
+ v-if="channel !== 'official-website'"
487
504
  @upload="
488
505
  handleUpload(
489
506
  $event,
@@ -677,31 +694,35 @@
677
694
  :type="shipmentFileInfo.waterBill ? 'primary' : ''"
678
695
  size="large"
679
696
  >
680
- <div v-if="channel !== 'official-website'" style="color: #1890ff">
697
+ <div
698
+ v-if="channel !== 'official-website'"
699
+ style="color: #1890ff"
700
+ >
681
701
  {{
682
- contract.contractType == "sale" ? "尾款收款" : $t('contractDetail.Final_payment')
702
+ contract.contractType == "sale"
703
+ ? "尾款收款"
704
+ : $t("contractDetail.Final_payment")
683
705
  }}
684
706
  </div>
685
707
  <div v-else class="sub-title">
686
- {{
687
- $t('contractDetail.Final_payment')
688
- }}
708
+ {{ $t("contractDetail.Final_payment") }}
689
709
  </div>
690
710
  <el-row>
691
711
  <el-col :span="8">
692
712
  <div>
693
- <div v-if="channel !== 'official-website'" class="sub-title">
713
+ <div
714
+ v-if="channel !== 'official-website'"
715
+ class="sub-title"
716
+ >
694
717
  {{
695
718
  contract.contractType == "sale"
696
719
  ? "收款水单"
697
- : $t('contractDetail.Payment_receipt')
720
+ : $t("contractDetail.Payment_receipt")
698
721
  }}
699
722
  </div>
700
723
  <div v-else class="sub-title">
701
- {{
702
- $t('contractDetail.Payment_receipt')
703
- }}
704
- </div>
724
+ {{ $t("contractDetail.Payment_receipt") }}
725
+ </div>
705
726
  <div class="file-list">
706
727
  <file-show
707
728
  @refresh="handleRefresh"
@@ -769,17 +790,18 @@
769
790
  </el-row>
770
791
  <el-row>
771
792
  <div>
772
- <div class="sub-title" v-if="channel !== 'official-website'">
793
+ <div
794
+ class="sub-title"
795
+ v-if="channel !== 'official-website'"
796
+ >
773
797
  {{
774
798
  contract.contractType == "sale"
775
799
  ? "收款凭证"
776
- : $t('contractDetail.Payment_voucher')
800
+ : $t("contractDetail.Payment_voucher")
777
801
  }}
778
802
  </div>
779
803
  <div v-else class="sub-title">
780
- {{
781
- $t('contractDetail.Payment_voucher')
782
- }}
804
+ {{ $t("contractDetail.Payment_voucher") }}
783
805
  </div>
784
806
  <div class="file-list">
785
807
  <file-show
@@ -824,7 +846,7 @@
824
846
  :key="i"
825
847
  />
826
848
  <contract-file-drag-upload
827
- v-if="channel !== 'official-website'"
849
+ v-if="channel !== 'official-website'"
828
850
  @upload="
829
851
  handleUpload(
830
852
  $event,
@@ -859,11 +881,12 @@
859
881
  </template>
860
882
 
861
883
  <script>
884
+ import { chargedShipment } from "../../../api/biz/bizShipment";
862
885
  import { listBizFileInfo, addBizFileInfo } from "../../../api/biz/bizFileInfo";
863
886
  import { getBizContractFileInfo } from "../../../api/biz/bizContract";
864
887
  import FileShow from "./fileShow.vue";
865
888
  import ContractFileUpload from "../../../components/FileUpload/contract.vue";
866
- import ContractFileDragUpload from "../../../components/FileUpload/contract-drag.vue";
889
+ import ContractFileDragUpload from "../../../components/FileUpload/contract-drag-new.vue";
867
890
  import { batchAsZip } from "../../../utils/zip";
868
891
  import {
869
892
  getBizContract,
@@ -1050,6 +1073,12 @@ export default {
1050
1073
  });
1051
1074
  });
1052
1075
  }
1076
+ //如果是上传电放
1077
+ if (fileType == "shipment_delivery_receipt") {
1078
+ chargedShipment({ shipmentId: linkId }).then((response) => {
1079
+ this.$modal.msgSuccess("电放成功");
1080
+ });
1081
+ }
1053
1082
  });
1054
1083
  },
1055
1084
 
@@ -103,6 +103,11 @@ export default {
103
103
  };
104
104
  },
105
105
  },
106
+ //是否隐藏操作
107
+ hiddenOperation: {
108
+ type: Boolean,
109
+ default: false,
110
+ },
106
111
  },
107
112
  data() {
108
113
  return {