123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <template>
- <div>
- <div class="my-title">订单金额屏蔽设置</div>
- <!-- 表单 -->
- <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
- <el-row class="my-row">
- <el-form-item label="屏蔽人" prop="userIds">
- <user-components v-model="dataForm.userIds" :userIds.sync="dataForm.userIds" @change="userSelectedChanged"/>
- </el-form-item>
- </el-row>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="onChose">取消</el-button>
- <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
- </span>
- </div>
- </template>
- <script>
- import UserComponents from '../common/user-components'
- export default {
- name: 'order-amount-mask-setting',
- components: {
- UserComponents
- },
- data () {
- return {
- visible: false,
- dataForm: {
- userIds: []
- },
- dataRule: {
- userIds: [{ required: true, message: '请选择需屏蔽的人', trigger: 'change' }]
- }
- }
- },
- methods: {
- onChose () {
- this.$emit('onChose')
- },
- async init () {
- this.dataForm = {}
- this.$http({
- url: this.$http.adornUrl(`/biz-service/order/priceConfig`),
- method: 'get'
- }).then(({data}) => {
- if (data && data.code === '200') {
- this.dataForm = {
- userIds: data.data
- }
- }
- })
- this.visible = true
- },
- validateField (type) {
- this.$refs.dataForm.validateField(type)
- },
- // 表单提交
- dataFormSubmit () {
- this.$refs['dataForm'].validate((valid) => {
- if (valid) {
- this.$http({
- url: this.$http.adornUrl(`/biz-service/order/priceConfig`),
- method: 'post',
- data: this.dataForm.userIds
- }).then(({data}) => {
- if (data && data.code === '200') {
- this.$message({
- message: '操作成功',
- type: 'success',
- duration: 1500,
- onClose: () => {
- this.onChose()
- }
- })
- } else {
- this.$message.error(data.msg)
- }
- })
- }
- })
- },
- userSelectedChanged (val) {
- this.dataForm.userIds = val
- }
- }
- }
- </script>
- <style scoped>
- </style>
|