Commit 41a815df by liuliufashi

update

parent 8784a8e7
......@@ -7,7 +7,6 @@
"build": "vue-cli-service build --mode prod",
"lint": "vue-cli-service lint",
"dev": "vue-cli-service serve --mode dev --open",
"prod": "vue-cli-service serve --mode prod --open",
"local": "vue-cli-service serve --mode local --open"
},
"dependencies": {
......
......@@ -56,12 +56,12 @@
<a-switch v-model:checked="formState.fullphone" />
</div>
</a-form-item>
<a-form-item label="开始时间" name="price" :label-col="{ span: 2 }"
<!-- <a-form-item label="开始时间" name="price" :label-col="{ span: 2 }"
labelAlign="left">
<div style="display:flex">
<a-date-picker v-model:value="formState.starttime" :locale="locale" :format="dateFormat" :disabledDate="disabledDate"/> <a-time-picker style="margin-left:10px;" v-model:value="startvalue" format="HH:mm" />
</div>
</a-form-item>
</a-form-item> -->
<a-form-item label="结束时间" name="price" :label-col="{ span: 2 }"
labelAlign="left">
<div style="display:flex">
......@@ -87,9 +87,9 @@
@cancel="onCancel"
>
<a-radio-group v-model:value="modalvalue">
<div v-for="item in list" :itemkey="item">
<a-radio v-if="item.paytype == 1" :value="item.name" :lable="item.id" @change="onChangeRadioName(item)">{{item.name}}</a-radio>
<a-radio v-else-if="item.paytype == 2" :value="item.payname" :lable="item.id" @change="onChangeRadioName(item)">{{item.payname}}</a-radio>
<div v-for="item in list" :itemkey="item.id">
<a-radio v-if="item.paytype == 1" :value="item.id" :lable="item.id" @change="onChangeRadioName(item)">{{item.name}}</a-radio>
<a-radio v-else-if="item.paytype == 2" :value="item.id" :lable="item.id" @change="onChangeRadioName(item)">{{item.payname}}</a-radio>
</div>
</a-radio-group>
</a-modal>
......@@ -119,10 +119,9 @@ interface FormState {
const visible = ref<boolean>(false);
const list = ref<any>([])
const optionss = ref<any>([])
let goodspayditch = ref([{}])
let goodspayditch = ref([])
const props = defineProps();
const dateFormat = 'YYYY/MM/DD';
const startvalue = ref<Dayjs>(dayjs('08:00', 'HH:mm'));
const endvalue = ref<Dayjs>(dayjs('10:00', 'HH:mm'));
const optionsWithDisabled = [
{ value: '微信', label: '1' },
......@@ -148,7 +147,7 @@ const formState = reactive<FormState>({
});
let price = ref(0)
let priceSet = ref(0)
const modalvalue = ref<any>(0)
const modalvalue = ref<any>('0')
let radioValue= reactive<any>({
})
let listValue = ref<any>([])
......@@ -175,27 +174,28 @@ const onSubmit = () => {
validate()
.then(async (res) => {
const uid =getUid()
const starttime = (moment(toRaw(formState).starttime.$d).format('YYYY-MM-DD'))+(moment(startvalue.value.$d).format('THH:mm:[00][Z]'))
const expireendtime = (moment(toRaw(formState).expireendtime.$d).format('YYYY-MM-DD'))+(moment(endvalue.value.$d).format('THH:mm:[00][Z]'))
goodspayditch.value.map((item:any)=>{return item.goodsid = toRaw(formState).subject.value})
const prarms = {
subject:toRaw(formState).subject.label,
shortname:toRaw(formState).shortname,
paymentmodel:toRaw(formState).paymentmodel,
fullphone:toRaw(formState).paymentmodel?0:1,
expireendtime:expireendtime,
starttime:starttime,
goodsid: toRaw(formState).subject.value,
goodspayditch:goodspayditch.value,
payment:formState.paymentmodel == '1'?price.value*100:priceSet.value*100,
uid,
remark:toRaw(formState).remark
}
const data:any = await onCreateGoodsPay(prarms)
if(data.state === 1){
message.success(data.message)
emit('onBack')
}
// goodspayditch.value.map((item:any)=>{return item.goodsid = toRaw(formState).subject.value})
// console.log(toRaw(formState),'toRaw(formState)',goodspayditch.value);
// const prarms = {
// subject:toRaw(formState).subject.label,
// shortname:toRaw(formState).shortname,
// paymentmodel:toRaw(formState).paymentmodel,
// fullphone:toRaw(formState).paymentmodel?0:1,
// expireendtime:expireendtime,
// starttime: moment(new Date()).format('YYYY-MM-DDTHH:mm:[00][Z]'),
// goodsid: toRaw(formState).subject.value,
// goodspayditch:goodspayditch.value,
// payment:formState.paymentmodel == '1'?price.value*100:priceSet.value*100,
// uid,
// remark:toRaw(formState).remark
// }
// const data:any = await onCreateGoodsPay(prarms)
// if(data.state === 1){
// message.success(data.message)
// emit('onBack')
// }
})
.catch(err => {
......@@ -211,7 +211,7 @@ const onCancel = ()=>{
visible.value = false;
}
const onChangeRadioName = (e:any)=>{
radioValue = e
radioValue = e
}
const onSet = async(index:string)=>{
const uid =getUid()
......@@ -219,17 +219,26 @@ const onSet = async(index:string)=>{
if (index == '1') {
data = await onfindWX(uid);
} else if (index == '2') {
data = await onfindAli(uid);
data = await onfindAli(uid);
}
list.value = data.data;
list.value = data.data;
showModal()
}
const onSelectCheckboxValue = (e:any,index:any)=>{
if(checkboxValue.value.includes(e)){
checkboxValue.value.splice(index,1)
}else{
checkboxValue.value.push(e)
}
const onSelectCheckboxValue = async(e:any,index:any)=>{
index = index+1
const uid =getUid()
let data:any ={}
if (index == '1') {
data = await onfindWX(uid);
} else if (index == '2') {
data = await onfindAli(uid);
}
let params:any = data.data;
if(goodspayditch.value[index-1]){
goodspayditch.value.splice(index-1,1)
}else{
goodspayditch.value[index-1]=params[0]
}
}
const showModal = () => {
visible.value = true;
......@@ -268,7 +277,6 @@ defineExpose({
priceSet,
dateFormat,
disabledDate,
startvalue,
endvalue,
...toRefs(checkboxValue),
onChangeRadioName,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment