Commit ef3812d4 by liuliufashi

updater

parent d35dd5bb
......@@ -31,6 +31,9 @@
<template v-if="column.key === 'price'">
<div>{{ record.price / 100 }}</div>
</template>
<template v-if="column.key === 'sellamount'">
<div>{{ record.sellamount / 100 }}</div>
</template>
<template v-if="column.key === 'status'">
<div v-if="record.status === 0" style="color: rgb(12, 191, 33);">正常</div>
<div v-else style="color: #f56c6c;">已下架</div>
......@@ -186,12 +189,12 @@ const columns = [
dataIndex: "sellcount",
},
{
title: "默认金额",
title: "默认单价(元)",
key: "price",
dataIndex: "price",
},
{
title: "已售金额",
title: "已售金额(元)",
key: "sellamount",
dataIndex: "sellamount",
},
......
<template>
<div>
<div style="display: flex;margin-bottom: 20px;">
<a-input-search v-model:value="value" placeholder="请输入订单号" style="width: 200px" @search="onSearchOrd" />
</div>
<div>
<div style="display: flex;margin-bottom: 20px;">
<a-input-search v-model:value="value" placeholder="请输入订单号" style="width: 200px" @search="onSearchOrd" />
</div>
<a-table :columns="columns" :data-source="list" @change="tableChange" :pagination="pagination" :scroll="{ y: 'calc(100vh - 300px)' }">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'amount'">
<div v-if="record.amount">
<div>{{ record.amount/100 }}</div>
</div>
</template>
<template v-if="column.key === 'nickname'">
<div v-if="record.nickname">
<div>{{ record.nickname }}</div>
</div>
<div v-else>
~
</div>
</template>
<template v-if="column.key === 'creator'">
<div v-if="record.creator">
<div>{{ record.creator }}</div>
</div>
<div v-else>
~
</div>
</template>
<template v-if="column.key === 'headimgurl'">
<div v-if="record.headimgurl">
<a-image :width="50" :src="record.headimgurl" />
</div>
<div v-else>
~
</div>
</template>
<a-table :columns="columns" :data-source="list" @change="tableChange" :pagination="pagination"
:scroll="{ y: 'calc(100vh - 300px)' }">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'amount'">
<div v-if="record.amount">
<div>{{ record.amount / 100 }}</div>
</div>
</template>
<template v-if="column.key === 'nickname'">
<div v-if="record.nickname">
<div>{{ record.nickname }}</div>
</div>
<div v-else>
~
</div>
</template>
<template v-if="column.key === 'creator'">
<div v-if="record.creator">
<div>{{ record.creator }}</div>
</div>
<div v-else>
~
</div>
</template>
<template v-if="column.key === 'headimgurl'">
<div v-if="record.headimgurl">
<a-image :width="50" :src="record.headimgurl" />
</div>
<div v-else>
~
</div>
</template>
<template v-if="column.key === 'status'">
<div v-if="record.status === 0" style="color: rgb(245, 108, 108);">
未支付
</div>
<div v-else style="color: rgb(12, 191, 33);">
已支付
</div>
<div v-if="record.status === 0" style="color: rgb(245, 108, 108);">
未支付
</div>
<div v-else style="color: rgb(12, 191, 33);">
已支付
</div>
</template>
<template v-if="column.key === 'paytype'">
<div v-if="record.paytype === 1">
微信
</div>
<div v-else-if="record.paytype === 2">
支付宝
</div>
<div v-else>
未知
</div>
</template>
</template>
</template>
</a-table>
</a-table>
</div>
</template>
<script lang="ts" setup>
......@@ -53,22 +65,31 @@ import { onMounted, ref, defineExpose } from 'vue';
import { onFindPayInfo, onFindPayOrderid } from '@/api/index'
import { getUid } from '@/utils/userInfo'
const columns = [
{
title: '订单号',
dataIndex: 'id',
key: 'id',
},
{
title: '商品名',
dataIndex: 'subject',
key: 'subject',
},
{
title: '金额',
{
title: '金额(元)',
dataIndex: 'amount',
key: 'amount',
},
{
title: '订单号',
dataIndex: 'id',
key: 'id',
},
title: '订单时间',
dataIndex: 'updatetime',
key: 'updatetime',
},
{
title: '头像',
dataIndex: 'headimgurl',
key: 'headimgurl',
},
{
title: '昵称',
dataIndex: 'nickname',
......@@ -79,21 +100,19 @@ const columns = [
dataIndex: 'creator',
key: 'creator',
},
{
title: '头像',
dataIndex: 'headimgurl',
key: 'headimgurl',
title: '支付渠道',
dataIndex: 'paytype',
key: 'paytype',
},
{
{
title: '状态',
dataIndex: 'status',
key: 'status',
},
{
title: '订单时间',
dataIndex: 'updatetime',
key: 'updatetime',
},
];
let list = ref<any>([])
let value = ref<any>('')
......@@ -134,20 +153,20 @@ const onSearch = async () => {
}
}
}
const onSearchOrd =async()=>{
const onSearchOrd = async () => {
const uid = getUid()
const prarms= {
orderid:value.value,
const prarms = {
orderid: value.value,
uid
}
const data:any = await onFindPayOrderid(prarms)
const data: any = await onFindPayOrderid(prarms)
if (data.state === 1) {
list.value = [data.data]
pagination.value.total = data.data.count
list.value = [data.data]
pagination.value.total = data.data.count
}
}
const tableChange = async (e:any) => {
const tableChange = async (e: any) => {
const uid = getUid()
const prarms: any = {
page: e.current,
......
......@@ -40,7 +40,7 @@
</a-checkbox>
<div style="margin-left:20px;">收款账户</div>
<div style="margin-left:20px;color: black;" v-if="listValue[index] &&listValue[index].paytype == 1">{{listValue[index].name}}</div>
<div style="margin-left:20px;color: black;" v-else-if="listValue[index] &&listValue[index].paytype == 2">{{listValue[index].payname}}</div>
<div style="margin-left:20px;color: black;" v-else-if="listValue[index] &&listValue[index].paytype == 2">{{listValue[index].name}}</div>
<div style="margin-left:20px;color: black;" v-else>默认</div>
<div style="margin-left:20px;color: rgb(15, 64, 245);cursor: pointer;" @click="onSet(item.label)">设置</div>
</div>
......@@ -86,7 +86,7 @@
<a-radio-group v-model:value="modalvalue">
<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.name}}</a-radio>
<a-radio v-else-if="item.paytype == 2" :value="item.id" :lable="item.id" @change="onChangeRadioName(item)">{{item}}</a-radio>
</div>
</a-radio-group>
</a-modal>
......
......@@ -10,7 +10,8 @@
</div>
</div>
<div style="margin-top: 10px;" v-if="isShow">
<a-table :dataSource="list" :columns="columns" :pagination="pagination" @change="tableChange" :scroll="{ y: 'calc(100vh - 270px)' }">
<a-table :dataSource="list" :columns="columns" :pagination="pagination" @change="tableChange"
:scroll="{ y: 'calc(100vh - 270px)' }">
<template #bodyCell="{ column, record }">
<div v-if="column.key == 'picurl'">
<div style="display:flex;align-items: center;">
......@@ -19,7 +20,7 @@
</div>
</div>
<div v-else-if="column.key == 'status'" style="width:80px;">
<div v-if="record.status == 0" style="color: rgb(12, 191, 33);width:80px;" >
<div v-if="record.status == 0" style="color: rgb(12, 191, 33);width:80px;">
正常
</div>
<div v-else-if="record.status == 1" style="color: #e6a23c;width:80px;">
......@@ -30,46 +31,51 @@
</div>
</div>
<div v-if="column.key == 'payment'">
{{record.payment/100}}
{{ record.payment / 100 }}
</div>
<div v-if="column.key == 'tags'" style="display:flex;">
<a-button type="primary" @click="onEdit(record)" style=";width: 80px;" >编辑</a-button>
<a-button type="primary" style="margin-left: 10px;width: 90px;" @click="onCopy(record)">支付链接</a-button>
<a-button type="primary" @click="onEdit(record)" style=";width: 80px;">编辑</a-button>
<a-button type="primary" style="margin-left: 10px;width: 90px;" @click="onCopy(record)">支付链接
</a-button>
<!-- <a-button type="primary" style="margin-left: 20px;">统计</a-button> -->
<a-popconfirm title="确定下架这条数据" ok-text="确定" cancel-text="取消" @confirm="onDel(record)" style=";width: 80px;">
<a-popconfirm title="确定下架这条数据" ok-text="确定" cancel-text="取消" @confirm="onDel(record)"
style=";width: 80px;">
<a-button type="primary" style="margin-left: 10px">删除</a-button>
</a-popconfirm>
</div>
<div v-if="column.key == 'time' && (record.starttime >= new Date())" style="color: #DDD222;">
{{moment(record.starttime).format('YYYY-MM-DD HH:mm')}}
</div>
<div v-else-if="column.key == 'time' && (record.starttime<new Date())" style="color: red;">
{{moment(record.starttime).format('YYYY-MM-DD HH:mm')}}
</div>
<div v-if="column.key == 'time' && (record.starttime >= new Date())" style="color: #DDD222;">
{{ moment(record.starttime).format('YYYY-MM-DD HH:mm') }}
</div>
<div v-else-if="column.key == 'time' && (record.starttime < new Date())" style="color: red;">
{{ moment(record.starttime).format('YYYY-MM-DD HH:mm') }}
</div>
</template>
</a-table>
</div>
<div v-else>
<div style="display:flex">
<a-button class="small left" @click="onBack">
<template #icon>
<LeftOutlined />
</template>
<template #icon>
<LeftOutlined />
</template>
</a-button>
</div>
<CreatePay @onBack="onBack"></CreatePay>
</div>
<a-modal v-model:visible="visible" title="编辑" @ok="handleOk" :width="1000" >
<a-modal v-model:visible="visible" title="编辑" @ok="handleOk" :width="1000">
<a-form :model="formState" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }"
autocomplete="off" >
autocomplete="off">
<a-form-item label="选择商品" name="subject" :label-col="{ span: 2 }" labelAlign="left">
<div style="width:100%;display: flex;align-items: center;">
<a-select v-model:value="formState.subject" mode="multiple" style="width: 100%" placeholder="请选择商品" @focus="onSubSearch" @search="onSubSearch" @select="onSelect" @popupScroll="popupScroll">
<a-select-option v-for="item,index in listArray" :itemKey="item" :value="item.subject" :label="index" :key="index">
<span>{{item.subject}}</span>
</a-select-option>
</a-select>
<a-select v-model:value="formState.subject" mode="multiple" style="width: 100%"
placeholder="请选择商品" @focus="onSubSearch" @search="onSubSearch" @select="onSelect"
@popupScroll="popupScroll">
<a-select-option v-for="item, index in listArray" :itemKey="item" :value="item.subject"
:label="index" :key="index">
<span>{{ item.subject }}</span>
</a-select-option>
</a-select>
</div>
</a-form-item>
<a-form-item label="项目描述" name="shortname" :label-col="{ span: 2 }" labelAlign="left">
......@@ -78,15 +84,17 @@
<a-form-item label="支付金额" name="price" :label-col="{ span: 2 }" labelAlign="left">
<a-radio-group v-model:value="formState.paymentmodel" name="radioGroup" class="pay">
<div style="display: flex;height: 35px;">
<a-radio value="0" style="width:150px;" >商品默认金额</a-radio>
<a-input-number style="width:200px;height: 35px;" :value="formState.price" :formatter="value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')"
:parser="value => value.replace(/\$\s?|(,*)/g, '')" :disabled="true"/>
<a-radio value="0" style="width:150px;">商品默认金额</a-radio>
<a-input-number style="width:200px;height: 35px;" :value="formState.price"
:formatter="value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')"
:parser="value => value.replace(/\$\s?|(,*)/g, '')" :disabled="true" />
<div style="width:50px;"></div>
</div>
<div style="display: flex;height: 35px;margin-top: 20px;">
<a-radio value="1" style="width:150px;">自定义金额</a-radio>
<a-input-number style="width:200px;height: 35px;" v-model:value="formState.payment" :formatter="value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')"
:parser="value => value.replace(/\$\s?|(,*)/g, '')"/>
<a-input-number style="width:200px;height: 35px;" v-model:value="formState.payment"
:formatter="value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')"
:parser="value => value.replace(/\$\s?|(,*)/g, '')" />
<div style="width:50px;"></div>
</div>
</a-radio-group>
......@@ -98,8 +106,7 @@
</a-form-item>
<a-form-item label="结束时间" name="price" :label-col="{ span: 2 }" labelAlign="left">
<div style="display:flex">
<a-date-picker v-model:value="value4" :format="dateFormat"
:disabledDate="disabledDate" />
<a-date-picker v-model:value="value4" :format="dateFormat" :disabledDate="disabledDate" />
<a-time-picker style="margin-left: 20px;" v-model:value="value5" format="HH:mm" />
</div>
</a-form-item>
......@@ -114,22 +121,22 @@
</template>
<script lang="ts" setup>
import { ref, defineExpose, onMounted,reactive } from 'vue';
import { SelectProps,message } from 'ant-design-vue';
import { ref, defineExpose, onMounted, reactive } from 'vue';
import { SelectProps, message } from 'ant-design-vue';
import { getUid } from '@/utils/userInfo'
import moment from 'moment';
import { onUpdateGoodsPay, onfindby,onfindWX,onfindAli,onDelectgoodpay,onFindbyLikeName,onFindBysub} from '@/api/index'
import { onUpdateGoodsPay, onfindby, onfindWX, onfindAli, onDelectgoodpay, onFindbyLikeName, onFindBysub } from '@/api/index'
import CreatePay from './components/createpay/index.vue'
import dayjs, { Dayjs } from 'dayjs';
import useClipboard from 'vue-clipboard3'
import { LeftOutlined} from "@ant-design/icons-vue";
import { LeftOutlined } from "@ant-design/icons-vue";
const dateFormat = 'YYYY/MM/DD';
let listValue = ref<any>([])
const { toClipboard } = useClipboard()
const disabledDate = (current: any) => {
return current && current < moment().startOf("day")
}
const uid =getUid()
const uid = getUid()
const value = ref<string>('');
const checkboxValue = ref<any>([])
const optionss = ref<Array<Object>>([])
......@@ -140,12 +147,12 @@ let isShow = ref(true)
let formState = ref<any>({
})
const pagination = reactive({
total:0,
page:1,
defaultPageSize:10,
showSizeChanger:true,
total: 0,
page: 1,
defaultPageSize: 10,
showSizeChanger: true,
pageSizeOptions: ['5', '10', '15', '20'],
onShowSizeChange:(current:any, pageSize:any)=>pageSize = pageSize
onShowSizeChange: (current: any, pageSize: any) => pageSize = pageSize
})
const optionsWithDisabled = [
{ value: '微信', label: '1' },
......@@ -165,22 +172,22 @@ const columns = [
key: 'goodsid',
},
{
title: '商品价格',
title: '商品单价(元)',
dataIndex: 'payment',
key: 'payment',
width: 100,
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
width: 100,
width: 100,
},
{
title: '创建人',
dataIndex: 'userid',
key: 'userid',
},
{
title: '备注',
dataIndex: 'remark',
......@@ -205,52 +212,52 @@ const value5 = ref<any>()
const showModal = () => {
visible.value = true;
};
const handleOk =async(e: MouseEvent) => {
const uid =getUid()
const starttime = moment(new Date()).format('YYYY-MM-DDTHH:mm:[00][Z]')
const expireendtime = (moment(value4.value.$d).format('YYYY-MM-DD'))+(moment(value5.value.$d).format('THH:mm:[00][Z]'))
formState.value.fullphone = formState.value.fullphone?'0':'1'
formState.value.payment= formState.value.payment*100
const params={
const handleOk = async (e: MouseEvent) => {
const uid = getUid()
const starttime = moment(new Date()).format('YYYY-MM-DDTHH:mm:[00][Z]')
const expireendtime = (moment(value4.value.$d).format('YYYY-MM-DD')) + (moment(value5.value.$d).format('THH:mm:[00][Z]'))
formState.value.fullphone = formState.value.fullphone ? '0' : '1'
formState.value.payment = formState.value.payment * 100
const params = {
...formState.value,
uid,
}
const data:any = await onUpdateGoodsPay(params)
if(data.state == 1){
visible.value = false;
onSearch()
const data: any = await onUpdateGoodsPay(params)
if (data.state == 1) {
visible.value = false;
onSearch()
}
};
const onGetSearch= async() => {
const onGetSearch = async () => {
const params = {
size:pagination.defaultPageSize,
page:pagination.page ,
uid:getUid(),
subject:value.value
size: pagination.defaultPageSize,
page: pagination.page,
uid: getUid(),
subject: value.value
}
const data =await onFindBysub(params)
list.value = data.data.goods
pagination.total = data.data.count
const data = await onFindBysub(params)
list.value = data.data.goods
pagination.total = data.data.count
}
const onEdit = (e: any) => {
console.log(e,'e');
formState.value= {
...e
}
value2.value = dayjs(moment(e.starttime).format(('YYYY/MM/DD')), dateFormat)
value3.value = dayjs(moment(e.starttime).format(('HH:mm')), 'HH:mm')
value4.value = dayjs(moment(e.expireendtime).format(('YYYY-MM-DD')), dateFormat)
value5.value = dayjs(moment(e.expireendtime).format(('HH:mm')), 'HH:mm')
formState.value.payment = formState.value.payment/100
formState.value.paymentmodel = '1'
formState.value.fullphone = formState.value.fullphone?true:false
showModal()
console.log(e, 'e');
formState.value = {
...e
}
value2.value = dayjs(moment(e.starttime).format(('YYYY/MM/DD')), dateFormat)
value3.value = dayjs(moment(e.starttime).format(('HH:mm')), 'HH:mm')
value4.value = dayjs(moment(e.expireendtime).format(('YYYY-MM-DD')), dateFormat)
value5.value = dayjs(moment(e.expireendtime).format(('HH:mm')), 'HH:mm')
formState.value.payment = formState.value.payment / 100
formState.value.paymentmodel = '1'
formState.value.fullphone = formState.value.fullphone ? true : false
showModal()
}
const onSearch = async () => {
const params = {
size:pagination.defaultPageSize,
page:pagination.page ,
size: pagination.defaultPageSize,
page: pagination.page,
name: value.value,
uid: getUid()
}
......@@ -258,14 +265,14 @@ const onSearch = async () => {
list.value = data.data.goods
pagination.total = data.data.count
};
const tableChange=async(e:any)=>{
let queryData = {
current_page:e.current,//当前页数
per_page:e.pageSize//每页显示条数
};
const params = {
size:queryData.per_page,
page:queryData.current_page ,
const tableChange = async (e: any) => {
let queryData = {
current_page: e.current,//当前页数
per_page: e.pageSize//每页显示条数
};
const params = {
size: queryData.per_page,
page: queryData.current_page,
uid: getUid()
}
const data = await onfindby(params)
......@@ -279,35 +286,35 @@ const onBack = (e: Number) => {
const onCreatePay = async () => {
isShow.value = !isShow.value
}
const onCopy = async(e:any) => {
console.log(e,'e');
const onCopy = async (e: any) => {
console.log(e, 'e');
const value = localStorage.getItem('url') || ''
try {
try {
await toClipboard(`${value}/#/?ditch=${uid}&goodsid=${e.id}&phone=${e.fullphone}`)
message.success('复制成功')
} catch (e) {
} catch (e) {
console.error(e)
}
}
}
const onSet = async(index:string)=>{
const uid =getUid()
let data:any ={}
const onSet = async (index: string) => {
const uid = getUid()
let data: any = {}
if (index == '1') {
data = await onfindWX(uid);
data = await onfindWX(uid);
} else if (index == '2') {
data = await onfindAli(uid);
data = await onfindAli(uid);
}
list.value = data.data.goods
pagination.total = data.data.count
}
const onDel = async (e: any) => {
const prarms = {
uid:getUid(),
goodspayid:e.id
}
const data:any = await onDelectgoodpay(prarms)
if(data.state == 1){
uid: getUid(),
goodspayid: e.id
}
const data: any = await onDelectgoodpay(prarms)
if (data.state == 1) {
await onSearch()
}
}
......@@ -322,32 +329,32 @@ const onFinishFailed = (errorInfo: any) => {
const onSelectCheckboxValue = (e: any, index: any) => {
checkboxValue.value[index] = e
}
const onSelect =(e:any,opt:any)=>{
const onSelect = (e: any, opt: any) => {
formState.value.subject = ''
const goodspayditch = formState.value.goodspayditch
const id = formState.value.id
formState.value ={
goodspayditch:goodspayditch,
formState.value = {
goodspayditch: goodspayditch,
...opt.itemKey,
id
}
formState.value.price = formState.value.price/100
formState.value.paymentmodel= '1'
formState.value.price = formState.value.price / 100
formState.value.paymentmodel = '1'
}
const onSubSearch = async(value:any)=>{
const onSubSearch = async (value: any) => {
const uid = getUid();
const params = {
name: value.target?'':value,
size:10,
page:1,
name: value.target ? '' : value,
size: 10,
page: 1,
uid,
};
const data = await onFindbyLikeName(params);
listArray.value = data.data.goods
pagination.value.total =data.data.count
pagination.value.total = data.data.count
}
const popupScroll = ()=>{
const popupScroll = () => {
console.log(1);
}
onMounted(async () => {
......@@ -397,9 +404,9 @@ defineExpose({
border: none;
height: 30px;
width: 50px;
}
}
.left {
.left {
border-left: 1px solid rgb(236, 236, 236);
border-top: 1px solid rgb(236, 236, 236);
border-bottom: 1px solid rgb(236, 236, 236);
......@@ -407,5 +414,5 @@ defineExpose({
border-right: 1px solid rgb(236, 236, 236);
border-bottom-left-radius: 25px;
border-top-left-radius: 25px;
}
}
</style>
\ No newline at end of file
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