feat(x): 新增出栏审核功能
- 添加出栏审核相关的三个子页面:add、list 和 AppSellAudit - 实现出umu栏审核的添加、列表展示和审批功能 - 集成字典加载、权限控制和用户信息获取 - 优化表格数据加载和搜索过滤
This commit is contained in:
		
							
								
								
									
										35
									
								
								project/xumu/AppSellAudit/AppSellAudit.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								project/xumu/AppSellAudit/AppSellAudit.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,35 @@ | ||||
| <script> | ||||
| import add from "./add.vue"; | ||||
| import list from "./list.vue"; | ||||
|  | ||||
| export default { | ||||
|   name: "AppSellAudit", | ||||
|   label: "出栏审核", | ||||
|   props: { | ||||
|     instance: Function, | ||||
|     dict: Object, | ||||
|     permissions: Function | ||||
|   }, | ||||
|   computed: { | ||||
|     currentPage() { | ||||
|       let {hash} = this.$route | ||||
|       return ["#audit", "#add"].includes(hash) ? add : list | ||||
|     } | ||||
|   }, | ||||
|   created() { | ||||
|     this.dict.load("auditStatus", "loanProduct", "loanStatus", "category", "variety") | ||||
|   }, | ||||
| } | ||||
| </script> | ||||
|  | ||||
| <template> | ||||
|   <section class="AppSellAudit"> | ||||
|     <component :is="currentPage" v-bind="$props"/> | ||||
|   </section> | ||||
| </template> | ||||
|  | ||||
| <style scoped lang="scss"> | ||||
| .AppSellAudit { | ||||
|   height: 100%; | ||||
| } | ||||
| </style> | ||||
							
								
								
									
										149
									
								
								project/xumu/AppSellAudit/add.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										149
									
								
								project/xumu/AppSellAudit/add.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,149 @@ | ||||
| <script> | ||||
| import {mapState} from "vuex" | ||||
| import AiEartagPicker from "@project/xumu/components/AiEartagPicker.vue"; | ||||
|  | ||||
| export default { | ||||
|   name: "saAdd", | ||||
|   components: {AiEartagPicker}, | ||||
|   props: { | ||||
|     instance: Function, | ||||
|     permissions: Function, | ||||
|     dict: Object | ||||
|   }, | ||||
|   data() { | ||||
|     return { | ||||
|       detail: {detailList: []} | ||||
|     } | ||||
|   }, | ||||
|   computed: { | ||||
|     ...mapState(["user"]), | ||||
|     userinfo: v => v.user.info || {}, | ||||
|     pageTitle: v => { | ||||
|       const appName = v.$parent.menuName || v.$parent.$options.label | ||||
|       return v.isAudit ? `${appName}审批` : `${appName}详情` | ||||
|     }, | ||||
|     isAudit: v => v.$route.hash == "#audit", | ||||
|     formImages: v => [ | ||||
|       {label: "合同/协议", prop: "contractPicture"}, | ||||
|     ], | ||||
|     columns: v => [ | ||||
|       {label: "序号", type: "index"}, | ||||
|       {label: "生物芯片耳标号", prop: "biochipEarNumber"}, | ||||
|       {label: "身长测量照片", prop: "heightPicture", upload: {instance: v.instance, readonly: !0, valueIsUrl: !0, limit: 1}}, | ||||
|       {label: "电子耳标照片", prop: "earNumberPicture", upload: {instance: v.instance, readonly: !0, valueIsUrl: !0, limit: 1}}, | ||||
|       {label: "防疫耳标照片", prop: "preventionPicture", upload: {instance: v.instance, readonly: !0, valueIsUrl: !0, limit: 1}}, | ||||
|     ].filter(e => !e.hide), | ||||
|   }, | ||||
|   methods: { | ||||
|     back(params = {}) { | ||||
|       this.$router.push(params) | ||||
|     }, | ||||
|     getDetail() { | ||||
|       const {id} = this.$route.query | ||||
|       return id && this.instance.post("/api/sell/apply/getAuditInfo", null, {params: {id}}).then(res => { | ||||
|         if (res?.data) { | ||||
|           const detail = res.data | ||||
|           return this.detail = {...detail} | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     submit() { | ||||
|       this.$refs.detail.validate().then(() => { | ||||
|         this.instance.post("/api/sell/apply/audit", {...this.detail}).then(res => { | ||||
|           if (res?.code == '0') { | ||||
|             this.$message.success("提交成功!") | ||||
|             this.back() | ||||
|           } | ||||
|         }) | ||||
|       }) | ||||
|     } | ||||
|   }, | ||||
|   created() { | ||||
|     this.getDetail() | ||||
|   } | ||||
| } | ||||
| </script> | ||||
|  | ||||
| <template> | ||||
|   <ai-page :title="pageTitle" class="saAdd" showBack content-string="blank"> | ||||
|     <el-form size="small" label-width="120px" :model="detail" ref="detail"> | ||||
|       <ai-card title="基础信息"> | ||||
|         <div class="grid"> | ||||
|           <el-form-item label="养殖场" prop="farmId" :rules="{message:'请选择 养殖场'}"> | ||||
|             <b v-text="detail.farmName"/> | ||||
|           </el-form-item> | ||||
|           <el-form-item label="贷款银行" prop="bankId" :rules="{message:'请选择 贷款银行'}"> | ||||
|             <b v-text="detail.bankName"/> | ||||
|           </el-form-item> | ||||
|           <el-form-item label="贷款产品" prop="productType" :rules="{message:'请选择 贷款产品'}"> | ||||
|             <b v-text="dict.getLabel('loanProduct',detail.productType)"/> | ||||
|           </el-form-item> | ||||
|           <el-form-item label="贷款金额(万)" prop="loanAmount" :rules="{message:'请输入 预期贷款额'}"> | ||||
|             <ai-input v-model.number="detail.loanAmount" :edit="!1"/> | ||||
|           </el-form-item> | ||||
|           <el-form-item label="联系人" prop="contacts" :rules="{message:'请输入 联系人'}"> | ||||
|             <ai-input v-model="detail.contacts" :edit="!1"/> | ||||
|           </el-form-item> | ||||
|           <el-form-item label="联系电话" prop="phone" :rules="{message:'请输入 联系电话'}"> | ||||
|             <ai-input v-model="detail.phone" :edit="!1"/> | ||||
|           </el-form-item> | ||||
|         </div> | ||||
|       </ai-card> | ||||
|       <ai-card title="标的信息"> | ||||
|         <ai-table :tableData="detail.detailList" :colConfigs="columns" :isShowPagination="!1" hideOptions/> | ||||
|       </ai-card> | ||||
|       <ai-card title="解押材料"> | ||||
|         <el-form-item v-for="(img,i) in formImages" :key="i" v-bind="img"> | ||||
|           <ai-uploader v-model="detail[img.prop]" value-is-url readonly/> | ||||
|         </el-form-item> | ||||
|       </ai-card> | ||||
|       <ai-card title="审核信息"> | ||||
|         <div class="grid"> | ||||
|           <template v-if="isAudit"> | ||||
|             <el-form-item label="审批状态" prop="auditStatus" :rules="{required:true,message:'请选择审批状态'}"> | ||||
|               <ai-select v-model="detail.auditStatus" dict="auditStatus"/> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="解压资料" class="sc-3"> | ||||
|               <ai-uploader v-model="detail.picture" value-is-url :instance="instance" :limit="1"/> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="解押凭证号" prop="reportNo" :rules="{required:true,message:'请输入 解押凭证号'}"> | ||||
|               <ai-input v-model="detail.reportNo"/> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="说明"> | ||||
|               <ai-input type="textarea" :rows="3" v-model="detail.remarks"/> | ||||
|             </el-form-item> | ||||
|           </template> | ||||
|           <template v-else> | ||||
|             <el-form-item label="审核状态">{{ dict.getLabel('auditStatus', detail.auditStatus) }}</el-form-item> | ||||
|             <el-form-item label="解压资料" class="sc-3"> | ||||
|               <el-image :src="detail.picture" :preview-src-list="[detail.picture]"/> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="审核时间">{{ detail.auditTime }}</el-form-item> | ||||
|             <el-form-item label="审核人">{{ detail.auditName }}</el-form-item> | ||||
|             <el-form-item label="说明">{{ detail.remarks }}</el-form-item> | ||||
|           </template> | ||||
|         </div> | ||||
|       </ai-card> | ||||
|     </el-form> | ||||
|     <div slot="footer"> | ||||
|       <template v-if="isAudit"> | ||||
|         <el-button type="primary" @click="submit">提交</el-button> | ||||
|       </template> | ||||
|       <el-button @click="back">返回</el-button> | ||||
|     </div> | ||||
|   </ai-page> | ||||
| </template> | ||||
|  | ||||
| <style scoped lang="scss"> | ||||
| .saAdd { | ||||
|   :deep(.el-form--label-top) { | ||||
|     .el-form-item__label { | ||||
|       width: 100% !important; | ||||
|     } | ||||
|  | ||||
|     .el-form-item__content { | ||||
|       margin-left: unset !important; | ||||
|     } | ||||
|   } | ||||
| } | ||||
| </style> | ||||
							
								
								
									
										102
									
								
								project/xumu/AppSellAudit/list.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										102
									
								
								project/xumu/AppSellAudit/list.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,102 @@ | ||||
| <script> | ||||
| import {mapState} from "vuex" | ||||
|  | ||||
| const columns = [ | ||||
|   {label: "序号", type: "index"}, | ||||
|   {label: "解押凭证号", prop: "releaseNo"}, | ||||
|   {label: "贷款合同号", prop: "contractNo"}, | ||||
|   {label: "所属养殖户", prop: "applyName"}, | ||||
|   {label: "解押数量", prop: "sellNumber"}, | ||||
|   {label: "审批状态", prop: "auditStatus", dict: "auditStatus"}, | ||||
|   {label: "审批时间", prop: "auditTime", width: 160}, | ||||
|   {label: "审批人", prop: "auditName"}, | ||||
| ] | ||||
| export default { | ||||
|   name: "saList", | ||||
|   props: { | ||||
|     instance: Function, | ||||
|     dict: Object, | ||||
|     permissions: Function | ||||
|   }, | ||||
|   data() { | ||||
|     return { | ||||
|       columns, | ||||
|       tableData: [], | ||||
|       page: {pageNum: 1, pageSize: 10, total: 0}, | ||||
|       search: {}, | ||||
|     } | ||||
|   }, | ||||
|   computed: { | ||||
|     ...mapState(['user']), | ||||
|     userinfo: v => v.user.info || {}, | ||||
|     pageTitle: v => v.$parent.menuName || v.$parent.$options.label | ||||
|   }, | ||||
|   watch: { | ||||
|     search: { | ||||
|       deep: true, | ||||
|       handler() { | ||||
|         this.page.pageNum = 1 | ||||
|         this.getTableData() | ||||
|       } | ||||
|     } | ||||
|   }, | ||||
|   methods: { | ||||
|     getTableData() { | ||||
|       this.instance.post("/api/sell/apply/getAuditPage", {...this.page, ...this.search}).then(res => { | ||||
|         if (res?.data) { | ||||
|           this.tableData = res.data?.records.map(e => ({...e, permit: `${e.status}` + e.auditStatus})) | ||||
|           this.page.total = res.data.total | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|   }, | ||||
|   created() { | ||||
|     this.getTableData() | ||||
|   } | ||||
| } | ||||
| </script> | ||||
|  | ||||
| <template> | ||||
|   <ai-page class="saList" :title="pageTitle"> | ||||
|     <ai-search-bar> | ||||
|       <template #left> | ||||
|         <ai-input placeholder="解押凭证号" v-model="search.releaseNo"/> | ||||
|         <ai-input placeholder="贷款合同号" v-model="search.contractNo"/> | ||||
|         <ai-select placeholder="全部审批状态" v-model="search.auditStatus" dict="auditStatus"/> | ||||
|         <ai-search label="投保日期"> | ||||
|           <el-date-picker v-model="search.auditBeginDate" type="datetime" placeholder="开始日期" size="small"/> | ||||
|           <el-date-picker v-model="search.auditEndDate" type="datetime" placeholder="结束日期" size="small"/> | ||||
|         </ai-search> | ||||
|         <ai-input placeholder="养殖户" v-model="search.applyName"/> | ||||
|       </template> | ||||
|     </ai-search-bar> | ||||
|     <ai-search-bar> | ||||
|       <template #left> | ||||
|         <ai-download :instance="instance" url="/api/sell/apply/exportAudit" :params="{...search,...page}" :fileName="`${pageTitle}导出表-${Date.now()}`"/> | ||||
|       </template> | ||||
|     </ai-search-bar> | ||||
|     <ai-table :tableData="tableData" :colConfigs="columns" :dict="dict" @getList="getTableData" | ||||
|               :total="page.total" :current.sync="page.pageNum" :size.sync="page.pageSize"> | ||||
|       <el-table-column slot="options" label="操作" fixed="right" align="center"> | ||||
|         <template slot-scope="{row}"> | ||||
|           <div class="table-options"> | ||||
|             <template v-if="['1'].includes(row.auditStatus)"> | ||||
|               <el-button type="text" @click="$router.push({hash:'#audit',query:{id:row.id}})">审核</el-button> | ||||
|             </template> | ||||
|             <el-button v-else type="text" @click="$router.push({hash:'#add',query:{id:row.id}})">查看</el-button> | ||||
|           </div> | ||||
|         </template> | ||||
|       </el-table-column> | ||||
|     </ai-table> | ||||
|   </ai-page> | ||||
| </template> | ||||
|  | ||||
| <style scoped lang="scss"> | ||||
| .saList { | ||||
|   height: 100%; | ||||
|  | ||||
|   .deleteBtn { | ||||
|     color: $errorColor; | ||||
|   } | ||||
| } | ||||
| </style> | ||||
		Reference in New Issue
	
	Block a user