物资类型管理

This commit is contained in:
jjLv 2024-10-28 16:25:31 +08:00
parent 79e72d2b0b
commit 09ed54aba5
2 changed files with 39 additions and 28 deletions

View File

@ -317,7 +317,7 @@
//1 //1
uploadDisabled() { uploadDisabled() {
return this.fileList.length > 0 return this.businessLicenseList.length > 2
}, },
}, },
created() { created() {
@ -336,13 +336,14 @@
}, },
// //
imgUpLoadTwo(param, name, index) { async imgUpLoadTwoAll(param, name, index) {
console.log(param, 'image') console.log(param, 'image')
param.type = 'ma' param.type = 'ma'
imgUpLoadTwo(param) await imgUpLoadTwo(param)
.then((res) => { .then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.imageUrl = res.data.fileUrl this.imageUrl = res.data.url
this.businessLicenseFileList.push(this.imageUrl);
} else { } else {
// this.$msgError(res.msg) // this.$msgError(res.msg)
this.$modal.msgError(res.msg) this.$modal.msgError(res.msg)
@ -448,7 +449,7 @@
this.businessLicenseList = fileList; this.businessLicenseList = fileList;
}, },
getList() { async getList() {
this.loading = true; this.loading = true;
getListFacturer(this.queryParams).then(response => { getListFacturer(this.queryParams).then(response => {
this.houseList = response.rows; this.houseList = response.rows;
@ -488,12 +489,13 @@
}, },
//** */ //** */
submitForm() { async submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if (this.form.supplierId != undefined) { if (this.form.supplierId != undefined) {
const reqData = new FormData(); const reqData = new FormData();
editFacturer(this.form).then(response => {
editFacturer(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.showHouse = false; this.showHouse = false;
this.getList(); this.getList();
@ -503,29 +505,16 @@
} else { } else {
const reqData = new FormData() const reqData = new FormData()
const {fileTwo} = this.getFileData() const {fileTwo} = this.getFileData()
fileTwo.forEach(item=>{ fileTwo.forEach(async item=>{
let obj={file: item} let obj={file: item};
imgUpLoadTwo(obj) await this.imgUpLoadTwoAll(obj,name,name);
.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)
})
}) })
this.form.businessLicenseFileList=this.businessLicenseFileList this.form.businessLicenseFileList=this.businessLicenseFileList
addFacturer(this.form).then(response => { addFacturer(this.form).then(async response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.showHouse = false; this.showHouse = false;
this.getList(); await this.getList();
this.businessLicenseList=[]; this.businessLicenseList=[];
this.delBusinessFileIdList=[]; this.delBusinessFileIdList=[];
this.businessLicenseFileList=[]; this.businessLicenseFileList=[];

View File

@ -668,6 +668,7 @@ export default {
// //
treeOptions: undefined, treeOptions: undefined,
treeTemp:[], treeTemp:[],
treeTempTwo:[],
// //
typeList: undefined, typeList: undefined,
// //
@ -793,6 +794,22 @@ export default {
getTreeData() { getTreeData() {
getMaTypeList().then((response) => { getMaTypeList().then((response) => {
this.treeOptions = response.data 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.levelTemp = data.level;
this.idTemp = data.id; this.idTemp = data.id;
console.log('dataAdd',data) console.log('dataAdd',data)
console.log('idTemp',data)
if (data.level === 3) { if (data.level === 3) {
this.reset() this.reset()
Object.assign(this.form, data) Object.assign(this.form, data)
@ -1068,16 +1086,20 @@ export default {
console.log('level',this.levelTemp) console.log('level',this.levelTemp)
console.log('idTemp',this.idTemp) console.log('idTemp',this.idTemp)
const addParams = { const addParams = {
parentId: this.idTemp, parentId: this.levelTemp==0 ? 0:this.idTemp,
typeName, typeName,
level:this.levelTemp, level:this.levelTemp,
houseId:this.levelTemp==0 ? id:null,
} }
const editParams = { const editParams = {
typeId: id, houseId: id,
typeName, typeName,
level:this.levelTemp, level:this.levelTemp,
parentId: this.parentId, parentId: this.parentId,
typeId: id,
} }
this.$refs['addFormParamsRef'].validate(async (valid) => { this.$refs['addFormParamsRef'].validate(async (valid) => {
if (valid) { if (valid) {