فهرست منبع

commit 仓库

xkwg 4 سال پیش
والد
کامیت
0728aa8bb8

+ 2 - 2
src/services/funcode/index.ts

@@ -69,8 +69,8 @@ export const funCode: Code = {
     DeliveryGoodsCancelRsp: 1900674, // 现货品种停用响应
 
     // 仓库信息
-    WareHouseApplyReq: 1900685,     /// 仓库申请请求
-    WareHouseApplyRsp: 1900686,    /// 仓库申请响应
+    WarehouseApplyReq: 1900685,     /// 仓库申请请求
+    WarehouseApplyRsp: 1900686,    /// 仓库申请响应
     WarehouseStateChangeReq: 1900687,    /// 仓库状态修改请求
     WarehouseStateChangeRsp: 1900688,    /// 仓库状态修改响应
 

+ 1 - 1
src/services/proto/warehouse/index.ts

@@ -34,7 +34,7 @@ export const addWarehouseApply = (param: WarehouseApplyReq): Promise<any> => {
         const package50 = buildProtoReq50(params);
         APP.sendTradingServer(package50, undefined, {
             onSuccess: (res) => {
-                const { isSuccess, result } = parseProtoRsp50(res, 'WareHouseApplyRsp');
+                const { isSuccess, result } = parseProtoRsp50(res, 'WarehouseApplyRsp');
                 if (isSuccess) {
                     resolve(result);
                 } else {

+ 35 - 5
src/views/information/warehouse-info/compoments/add/index.vue

@@ -8,6 +8,10 @@
            @cancel="cancel"
            width="890px">
     <template #footer>
+        <a-button key="submit"
+                  type="primary"
+                  :loading="loading"
+                  @click="cancel">取消</a-button>
       <a-button key="submit"
                 type="primary"
                 :loading="loading"
@@ -128,19 +132,25 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, ref, toRaw } from 'vue';
+import {defineComponent, PropType, ref, toRaw} from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
-import { initData } from '@/common/methods/index';
 import { getAddress } from '@/services/go/adress';
 import { handleForm, getWarehouseType, FormState, warehouseApply } from '../setup';
 import { ValidateErrorEntity } from 'ant-design-vue/lib/form/interface';
 import { AllEnums } from '@/services/go/commonService/interface';
 import { WarehouseApplyReq } from '@/services/proto/warehouse/interface';
+import {ErmcpWareHouseInfo} from "@/services/go/ermcp/warehouse-info/interface";
 
 export default defineComponent({
     name: 'warehouse_info_btn_add',
     components: {},
-    setup() {
+    props: {
+        selectedRow: {
+            type: Object as PropType<ErmcpWareHouseInfo>,
+            default: {},
+        },
+    },
+    setup(props, context) {
         const { visible, cancel } = closeModal('warehouse_info_btn_add');
         const loading = ref<boolean>(false);
         const { cityList, districtList, provinceList, getCityList, getDistrictList } = getAddress();
@@ -150,8 +160,28 @@ export default defineComponent({
             formRef.value
                 .validate()
                 .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);
                 })
                 .catch((error: ValidateErrorEntity<FormState>) => {

+ 28 - 6
src/views/information/warehouse-info/compoments/modify/index.vue

@@ -8,10 +8,14 @@
            @cancel="cancel"
            width="890px">
     <template #footer>
+        <a-button key="submit"
+                  type="primary"
+                  :loading="loading"
+                  @click="cancel">关闭</a-button>
       <a-button key="submit"
                 type="primary"
                 :loading="loading"
-                @click="submit">完成</a-button>
+                @click="submit">修改</a-button>
     </template>
     <a-form class="inlineForm"
             ref="formRef"
@@ -148,7 +152,7 @@ export default defineComponent({
         },
     },
     components: {},
-    setup(props) {
+    setup(props,context) {
         const { visible, cancel } = closeModal('warehouse_info_btn_modify');
         const loading = ref<boolean>(false);
         const { cityList, districtList, provinceList, getCityList, getDistrictList } = getAddress();
@@ -164,10 +168,28 @@ export default defineComponent({
             formRef.value
                 .validate()
                 .then(() => {
-                    const param = toRaw(formState) as WarehouseApplyReq;
-                    param.type = 2;
-                    warehouseApply(param, loading);
-                    console.log('param', param);
+                    const param = toRaw(formState);
+                    const reqParam: WarehouseApplyReq = {
+                        type: 2,// int32 类型 1 新增 2 修改
+                        warehouseid: props.selectedRow.autoid, // uint64 仓库ID
+                        warehousecode: props.selectedRow.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 => {
+
+                        })
                 })
                 .catch((error: ValidateErrorEntity<FormState>) => {
                     console.log('error', error);

+ 0 - 1
src/views/information/warehouse-info/compoments/setup.ts

@@ -123,7 +123,6 @@ export function warehouseApply(param: WarehouseApplyReq, loading: Ref<boolean>)
     loading.value = true
     // 获取提示信息
     const sign = getRequestResultInfo(warehouseApplyRequestResultMsg, param.type)  // 接口请求后的返回提示 这里统一进行管理
-    addWarehouseApply(param)
     // 接口调用
     const result = addWarehouseApply(param)
     // 接口调用结果处理,提示成功或者失败信息,并关闭loading效果

+ 2 - 1
src/views/information/warehouse-info/list/normal-use/index.vue

@@ -26,7 +26,8 @@
       </a-table>
     </contextMenu>
     <!-- 新增仓库信息 -->
-    <Add />
+    <Add  :selectedRow="selectedRow"
+          @refresh="queryTable" />
     <!-- 停用仓库信息 -->
     <Disable :selectedRow="selectedRow"
              @refresh="queryTable" />