fanfan 10 months ago
commit 33e0f7978f
  1. 12
      src/api/server/index.js
  2. 12
      src/api/server/recovery.js
  3. 61
      src/components/SelectGoods/SelectGoods.vue
  4. 112
      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', dispatchOrders: '/server/dispatchOrders',
OrderStatus: '/server/OrderStatus', OrderStatus: '/server/OrderStatus',
OrderDeatil: '/server/orderDetail', OrderDeatil: '/server/orderDetail',
delOrder: '/server/delOrder',
listByIds: '/server/listByIds', listByIds: '/server/listByIds',
} }
/** /**
@ -203,3 +204,14 @@ export function orderStatusList(data) {
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', cancelOrder: '/recovery/cancelOrder',
orderStatus: '/recovery/orderStatus', orderStatus: '/recovery/orderStatus',
orderDetail: '/recovery/orderDetail', orderDetail: '/recovery/orderDetail',
orderDel: '/recovery/orderDel',
completeOrder: '/recovery/completeOrder', completeOrder: '/recovery/completeOrder',
} }
/** /**
@ -181,3 +182,14 @@ export function completeOrder(data) {
data, data,
}) })
} }
/**
* 订单删除
* @param {*} data
*/
export function orderDel(data) {
return axios({
url: api.orderDel,
method: 'post',
data,
})
}

@ -1,6 +1,31 @@
<template> <template>
<div> <div>
<a-button @click="handleSelectGoods">选择商品</a-button> <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 <GoodsModal
ref="GoodsModal" ref="GoodsModal"
:multiple="multiple" :multiple="multiple"
@ -15,37 +40,39 @@
import PropTypes from 'ant-design-vue/es/_util/vue-types' import PropTypes from 'ant-design-vue/es/_util/vue-types'
import cloneDeep from 'lodash.clonedeep' import cloneDeep from 'lodash.clonedeep'
import { GoodsModal } from '@/components/Modal' import { GoodsModal } from '@/components/Modal'
import { GoodsItem } from '@/components/Table'
const columns = [ const columns = [
{ {
title: '商品ID', title: '商品ID',
dataIndex: 'goods_id' dataIndex: 'goods_id',
}, },
{ {
title: '商品信息', title: '商品信息',
scopedSlots: { customRender: 'item' } scopedSlots: { customRender: 'item' },
}, },
{ {
title: '库存总量', title: '库存总量',
dataIndex: 'stock_total' dataIndex: 'stock_total',
}, },
{ {
title: '操作', title: '操作',
width: '180px', width: '180px',
dataIndex: 'action', dataIndex: 'action',
scopedSlots: { customRender: 'action' } scopedSlots: { customRender: 'action' },
} },
] ]
// //
export default { export default {
name: 'SelectGoods', name: 'SelectGoods',
components: { components: {
GoodsModal GoodsModal,
GoodsItem,
}, },
model: { model: {
prop: 'value', prop: 'value',
event: 'change' event: 'change',
}, },
props: { props: {
// , false // , false
@ -53,7 +80,7 @@ export default {
// , multiple // , multiple
maxNum: PropTypes.integer.def(100), maxNum: PropTypes.integer.def(100),
// //
defaultList: PropTypes.array.def([]) defaultList: PropTypes.array.def([]),
}, },
data() { data() {
return { return {
@ -61,7 +88,7 @@ export default {
// //
selectedItems: [], selectedItems: [],
// ID // ID
selectedGoodsIds: [] selectedGoodsIds: [],
} }
}, },
watch: { watch: {
@ -74,19 +101,17 @@ export default {
if (val.length && !selectedItems.length) { if (val.length && !selectedItems.length) {
this.onUpdate(cloneDeep(val)) this.onUpdate(cloneDeep(val))
} }
}
}
}, },
created () {
}, },
},
created() {},
methods: { methods: {
// //
onUpdate(selectedItems) { onUpdate(selectedItems) {
if (this.multiple || !selectedItems.length) { if (this.multiple || !selectedItems.length) {
// //
this.selectedItems = selectedItems this.selectedItems = selectedItems
this.selectedGoodsIds = selectedItems.map(item => item.goods_id) this.selectedGoodsIds = selectedItems.map((item) => item.goods_id)
} else { } else {
// //
const single = selectedItems[selectedItems.length - 1] const single = selectedItems[selectedItems.length - 1]
@ -117,12 +142,10 @@ export default {
// change // change
onChange() { onChange() {
const { multiple, selectedGoodsIds } = this const { multiple, selectedGoodsIds } = this
const sGoodsIds = multiple ? selectedGoodsIds : (selectedGoodsIds.length ? selectedGoodsIds[0] : undefined) const sGoodsIds = multiple ? selectedGoodsIds : selectedGoodsIds.length ? selectedGoodsIds[0] : undefined
this.$emit('select', multiple ? this.selectedItems : this.selectedItems[0])
return this.$emit('change', sGoodsIds) return this.$emit('change', sGoodsIds)
} },
},
}
} }
</script> </script>

@ -13,9 +13,7 @@
</div> </div>
</a-form-item> </a-form-item>
<a-form-item class="mt-30" label="小程序 AppID" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item class="mt-30" label="小程序 AppID" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input <a-input v-decorator="['app_id', { rules: [{ required: true, message: '请输入小程序AppID' }] }]" />
v-decorator="['app_id', { rules: [{ required: true, message: '请输入小程序AppID' }] }]"
/>
<p class="form-item-help"> <p class="form-item-help">
<small>登录微信小程序平台开发 - 开发管理 - 开发设置记录AppID (小程序ID)</small> <small>登录微信小程序平台开发 - 开发管理 - 开发设置记录AppID (小程序ID)</small>
</p> </p>
@ -29,7 +27,62 @@
<small>登录微信小程序平台开发 - 开发管理 - 开发设置记录AppSecret (小程序密钥)</small> <small>登录微信小程序平台开发 - 开发管理 - 开发设置记录AppSecret (小程序密钥)</small>
</p> </p>
</a-form-item> </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-divider orientation="left">授权域名设置</a-divider>
<a-form-item <a-form-item
v-for="(item, index) in domainList" v-for="(item, index) in domainList"
@ -41,11 +94,9 @@
required required
> >
<span class="f-14">{{ `${item.protocol}://${domain}` }}</span> <span class="f-14">{{ `${item.protocol}://${domain}` }}</span>
<a <a class="ml-15 f-12" href="javascript:void(0);" @click="handleCopyLink(`${item.protocol}://${domain}`)"
class="ml-15 f-12" >点击复制</a
href="javascript:void(0);" >
@click="handleCopyLink(`${item.protocol}://${domain}`)"
>点击复制</a>
<p class="form-item-help"> <p class="form-item-help">
<small>登录小程序平台开发 - 开发管理 - 开发设置 - 服务器域名修改{{ item.protocol }}协议业务域名</small> <small>登录小程序平台开发 - 开发管理 - 开发设置 - 服务器域名修改{{ item.protocol }}协议业务域名</small>
</p> </p>
@ -68,19 +119,19 @@ import * as Api from '@/api/client/wxapp/setting'
const domainList = [ const domainList = [
{ {
name: 'request', name: 'request',
protocol: 'https' protocol: 'https',
}, },
{ {
name: 'socket', name: 'socket',
protocol: 'wss' protocol: 'wss',
}, },
{ {
name: 'uploadFile', name: 'uploadFile',
protocol: 'https' protocol: 'https',
}, },
{ {
name: 'downloadFile', name: 'downloadFile',
protocol: 'https' protocol: 'https',
}, },
] ]
@ -111,32 +162,44 @@ export default {
this.getDetail() this.getDetail()
}, },
methods: { methods: {
// //
getDetail() { getDetail() {
this.isLoading = true this.isLoading = true
Api.detail(this.key) Api.detail(this.key)
.then(result => { .then((result) => {
// //
this.record = result.data.detail this.record = result.data.detail
this.domain = result.data.domain this.domain = result.data.domain
// //
this.setFieldsValue() this.setFieldsValue()
}) })
.finally(() => this.isLoading = false) .finally(() => (this.isLoading = false))
}, },
// //
setFieldsValue() { setFieldsValue() {
const { record, $nextTick, form } = this const { record, $nextTick, form } = this
!isEmpty(form.getFieldsValue()) && $nextTick(() => { !isEmpty(form.getFieldsValue()) &&
form.setFieldsValue(pick(record, ['enabled', 'app_id', 'app_secret'])) $nextTick(() => {
form.setFieldsValue(
pick(record, [
'enabled',
'app_id',
'app_secret',
'same_city',
'new_first_gift',
'big_brand',
'new_product',
'ranking_list',
'service',
])
)
}) })
}, },
// //
handleCopyLink(url) { handleCopyLink(url) {
this.$copyText(url).then(res => { this.$copyText(url).then((res) => {
this.$message.success('复制成功', 0.8) this.$message.success('复制成功', 0.8)
}) })
}, },
@ -145,7 +208,9 @@ export default {
handleSubmit(e) { handleSubmit(e) {
e.preventDefault() e.preventDefault()
// //
const { form: { validateFields } } = this const {
form: { validateFields },
} = this
validateFields((errors, values) => { validateFields((errors, values) => {
// api // api
!errors && this.onFormSubmit(values) !errors && this.onFormSubmit(values)
@ -156,11 +221,10 @@ export default {
onFormSubmit(values) { onFormSubmit(values) {
this.isLoading = true this.isLoading = true
Api.update(this.key, { form: values }) Api.update(this.key, { form: values })
.then(result => this.$message.success(result.message, 1.5)) .then((result) => this.$message.success(result.message, 1.5))
.finally(() => this.isLoading = false) .finally(() => (this.isLoading = false))
} },
},
}
} }
</script> </script>
<style lang="less" scoped> <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 v-if="item.order_status == 10" v-action:edit style="margin-right: 8px" @click="handleAcceptance(item)"
>验收</a >验收</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> </span>
</a-table> </a-table>
<a-pagination <a-pagination
@ -109,9 +116,14 @@ const columns = [
}, },
{ {
title: '期待价格', title: '期待价格',
width: '180px', width: '100px',
dataIndex: 'expect_price', dataIndex: 'expect_price',
}, },
{
title: '实际回收价',
width: '100px',
dataIndex: 'real_price',
},
{ {
title: '添加时间', title: '添加时间',
width: '180px', 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() { getOrderStatusList() {
this.isLoading = true 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 v-if="item.order_status == 20" v-action:edit style="margin-right: 8px" @click="handleDispatch(item.order_id)"
>派单</a >派单</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 <a
v-if="item.order_status == 10 || item.order_status == 20" v-if="item.order_status == 10 || item.order_status == 20"
style="margin-right: 8px" style="margin-right: 8px"
@ -267,6 +274,22 @@ export default {
handleDispatch(order_id) { handleDispatch(order_id) {
this.$refs.dispatchRef.add(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 强制刷新到第一页 * @param Boolean bool 强制刷新到第一页

Loading…
Cancel
Save