فهرست منبع

commit 销售

yu.jie 4 سال پیش
والد
کامیت
c0f2fa81a7

+ 1 - 6
src/views/business/purchase/components/funds/index.vue

@@ -168,13 +168,8 @@ import { closeModal } from '@/common/setup/modal/index';
 import { formatValue, initData } from '@/common/methods';
 import { Ermcp3SellBuyContract } from '@/services/go/ermcp/purchase/interface';
 import { getPriceTypeName } from '@/views/business/purchase/setup';
-import { operationContractReq } from '@/services/proto/contract';
-import { message } from 'ant-design-vue';
-import { objectToUint8Array } from '@/utils/objHandle';
-import { FundsReq, InvoiceReq } from '@/services/proto/contract/interface';
-import { fundsReq, invoiceReq } from '@/views/business/purchase/components/setup';
+import { fundsReq } from '@/views/business/purchase/components/setup';
 import { handleForm } from './setup';
-import { QueryMiddleGoodsChange } from '@/services/go/ermcp/goodsInfo';
 
 export default defineComponent({
     name: 'purchase_pending_funds',

+ 205 - 197
src/views/business/sell/components/funds/index.vue

@@ -1,214 +1,222 @@
 <template>
-  <!-- 款项登记-->
-  <a-modal class="custom-detail"
-           title="款项登记"
-           v-model:visible="visible"
-           centered
-           @cancel="cancel"
-           width="890px">
-    <template #footer>
-      <a-button key="submit"
-                type="primary"
-                :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">{{ selectedRow.pricetype === 3 ? formatValue(selectedRow.loanamount) : 0 }}</span>
-                      </a-form-item>
-                  </a-col>
-              </a-row>
-          </a-form>
-      </fieldset>
+    <!-- 款项登记-->
+    <a-modal class="commonModal paddingDialog funds"
+             title="款项登记"
+             v-model:visible="visible"
+             centered
+             @cancel="cancel"
+             width="890px">
+        <template #footer>
+            <a-button key="submit"
+                      class="cancelBtn"
+                      @click="cancel">取消
+            </a-button>
+            <a-button key="submit"
+                      type="primary"
+                      :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.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">{{ 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.pricedamount }}</span>
-                      </a-form-item>
-                  </a-col>
-                  <a-col :span="12">
-                      <a-form-item label="调整金额">
-                          <span class="white">{{ selectedRow.reckonadjustamount }}</span>
-                      </a-form-item>
-                  </a-col>
-              </a-row>
+        <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.pricedamount }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="调整金额">
+                            <span class="white">{{ selectedRow.reckonadjustamount }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
 
-              <a-row :gutter="24">
-                  <a-col :span="12">
-                      <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">{{ 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">{{ selectedRow.pricedamount + selectedRow.reckonadjustamount }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <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">{{ selectedRow.reckonotheramount }}</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-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="其他费用">
+                            <span class="white">{{ selectedRow.reckonotheramount }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="合计总额">
+                            <span class="white">{{ formatValue(selectedRow.totalamount) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
 
-              <a-row :gutter="24">
-                  <a-col :span="12">
-                      <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>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <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"
-                  ref="formRef"
-                  :model="formState"
-                  :rules="rules">
-              <a-row :gutter="24">
-                  <a-col :span="12">
-                      <a-form-item label="应付款额"
-                                   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"  v-model:value="formState.payType" >
-                              <a-radio :value="1">付款申请</a-radio>
-                              <a-radio :value="2">退款通知</a-radio>
-                          </a-radio-group>
-                      </a-form-item>
-                  </a-col>
-              </a-row>
-              <a-row :gutter="24">
-                  <a-col :span="12">
-                      <a-form-item label="登记金额" name="Amount">
-                          <a-input-number class="dialogInput"
-                                          style="width: 200px"
-                                          suffix="元"
-                                          type="number"
-                                          placeholder="请输入登记金额"
-                                          v-model:value="formState.Amount" />
-                      </a-form-item>
-                  </a-col>
-                  <a-col :span="24">
-                      <a-form-item label="备注"
-                                   name="PricedQty"
-                                   class="relative">
-                          <a-input class="dialogInput"
-                                   style="width: 608px"
-                                   placeholder="请输入备注信息"
-                                   v-model:value="formState.Remark"/>
-                      </a-form-item>
-                  </a-col>
-              </a-row>
-          </a-form>
-      </fieldset>
-  </a-modal>
+        <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="unpayamount">
+                            <span class="white">{{selectedRow.unpayamount}}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="款项类型">
+                            <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>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="登记金额"
+                                     name="Amount">
+                            <a-input-number class="dialogInput"
+                                            style="width: 200px"
+                                            suffix="元"
+                                            type="number"
+                                            placeholder="请输入登记金额"
+                                            v-model:value="formState.Amount"/>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="24">
+                        <a-form-item label="备注"
+                                     name="PricedQty"
+                                     class="relative">
+                            <a-input class="dialogInput"
+                                     style="width: 608px"
+                                     placeholder="请输入备注信息"
+                                     v-model:value="formState.Remark"/>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </a-form>
+        </fieldset>
+    </a-modal>
 </template>
 
 <script lang="ts">
-import {defineComponent, PropType, ref, unref} from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
-import {Ermcp3SellBuyContract} from "@/services/go/ermcp/purchase/interface";
-import {formatValue} from "@/common/methods";
-import {getPriceTypeName} from "@/views/business/purchase/setup";
-import {handleForm} from "@/views/business/purchase/components/funds/setup";
-import {fundsReq} from "@/views/business/purchase/components/setup";
+    import {defineComponent, PropType, reactive, ref, unref, watch, watchEffect} from 'vue';
+    import {closeModal} from '@/common/setup/modal/index';
+    import {formatValue, initData} from '@/common/methods';
+    import {Ermcp3SellBuyContract} from '@/services/go/ermcp/purchase/interface';
+    import {getPriceTypeName} from '@/views/business/purchase/setup';
+    import {fundsReq} from '@/views/business/purchase/components/setup';
+    import {handleForm} from './setup';
 
-export default defineComponent({
-    name: 'sell_pending_funds',
-    components: {},
-    props: {
-        selectedRow: {
-            type: Object as PropType<Ermcp3SellBuyContract>,
-            default: {},
+    export default defineComponent({
+        name: 'sell_pending_funds',
+        components: {},
+        props: {
+            selectedRow: {
+                type: Object as PropType<Ermcp3SellBuyContract>,
+                default: {},
+            },
         },
-    },
-    setup(props, context) {
-        const { visible, cancel } = closeModal('sell_pending_funds');
-        const loading = ref<boolean>(false);
-        const { rules, formState, formRef } = handleForm();
+        setup(props, context) {
+            const {visible, cancel} = closeModal('sell_pending_funds');
+            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:any = {}
-                if(formState.payType === 1){
-                    params.PayAmount = Number(formState.Amount)
-                }else {
-                    params.DeductAmount = Number(formState.Amount)
-                }
-                // 发出发票登记
-                fundsReq(props.selectedRow.spotcontractid, params, loading,formState.Remark)
-                    .then(() => {
+            function submit() {
+                console.log(props.selectedRow);
+                const wrapEl = unref(formRef);
+                wrapEl.validate().then(() => {
+                    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, formState.Remark).then(() => {
                         cancel();
                         context.emit('refresh');
-                    })
-            });
-        }
-        return {
-            visible,
-            cancel,
-            submit,
-            loading,
-            formState,
-            formatValue,
-            rules,
-            getPriceTypeName,
-        };
-    },
-});
+                    });
+                });
+            }
+
+            return {
+                visible,
+                cancel,
+                submit,
+                loading,
+                formState,
+                formatValue,
+                formRef,
+                rules,
+                getPriceTypeName,
+            };
+        },
+    });
 </script>
 
 <style lang="less">

+ 22 - 0
src/views/business/sell/components/funds/setup.ts

@@ -0,0 +1,22 @@
+import { reactive, ref, UnwrapRef } from "vue";
+/**
+ * 表单
+ * @returns 
+ */
+export function handleForm() {
+    interface FormState {
+        payType: number 
+        Amount: number | null
+        Remark:String
+    }
+    const formRef = ref();
+    const formState: UnwrapRef<FormState> = reactive({
+        payType: 1,
+        Amount: null,
+        Remark:''
+    })
+    const rules = {
+        Amount: [{ required: true, message: '请输入登记价格', trigger: 'blur', type: 'number' }],
+    }
+    return { rules, formState, formRef }
+}

+ 178 - 147
src/views/business/sell/components/invoice/index.vue

@@ -1,156 +1,187 @@
 <template>
-  <!-- 发票登记-->
-  <a-modal class="custom-detail"
-           title="发票登记"
-           v-model:visible="visible"
-           centered
-           @cancel="cancel"
-           width="890px">
-    <template #footer>
-      <a-button key="submit"
-                type="primary"
-                :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.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-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">499999000.00元</span>
-                      </a-form-item>
-                  </a-col>
-                  <a-col :span="12">
-                      <a-form-item label="保证金">
-                          <span class="white">1000000元</span>
-                      </a-form-item>
-                  </a-col>
-                  <a-col :span="12">
-                      <a-form-item label="其他费用">
-                          <span class="white">500.00元</span>
-                      </a-form-item>
-                  </a-col>
-                  <a-col :span="12">
-                      <a-form-item label="合计总额">
-                          <span class="white">505990500.00元</span>
-                      </a-form-item>
-                  </a-col>
-                  <a-col :span="12">
-                      <a-form-item label="已支付额 ">
-                          <span class="white">500.00元</span>
-                      </a-form-item>
-                  </a-col>
-                  <a-col :span="12">
-                      <a-form-item label="已收票额">
-                          <span class="white">505990500.00元</span>
-                      </a-form-item>
-                  </a-col>
-                  <a-col :span="24">
-                      <a-form-item label="预收票额">
-                          <span class="white">--</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="收票金额"
-                                   class="relative mb40"
-                                   name="PricedPrice">
-                          <a-input class="dialogInput"
-                                   style="width: 200px"
-                                   suffix="元"
-                                   placeholder="请输入收票金额" />
-                          <div class="tip">
-                              <div>应收票额:4090500.00元</div>
-                              <div><a class="blue fr">全部登记</a></div>
-                          </div>
-                      </a-form-item>
-                  </a-col>
-                  <a-col :span="12">
-                      <a-form-item label="发票附件" class="mb40">
-                          <div class="upload">
-                              <a-upload action="">
-                                  <a-button class="uploadBtn">上传</a-button>
-                              </a-upload>
-                              <div class="look">查看附件</div>
-                          </div>
-                      </a-form-item>
-                  </a-col>
-              </a-row>
-          </a-form>
-      </fieldset>
-  </a-modal>
+    <!-- 发票登记-->
+    <a-modal class="commonModal paddingDialog invoice"
+             :title="selectedRow.contracttype===1? '采购合同-发票登记': '销售合同-发票登记'"
+             v-model:visible="visible"
+             centered
+             @cancel="cancel"
+             width="890px">
+        <template #footer>
+            <a-button key="submit"
+                      class="cancelBtn"
+                      @click="cancel">取消
+            </a-button>
+            <a-button key="submit"
+                      type="primary"
+                      :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.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-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.loanamount) + selectedRow.currencyname }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="保证金">
+                            <span class="white">{{ formatValue(selectedRow.margin) + selectedRow.currencyname }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="其他费用">
+                            <span class="white">{{ selectedRow.reckonotheramount + selectedRow.currencyname }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="合计总额">
+                            <span class="white">{{ selectedRow.totalamount + selectedRow.currencyname }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="已支付额 ">
+                            <span class="white">{{ selectedRow.payamount + selectedRow.currencyname }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="已收票额">
+                            <span class="white">{{ selectedRow.invoiceamount + selectedRow.currencyname }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="24">
+                        <a-form-item label="预收票额">
+                            <span class="white">{{ selectedRow.preinvoiceamount + 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="收票金额"
+                                     class="relative mb40"
+                                     name="InvoiceAmount">
+                            <a-input-number v-model:value="formState.InvoiceAmount" class="dialogInput"
+                                            style="width: 200px"
+                                            suffix="元"
+                                            placeholder="请输入收票金额"/>
+                            <div class="tip">
+                                <div>应收票额:{{ selectedRow.invoiceamount }} {{ selectedRow.currencyname }}</div>
+                                <div><a class="blue fr">全部登记</a></div>
+                            </div>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="发票附件" class="mb40">
+                            <div class="upload">
+                                <a-upload action="">
+                                    <a-button class="uploadBtn">上传</a-button>
+                                </a-upload>
+                                <div class="look">查看附件</div>
+                            </div>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </a-form>
+        </fieldset>
+    </a-modal>
 </template>
 
 <script lang="ts">
-import {defineComponent, PropType, ref} from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
-import {Ermcp3SellBuyContract} from "@/services/go/ermcp/purchase/interface";
-import {getPriceTypeName} from "@/views/business/purchase/setup";
+    import {defineComponent, PropType, ref, unref} from 'vue';
+    import {closeModal} from '@/common/setup/modal/index';
+    import {Ermcp3SellBuyContract} from "@/services/go/ermcp/purchase/interface";
+    import {getPriceTypeName} from "@/views/business/purchase/setup";
+    import {formatValue} from "@/common/methods";
+    import {handleForm} from "@/views/business/purchase/components/invoice/setup";
+    import {InvoiceReq} from "@/services/proto/contract/interface";
+    import {invoiceReq} from "@/views/business/purchase/components/setup";
 
-export default defineComponent({
-    name: 'sell_pending_invoice',
-    components: {},
-    props: {
-        selectedRow: {
-            type: Object as PropType<Ermcp3SellBuyContract>,
-            default: {},
+    export default defineComponent({
+        name: 'sell_pending_invoice',
+        components: {},
+        props: {
+            selectedRow: {
+                type: Object as PropType<Ermcp3SellBuyContract>,
+                default: {},
+            },
         },
-    },
-    setup(props) {
-        const { visible, cancel } = closeModal('sell_pending_invoice');
-        const loading = ref<boolean>(false);
-        function submit() {
-            loading.value = true
-            props
-        }
-        return {
-            visible,
-            cancel,
-            submit,
-            loading,
-            getPriceTypeName,
-        };
-    },
-});
+        setup(props, context) {
+            const {visible, cancel} = closeModal('purchase_pending_invoice');
+            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: InvoiceReq = {
+                        InvoiceAmount: formState.InvoiceAmount!,
+                    };
+                    // 发出发票登记
+                    invoiceReq(props.selectedRow.spotcontractid, params, loading)
+                        .then(() => {
+                            cancel();
+                            context.emit('refresh');
+                        })
+                        .catch((err) => {
+                        });
+                });
+            }
+
+            return {
+                visible,
+                cancel,
+                submit,
+                loading,
+                formRef,
+                formState,
+                formatValue,
+                rules,
+                getPriceTypeName,
+            };
+        },
+    });
 </script>
 
 <style lang="less">

+ 10 - 5
src/views/business/sell/components/settlement/index.vue

@@ -1,16 +1,21 @@
 <template>
   <!-- 交收登记-->
-  <a-modal class="custom-detail"
+  <a-modal  class="commonModal paddingDialog settlement"
            title="交收登记"
            v-model:visible="visible"
            @cancel="cancel"
            centered
            width="890px">
     <template #footer>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading"
-                @click="submit">关闭</a-button>
+        <a-button key="submit"
+                  class="cancelBtn"
+                  @click="cancel">取消
+        </a-button>
+        <a-button key="submit"
+                  type="primary"
+                  :loading="loading"
+                  @click="submit">交收登记
+        </a-button>
     </template>
       <fieldset class="formFieldSet">
           <legend>合同基本信息</legend>

+ 223 - 34
src/views/business/sell/components/storage/index.vue

@@ -1,42 +1,231 @@
 <template>
-  <!-- 出库登记-->
-  <a-modal class="custom-detail"
-           title="出库登记"
-           v-model:visible="visible"
-           @cancel="cancel"
-           centered
-           width="890px">
-    <template #footer>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading"
-                @click="submit">关闭</a-button>
-    </template>
-
-  </a-modal>
+    <!-- 出库登记-->
+    <a-modal class="commonModal"
+             title="出库登记"
+             v-model:visible="visible"
+             @cancel="cancel"
+             centered
+             width="890px">
+        <template #footer>
+            <a-button key="submit"
+                      class="cancelBtn"
+                      @click="cancel">取消
+            </a-button>
+            <a-button key="submit"
+                      type="primary"
+                      :loading="loading"
+                      @click="submit">入库登记
+            </a-button>
+        </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">{{ formatValue(selectedRow.contractno) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <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-col :span="12">
+                        <a-form-item label="合同签署量">
+                            <span class="white">{{formatValue(selectedRow.qty)}}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </fieldset>
+            <fieldset class="formFieldSet">
+                <legend>已登记信息</legend>
+                <a-row :gutter="24">
+                    <a-col :span="12"
+                           v-for="(item, i) in DGList"
+                           :key="i">
+                        <a-form-item label="已入库量">
+                            <span class="white">{{item.wrstandardname}} + {{item.brandname}}</span>
+                        </a-form-item>
+                    </a-col>
+                    <!-- <a-col :span="12">
+                      <a-form-item label="已入库量2">
+                        <span class="white">品类2+品牌2(66吨)</span>
+                      </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                      <a-form-item label="已入库量3">
+                        <span class="white">品类3+品牌3(1000吨)</span>
+                      </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                      <a-form-item label="已入库量4">
+                        <span class="white">品类4+品牌4(5吨)</span>
+                      </a-form-item>
+                    </a-col> -->
+                </a-row>
+            </fieldset>
+            <fieldset class="formFieldSet">
+                <legend>本次入库信息</legend>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="品类">
+                            <a-select class="inlineFormSelect"
+                                      style="width: 200px"
+                                      placeholder="请选择品类"
+                                      v-model:value="selectedRow.wrstandardid"
+                                      readonly>
+                                <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="品牌"
+                                     name="SpotGoodsBrandID">
+                            <a-select class="inlineFormSelect"
+                                      style="width: 200px"
+                                      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="入库仓库"
+                                     name="WarehouseInfo">
+                            <a-select class="inlineFormSelect"
+                                      style="width: 200px"
+                                      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="入库数量"
+                                     name="Qty">
+                            <a-input-number class="dialogInput"
+                                            style="width: 200px"
+                                            suffix="单位"
+                                            placeholder="请输入入库数量"
+                                            v-model:value="formState.Qty">
+                            </a-input-number>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </fieldset>
+        </a-form>
+    </a-modal>
 </template>
 
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
+    import { defineComponent, PropType, ref, unref, watchEffect } from 'vue';
+    import { closeModal } from '@/common/setup/modal/index';
+    import { Ermcp3SellBuyContract } from '@/services/go/ermcp/purchase/interface';
+    import { ERMCPAreaInOutStockApplyReq } from '@/services/proto/warehouse/interface';
+    import { QueryAreaStockApply, 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';
+    import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+    import { message } from 'ant-design-vue';
+    import { Ermcp3AreaStockApplySum } from '@/services/go/ermcp/warehouse-info/interface';
+    import { ermcpInOutStockApplyReq } from '@/services/proto/warehouse';
+
+    export default defineComponent({
+        name: 'sell_pending_storage',
+        components: {},
+        props: {
+            selectedRow: {
+                type: Object as PropType<Ermcp3SellBuyContract>,
+                default: {},
+            },
+        },
+        setup(props, context) {
+            const { visible, cancel } = closeModal('purchase_pending_storage');
+            const { rules, formState, formRef } = handleForm();
+            const loading = ref<boolean>(false);
+            const wareHouseList = ref<ErmcpWareHouseInfo[]>([]);
+            const gblist = ref<[]>([]);
+            const gmlist = ref<[]>([]);
+            const DGList = ref<Ermcp3AreaStockApplySum[]>([]);
+            watchEffect(() => {
+                if (visible.value) {
+                    const id = Long.fromString(props.selectedRow.spotcontractid);
+                    QueryAreaStockApply(Number(props.selectedRow.spotcontractid))
+                        .then((res) => {
+                            DGList.value = res.filter((e) => e.inouttype === 1);
+                        })
+                        .catch((err) => message.error(err));
+                }
+            });
+            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;
+                });
+            });
 
-export default defineComponent({
-    name: 'sell_pending_storage',
-    components: {},
-    setup() {
-        const { visible, cancel } = closeModal('sell_pending_storage');
-        const loading = ref<boolean>(false);
-        function submit() {
-            cancel();
-        }
-        return {
-            visible,
-            cancel,
-            submit,
-            loading,
-        };
-    },
-});
+            function submit() {
+                console.log(props.selectedRow);
+                console.log(wareHouseList);
+                const wrapEl = unref(formRef);
+                wrapEl.validate().then(() => {
+                    const params: ERMCPAreaInOutStockApplyReq = {
+                        InOutType: 5, //  5:采购入库 6:销售出库 7:生产入库 8:生产出库
+                        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 数量t
+                        ApplyRemark: '', // string 申请备注
+                    };
+                    requestResultLoadingAndInfo(ermcpInOutStockApplyReq, params, loading, ['入库登记成功', '入库登记失败:']).then(() => {
+                        context.emit('refresh');
+                        cancel();
+                    });
+                });
+            }
+            return {
+                visible,
+                cancel,
+                submit,
+                loading,
+                formatValue,
+                rules,
+                formState,
+                formRef,
+                wareHouseList,
+                gblist,
+                gmlist,
+                DGList,
+            };
+        },
+    });
 </script>
 
 <style lang="less">

+ 24 - 0
src/views/business/sell/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 }
+}