|
|
@@ -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({
|