| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251 |
- <template>
- <el-dialog
- title="协会管理"
- :visible.sync="dialogVisible"
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- @close="handleClose"
- width="600px"
- >
- <el-form
- ref="baseForm"
- class="base-form"
- label-position="right"
- label-width="95px"
- :model="baseForm"
- :rules="rules"
- size="small"
- >
- <el-row :gutter="10">
- <el-col :span="24">
- <el-form-item label="协会名称:" prop="productName">
- <el-row :gutter="5">
- <el-col :span="23">
- <el-input
- type="input"
- :autosize="{ minRows: 2}"
- placeholder="请输入协会名称"
- v-model="textarea">
- </el-input>
- </el-col>
- </el-row>
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item label="管辖范围:" prop="sourceinfoId">
- <el-row :gutter="5">
- <el-col :span="23">
- <el-select
- v-model="baseForm.sourceinfoId"
- filterable
- style="width: 100%"
- placeholder="请选择管辖范围"
- >
- <el-option
- v-for="item in syinfoList"
- :key="item.id"
- :label="item.sourceinfoName"
- :value="item.sourceinfoId"
- >
- </el-option>
- </el-select>
- <div class="areatText" type="">
- <el-tag closable>
- 标签一
- </el-tag>
- <el-tag closable>
- 标签一
- </el-tag>
- <el-tag closable>
- 标签一
- </el-tag>
- </div>
- </el-col>
- </el-row>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="10">
- <el-col :span="14">
- <el-form-item label="负责人:" prop="stockAmount">
- <el-row :gutter="5">
- <el-col :span="23">
- <el-select
- v-model="baseForm.sourceinfoId"
- filterable
- style="width: 100%"
- placeholder="请选择负责人"
- >
- <el-option
- v-for="item in syinfoList"
- :key="item.id"
- :label="item.sourceinfoName"
- :value="item.sourceinfoId"
- >
- </el-option>
- </el-select>
- </el-col>
- </el-row>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="10">
- <el-col :span="24">
- <el-form-item label="协会介绍:" prop="supplierId">
- <el-row :gutter="5">
- <el-col :span="23">
- <el-input
- type="textarea"
- :autosize="{ minRows: 4}"
- placeholder="请输入协会介绍"
- maxlength="500"
- show-word-limit
- v-model="textarea" />
- </el-col>
- </el-row>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div style="text-align: right">
- <el-button type="info" plain @click="resetForm('baseForm')"
- >取消</el-button
- >
- <el-button
- type="primary"
- style="margin-left:16px;"
- @click="submitForm('baseForm')"
- :disabled="dialogSubmitLoading"
- :loading="dialogSubmitLoading"
- >确定</el-button
- >
- </div>
- </el-dialog>
- </template>
- <script>
- import { assign } from 'lodash-es';
- import { UPLOAD_TYPE_MAP } from '@/utils/constants';
- export default {
- name:'associationManage',
- props: {
- data: {
- default() {
- return {};
- }
- },
- visible: {
- type: Boolean,
- default: false
- }
- },
- data() {
- return {
- imageUploadType: UPLOAD_TYPE_MAP.FARMING_RECORD,
- dialogSubmitLoading: false,
- dialogVisible: false,
- textareaArea: '',
- baseForm: {
- productValue: '',
- productName: '',
- stockAmount: '',
- goodsUnit: '',
- goodsSpecValue: '',
- imageArr1: [],
- supplierId: '',
- imageArr2: []
- },
- productList: [],
- syinfoList: [],
- processList: [],
- hasFetched: false,
- landList: [], //基地列表
- rules: {
- stockAmount: [
- { required: true, message: '请选择负责人', trigger: 'blur' }
- ],
- sourceinfoId: [
- { required: true, message: '请选择管辖范围', trigger: 'blur' }
- ],
- productName: [
- { required: true, message: '请输入协会名称', trigger: 'blur' }
- ],
- supplierId: [
- { required: false, message: '请输入协会介绍', trigger: 'blur' }
- ],
- goodsSpecValue: [
- { required: true, message: '请选择规格', trigger: 'blur' }
- ]
- }
- };
- },
- watch: {
- visible(val) {
- if (val !== this.dialogVisible) {
- this.dialogVisible = val;
- if (val) {
- assign(this.baseForm, this.data);
- if (!this.hasFetched) {
- this.hasFetched = true;
- }
- }
- }
- },
- data: {
- deep: true,
- handler(val) {
- assign(this.baseForm, val);
- }
- }
- },
- methods: {
- resetForm(formName) {
- this.$refs[formName].resetFields();
- this.resetFormData();
- this.dialogVisible = false;
- },
- resetFormData() {
- this.baseForm = {};
- },
- submitForm(formName) {
- this.$refs[formName].validate((valid) => {
- console.log(valid)
- })
- },
- handleClose() {
- this.$emit('update:visible', false);
- this.resetForm('baseForm');
- },
- }
- };
- </script>
- <style lang="scss" scoped>
- ::v-deep .el-tag{
- margin-right: 5px;
- }
- .areatText{
- width: 100%;
- height: 100px;
- border:1px solid #DCDFE6;
- margin-top: 10px;
- padding:2% 3%;
- }
- .input-number {
- width: 100%;
- }
- .base-form {
- max-height: 70vh;
- overflow-y: auto;
- overflow-x: hidden;
- padding: 0 20px;
- }
- </style>
- <style lang="css" scoped>
- ::v-deep .el-dialog__header {
- border-bottom: 1px solid #ebeef5;
- }
- </style>
|