|
@@ -0,0 +1,191 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <a-modal class="modalBox" title="默认方案设置" v-model="isshow" @cancle="cancel" :width="600">
|
|
|
+ <a-form :form="form" ref="form" @submit="handleSubmit">
|
|
|
+ <a-row :gutter="24">
|
|
|
+ <a-col :span="20">
|
|
|
+ <!-- 视频巡店默认方案 -->
|
|
|
+ <a-form-item label="视频巡店默认方案:" :label-col="{ span: 7 }" :wrapper-col="{ span: 16 }">
|
|
|
+ <v-select
|
|
|
+ ref="orgType"
|
|
|
+ allowClear
|
|
|
+ @change="scopeTypeChange"
|
|
|
+ v-decorator="[
|
|
|
+ 'formData.scopeType',
|
|
|
+ { initialValue: formData.scopeType,
|
|
|
+ rules: [{ required: true, message: '请选择视频巡店默认方案!' }] },
|
|
|
+ ]"
|
|
|
+ code="STORE_AUTH_TYPE"></v-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ <a-row :gutter="24">
|
|
|
+ <a-col :span="20">
|
|
|
+ <!-- 现场巡店默认方案 -->
|
|
|
+ <a-form-item label="现场巡店默认方案:" :label-col="{ span: 7 }" :wrapper-col="{ span: 16 }">
|
|
|
+ <v-select
|
|
|
+ ref="orgType"
|
|
|
+ allowClear
|
|
|
+ @change="scopeTypeChange"
|
|
|
+ v-decorator="[
|
|
|
+ 'formData.scopeType',
|
|
|
+ { initialValue: formData.scopeType,
|
|
|
+ rules: [{ required: true, message: '请选择现场巡店默认方案!' }] },
|
|
|
+ ]"
|
|
|
+ code="STORE_AUTH_TYPE"></v-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ <a-form-item :wrapper-col="{ span: 24, offset: 10 }">
|
|
|
+ <a-button type="primary" @click="handleSubmit()">
|
|
|
+ 确定
|
|
|
+ </a-button>
|
|
|
+ <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
|
|
|
+ 取消
|
|
|
+ </a-button>
|
|
|
+ </a-form-item>
|
|
|
+ </a-form>
|
|
|
+
|
|
|
+ </a-modal>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {
|
|
|
+ STable,
|
|
|
+ VSelect
|
|
|
+} from '@/components'
|
|
|
+import {
|
|
|
+ saveAuth
|
|
|
+} from '@/api/tenants.js'
|
|
|
+export default {
|
|
|
+ name: 'AddEvaModal',
|
|
|
+ components: {
|
|
|
+ STable,
|
|
|
+ VSelect
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ visible: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
+ // 要编辑的方案id
|
|
|
+ itemId: {
|
|
|
+ type: [String, Number],
|
|
|
+ default: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ visible (newValue, oldValue) {
|
|
|
+ this.isshow = newValue
|
|
|
+ },
|
|
|
+ isshow (newValue, oldValue) {
|
|
|
+ if (newValue) {
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.cancel()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ isshow: this.visible, // 弹框显示隐藏
|
|
|
+ form: this.$form.createForm(this, {
|
|
|
+ name: 'AddEvaModal'
|
|
|
+ }),
|
|
|
+ formData: {
|
|
|
+ name: '', // 方案名称
|
|
|
+ scopeType: [], // 适用类型
|
|
|
+ remarks: '' // 方案说明
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 点击弹框x号触发事件
|
|
|
+ cancel (e) {
|
|
|
+ this.clear()
|
|
|
+ this.$emit('close')
|
|
|
+ },
|
|
|
+ // 使用权限改变
|
|
|
+ scopeTypeChange (v) {
|
|
|
+ this.formData.scopeType = v
|
|
|
+ },
|
|
|
+ // 保存提交
|
|
|
+ handleSubmit () {
|
|
|
+ const _this = this
|
|
|
+ this.form.validateFields((err, values) => {
|
|
|
+ if (!err) {
|
|
|
+ console.log(values.formData, ' formData.type222222222')
|
|
|
+ // const params = Object.assign({
|
|
|
+ // id: this.itemData.id
|
|
|
+ // }, values.formData)
|
|
|
+ // params.expireDate = moment(params.expireDate).format('YYYY-MM-DD')
|
|
|
+ // console.log(params, 'ppppppppppppp')
|
|
|
+ // saveAuth(params).then(res => {
|
|
|
+ // console.log(res, 'res--save')
|
|
|
+ // if (res.status + '' === '200') {
|
|
|
+ // this.$message.success(res.message ? res.message : '保存成功')
|
|
|
+ // this.$emit('refresh')
|
|
|
+ // setTimeout(function () {
|
|
|
+ // _this.cancel()
|
|
|
+ // }, 300)
|
|
|
+ // } else {
|
|
|
+ // // this.$message.warning(res.message)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 取消
|
|
|
+ handleCancel () {
|
|
|
+ const _this = this
|
|
|
+ this.$confirm({
|
|
|
+ title: '提示',
|
|
|
+ content: '确定取消吗?',
|
|
|
+ okText: '确定',
|
|
|
+ cancelText: '取消',
|
|
|
+ onOk () {
|
|
|
+ _this.clear()
|
|
|
+ _this.cancel()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ clear () {
|
|
|
+ this.form.resetFields()
|
|
|
+ // 重置时 下拉框不起作用,对下拉框单独设置
|
|
|
+ this.form.setFields({ 'formData.scopeType': { value: [], errors: '' } })
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ beforeCreate () {
|
|
|
+ this.form = this.$form.createForm(this, {
|
|
|
+ name: 'AddEvaModal'
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+ .modalBox {}
|
|
|
+
|
|
|
+ .ant-modal-footer {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .time-text {
|
|
|
+ color: #1890FF;
|
|
|
+ padding: 0px 20px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+
|
|
|
+ .labelT {
|
|
|
+ position: absolute;
|
|
|
+ left: -135px;
|
|
|
+ top: 20px;
|
|
|
+ color: rgba(0, 0, 0, 0.85);
|
|
|
+ }
|
|
|
+</style>
|