Merge branch 'master' of http://git.excellentkk.cn/mkm/TaskSystem-admin
This commit is contained in:
commit
05b985475f
@ -44,3 +44,8 @@ export function generateGontract(params: any) {
|
||||
export function authentication(params: any) {
|
||||
return request.get({ url: '/company/authentication', params })
|
||||
}
|
||||
|
||||
// 平台公司
|
||||
export function companyListTwo(params: any) {
|
||||
return request.get({ url: '/company/list_two', params })
|
||||
}
|
@ -43,49 +43,59 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="companyLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiCompanyLists, apiCompanyDelete } from '@/api/company'
|
||||
import { defineEmits } from 'vue'
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import { apiCompanyLists, apiCompanyDelete } from "@/api/company";
|
||||
import { defineEmits } from "vue";
|
||||
|
||||
// 当前类型
|
||||
const props = defineProps({
|
||||
type: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
});
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
level_two: '',
|
||||
level_one: '',
|
||||
company_name: '',
|
||||
organization_code: '',
|
||||
city: '',
|
||||
area: '',
|
||||
street: '',
|
||||
company_type: '',
|
||||
master_name: '',
|
||||
master_position: '',
|
||||
master_phone: '',
|
||||
master_email: '',
|
||||
other_contacts: '',
|
||||
area_manager: '',
|
||||
is_contract: '',
|
||||
account: '',
|
||||
password: '',
|
||||
deposit: '',
|
||||
deposit_time: '',
|
||||
qualification: '',
|
||||
status: ''
|
||||
})
|
||||
level_two: "",
|
||||
level_one: "",
|
||||
company_name: "",
|
||||
organization_code: "",
|
||||
city: "",
|
||||
area: "",
|
||||
street: "",
|
||||
company_type: "",
|
||||
master_name: "",
|
||||
master_position: "",
|
||||
master_phone: "",
|
||||
master_email: "",
|
||||
other_contacts: "",
|
||||
area_manager: "",
|
||||
is_contract: "",
|
||||
account: "",
|
||||
password: "",
|
||||
deposit: "",
|
||||
deposit_time: "",
|
||||
qualification: "",
|
||||
status: "",
|
||||
});
|
||||
|
||||
if (props.type) queryParams.company_type = props.type;
|
||||
|
||||
// 选中数据
|
||||
const emits = defineEmits(['customEvent'])
|
||||
const emits = defineEmits(["customEvent"]);
|
||||
|
||||
// 选中数据子父传递
|
||||
const handleCurrentChange = (value: any) => {
|
||||
emits('customEvent', value)
|
||||
}
|
||||
emits("customEvent", value);
|
||||
};
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiCompanyLists,
|
||||
params: queryParams
|
||||
})
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
getLists()
|
||||
getLists();
|
||||
</script>
|
||||
|
@ -422,8 +422,23 @@
|
||||
placeholder="请选择签约方"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
:disabled="true"
|
||||
:disabled="!partyDisabled || isDisabled"
|
||||
@click="openCompany"
|
||||
></el-input>
|
||||
<!-- <el-select
|
||||
:disabled="partyDisabled"
|
||||
v-model="formData.party_a_name"
|
||||
placeholder="请选择签约方"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<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-col>
|
||||
<el-col :span="12">
|
||||
@ -493,10 +508,10 @@
|
||||
<el-col :span="24" class="el-card pt-6">
|
||||
<el-form-item label prop="field139">
|
||||
<el-button v-if="isEdit" type="primary" size="medium" @click="create"
|
||||
>修改</el-button
|
||||
>完成</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="isDisabled == false"
|
||||
v-if="isDisabled == false && isEdit == false"
|
||||
type="primary"
|
||||
:disabled="isDisabled"
|
||||
size="medium"
|
||||
@ -507,7 +522,7 @@
|
||||
</el-col>
|
||||
</el-form>
|
||||
<el-dialog v-model="isCompany" title="选择签约方" width="60%">
|
||||
<DialogIndex @customEvent="customEvent" />
|
||||
<DialogIndex @customEvent="customEvent" :type="indexType" />
|
||||
</el-dialog>
|
||||
<el-dialog v-model="isMan" title="选择管理人员" width="60%">
|
||||
<DialogIndexMan @customEvent="customEventMan" />
|
||||
@ -551,6 +566,9 @@ if (route.query.isshow) {
|
||||
imgflag = false
|
||||
isDisabled = true
|
||||
}
|
||||
console.log(isDisabled)
|
||||
// 公司类型
|
||||
const indexType = ref(0)
|
||||
|
||||
let isEdit = ref(false)
|
||||
defineProps({
|
||||
@ -627,7 +645,8 @@ const datas = reactive({
|
||||
villageOptions: [],
|
||||
brigadeOptions: [],
|
||||
dictTypeLists: [],
|
||||
contract_type: []
|
||||
contract_type: [],
|
||||
company_list: []
|
||||
})
|
||||
const fileList = ref<UploadUserFile[]>([])
|
||||
// 表单验证
|
||||
@ -689,6 +708,7 @@ const isArea = ref(false)
|
||||
const isStreet = ref(false)
|
||||
const isVillage = ref(false)
|
||||
const isBrigade = ref(false)
|
||||
const partyDisabled = ref(true)
|
||||
|
||||
function customEvent(data: any) {
|
||||
isCompany.value = false
|
||||
@ -801,8 +821,13 @@ function company_type_change(type: any) {
|
||||
isBrigade.value = false
|
||||
formData.village = ''
|
||||
formData.brigade = ''
|
||||
partyDisabled.value = true
|
||||
indexType.value = 30
|
||||
return true
|
||||
}
|
||||
if (type != 16) {
|
||||
partyDisabled.value = false
|
||||
}
|
||||
//村
|
||||
if (type == 17) {
|
||||
isArea.value = true
|
||||
@ -880,6 +905,10 @@ const getDetails = async () => {
|
||||
const data = await apiCompanyDetail({
|
||||
id: route.query.id
|
||||
})
|
||||
if (data.company_type == 16) {
|
||||
indexType.value = 30
|
||||
partyDisabled.value = true
|
||||
}
|
||||
Object.keys(formData).forEach((key) => {
|
||||
const stringArr = ['province', 'city', 'area', 'street', 'village', 'brigade']
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
|
@ -83,18 +83,18 @@
|
||||
创建
|
||||
</el-button>
|
||||
</router-link>
|
||||
|
||||
<router-link
|
||||
<!-- <router-link
|
||||
:to="{
|
||||
path: getRoutePath('company/add:edit'),
|
||||
query: {
|
||||
id: userStore.userInfo.company_id,
|
||||
read: true
|
||||
}
|
||||
read: true,
|
||||
},
|
||||
}"
|
||||
>
|
||||
<el-button type="primary" class="mb-4"> 我的公司 </el-button></router-link
|
||||
>
|
||||
<el-button type="primary" class="mb-4">
|
||||
我的公司
|
||||
</el-button></router-link -->
|
||||
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
@ -161,7 +161,7 @@
|
||||
edit: true
|
||||
}
|
||||
}"
|
||||
>编辑</router-link
|
||||
>合同签约</router-link
|
||||
>
|
||||
</el-button>
|
||||
<el-button
|
||||
@ -184,7 +184,7 @@
|
||||
v-perms="['company/initiate_contract']"
|
||||
type="primary"
|
||||
link
|
||||
@click="ShowInitiateContractPop(row)"
|
||||
@click="showChangeCompany(row)"
|
||||
>生成合同</el-button
|
||||
>
|
||||
<el-button
|
||||
@ -213,12 +213,85 @@
|
||||
</el-card>
|
||||
<el-dialog v-model="showInitiateContractPop" @close="offInitiateContractPop">
|
||||
<h1>重要提醒</h1>
|
||||
<div>
|
||||
<div class="content">请确认信息是否有误</div>
|
||||
<el-card>
|
||||
<el-col :span="24" class="el-card pt-6">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label-width="100px" label="签约方" prop="field130">
|
||||
<el-select
|
||||
v-model="contractFormData.party_a"
|
||||
placeholder="请选择签约方"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in company_list"
|
||||
:key="index"
|
||||
:label="item.company_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="field131"
|
||||
>
|
||||
<el-input
|
||||
:disabled="true"
|
||||
v-model="contractFormData.party_b_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
|
||||
v-model="contractFormData.contract_type"
|
||||
placeholder="请选择合同类型"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in 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="contractFormData.contract_no"
|
||||
clearable
|
||||
:style="{ width: '100%' }"
|
||||
:disabled="true"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-card>
|
||||
</div>
|
||||
<p class="btn_menu">
|
||||
<el-button type="primary" size="large" @click="InitiateContract"
|
||||
>确认创建</el-button
|
||||
>
|
||||
<el-button type="info" size="large" @click="offPop">返回</el-button>
|
||||
<el-button type="info" size="large" @click="offInitiateContractPop">返回</el-button>
|
||||
</p>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="showPop" @close="offPop">
|
||||
@ -246,16 +319,19 @@ import { useDictData } from '@/hooks/useDictOptions'
|
||||
import useUserStore from '@/stores/modules/user'
|
||||
import {
|
||||
apiCompanyLists,
|
||||
companyListTwo,
|
||||
apiCompanyDelete,
|
||||
generateGontract,
|
||||
sendMsgApi,
|
||||
authentication,
|
||||
apiCompanyDetail,
|
||||
initiate_contract
|
||||
} from '@/api/company'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import { dictDataLists } from '@/api/setting/dict'
|
||||
import { getRoutePath } from '@/router'
|
||||
import DialogIndex from './dialog_index.vue'
|
||||
|
||||
const userStore = useUserStore()
|
||||
console.log(userStore.userInfo.company_id)
|
||||
@ -272,22 +348,64 @@ const offPop = () => {
|
||||
const InitiateContractPop = ref(false)
|
||||
const showInitiateContractPop = ref(false)
|
||||
const offInitiateContractPop = () => {
|
||||
showPop.value = false
|
||||
showConctactPop.value = false
|
||||
showInitiateContractPop.value = false
|
||||
InitiateContractPop.value = false
|
||||
}
|
||||
// 创建合同的id
|
||||
const contractId = ref('')
|
||||
|
||||
const ShowInitiateContractPop = (row) => {
|
||||
;(InitiateContractPop.value = true),
|
||||
(showInitiateContractPop.value = true),
|
||||
(contractId.value = row.id)
|
||||
// 合同
|
||||
const contractFormData = ref({
|
||||
party_a: '',
|
||||
party_a_name: '',
|
||||
party_b: '',
|
||||
party_b_name: '',
|
||||
contract_type: '',
|
||||
contract_no: ''
|
||||
})
|
||||
|
||||
const company_list = ref([])
|
||||
const contract_type = ref([])
|
||||
|
||||
const getDetails = async (id: any) => {
|
||||
const data = await apiCompanyDetail({
|
||||
id: id
|
||||
})
|
||||
companyListTwo().then((res) => {
|
||||
company_list.value = res
|
||||
})
|
||||
dictDataLists({ type_id: 7 }).then((res) => {
|
||||
contract_type.value = res.lists
|
||||
})
|
||||
contractFormData.value.party_b = data.id
|
||||
contractFormData.value.party_b_name = data.company_name
|
||||
if (userStore.userInfo.company.id) {
|
||||
contractFormData.value.party_a = userStore.userInfo.company.id
|
||||
contractFormData.value.party_a_name = userStore.userInfo.company.company_name
|
||||
} else {
|
||||
contractFormData.value.party_a = ''
|
||||
contractFormData.value.party_a_name = ''
|
||||
}
|
||||
}
|
||||
|
||||
const showChangeCompany = (row: any) => {
|
||||
contractId.value = row.id
|
||||
getDetails(row.id)
|
||||
// showPop.value = true
|
||||
ShowInitiateContractPop()
|
||||
}
|
||||
|
||||
const ShowInitiateContractPop = () => {
|
||||
;(InitiateContractPop.value = true), (showInitiateContractPop.value = true)
|
||||
}
|
||||
const showCreateConctPop = (row) => {
|
||||
;(showPop.value = true), (showConctactPop.value = true), (contractId.value = row.id)
|
||||
}
|
||||
const InitiateContract = () => {
|
||||
initiate_contract({ id: contractId.value }).catch((res) => {
|
||||
initiate_contract({
|
||||
id: contractId.value,
|
||||
...contractFormData.value
|
||||
}).catch((res) => {
|
||||
console.log(res)
|
||||
})
|
||||
offInitiateContractPop()
|
||||
|
@ -70,10 +70,6 @@ watch(
|
||||
);
|
||||
// apiTaskList()
|
||||
|
||||
const test = (e: any) => {
|
||||
console.log(e);
|
||||
};
|
||||
|
||||
// 加载
|
||||
const loading = ref(true);
|
||||
|
||||
@ -126,7 +122,7 @@ const initShowDate = (dateStr = "") => {
|
||||
initShowDate();
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData("");
|
||||
// const { dictData } = useDictData("");
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user