fanfan 10 months ago
commit 33e0f7978f
  1. 12
      src/api/server/index.js
  2. 12
      src/api/server/recovery.js
  3. 75
      src/components/SelectGoods/SelectGoods.vue
  4. 128
      src/views/client/wxapp/Setting.vue
  5. 30
      src/views/recovery/order/Index.vue
  6. 23
      src/views/server/Order.vue

@ -18,6 +18,7 @@ const api = {
dispatchOrders: '/server/dispatchOrders',
OrderStatus: '/server/OrderStatus',
OrderDeatil: '/server/orderDetail',
delOrder: '/server/delOrder',
listByIds: '/server/listByIds',
}
/**
@ -203,3 +204,14 @@ export function orderStatusList(data) {
data,
})
}
/**
* 删除
* @param {*} data
*/
export function delOrder(data) {
return axios({
url: api.delOrder,
method: 'post',
data,
})
}

@ -16,6 +16,7 @@ const api = {
cancelOrder: '/recovery/cancelOrder',
orderStatus: '/recovery/orderStatus',
orderDetail: '/recovery/orderDetail',
orderDel: '/recovery/orderDel',
completeOrder: '/recovery/completeOrder',
}
/**
@ -181,3 +182,14 @@ export function completeOrder(data) {
data,
})
}
/**
* 订单删除
* @param {*} data
*/
export function orderDel(data) {
return axios({
url: api.orderDel,
method: 'post',
data,
})
}

@ -1,6 +1,31 @@
<template>
<div>
<a-button @click="handleSelectGoods">选择商品</a-button>
<a-table
v-show="selectedItems.length"
class="table-goodsList"
rowKey="goods_id"
:columns="columns"
:dataSource="selectedItems"
:pagination="false"
>
<!-- 商品信息 -->
<template slot="item" slot-scope="item">
<GoodsItem
:data="{
image: item.goods_image,
imageAlt: '商品图片',
title: item.goods_name,
subtitle: `¥${item.goods_price_min}`,
}"
:subTitleColor="true"
/>
</template>
<!-- 操作项 -->
<span slot="action" slot-scope="text, item, index">
<a v-action:delete @click="handleDeleteItem(index)">删除</a>
</span>
</a-table>
<GoodsModal
ref="GoodsModal"
:multiple="multiple"
@ -15,37 +40,39 @@
import PropTypes from 'ant-design-vue/es/_util/vue-types'
import cloneDeep from 'lodash.clonedeep'
import { GoodsModal } from '@/components/Modal'
import { GoodsItem } from '@/components/Table'
const columns = [
{
title: '商品ID',
dataIndex: 'goods_id'
dataIndex: 'goods_id',
},
{
title: '商品信息',
scopedSlots: { customRender: 'item' }
scopedSlots: { customRender: 'item' },
},
{
title: '库存总量',
dataIndex: 'stock_total'
dataIndex: 'stock_total',
},
{
title: '操作',
width: '180px',
dataIndex: 'action',
scopedSlots: { customRender: 'action' }
}
scopedSlots: { customRender: 'action' },
},
]
//
export default {
name: 'SelectGoods',
components: {
GoodsModal
GoodsModal,
GoodsItem,
},
model: {
prop: 'value',
event: 'change'
event: 'change',
},
props: {
// , false
@ -53,15 +80,15 @@ export default {
// , multiple
maxNum: PropTypes.integer.def(100),
//
defaultList: PropTypes.array.def([])
defaultList: PropTypes.array.def([]),
},
data () {
data() {
return {
columns,
//
selectedItems: [],
// ID
selectedGoodsIds: []
selectedGoodsIds: [],
}
},
watch: {
@ -69,24 +96,22 @@ export default {
defaultList: {
//
immediate: true,
handler (val) {
handler(val) {
const { selectedItems } = this
if (val.length && !selectedItems.length) {
this.onUpdate(cloneDeep(val))
}
}
}
},
created () {
},
},
created() {},
methods: {
//
onUpdate (selectedItems) {
onUpdate(selectedItems) {
if (this.multiple || !selectedItems.length) {
//
this.selectedItems = selectedItems
this.selectedGoodsIds = selectedItems.map(item => item.goods_id)
this.selectedGoodsIds = selectedItems.map((item) => item.goods_id)
} else {
//
const single = selectedItems[selectedItems.length - 1]
@ -97,32 +122,30 @@ export default {
},
//
handleSelectGoods () {
handleSelectGoods() {
this.$refs.GoodsModal.handle()
},
// modal
handleSelectGoodsSubmit (result) {
handleSelectGoodsSubmit(result) {
const { selectedItems } = result
this.onUpdate(cloneDeep(selectedItems))
},
//
handleDeleteItem (index) {
handleDeleteItem(index) {
const { selectedItems } = this
selectedItems.splice(index, 1)
this.onUpdate(selectedItems)
},
// change
onChange () {
onChange() {
const { multiple, selectedGoodsIds } = this
const sGoodsIds = multiple ? selectedGoodsIds : (selectedGoodsIds.length ? selectedGoodsIds[0] : undefined)
this.$emit('select', multiple ? this.selectedItems : this.selectedItems[0])
const sGoodsIds = multiple ? selectedGoodsIds : selectedGoodsIds.length ? selectedGoodsIds[0] : undefined
return this.$emit('change', sGoodsIds)
}
}
},
},
}
</script>

@ -13,9 +13,7 @@
</div>
</a-form-item>
<a-form-item class="mt-30" label="小程序 AppID" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
v-decorator="['app_id', { rules: [{ required: true, message: '请输入小程序AppID' }] }]"
/>
<a-input v-decorator="['app_id', { rules: [{ required: true, message: '请输入小程序AppID' }] }]" />
<p class="form-item-help">
<small>登录微信小程序平台开发 - 开发管理 - 开发设置记录AppID (小程序ID)</small>
</p>
@ -29,10 +27,65 @@
<small>登录微信小程序平台开发 - 开发管理 - 开发设置记录AppSecret (小程序密钥)</small>
</p>
</a-form-item>
<a-form-item class="mt-30" label="同城送" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group v-decorator="['same_city', { rules: [{ required: true }] }]">
<a-radio :value="true">开启</a-radio>
<a-radio :value="false">关闭</a-radio>
</a-radio-group>
<div class="form-item-help">
<small>如关闭用户则无法通过微信小程序端访问同城送</small>
</div>
</a-form-item>
<a-form-item class="mt-30" label="新人首礼" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group v-decorator="['new_first_gift', { rules: [{ required: true }] }]">
<a-radio :value="true">开启</a-radio>
<a-radio :value="false">关闭</a-radio>
</a-radio-group>
<div class="form-item-help">
<small>如关闭用户则无法通过微信小程序端访问新人首礼</small>
</div>
</a-form-item>
<a-form-item class="mt-30" label="大牌正品" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group v-decorator="['big_brand', { rules: [{ required: true }] }]">
<a-radio :value="true">开启</a-radio>
<a-radio :value="false">关闭</a-radio>
</a-radio-group>
<div class="form-item-help">
<small>如关闭用户则无法通过微信小程序端访问大牌正品</small>
</div>
</a-form-item>
<a-form-item class="mt-30" label="新品首发" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group v-decorator="['new_product', { rules: [{ required: true }] }]">
<a-radio :value="true">开启</a-radio>
<a-radio :value="false">关闭</a-radio>
</a-radio-group>
<div class="form-item-help">
<small>如关闭用户则无法通过微信小程序端访问新品首发</small>
</div>
</a-form-item>
<a-form-item class="mt-30" label="排行榜" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group v-decorator="['ranking_list', { rules: [{ required: true }] }]">
<a-radio :value="true">开启</a-radio>
<a-radio :value="false">关闭</a-radio>
</a-radio-group>
<div class="form-item-help">
<small>如关闭用户则无法通过微信小程序端访问排行榜</small>
</div>
</a-form-item>
<a-form-item class="mt-30" label="服务" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group v-decorator="['service', { rules: [{ required: true }] }]">
<a-radio :value="true">开启</a-radio>
<a-radio :value="false">关闭</a-radio>
</a-radio-group>
<div class="form-item-help">
<small>如关闭用户则无法通过微信小程序端访问服务</small>
</div>
</a-form-item>
<a-divider orientation="left">授权域名设置</a-divider>
<a-form-item
v-for="(item , index) in domainList"
v-for="(item, index) in domainList"
:key="index"
class="mt-30"
:label="`${item.name}合法域名`"
@ -41,11 +94,9 @@
required
>
<span class="f-14">{{ `${item.protocol}://${domain}` }}</span>
<a
class="ml-15 f-12"
href="javascript:void(0);"
@click="handleCopyLink(`${item.protocol}://${domain}`)"
>点击复制</a>
<a class="ml-15 f-12" href="javascript:void(0);" @click="handleCopyLink(`${item.protocol}://${domain}`)"
>点击复制</a
>
<p class="form-item-help">
<small>登录小程序平台开发 - 开发管理 - 开发设置 - 服务器域名修改{{ item.protocol }}协议业务域名</small>
</p>
@ -68,24 +119,24 @@ import * as Api from '@/api/client/wxapp/setting'
const domainList = [
{
name: 'request',
protocol: 'https'
protocol: 'https',
},
{
name: 'socket',
protocol: 'wss'
protocol: 'wss',
},
{
name: 'uploadFile',
protocol: 'https'
protocol: 'https',
},
{
name: 'downloadFile',
protocol: 'https'
protocol: 'https',
},
]
export default {
data () {
data() {
return {
//
labelCol: { span: 4 },
@ -106,46 +157,60 @@ export default {
}
},
//
created () {
created() {
//
this.getDetail()
},
methods: {
//
getDetail () {
getDetail() {
this.isLoading = true
Api.detail(this.key)
.then(result => {
.then((result) => {
//
this.record = result.data.detail
this.domain = result.data.domain
//
this.setFieldsValue()
})
.finally(() => this.isLoading = false)
.finally(() => (this.isLoading = false))
},
//
setFieldsValue () {
setFieldsValue() {
const { record, $nextTick, form } = this
!isEmpty(form.getFieldsValue()) && $nextTick(() => {
form.setFieldsValue(pick(record, ['enabled', 'app_id', 'app_secret']))
!isEmpty(form.getFieldsValue()) &&
$nextTick(() => {
form.setFieldsValue(
pick(record, [
'enabled',
'app_id',
'app_secret',
'same_city',
'new_first_gift',
'big_brand',
'new_product',
'ranking_list',
'service',
])
)
})
},
//
handleCopyLink (url) {
this.$copyText(url).then(res => {
handleCopyLink(url) {
this.$copyText(url).then((res) => {
this.$message.success('复制成功', 0.8)
})
},
//
handleSubmit (e) {
handleSubmit(e) {
e.preventDefault()
//
const { form: { validateFields } } = this
const {
form: { validateFields },
} = this
validateFields((errors, values) => {
// api
!errors && this.onFormSubmit(values)
@ -153,14 +218,13 @@ export default {
},
// api
onFormSubmit (values) {
onFormSubmit(values) {
this.isLoading = true
Api.update(this.key, { form: values })
.then(result => this.$message.success(result.message, 1.5))
.finally(() => this.isLoading = false)
}
}
.then((result) => this.$message.success(result.message, 1.5))
.finally(() => (this.isLoading = false))
},
},
}
</script>
<style lang="less" scoped>

@ -51,6 +51,13 @@
<a v-if="item.order_status == 10" v-action:edit style="margin-right: 8px" @click="handleAcceptance(item)"
>验收</a
>
<a
v-if="item.order_status == 10 || item.order_status == 30"
v-action:edit
style="margin-right: 8px"
@click="handleDelete(item.order_id)"
>删除</a
>
</span>
</a-table>
<a-pagination
@ -109,9 +116,14 @@ const columns = [
},
{
title: '期待价格',
width: '180px',
width: '100px',
dataIndex: 'expect_price',
},
{
title: '实际回收价',
width: '100px',
dataIndex: 'real_price',
},
{
title: '添加时间',
width: '180px',
@ -241,6 +253,22 @@ export default {
},
})
},
//
handleDelete(order_id) {
const self = this
const modal = this.$confirm({
title: '您确定要删除该记录吗?',
content: '删除后不可恢复',
onOk() {
return Api.orderDel({ order_id })
.then((result) => {
self.$message.success(result.message, 1.5)
self.handleRefresh()
})
.finally(() => modal.destroy())
},
})
},
//
getOrderStatusList() {
this.isLoading = true

@ -58,6 +58,13 @@
<a v-if="item.order_status == 20" v-action:edit style="margin-right: 8px" @click="handleDispatch(item.order_id)"
>派单</a
>
<a
v-if="item.order_status == 10 || item.order_status == 50"
v-action:edit
style="margin-right: 8px"
@click="handleDelete(item.order_id)"
>删除</a
>
<a
v-if="item.order_status == 10 || item.order_status == 20"
style="margin-right: 8px"
@ -267,6 +274,22 @@ export default {
handleDispatch(order_id) {
this.$refs.dispatchRef.add(order_id)
},
//
handleDelete(order_id) {
const self = this
const modal = this.$confirm({
title: '您确定要删除该记录吗?',
content: '删除后不可恢复',
onOk() {
return Api.delOrder({ order_id })
.then((result) => {
self.$message.success(result.message, 1.5)
self.handleRefresh()
})
.finally(() => modal.destroy())
},
})
},
/**
* 刷新列表
* @param Boolean bool 强制刷新到第一页

Loading…
Cancel
Save