feat: 新增档案

This commit is contained in:
wanglei
2024-06-25 11:13:29 +08:00
parent f095e344f5
commit 2143da5dce
2 changed files with 170 additions and 116 deletions

View File

@@ -1,4 +1,5 @@
<template>
<div>
<ai-detail class="add">
<template slot="title">
<ai-title title="添加档案" isShowBack isShowBottomBorder @onBackClick="cancel(false)"></ai-title>
@@ -65,8 +66,11 @@
</ai-select>
</el-form-item>
<el-form-item label="所属片区:" style="width: 100%;" prop="girdCode">
<el-select placeholder="请选择所属片区" size="small" v-model="form.girdCode"
style="width: 100%;"></el-select>
<el-input disabled v-model="form.girdName" size="small" placeholder="请选择片区">
<template slot="append">
<el-button size="small" @click="handleSelectGrid">选择片区</el-button>
</template>
</el-input>
</el-form-item>
</div>
@@ -76,7 +80,6 @@
isShowTip
v-model="form.fileUrl"
:limit="1"
:cropOps="cropOps"
is-crop>
<template slot="tips">
<p>最多上传1张图片,单个文件最大10MB支持jpgjpegpng格式</p>
@@ -89,8 +92,9 @@
<el-input v-model="form.creditCode" placeholder="请输入社会统一信用代码" size="small"></el-input>
</el-form-item>
<el-form-item label="门店住址:" style="width: 100%;" prop="addressCode">
<ai-area-select :instance="instance" clearable v-model="form.addressCode" always-show
@name="v=>form.areaName=v"/>
<ai-area-select :instance="instance" clearable always-show
:disabled-level="$store.state.user.info.areaList.length"
@name="v=>form.areaName=v" v-model="form.areaId"/>
</el-form-item>
<el-form-item label="" style="width:100%" prop="address">
<el-input
@@ -114,6 +118,24 @@
<el-button type="primary" @click="handleSave">保存</el-button>
</template>
</ai-detail>
<ai-dialog title="选择片区" :visible.sync="dialog" :customFooter="true" border width="720px">
<div class="grid">
<el-tree
:data="treeList"
:props="defaultProps"
node-key="id"
ref="treeRef"
:check-strictly="true"
show-checkbox
@check="onCheckChange">
</el-tree>
</div>
<div class="dialog-footer" slot="footer">
<el-button size="medium" @click="dialog=false">取消</el-button>
<el-button type="primary" size="medium" @click="getCheckedTree()">确认</el-button>
</div>
</ai-dialog>
</div>
</template>
<script>
@@ -131,7 +153,8 @@ export default {
data() {
return {
form: {
id:null,
id: null,
areaId: '',
name: '',
idNumber: '',
sex: '',
@@ -139,6 +162,12 @@ export default {
birthday: '',
age: '',
},
dialog: false,
treeList: [],
defaultProps: {
children: "children",
label: "girdName",
},
rules: {
name: [{required: true, message: '请输入经营者姓名', trigger: 'blur'}],
idNumber: [{required: true, message: '请输入身份证号', trigger: 'blur'}],
@@ -154,11 +183,30 @@ export default {
},
created() {
this.$dict.load('sex','operatorType')
this.form.areaId = this.$store.state.user.info.areaId
this.$dict.load('sex', 'operatorType')
},
methods: {
async handleSelectGrid() {
try {
this.dialog = true
const {code, data} = await this.instance.post('/app/appgirdinfo/listAll3')
if (code === 0) {
console.log('data--->', data)
}
} catch (e) {
console.error(e)
}
},
getCheckedTree() {
},
onCheckChange(e) {
},
idChange(val) {
if (val.length == 18) {
this.IdCard(val);
@@ -180,7 +228,7 @@ export default {
...this.form
}
})
if(code===0){
if (code === 0) {
this.$message.success('保存成功');
this.form = {...data}
}

View File

@@ -2,7 +2,7 @@
<div>
<ai-list class="app-archives-list">
<template slot="title">
<ai-title title="门店档案" isShowBottomBorder></ai-title>
<ai-title title="门店档案" isShowBottomBorder v-model="search.areaId" isShowArea :hideLevel="hideLevel - 1" @change="search.current = 1, getList()"></ai-title>
</template>
<template slot="content">
<ai-search-bar class="search-bar">
@@ -44,12 +44,6 @@
placeholder="经营类型"
:selectList="$dict.getDict('operatorType')">
</ai-select>
<ai-select
v-model="search.status"
@change="(search.current = 1), getList()"
placeholder="所属片区"
:selectList="$dict.getDict('appIntegralApplyEventStatus')">
</ai-select>
</template>
<template #right>
<el-input
@@ -124,6 +118,7 @@
<script>
import { MessageBox } from 'element-ui'
import {mapState} from "vuex";
export default {
name: 'List',
@@ -135,6 +130,7 @@ export default {
data () {
return {
search: {
areaId:'',
current: 1,
size: 10,
applyItemId: '',
@@ -163,7 +159,17 @@ export default {
}
},
computed:{
...mapState(['user']),
hideLevel () {
return this.user.info.areaList.length || 0
},
},
created () {
this.search.areaId = this.user.info.areaId
this.$dict.load('yesOrNo','storeLevel','operatorType').then(() => {
this.getList()
})