|
@@ -8,10 +8,10 @@
|
|
|
@cancel="cancel"
|
|
@cancel="cancel"
|
|
|
width="890px">
|
|
width="890px">
|
|
|
<template #footer>
|
|
<template #footer>
|
|
|
- <a-button key="submit"
|
|
|
|
|
- type="primary"
|
|
|
|
|
- :loading="loading"
|
|
|
|
|
- @click="cancel">关闭</a-button>
|
|
|
|
|
|
|
+ <a-button key="submit"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ :loading="loading"
|
|
|
|
|
+ @click="cancel">关闭</a-button>
|
|
|
<a-button key="submit"
|
|
<a-button key="submit"
|
|
|
type="primary"
|
|
type="primary"
|
|
|
:loading="loading"
|
|
:loading="loading"
|
|
@@ -84,7 +84,7 @@
|
|
|
<a-select class="inlineFormSelect"
|
|
<a-select class="inlineFormSelect"
|
|
|
style="width: 205px"
|
|
style="width: 205px"
|
|
|
v-model:value="formState.provinceid"
|
|
v-model:value="formState.provinceid"
|
|
|
- @change="getCityList"
|
|
|
|
|
|
|
+ @change="provinceChange"
|
|
|
placeholder="请选择省">
|
|
placeholder="请选择省">
|
|
|
<a-select-option v-for="item in provinceList"
|
|
<a-select-option v-for="item in provinceList"
|
|
|
:key="item.autoid"
|
|
:key="item.autoid"
|
|
@@ -95,7 +95,7 @@
|
|
|
<a-select class="inlineFormSelect ml9"
|
|
<a-select class="inlineFormSelect ml9"
|
|
|
style="width: 205px"
|
|
style="width: 205px"
|
|
|
v-model:value="formState.cityid"
|
|
v-model:value="formState.cityid"
|
|
|
- @change="getDistrictList"
|
|
|
|
|
|
|
+ @change="cityChange"
|
|
|
placeholder="请选择市">
|
|
placeholder="请选择市">
|
|
|
<a-select-option v-for="item in cityList"
|
|
<a-select-option v-for="item in cityList"
|
|
|
:key="item.autoid"
|
|
:key="item.autoid"
|
|
@@ -152,7 +152,7 @@ export default defineComponent({
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
components: {},
|
|
components: {},
|
|
|
- setup(props,context) {
|
|
|
|
|
|
|
+ setup(props, context) {
|
|
|
const { visible, cancel } = closeModal('warehouse_info_btn_modify');
|
|
const { visible, cancel } = closeModal('warehouse_info_btn_modify');
|
|
|
const loading = ref<boolean>(false);
|
|
const loading = ref<boolean>(false);
|
|
|
const { cityList, districtList, provinceList, getCityList, getDistrictList } = getAddress();
|
|
const { cityList, districtList, provinceList, getCityList, getDistrictList } = getAddress();
|
|
@@ -162,6 +162,13 @@ export default defineComponent({
|
|
|
if (props.selectedRow.warehousename) {
|
|
if (props.selectedRow.warehousename) {
|
|
|
console.log('props.selectedRow,', props.selectedRow);
|
|
console.log('props.selectedRow,', props.selectedRow);
|
|
|
mergeTwoObj(formState, props.selectedRow);
|
|
mergeTwoObj(formState, props.selectedRow);
|
|
|
|
|
+ const { provinceid, cityid } = props.selectedRow;
|
|
|
|
|
+ if (provinceid) {
|
|
|
|
|
+ getCityList(provinceid);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (cityid) {
|
|
|
|
|
+ getDistrictList(cityid);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
function submit() {
|
|
function submit() {
|
|
@@ -170,31 +177,38 @@ export default defineComponent({
|
|
|
.then(() => {
|
|
.then(() => {
|
|
|
const param = toRaw(formState);
|
|
const param = toRaw(formState);
|
|
|
const reqParam: WarehouseApplyReq = {
|
|
const reqParam: WarehouseApplyReq = {
|
|
|
- type: 2,// int32 类型 1 新增 2 修改
|
|
|
|
|
|
|
+ type: 2, // int32 类型 1 新增 2 修改
|
|
|
warehouseid: props.selectedRow.autoid, // uint64 仓库ID
|
|
warehouseid: props.selectedRow.autoid, // uint64 仓库ID
|
|
|
warehousecode: props.selectedRow.warehousecode, // string 仓库代码
|
|
warehousecode: props.selectedRow.warehousecode, // string 仓库代码
|
|
|
warehousename: param.warehousename, // string 仓库名称
|
|
warehousename: param.warehousename, // string 仓库名称
|
|
|
- warehousetype: undefined === param.warehousetype ? 0 : param.warehousetype as number, // int32 仓库类型 - 1 厂库 2 自有库 3 合作库
|
|
|
|
|
- provinceid: undefined === param.provinceid ? 0 : param.provinceid as number, // uint64 省
|
|
|
|
|
- cityid: undefined === param.cityid ? 0 : param.cityid as number, // uint64 市
|
|
|
|
|
- districtid: undefined === param.districtid ? 0 : param.districtid as number, // int32 区
|
|
|
|
|
|
|
+ warehousetype: undefined === param.warehousetype ? 0 : (param.warehousetype as number), // int32 仓库类型 - 1 厂库 2 自有库 3 合作库
|
|
|
|
|
+ provinceid: undefined === param.provinceid ? 0 : (param.provinceid as number), // uint64 省
|
|
|
|
|
+ cityid: undefined === param.cityid ? 0 : (param.cityid as number), // uint64 市
|
|
|
|
|
+ districtid: undefined === param.districtid ? 0 : (param.districtid as number), // int32 区
|
|
|
address: param.address, // string 详细地址
|
|
address: param.address, // string 详细地址
|
|
|
contactname: param.contactname, // string 联系人
|
|
contactname: param.contactname, // string 联系人
|
|
|
contactnum: param.contactnum, // string 联系电话
|
|
contactnum: param.contactnum, // string 联系电话
|
|
|
- }
|
|
|
|
|
|
|
+ };
|
|
|
warehouseApply(reqParam, loading)
|
|
warehouseApply(reqParam, loading)
|
|
|
- .then(res => {
|
|
|
|
|
- cancel()
|
|
|
|
|
- context.emit("refresh")
|
|
|
|
|
- })
|
|
|
|
|
- .catch(err => {
|
|
|
|
|
-
|
|
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ cancel();
|
|
|
|
|
+ context.emit('refresh');
|
|
|
})
|
|
})
|
|
|
|
|
+ .catch((err) => {});
|
|
|
})
|
|
})
|
|
|
.catch((error: ValidateErrorEntity<FormState>) => {
|
|
.catch((error: ValidateErrorEntity<FormState>) => {
|
|
|
console.log('error', error);
|
|
console.log('error', error);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+ function provinceChange(id: number) {
|
|
|
|
|
+ getCityList(id);
|
|
|
|
|
+ formState.cityid = undefined;
|
|
|
|
|
+ formState.districtid = undefined;
|
|
|
|
|
+ }
|
|
|
|
|
+ function cityChange(id: number) {
|
|
|
|
|
+ getDistrictList(id);
|
|
|
|
|
+ formState.districtid = undefined;
|
|
|
|
|
+ }
|
|
|
return {
|
|
return {
|
|
|
visible,
|
|
visible,
|
|
|
cancel,
|
|
cancel,
|
|
@@ -204,8 +218,8 @@ export default defineComponent({
|
|
|
cityList,
|
|
cityList,
|
|
|
districtList,
|
|
districtList,
|
|
|
provinceList,
|
|
provinceList,
|
|
|
- getCityList,
|
|
|
|
|
- getDistrictList,
|
|
|
|
|
|
|
+ provinceChange,
|
|
|
|
|
+ cityChange,
|
|
|
formRef,
|
|
formRef,
|
|
|
formState,
|
|
formState,
|
|
|
rules,
|
|
rules,
|