Merge branch 'dev-cq-bug' of http://192.168.0.56:3000/bonus/devicesmgt into dev-cq-bug
This commit is contained in:
commit
4cab68bba6
|
|
@ -2,13 +2,8 @@
|
|||
<div class="app-container" id="toolsSupplier">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="供应商名称" prop="supplier">
|
||||
<el-input
|
||||
v-model="queryParams.supplier"
|
||||
placeholder="请输入供应商名称"
|
||||
clearable maxlength="50"
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.supplier" placeholder="请输入供应商名称" clearable maxlength="50" style="width: 240px"
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
|
|
@ -19,13 +14,7 @@
|
|||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
>新增</el-button>
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
|
|
@ -50,24 +39,18 @@
|
|||
<!-- >删除</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-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="danger"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-refresh"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="handleRefreshCache"-->
|
||||
<!-- v-hasPermi="['store:labelType:remove']"-->
|
||||
<!-- >刷新缓存</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="danger"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-refresh"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="handleRefreshCache"-->
|
||||
<!-- v-hasPermi="['store:labelType:remove']"-->
|
||||
<!-- >刷新缓存</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</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="phone" :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">
|
||||
<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>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="状态" align="center" prop="status" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status">
|
||||
<el-switch v-model="scope.row.status">
|
||||
</el-switch>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
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>
|
||||
<el-button size="mini" 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>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination v-show="total > 0" :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-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<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 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 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 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 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 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 label="营业执照" prop="businessLicense">
|
||||
<el-upload
|
||||
:http-request="(obj) => imgUpLoad(obj,'fileUrl')"
|
||||
action="#"
|
||||
:file-list="fileList"
|
||||
:show-file-list="false"
|
||||
list-type="picture-card"
|
||||
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-upload :http-request="(obj) => imgUpLoad(obj, 'fileUrl')" action="#" :file-list="fileList"
|
||||
:show-file-list="false" list-type="picture-card" 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>
|
||||
|
|
@ -173,7 +134,7 @@
|
|||
|
||||
<script>
|
||||
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 {
|
||||
name: "ToolsSupplier",
|
||||
dicts: ['sys_normal_disable'],
|
||||
|
|
@ -209,21 +170,18 @@ export default {
|
|||
form: {},
|
||||
dialogImageUrl: '',
|
||||
dialogVisible: false,
|
||||
imageUrl:'',
|
||||
imageName:'',
|
||||
fileList:[],
|
||||
field101fileList:[],
|
||||
imageUrl: '',
|
||||
imageName: '',
|
||||
fileList: [],
|
||||
field101fileList: [],
|
||||
//上传地址
|
||||
// uploadUrl:'http://192.168.0.14:21624/system',//线上服务器地址+system
|
||||
// uploadUrl:'http://112.29.103.165:21624/system',//线上服务器地址+system
|
||||
uploadUrl: process.env.VUE_APP_BASE_API + "/system", // 上传的图片服务器地址
|
||||
// 表单校验
|
||||
rules: {
|
||||
dictName: [
|
||||
{ required: true, message: "字典名称不能为空", trigger: "blur" }
|
||||
],
|
||||
dictType: [
|
||||
{ required: true, message: "字典类型不能为空", trigger: "blur" }
|
||||
supplier: [
|
||||
{ required: true, message: "供应商名称不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
|
@ -236,10 +194,10 @@ export default {
|
|||
getList() {
|
||||
this.loading = true;
|
||||
listSupplierInfo(this.queryParams).then(response => {
|
||||
this.supplierList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
}
|
||||
this.supplierList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
}
|
||||
);
|
||||
},
|
||||
// 取消按钮
|
||||
|
|
@ -285,7 +243,7 @@ export default {
|
|||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.supplierId)
|
||||
this.single = selection.length!=1
|
||||
this.single = selection.length != 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
|
|
@ -300,7 +258,7 @@ export default {
|
|||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
submitForm: function () {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.supplierId != undefined) {
|
||||
|
|
@ -320,14 +278,14 @@ export default {
|
|||
});
|
||||
},
|
||||
// 图片上传
|
||||
imgUpLoad(param,name,index) {
|
||||
console.log(param,'image')
|
||||
imgUpLoad(param, name, index) {
|
||||
console.log(param, 'image')
|
||||
param.type = 'ma'
|
||||
imgUpLoad(param).then(res => {
|
||||
if(res.code == 200) {
|
||||
if (res.code == 200) {
|
||||
this.form.businessLicense = res.data.fileUrl;
|
||||
this.imageUrl = res.data.fileUrl;
|
||||
}else{
|
||||
} else {
|
||||
// this.$msgError(res.msg)
|
||||
this.$modal.msgError(res.msg);
|
||||
}
|
||||
|
|
@ -336,14 +294,14 @@ export default {
|
|||
this.$modal.msgError(error);
|
||||
})
|
||||
},
|
||||
handleAvatarSuccess(res,file) {
|
||||
handleAvatarSuccess(res, file) {
|
||||
console.log("success")
|
||||
// this.imageUrl = URL.createObjectURL(file.raw);
|
||||
// console.log(this.imageUrl)
|
||||
},
|
||||
// this.imageUrl = URL.createObjectURL(file.raw);
|
||||
// console.log(this.imageUrl)
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
console.log(file, fileList);
|
||||
console.log(this.form,'222222')
|
||||
console.log(this.form, '222222')
|
||||
this.form.businessLicense = "";
|
||||
},
|
||||
//图片点击查看
|
||||
|
|
@ -352,20 +310,20 @@ export default {
|
|||
this.dialogImageUrl = file.url;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
//图片查看
|
||||
openImg(url){
|
||||
//图片查看
|
||||
openImg(url) {
|
||||
this.dialogImageUrl = this.uploadUrl + url;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const supplierIds = row.supplierId || this.ids;
|
||||
this.$modal.confirm('是否确认删除该数据项?').then(function() {
|
||||
this.$modal.confirm('是否确认删除该数据项?').then(function () {
|
||||
return delSupplier(supplierIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}).catch(() => { });
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue