创建公司新增对公账户

This commit is contained in:
lxz 2023-12-28 09:23:09 +08:00
parent 7c5fae74fb
commit 7e662aabf6
5 changed files with 139 additions and 826 deletions

View File

@ -1,8 +1,8 @@
NODE_ENV = 'development'
VITE_APP_BASE_URL = 'http://192.168.1.16:8000'
# VITE_APP_BASE_URL = 'http://192.168.1.16:8000'
# VITE_APP_BASE_URL = 'https://ceshi-worker-task.lihaink.cn'
VITE_APP_BASE_URL = ''
# VITE_APP_BASE_URL = 'https://preview-worker-task.lihaink.cn'

BIN
dist.zip Normal file

Binary file not shown.

View File

@ -1,233 +1,106 @@
<template>
<div class="edit-popup">
<el-form
ref="formRef"
:model="formData"
label-width="90px"
:rules="formRules"
>
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
<!-- <div style="font-size: 1.2rem; margin: 10px 0">公司基本信息创建</div> -->
<el-col :span="24" class="pt-6 el-card">
<div class="tit">公司基本信息创建</div>
<el-row>
<el-form-item label="公司名称" prop="company_name">
<el-input
v-model="formData.company_name"
placeholder="请输入公司名称"
clearable
:disabled="isDisabled"
:style="{ width: '300px' }"
></el-input>
<el-input v-model="formData.company_name" placeholder="请输入公司名称" clearable :disabled="isDisabled"
:style="{ width: '300px' }"></el-input>
</el-form-item>
<el-form-item label="社会代码" prop="organization_code">
<el-input
:disabled="isDisabled"
v-model="formData.organization_code"
placeholder="请输入社会代码"
clearable
:style="{ width: '300px' }"
></el-input>
<el-input :disabled="isDisabled" v-model="formData.organization_code" placeholder="请输入社会代码" clearable
:style="{ width: '300px' }"></el-input>
</el-form-item>
<el-form-item
label="对公账号"
:rules="[
{ required: true, message: '请输入对公账号', trigger: 'blur' },
]"
prop="qualification.corporate_account"
>
<el-input
v-model="formData.qualification.corporate_account"
placeholder="请输入对公账号"
clearable
:disabled="isDisabled"
:style="{ width: '300px' }"
></el-input>
<el-form-item label="对公账号" :rules="[
{ required: true, message: '请输入对公账号', trigger: 'blur' },
]" prop="qualification.corporate_account">
<el-input v-model="formData.qualification.corporate_account" placeholder="请输入对公账号" clearable
:disabled="isDisabled" :style="{ width: '300px' }"></el-input>
</el-form-item>
<el-form-item
label="公司类型"
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]"
prop="company_type"
>
<el-select
:disabled="isDisabled"
v-model="formData.company_type"
placeholder="请选择公司类型"
clearable
@change="company_type_change"
>
<el-option
v-for="(item, index) in datas.dictTypeLists"
:key="index"
:label="item.name"
:value="item.id"
></el-option>
<el-form-item label="开户行名称" label-width="150px" prop="qualification.corporate_bank" :rules="[
{ required: true, message: '请输入开户行名称', trigger: 'blur' },
]">
<el-input :disabled="isDisabled" v-model="formData.qualification.corporate_bank" placeholder="请输入开户行名称" clearable
:style="{ width: '300px' }"></el-input>
</el-form-item>
<el-form-item label="开户行地址">
<el-input :disabled="isDisabled" v-model="formData.qualification.corporate_bank_address" placeholder="请输入开户行地址" clearable
:style="{ width: '300px' }"></el-input>
</el-form-item>
<el-form-item label="公司类型" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" prop="company_type">
<el-select :disabled="isDisabled" v-model="formData.company_type" placeholder="请选择公司类型" clearable
@change="company_type_change">
<el-option v-for="(item, index) in datas.dictTypeLists" :key="index" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item
label="省"
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]"
prop="province"
>
<el-select
:disabled="isDisabled"
v-model="formData.province"
placeholder="请选择省"
clearable
@change="province_change"
:style="{ width: '100%' }"
>
<el-option
v-for="(item, index) in datas.provinceOptions"
:key="index"
:label="item.province_name"
:value="item.province_code"
></el-option>
<el-form-item label="省" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" prop="province">
<el-select :disabled="isDisabled" v-model="formData.province" placeholder="请选择省" clearable
@change="province_change" :style="{ width: '100%' }">
<el-option v-for="(item, index) in datas.provinceOptions" :key="index" :label="item.province_name"
:value="item.province_code"></el-option>
</el-select>
</el-form-item>
<el-form-item
label="市"
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]"
prop="city"
>
<el-select
:disabled="isDisabled"
v-model="formData.city"
placeholder="请选择市"
clearable
@change="city_change"
:style="{ width: '100%' }"
>
<el-option
v-for="(item, index) in datas.cityOptions"
:key="index"
:label="item.city_name"
:value="item.city_code"
></el-option>
<el-form-item label="市" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]" prop="city">
<el-select :disabled="isDisabled" v-model="formData.city" placeholder="请选择市" clearable @change="city_change"
:style="{ width: '100%' }">
<el-option v-for="(item, index) in datas.cityOptions" :key="index" :label="item.city_name"
:value="item.city_code"></el-option>
</el-select>
</el-form-item>
<el-form-item
v-if="isArea"
label="区"
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]"
prop="area"
>
<el-select
:disabled="isDisabled"
v-model="formData.area"
placeholder="请选择区"
clearable
@change="area_change"
:style="{ width: '100%' }"
>
<el-option
v-for="(item, index) in datas.areaOptions"
:key="index"
:label="item.area_name"
:value="item.area_code"
:disabled="item.disabled"
></el-option>
<el-form-item v-if="isArea" label="区" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]"
prop="area">
<el-select :disabled="isDisabled" v-model="formData.area" placeholder="请选择区" clearable @change="area_change"
:style="{ width: '100%' }">
<el-option v-for="(item, index) in datas.areaOptions" :key="index" :label="item.area_name"
:value="item.area_code" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
<el-form-item
v-if="isStreet"
label="镇"
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]"
prop="street"
>
<el-select
:disabled="isDisabled"
v-model="formData.street"
placeholder="请选择镇"
clearable
@change="street_change"
:style="{ width: '100%' }"
>
<el-option
v-for="(item, index) in datas.streetOptions"
:key="index"
:label="item.street_name"
:value="item.street_code"
:disabled="item.disabled"
></el-option>
<el-form-item v-if="isStreet" label="镇" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]"
prop="street">
<el-select :disabled="isDisabled" v-model="formData.street" placeholder="请选择镇" clearable
@change="street_change" :style="{ width: '100%' }">
<el-option v-for="(item, index) in datas.streetOptions" :key="index" :label="item.street_name"
:value="item.street_code" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
<el-form-item
v-if="isVillage"
label="村"
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]"
prop="village"
>
<el-select
:disabled="isDisabled"
v-model="formData.village"
placeholder="请选择村"
clearable
@change="village_change"
:style="{ width: '100%' }"
>
<el-option
v-for="(item, index) in datas.villageOptions"
:key="index"
:label="item.village_name"
:value="item.village_code"
:disabled="item.disabled"
></el-option>
<el-form-item v-if="isVillage" label="村" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]"
prop="village">
<el-select :disabled="isDisabled" v-model="formData.village" placeholder="请选择村" clearable
@change="village_change" :style="{ width: '100%' }">
<el-option v-for="(item, index) in datas.villageOptions" :key="index" :label="item.village_name"
:value="item.village_code" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
<el-form-item
v-if="isBrigade"
label="队"
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]"
prop="brigade"
>
<el-select
:disabled="isDisabled"
v-model="formData.brigade"
placeholder="请选择队"
clearable
:style="{ width: '100%' }"
>
<el-option
v-for="(item, index) in datas.brigadeOptions"
:key="index"
:label="item.brigade_name"
:value="item.id"
:disabled="item.disabled"
></el-option>
<el-form-item v-if="isBrigade" label="队" :rules="[{ required: true, message: '不可为空', trigger: 'blur' }]"
prop="brigade">
<el-select :disabled="isDisabled" v-model="formData.brigade" placeholder="请选择队" clearable
:style="{ width: '100%' }">
<el-option v-for="(item, index) in datas.brigadeOptions" :key="index" :label="item.brigade_name"
:value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
<el-form-item label="地址" prop="address">
<el-input
:disabled="isDisabled"
v-model="formData.address"
placeholder="请输入地址"
clearable
:style="{ width: '300px' }"
></el-input>
<el-input :disabled="isDisabled" v-model="formData.address" placeholder="请输入地址" clearable
:style="{ width: '300px' }"></el-input>
</el-form-item>
<el-col :span="23">
<el-form-item label="负责区域" prop="region">
<el-checkbox-group
v-model="formData.responsible_area"
@change="handleCheckedCitiesChange"
:disabled="isDisabled ||formData.company_type==17"
>
<el-checkbox
:disabled="
formData[regionType] == city[regionType + '_code'] ||
formData[regionType] == city.id ||
city.disabled
"
v-for="city in datas[regionType + 'Options']"
:key="city[regionType + '_name']"
:label="
regionType == 'brigade'
? city.id + ''
: city[regionType + '_code'] + ''
"
>{{ city[regionType + "_name"] }}</el-checkbox
>
<el-checkbox-group v-model="formData.responsible_area" @change="handleCheckedCitiesChange"
:disabled="isDisabled || formData.company_type == 17">
<el-checkbox :disabled="formData[regionType] == city[regionType + '_code'] ||
formData[regionType] == city.id ||
city.disabled
" v-for="city in datas[regionType + 'Options']" :key="city[regionType + '_name']" :label="regionType == 'brigade'
? city.id + ''
: city[regionType + '_code'] + ''
">{{ city[regionType + "_name"] }}</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-col>
@ -249,22 +122,10 @@
<el-aside width="190px" style="display: flex">
<span style="color: #f56c6c; padding-left: 20px">*</span>
<div class="headimg" style="margin-left: 5px">
<el-upload
:disabled="isDisabled"
:accept="acceptFileTypes"
v-model="formData.avatar"
class="avatar-uploader-head"
:data="{ cid: 1 }"
:headers="{ Token: userStore.token }"
:action="base_url + '/upload/image'"
:show-file-list="false"
:on-success="handleAvatarSuccessAvatar"
>
<img
v-if="formData.avatar"
:src="formData.avatar"
class="avatar"
/>
<el-upload :disabled="isDisabled" :accept="acceptFileTypes" v-model="formData.avatar"
class="avatar-uploader-head" :data="{ cid: 1 }" :headers="{ Token: userStore.token }"
:action="base_url + '/upload/image'" :show-file-list="false" :on-success="handleAvatarSuccessAvatar">
<img v-if="formData.avatar" :src="formData.avatar" class="avatar" />
<div v-else class="avatar-uploader-icon">
<el-icon>
<Plus />
@ -279,60 +140,31 @@
<div class="right" style="max-width: 1100px">
<el-row>
<el-form-item label="姓名" prop="master_name">
<el-input
:disabled="isDisabled"
v-model="formData.master_name"
placeholder="请输入姓名"
clearable
:style="{ width: '450px' }"
></el-input>
<el-input :disabled="isDisabled" v-model="formData.master_name" placeholder="请输入姓名" clearable
:style="{ width: '450px' }"></el-input>
</el-form-item>
<el-form-item label="职务" prop="master_position">
<el-input
:disabled="isDisabled"
v-model="formData.master_position"
placeholder="请输入职务"
clearable
:style="{ width: '450px' }"
></el-input>
<el-input :disabled="isDisabled" v-model="formData.master_position" placeholder="请输入职务" clearable
:style="{ width: '450px' }"></el-input>
</el-form-item>
<el-form-item label="手机" prop="master_phone">
<el-input
:disabled="isDisabled"
v-model="formData.master_phone"
placeholder="请输入手机"
clearable
:style="{ width: '450px' }"
></el-input>
<el-input :disabled="isDisabled" v-model="formData.master_phone" placeholder="请输入手机" clearable
:style="{ width: '450px' }"></el-input>
</el-form-item>
<el-form-item label="邮箱">
<el-input
disabled
v-model="formData.master_email"
placeholder="邮箱将由系统自动生成"
clearable
:style="{ width: '450px' }"
></el-input>
<el-input disabled v-model="formData.master_email" placeholder="邮箱将由系统自动生成" clearable
:style="{ width: '450px' }"></el-input>
</el-form-item>
<el-form-item label="性别" prop="sex">
<el-select
:disabled="isDisabled"
v-model="formData.sex"
placeholder="请选择性别"
:style="{ width: '450px' }"
>
<el-select :disabled="isDisabled" v-model="formData.sex" placeholder="请选择性别"
:style="{ width: '450px' }">
<el-option label="男" value="1" />
<el-option label="女" value="2" />
</el-select>
</el-form-item>
<el-form-item label="身份证">
<el-input
:disabled="isDisabled"
v-model="formData.id_card"
placeholder="请输入身份证"
clearable
:style="{ width: '450px' }"
></el-input>
<el-input :disabled="isDisabled" v-model="formData.id_card" placeholder="请输入身份证" clearable
:style="{ width: '450px' }"></el-input>
</el-form-item>
<!--
<el-form-item label="片区经理" prop="area_manager_name">
@ -357,73 +189,38 @@
<div class="tit">其他联系人</div>
<el-row>
<template
v-for="(item, index) in formData.other_contacts"
:key="index"
>
<template v-for="(item, index) in formData.other_contacts" :key="index">
<el-col :span="12">
<el-form-item label="姓名" prop="field120">
<el-input
:disabled="isDisabled"
v-model="item.name"
placeholder="请输入姓名"
clearable
:style="{ width: '100%' }"
></el-input>
<el-input :disabled="isDisabled" v-model="item.name" placeholder="请输入姓名" clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="职务" prop="field121">
<el-input
:disabled="isDisabled"
v-model="item.position"
placeholder="请输入职务"
clearable
:style="{ width: '100%' }"
></el-input>
<el-input :disabled="isDisabled" v-model="item.position" placeholder="请输入职务" clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="手机" prop="field122">
<el-input
:disabled="isDisabled"
v-model="item.phone"
placeholder="请输入手机"
clearable
:style="{ width: '100%' }"
></el-input>
<el-input :disabled="isDisabled" v-model="item.phone" placeholder="请输入手机" clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="邮箱">
<el-input
:disabled="isDisabled"
v-model="item.email"
placeholder="请输入邮箱"
clearable
:style="{ width: '100%' }"
></el-input>
<el-input :disabled="isDisabled" v-model="item.email" placeholder="请输入邮箱" clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
</template>
<el-col :span="24">
<el-form-item label prop="field126">
<el-button
type="primary"
:disabled="isDisabled"
size="medium"
@click="other"
>添加联系人</el-button
>
<el-button
v-if="formData.other_contacts.length"
type="primary"
:disabled="isDisabled"
size="medium"
@click="otherdelete"
>删除</el-button
>
<el-button type="primary" :disabled="isDisabled" size="medium" @click="other">添加联系人</el-button>
<el-button v-if="formData.other_contacts.length" type="primary" :disabled="isDisabled" size="medium"
@click="otherdelete">删除</el-button>
</el-form-item>
</el-col>
</el-row>
@ -435,47 +232,24 @@
<el-row>
<el-col :span="12">
<el-form-item label="公司资质" required>
<el-upload
:disabled="isDisabled"
:accept="acceptFileTypes"
v-model="formData.qualification.business_license"
class="pl-3 avatar-uploader"
:data="{ cid: 1 }"
:headers="{ Token: userStore.token }"
:action="base_url + '/upload/image'"
:show-file-list="false"
:on-success="handleAvatarSuccess"
>
<img
v-if="formData.qualification.business_license"
:src="formData.qualification.business_license"
class="avatar"
/>
<el-upload :disabled="isDisabled" :accept="acceptFileTypes"
v-model="formData.qualification.business_license" class="pl-3 avatar-uploader" :data="{ cid: 1 }"
:headers="{ Token: userStore.token }" :action="base_url + '/upload/image'" :show-file-list="false"
:on-success="handleAvatarSuccess">
<img v-if="formData.qualification.business_license" :src="formData.qualification.business_license"
class="avatar" />
<el-icon v-else class="avatar-uploader-icon">
<Plus />
</el-icon>
</el-upload>
</el-form-item>
<el-form-item class="others" label="其他资质">
<div
v-for="(v, i) in formData.qualification.other_qualifications"
:key="i"
class="otherimg"
>
<div v-for="(v, i) in formData.qualification.other_qualifications" :key="i" class="otherimg">
<img :src="v" @click="clickdelete(i)" />
</div>
<el-upload
v-if="imgflag"
:accept="acceptFileTypes"
:disabled="isDisabled"
class="pl-3 avatar-uploader"
:data="{ cid: 1 }"
:headers="{ Token: userStore.token }"
:action="base_url + '/upload/image'"
:show-file-list="false"
:on-success="handleAvatarSuccess_two"
style="margin-bottom: 12px"
>
<el-upload v-if="imgflag" :accept="acceptFileTypes" :disabled="isDisabled" class="pl-3 avatar-uploader"
:data="{ cid: 1 }" :headers="{ Token: userStore.token }" :action="base_url + '/upload/image'"
:show-file-list="false" :on-success="handleAvatarSuccess_two" style="margin-bottom: 12px">
<el-icon class="avatar-uploader-icon">
<Plus />
</el-icon>
@ -484,22 +258,12 @@
</el-col>
<el-col :span="12">
<el-form-item label-width="120px" label="开户许可证" required>
<el-upload
:disabled="isDisabled"
:accept="acceptFileTypes"
v-model="formData.qualification.business_licenseB"
class="pl-3 avatar-uploader"
:data="{ cid: 1 }"
:headers="{ Token: userStore.token }"
:action="base_url + '/upload/image'"
:show-file-list="false"
:on-success="handleAvatarSuccessB"
>
<img
v-if="formData.qualification.business_licenseB"
:src="formData.qualification.business_licenseB"
class="avatar"
/>
<el-upload :disabled="isDisabled" :accept="acceptFileTypes"
v-model="formData.qualification.business_licenseB" class="pl-3 avatar-uploader" :data="{ cid: 1 }"
:headers="{ Token: userStore.token }" :action="base_url + '/upload/image'" :show-file-list="false"
:on-success="handleAvatarSuccessB">
<img v-if="formData.qualification.business_licenseB" :src="formData.qualification.business_licenseB"
class="avatar" />
<el-icon v-else class="avatar-uploader-icon">
<Plus />
</el-icon>
@ -516,14 +280,8 @@
<el-row>
<el-col :span="12">
<el-form-item label="签约方" prop="field130">
<el-input
v-model="formData.party_a_name"
placeholder="请选择签约方"
clearable
:style="{ width: '100%' }"
:disabled="!partyDisabled || isDisabled"
@click="openCompany"
></el-input>
<el-input v-model="formData.party_a_name" placeholder="请选择签约方" clearable :style="{ width: '100%' }"
:disabled="!partyDisabled || isDisabled" @click="openCompany"></el-input>
<!-- <el-select
:disabled="partyDisabled"
v-model="formData.party_a_name"
@ -541,52 +299,25 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label-width="100px"
label="被签约公司"
prop="field131"
>
<el-input
:disabled="true"
v-model="formData.company_name"
placeholder="请输入被签约公司"
clearable
:style="{ width: '100%' }"
></el-input>
<el-form-item label-width="100px" label="被签约公司" prop="field131">
<el-input :disabled="true" v-model="formData.company_name" placeholder="请输入被签约公司" clearable
:style="{ width: '100%' }"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label-width="100px"
label="合同类型"
prop="contract_type"
>
<el-select
:disabled="isDisabled"
v-model="formData.contract.contract_type"
placeholder="请选择合同类型"
clearable
:style="{ width: '100%' }"
>
<el-option
v-for="(item, index) in datas.contract_type"
:key="index"
:label="item.name"
:value="item.id"
></el-option>
<el-form-item label-width="100px" label="合同类型" prop="contract_type">
<el-select :disabled="isDisabled" v-model="formData.contract.contract_type" placeholder="请选择合同类型" clearable
:style="{ width: '100%' }">
<el-option v-for="(item, index) in datas.contract_type" :key="index" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label-width="100px" label="合同编号" prop="field133">
<el-input
placeholder="系统自动生成"
v-model="formData.contract.contract_no"
clearable
:style="{ width: '100%' }"
:disabled="true"
></el-input>
<el-input placeholder="系统自动生成" v-model="formData.contract.contract_no" clearable :style="{ width: '100%' }"
:disabled="true"></el-input>
</el-form-item>
</el-col>
</el-row>
@ -612,23 +343,11 @@
</el-row>
</el-col> -->
<el-col
v-if="(isDisabled == false && isEdit == false) || isEdit"
:span="24"
class="pt-6 el-card"
>
<el-col v-if="(isDisabled == false && isEdit == false) || isEdit" :span="24" class="pt-6 el-card">
<el-form-item label prop="field139">
<el-button v-if="isEdit" type="primary" size="medium" @click="create"
>完成</el-button
>
<el-button
v-if="isDisabled == false && isEdit == false"
type="primary"
:disabled="isDisabled"
size="medium"
@click="create"
>创建</el-button
>
<el-button v-if="isEdit" type="primary" size="medium" @click="create">完成</el-button>
<el-button v-if="isDisabled == false && isEdit == false" type="primary" :disabled="isDisabled" size="medium"
@click="create">创建</el-button>
</el-form-item>
</el-col>
</el-form>
@ -715,6 +434,7 @@ if (route.query.edit) {
}
//
const formData = reactive({
admin_id: "",
admin_name: "",
area_manager: "",
@ -748,6 +468,8 @@ const formData = reactive({
other_qualifications: [],
bank_accountB: [],
bank_account: [],
corporate_bank: "",
corporate_bank_address: "",
},
contract: {
contract_type: "",

View File

@ -1,179 +0,0 @@
<template>
<div class="edit-popup">
<popup
ref="popupRef"
:title="popupTitle"
:async="true"
width="550px"
@confirm="handleSubmit"
@close="handleClose"
>
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
<el-form-item label="主题" prop="title">
<el-input v-model="formData.title" clearable placeholder="请输入主题" />
</el-form-item>
<el-form-item label="任务角色id 1镇合伙人公司负责人2镇合伙人公司市场部长3镇合伙人公司服务部长4村联络员5小组服务团队" prop="task_role_id">
<el-select class="flex-1" v-model="formData.task_role_id" clearable placeholder="请选择任务角色id 1镇合伙人公司负责人2镇合伙人公司市场部长3镇合伙人公司服务部长4村联络员5小组服务团队">
<el-option
v-for="(item, index) in dictData.create_task_template_select_role"
:key="index"
:label="item.name"
:value="parseInt(item.value)"
/>
</el-select>
</el-form-item>
<el-form-item label="任务类型" prop="type">
<el-select class="flex-1" v-model="formData.type" clearable placeholder="请选择任务类型">
<el-option
v-for="(item, index) in dictData.village_task_type"
:key="index"
:label="item.name"
:value="parseInt(item.value)"
/>
</el-select>
</el-form-item>
<el-form-item label="一阶天数" prop="stage_day_one">
<el-input v-model="formData.stage_day_one" clearable placeholder="请输入一阶天数" />
</el-form-item>
<el-form-item label="第一阶段金额" prop="money">
<el-input v-model="formData.money" clearable placeholder="请输入第一阶段金额" />
</el-form-item>
<el-form-item label="一阶比例" prop="proportion_one">
<el-input v-model="formData.proportion_one" clearable placeholder="请输入一阶比例" />
</el-form-item>
<el-form-item label="二阶天数 0代表无天数" prop="stage_day_two">
<el-input v-model="formData.stage_day_two" clearable placeholder="请输入二阶天数 0代表无天数" />
</el-form-item>
<el-form-item label="二阶比例" prop="proportion_two">
<el-input v-model="formData.proportion_two" clearable placeholder="请输入二阶比例" />
</el-form-item>
<el-form-item label="二阶段金额" prop="money_two">
<el-input v-model="formData.money_two" clearable placeholder="请输入二阶段金额" />
</el-form-item>
<el-form-item label="三阶段天数" prop="stage_day_three">
<el-input v-model="formData.stage_day_three" clearable placeholder="请输入三阶段天数" />
</el-form-item>
<el-form-item label="三阶段金额" prop="new_money_three">
<el-input v-model="formData.new_money_three" clearable placeholder="请输入三阶段金额" />
</el-form-item>
<el-form-item label="长期金额" prop="money_longtime">
<el-input v-model="formData.money_longtime" clearable placeholder="请输入长期金额" />
</el-form-item>
<el-form-item label="1循环2长期3单次" prop="types">
<el-input v-model="formData.types" clearable placeholder="请输入1循环2长期3单次" />
</el-form-item>
<el-form-item label="扩展字段" prop="extend">
<el-input v-model="formData.extend" clearable placeholder="请输入扩展字段" />
</el-form-item>
<el-form-item label="充值金额" prop="recharge">
<el-input v-model="formData.recharge" clearable placeholder="请输入充值金额" />
</el-form-item>
<el-form-item label="任务描述" prop="content">
<el-input v-model="formData.content" clearable placeholder="请输入任务描述" />
</el-form-item>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="createTaskTemplateEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiCreateTaskTemplateAdd, apiCreateTaskTemplateEdit, apiCreateTaskTemplateDetail } from '@/api/create_task_template'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑任务创建模板' : '新增任务创建模板'
})
//
const formData = reactive({
id: '',
title: '',
task_role_id: '',
type: '',
stage_day_one: '',
money: '',
proportion_one: '',
stage_day_two: '',
proportion_two: '',
money_two: '',
stage_day_three: '',
new_money_three: '',
money_longtime: '',
types: '',
extend: '',
recharge: '',
content: '',
})
//
const formRules = reactive<any>({
})
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiCreateTaskTemplateDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
await formRef.value?.validate()
const data = { ...formData, }
mode.value == 'edit'
? await apiCreateTaskTemplateEdit(data)
: await apiCreateTaskTemplateAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -1,230 +0,0 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form
class="mb-[-16px]"
:model="queryParams"
inline
>
<el-form-item label="主题" prop="title">
<el-input class="w-[280px]" v-model="queryParams.title" clearable placeholder="请输入主题" />
</el-form-item>
<el-form-item label="创建人" prop="admin_id">
<el-input class="w-[280px]" v-model="queryParams.admin_id" clearable placeholder="请输入创建人" />
</el-form-item>
<el-form-item label="任务角色id 1镇合伙人公司负责人2镇合伙人公司市场部长3镇合伙人公司服务部长4村联络员5小组服务团队" prop="task_role_id">
<el-select class="w-[280px]" v-model="queryParams.task_role_id" clearable placeholder="请选择任务角色id 1镇合伙人公司负责人2镇合伙人公司市场部长3镇合伙人公司服务部长4村联络员5小组服务团队">
<el-option label="全部" value=""></el-option>
<el-option
v-for="(item, index) in dictData.create_task_template_select_role"
:key="index"
:label="item.name"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="任务类型" prop="type">
<el-select class="w-[280px]" v-model="queryParams.type" clearable placeholder="请选择任务类型">
<el-option label="全部" value=""></el-option>
<el-option
v-for="(item, index) in dictData.village_task_type"
:key="index"
:label="item.name"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="一阶天数" prop="stage_day_one">
<el-input class="w-[280px]" v-model="queryParams.stage_day_one" clearable placeholder="请输入一阶天数" />
</el-form-item>
<el-form-item label="第一阶段金额" prop="money">
<el-input class="w-[280px]" v-model="queryParams.money" clearable placeholder="请输入第一阶段金额" />
</el-form-item>
<el-form-item label="一阶比例" prop="proportion_one">
<el-input class="w-[280px]" v-model="queryParams.proportion_one" clearable placeholder="请输入一阶比例" />
</el-form-item>
<el-form-item label="二阶天数 0代表无天数" prop="stage_day_two">
<el-input class="w-[280px]" v-model="queryParams.stage_day_two" clearable placeholder="请输入二阶天数 0代表无天数" />
</el-form-item>
<el-form-item label="二阶比例" prop="proportion_two">
<el-input class="w-[280px]" v-model="queryParams.proportion_two" clearable placeholder="请输入二阶比例" />
</el-form-item>
<el-form-item label="二阶段金额" prop="money_two">
<el-input class="w-[280px]" v-model="queryParams.money_two" clearable placeholder="请输入二阶段金额" />
</el-form-item>
<el-form-item label="三阶段天数" prop="stage_day_three">
<el-input class="w-[280px]" v-model="queryParams.stage_day_three" clearable placeholder="请输入三阶段天数" />
</el-form-item>
<el-form-item label="三阶段金额" prop="new_money_three">
<el-input class="w-[280px]" v-model="queryParams.new_money_three" clearable placeholder="请输入三阶段金额" />
</el-form-item>
<el-form-item label="长期金额" prop="money_longtime">
<el-input class="w-[280px]" v-model="queryParams.money_longtime" clearable placeholder="请输入长期金额" />
</el-form-item>
<el-form-item label="1循环2长期3单次" prop="types">
<el-input class="w-[280px]" v-model="queryParams.types" clearable placeholder="请输入1循环2长期3单次" />
</el-form-item>
<el-form-item label="扩展字段" prop="extend">
<el-input class="w-[280px]" v-model="queryParams.extend" clearable placeholder="请输入扩展字段" />
</el-form-item>
<el-form-item label="充值金额" prop="recharge">
<el-input class="w-[280px]" v-model="queryParams.recharge" clearable placeholder="请输入充值金额" />
</el-form-item>
<el-form-item label="任务描述" prop="content">
<el-input class="w-[280px]" v-model="queryParams.content" clearable placeholder="请输入任务描述" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<el-button v-perms="['create_task_template/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button
v-perms="['create_task_template/delete']"
:disabled="!selectData.length"
@click="handleDelete(selectData)"
>
删除
</el-button>
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="主题" prop="title" show-overflow-tooltip />
<el-table-column label="创建人" prop="admin_id" show-overflow-tooltip />
<el-table-column label="任务角色id 1镇合伙人公司负责人2镇合伙人公司市场部长3镇合伙人公司服务部长4村联络员5小组服务团队" prop="task_role_id">
<template #default="{ row }">
<dict-value :options="dictData.create_task_template_select_role" :value="row.task_role_id" />
</template>
</el-table-column>
<el-table-column label="任务类型" prop="type">
<template #default="{ row }">
<dict-value :options="dictData.village_task_type" :value="row.type" />
</template>
</el-table-column>
<el-table-column label="一阶天数" prop="stage_day_one" show-overflow-tooltip />
<el-table-column label="第一阶段金额" prop="money" show-overflow-tooltip />
<el-table-column label="一阶比例" prop="proportion_one" show-overflow-tooltip />
<el-table-column label="二阶天数 0代表无天数" prop="stage_day_two" show-overflow-tooltip />
<el-table-column label="二阶比例" prop="proportion_two" show-overflow-tooltip />
<el-table-column label="二阶段金额" prop="money_two" show-overflow-tooltip />
<el-table-column label="三阶段天数" prop="stage_day_three" show-overflow-tooltip />
<el-table-column label="三阶段金额" prop="new_money_three" show-overflow-tooltip />
<el-table-column label="长期金额" prop="money_longtime" show-overflow-tooltip />
<el-table-column label="1循环2长期3单次" prop="types" show-overflow-tooltip />
<el-table-column label="扩展字段" prop="extend" show-overflow-tooltip />
<el-table-column label="充值金额" prop="recharge" show-overflow-tooltip />
<el-table-column label="任务描述" prop="content" show-overflow-tooltip />
<el-table-column label="删除时间" prop="delete_time" show-overflow-tooltip />
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button
v-perms="['create_task_template/edit']"
type="primary"
link
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-perms="['create_task_template/delete']"
type="danger"
link
@click="handleDelete(row.id)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
</div>
</template>
<script lang="ts" setup name="createTaskTemplateLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiCreateTaskTemplateLists, apiCreateTaskTemplateDelete } from '@/api/create_task_template'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
//
const queryParams = reactive({
title: '',
admin_id: '',
task_role_id: '',
type: '',
stage_day_one: '',
money: '',
proportion_one: '',
stage_day_two: '',
proportion_two: '',
money_two: '',
stage_day_three: '',
new_money_three: '',
money_longtime: '',
types: '',
extend: '',
recharge: '',
content: ''
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('create_task_template_select_role,village_task_type')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiCreateTaskTemplateLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.setFormData(data)
}
//
const handleDelete = async (id: number | any[]) => {
await feedback.confirm('确定要删除?')
await apiCreateTaskTemplateDelete({ id })
getLists()
}
getLists()
</script>