Commit f9797a77 authored by 黄媛媛's avatar 黄媛媛
parents 3d8bb51e 406d6d9c
......@@ -31,7 +31,7 @@
<th>库存</th>
<th>型号</th>
<th>档案编码</th>
<th>图片</th>
<!-- <th>图片</th> -->
<th>操作人</th>
<th>操作时间</th>
<th>备注</th>
......@@ -54,9 +54,9 @@
</td>
<td>{{item.SuppliesModel}}</td>
<td>{{item.SuppliesNum}}</td>
<td>
<!-- <td>
<img v-for="(subItem,index) in item.ImageList" :key="index" :src="subItem" alt="">
</td>
</td> -->
<td>{{item.UpdateBy}}</td>
<td>{{item.UpdateDate}}</td>
<td>{{item.Remark}}</td>
......@@ -140,10 +140,10 @@
</el-form-item>
<div class="_addUpload_box">
<ul class="uploadUl">
<li>
<img src="../../assets/img/pic.png" alt="">
<li v-for="(item,index) in addMsg.ImageList" :key="index">
<img :src="item" alt="">
<div class="hoverDiv">
<img src="../../assets/img/imgdelete.png" alt="">
<img @click="DeleteImg(item,index)" src="../../assets/img/imgdelete.png" alt="">
</div>
</li>
</ul>
......@@ -161,7 +161,7 @@
</div>
<div class="btnformItem">
<span class="submitBtn" type="primary" @click="submitForm('addMsg')">确定</span>
<span class="exitBtn" @click="dialogState=false">取消</span>
<span class="exitBtn" @click="dialogState=false,linitMsg()">取消</span>
</div>
</el-form>
</el-dialog>
......@@ -216,7 +216,7 @@ export default {
Money:'',
Barcode:'',
Remark:'',
ImageList:'',
ImageList:[],
},
dialogtitle:'新增物料档案',
dialogState:false,
......@@ -282,6 +282,9 @@ export default {
this.getNode();
},
methods:{
DeleteImg(item,index){
this.addMsg.ImageList.splice(index, 1);
},
treefocus(){
this.treedataState=true;
},
......@@ -290,13 +293,27 @@ export default {
},
addSupplier(){
this.addMsg={
Id:0,
Name:''
}
this.addMsg.Id=0;
this.dialogtitle="新增物料档案";
this.dialogState=true;
},
//重置
initMsg(){
this.addMsg.Id=0;
this.addMsg.Name='';
this.addMsg.SuppliesNum='';
this.addMsg.BrandName='';
this.addMsg.CategoryId=null;
this.addMsg.SupplierName='';
this.addMsg.SafetyStock='';
this.addMsg.ReservedStock='';
this.addMsg.SuppliesModel='';
this.addMsg.Units='';
this.addMsg.Money='';
this.addMsg.Barcode='';
this.addMsg.Remark='';
this.addMsg.ImageList='';
},
uploadFileBtn(file) { //上传
if(file.file.size > 1024 * 1024 * 10) {
this.$message.warning("文件大小不能超过10M!")
......@@ -323,7 +340,7 @@ export default {
this.$message.info("上传中...")
this.UploadSelfFileT(path, newArr, x => {
let fileSize = file.file.size<1024? file.file.size:(file.file.size / 1024).toFixed(0);
this.addMsg.ImageList = this.domainManager().ViittoFileUrl + x.data.FilePath
this.addMsg.ImageList.push(this.domainManager().ViittoFileUrl + x.data.FilePath)
this.Success("上传成功");
// this.$forceUpdate();
});
......@@ -337,7 +354,7 @@ export default {
this.getList();
this.Success(res.data.message)
this.dialogState=false;
this.initMsg();
} else {
this.Error(res.data.message);
}
......@@ -372,8 +389,10 @@ export default {
Edit(item){
this.dialogtitle="编辑物料档案";
this.dialogState=true;
console.log(item,'item');
this.addMsg=Object.assign({},item);
this.addMsg=Object.assign({},item)
if(!this.addMsg.ImageList){
this.addMsg.ImageList=[];
}
// this.addMsg={
// Id:item.Id,
// Name:item.Name,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment