|
@@ -31,9 +31,10 @@
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="shopName" label="所属供应商" align="center" />
|
|
<el-table-column prop="shopName" label="所属供应商" align="center" />
|
|
- <el-table-column label="操作" align="center" width="280px">
|
|
|
|
|
|
+ <el-table-column label="操作" align="center" width="320px">
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
<el-button type="primary" size="mini" @click="onChangeSupplier(row)">更换供应商</el-button>
|
|
<el-button type="primary" size="mini" @click="onChangeSupplier(row)">更换供应商</el-button>
|
|
|
|
+ <el-button type="primary" size="mini" @click="onTempEdit(row)">编辑</el-button>
|
|
<!-- 隐藏其一 -->
|
|
<!-- 隐藏其一 -->
|
|
<el-button v-if="row.status === 0" type="info" size="mini" @click="onTempStatusChange(row)">启用</el-button>
|
|
<el-button v-if="row.status === 0" type="info" size="mini" @click="onTempStatusChange(row)">启用</el-button>
|
|
<el-button v-else type="danger" size="mini" @click="onTempStatusChange(row)">停用</el-button>
|
|
<el-button v-else type="danger" size="mini" @click="onTempStatusChange(row)">停用</el-button>
|
|
@@ -45,16 +46,16 @@
|
|
<supplier-list @cancel="selectSupplierVisible = false" @confirm="onSupplierConfirm('edit', $event)" />
|
|
<supplier-list @cancel="selectSupplierVisible = false" @confirm="onSupplierConfirm('edit', $event)" />
|
|
</el-dialog>
|
|
</el-dialog>
|
|
<!-- 上传图片 -->
|
|
<!-- 上传图片 -->
|
|
- <el-dialog title="添加授权牌模板" :visible.sync="addCardVisible" width="40%" @close="onAddCardClose">
|
|
|
|
|
|
+ <el-dialog title="添加授权牌模板" :visible.sync="addCardVisible" width="40%" @closed="onAddCardClose">
|
|
<el-dialog width="66%" title="选择供应商" :visible.sync="addCardInnerVisible" append-to-body>
|
|
<el-dialog width="66%" title="选择供应商" :visible.sync="addCardInnerVisible" append-to-body>
|
|
<supplier-list @cancel="addCardInnerVisible = false" @confirm="onSupplierConfirm('add', $event)" />
|
|
<supplier-list @cancel="addCardInnerVisible = false" @confirm="onSupplierConfirm('add', $event)" />
|
|
</el-dialog>
|
|
</el-dialog>
|
|
<el-form ref="addCardForm" :model="formData" label-width="120px" :rules="rules">
|
|
<el-form ref="addCardForm" :model="formData" label-width="120px" :rules="rules">
|
|
- <el-form-item label="授权牌模板:" prop="image">
|
|
|
|
|
|
+ <el-form-item label="授权牌模板:" prop="templateImage">
|
|
<el-input v-show="false" v-model="formData.templateImage" />
|
|
<el-input v-show="false" v-model="formData.templateImage" />
|
|
<upload-image
|
|
<upload-image
|
|
:limit="1"
|
|
:limit="1"
|
|
- tip="建议尺寸:200px * 200px"
|
|
|
|
|
|
+ tip="建议尺寸:542px * 546px"
|
|
:image-list="tempList"
|
|
:image-list="tempList"
|
|
@success="uploadTempImageSuccess"
|
|
@success="uploadTempImageSuccess"
|
|
@remove="handleLogoImageRemove"
|
|
@remove="handleLogoImageRemove"
|
|
@@ -63,11 +64,14 @@
|
|
<el-form-item label="二维码位置:" prop="qrPosition">
|
|
<el-form-item label="二维码位置:" prop="qrPosition">
|
|
<el-input
|
|
<el-input
|
|
v-model="formData.qrPosition"
|
|
v-model="formData.qrPosition"
|
|
- placeholder="请输入二维码位置坐标,以英文逗号隔开,分别为二维码左上角X,Y轴坐标(例如100,100)"
|
|
|
|
|
|
+ placeholder="请输入二维码位置坐标,以英文逗号隔开,分别为二维码左上角X,Y轴坐标(例如:100,100)"
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="二维码大小:" prop="qrSize">
|
|
<el-form-item label="二维码大小:" prop="qrSize">
|
|
- <el-input v-model.number="formData.qrSize" placeholder="请输入二维码大小(例如:120)" />
|
|
|
|
|
|
+ <el-input v-model.number="formData.qrSize" placeholder="请输入二维码大小(例如:53)" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="LOGO大小:" prop="logoSize">
|
|
|
|
+ <el-input v-model="formData.logoSize" placeholder="请输入授权牌logo建议尺寸宽高(例如:212,98)" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="所属供应商:" prop="authUserId">
|
|
<el-form-item label="所属供应商:" prop="authUserId">
|
|
<el-input v-show="false" v-model="formData.authUserId" />
|
|
<el-input v-show="false" v-model="formData.authUserId" />
|
|
@@ -113,6 +117,14 @@ export default {
|
|
callback(new Error('二维码坐标格式不正确,请改为(X坐标,Y坐标) => (100,100)'))
|
|
callback(new Error('二维码坐标格式不正确,请改为(X坐标,Y坐标) => (100,100)'))
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ const validateLogoSize = (rule, value, callback) => {
|
|
|
|
+ if (!value) return callback()
|
|
|
|
+ if (value.split(',').length === 2) {
|
|
|
|
+ return callback()
|
|
|
|
+ }
|
|
|
|
+ callback(new Error('logo建议尺寸格式不正确,请改为(宽,高)格式'))
|
|
|
|
+ }
|
|
|
|
+
|
|
return {
|
|
return {
|
|
listLoading: false,
|
|
listLoading: false,
|
|
isLoading: false,
|
|
isLoading: false,
|
|
@@ -129,7 +141,8 @@ export default {
|
|
templateImage: '',
|
|
templateImage: '',
|
|
authUserId: '',
|
|
authUserId: '',
|
|
qrPosition: '',
|
|
qrPosition: '',
|
|
- qrSize: ''
|
|
|
|
|
|
+ qrSize: '',
|
|
|
|
+ logoSize: ''
|
|
},
|
|
},
|
|
addCardVisible: false,
|
|
addCardVisible: false,
|
|
addCardInnerVisible: false,
|
|
addCardInnerVisible: false,
|
|
@@ -143,7 +156,11 @@ export default {
|
|
templateImage: [{ required: true, message: '请上传授权牌模板', trigger: ['change'] }],
|
|
templateImage: [{ required: true, message: '请上传授权牌模板', trigger: ['change'] }],
|
|
authUserId: [{ required: true, message: '请选择供应商', trigger: ['change'] }],
|
|
authUserId: [{ required: true, message: '请选择供应商', trigger: ['change'] }],
|
|
qrPosition: [{ validator: validateQrPosition, trigger: ['blur'] }],
|
|
qrPosition: [{ validator: validateQrPosition, trigger: ['blur'] }],
|
|
- qrSize: [{ required: true, message: '请填写二维码大小', trigger: ['blur'] }]
|
|
|
|
|
|
+ qrSize: [{ required: true, message: '请填写二维码大小', trigger: ['blur'] }],
|
|
|
|
+ logoSize: [
|
|
|
|
+ { required: true, message: '请输入授权牌logo建议尺寸宽高', trigger: ['blur'] },
|
|
|
|
+ { validator: validateLogoSize, trigger: ['blur'] }
|
|
|
|
+ ]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -172,6 +189,20 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ // 编辑授权牌模板
|
|
|
|
+ onTempEdit(row) {
|
|
|
|
+ this.formData.templateId = row.templateId
|
|
|
|
+ this.formData.authUserId = row.authUserId
|
|
|
|
+ this.formData.qrPosition = row.qrPosition
|
|
|
|
+ this.formData.qrSize = row.qrSize
|
|
|
|
+ this.formData.logoSize = row.logoSize
|
|
|
|
+ this.formData.templateImage = row.templateImage
|
|
|
|
+ if (row.templateImage) {
|
|
|
|
+ this.tempList = [{ name: '授权牌模板', url: row.templateImage }]
|
|
|
|
+ }
|
|
|
|
+ this.addCardVisible = true
|
|
|
|
+ },
|
|
|
|
+
|
|
// 获取供应商列表
|
|
// 获取供应商列表
|
|
async fetchSupplierList() {
|
|
async fetchSupplierList() {
|
|
try {
|
|
try {
|
|
@@ -228,7 +259,11 @@ export default {
|
|
// 添加授权牌弹窗关闭
|
|
// 添加授权牌弹窗关闭
|
|
onAddCardClose() {
|
|
onAddCardClose() {
|
|
this.selectSupplier = null
|
|
this.selectSupplier = null
|
|
|
|
+ this.formData.templateId = ''
|
|
this.formData.authUserId = ''
|
|
this.formData.authUserId = ''
|
|
|
|
+ this.formData.qrPosition = ''
|
|
|
|
+ this.formData.qrSize = ''
|
|
|
|
+ this.formData.logoSize = ''
|
|
this.formData.templateImage = ''
|
|
this.formData.templateImage = ''
|
|
this.tempList = []
|
|
this.tempList = []
|
|
this.$refs.addCardForm?.clearValidate()
|
|
this.$refs.addCardForm?.clearValidate()
|
|
@@ -256,6 +291,7 @@ export default {
|
|
authUserId: '',
|
|
authUserId: '',
|
|
status: 1,
|
|
status: 1,
|
|
qrPosition: '',
|
|
qrPosition: '',
|
|
|
|
+ logoSize: '',
|
|
qrSize: ''
|
|
qrSize: ''
|
|
},
|
|
},
|
|
data
|
|
data
|