From 68defbe491894e01c4402922de33c39633fca091 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Tue, 29 Mar 2022 14:25:54 +0800
Subject: [PATCH] 系统名称
---
zq-erp/src/main/resources/templates/views/admin/shop/parameterSetting-form.html | 100 ++++++++++++++++++++++---------------------------
1 files changed, 45 insertions(+), 55 deletions(-)
diff --git a/zq-erp/src/main/resources/templates/views/admin/shop/parameterSetting-form.html b/zq-erp/src/main/resources/templates/views/admin/shop/parameterSetting-form.html
index c93a906..b076bcf 100644
--- a/zq-erp/src/main/resources/templates/views/admin/shop/parameterSetting-form.html
+++ b/zq-erp/src/main/resources/templates/views/admin/shop/parameterSetting-form.html
@@ -50,10 +50,10 @@
<label class="col-md-2 control-label">{{paramSetting.name}}</label>
<div class="col-md-8">
<el-radio-group v-model="paramSetting.userValue">
- <el-radio v-for="item in buttonType"
+ <el-radio v-for="item in buttonTypeTwo"
:key="item.value"
:label="item.displayName"
- :value="item.value"></el-radio>
+ :value="item.displayName"></el-radio>
</el-radio-group>
</div>
</div>
@@ -63,7 +63,7 @@
<div class="col-md-8">
<el-select v-model="paramSetting.userValue" placeholder="">
<el-option
- v-for="item in buttonType"
+ v-for="item in buttonTypeThree"
:key="item.value"
:label="item.displayName"
:value="item.displayName">
@@ -77,7 +77,7 @@
<div class="col-md-8">
<el-select v-model="paramSetting.userValue" multiple placeholder="请选择">
<el-option
- v-for="item in buttonType"
+ v-for="item in buttonTypeFour"
:key="item.value"
:label="item.displayName"
:value="item.displayName">
@@ -93,10 +93,11 @@
class="upload-demo"
action="/admin/multipleUploadFile/doUpload"
:on-preview="handlePreview"
+ :on-success="uploadSuccess"
:on-remove="handleRemove"
:before-remove="beforeRemove"
multiple
- :limit="3"
+ :limit="1"
:on-exceed="handleExceed"
:file-list="fileList">
<el-button size="small" type="primary">点击上传</el-button>
@@ -108,35 +109,13 @@
<div class="form-group" v-if="paramSetting.type==6">
<label class="col-md-2 control-label">{{paramSetting.name}}</label>
<div class="col-md-8">
- <el-upload action="/admin/multipleUploadFile/doUpload"
- list-type="picture-card"
- :auto-upload="false">
- <i slot="default" class="el-icon-plus"></i>
- <img v-if="paramSetting.userValue" :src="paramSetting.userValue" style="max-width: 300px;">
- <div slot="file" slot-scope="{file}">
- <img class="el-upload-list__item-thumbnail"
- :src="file.url" alt="" >
- <span class="el-upload-list__item-actions">
- <span class="el-upload-list__item-preview"
- @click="handlePictureCardPreview(file)" >
- <i class="el-icon-zoom-in"></i>
- </span>
-<!-- <span v-if="!disabled"-->
-<!-- class="el-upload-list__item-delete"-->
-<!-- @click="handleDownload(file)" >-->
-<!-- <i class="el-icon-download"></i>-->
-<!-- </span>-->
- <span v-if="!disabled"
- class="el-upload-list__item-delete"
- @click="handleRemove(file)" >
- <i class="el-icon-delete"></i>
- </span>
- </span>
- </div>
+ <el-upload
+ action="/admin/multipleUploadFile/doUpload"
+ :show-file-list="false"
+ :on-success="imageLineSuccess">
+ <img v-if="imageLine" :src="imageLine" style="max-width: 300px;">
+ <el-button size="small" type="primary">点击上传</el-button>
</el-upload>
- <el-dialog :visible.sync="dialogVisible">
- <img width="100%" :src="dialogImageUrl" alt="">
- </el-dialog>
</div>
</div>
@@ -168,10 +147,6 @@
var app = new Vue({
el: '#app',
data: {
- dialogImageUrl: '',
- dialogVisible: false,
- disabled: false,
-
form: {
warehouseId: '',
shopId: '',
@@ -181,9 +156,13 @@
warehouses: [],
shops: [],
categoryList: [],
- buttonType:[],
+ buttonTypeThree:[],
+ buttonTypeFour:[],
+ buttonTypeTwo:[],
fileList:[],
codeName:'',
+ imageLine:'',
+ type:2,
},
created: function () {
this.loadInfo();
@@ -215,7 +194,7 @@
},
//获取枚举列表
- loadEnum(codeName){
+ loadEnum(codeName,type){
let _this = this;
//获取枚举列表
AjaxProxy.requst({
@@ -223,7 +202,13 @@
url: basePath + '/common/data/getEnums',
data:{"enumCodes":[_this.codeName]},
callback: function (data) {
- _this.buttonType = data.data[''+_this.codeName+''];
+ if(_this.type === 3){
+ _this.buttonTypeThree = data.data[''+_this.codeName+''];
+ }else if(_this.type === 4){
+ _this.buttonTypeFour = data.data[''+_this.codeName+''];
+ }else if(_this.type === 2){
+ _this.buttonTypeTwo = data.data[''+_this.codeName+''];
+ }
}
});
},
@@ -246,26 +231,36 @@
for (let i = 0; i < paramSettings.length; i++) {
if (paramSettings[i].type === 2) {
if(paramSettings[i].value != null && paramSettings[i].value != ''){
+ if(paramSettings[i].userValue === '1'){
+ paramSettings[i].userValue = '是';
+ }else if(paramSettings[i].userValue === '2'){
+ paramSettings[i].userValue = '否';
+ }
_this.codeName = paramSettings[i].value;
- _this.loadEnum(_this.codeName);
+ _this.type = paramSettings[i].type;
+ _this.loadEnum(_this.codeName,_this.type);
}
}else if(paramSettings[i].type === 3){
if(paramSettings[i].value != null && paramSettings[i].value != ''){
_this.codeName = paramSettings[i].value;
- _this.loadEnum(_this.codeName);
+ _this.type = paramSettings[i].type;
+ _this.loadEnum(_this.codeName,_this.type);
}
}else if(paramSettings[i].type === 4){
if(paramSettings[i].value != null && paramSettings[i].value != ''){
//下拉框回显
paramSettings[i].userValue = paramSettings[i].userValue.split(',');
_this.codeName = paramSettings[i].value;
- _this.loadEnum(_this.codeName);
+ _this.type = paramSettings[i].type;
+ _this.loadEnum(_this.codeName,_this.type);
}
}else if(paramSettings[i].type === 5){
if(paramSettings[i].value != null && paramSettings[i].value != ''){
+ alert(paramSettings[i].userValue+"----类型");
+ _this.fileList.push(paramSettings[i].userValue);
}
}else if(paramSettings[i].type === 6){
- _this.file.push(paramSettings[i].userValue);
+ _this.imageLine = paramSettings[i].userValue;
}
}
_this.paramSettings = paramSettings;
@@ -281,20 +276,16 @@
console.log(file);
},
handleExceed(files, fileList) {
- this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
+ this.$message.warning(`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${ file.name }?`);
},
- handleRemove(file) {
- console.log(file);
+ uploadSuccess(res, file) {
+ this.imageLine = res.path;
},
- handlePictureCardPreview(file) {
- this.dialogImageUrl = file.url;
- this.dialogVisible = true;
- },
- handleDownload(file) {
- console.log(file);
+ imageLineSuccess(res, file) {
+ this.imageLine = res.path;
},
submit() {
@@ -310,8 +301,7 @@
}
if (paramSetting.type == 6) {
- userValue = _this.dialogImageUrl;
- alert(_this.dialogImageUrl);
+ userValue = _this.imageLine;
}
let obj = {
code: paramSetting.code,
--
Gitblit v1.9.1