基础管理
This commit is contained in:
parent
77b4ec475b
commit
ff383c5754
|
|
@ -172,6 +172,14 @@ export function delUnitPerson(unitId) {
|
|||
}
|
||||
|
||||
|
||||
// 工程管理下拉框
|
||||
export function queryProDataApi(dictType) {
|
||||
return request({
|
||||
url: '/system/dict/data//type/'+ dictType,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
// 字典表数据库
|
||||
// 单位类型-列表
|
||||
export function unitTypeList(query) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,107 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
//机具类型管理
|
||||
export function getMaTypeList(query) {
|
||||
return request({
|
||||
url: '/material/ma_type/getMaTypeTreeSelect',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
//机具类型管理列表信息
|
||||
export function getListByMaType(query) {
|
||||
return request({
|
||||
url: '/material/ma_type/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
//查看机具类型管理列表详细信息
|
||||
export function getMaType(id) {
|
||||
return request({
|
||||
url: '/material/ma_type/'+ id,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
// 仓库信息下拉框-
|
||||
export function queryKeeperDataApi(query) {
|
||||
return request({
|
||||
url: '/material/wh_house_info/listNoPage',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 施工类型下拉框-
|
||||
export function queryKeeperProApi(query) {
|
||||
return request({
|
||||
url: '/material/ma_type/selectMaTypeListByHouseId',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 物资类型下拉框-
|
||||
export function queryKeeperMatApi(query) {
|
||||
return request({
|
||||
url: '/material/ma_type/selectMaTypeListByTypeId',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 物资名称下拉框-
|
||||
export function queryKeeperNameApi(query) {
|
||||
return request({
|
||||
url: '/material/ma_type/selectMaTypeListByTypeId',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// // 导出
|
||||
// export function exportMaterial(query) {
|
||||
// return request({
|
||||
// url: '/material/ma_type/export',
|
||||
// method: 'post',
|
||||
// responseType: 'blob',
|
||||
// params: query
|
||||
// })
|
||||
// }
|
||||
|
||||
// 物资类型管理--删除
|
||||
export function delMaType(typeId) {
|
||||
return request({
|
||||
url: '/material/ma_type/' + typeId,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
|
||||
// 物资类型管理--修改
|
||||
export function updateMaType(data) {
|
||||
return request({
|
||||
url: '/material/ma_type',
|
||||
method: 'put',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 物资类型管理--新增
|
||||
export function addMaType(data) {
|
||||
return request({
|
||||
url: '/material/ma_type',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 工程项目-列表
|
||||
export function getProjectList(query) {
|
||||
return request({
|
||||
url: '/material/base/bmProjectInfo/projectInfoAll',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
//机具类型管理列表信息
|
||||
export function getListFacturer(query) {
|
||||
return request({
|
||||
url: '/material/ma_supplier_info/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
//机具类型管理列表信息
|
||||
export function getManufacturerSelect(query) {
|
||||
return request({
|
||||
url: '/material/ma_supplier_info/select',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//查看机具类型管理列表详细信息
|
||||
export function getFacturerDetail(id) {
|
||||
return request({
|
||||
url: '/material/ma_supplier_info/'+ id,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 仓库管理--删除
|
||||
export function delFacturer(id) {
|
||||
return request({
|
||||
url: '/material/ma_supplier_info/' + id,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
|
||||
// 仓库管理--修改
|
||||
export function editFacturer(data) {
|
||||
return request({
|
||||
url: '/material/ma_supplier_info',
|
||||
method: 'put',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 仓库管理--新增
|
||||
export function addFacturer(data) {
|
||||
return request({
|
||||
url: '/material/ma_supplier_info',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
import request from '@/utils/request'
|
||||
//资源图片上传
|
||||
export function imgUpLoad(param){
|
||||
const formData = new FormData()
|
||||
formData.append('file', param.file)
|
||||
formData.append('fileType', param.type)
|
||||
return request({
|
||||
url: '/system/sys/file/upload',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
header:'multipart/form-data'
|
||||
})
|
||||
}
|
||||
|
||||
export function imgUpLoadTwo(param){
|
||||
const formData = new FormData()
|
||||
formData.append('file', param.file)
|
||||
formData.append('fileType', param.type)
|
||||
return request({
|
||||
url: '/file/upload',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
header:'multipart/form-data'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
//资源文件上传
|
||||
export function fileUpLoad(param){
|
||||
const formData = new FormData()
|
||||
formData.append('file', param.file)
|
||||
return request({
|
||||
url: '/system/sys/file/upload',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
})
|
||||
}
|
||||
|
||||
// excel文件上传
|
||||
export function excelUpLoad(param){
|
||||
const formData = new FormData()
|
||||
formData.append('file', param.file)
|
||||
return request({
|
||||
url: '/material/base/maPartType/readExcel',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
})
|
||||
}
|
||||
|
||||
// excel文件下载
|
||||
export function downloadExcel(param){
|
||||
return request({
|
||||
url: '/material/base/maPartType/downLoad',
|
||||
method: 'post',
|
||||
param
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 9.0 KiB |
|
|
@ -102,15 +102,9 @@
|
|||
<el-table-column
|
||||
label="工程类型"
|
||||
align="center"
|
||||
prop="proTypeId"
|
||||
prop="proType"
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.proTypeId =='0'" >{{ '线路工程' }}</div>
|
||||
<div v-if="scope.row.proTypeId =='1'" >{{ '变电工程' }}</div>
|
||||
<div v-if="scope.row.proTypeId =='2'" >{{ '业务工程' }}</div>
|
||||
<div v-if="scope.row.proTypeId =='3'" >{{ '其它工程' }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="工程编号"
|
||||
|
|
@ -239,13 +233,15 @@
|
|||
<el-form-item label="工程类型" prop="proTypeId">
|
||||
<el-select
|
||||
v-model="form.proTypeId"
|
||||
placeholder="请选择工程状态"
|
||||
placeholder="请选择工程类型"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option label="线路工程" value="0"></el-option>
|
||||
<el-option label="变电工程" value="1"></el-option>
|
||||
<el-option label="业务工程" value="2"></el-option>
|
||||
<el-option label="其他工厂" value="3"></el-option>
|
||||
<el-option
|
||||
v-for="keeper in proDataRange"
|
||||
:key="keeper.value"
|
||||
:label="keeper.label"
|
||||
:value="keeper.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
|
@ -384,6 +380,7 @@ import {
|
|||
getProjectList,
|
||||
getProjectListDetail,
|
||||
updateProject,
|
||||
queryProDataApi,
|
||||
getProjectUserList,
|
||||
} from '@/api/basic/basic'
|
||||
import { unitTypeList,impUnitTypeList } from '@/api/basic/basic'
|
||||
|
|
@ -434,6 +431,9 @@ export default {
|
|||
// 表单参数
|
||||
form: {},
|
||||
chosenData: {},
|
||||
proDataRange:[],
|
||||
proStatusDataRange:[],
|
||||
proNatureDataRange:[],
|
||||
// 表单校验
|
||||
rules: {
|
||||
proName: [
|
||||
|
|
@ -486,9 +486,36 @@ export default {
|
|||
this.getType()
|
||||
// this.getDeptTree()
|
||||
this.getList()
|
||||
this.getProjectType()
|
||||
},
|
||||
methods: {
|
||||
//获取工程类型
|
||||
|
||||
async getProjectType(){
|
||||
let prodataRes = await queryProDataApi('bm_project_type');
|
||||
this.proDataRange = prodataRes.data.map((item) => {
|
||||
return {
|
||||
label: item.dictLabel,
|
||||
value: item.dictValue,
|
||||
};
|
||||
});
|
||||
|
||||
let proStatusdataRes = await queryProDataApi('bm_project_status');
|
||||
this.proStatusDataRange = proStatusdataRes.data.map((item) => {
|
||||
return {
|
||||
label: item.dictLabel,
|
||||
value: item.dictValue,
|
||||
};
|
||||
});
|
||||
|
||||
let proNaturedataRes = await queryProDataApi('bm_project_nature');
|
||||
this.proNatureDataRange = proNaturedataRes.data.map((item) => {
|
||||
return {
|
||||
label: item.dictLabel,
|
||||
value: item.dictValue,
|
||||
};
|
||||
});
|
||||
},
|
||||
//获取实施单位
|
||||
getType() {
|
||||
impUnitTypeList().then((response) => {
|
||||
let matTypeRes = response.data;
|
||||
|
|
|
|||
|
|
@ -348,13 +348,26 @@ export default {
|
|||
//获取所属分公司类型
|
||||
getTypeDept() {
|
||||
getDeptList().then((response) => {
|
||||
let unitList = response.data
|
||||
this.deptOptions = unitList.map((item) => {
|
||||
return {
|
||||
let unitList = response.data;
|
||||
let result=[];
|
||||
unitList.forEach(item=>{
|
||||
const parts = item.ancestors.split(',');
|
||||
if(parts.length==2){
|
||||
result.push({
|
||||
label: item.deptName,
|
||||
value: item.deptId,
|
||||
};
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
this.deptOptions=result
|
||||
|
||||
// let unitList = response.data
|
||||
// this.deptOptions = unitList.map((item) => {
|
||||
// return {
|
||||
// label: item.deptName,
|
||||
// value: item.deptId,
|
||||
// };
|
||||
// });
|
||||
})
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
:data="deptOptions"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
:render-content="renderConent"
|
||||
ref="tree"
|
||||
node-key="userId"
|
||||
default-expand-all
|
||||
|
|
@ -506,6 +507,24 @@ export default {
|
|||
|
||||
},
|
||||
methods: {
|
||||
renderConent(h, { node }) {
|
||||
let iconClass = '';
|
||||
console.log('node',node)
|
||||
// 根据 node 的类型判断图标
|
||||
if (node.level == 4) {
|
||||
iconClass = 'el-icon-user-solid';
|
||||
}
|
||||
// else if (node.type === 'file') {
|
||||
// iconClass = 'el-icon-document';
|
||||
// }
|
||||
|
||||
return (
|
||||
<span>
|
||||
<i class={iconClass}></i> {node.label}
|
||||
</span>
|
||||
);
|
||||
s
|
||||
},
|
||||
/** 查询人员列表 */
|
||||
getUserList() {
|
||||
getUserList({ userName: this.userName ,deptId:0}).then(response => {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,655 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item prop="keyWord">
|
||||
<el-input
|
||||
v-model="queryParams.keyWord"
|
||||
placeholder="请输入关键词"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
maxlength="20"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['machinery:type:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-table v-loading="loading" :data="houseList" ref="multipleTable" row-key="teamId">
|
||||
<!-- <el-table-column type="selection" width="55" align="center" :reserve-selection="true" /> -->
|
||||
<el-table-column label="序号" align="center" width="80" type="index">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="厂家名称" align="center" prop="supplier" sortable/>
|
||||
<el-table-column label="厂家地址" align="center" prop="address" sortable/>
|
||||
<el-table-column label="法人代表" align="center" prop="legalPerson" sortable/>
|
||||
<el-table-column label="主要联系人" align="center" prop="primaryContact" sortable/>
|
||||
<el-table-column label="联系电话" align="center" prop="phone" sortable/>
|
||||
<el-table-column label="主要经营范围" align="center" prop="businessScope" sortable/>
|
||||
<el-table-column label="备注" align="center" prop="remark" sortable>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['machinery:type:edit']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['machinery:type:del']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 新增或修改弹窗 -->
|
||||
<el-dialog :title="title" :visible.sync="showHouse" width="1000px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px" >
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="厂家名称" prop="supplier" >
|
||||
<el-input
|
||||
v-model="form.supplier"
|
||||
placeholder="请输入厂家名称"
|
||||
maxlength="30"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="厂家地址" prop="address">
|
||||
<el-input
|
||||
v-model="form.address"
|
||||
placeholder="请输入厂家地址"
|
||||
maxlength="30"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="法人代表" prop="legalPerson" >
|
||||
<el-input
|
||||
v-model="form.legalPerson"
|
||||
placeholder="请输入法人代表"
|
||||
maxlength="10"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="主要联系人" prop="primaryContact">
|
||||
<el-input
|
||||
v-model="form.primaryContact"
|
||||
placeholder="请输入主要联系人"
|
||||
maxlength="30"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="phone" >
|
||||
<el-input
|
||||
v-model="form.phone"
|
||||
placeholder="请输入联系电话"
|
||||
maxlength="11"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row >
|
||||
<el-col :span="12">
|
||||
<el-form-item label="主要联系范围" prop="businessScope">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="6"
|
||||
placeholder="输入内容"
|
||||
v-model="form.businessScope"
|
||||
show-word-limit
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="6"
|
||||
placeholder="请输入备注"
|
||||
v-model="form.remark"
|
||||
maxlength="100"
|
||||
show-word-limit
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="营业执照">
|
||||
<el-upload
|
||||
class = "upload-demo"
|
||||
:action="upload.url"
|
||||
:file-list="businessLicenseList"
|
||||
:show-file-list="true"
|
||||
:auto-upload="false"
|
||||
list-type="picture-card"
|
||||
accept=".png, .jpg, .jpeg, .pdf"
|
||||
:on-change="handleChangeBusinessList"
|
||||
:class="{ disabled: uploadDisabled }"
|
||||
:on-preview="picturePreview"
|
||||
:on-remove="handleRemoveElectricianImgList"
|
||||
>
|
||||
|
||||
<!-- 文件格式下载,图片格式预览 -->
|
||||
<div slot="file" slot-scope="{file}">
|
||||
<img v-if="isImage(file)" class="el-upload-list__item-thumbnail" :src="file.url" alt="">
|
||||
<div v-else class="picture-card-container" >
|
||||
<img class="picture-card" :src="urlTemp" alt="">
|
||||
<p class="file-name">{{ file.name }}</p>
|
||||
</div>
|
||||
<span class="el-upload-list__item-actions">
|
||||
<span v-if="updataIf(file)" class="el-upload-list__item-delete" @click="handleDownload(file)">
|
||||
<i class="el-icon-download" />
|
||||
</span>
|
||||
<span v-else class="el-upload-list__item-preview" @click="picturePreview(file)">
|
||||
<i class="el-icon-zoom-in" />
|
||||
</span>
|
||||
<span class="el-upload-list__item-delete" @click="handleRemoveElectricianImgList(file)">
|
||||
<i class="el-icon-delete" />
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<i class="el-icon-plus avatar-uploader-icon" ></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 图片查看弹窗 -->
|
||||
<el-dialog :visible.sync="dialogVisible" width="500px" height="500px" >
|
||||
<img width="100%" height="500px" :src="dialogImageUrl" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getListFacturer,getFacturerDetail,editFacturer,addFacturer,delFacturer } from "@/api/ma/supplier";
|
||||
import { imgUpLoadTwo, fileUpLoad } from '@/api/system/upload'
|
||||
import { downloadFile } from '@/utils/download'
|
||||
import { getToken } from '@/utils/auth'
|
||||
export default {
|
||||
name: "supplier",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
|
||||
loadingTwo: false,
|
||||
|
||||
|
||||
// 是否显示项目部Id
|
||||
showName: false,
|
||||
|
||||
// 是否显示施工预警信息
|
||||
showWarn: false,
|
||||
|
||||
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
|
||||
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
showHouse: false,
|
||||
|
||||
// 总条数
|
||||
total: 0,
|
||||
totalTwo : 0,
|
||||
// 施工记录表格数据
|
||||
houseList: [],
|
||||
maxLength:100,//已选列表上限,防止数据过多请求报错
|
||||
keeperDataRange:[],
|
||||
// 班组人员表格数据
|
||||
teamList: [],
|
||||
teamTempList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
keyWord:undefined
|
||||
},
|
||||
// 查询参数
|
||||
queryTeam: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: undefined,
|
||||
sex: undefined,
|
||||
teamId: undefined,
|
||||
},
|
||||
|
||||
fileList:[],
|
||||
businessLicenseList:[],
|
||||
businessLicenseFileList:[],
|
||||
delBusinessFileIdList:[],
|
||||
//图片查看弹窗
|
||||
dialogImageUrl: '',
|
||||
dialogVisible: false,
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
|
||||
},
|
||||
|
||||
//上传
|
||||
upload: {
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: 'Bearer ' + getToken() },
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + '/file/upload'
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
||||
//图片上传1张后,隐藏上传框
|
||||
uploadDisabled() {
|
||||
return this.fileList.length > 0
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
//提交时循环fileList 获取raw文件
|
||||
getFileData() {
|
||||
const fileTwo = []
|
||||
this.businessLicenseList.forEach(item => {
|
||||
if (item?.hasOwnProperty('raw')) {
|
||||
fileTwo.push(item.raw)
|
||||
}
|
||||
})
|
||||
return { fileTwo }
|
||||
},
|
||||
|
||||
// 图片上传
|
||||
imgUpLoadTwo(param, name, index) {
|
||||
console.log(param, 'image')
|
||||
param.type = 'ma'
|
||||
imgUpLoadTwo(param)
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.imageUrl = res.data.fileUrl
|
||||
} else {
|
||||
// this.$msgError(res.msg)
|
||||
this.$modal.msgError(res.msg)
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
// this.$msgError(error)
|
||||
this.$modal.msgError(error)
|
||||
})
|
||||
},
|
||||
|
||||
//上传组件-图片查看
|
||||
picturePreview(file) {
|
||||
this.dialogImageUrl = file.url;
|
||||
const parts = file.name.split('.');
|
||||
const extension = parts.pop();
|
||||
if(extension === 'doc'||extension === 'docx'||extension === 'pdf'){
|
||||
const windowName = file.name;
|
||||
window.open(file.url,windowName)
|
||||
}else{
|
||||
this.dialogVisible = true
|
||||
}
|
||||
},
|
||||
handleRemoveElectricianImgList(file, fileList) {
|
||||
let sum = 0
|
||||
this.businessLicenseList.forEach((item, index) => {
|
||||
if (item.uid == file.uid) {
|
||||
sum = index
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
this.businessLicenseList.splice(sum, 1)
|
||||
},
|
||||
|
||||
isImage(file){
|
||||
this.urlTemp = require('@/assets/file.png');
|
||||
if(this.updataIf(file)){
|
||||
return false
|
||||
}else{
|
||||
return true
|
||||
}
|
||||
},
|
||||
// 判断文件类型,图片预览,文件下载
|
||||
updataIf(e) {
|
||||
if (e.fileName) {
|
||||
const parts = e.fileName.split('.');
|
||||
const extension = parts.pop();
|
||||
if (extension === 'png' || extension === 'jpeg' || extension === 'jpg') {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
} else {
|
||||
const parts = e.name.split('.');
|
||||
const extension = parts.pop();
|
||||
if (extension === 'png' || extension === 'jpeg' || extension === 'jpg') {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
handleChangeBusinessList(file, fileList) {
|
||||
const fileListTemp = fileList.filter(item => {
|
||||
return item.uid != file.uid
|
||||
});
|
||||
const parts = file.name.split('.');
|
||||
const extension = parts.pop();
|
||||
if(fileList.length > 3){
|
||||
this.$message.warning('最多上传3张营业执照')
|
||||
fileList = fileList.filter(item => {
|
||||
return item.uid != file.uid
|
||||
})
|
||||
}else if(!(extension === 'pdf' || extension === 'png' || extension === 'jpg' || extension === 'jpeg')){
|
||||
this.$message.warning('文件格式不正确')
|
||||
fileList = fileList.filter(item => {
|
||||
return item.uid != file.uid
|
||||
})
|
||||
}else if(file.size > 1024 * 1024 * 10){
|
||||
this.$message.warning('文件大小不能超过10Mb')
|
||||
fileList = fileList.filter(item => {
|
||||
return item.uid != file.uid
|
||||
})
|
||||
}else if(file.name.length > 40){
|
||||
this.$message.warning('文件名长度不能超过40个字符')
|
||||
fileList = fileList.filter(item => {
|
||||
return item.uid != file.uid
|
||||
})
|
||||
}else if(fileListTemp.some(item =>item.name === file.name)){
|
||||
this.$message.warning('文件名重复')
|
||||
fileList = fileList.filter(item => {
|
||||
return item.uid != file.uid
|
||||
})
|
||||
}
|
||||
fileList.forEach(file=>{
|
||||
if(extension === 'doc'||extension === 'docx'||extension === 'pdf'){
|
||||
this.urlTemp = require('../../../../assets/file.png');
|
||||
|
||||
}
|
||||
}),
|
||||
this.businessLicenseList = fileList;
|
||||
},
|
||||
|
||||
getList() {
|
||||
this.loading = true;
|
||||
getListFacturer(this.queryParams).then(response => {
|
||||
this.houseList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.showHouse = true
|
||||
this.title = '新增'
|
||||
},
|
||||
|
||||
handleUpdate(row){
|
||||
this.reset()
|
||||
const supplierId = row.supplierId
|
||||
getFacturerDetail(supplierId).then((response) => {
|
||||
this.form = response.data;
|
||||
|
||||
this.showHouse = true
|
||||
this.title = '修改'
|
||||
})
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.queryParams.keyWord=null;
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
//** 提交按钮 */
|
||||
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;
|
||||
this.getList();
|
||||
this.businessLicenseList=[];
|
||||
this.delBusinessFileIdList=[];
|
||||
});
|
||||
} 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)
|
||||
})
|
||||
})
|
||||
this.form.businessLicenseFileList=this.businessLicenseFileList
|
||||
addFacturer(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.showHouse = false;
|
||||
this.getList();
|
||||
this.businessLicenseList=[];
|
||||
this.delBusinessFileIdList=[];
|
||||
this.businessLicenseFileList=[];
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.showHouse = false;
|
||||
this.businessLicenseList=[];
|
||||
this.reset();
|
||||
},
|
||||
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const supplierId = row.supplierId
|
||||
this.$modal
|
||||
.confirm('是否确认删除数据项?')
|
||||
.then(function () {
|
||||
return delFacturer(supplierId)
|
||||
})
|
||||
.then(() => {
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
this.getList()
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
|
||||
handleExport() {
|
||||
this.download('/material/wh_house_info/export', {
|
||||
...this.queryParams
|
||||
}, `仓库管理_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.uploadImg {
|
||||
padding-top: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.deviceCode {
|
||||
margin-top: 10px;
|
||||
padding-bottom: 20px;
|
||||
font-size: 18px;
|
||||
}
|
||||
::v-deep.el-table .fixed-width .el-button--mini {
|
||||
width: 60px !important;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
//隐藏图片上传框的css
|
||||
::v-deep.disabled {
|
||||
.el-upload--picture-card {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
::v-deep .el-upload-list--picture-card{
|
||||
display: flex;
|
||||
}
|
||||
::v-deep .el-upload-list__item {
|
||||
margin-bottom: 20px;
|
||||
overflow: revert;
|
||||
}
|
||||
::v-deep .el-upload-list__item-actions{
|
||||
overflow:hidden;
|
||||
}
|
||||
.upload-demo{
|
||||
display: flex;
|
||||
}
|
||||
.el-upload-list__item-thumbnail{
|
||||
height: 145px!important;
|
||||
}
|
||||
.picture-card-container{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
}
|
||||
.picture-card{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit:cover;
|
||||
justify-content: center;
|
||||
// border: 1px solid #ddd;
|
||||
// border-radius: 4px;
|
||||
}
|
||||
.file-name{
|
||||
width: 90%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
position: absolute;
|
||||
bottom: -35px;
|
||||
margin-top: 8px;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
color:#333;
|
||||
z-index: 999999;
|
||||
}
|
||||
.file-overlay{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #fff;
|
||||
font-size: 20px;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue