huangfuli 3 năm trước cách đây
mục cha
commit
7f5532bb76

+ 27 - 6
src/views/outboundManagement/weighing.vue

@@ -66,11 +66,15 @@
 						<div class="bangdan">
 						<div class="bangdan">
 							<el-form-item label="上传磅单" v-if="this.types == 1">
 							<el-form-item label="上传磅单" v-if="this.types == 1">
 							</el-form-item>
 							</el-form-item>
-							<el-upload action="https://www.zthymaoyi.com/upload/admin" list-type="picture-card"
+							<!-- <el-upload action="https://www.zthymaoyi.com/upload/admin" 
+								list-type="picture-card"
 								:on-success="(res, file) => {handlePictureCardPreview1(res)}"
 								:on-success="(res, file) => {handlePictureCardPreview1(res)}"
-								:on-remove="(value) => {handleRemove(value)}" class="photo2" v-if="this.types == 1">
+								:on-remove="handleRemove" class="photo2" v-if="this.types == 1">
 								<i class="el-icon-plus"></i>
 								<i class="el-icon-plus"></i>
-							</el-upload>
+							</el-upload> -->
+							<ws-upload ref="upload" :comp-id="compId" :appendix-ids="weighingList.addressUrl"
+								:size-limit="size" @onChange="onChange" v-if="this.types == 1"
+								accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar" />
 							<el-dialog :visible.sync="dialogVisible" v-if="this.types == 1">
 							<el-dialog :visible.sync="dialogVisible" v-if="this.types == 1">
 								<img width="100%" :src="weighingList.addressUrl" alt="" />
 								<img width="100%" :src="weighingList.addressUrl" alt="" />
 							</el-dialog>
 							</el-dialog>
@@ -94,7 +98,12 @@
 		tareEdit,
 		tareEdit,
 		getweighing
 		getweighing
 	} from '@/model/outboundManagement/index'
 	} from '@/model/outboundManagement/index'
+	import WsUpload from '@/components/WsUpload'
+	import {EventBus} from 'base-core-lib'
 	export default {
 	export default {
+		components: {
+			WsUpload,
+		},
 		data() {
 		data() {
 			return {
 			return {
 				inspect: {},
 				inspect: {},
@@ -103,6 +112,7 @@
 				weighingList: {
 				weighingList: {
 					carNumber: '',
 					carNumber: '',
 					storageNumber: '',
 					storageNumber: '',
+					addressUrl: '',
 					buckleMiscellaneous: 0,
 					buckleMiscellaneous: 0,
 					compId: sessionStorage.getItem('ws-pf_compId'),
 					compId: sessionStorage.getItem('ws-pf_compId'),
 				},
 				},
@@ -132,6 +142,8 @@
 				],
 				],
 				relationId: '',
 				relationId: '',
 				warehouseId: '', //仓库id
 				warehouseId: '', //仓库id
+				compId: sessionStorage.getItem('ws-pf_compId'),
+				size: 10,
 			}
 			}
 		},
 		},
 		activated() {
 		activated() {
@@ -163,9 +175,18 @@
 					return
 					return
 				}
 				}
 			},
 			},
-			handlePictureCardPreview1(file) {
-				this.weighingList.addressUrl += file.url + ','
-				this.addressUrls.push(file.url)
+			//附件
+			//上传附件
+			onChange() {
+				this.$refs.upload
+					.handleSaveBill()
+					.then(async response => {
+						this.weighingList.addressUrl = response
+					})
+					.catch(res => {
+						EventBus.$emit('error', (JSON.parse(res) || {}).message)
+						this.$refs.upload.clearFiles()
+					})
 			},
 			},
 			cancel() {
 			cancel() {
 				this.weighingList = {}
 				this.weighingList = {}

+ 9 - 13
src/views/outboundManagement/weighingManagement.vue

@@ -40,10 +40,10 @@
 			<el-table-column prop="secretaryWeigher" label="司称员"></el-table-column>
 			<el-table-column prop="secretaryWeigher" label="司称员"></el-table-column>
 			<el-table-column prop="grossDate" label="称重时间">
 			<el-table-column prop="grossDate" label="称重时间">
 				<template slot-scope="scope">
 				<template slot-scope="scope">
-				{{scope.row.grossDate}}
-				<span v-if="scope.row.grossDate == null">
-            		{{scope.row.tareDate}}
-          		</span>
+					{{scope.row.grossDate}}
+					<span v-if="scope.row.grossDate == null">
+						{{scope.row.tareDate}}
+					</span>
 				</template>
 				</template>
 			</el-table-column>
 			</el-table-column>
 			<el-table-column prop="addressUrl" label="附件">
 			<el-table-column prop="addressUrl" label="附件">
@@ -51,7 +51,7 @@
 					<img width="18" height="20" style="vertical-align: text-top; position: relative; top: -1px"
 					<img width="18" height="20" style="vertical-align: text-top; position: relative; top: -1px"
 						src="../../../public/img/fujian.png" @click="fujian(scope.row)" alt="" />
 						src="../../../public/img/fujian.png" @click="fujian(scope.row)" alt="" />
 					<span v-if="scope.row.addressUrlArray != null">
 					<span v-if="scope.row.addressUrlArray != null">
-						{{scope.row.addressUrlArray.length == 0? '': scope.row.addressUrlArray.length}}
+						{{scope.row.addressUrlArray.length == 0? "":scope.row.addressUrlArray.length}}
 					</span>
 					</span>
 				</template>
 				</template>
 			</el-table-column>
 			</el-table-column>
@@ -72,10 +72,8 @@
 		</div>
 		</div>
 		<WinseaContentModal v-model="accessoryTFs" :title="$t('system.noticeCircular.information')"
 		<WinseaContentModal v-model="accessoryTFs" :title="$t('system.noticeCircular.information')"
 			@on-cancel="handleClose">
 			@on-cancel="handleClose">
-			<p>查看附件</p>
-			<div style="display: inline-block; margin: 5px" v-for="item in appendixIdss">
-				<img width="100" height="100" :src="item" alt="" />
-			</div>
+			<ws-upload ref="upload" :comp-id="compId" :appendix-ids="appendixIdss" :editable="false"
+				accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar" />
 		</WinseaContentModal>
 		</WinseaContentModal>
 	</div>
 	</div>
 </template>
 </template>
@@ -85,9 +83,7 @@
 		selectWarehouseSelf,
 		selectWarehouseSelf,
 		delelteWeighing,
 		delelteWeighing,
 	} from '@/model/outboundManagement/index'
 	} from '@/model/outboundManagement/index'
-	import {
-		EventBus
-	} from 'base-core-lib'
+	import {EventBus} from 'base-core-lib'
 	import WsUpload from '@/components/WsUpload'
 	import WsUpload from '@/components/WsUpload'
 	export default {
 	export default {
 		components: {
 		components: {
@@ -258,7 +254,7 @@
 				} else {
 				} else {
 					this.accessoryTFs = true
 					this.accessoryTFs = true
 				}
 				}
-				this.appendixIdss = row.addressUrlArray
+				this.appendixIdss = row.addressUrl
 			},
 			},
 			handleClose() {
 			handleClose() {
 				this.dialogViewSpareMoney = false
 				this.dialogViewSpareMoney = false