Commit 41a815df by liuliufashi

update

parent 8784a8e7
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
"build": "vue-cli-service build --mode prod", "build": "vue-cli-service build --mode prod",
"lint": "vue-cli-service lint", "lint": "vue-cli-service lint",
"dev": "vue-cli-service serve --mode dev --open", "dev": "vue-cli-service serve --mode dev --open",
"prod": "vue-cli-service serve --mode prod --open",
"local": "vue-cli-service serve --mode local --open" "local": "vue-cli-service serve --mode local --open"
}, },
"dependencies": { "dependencies": {
......
...@@ -56,12 +56,12 @@ ...@@ -56,12 +56,12 @@
<a-switch v-model:checked="formState.fullphone" /> <a-switch v-model:checked="formState.fullphone" />
</div> </div>
</a-form-item> </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"> labelAlign="left">
<div style="display:flex"> <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" /> <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> </div>
</a-form-item> </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"> labelAlign="left">
<div style="display:flex"> <div style="display:flex">
...@@ -87,9 +87,9 @@ ...@@ -87,9 +87,9 @@
@cancel="onCancel" @cancel="onCancel"
> >
<a-radio-group v-model:value="modalvalue"> <a-radio-group v-model:value="modalvalue">
<div v-for="item in list" :itemkey="item"> <div v-for="item in list" :itemkey="item.id">
<a-radio v-if="item.paytype == 1" :value="item.name" :lable="item.id" @change="onChangeRadioName(item)">{{item.name}}</a-radio> <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.payname" :lable="item.id" @change="onChangeRadioName(item)">{{item.payname}}</a-radio> <a-radio v-else-if="item.paytype == 2" :value="item.id" :lable="item.id" @change="onChangeRadioName(item)">{{item.payname}}</a-radio>
</div> </div>
</a-radio-group> </a-radio-group>
</a-modal> </a-modal>
...@@ -119,10 +119,9 @@ interface FormState { ...@@ -119,10 +119,9 @@ interface FormState {
const visible = ref<boolean>(false); const visible = ref<boolean>(false);
const list = ref<any>([]) const list = ref<any>([])
const optionss = ref<any>([]) const optionss = ref<any>([])
let goodspayditch = ref([{}]) let goodspayditch = ref([])
const props = defineProps(); const props = defineProps();
const dateFormat = 'YYYY/MM/DD'; const dateFormat = 'YYYY/MM/DD';
const startvalue = ref<Dayjs>(dayjs('08:00', 'HH:mm'));
const endvalue = ref<Dayjs>(dayjs('10:00', 'HH:mm')); const endvalue = ref<Dayjs>(dayjs('10:00', 'HH:mm'));
const optionsWithDisabled = [ const optionsWithDisabled = [
{ value: '微信', label: '1' }, { value: '微信', label: '1' },
...@@ -148,7 +147,7 @@ const formState = reactive<FormState>({ ...@@ -148,7 +147,7 @@ const formState = reactive<FormState>({
}); });
let price = ref(0) let price = ref(0)
let priceSet = ref(0) let priceSet = ref(0)
const modalvalue = ref<any>(0) const modalvalue = ref<any>('0')
let radioValue= reactive<any>({ let radioValue= reactive<any>({
}) })
let listValue = ref<any>([]) let listValue = ref<any>([])
...@@ -175,27 +174,28 @@ const onSubmit = () => { ...@@ -175,27 +174,28 @@ const onSubmit = () => {
validate() validate()
.then(async (res) => { .then(async (res) => {
const uid =getUid() 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]')) 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}) // goodspayditch.value.map((item:any)=>{return item.goodsid = toRaw(formState).subject.value})
const prarms = { // console.log(toRaw(formState),'toRaw(formState)',goodspayditch.value);
subject:toRaw(formState).subject.label,
shortname:toRaw(formState).shortname, // const prarms = {
paymentmodel:toRaw(formState).paymentmodel, // subject:toRaw(formState).subject.label,
fullphone:toRaw(formState).paymentmodel?0:1, // shortname:toRaw(formState).shortname,
expireendtime:expireendtime, // paymentmodel:toRaw(formState).paymentmodel,
starttime:starttime, // fullphone:toRaw(formState).paymentmodel?0:1,
goodsid: toRaw(formState).subject.value, // expireendtime:expireendtime,
goodspayditch:goodspayditch.value, // starttime: moment(new Date()).format('YYYY-MM-DDTHH:mm:[00][Z]'),
payment:formState.paymentmodel == '1'?price.value*100:priceSet.value*100, // goodsid: toRaw(formState).subject.value,
uid, // goodspayditch:goodspayditch.value,
remark:toRaw(formState).remark // payment:formState.paymentmodel == '1'?price.value*100:priceSet.value*100,
} // uid,
const data:any = await onCreateGoodsPay(prarms) // remark:toRaw(formState).remark
if(data.state === 1){ // }
message.success(data.message) // const data:any = await onCreateGoodsPay(prarms)
emit('onBack') // if(data.state === 1){
} // message.success(data.message)
// emit('onBack')
// }
}) })
.catch(err => { .catch(err => {
...@@ -211,7 +211,7 @@ const onCancel = ()=>{ ...@@ -211,7 +211,7 @@ const onCancel = ()=>{
visible.value = false; visible.value = false;
} }
const onChangeRadioName = (e:any)=>{ const onChangeRadioName = (e:any)=>{
radioValue = e radioValue = e
} }
const onSet = async(index:string)=>{ const onSet = async(index:string)=>{
const uid =getUid() const uid =getUid()
...@@ -219,17 +219,26 @@ const onSet = async(index:string)=>{ ...@@ -219,17 +219,26 @@ const onSet = async(index:string)=>{
if (index == '1') { if (index == '1') {
data = await onfindWX(uid); data = await onfindWX(uid);
} else if (index == '2') { } else if (index == '2') {
data = await onfindAli(uid); data = await onfindAli(uid);
} }
list.value = data.data; list.value = data.data;
showModal() showModal()
} }
const onSelectCheckboxValue = (e:any,index:any)=>{ const onSelectCheckboxValue = async(e:any,index:any)=>{
if(checkboxValue.value.includes(e)){ index = index+1
checkboxValue.value.splice(index,1) const uid =getUid()
}else{ let data:any ={}
checkboxValue.value.push(e) 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 = () => { const showModal = () => {
visible.value = true; visible.value = true;
...@@ -268,7 +277,6 @@ defineExpose({ ...@@ -268,7 +277,6 @@ defineExpose({
priceSet, priceSet,
dateFormat, dateFormat,
disabledDate, disabledDate,
startvalue,
endvalue, endvalue,
...toRefs(checkboxValue), ...toRefs(checkboxValue),
onChangeRadioName, 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