fix:新增供应商必填校验添加
This commit is contained in:
parent
82f8e5bb6c
commit
7737e18910
|
|
@ -2,13 +2,8 @@
|
||||||
<div class="app-container" id="toolsSupplier">
|
<div class="app-container" id="toolsSupplier">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||||
<el-form-item label="供应商名称" prop="supplier">
|
<el-form-item label="供应商名称" prop="supplier">
|
||||||
<el-input
|
<el-input v-model="queryParams.supplier" placeholder="请输入供应商名称" clearable maxlength="50" style="width: 240px"
|
||||||
v-model="queryParams.supplier"
|
@keyup.enter.native="handleQuery" />
|
||||||
placeholder="请输入供应商名称"
|
|
||||||
clearable maxlength="50"
|
|
||||||
style="width: 240px"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
|
|
@ -19,13 +14,7 @@
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleAdd"
|
|
||||||
>新增</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- <el-col :span="1.5">-->
|
<!-- <el-col :span="1.5">-->
|
||||||
<!-- <el-button-->
|
<!-- <el-button-->
|
||||||
|
|
@ -50,24 +39,18 @@
|
||||||
<!-- >删除</el-button>-->
|
<!-- >删除</el-button>-->
|
||||||
<!-- </el-col>-->
|
<!-- </el-col>-->
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
@click="handleExport"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- <el-col :span="1.5">-->
|
<!-- <el-col :span="1.5">-->
|
||||||
<!-- <el-button-->
|
<!-- <el-button-->
|
||||||
<!-- type="danger"-->
|
<!-- type="danger"-->
|
||||||
<!-- plain-->
|
<!-- plain-->
|
||||||
<!-- icon="el-icon-refresh"-->
|
<!-- icon="el-icon-refresh"-->
|
||||||
<!-- size="mini"-->
|
<!-- size="mini"-->
|
||||||
<!-- @click="handleRefreshCache"-->
|
<!-- @click="handleRefreshCache"-->
|
||||||
<!-- v-hasPermi="['store:labelType:remove']"-->
|
<!-- v-hasPermi="['store:labelType:remove']"-->
|
||||||
<!-- >刷新缓存</el-button>-->
|
<!-- >刷新缓存</el-button>-->
|
||||||
<!-- </el-col>-->
|
<!-- </el-col>-->
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
|
@ -80,81 +63,59 @@
|
||||||
<el-table-column label="主要联系人" align="center" prop="primaryContact" :show-overflow-tooltip="true" />
|
<el-table-column label="主要联系人" align="center" prop="primaryContact" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="联系电话" align="center" prop="phone" :show-overflow-tooltip="true" />
|
<el-table-column label="联系电话" align="center" prop="phone" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="主要经营范围" align="center" prop="businessScope" :show-overflow-tooltip="true" />
|
<el-table-column label="主要经营范围" align="center" prop="businessScope" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="营业执照" align="center" prop="businessLicense" :show-overflow-tooltip="true" >
|
<el-table-column label="营业执照" align="center" prop="businessLicense" :show-overflow-tooltip="true">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="scope.row.businessLicense" @click="openImg(scope.row.businessLicense)" style="color: #02A7F0;"> 查看 </span>
|
<span v-if="scope.row.businessLicense" @click="openImg(scope.row.businessLicense)" style="color: #02A7F0;"> 查看
|
||||||
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="状态" align="center" prop="status" width="180">
|
<el-table-column label="状态" align="center" prop="status" width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-switch
|
<el-switch v-model="scope.row.status">
|
||||||
v-model="scope.row.status">
|
|
||||||
</el-switch>
|
</el-switch>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button size="mini" type="primary" icon="el-icon-edit" @click="handleUpdate(scope.row)">编辑</el-button>
|
||||||
size="mini"
|
<el-button size="mini" type="danger" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||||
type="primary"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
@click="handleUpdate(scope.row)"
|
|
||||||
>编辑</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="danger"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
>删除</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||||
v-show="total>0"
|
@pagination="getList" />
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 添加或修改参数配置对话框 -->
|
<!-- 添加或修改参数配置对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body :close-on-click-modal="false">
|
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body :close-on-click-modal="false">
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||||
<el-form-item label="供应商名称" prop="supplier">
|
<el-form-item label="供应商名称" prop="supplier">
|
||||||
<el-input v-model="form.supplier" placeholder="请输入供应商名称" maxlength="50"/>
|
<el-input v-model="form.supplier" placeholder="请输入供应商名称" maxlength="50" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="供应商地址" prop="address">
|
<el-form-item label="供应商地址" prop="address">
|
||||||
<el-input v-model="form.address" placeholder="请输入供应商地址" maxlength="50"/>
|
<el-input v-model="form.address" placeholder="请输入供应商地址" maxlength="50" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="法人代表" prop="legalPerson">
|
<el-form-item label="法人代表" prop="legalPerson">
|
||||||
<el-input v-model="form.legalPerson" placeholder="请输入法人代表" maxlength="50"/>
|
<el-input v-model="form.legalPerson" placeholder="请输入法人代表" maxlength="50" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="主要联系人" prop="primaryContact">
|
<el-form-item label="主要联系人" prop="primaryContact">
|
||||||
<el-input v-model="form.primaryContact" placeholder="请输入主要联系人" maxlength="50"/>
|
<el-input v-model="form.primaryContact" placeholder="请输入主要联系人" maxlength="50" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="联系电话" prop="phone">
|
<el-form-item label="联系电话" prop="phone">
|
||||||
<el-input v-model="form.phone" placeholder="请输入联系电话" maxlength="11"/>
|
<el-input v-model="form.phone" placeholder="请输入联系电话" maxlength="11" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="经营范围" prop="businessScope">
|
<el-form-item label="经营范围" prop="businessScope">
|
||||||
<el-input v-model="form.businessScope" placeholder="请输入经营范围" maxlength="50"/>
|
<el-input v-model="form.businessScope" placeholder="请输入经营范围" maxlength="50" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="营业执照" prop="businessLicense">
|
<el-form-item label="营业执照" prop="businessLicense">
|
||||||
<el-upload
|
<el-upload :http-request="(obj) => imgUpLoad(obj, 'fileUrl')" action="#" :file-list="fileList"
|
||||||
:http-request="(obj) => imgUpLoad(obj,'fileUrl')"
|
:show-file-list="false" list-type="picture-card" accept=".png,.jpg,.jpeg" :on-success="handleAvatarSuccess"
|
||||||
action="#"
|
:on-preview="handlePictureCardPreview" :on-remove="handleRemove">
|
||||||
:file-list="fileList"
|
<img v-if="imageUrl" :src="uploadUrl + imageUrl" style="width: 140px;height: 140px;" class="avatar">
|
||||||
:show-file-list="false"
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||||
list-type="picture-card"
|
</el-upload>
|
||||||
accept=".png,.jpg,.jpeg"
|
|
||||||
:on-success="handleAvatarSuccess"
|
|
||||||
:on-preview="handlePictureCardPreview"
|
|
||||||
:on-remove="handleRemove">
|
|
||||||
<img v-if="imageUrl" :src="uploadUrl+imageUrl" style="width: 140px;height: 140px;" class="avatar">
|
|
||||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
||||||
</el-upload>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
@ -173,7 +134,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listSupplierInfo, getSupplierInfo, addSupplier, updateSupplier, delSupplier } from "@/api/store/tools";
|
import { listSupplierInfo, getSupplierInfo, addSupplier, updateSupplier, delSupplier } from "@/api/store/tools";
|
||||||
import { imgUpLoad,fileUpLoad } from "@/api/system/upload";
|
import { imgUpLoad, fileUpLoad } from "@/api/system/upload";
|
||||||
export default {
|
export default {
|
||||||
name: "ToolsSupplier",
|
name: "ToolsSupplier",
|
||||||
dicts: ['sys_normal_disable'],
|
dicts: ['sys_normal_disable'],
|
||||||
|
|
@ -209,21 +170,18 @@ export default {
|
||||||
form: {},
|
form: {},
|
||||||
dialogImageUrl: '',
|
dialogImageUrl: '',
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
imageUrl:'',
|
imageUrl: '',
|
||||||
imageName:'',
|
imageName: '',
|
||||||
fileList:[],
|
fileList: [],
|
||||||
field101fileList:[],
|
field101fileList: [],
|
||||||
//上传地址
|
//上传地址
|
||||||
// uploadUrl:'http://192.168.0.14:21624/system',//线上服务器地址+system
|
// uploadUrl:'http://192.168.0.14:21624/system',//线上服务器地址+system
|
||||||
// uploadUrl:'http://112.29.103.165:21624/system',//线上服务器地址+system
|
// uploadUrl:'http://112.29.103.165:21624/system',//线上服务器地址+system
|
||||||
uploadUrl: process.env.VUE_APP_BASE_API + "/system", // 上传的图片服务器地址
|
uploadUrl: process.env.VUE_APP_BASE_API + "/system", // 上传的图片服务器地址
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
dictName: [
|
supplier: [
|
||||||
{ required: true, message: "字典名称不能为空", trigger: "blur" }
|
{ required: true, message: "供应商名称不能为空", trigger: "blur" }
|
||||||
],
|
|
||||||
dictType: [
|
|
||||||
{ required: true, message: "字典类型不能为空", trigger: "blur" }
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -236,10 +194,10 @@ export default {
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listSupplierInfo(this.queryParams).then(response => {
|
listSupplierInfo(this.queryParams).then(response => {
|
||||||
this.supplierList = response.rows;
|
this.supplierList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
|
|
@ -285,7 +243,7 @@ export default {
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.supplierId)
|
this.ids = selection.map(item => item.supplierId)
|
||||||
this.single = selection.length!=1
|
this.single = selection.length != 1
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
|
|
@ -300,7 +258,7 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm: function() {
|
submitForm: function () {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.supplierId != undefined) {
|
if (this.form.supplierId != undefined) {
|
||||||
|
|
@ -320,14 +278,14 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 图片上传
|
// 图片上传
|
||||||
imgUpLoad(param,name,index) {
|
imgUpLoad(param, name, index) {
|
||||||
console.log(param,'image')
|
console.log(param, 'image')
|
||||||
param.type = 'ma'
|
param.type = 'ma'
|
||||||
imgUpLoad(param).then(res => {
|
imgUpLoad(param).then(res => {
|
||||||
if(res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.form.businessLicense = res.data.fileUrl;
|
this.form.businessLicense = res.data.fileUrl;
|
||||||
this.imageUrl = res.data.fileUrl;
|
this.imageUrl = res.data.fileUrl;
|
||||||
}else{
|
} else {
|
||||||
// this.$msgError(res.msg)
|
// this.$msgError(res.msg)
|
||||||
this.$modal.msgError(res.msg);
|
this.$modal.msgError(res.msg);
|
||||||
}
|
}
|
||||||
|
|
@ -336,14 +294,14 @@ export default {
|
||||||
this.$modal.msgError(error);
|
this.$modal.msgError(error);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleAvatarSuccess(res,file) {
|
handleAvatarSuccess(res, file) {
|
||||||
console.log("success")
|
console.log("success")
|
||||||
// this.imageUrl = URL.createObjectURL(file.raw);
|
// this.imageUrl = URL.createObjectURL(file.raw);
|
||||||
// console.log(this.imageUrl)
|
// console.log(this.imageUrl)
|
||||||
},
|
},
|
||||||
handleRemove(file, fileList) {
|
handleRemove(file, fileList) {
|
||||||
console.log(file, fileList);
|
console.log(file, fileList);
|
||||||
console.log(this.form,'222222')
|
console.log(this.form, '222222')
|
||||||
this.form.businessLicense = "";
|
this.form.businessLicense = "";
|
||||||
},
|
},
|
||||||
//图片点击查看
|
//图片点击查看
|
||||||
|
|
@ -352,20 +310,20 @@ export default {
|
||||||
this.dialogImageUrl = file.url;
|
this.dialogImageUrl = file.url;
|
||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
},
|
},
|
||||||
//图片查看
|
//图片查看
|
||||||
openImg(url){
|
openImg(url) {
|
||||||
this.dialogImageUrl = this.uploadUrl + url;
|
this.dialogImageUrl = this.uploadUrl + url;
|
||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const supplierIds = row.supplierId || this.ids;
|
const supplierIds = row.supplierId || this.ids;
|
||||||
this.$modal.confirm('是否确认删除该数据项?').then(function() {
|
this.$modal.confirm('是否确认删除该数据项?').then(function () {
|
||||||
return delSupplier(supplierIds);
|
return delSupplier(supplierIds);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {});
|
}).catch(() => { });
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue