Browse Source

Merge branch 'code2' into cucu

codeMan 1 year ago
parent
commit
182009c274

+ 1 - 1
src/DRP/HDrpManagement/agentManage/detail/tabs/fields.vue

@@ -1,5 +1,5 @@
 <template>
-  <normalTable size="small" :columns="utils.TBLayout('fieldsTable')" :param="{id:20221223141802,content:{sys_enterpriseid:props.enterpriseid}}"/>
+  <normalTable :is-select="false" size="small" :columns="utils.TBLayout('fieldsTable')" :param="{id:20221223141802,content:{sys_enterpriseid:props.enterpriseid}}"/>
 </template>
 
 <script setup>

+ 64 - 9
src/DRP/HDrpManagement/calcMethod/detail/index.vue

@@ -1,10 +1,13 @@
 <template>
   <div>
-    <detail-template :headData="mainAreaData" :title="mainData.functionname" :tabs="['商品']" :hideBorder="false" ownertable="sys_datafunction">
+    <detail-template :headData="mainAreaData" :title="mainData.functionname" :tabs="['参数','商品']" :hideBorder="false" ownertable="sys_datafunction">
       <template #operation>
         <Edit :data="mainData.param" @onSuccess="queryMainData" :disabled="!utils.hasPermission('update')"></Edit>
       </template>
       <template #tab0>
+        <defaultInfo :data="baseInfo"></defaultInfo>
+      </template>
+      <template #tab1>
         <product></product>
       </template>
     </detail-template>
@@ -17,12 +20,30 @@ import  utils from '@/utils/utils'
 import Edit from '../modules/Edit.vue'
 import detailTemplate from '@/components/detailTemplate/index.vue'
 import product from './modules/tabs/product/product.vue'
-import {ref,onMounted,createVNode} from 'vue'
+import defaultInfo from '@/template/defaultInfo/index.vue'
+import {ref,onMounted,createVNode, provide} from 'vue'
 import { useRouter } from "vue-router"
 const router = useRouter()
 const remitmx = ref()
 const mainData = ref({})
 const mainAreaData = ref([])
+let baseInfo = ref([])
+const onSuccess = () =>{
+  queryMainData()
+}
+const  changeDataStructure = (data)=> {
+  mainAreaData.value = utils.FormLayout('detailsHead',data)
+}
+let cashbillrectype = ref('')
+let itemfield = ref('')
+let condition = ref('')
+let ordertype = ref('')
+
+provide('cashbillrectype',cashbillrectype)
+provide('itemfield',itemfield)
+provide('condition',condition)
+provide('ordertype',ordertype)
+
 const queryMainData = async () => {
   const res = await Api.requested({
     "id":20231212111202,
@@ -31,16 +52,50 @@ const queryMainData = async () => {
     }
   })
   mainData.value = res.data
+  baseInfo.value = mainData.value.param.map(item => {
+    let value
+    if (item.param == 'apportiontype') {
+      console.log(item.value);
+      value = cashbillrectype.value.filter(f => f.value == item.value)[0].remarks
+    } else if (item.param == 'condition') {
+      value = condition.value.filter(f => f.value == item.value)[0].remarks
+    } else if (item.param == 'itemfield') {
+      value = itemfield.value.filter(f => f.value == item.value)[0].remarks
+    } else if (item.param == 'isaccumulation') {
+      value = item.value ? '是' : '否'
+    } else if (item.param == 'iscombination') {
+      value = item.value ? '是' : '否'
+    } else {
+      value = item.value
+    }
+    return {
+      label:item.paramname,
+      value:value
+    }
+  })
+  console.log(baseInfo);
   changeDataStructure(res.data)
 }
-const onSuccess = () =>{
-  queryMainData()
-}
-const  changeDataStructure = (data)=> {
-  mainAreaData.value = utils.FormLayout('detailsHead',data)
-}
-onMounted(()=>{
+onMounted( async ()=>{
+
+  const res = await Api.optionstype('apportiontype')
+  cashbillrectype.value = res.data
+  console.log(cashbillrectype.value,'分摊方式');
+
+  const res1 = await Api.optionstype('itemfield')
+  itemfield.value = res1.data
+  console.log(itemfield.value,'计算依据');
+
+  const res2 = await Api.optionstype('condition')
+  condition.value = res2.data
+  console.log(condition.value,'满足条件');
+  
+  const res3 = await Api.optionstype('ordertype')
+  ordertype.value = res3.data
+  console.log(ordertype.value,'订单类型');
+
   queryMainData()
+
 })
 </script>
 <style>

+ 25 - 28
src/DRP/HDrpManagement/calcMethod/modules/Edit.vue

@@ -11,7 +11,7 @@
     <a-form ref="formRef" :model="form" layout="vertical">
       <a-row :gutter="16">
         <template v-for="(item) in data">
-          <a-col :span="12" v-if="item.param == 'apportiontype'">
+          <a-col :span="12" v-if="item.param == 'apportiontype' && form.是否订单内组合计算 == 1">
             <a-form-item :label="item.paramname" :name="item.paramname" :rules="[{ required: true, message:item }]">
               <a-select v-model:value="form[item.paramname]">
                 <a-select-option v-for="(cash,cashi) in cashbillrectype" :key="cashi" :value="cash.value">{{ cash.remarks }}</a-select-option>
@@ -20,12 +20,12 @@
           </a-col>
           <a-col :span="12" v-if="item.param == 'value'">
             <a-form-item :label="item.paramname" :name="item.paramname" :rules="[{ required: true,validator: checkNumber,message:item }]">
-              <a-input-group>
-                <a-input v-model:value="form[item.paramname]" style="width: 60%" />
+              <a-input-group compact>
                 <a-select v-model:value="form['满足条件']" style="width:100px">
                   <a-select-option v-for="(cond,condi) in condition" :key="condi" :value="cond.value">{{ cond.remarks }}</a-select-option>
                   <a-select-option value="Jiangsu">Jiangsu</a-select-option>
                 </a-select>
+                <a-input v-model:value="form[item.paramname]" style="width: 60%" />
               </a-input-group>
             </a-form-item>
           </a-col>
@@ -75,7 +75,7 @@
           </a-col>
           <a-col :span="12" v-if="item.param == 'ordertype'">
             <a-form-item :label="item.paramname" :name="item.paramname" :rules="[{ required: true, message:item }]">
-              <a-select v-model:value="form[item.paramname]">
+              <a-select mode="multiple" v-model:value="form[item.paramname]">
                 <a-select-option v-for="(order,orderi) in ordertype" :key="orderi" :value="order.value">{{ order.value }}</a-select-option>
               </a-select>
             </a-form-item>
@@ -95,7 +95,7 @@
 </template>
 
 <script setup>
-import {ref,defineEmits,defineProps,defineExpose, onMounted} from 'vue'
+import {ref,defineEmits,defineProps,defineExpose, onMounted, inject} from 'vue'
 import {PlusOutlined} from '@ant-design/icons-vue';
 import Api from '@/api/api'
 import utils from '@/utils/utils'
@@ -105,7 +105,12 @@ const visible = ref(false)
 let form = ref({})
 const showDrawer = ()=>{
   props.data.forEach(item => {
-    form.value[item.paramname] = item.value
+    if (item.param == 'ordertype') {
+      let arr = item.value.split(',')
+      arr.length ? form.value[item.paramname] = arr : form.value[item.paramname] = []
+    }else {
+      form.value[item.paramname] = item.value
+    }
   })
   console.log(form.value,'参数',props.data);
   visible.value = true
@@ -131,10 +136,16 @@ const submit = async ()=>{
     const values = await formRef.value.validateFields();
     let items = []
     Object.keys(form.value).forEach((item,index) => {
-      items[index] = {
-        sys_datafunction_paramsid:props.data.filter(item2 => item2.paramname == item)[0].sys_datafunction_paramsid,
-        value:form.value[item],
-      }
+    let value
+    if (item == '订单类型') {
+      value = form.value[item].join(',')
+    } else {
+      value = form.value[item]
+    }
+    items[index] = {
+      sys_datafunction_paramsid:props.data.filter(item2 => item2.paramname == item)[0].sys_datafunction_paramsid,
+      value:value,
+    }
     })
     const res = await Api.requested({
       "content": {
@@ -151,27 +162,13 @@ const submit = async ()=>{
   }
 }
 
-let cashbillrectype = ref('')
-let itemfield = ref('')
-let condition = ref('')
-let ordertype = ref('')
+let cashbillrectype = inject('cashbillrectype')
+let itemfield = inject('itemfield')
+let condition = inject('condition')
+let ordertype = inject('ordertype')
 
 onMounted(async () => {
-  const res = await Api.optionstype('apportiontype')
-  cashbillrectype.value = res.data
-  console.log(cashbillrectype.value,'分摊方式');
-
-  const res1 = await Api.optionstype('itemfield')
-  itemfield.value = res1.data
-  console.log(itemfield.value,'计算依据');
-
-  const res2 = await Api.optionstype('condition')
-  condition.value = res2.data
-  console.log(condition.value,'满足条件');
   
-  const res3 = await Api.optionstype('ordertype')
-  ordertype.value = res3.data
-  console.log(ordertype.value,'订单类型');
 })
 
 defineExpose({

+ 2 - 2
src/template/defaultInfo/index.vue

@@ -1,6 +1,6 @@
 <template>
-  <a-descriptions :column="6" :labelStyle="{color:'#666',width:'150px'}" :contentStyle="{marginRight:'20px',marginBottom:'5px'}" bordered>
-    <a-descriptions-item :span="item.span ? item.span : 1"  v-for="item in props.data" :key="item.index" :label="item.label"><span :style="item.style?item.style():''">{{item.value}}</span></a-descriptions-item>
+  <a-descriptions :column="3" :labelStyle="{color:'#666',width:'150px'}" :contentStyle="{marginRight:'20px',marginBottom:'5px',minWidth:'200px'}" bordered>
+    <a-descriptions-item v-for="item in props.data" :key="item.index" :label="item.label"><span :style="item.style?item.style():''">{{item.value}}</span></a-descriptions-item>
   </a-descriptions>
 </template>