导入新产品,20.套餐编辑的时候,不能低于基准价,低于就提示不能保存
This commit is contained in:
@@ -9,6 +9,10 @@
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div v-if="$slots.extra" class="import-extra">
|
||||
<slot name="extra" />
|
||||
</div>
|
||||
|
||||
<!-- 上传拖拽区 -->
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
@@ -138,6 +142,14 @@ const props = defineProps({
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
extraQuery: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
beforeSubmit: {
|
||||
type: Function,
|
||||
default: null
|
||||
},
|
||||
// 确定按钮文字
|
||||
submitText: {
|
||||
type: String,
|
||||
@@ -157,7 +169,16 @@ const validateError = ref('')
|
||||
const headers = { Authorization: 'Bearer ' + getToken() }
|
||||
|
||||
const uploadUrl = computed(() => {
|
||||
return import.meta.env.VITE_APP_BASE_API + props.action + '?updateSupport=' + (updateSupport.value ? 1 : 0)
|
||||
const query = new URLSearchParams()
|
||||
query.set('updateSupport', updateSupport.value ? '1' : '0')
|
||||
const extra = props.extraQuery || {}
|
||||
Object.keys(extra).forEach(key => {
|
||||
const value = extra[key]
|
||||
if (value !== undefined && value !== null && value !== '') {
|
||||
query.set(key, value)
|
||||
}
|
||||
})
|
||||
return import.meta.env.VITE_APP_BASE_API + props.action + '?' + query.toString()
|
||||
})
|
||||
|
||||
const templateUrl = computed(() => !!props.templateAction)
|
||||
@@ -256,6 +277,13 @@ function handleSuccess(response) {
|
||||
|
||||
// 提交上传
|
||||
function handleSubmit() {
|
||||
if (typeof props.beforeSubmit === 'function') {
|
||||
const msg = props.beforeSubmit()
|
||||
if (msg) {
|
||||
proxy.$modal.msgError(msg)
|
||||
return
|
||||
}
|
||||
}
|
||||
const file = selectedFile.value
|
||||
const err = checkFile(file)
|
||||
if (err) {
|
||||
@@ -440,6 +468,10 @@ defineExpose({ open })
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.import-extra {
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.file-progress {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user