物资类型管理
This commit is contained in:
parent
79e72d2b0b
commit
09ed54aba5
|
|
@ -317,7 +317,7 @@
|
|||
|
||||
//图片上传1张后,隐藏上传框
|
||||
uploadDisabled() {
|
||||
return this.fileList.length > 0
|
||||
return this.businessLicenseList.length > 2
|
||||
},
|
||||
},
|
||||
created() {
|
||||
|
|
@ -336,13 +336,14 @@
|
|||
},
|
||||
|
||||
// 图片上传
|
||||
imgUpLoadTwo(param, name, index) {
|
||||
async imgUpLoadTwoAll(param, name, index) {
|
||||
console.log(param, 'image')
|
||||
param.type = 'ma'
|
||||
imgUpLoadTwo(param)
|
||||
await imgUpLoadTwo(param)
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.imageUrl = res.data.fileUrl
|
||||
this.imageUrl = res.data.url
|
||||
this.businessLicenseFileList.push(this.imageUrl);
|
||||
} else {
|
||||
// this.$msgError(res.msg)
|
||||
this.$modal.msgError(res.msg)
|
||||
|
|
@ -448,7 +449,7 @@
|
|||
this.businessLicenseList = fileList;
|
||||
},
|
||||
|
||||
getList() {
|
||||
async getList() {
|
||||
this.loading = true;
|
||||
getListFacturer(this.queryParams).then(response => {
|
||||
this.houseList = response.rows;
|
||||
|
|
@ -488,11 +489,12 @@
|
|||
},
|
||||
|
||||
//** 提交按钮 */
|
||||
submitForm() {
|
||||
async submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.supplierId != undefined) {
|
||||
const reqData = new FormData();
|
||||
|
||||
editFacturer(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.showHouse = false;
|
||||
|
|
@ -503,29 +505,16 @@
|
|||
} else {
|
||||
const reqData = new FormData()
|
||||
const {fileTwo} = this.getFileData()
|
||||
fileTwo.forEach(item=>{
|
||||
let obj={file: item}
|
||||
imgUpLoadTwo(obj)
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.imageUrl = res.data.fileUrl
|
||||
console.log('imageUrl',this.imageUrl)
|
||||
this.businessLicenseFileList.push(this.imageUrl);
|
||||
} else {
|
||||
// this.$msgError(res.msg)
|
||||
this.$modal.msgError(res.msg)
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
// this.$msgError(error)
|
||||
this.$modal.msgError(error)
|
||||
})
|
||||
fileTwo.forEach(async item=>{
|
||||
let obj={file: item};
|
||||
await this.imgUpLoadTwoAll(obj,name,name);
|
||||
|
||||
})
|
||||
this.form.businessLicenseFileList=this.businessLicenseFileList
|
||||
addFacturer(this.form).then(response => {
|
||||
addFacturer(this.form).then(async response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.showHouse = false;
|
||||
this.getList();
|
||||
await this.getList();
|
||||
this.businessLicenseList=[];
|
||||
this.delBusinessFileIdList=[];
|
||||
this.businessLicenseFileList=[];
|
||||
|
|
|
|||
|
|
@ -668,6 +668,7 @@ export default {
|
|||
// 树选项
|
||||
treeOptions: undefined,
|
||||
treeTemp:[],
|
||||
treeTempTwo:[],
|
||||
//列表数据
|
||||
typeList: undefined,
|
||||
// 是否显示弹出层
|
||||
|
|
@ -793,6 +794,22 @@ export default {
|
|||
getTreeData() {
|
||||
getMaTypeList().then((response) => {
|
||||
this.treeOptions = response.data
|
||||
// if(response.data!=null){
|
||||
// const firstTree = response.data[0];
|
||||
// for(let i = 1;i<response.data.length;i++){
|
||||
// firstTree.children.push(...response.data[i].children)
|
||||
// }
|
||||
// this.treeOptions = [firstTree]
|
||||
// // this.treeTempTwo[0] = response.data[0]
|
||||
// // this.treeTempTwo[0].children[0]=response.data[0].children
|
||||
// // console.log('treeTempTwo',this.treeTempTwo)
|
||||
// // for(let i=1;i<response.data.length;i++){
|
||||
// // this.treeTempTwo[0].children.push(response.data[i].children)
|
||||
// // }
|
||||
// // console.log('treeTempTwo',this.treeTempTwo)
|
||||
// // this.treeOptions = this.treeTempTwo
|
||||
// }
|
||||
// console.log('treeOptions',this.treeOptions)
|
||||
})
|
||||
},
|
||||
/** 查询列表 */
|
||||
|
|
@ -999,6 +1016,7 @@ export default {
|
|||
this.levelTemp = data.level;
|
||||
this.idTemp = data.id;
|
||||
console.log('dataAdd',data)
|
||||
console.log('idTemp',data)
|
||||
if (data.level === 3) {
|
||||
this.reset()
|
||||
Object.assign(this.form, data)
|
||||
|
|
@ -1068,17 +1086,21 @@ export default {
|
|||
console.log('level',this.levelTemp)
|
||||
console.log('idTemp',this.idTemp)
|
||||
const addParams = {
|
||||
parentId: this.idTemp,
|
||||
parentId: this.levelTemp==0 ? 0:this.idTemp,
|
||||
typeName,
|
||||
level:this.levelTemp,
|
||||
houseId:this.levelTemp==0 ? id:null,
|
||||
}
|
||||
|
||||
const editParams = {
|
||||
typeId: id,
|
||||
houseId: id,
|
||||
typeName,
|
||||
level:this.levelTemp,
|
||||
parentId: this.parentId,
|
||||
typeId: id,
|
||||
}
|
||||
|
||||
|
||||
this.$refs['addFormParamsRef'].validate(async (valid) => {
|
||||
if (valid) {
|
||||
if (this.addTitle === '新增') {
|
||||
|
|
|
|||
Loading…
Reference in New Issue