Browse Source

7.11

master
fengdong777 2 years ago
parent
commit
3c8664b663
  1. 57
      warehousing-system/project_web/src/components/initial_value/storehouse.vue
  2. 22
      warehousing-system/project_web/src/components/uploadFile/uploadTwo.vue
  3. 42
      warehousing-system/project_web/src/components/uploadFile/upload_yanchejianchaTuBiao.vue

57
warehousing-system/project_web/src/components/initial_value/storehouse.vue

@ -382,7 +382,7 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item class="trightbs_item"> <el-form-item class="trightbs_item">
<uploadTwo class="item_input" ref="uploadImg" v-model="imgPrl" @change="backData" bucket="map" <uploadTwo class="item_input" ref="uploadImg" @passfunction = "meetfunction" :imgUrl="imagesg" v-model="imgPrl" @change="backData" bucket="map"
:upload-data="{ type: '0001' }" :upload-data="{ type: '0001' }"
></uploadTwo> ></uploadTwo>
</el-form-item> </el-form-item>
@ -394,7 +394,7 @@
</el-col> </el-col>
<el-col :span="20"> <el-col :span="20">
<el-form-item class="trightbs_item"> <el-form-item class="trightbs_item">
<upload class="item_input" ref="uploadImg" v-model="imgList" @change="backDatas" bucket="map" <upload class="item_input" ref="uploadImg" :minet-list="msg" v-model="imgList" @change="backDatas" bucket="map"
:upload-data="{ type: '0001' }"></upload> :upload-data="{ type: '0001' }"></upload>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -699,8 +699,25 @@ export default {
mapApiKey: "map", mapApiKey: "map",
shouhuoArrive: {}, shouhuoArrive: {},
fullscreenloading: null, fullscreenloading: null,
msg: [],
imagesg:[],
meetfunctions:[]
}; };
}, },
watch: {
imgList:{
deep: true,
immediate: true,
handler(newVal, oldVal) {
console.log(newVal);
const aa=[]
for (var i = 0; i < newVal.length; i++) {
aa.push(newVal[i].sid)
}
this.form.pics = aa
}
},
},
methods: { methods: {
// //
indexMethod(index) { indexMethod(index) {
@ -750,6 +767,8 @@ export default {
}, },
addStorehouseDialog() { addStorehouseDialog() {
this.clearList() this.clearList()
this.imgPrl=[]
this.imgList=[]
this.title = "新增仓库"; this.title = "新增仓库";
this.storehouseDialogVisible = true; this.storehouseDialogVisible = true;
}, },
@ -759,11 +778,28 @@ export default {
this.custList = result.data this.custList = result.data
} }
}, },
updataStorehousedialog(storehouse) { async updataStorehousedialog(storehouse) {
console.log(storehouse); this.clearList()
this.form = storehouse; this.imgList=[]
this.msg=[]
this.imgPrl=[]
this.imagesg=[]
this.title = "修改仓库"; this.title = "修改仓库";
this.storehouseDialogVisible = true; this.storehouseDialogVisible = true;
const { data: result } = await this.$http.get(
`/v1/shstorehouse/fetchDetailsBySid/${storehouse.sid}`
);
if (result.code == 200) {
this.form = result.data;
let value=result.data.pics
const picImg=result.data.picUrl
this.imagesg.push({
url:picImg
})
for(let i=0;i<value.length;i++){
this.msg.push(value[i])
}
}
}, },
async addStorehouse() { async addStorehouse() {
const { data: result } = await this.$http.post( const { data: result } = await this.$http.post(
@ -773,7 +809,11 @@ export default {
if (result.code == 200) this.$message.success("成功添加仓库"); if (result.code == 200) this.$message.success("成功添加仓库");
this.getStorehouseList(); this.getStorehouseList();
this.storehouseDialogVisible = false; this.storehouseDialogVisible = false;
this.clearList(); this.clearList()
this.msg=[]
this.imgList=[]
this.imgPrl=[]
this.imagesg=[]
}, },
async updataStorehouse() { async updataStorehouse() {
const { data: result } = await this.$http.post( const { data: result } = await this.$http.post(
@ -957,6 +997,11 @@ export default {
backData(value) { backData(value) {
this.form.picUrl = value[0].response.data this.form.picUrl = value[0].response.data
}, },
meetfunction(val){
if(val.length==0){
this.form.picUrl=''
}
}
}, },
mounted() { mounted() {
this.getStorehouseList(); this.getStorehouseList();

22
warehousing-system/project_web/src/components/uploadFile/uploadTwo.vue

@ -28,9 +28,9 @@
default: 'abc' default: 'abc'
}, },
// //
width: { img: {
type: String, type: String,
default: '270px' default: ''
}, },
// limit: { // limit: {
// type: Number, // type: Number,
@ -41,7 +41,7 @@
default: '.jpg,.jpeg,.png,.JPG,.JPEG,' default: '.jpg,.jpeg,.png,.JPG,.JPEG,'
}, },
// //
name: { imgUrl: {
type: Array, type: Array,
required: true required: true
}, },
@ -70,18 +70,23 @@
} }
}, },
watch: { watch: {
name: { imgUrl: {
deep: true, deep: true,
immediate: true, immediate: true,
handler(newVal, oldVal) { handler(newVal, oldVal) {
this.files = newVal if(newVal.url!=undefined){
let copy = newVal.slice();
this.files = copy
}
} }
} }
}, },
mounted() { mounted() {
this.$nextTick(() => { // this.$nextTick(() => {
this.Init() // this.Init()
}) // })
}, },
created() { created() {
@ -131,6 +136,7 @@
imgFiles.push(o.url) imgFiles.push(o.url)
}) })
this.$emit('fileChange', this.files) this.$emit('fileChange', this.files)
this.$emit("passfunction",this.files)
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
console.log('file:' + JSON.stringify(file)) console.log('file:' + JSON.stringify(file))

42
warehousing-system/project_web/src/components/uploadFile/upload_yanchejianchaTuBiao.vue

@ -48,6 +48,12 @@
uploadData: { uploadData: {
type: Object, type: Object,
default: {} default: {}
},
MinetList: {
type: Array,
default: function () {
return []
}
} }
}, },
data() { data() {
@ -76,12 +82,28 @@
handler(newVal, oldVal) { handler(newVal, oldVal) {
this.files = newVal this.files = newVal
} }
},
MinetList: {
deep: true,
immediate: true,
handler(newVal, oldVal) {
let copy = newVal.slice();
if (copy !== undefined) {
// this.files = []
for (var i = 0; i < copy.length; i++) {
this.files.push({
url: copy[i].fileUrl,
name: copy[i].fileName,
sid: copy[i].sid,
})
}
} }
}
},
}, },
mounted() { mounted() {
this.$nextTick(() => { // this.Init()
this.Init()
})
}, },
created() { created() {
@ -95,15 +117,7 @@
}, },
// //
Init() { Init() {
if (this.name !== undefined) {
this.files = []
for (var i = 0; i < this.name.length; i++) {
this.files.push({
name: this.name[i],
url: this.name[i]
})
}
}
}, },
handlePictureCardPreview(file) { handlePictureCardPreview(file) {
this.dialogVisible = true this.dialogVisible = true
@ -123,6 +137,7 @@
url: file.response.data.fileUrl, url: file.response.data.fileUrl,
sid: file.response.data.sid sid: file.response.data.sid
}) })
console.log( this.files);
this.$emit('change', this.files) this.$emit('change', this.files)
this.$emit('eett', this.files) this.$emit('eett', this.files)
} }
@ -135,6 +150,7 @@
imgFiles.push(o.url) imgFiles.push(o.url)
}) })
this.$emit('fileChange', this.files) this.$emit('fileChange', this.files)
console.log(this.files);
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
console.log('file:' + JSON.stringify(file)) console.log('file:' + JSON.stringify(file))
@ -209,7 +225,7 @@
} }
// console.log('event:', event) // console.log('event:', event)
} }
} },
} }
</script> </script>

Loading…
Cancel
Save