| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <template>
- <el-card shadow="never" style="border: 0;">
- <yun-form
- ref="yunform"
- @render="onFormRender"
- @submit="onSubmit"
- @success="onSuccess"
- @fail="onFail"
- :data="row"
- :columns="columns">
- {:token_field()}
- </yun-form>
- </el-card>
- </template>
- <script>
- import form from "@components/Form.js";
- export default{
- components:{'YunForm':form},
- data:{
- row:Yunqi.data.row,
- columns:[
- {field: 'id',title: __('ID'),edit:'hidden'},
- {field: 'name',title: __('姓名'),edit:'text',rules:'required'},
- {field: 'phone',title: __('手机'),edit:'text',rules:'mobile'},
- {field: 'password',title: __('密码'),edit:'text',rules:'required;length(6, 20)'},
- {field: 'account_term', title: __('账期'), edit: {form:'radio',change:'changeType'},rules:"required",searchList: {1: __('日结'), 2: __('周结'), 3: __('半月结')}},
- {field: 'cycle', title: __('周结日期'), visible: false, edit: 'radio',searchList: {1: __('周一'), 2: __('周二'), 3: __('周三'),4: __('周四'), 5: __('周五'), 6: __('周六'), 7: __('周日')}},
- {field: 'remark',title: __('备注'),edit:'textarea'},
- {field: 'status', title: __('状态'), edit:'switch',searchList: {1: __('正常'),2: __('隐藏')}},
- ]
- },
- methods: {
- changeType:function(data,row){
- if(data == 2){
- this.$refs.yunform.showField("cycle")//为表单项设置值
- }else{
- this.$refs.yunform.hideField('cycle');//为表单项设置值
- }
- },
- },
-
- }
- </script>
- <style>
- </style>
|