|
@@ -21,6 +21,7 @@
|
|
|
disabled
|
|
|
class="code-input"
|
|
|
placeholder="请填写基本信息后生成编号"
|
|
|
+ :style="{ width: isEditType ? '100%' : 'auto' }"
|
|
|
/>
|
|
|
<el-button type="primary" @click="customerCode" class="code-button" v-if="!isEditType"
|
|
|
>生成编号</el-button
|
|
@@ -30,7 +31,10 @@
|
|
|
<tr>
|
|
|
<td class="th">所属公司:</td>
|
|
|
<td>
|
|
|
- <CompanySelect v-model="queryParams.belongCompanyId" :isDisabled="customerId" />
|
|
|
+ <CompanySelect
|
|
|
+ v-model="queryParams.belongCompanyId"
|
|
|
+ :isDisabled="customerId ? true : false"
|
|
|
+ />
|
|
|
</td>
|
|
|
<td class="th">客户类型:</td>
|
|
|
<td>
|
|
@@ -52,6 +56,7 @@
|
|
|
<tr>
|
|
|
<td class="th">所属区域:</td>
|
|
|
<td>
|
|
|
+ <!-- <AreaSelectTree v-model="queryParams.xzqdm" :defaultValue="defaultAreaCode" /> -->
|
|
|
<AreaSelectTree v-model="queryParams.xzqdm" />
|
|
|
</td>
|
|
|
<td class="th">联系地址:</td>
|
|
@@ -77,8 +82,8 @@
|
|
|
<tr>
|
|
|
<td class="th">开户银行账号:</td>
|
|
|
<td><el-input clearable v-model="queryParams.bankaccount" /></td>
|
|
|
- <td class="th">排序序号:</td>
|
|
|
- <td><el-input clearable v-model="queryParams.indexCode" /></td>
|
|
|
+ <!-- <td class="th">排序序号:</td>
|
|
|
+ <td><el-input disabled v-model="queryParams.indexCode" /></td> -->
|
|
|
</tr>
|
|
|
</table>
|
|
|
</div>
|
|
@@ -177,8 +182,7 @@ const queryParams = ref<ICustomer>({
|
|
|
description: '',
|
|
|
taxNumber: '',
|
|
|
phone: '',
|
|
|
- bankaccount: '',
|
|
|
- indexCode: ''
|
|
|
+ bankaccount: ''
|
|
|
})
|
|
|
|
|
|
// 客户类型
|
|
@@ -201,6 +205,7 @@ onMounted(() => {
|
|
|
if (propId) {
|
|
|
customerId.value = propId
|
|
|
queryParams.value.pid = propId
|
|
|
+ getCustomerDetail(propId, true)
|
|
|
}
|
|
|
// 如果是编辑
|
|
|
if (isEdit && propId) {
|
|
@@ -210,7 +215,9 @@ onMounted(() => {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
-const getCustomerDetail = async (id) => {
|
|
|
+// const defaultAreaCode = ref('') // 所属区域默认值
|
|
|
+
|
|
|
+const getCustomerDetail = async (id, child?: boolean) => {
|
|
|
// 获取当前路由id及周报详情
|
|
|
try {
|
|
|
const result: any = await request.get(
|
|
@@ -220,8 +227,14 @@ const getCustomerDetail = async (id) => {
|
|
|
},
|
|
|
'/business'
|
|
|
)
|
|
|
+ if (result && child) {
|
|
|
+ // 新增下级客户回填公司和区域
|
|
|
+ queryParams.value.belongCompanyId = result.belongCompanyId
|
|
|
+ queryParams.value.belongCompanyName = result.belongCompanyName
|
|
|
+ queryParams.value.xzqdm = result.xzqdm
|
|
|
+ }
|
|
|
|
|
|
- if (result) {
|
|
|
+ if (result && !child) {
|
|
|
queryParams.value = {
|
|
|
id: result.id,
|
|
|
customerName: result.customerName,
|
|
@@ -237,6 +250,7 @@ const getCustomerDetail = async (id) => {
|
|
|
bankaccount: result.bankaccount,
|
|
|
indexCode: result.indexCode
|
|
|
}
|
|
|
+ // defaultAreaCode.value = result.xzqdm
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.error('Error getting customer detail:', error)
|
|
@@ -501,7 +515,7 @@ const customerCode = () => {
|
|
|
}
|
|
|
|
|
|
.code-input {
|
|
|
- width: auto;
|
|
|
+ // width: auto;
|
|
|
}
|
|
|
.code-button {
|
|
|
margin-left: 20px;
|