Преглед на файлове

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP2.0_WEB

huangbin преди 4 години
родител
ревизия
34864b93fd

+ 125 - 70
src/views/business/purchase/components/settlement/index.vue

@@ -34,7 +34,7 @@
         </a-row>
         <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-item :label="'销售方'">
+            <a-form-item :label="selectedRow.contracttype===1? '采购方': '销售方'">
               <span class="white">{{ formatValue(selectedRow.accountname) }}</span>
             </a-form-item>
           </a-col>
@@ -96,75 +96,129 @@
               ref="formRef"
               :model="formState"
               :rules="rules">
-        <a-checkbox-group class="commonCheckboxGroup">
-          <a-row>
-            <a-col :span="12">
-              <a-form-item class="relative">
-                <template #label>
-                  <a-checkbox value="交收量">交收量</a-checkbox>
-                </template>
-                <a-input class="dialogInput" placeholder="请输入交收量" suffix="单位"/>
-                <div class="tip"><span>未定价量:40吨</span><a class="blue fr">全部登记</a></div>
+              <a-form-item name="IsChecked">
+                <a-checkbox-group class="commonCheckboxGroup">
+                  <a-row>
+                    <a-col :span="12">
+                      <a-form-item class="relative">
+                        <template #label>
+                          <a-checkbox value="交收量" v-model:checked="checkedObj.qty" @change="()=>checkedObj.qty = !checkedObj.qty">交收量</a-checkbox>
+                        </template>
+                        <a-form-item class="relative" v-if="checkedObj.qty" name="ReckonRealQty">
+                          <a-input-number  v-model:value="formState.ReckonRealQty" class="dialogInput" style="width: 200px" placeholder="请输入交收量" suffix="单位"/>
+                          <div class="tip"><span>未定价量:40吨</span><a class="blue">全部登记</a></div>
+                        </a-form-item>
+                        <a-form-item class="relative" v-else>
+                          <a-input-number disabled class="dialogInput" style="width: 200px" placeholder="请输入交收量" suffix="单位" />
+                          <div class="tip"><span>未定价量:--吨</span><a class="blue">全部登记</a></div>
+                        </a-form-item>
+                      </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                      <a-form-item class="relative">
+                        <template #label>
+                            <a-checkbox value="其他费用"  v-model:checked="checkedObj.amount" @change="()=>checkedObj.amount = !checkedObj.amount">其他费用</a-checkbox>
+                        </template>
+                        <a-form-item v-if="checkedObj.amount" name="ReckonOtherAmount">
+                          <a-input-number v-model:value="formState.ReckonOtherAmount" class="dialogInput" style="width: 200px" placeholder="请输入其他费用" suffix="元"/>
+                        </a-form-item>
+                        <a-form-item v-else>
+                          <a-input-number disabled class="dialogInput" style="width: 200px" placeholder="请输入其他费用" suffix="元"/>
+                        </a-form-item>
+                      </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                      <a-form-item class="relative">
+                        <template #label>
+                            <a-checkbox value="调整保证金" v-model:checked="checkedObj.margin" @change="()=>checkedObj.margin = !checkedObj.margin">调整保证金</a-checkbox>
+                        </template>
+                        <a-form-item class="relative mt10" v-if="checkedObj.margin">
+                            <a-radio-group class="commonRadioGroup"  v-model:value="checkedObj.adjustMargin">
+                              <a-row style="width: 200px">
+                                <a-col :span="12">
+                                  <a-radio :value="1">追加</a-radio>
+                                </a-col>
+                                <a-col :span="12">
+                                  <a-radio :value="2">退还</a-radio>
+                                </a-col>
+                              </a-row>
+                            </a-radio-group>
+                        <div class="tip mt5">
+                          <a-form-item  name="AddMargin"  v-if="checkedObj.adjustMargin === 1">
+                              <a-input-number v-model:value="formState.AddMargin" class="dialogInput" style="width: 200px;" placeholder="请输入调整保证金" suffix="元"/> 
+                          </a-form-item >
+                          <a-form-item  name="DecMargin" v-else>
+                              <a-input-number  v-model:value="formState.DecMargin" class="dialogInput" style="width: 200px;" placeholder="请输入调整保证金" suffix="元" /> 
+                          </a-form-item >
+                        </div>
+                        </a-form-item >
+                        <a-form-item class="relative mt10" v-else>
+                            <a-radio-group class="commonRadioGroup" disabled>
+                              <a-row style="width: 200px">
+                                <a-col :span="12">
+                                  <a-radio :value="1">追加</a-radio>
+                                </a-col>
+                                <a-col :span="12">
+                                  <a-radio :value="2">退还</a-radio>
+                                </a-col>
+                              </a-row>
+                            </a-radio-group>
+                        <div class="tip mt5">
+                          <a-input-number disabled class="dialogInput" style="width: 200px;" placeholder="请输入调整保证金" suffix="元"/>
+                        </div>
+                        </a-form-item>
+                      </a-form-item >
+                    </a-col>
+                    <a-col :span="12">
+                      <a-form-item class="relative">
+                        <template #label>
+                          <a-checkbox value="调整金额" v-model:checked="checkedObj.justAmount" @change="()=>checkedObj.justAmount = !checkedObj.justAmount">调整金额</a-checkbox>
+                        </template>
+                        <a-form-item class="relative mt5" v-if="checkedObj.justAmount">
+                            <a-radio-group class="commonRadioGroup" v-model:value="checkedObj.adjustAmount">
+                              <a-row style="width: 200px">
+                                <a-col :span="12">
+                                  <a-radio :value="1">增加</a-radio>
+                                </a-col>
+                                <a-col :span="12">
+                                  <a-radio :value="2">减少</a-radio>
+                                </a-col>
+                              </a-row>
+                            </a-radio-group>
+                            <div class="tip mt10">
+                                <a-form-item  name="ReckonAdjustAmount">
+                                    <a-input-number v-model:value="checkedObj.ReckonAdjustAmount" class="dialogInput" style="width: 200px;" placeholder="请输入调整金额" suffix="元" />
+                                </a-form-item >
+                            </div>
+                        </a-form-item>
+                        <a-form-item class="relative mt5" v-else>
+                          <a-radio-group class="commonRadioGroup" disabled>
+                            <a-row style="width: 200px">
+                              <a-col :span="12">
+                                <a-radio :value="1">增加</a-radio>
+                              </a-col>
+                              <a-col :span="12">
+                                <a-radio :value="2">减少</a-radio>
+                              </a-col>
+                            </a-row>
+                          </a-radio-group>
+                          <div class="tip mt10">
+                            <a-input-number disabled class="dialogInput" style="width: 200px;" placeholder="请输入调整金额" suffix="元"/>
+                          </div>
+                        </a-form-item>
+                      </a-form-item>
+                    </a-col>
+                    <a-col :span="24">
+                      <a-form-item label="备注"
+                                  class="relative mt30 pl40">
+                        <a-input class="dialogInput"
+                                        style="width: 600px"
+                                        placeholder="请输入备注信息" v-model:value="formState.Remark"/>
+                      </a-form-item>
+                    </a-col>
+                  </a-row>
+                </a-checkbox-group>
               </a-form-item>
-            </a-col>
-            <a-col :span="12">
-              <a-form-item>
-                <template #label>
-                  <a-checkbox value="其他费用">其他费用</a-checkbox>
-                </template>
-                <a-input class="dialogInput" style="width: 200px" placeholder="请输入其他费用" suffix="元"/>
-              </a-form-item>
-            </a-col>
-            <a-col :span="12">
-              <a-form-item class="relative mt10">
-                <template #label>
-                  <a-checkbox value="调整保证金">调整保证金</a-checkbox>
-                </template>
-                    <a-radio-group class="commonRadioGroup">
-                      <a-row style="width: 200px">
-                        <a-col :span="12">
-                          <a-radio :value="1">追加</a-radio>
-                        </a-col>
-                        <a-col :span="12">
-                          <a-radio :value="2">退还</a-radio>
-                        </a-col>
-                      </a-row>
-                    </a-radio-group>
-                <div class="tip mt5">
-                  <a-input class="dialogInput" style="width: 200px;" placeholder="请输入调整保证金" suffix="元"/>
-                </div>
-              </a-form-item>
-            </a-col>
-            <a-col :span="12">
-              <a-form-item class="relative mt5">
-                <template #label>
-                  <a-checkbox value="调整金额">调整金额</a-checkbox>
-                </template>
-                    <a-radio-group class="commonRadioGroup">
-                      <a-row style="width: 200px">
-                        <a-col :span="12">
-                          <a-radio :value="1">增加</a-radio>
-                        </a-col>
-                        <a-col :span="12">
-                          <a-radio :value="2">减少</a-radio>
-                        </a-col>
-                      </a-row>
-                    </a-radio-group>
-                <div class="tip mt10">
-                  <a-input class="dialogInput" style="width: 200px;" placeholder="请输入调整金额" suffix="元"/>
-                </div>
-              </a-form-item>
-            </a-col>
-            <a-col :span="24">
-              <a-form-item label="备注"
-                          class="relative mt30 pl40">
-                <a-input class="dialogInput"
-                                style="width: 600px"
-                                placeholder="请输入备注信息" />
-              </a-form-item>
-            </a-col>
-          </a-row>
-        </a-checkbox-group>
       </a-form>
     </fieldset>
   </a-modal>
@@ -204,7 +258,7 @@ export default defineComponent({
                     ReckonOtherAmount: 11, // 其它费用
                     AddMargin: 12, // 追加保证金
                     // DecMargin: number // 减少保证金
-                    ReckonAdjustAmount: 13, // 调整金额
+                    ReckonAdjustAmount: 13, // 调整金额 +-代表增减
                 };
                 // 发出交收请求
                 settlementReq(props.selectedRow.spotcontractid, params, loading)
@@ -226,6 +280,7 @@ export default defineComponent({
             formatValue,
             rules,
             getPriceTypeName,
+            checkedObj,
         };
     },
 });

+ 38 - 9
src/views/business/purchase/components/settlement/setup.ts

@@ -1,4 +1,4 @@
-import { reactive, ref, UnwrapRef } from "vue";
+import { reactive, ref,Ref, toRefs, UnwrapRef } from "vue";
 /**
  * 表单
  * @returns 
@@ -8,27 +8,56 @@ export function handleForm() {
         ReckonRealQty?: number | null // 交收量
         ReckonOtherAmount?: number | null // 其它费用
         AddMargin?: number | null // 追加保证金
+        DecMargin?: number | null // 减少保证金
         ReckonAdjustAmount?: number | null // 调整金额
         Remark: string
     }
     // 是否选中数据
-    const checkedObj = reactive({
-        ReckonRealQty: false,
-        ReckonOtherAmount: false,
-        AddMargin: false,
-        ReckonAdjustAmount: false,
-    })
+    // const checkedObj = reactive({
+    //     ReckonRealQty: false,
+    //     ReckonOtherAmount: false,
+    //     AddMargin: false,
+    //     ReckonAdjustAmount: false,
+    // })
     const formRef = ref();
     const formState: UnwrapRef<FormState> = reactive({
         ReckonRealQty: null, // 交收量
         ReckonOtherAmount: null, // 其它费用
         AddMargin: null, // 追加保证金
+        DecMargin: null, // 减少保证金
         ReckonAdjustAmount: null, // 调整金额
         Remark: ''
     })
+    interface check  {
+        qty: boolean, // 交收量
+        amount: boolean, // 其它费用
+        margin: boolean, // 追加保证金
+        justAmount: boolean, // 调整金额
+        adjustMargin: number,// 调整保证金
+        adjustAmount: number,// 调整金额
+    }
+    const checkedObj : Ref<check> = ref({
+        qty: false, // 交收量
+        amount: false, // 其它费用
+        margin: false, // 追加保证金
+        justAmount: false, // 调整金额
+        adjustMargin: 1,// 调整保证金
+        adjustAmount: 1,// 调整金额
+    })
+    const validateIsChecked = ()=>{
+        if (checkedObj.value.qty || checkedObj.value.amount || checkedObj.value.margin || checkedObj.value.justAmount) {
+            return Promise.resolve();
+        } else {
+            return Promise.reject('请至少填一项');
+        }
+    }
     const rules = {
-        // PricedPrice: [{ required: true, message: '请输入点价价格', trigger: 'blur', type: 'number' }],
-        // PricedQty: [{ required: true, message: '请输入点价数量', trigger: 'blur', type: 'number' }],
+        IsChecked: [{ required: true, validator: validateIsChecked }],
+        ReckonRealQty: [{ required: true, message: '请输入交收量', trigger: 'blur', type: 'number' }],
+        ReckonOtherAmount: [{ required: true, message: '请输入其它费用', trigger: 'blur', type: 'number' }],
+        AddMargin: [{ required: true, message: '请输入追加保证金', trigger: 'blur', type: 'number' }],
+        DecMargin: [{ required: true, message: '请输入减少保证金', trigger: 'blur', type: 'number' }],
+        ReckonAdjustAmount: [{ required: true, message: '请输入调整金额', trigger: 'blur', type: 'number' }],
     }
     return { rules, formState, formRef, checkedObj }
 }

+ 5 - 5
src/views/information/goods/components/hedgingModify/index.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 修改套保品种 -->
-  <a-modal class="commonModal modify-custom"
+  <a-modal class="commonModal fieldsetForm modify-custom"
            title="修改套保品种"
            v-if="visible"
            v-model:visible="visible"
@@ -23,17 +23,17 @@
         <a-row :gutter="24">
           <a-col :span="12">
             <a-form-item label="套保品种名称">
-              <span>{{selctedMG.mg.middlegoodsname}}</span>
+              <span class="white">{{selctedMG.mg.middlegoodsname}}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
             <a-form-item label="单位">
-              <span>{{getGoodsUnitEnumItemName(selctedMG.mg.goodsunitid)}}</span>
+              <span class="white">{{getGoodsUnitEnumItemName(selctedMG.mg.goodsunitid)}}</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
             <a-form-item label="当前套保比例">
-              <span>{{(selctedMG.mg.needhedgeratio * 100).toFixed(2)}}%</span>
+              <span class="white">{{(selctedMG.mg.needhedgeratio * 100).toFixed(2)}}%</span>
             </a-form-item>
           </a-col>
           <a-col :span="12">
@@ -53,7 +53,7 @@
         <a-row :gutter="24">
           <a-col :span="24">
             <a-form-item label="备注">
-              <span>{{selctedMG.mg.remark}}</span>
+              <span class="white">{{selctedMG.mg.remark}}</span>
             </a-form-item>
           </a-col>
         </a-row>

+ 2 - 0
src/views/information/goods/components/modify/index.vue

@@ -124,6 +124,7 @@
               <a-form-item :name="['gldwrstandards',index,'convertfactor']"
                            :rules="rules.gldwrstandards.convertfactor">
                 <a-input-number class="dialogInput"
+                                style="width: 200px"
                                 v-model:value="domain.convertfactor"
                                 placeholder="请输入标仓系数"></a-input-number>
               </a-form-item>
@@ -246,6 +247,7 @@
               <a-form-item :name="['wrsconvertdetails', index, 'convertratio']"
                            :rules="rules.wrsconvertdetails.convertratio">
                 <a-input-number class="dialogInput"
+                                style="width: 200px"
                                 v-model:value="domain.convertratio"
                                 placeholder="请输入套保系数"></a-input-number>
               </a-form-item>