|
@@ -8,6 +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"
|
|
<a-button key="submit"
|
|
|
type="primary"
|
|
type="primary"
|
|
|
:loading="loading"
|
|
:loading="loading"
|
|
@@ -128,19 +132,25 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
-import { defineComponent, ref, toRaw } from 'vue';
|
|
|
|
|
|
|
+import {defineComponent, PropType, ref, toRaw} from 'vue';
|
|
|
import { closeModal } from '@/common/setup/modal/index';
|
|
import { closeModal } from '@/common/setup/modal/index';
|
|
|
-import { initData } from '@/common/methods/index';
|
|
|
|
|
import { getAddress } from '@/services/go/adress';
|
|
import { getAddress } from '@/services/go/adress';
|
|
|
import { handleForm, getWarehouseType, FormState, warehouseApply } from '../setup';
|
|
import { handleForm, getWarehouseType, FormState, warehouseApply } from '../setup';
|
|
|
import { ValidateErrorEntity } from 'ant-design-vue/lib/form/interface';
|
|
import { ValidateErrorEntity } from 'ant-design-vue/lib/form/interface';
|
|
|
import { AllEnums } from '@/services/go/commonService/interface';
|
|
import { AllEnums } from '@/services/go/commonService/interface';
|
|
|
import { WarehouseApplyReq } from '@/services/proto/warehouse/interface';
|
|
import { WarehouseApplyReq } from '@/services/proto/warehouse/interface';
|
|
|
|
|
+import {ErmcpWareHouseInfo} from "@/services/go/ermcp/warehouse-info/interface";
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
name: 'warehouse_info_btn_add',
|
|
name: 'warehouse_info_btn_add',
|
|
|
components: {},
|
|
components: {},
|
|
|
- setup() {
|
|
|
|
|
|
|
+ props: {
|
|
|
|
|
+ selectedRow: {
|
|
|
|
|
+ type: Object as PropType<ErmcpWareHouseInfo>,
|
|
|
|
|
+ default: {},
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+ setup(props, context) {
|
|
|
const { visible, cancel } = closeModal('warehouse_info_btn_add');
|
|
const { visible, cancel } = closeModal('warehouse_info_btn_add');
|
|
|
const loading = ref<boolean>(false);
|
|
const loading = ref<boolean>(false);
|
|
|
const { cityList, districtList, provinceList, getCityList, getDistrictList } = getAddress();
|
|
const { cityList, districtList, provinceList, getCityList, getDistrictList } = getAddress();
|
|
@@ -150,8 +160,28 @@ export default defineComponent({
|
|
|
formRef.value
|
|
formRef.value
|
|
|
.validate()
|
|
.validate()
|
|
|
.then(() => {
|
|
.then(() => {
|
|
|
- const param = toRaw(formState) as WarehouseApplyReq;
|
|
|
|
|
- warehouseApply(param, loading);
|
|
|
|
|
|
|
+ const param = toRaw(formState)
|
|
|
|
|
+ const reqParam: WarehouseApplyReq = {
|
|
|
|
|
+ type: 1,// int32 类型 1 新增 2 修改
|
|
|
|
|
+ warehouseid: param.warehouseid, // uint64 仓库ID
|
|
|
|
|
+ warehousecode: param.warehousecode, // 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 区
|
|
|
|
|
+ address: param.address, // string 详细地址
|
|
|
|
|
+ contactname: param.contactname, // string 联系人
|
|
|
|
|
+ contactnum: param.contactnum, // string 联系电话
|
|
|
|
|
+ }
|
|
|
|
|
+ warehouseApply(reqParam, loading)
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ cancel()
|
|
|
|
|
+ context.emit("refresh")
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(err => {
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
console.log('param', param);
|
|
console.log('param', param);
|
|
|
})
|
|
})
|
|
|
.catch((error: ValidateErrorEntity<FormState>) => {
|
|
.catch((error: ValidateErrorEntity<FormState>) => {
|