feat(xumu): 新增出栏申请功能
- 添加 AppSellApply 组件作为出栏申请的主入口 - 实现出栏申请列表页面,包括筛选、导出等功能 - 实现出栏申请详情和编辑页面,包括基础信息、标的信息、解押材料等 - 集成耳标选择器组件,用于选择投保标的
This commit is contained in:
35
project/xumu/AppSellApply/AppSellApply.vue
Normal file
35
project/xumu/AppSellApply/AppSellApply.vue
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<script>
|
||||||
|
import add from "./add.vue";
|
||||||
|
import list from "./list.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AppSellApply",
|
||||||
|
label: "出栏申请",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
currentPage() {
|
||||||
|
let {hash} = this.$route
|
||||||
|
return ["#edit", "#add"].includes(hash) ? add : list
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("auditStatus", "loanProduct", "loanStatus", "category", "variety")
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section class="AppSellApply">
|
||||||
|
<component :is="currentPage" v-bind="$props"/>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.AppSellApply {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
145
project/xumu/AppSellApply/add.vue
Normal file
145
project/xumu/AppSellApply/add.vue
Normal file
@@ -0,0 +1,145 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
import AiEartagPicker from "@project/xumu/components/AiEartagPicker.vue";
|
||||||
|
|
||||||
|
const records = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "解押凭证号", prop: "releaseNo"},
|
||||||
|
{label: "审批状态", prop: "auditStatus", dict: "auditStatus"},
|
||||||
|
{label: "审批时间", prop: "auditTime"},
|
||||||
|
{label: "审批人", prop: "auditName"},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "sellAdd",
|
||||||
|
components: {AiEartagPicker},
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
permissions: Function,
|
||||||
|
dict: Object
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
detail: {detailList: []},
|
||||||
|
records
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user"]),
|
||||||
|
userinfo: v => v.user.info || {},
|
||||||
|
pageTitle: v => {
|
||||||
|
const appName = v.$parent.menuName || v.$parent.$options.label
|
||||||
|
return v.isEdit ? `新增${appName}` : `${appName}详情`
|
||||||
|
},
|
||||||
|
isEdit: v => v.$route.hash == "#edit",
|
||||||
|
formImages: v => [
|
||||||
|
{label: "合同/协议", prop: "contractPicture", rules: {required: v.isEdit, message: '请上传 合同/协议'}},
|
||||||
|
],
|
||||||
|
columns: v => [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "生物芯片耳标号", prop: "biochipEarNumber"},
|
||||||
|
{label: "身长测量照片", prop: "heightPicture", upload: {instance: v.instance, readonly: !v.isEdit, valueIsUrl: !0, limit: 1}},
|
||||||
|
{label: "电子耳标照片", prop: "earNumberPicture", upload: {instance: v.instance, readonly: !v.isEdit, valueIsUrl: !0, limit: 1}},
|
||||||
|
{label: "防疫耳标照片", prop: "preventionPicture", upload: {instance: v.instance, readonly: !v.isEdit, valueIsUrl: !0, limit: 1}},
|
||||||
|
{label: "解押办结凭证号", prop: "releaseNo", hide: v.isEdit},
|
||||||
|
].filter(e => !e.hide),
|
||||||
|
selectedEartags: v => v.detail.list?.length || 0,
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
back(params = {}) {
|
||||||
|
this.$router.push(params)
|
||||||
|
},
|
||||||
|
getDetail() {
|
||||||
|
const {id} = this.$route.query
|
||||||
|
return id && this.instance.post("/api/sell/apply/getInfo", null, {params: {contractNo: id}}).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
const detail = res.data
|
||||||
|
detail.detailList = detail.detailList || []
|
||||||
|
detail.list = detail.list || []
|
||||||
|
return this.detail = {...detail}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
this.$refs.detail.validate().then(() => {
|
||||||
|
this.instance.post("/api/sell/apply/add", {...this.detail}).then(res => {
|
||||||
|
if (res?.code == '0') {
|
||||||
|
this.$message.success("提交成功!")
|
||||||
|
this.back()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDetail()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ai-page :title="pageTitle" class="sellAdd" 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="标的信息">
|
||||||
|
<template #right v-if="isEdit">
|
||||||
|
<ai-eartag-picker @select="v=>detail.detailList=v" :instance="instance"
|
||||||
|
:action="`/api/sell/apply/getClaimEarNumberList?contractNo=${detail.contractNo}`">
|
||||||
|
<el-button type="text">选择</el-button>
|
||||||
|
</ai-eartag-picker>
|
||||||
|
</template>
|
||||||
|
<ai-highlight class="mar-b8 font-14" :content="`投保标的共${detail.insureNumber||0}只,已理赔标的共 @v 只`" color="red" :value="selectedEartags"/>
|
||||||
|
<ai-table :tableData="detail.detailList" :colConfigs="columns" :isShowPagination="!1" hideOptions/>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="解押材料" v-if="isEdit">
|
||||||
|
<div class="font-12 mar-b8">只能上传JPG/PNG文件,且不超过2M,一次最多5张</div>
|
||||||
|
<el-form-item v-for="(img,i) in formImages" :key="i" v-bind="img">
|
||||||
|
<ai-uploader v-model="detail[img.prop]" :instance="instance" value-is-url :limit="5"/>
|
||||||
|
</el-form-item>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card title="出栏解押记录" v-else>
|
||||||
|
<ai-table :tableData="detail.list" :colConfigs="records" :isShowPagination="!1" hideOptions/>
|
||||||
|
</ai-card>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer">
|
||||||
|
<template v-if="isEdit">
|
||||||
|
<el-button type="primary" @click="submit(1)">提交</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button @click="back">返回</el-button>
|
||||||
|
</div>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.sellAdd {
|
||||||
|
:deep(.el-form--label-top) {
|
||||||
|
.el-form-item__label {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item__content {
|
||||||
|
margin-left: unset !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
103
project/xumu/AppSellApply/list.vue
Normal file
103
project/xumu/AppSellApply/list.vue
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
<script>
|
||||||
|
import {mapState} from "vuex"
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{label: "序号", type: "index"},
|
||||||
|
{label: "贷款合同号", prop: "contractNo"},
|
||||||
|
{label: "所属养殖户", prop: "applyName"},
|
||||||
|
{label: "所属养殖场", prop: "farmName"},
|
||||||
|
{label: "贷款金额(万元)", prop: "loanAmount"},
|
||||||
|
{label: "贷款状态", prop: "status", dict: "loanStatus"},
|
||||||
|
{label: "贷款时间", prop: "createTime", width: 160},
|
||||||
|
{label: "说明", prop: "remarks"},
|
||||||
|
]
|
||||||
|
export default {
|
||||||
|
name: "sellList",
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
columns,
|
||||||
|
tableData: [],
|
||||||
|
page: {pageNum: 1, pageSize: 10, total: 0},
|
||||||
|
search: {},
|
||||||
|
dialog: false,
|
||||||
|
form: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
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/page", {...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="sellList" :title="pageTitle">
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-input placeholder="贷款合同号" v-model="search.contractNo"/>
|
||||||
|
<ai-search label="贷款日期">
|
||||||
|
<el-date-picker v-model="search.beginDate" type="datetime" placeholder="开始日期" size="small"/>
|
||||||
|
<el-date-picker v-model="search.endDate" type="datetime" placeholder="结束日期" size="small"/>
|
||||||
|
</ai-search>
|
||||||
|
<ai-input placeholder="养殖户" v-model="search.applyName"/>
|
||||||
|
<ai-input placeholder="养殖场" v-model="search.farmName"/>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<ai-download :instance="instance" url="/api/sell/apply/export" :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.status)">
|
||||||
|
<el-button type="text" @click="$router.push({hash:'#edit',query:{id:row.contractNo}})">出栏申请</el-button>
|
||||||
|
</template>
|
||||||
|
<el-button v-else type="text" @click="$router.push({hash:'#add',query:{id:row.contractNo}})">查看</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</ai-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.sellList {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.deleteBtn {
|
||||||
|
color: $errorColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -33,7 +33,6 @@ export default {
|
|||||||
url += `?penId=${this.penId}`
|
url += `?penId=${this.penId}`
|
||||||
}
|
}
|
||||||
!/undefined/.test(url) && this.instance.post(url).then(res => {
|
!/undefined/.test(url) && this.instance.post(url).then(res => {
|
||||||
console.log(res)
|
|
||||||
if (res?.data) {
|
if (res?.data) {
|
||||||
this.list = res.data
|
this.list = res.data
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user