Przeglądaj źródła

款项登记 入库登记

Administrator 4 lat temu
rodzic
commit
f132266889

+ 2 - 2
src/services/proto/contract/interface.ts

@@ -69,8 +69,8 @@ export interface SettlementReq {
 
 // 款项登记
 export interface FundsReq {
-    PayAmount: number
-    DeductAmount: number
+    PayAmount?: number
+    DeductAmount?: number
 }
 
 // 发票登记

+ 43 - 66
src/views/business/purchase/components/funds/index.vue

@@ -46,100 +46,71 @@
         </a-row>
         <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-item label="合同签署量">
-              <span class="white">{{ formatValue(selectedRow.qty + selectedRow.enumdicname) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="合同暂定价">
-              <span class="white">{{ formatValue(selectedRow.price) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="点价合约">
-              <span class="white">{{ formatValue(selectedRow.goodsname) }}</span>
+            <a-form-item label="暂定价货款总额">
+              <span class="white">{{ selectedRow.pricetype === 3 ? formatValue(selectedRow.loanamount) : 0 }}</span>
             </a-form-item>
           </a-col>
         </a-row>
       </a-form>
     </fieldset>
+
     <fieldset class="formFieldSet">
       <legend>已登记信息</legend>
       <a-form class="inlineForm">
         <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-item label="已定价">
-              <span class="white">{{ selectedRow.pricedqty + selectedRow.enumdicname }}</span>
+            <a-form-item label="已定价额">
+              <span class="white">{{ selectedRow.pricedamount }}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
-            <a-form-item label="已点均价">
-              <span class="white">{{ formatValue(selectedRow.pricedavg) }}</span>
+            <a-form-item label="调整金额">
+              <span class="white">{{ selectedRow.reckonadjustamount }}</span>
             </a-form-item>
           </a-col>
         </a-row>
-      </a-form>
-    </fieldset>
-    <fieldset class="formFieldSet">
-      <legend>本次点价信息</legend>
-      <a-form class="inlineForm"
-              ref="formRef"
-              :model="formState"
-              :rules="rules">
-        <a-row :gutter="24">
+
+          <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-item label="点价价格"
-                         name="PricedPrice">
-              <a-input-number class="dialogInput"
-                              style="width: 200px"
-                              v-model:value="formState.PricedPrice"
-                              :min="0"
-                              placeholder="请输入点价价格" />
+            <a-form-item label="货款总额">
+              <span class="white">{{ selectedRow.pricedamount + selectedRow.reckonadjustamount }}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
-            <a-form-item label="升贴水">
-              <span class="white">{{ formatValue(selectedRow.pricemove) }}</span>
+            <a-form-item label="保证金">
+              <span class="white">{{ selectedRow.margin }}</span>
             </a-form-item>
           </a-col>
         </a-row>
 
         <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-item label="商品价格">
-              <span class="white">{{ Number(selectedRow.pricemove) + Number(formState.PricedPrice) }}</span>
+            <a-form-item label="其他费用">
+              <span class="white">{{ selectedRow.reckonotheramount }}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
-            <a-form-item label="点价数量"
-                         name="PricedQty"
-                         class="relative">
-              <a-input-number class="dialogInput"
-                              style="width: 200px"
-                              v-model:value="formState.PricedQty"
-                              :min="0"
-                              :max="selectedRow.unpricedqty"
-                              placeholder="请输入点价数量" />
-              <div class="tip">
-                <span>未定价量<span class="white">{{selectedRow.unpricedqty}}{{selectedRow.enumdicname}} </span></span>
-                <a class="blue ml10"
-                   @click="formState.PricedQty = selectedRow.unpricedqty"> 全部登记</a>
-              </div>
+            <a-form-item label="合计总额">
+              <span class="white">{{ formatValue(selectedRow.pricedavg) }}</span>
             </a-form-item>
           </a-col>
         </a-row>
 
         <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-item label="点价金额">
-              <span class="white">{{( Number(selectedRow.pricemove) + Number(formState.PricedPrice)) * formState.PricedQty }}</span>
+            <a-form-item label="已支付额">
+              <span class="white">{{ selectedRow.payamount }}</span>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="预计款额">
+              <span class="white">{{ selectedRow.prepayamount }}</span>
             </a-form-item>
           </a-col>
         </a-row>
       </a-form>
     </fieldset>
+
     <fieldset class="formFieldSet">
       <legend>本次款项信息</legend>
       <a-form class="inlineForm"
@@ -149,13 +120,13 @@
         <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="应付款额"
-                         name="PricedPrice">
+                         name="unpayamount">
               <span class="white">10000000.00元</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
             <a-form-item label="款项类型">
-              <a-radio-group class="commonRadioGroup">
+              <a-radio-group class="commonRadioGroup"  v-model:value="formState.payType" >
                 <a-radio :value="1">付款申请</a-radio>
                 <a-radio :value="2">退款通知</a-radio>
               </a-radio-group>
@@ -164,11 +135,13 @@
         </a-row>
         <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-item label="登记金额">
-               <a-input class="dialogInput"
+            <a-form-item label="登记金额" name="Amount">
+               <a-input-number class="dialogInput"
                               style="width: 200px"
                               suffix="元"
-                              placeholder="请输入登记金额" />
+                              type="number"
+                              placeholder="请输入登记金额"
+                              v-model:value="formState.Amount" />
             </a-form-item>
           </a-col>
           <a-col :span="24">
@@ -177,7 +150,8 @@
                          class="relative">
               <a-input class="dialogInput"
                               style="width: 608px"
-                              placeholder="请输入备注信息" />
+                              placeholder="请输入备注信息" 
+                              v-model:value="formState.Remark"/>
             </a-form-item>
           </a-col>
         </a-row>
@@ -213,15 +187,18 @@ export default defineComponent({
         const loading = ref<boolean>(false);
         const { rules, formState, formRef } = handleForm();
         function submit() {
+            console.log(props.selectedRow)
             const wrapEl = unref(formRef);
             wrapEl.validate().then(() => {
-                loading.value = true;
-                const params: FundsReq = {
-                    PayAmount: 98,
-                    DeductAmount: 90,
-                };
+                loading.value = true
+                const params:any = {}
+                if(formState.payType === 1){
+                  params.PayAmount = Number(formState.Amount)
+                }else {
+                  params.DeductAmount = Number(formState.Amount)
+                }
                 // 发出发票登记
-                fundsReq(props.selectedRow.spotcontractid, params, loading)
+                fundsReq(props.selectedRow.spotcontractid, params, loading,formState.Remark)
                     .then(() => {
                         cancel();
                         context.emit('refresh');

+ 7 - 6
src/views/business/purchase/components/funds/setup.ts

@@ -5,17 +5,18 @@ import { reactive, ref, UnwrapRef } from "vue";
  */
 export function handleForm() {
     interface FormState {
-        PayAmount: number | null
-        DeductAmount: number | null
+        payType: number 
+        Amount: number | null
+        Remark:String
     }
     const formRef = ref();
     const formState: UnwrapRef<FormState> = reactive({
-        PayAmount: null,
-        DeductAmount: null,
+        payType: 1,
+        Amount: null,
+        Remark:''
     })
     const rules = {
-        // PricedPrice: [{ required: true, message: '请输入点价价格', trigger: 'blur', type: 'number' }],
-        // PricedQty: [{ required: true, message: '请输入点价数量', trigger: 'blur', type: 'number' }],
+        Amount: [{ required: true, message: '请输入登记价格', trigger: 'blur', type: 'number' }],
     }
     return { rules, formState, formRef }
 }

+ 3 - 2
src/views/business/purchase/components/setup.ts

@@ -50,7 +50,7 @@ export function settlementReq(spotcontractid: string, req: SettlementReq, loadin
 /**
  * 款项登记
  */
-export function fundsReq(spotcontractid: string, req: FundsReq, loading: Ref<boolean>): Promise<string> {
+export function fundsReq(spotcontractid: string, req: FundsReq, loading: Ref<boolean>,Remark:String): Promise<string> {
     return operationContractRsp(3,
         operationContractReqBuilder(req, spotcontractid, 3),
         loading)
@@ -81,9 +81,10 @@ export function storageReq(req: ERMCPAreaInOutStockApplyReq, loading: Ref<boolea
  * @param id 操作的合同id
  * @param type 操作类型
  */
-export function operationContractReqBuilder(req: Object, id: string, type: number): ErmcpContractOperateApplyReq {
+export function operationContractReqBuilder(req: Object, id: string, type: number,Remark?:String): ErmcpContractOperateApplyReq {
     return {
         OperateType: 1, // uint32 操作类型-1:登记2:确认3:拒绝4:撤销
+        Remark:'',
         Info: {
             OperateApplyType: type, // uint32 操作申请类型-1:点价2:结算3:款项4:发票
             RelatedID: Long.fromString(id), // uint64 现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)

+ 80 - 45
src/views/business/purchase/components/storage/index.vue

@@ -9,7 +9,7 @@
     <template #footer>
       <a-button key="submit"
                 class="cancelBtn"
-                >取消</a-button>
+                @click="cancel">取消</a-button>
       <a-button key="submit"
                 type="primary"
                 :loading="loading"
@@ -17,23 +17,30 @@
     </template>
     <a-form class="inlineForm"
             ref="formRef"
+            :model="formState"
+            :rules="rules"
             >
       <fieldset class="formFieldSet">
         <legend>合同基本信息</legend>
         <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="合同编号">
-              <span class="white">NPCQ-2020121001</span>
+              <span class="white">{{ formatValue(selectedRow.contractno) }}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
-            <a-form-item label="销售方">
-              <span class="white">江西铜业集团</span>
+            <a-form-item :label="selectedRow.contracttype===1? '采购方': '销售方'">
+              <span class="white">{{ formatValue(selectedRow.accountname) }}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
             <a-form-item label="现货品种">
-              <span class="white">铜板</span>
+              <span class="white">{{formatValue(selectedRow.deliverygoodsname)}}</span>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="合同签署量">
+              <span class="white">{{formatValue(selectedRow.qty)}}</span>
             </a-form-item>
           </a-col>
         </a-row>
@@ -70,42 +77,41 @@
             <a-form-item label="品类">
               <a-select class="inlineFormSelect"
                         style="width: 200px"
-                        placeholder="请选择品类">
-                <a-select-option value="品牌一">
-                  品牌一
-                </a-select-option>
+                        placeholder="请选择品类"
+                        v-model:value="selectedRow.wrstandardid"
+                        disabled>
+                  <a-select-option v-for="option in gmlist" :key="option.wrstandardid" :value="option.wrstandardid">{{option.wrstandardname}}</a-select-option>
               </a-select>
             </a-form-item>
           </a-col>
           <a-col :span="12">
-            <a-form-item label="品牌">
+            <a-form-item label="品牌" name="SpotGoodsBrandID">
               <a-select class="inlineFormSelect"
                         style="width: 200px"
-                        placeholder="请选择品牌">
-                <a-select-option value="品牌一">
-                  品牌一
-                </a-select-option>
+                        placeholder="请选择品牌"
+                        v-model:value="formState.SpotGoodsBrandID">
+                  <a-select-option v-for="option in gblist" :key="option.brandid" :value="option.brandid">{{option.brandname}}</a-select-option>
               </a-select>
             </a-form-item>
           </a-col>
           <a-col :span="12">
-            <a-form-item label="入库仓库">
+            <a-form-item label="入库仓库" name="WarehouseInfo">
               <a-select class="inlineFormSelect"
                         style="width: 200px"
-                        placeholder="请选择入库仓库">
-                <a-select-option value="品牌一">
-                  品牌一
-                </a-select-option>
+                        placeholder="请选择入库仓库"
+                        v-model:value="formState.WarehouseInfo">
+                      <a-select-option v-for="option in wareHouseList" :key="option.autoid" :value="option.autoid">{{option.warehousename}}</a-select-option>
               </a-select>
             </a-form-item>
           </a-col>
           <a-col :span="12">
-            <a-form-item label="入库数量">
-              <a-input class="dialogInput"
+            <a-form-item label="入库数量" name="Qty">
+              <a-input-number class="dialogInput"
                         style="width: 200px"
                         suffix="单位"
-                        placeholder="请输入入库数量">
-              </a-input>
+                        placeholder="请输入入库数量"
+                        v-model:value="formState.Qty">
+              </a-input-number>
             </a-form-item>
           </a-col>
         </a-row>
@@ -115,13 +121,19 @@
 </template>
 
 <script lang="ts">
-import {defineComponent, PropType, ref} from 'vue';
+import {defineComponent, PropType, ref,unref,reactive} from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
 import {SomePriceReq} from "@/services/proto/contract/interface";
 import {somePriceReq, storageReq} from "@/views/business/purchase/components/setup";
 import {Ermcp3SellBuyContract} from "@/services/go/ermcp/purchase/interface";
 import {ERMCPAreaInOutStockApplyReq} from "@/services/proto/warehouse/interface";
+import { QueryWareHouse } from '@/services/go/ermcp/warehouse-info/index';
 import * as Long from "long";
+import { formatValue } from '@/common/methods';
+import { handleForm } from './setup';
+import APP from "@/services";
+import { initData } from '@/common/methods';
+import { ErmcpWareHouseInfo } from '@/views/information/warehouse-info/list';
 
 export default defineComponent({
     name: 'purchase_pending_storage',
@@ -134,35 +146,58 @@ export default defineComponent({
     },
     setup(props, context) {
         const { visible, cancel } = closeModal('purchase_pending_storage');
+        const { rules, formState, formRef } = handleForm();
         const loading = ref<boolean>(false);
-        function submit() {
-
-            const params : ERMCPAreaInOutStockApplyReq = {
-                InOutType: 1,  //  1:采购入库 2:销售出库 3:生产入库 4:生产出库
-                WRStandardID: props.selectedRow.wrstandardid,  //品类ID
-                SpotGoodsBrandID: props.selectedRow.spotgoodsbrandid,  //现货品牌ID(DGFactoryItem表的ID)
-                DeliveryGoodsID: props.selectedRow.deliverygoodsid,  //现货商品ID
-                SpotContractID: Long.fromString(props.selectedRow.spotcontractid),  //合同ID
-                WarehouseInfo: 8,   // uint64 现货仓库ID
-                Qty: 10,  // double 数量
-                ApplyRemark: "",  // string 申请备注
-            }
-            // 入库
-            storageReq(
-                params, loading)
-                .then(res => {
-                    cancel()
-                    context.emit('refresh')
-                })
-                .catch(err => {
+        const wareHouseList = ref<ErmcpWareHouseInfo[]>([]);
+        const gblist = ref<[]>([]);
+        const gmlist = ref<[]>([]);
+        initData(()=>{
+          const deliverygoods = APP.get('DeliveryGoodsList').find((x:any) => x.deliverygoodsid === props.selectedRow.deliverygoodsid);
+          gblist.value = deliverygoods&&deliverygoods.gblist;
+          gmlist.value = deliverygoods&&deliverygoods.gmlist;
+          // 查询仓库信息
+          QueryWareHouse("1")
+            .then((res) => {
+                wareHouseList.value = res;
+            })
+        })
 
-                })
+        function submit() {
+            console.log(props.selectedRow)
+            console.log(wareHouseList)
+            const wrapEl = unref(formRef);
+            wrapEl.validate().then(() => {
+                const params : ERMCPAreaInOutStockApplyReq = {
+                    InOutType: 1,  //  1:采购入库 2:销售出库 3:生产入库 4:生产出库
+                    WRStandardID: props.selectedRow.wrstandardid,  //品类ID
+                    SpotGoodsBrandID: formState.SpotGoodsBrandID || 0,  //现货品牌ID(DGFactoryItem表的ID)
+                    DeliveryGoodsID: props.selectedRow.deliverygoodsid,  //现货商品ID
+                    SpotContractID: Long.fromString(props.selectedRow.spotcontractid),  //合同ID
+                    WarehouseInfo: formState.WarehouseInfo || 0,   // uint64 现货仓库ID
+                    Qty: formState.Qty  || 0,  // double 数量
+                    ApplyRemark: "",  // string 申请备注
+                }
+                // 入库
+                storageReq(params, loading)
+                    .then(res => {
+                        cancel()
+                        context.emit('refresh')
+                    })
+                    .catch(err => {})
+            });
         }
         return {
             visible,
             cancel,
             submit,
             loading,
+            formatValue,
+            rules, 
+            formState, 
+            formRef,
+            wareHouseList,
+            gblist,
+            gmlist,
         };
     },
 });

+ 24 - 0
src/views/business/purchase/components/storage/setup.ts

@@ -0,0 +1,24 @@
+import { reactive, ref, UnwrapRef } from "vue";
+/**
+ * 表单
+ * @returns 
+ */
+export function handleForm() {
+    interface FormState {
+        SpotGoodsBrandID: number | null // 品牌
+        WarehouseInfo: number | null // 入库仓库
+        Qty: number | null // 入库数量
+    }
+    const formRef = ref();
+    const formState: UnwrapRef<FormState> = reactive({
+        SpotGoodsBrandID: null, // 品牌
+        WarehouseInfo:  null, // 入库仓库
+        Qty: null, // 入库数量
+    })
+    const rules = {
+        SpotGoodsBrandID: [{ required: true, message: '请选择品牌', trigger: 'blur', type: 'number' }],
+        WarehouseInfo: [{ required: true, message: '请选择入库仓库', trigger: 'blur', type: 'number' }],
+        Qty: [{ required: true, message: '请输入入库数量', trigger: 'blur', type: 'number' }],
+    }
+    return { rules, formState, formRef }
+}