This commit is contained in:
weiz 2024-01-21 15:19:49 +08:00
parent 9fdf783320
commit aa7896e19b

View File

@ -10,15 +10,6 @@
<el-step title="事业部总经理审批" />
<el-step title="销售副总" />
</el-steps>
<div style="display: flex; flex-direction: row-reverse; justify-content: flex-start;margin-bottom: 30px;">
<el-select class="w-[180px]" v-model="formData.dept_id" clearable placeholder="请选择部门">
<el-option v-for="(item, index) in list2" :key="index" :label="item.name" :value="item.id" />
</el-select>
<el-select class="w-[180px]" v-model="formData.org_id" clearable placeholder="请选择组织" @change="deptrmt">
<el-option v-for="(item, index) in list1" :key="index" :label="item.name" :value="item.id" />
</el-select>
</div>
<el-row>
<el-col :span="8">
<el-form-item label="标书编号" prop="buy_bidding_document_id" @click="showDialog = true"
@ -332,8 +323,6 @@ const bid_address = ref('')
const tableData = ref([{}])
const list1 = reactive([])
const list2 = reactive([])
import { deptAll } from '@/api/org/department'
import { getAll } from '@/api/org/organization'
import configs from "@/config"
const base_url = configs.baseUrl + configs.urlPrefix
import useUserStore from "@/stores/modules/user";
@ -446,8 +435,6 @@ const popupTitle = computed(() => {
//
const formData = reactive({
id: '',
dept_id: '',
org_id: '',
approve_id: 0,
buy_bidding_document_id: '',
@ -505,35 +492,6 @@ const customEvent1 = (e: any) => {
const formRules = reactive<any>({
})
//
const getlist = () => {
getAll().then((res) => {
Object.assign(list1, res)
if (res.length > 0 && !formData.org_id) {
formData.org_id = res[0].id
deptAll({ 'org_id': res[0].id }).then((res) => {
if (res.length > 0) {
Object.assign(list2, res)
formData.dept_id = res[0].id
}
})
}
})
}
//
const deptrmt = (e: any) => {
formData.dept_id = ''
getlist1(e)
}
//
const getlist1 = (id: any) => {
deptAll({ 'org_id': id }).then((res) => {
list2.splice(0, list2.length, ...res)
})
}
//
const setFormData = async (data: Record<any, any>) => {