Parcourir la source

commit 销售合同

xkwg il y a 4 ans
Parent
commit
d77b551437

+ 90 - 3
src/views/business/sell/components/detail/index.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 采购详情-->
-  <a-modal class="custom-detail"
+  <a-modal  class="commonModal paddingDialog purchase-detail"
            title="详情"
            v-model:visible="visible"
            @cancel="cancel"
@@ -12,17 +12,102 @@
                 :loading="loading"
                 @click="submit">关闭</a-button>
     </template>
-
+      <fieldset class="formFieldSet">
+          <legend>合同基本信息</legend>
+          <a-form class="inlineForm">
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="合同编号">
+                          <span class="white">{{ formatValue(selectedRow.contractno) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="合同类型">
+                          <span class="white">{{ getPriceTypeName(selectedRow.pricetype) }}</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.enumdicname) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="现货品种">
+                          <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</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.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>
+                  </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>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="已点均价">
+                          <span class="white">{{ formatValue(selectedRow.pricedavg) }}</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">{{ formatValue(selectedRow.pricemove) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+          </a-form>
+      </fieldset>
   </a-modal>
 </template>
 
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
+import {defineComponent, PropType, ref} from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
+import {formatValue} from "@/common/methods";
+import {getPriceTypeName} from "@/views/business/purchase/setup";
+import {Ermcp3SellBuyContract} from "@/services/go/ermcp/purchase/interface";
 
 export default defineComponent({
     name: 'sell-detail',
     components: {},
+    props: {
+        selectedRow: {
+            type: Object as PropType<Ermcp3SellBuyContract>,
+            default: {},
+        },
+    },
     setup() {
         const { visible, cancel } = closeModal('detail');
         const loading = ref<boolean>(false);
@@ -34,6 +119,8 @@ export default defineComponent({
             cancel,
             submit,
             loading,
+            formatValue,
+            getPriceTypeName,
         };
     },
 });

+ 164 - 5
src/views/business/sell/components/someprice/index.vue

@@ -1,6 +1,6 @@
 <template>
-  <!-- 采购点价登记-->
-  <a-modal class="custom-detail"
+  <!-- 销售点价登记-->
+  <a-modal class="commonModal someprice"
            title="点价登记"
            v-model:visible="visible"
            @cancel="cancel"
@@ -12,28 +12,187 @@
                 :loading="loading"
                 @click="submit">关闭</a-button>
     </template>
+      <fieldset class="formFieldSet">
+          <legend>合同基本信息</legend>
+          <a-form class="inlineForm">
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="合同编号">
+                          <span class="white">{{ formatValue(selectedRow.contractno) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="定价.
+                        类型">
+                          <span class="white">{{ getPriceTypeName(selectedRow.pricetype) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <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">{{ formatValue(selectedRow.deliverygoodsname) }}</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.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) + selectedRow.currencyname }}</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>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="已点均价">
+                          <span class="white">{{ formatValue(selectedRow.pricedavg)  + selectedRow.currencyname }}</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-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>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="升贴水">
+                          <span class="white">{{ formatValue(selectedRow.pricemove) }}</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>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="点价数量"
+                                   class="relative"
+                                   name="PricedQty">
+                          <a-input-number class="dialogInput"
+                                          style="width: 200px"
+                                          v-model:value="formState.PricedQty"
+                                          :min="0"
+                                          :max="selectedRow.unpricedqty"
+                                          placeholder="请输入点价数量" />
+                          <div class="tip mt10">
+                              <span>未定价量<span class="white">{{ selectedRow.unpricedqty }}{{ selectedRow.enumdicname }}</span> </span>
+                              <a class="blue ml10"
+                                 @click="formState.PricedQty = selectedRow.unpricedqty"> 全部登记</a>
+                          </div>
+                      </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
+                  }}{{selectedRow.currencyname}}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+          </a-form>
+      </fieldset>
   </a-modal>
 </template>
 
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
+import {defineComponent, PropType, ref, unref} from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
+import {Ermcp3SellBuyContract} from "@/services/go/ermcp/purchase/interface";
+import {SomePriceReq} from "@/services/proto/contract/interface";
+import {somePriceReq} from "@/views/business/purchase/components/setup";
+import {handleForm} from "@/views/business/purchase/components/someprice/setup";
+import {formatValue} from "@/common/methods";
+import {getPriceTypeName} from "@/views/business/purchase/setup";
 
 export default defineComponent({
     name: 'sell_pending_someprice',
     components: {},
-    setup() {
+    props: {
+        selectedRow: {
+            type: Object as PropType<Ermcp3SellBuyContract>,
+            default: {},
+        },
+    },
+    setup(props , context) {
         const { visible, cancel } = closeModal('sell_pending_someprice');
         const loading = ref<boolean>(false);
+        const { rules, formState, formRef } = handleForm();
         function submit() {
-            cancel();
+            const wrapEl = unref(formRef);
+            wrapEl.validate().then(() => {
+                loading.value = true;
+                const params: SomePriceReq = {
+                    PricedPrice: Number(formState.PricedPrice),
+                    PricedQty: Number(formState.PricedQty),
+                };
+                // 发出点价请求
+                somePriceReq(props.selectedRow.spotcontractid, params, loading)
+                    .then((res) => {
+                        cancel();
+                        context.emit('refresh');
+                    })
+                    .catch((err) => {});
+            });
         }
         return {
             visible,
             cancel,
             submit,
             loading,
+            formRef,
+            formState,
+            formatValue,
+            rules,
+            getPriceTypeName,
         };
     },
 });

+ 12 - 6
src/views/business/sell/list/all/index.vue

@@ -19,17 +19,23 @@
       </a-table>
     </contextMenu>
     <!-- 详情 -->
-    <Detail />
+    <Detail  :selectedRow="selectedRow"
+             @refresh="queryTable" />
     <!-- 采购点价登记 -->
-    <SomePrice />
+    <SomePrice  :selectedRow="selectedRow"
+                @refresh="queryTable" />
     <!-- 交收登记 -->
-    <Settlement />
+    <Settlement  :selectedRow="selectedRow"
+                 @refresh="queryTable" />
     <!-- 款项登记 -->
-    <Funds />
+    <Funds  :selectedRow="selectedRow"
+            @refresh="queryTable" />
     <!-- 发票登记 -->
-    <Invoice />
+    <Invoice  :selectedRow="selectedRow"
+              @refresh="queryTable" />
     <!-- 出库登记 -->
-    <Storage />
+    <Storage  :selectedRow="selectedRow"
+              @refresh="queryTable" />
   </div>
 </template>
 

+ 4 - 2
src/views/business/sell/list/pending/index.vue

@@ -20,9 +20,11 @@
       </a-table>
     </contextMenu>
     <!-- 详情 -->
-    <Detail />
+    <Detail  :selectedRow="selectedRow"
+             @refresh="queryTable" />
     <!-- 采购点价登记 -->
-    <SomePrice />
+    <SomePrice  :selectedRow="selectedRow"
+                @refresh="queryTable" />
   </div>
 </template>