| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <template id="apply-edit">
- <el-dialog :visible.sync="edit.visible" width="20%" title="分销商审核">
- <div>
- <el-form @submit.native.prevent size="small" label-width="150px">
- <el-form-item label="审核状态" prop="status">
- <el-radio-group v-model="status">
- <el-radio :label="1">通过</el-radio>
- <el-radio :label="2">不通过</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-form>
- <el-form @submit.native.prevent size="small" label-width="150px">
- <el-form-item label="审核备注" prop="marks">
- <el-input type="textarea"
- :rows="4"
- placeholder="备注"
- v-model="marks">
- </el-input>
- </el-form-item>
- </el-form>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="editCancel" type="default" size="small">取消</el-button>
- <el-button type="primary" :loading="edit.btnLoading" style="margin-bottom: 10px;" size="small"
- @click="editSave">保存</el-button>
- </span>
- </el-dialog>
- </template>
- <script>
- Vue.component('apply-edit', {
- template: '#apply-edit',
- props: {
- value: {
- type: Boolean,
- default: false,
- },
- row: {
- type: Object,
- default: null,
- },
- },
- data() {
- return {
- edit: {
- visible: false,
- keyword: '',
- nickname: '',
- id: '',
- btnLoading: false,
- },
- status:'',
- marks:'',
- user_id: 0,
- apply_id:0,
- props: {
- value: 'id',
- label: 'name',
- children: 'list'
- },
- }
- },
- watch: {
- value() {
- if (this.value) {
- this.user_id = this.row.user_id;
- this.apply_id = this.row.id;
- this.edit.visible = true;
- }
- },
- 'edit.visible'() {
- if (!this.edit.visible) {
- this.editCancel();
- }
- }
- },
- created() {
-
- },
- methods: {
- editCancel() {
- this.$emit('input', false);
- navigateTo({
- r: 'circle-distribution/audit/apply',
- })
- },
- editSave() {
- this.edit.btnLoading = true;
- if (this.user_id == 0) {
- this.$message.error('请确定用户信息');
- return;
- }
- if (!this.status) {
- this.$message.error('请选择是否审核通过');
- return false;
- }
- request({
- params: {
- r: 'circle-distribution/audit/edit',
- },
- method: 'post',
- data: {
- id: this.user_id,
- level: this.level,
- apply_id:this.apply_id,
- apply_marks:this.marks,
- apply_status:this.status
- }
- }).then(response => {
- this.edit.btnLoading = false;
- if (response.data.code == 0) {
- this.$message.success('添加成功');
- this.editCancel();
- } else {
- this.$message.error(response.data.msg);
- }
- }).catch(response => {
- this.edit.btnLoading = false;
- });
- }
- }
- });
- </script>
|