| | |
| | | v-model="queryParams.sex" |
| | | placeholder="请选择性别" |
| | | clearable |
| | | style="width: 240px" |
| | | style="width: 200px; |
| | | height: 35px; |
| | | border-radius: 16px 16px 16px 16px; |
| | | opacity: 0.5;" |
| | | > |
| | | <el-option |
| | | v-for="dict in typeOptions" |
| | |
| | | v-model="queryParams.name" |
| | | placeholder="请输入名字" |
| | | clearable |
| | | style="width: 240px" |
| | | style="width: 200px; |
| | | height: 35px; |
| | | border-radius: 16px 16px 16px 16px; |
| | | opacity: 0.5;" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | |
| | | v-model="queryParams.idNum" |
| | | placeholder="请输入证件号码" |
| | | clearable |
| | | style="width: 240px" |
| | | style="width: 200px; |
| | | height: 35px; |
| | | border-radius: 16px 16px 16px 16px; |
| | | opacity: 0.5;" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | |
| | | v-hasPermi="['system:role:remove']" |
| | | >删除</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | @click="handleExport" |
| | | v-hasPermi="['family:note:export']" |
| | | >导出</el-button> |
| | | </el-col> |
| | | |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | @click="handleExport" |
| | | v-hasPermi="['family:note:export']" |
| | | >导入模板下载</el-button> |
| | | </el-col> |
| | | <el-col :span="1.2"> |
| | | <el-upload |
| | | action="" |
| | | class="upload-demo" |
| | | :show-file-list="false" |
| | | :http-request="handleEnport" |
| | | > |
| | | <el-button size="mini" type="primary" |
| | | plain |
| | | icon="el-icon-plus" >导入</el-button> |
| | | |
| | | </el-upload> |
| | | </el-col> |
| | | |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | |
| | | <el-table v-loading="loading" :data="petList,PetNoteList" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | |
| | | <el-table-column label="序号" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="120"/> |
| | | <el-table-column label="序号" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="120"/> |
| | | <el-table-column label="种类" prop="animal" sortable :show-overflow-tooltip="true" width="150" /> |
| | | |
| | | <el-table-column label="类型" prop="type" sortable :show-overflow-tooltip="true" width="150" /> |
| | | <el-table-column label="品种" prop="type" sortable :show-overflow-tooltip="true" width="150" /> |
| | | <el-table-column label="名字" prop="name" sortable :show-overflow-tooltip="true" width="150" /> |
| | | <el-table-column label="性别" prop="sex" sortable width="120" > |
| | | <template slot-scope="scope"> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="宠物id" prop="id" sortable width="100" /> |
| | | <el-table-column label="主人姓名" prop="masterName" sortable width="100" /> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope" v-if="scope.row.roleId !== 1"> |
| | | <div class="button-container"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | :disabled="!scope.row.ownData" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['familymodel:property:info']" |
| | | >修改</el-button> |
| | |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | :disabled="!scope.row.ownData" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['system:role:remove']" |
| | | >删除</el-button> |
| | | <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['familymodel:property:info']"> |
| | | <el-button size="mini" type="text" icon="el-icon-d-arrow-right" @click="handleCheck(scope.row)">查看详情</el-button> |
| | | </el-dropdown> |
| | | |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <el-form-item label="防伪证" prop="securityCode"> |
| | | <el-input v-model="formDat.securityCode" placeholder="请输入防伪证" clearable :style="{width: '100%'}" ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="种类" prop="animal"> |
| | | <el-input v-model="formDat.animal" placeholder="请输入种类" clearable :style="{width: '100%'}" ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="品种" prop="type"> |
| | | <el-input v-model="formDat.type" placeholder="请输入品种" clearable :style="{width: '100%'}" ></el-input> |
| | | </el-form-item> |
| | |
| | | <el-input v-model="formDat.name" placeholder="请输入名字" clearable :style="{width: '100%'}" ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="出生日期" prop="birth"> |
| | | <el-input |
| | | v-model='formDat.birth' |
| | | type='date' |
| | | placeholder='选择日期' |
| | | ></el-input> |
| | | <el-date-picker v-model="formDat.birth" type="date" placeholder="请选择日期" |
| | | :editable="false" :clearable="false" :style="{width: '100%'}" value-format="yyyy-MM-dd" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="性别" prop="sex"> |
| | | <el-select v-model="formDat.sex" placeholder="请选择性别" clearable :style="{width: '100%'}" > |
| | |
| | | <el-input v-model="formDat.eatHabit" placeholder="请输入饮食习惯(喜)" clearable :style="{width: '100%'}" > |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="饮食习惯(恶)" prop="diseatHabit"> |
| | | <el-input v-model="formDat.diseatHabit" placeholder="请输入饮食习惯(恶)" clearable :style="{width: '100%'}" > |
| | | <el-form-item label="饮食习惯(恶)" prop="disEatHabit"> |
| | | <el-input v-model="formDat.disEatHabit" placeholder="请输入饮食习惯(恶)" clearable :style="{width: '100%'}" > |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="生活习惯(喜)" prop="lifeHabit"> |
| | |
| | | <el-upload |
| | | action="#" |
| | | list-type="picture-card" |
| | | multiple |
| | | :limit="1" |
| | | :http-request="requestUpload" |
| | | :file-list="fileList" |
| | | :file-list="fileList1" |
| | | > |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <i v-if="!uploading" slot="default" class="el-icon-plus"></i> |
| | | <i slot="default" class="el-icon-plus"></i> |
| | | <div slot="file" slot-scope="{file}"> |
| | | <img |
| | | class="el-upload-list__item-thumbnail" |
| | |
| | | <el-upload |
| | | action="#" |
| | | list-type="picture-card" |
| | | multiple |
| | | :http-request="requestUpload" |
| | | :file-list="fileListOther" |
| | | :limit="1" |
| | | :http-request="requestUpload2" |
| | | :file-list="fileList2" |
| | | > |
| | | <div v-if="uploading" class="upload-status">正在上传...</div> |
| | | <i v-if="!uploading" slot="default" class="el-icon-plus"></i> |
| | | <i slot="default" class="el-icon-plus"></i> |
| | | <div slot="file" slot-scope="{file}"> |
| | | <img |
| | | class="el-upload-list__item-thumbnail" |
| | |
| | | <i class="el-icon-delete"></i> |
| | | </span> |
| | | </span> |
| | | |
| | | |
| | | </div> |
| | | </el-upload> |
| | | </el-form> |
| | |
| | | |
| | | </el-dialog> |
| | | |
| | | <el-dialog :visible.sync="dialogVisible"> |
| | | <img w-full :src="dialogImageUrl" style="width: 100%; height: 100%" alt="Preview Image" /> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | |
| | | |
| | | //在system/note/index.js中导入接口函数 |
| | | import {listPet,enload, getPetInfo, delPet,addPet, uploadPic} from "@/api/pet/index"; |
| | | import {listPet,enload, getPetInfo, delPet,addPet, uploadPic1} from "@/api/pet/index"; |
| | | export default { |
| | | name: "Role", |
| | | dicts: ['sys_normal_disable'], |
| | |
| | | showSearch: true, |
| | | // 总条数 |
| | | total: 0, |
| | | // 资产表格数据 |
| | | petList: [], |
| | | // 弹出层标题 |
| | | title: "", |
| | | // 是否显示弹出层 |
| | |
| | | menuNodeAll: false, |
| | | deptExpand: true, |
| | | deptNodeAll: false, |
| | | |
| | | dialogImageUrl: '', |
| | | dialogVisible: false, |
| | | // 日期范围 |
| | | dateRange: [], |
| | | // 数据范围选项 |
| | | fot:[".jpg",".jif"], |
| | | fileList:[ |
| | | ], |
| | | fileListOther:[ |
| | | // 数据范围选项 |
| | | fot:['.bmp','.jpg','.jpeg','.png','.tif','.gif','.pcx','.tga','.exif','.fpx', |
| | | '.svg','.psd','.cdr','.pcd','.dxf','.ufo','.eps','.ai','.aw','.WMF','.webp','.apng'], |
| | | |
| | | ], |
| | | fileList1:[ ], |
| | | fileList2:[ ], |
| | | fileListOther:[ ], |
| | | dsb:true, |
| | | btn:false, |
| | | uploading: false, |
| | | formDat: { |
| | | type: undefined, |
| | | name: undefined, |
| | | sex: undefined, |
| | | color: undefined, |
| | | address: undefined, |
| | | animal:undefined, |
| | | remark: undefined, |
| | | url: undefined, |
| | | type: undefined, |
| | |
| | | dialect: undefined, |
| | | address:undefined, |
| | | eatHabit:undefined, |
| | | diseatHabit: undefined, |
| | | disEatHabit: undefined, |
| | | LifeHabit: undefined, |
| | | disLifeHabit: undefined, |
| | | url: undefined, |
| | | headPicture:undefined, |
| | | fullPicture:undefined, |
| | | |
| | | }, |
| | | petList: { |
| | |
| | | dialect: undefined, |
| | | address:undefined, |
| | | eatHabit:undefined, |
| | | diseatHabit: undefined, |
| | | disEatHabit: undefined, |
| | | LifeHabit: undefined, |
| | | disLifeHabit: undefined, |
| | | url: undefined, |
| | | headPicture:undefined, |
| | | fullPicture:undefined, |
| | | }, |
| | | |
| | | // 菜单列表 |
| | |
| | | }, |
| | | // 表单校验 |
| | | rules: { |
| | | type: [{ |
| | | animal: [{ |
| | | required: true, |
| | | message: '请输入品种', |
| | | message: '请输入种类', |
| | | trigger: 'blue' |
| | | }], |
| | | idNum: [{ |
| | |
| | | trigger: 'blue' |
| | | }], |
| | | securityCode: [{ |
| | | required: true, |
| | | // required: true, |
| | | message: '请输入防伪码', |
| | | trigger: 'blue' |
| | | }], |
| | |
| | | trigger: 'blue' |
| | | }], |
| | | properties: [{ |
| | | required: true, |
| | | // required: true, |
| | | message: '请输入性质', |
| | | trigger: 'blue' |
| | | }], |
| | |
| | | }], |
| | | |
| | | LifeHabit: [{ |
| | | required: true, |
| | | // required: true, |
| | | message: '请输入生活习惯(喜)', |
| | | trigger: 'blur' |
| | | }], |
| | | |
| | | disLifeHabit: [{ |
| | | required: true, |
| | | // required: true, |
| | | message: '请输入生活习惯(恶)', |
| | | trigger: 'blur' |
| | | }], |
| | |
| | | trigger: 'blur' |
| | | }], |
| | | |
| | | diseatHabit: [{ |
| | | disEatHabit: [{ |
| | | required: true, |
| | | message: '请输入饮食习惯(喜)', |
| | | message: '请输入饮食习惯(恶)', |
| | | trigger: 'blur' |
| | | }], |
| | | masterName: [{ |
| | | required: true, |
| | | message: '请输入主人姓名', |
| | | trigger: 'blur' |
| | | }], |
| | | masterIdNum: [{ |
| | | required: true, |
| | | message: '请输入主人身份证号码', |
| | | trigger: 'blur' |
| | | }], |
| | | phone: [{ |
| | | required: true, |
| | | message: '请输入手机号', |
| | | trigger: 'blur' |
| | | }], |
| | | masterAddress: [{ |
| | | required: true, |
| | | message: '请输入主人地址', |
| | | trigger: 'blur' |
| | | }], |
| | | |
| | | |
| | | |
| | | }, |
| | |
| | | |
| | | }, |
| | | methods: { |
| | | |
| | | |
| | | // 取消按钮 |
| | | cancelData() { |
| | | this.open = false; |
| | |
| | | }, |
| | | |
| | | handleRemove(file) { |
| | | for(let i = 0; i < this.fileList.length; i++) |
| | | for(let i = 0; i < this.fileList1.length; i++) |
| | | { |
| | | if(this.fileList[i].url==file.url) |
| | | this.$delete(this.fileList,i); |
| | | if(this.fileList1[i].url==file.url) |
| | | this.$delete(this.fileList1,i); |
| | | } |
| | | }, |
| | | handleRemoveFile(file) { |
| | | for(let i = 0; i < this.fileListOther.length; i++) |
| | | for(let i = 0; i < this.fileList2.length; i++) |
| | | { |
| | | if(this.fileListOther[i].url==file.url) |
| | | this.$delete(this.fileListOther,i); |
| | | if(this.fileList2[i].url==file.url) |
| | | this.$delete(this.fileList2,i); |
| | | } |
| | | }, |
| | | // 取消按钮 |
| | |
| | | }); |
| | | }, |
| | | |
| | | |
| | | //放大 |
| | | handlePictureCardPreview(file) { |
| | | this.dialogImageUrl = file.url; |
| | | this.dialogVisible = true; |
| | | }, |
| | | |
| | | /** 提交按钮(数据权限) */ |
| | | submitDataScope: function() { |
| | | |
| | | let ul = this.fileList.map(function (elem){ |
| | | let ul = this.fileList1.map(function (elem){ |
| | | return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") |
| | | }).join(",") |
| | | let uls = this.fileListOther.map(function (elem){ |
| | | let uls = this.fileList2.map(function (elem){ |
| | | return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") |
| | | }).join(",") |
| | | this.formDat.url = ul+","+uls |
| | | this.$refs["elForm"].validate(valid => { |
| | | if (valid) { |
| | | this.formDat.headPicture = ul, |
| | | this.formDat.fullPicture = uls, |
| | | this.$refs["elForm"].validate(valid => { |
| | | if (valid) { |
| | | |
| | | addPet(this.formDat).then(response => { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } |
| | | }); |
| | | // 清空formDat对象的数据 |
| | | Object.keys(this.formDat).forEach(key => { |
| | | this.formDat[key] = ''; |
| | | }); |
| | | this.handleRemove(this.fileList[0]); |
| | | this.handleRemoveFile(this.fileListOther[0]); |
| | | addPet(this.formDat).then(response => { |
| | | // alert(this.formDat.diseatHabit) |
| | | // alert(this.formDat.eatHabit) |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.open = false; |
| | | // 清空formDat对象的数据 |
| | | Object.keys(this.formDat).forEach(key => { |
| | | this.formDat[key] = ''; |
| | | }); |
| | | for(let i = 0; i <= this.fileList1.length; i++) |
| | | { |
| | | this.handleRemove(this.fileList1[0]); |
| | | } |
| | | for(let i = 0; i < this.fileListOther.length; i++){ |
| | | this.handleRemoveFile(this.fileListOther[0]); |
| | | } |
| | | // this.handleRemove(this.fileList[0]); |
| | | // this.handleRemoveFile(this.fileListOther[0]); |
| | | this.getList(); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | }, |
| | | requestUpload(params) |
| | | { |
| | | var file = params.file; |
| | | var formData = new FormData(); |
| | | |
| | | formData.append('uploadFile', file); |
| | | let _this = this |
| | | this.uploading = true; |
| | | uploadPic(formData).then(response => { |
| | | |
| | | uploadPic1(formData).then(response => { |
| | | let pth = response.data.originalFilename.substr(response.data.originalFilename.length-4, response.data.originalFilename.length) |
| | | this.uploading = false; |
| | | this.$modal.msgSuccess("上传成功"); |
| | | if(_this.fot.includes(pth) === true) |
| | | { |
| | | _this.fileList.push({name:response.data.fileName, "url":response.data.url}) |
| | | _this.fileList1.push({name:response.data.fileName, url:response.data.url}) |
| | | // _this.fileList2.push({name:response.data.fileName, url:response.data.url}) |
| | | console("ok") |
| | | }) |
| | | |
| | | } |
| | | }, |
| | | requestUpload2(params) |
| | | { |
| | | var file = params.file; |
| | | var formData = new FormData(); |
| | | |
| | | else{ |
| | | _this.fileListOther.push({name:response.data.fileName, url:response.data.url}) |
| | | formData.append('uploadFile', file); |
| | | let _this = this |
| | | |
| | | } |
| | | uploadPic1(formData).then(response => { |
| | | let pth = response.data.originalFilename.substr(response.data.originalFilename.length-4, response.data.originalFilename.length) |
| | | // _this.fileList1.push({name:response.data.fileName, url:response.data.url}) |
| | | _this.fileList2.push({name:response.data.fileName, url:response.data.url}) |
| | | console("ok") |
| | | }) |
| | | |
| | | }, |
| | |
| | | this.$modal.msgSuccess("删除成功"); |
| | | }).catch(() => {}); |
| | | }, |
| | | |
| | | |
| | | /** 导出按钮操作 */ |
| | | handleExport() { |
| | | this.download('family/pet/export', { |
| | | ...this.queryParams |
| | | }, `pet_${new Date().getTime()}.xlsx`) |
| | | }, |
| | | /** 导入操作*/ |
| | | handleEnport(params){ |
| | | var file = params.file; |
| | | var formData = new FormData(); |
| | | formData.append('excelImport', file); |
| | | let _this = this |
| | | alert(file) |
| | | enload(formData).then(response => { |
| | | _this.getList(); |
| | | Message({ message: "导入成功", type: 'warning' }) |
| | | |
| | | }).catch(err) |
| | | { |
| | | Message({ message: "导入失败", type: 'error' }) |
| | | } |
| | | |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | background: #FFEFF2; |
| | | |
| | | } |
| | | .upload-demo .el-upload-list__item-thumbnail img { |
| | | width: 100%; |
| | | height: 100%; |
| | | object-fit: cover; |
| | | } |
| | | .upload-demo .el-icon-plus { |
| | | font-size: 28px; |
| | | color: #999; |
| | | border: 1px dashed #999; |
| | | } |
| | | .el-table__cell { |
| | | font-size: 14px; /* 设置字体大小 */ |
| | | } |
| | | .button-container { |
| | | display: inline-flex; /* 设置按钮容器为行内元素 */ |
| | | } |
| | | </style> |