|
@@ -47,17 +47,19 @@
|
|
|
<el-button v-permit="0" :roles-permit="roles" type="primary" class="bg1" @click="machExamine(0)">订单审核</el-button>
|
|
|
<el-button v-permit="1" :roles-permit="roles" type="primary" class="bg2" @click="machExamine(1)">财务审核</el-button>
|
|
|
<el-button v-permit="2" :roles-permit="roles" type="primary" class="bg3" @click="machExamine(2)">发货审核</el-button>
|
|
|
- <el-button v-permit="[0,1,2]" :roles-permit="roles" type="primary" icon="el-icon-download" @click="dialog.export_order = true">导出</el-button>
|
|
|
- <el-button v-permit="2" :roles-permit="roles" type="primary" icon="el-icon-upload2" @click="dialog.import_wuliu = true">导入</el-button>
|
|
|
- <el-button v-permit="2" :roles-permit="roles" type="primary" icon="el-icon-refresh" @click="dialog.import_wuliunew = true">物流更新</el-button>
|
|
|
+ <el-button v-permit="3" :roles-permit="roles" type="primary" @click="showMergeOrder">合并订单</el-button>
|
|
|
+ <!-- <el-button v-permit="[0,1,2]" :roles-permit="roles" type="primary" icon="el-icon-download" @click="dialog.export_order = true">导出</el-button> -->
|
|
|
+ <el-button v-permit="2" :roles-permit="roles" type="primary" icon="el-icon-upload2" @click="dialog.lead_order = true">导入</el-button>
|
|
|
+ <!-- <el-button v-permit="2" :roles-permit="roles" type="primary" icon="el-icon-refresh" @click="dialog.import_wuliunew = true">物流更新</el-button> -->
|
|
|
<!-- <el-button v-permit="[0,1,2]" :roles-permit="roles" type="primary" :loading="downloadLoading" icon="el-icon-document" class="filter-item" @click="exportOrder">导出订单信息</el-button>
|
|
|
<el-button v-permit="[0,1,2]" :roles-permit="roles" type="primary" :loading="downloadLoading" icon="el-icon-document" class="filter-item" @click="exporOrdertOrder">导出拆单信息</el-button> -->
|
|
|
<!-- <el-button v-permit="2" :roles-permit="roles" type="primary" :loading="downloadLoading" icon="el-icon-document" class="filter-item" @click="exportTemp">物流模板</el-button>
|
|
|
<el-button v-permit="2" :roles-permit="roles" type="primary" :loading="downloadLoading" icon="el-icon-document" class="filter-item">导入物流</el-button> -->
|
|
|
- <el-button v-permit="3" :roles-permit="roles" type="primary" @click="showMergeOrder">合并订单</el-button>
|
|
|
+ <!-- <el-button v-permit="[0,1,2]" :roles-permit="roles" type="primary" @click="exportOrder">导出订单数据</el-button>
|
|
|
+ <el-button v-permit="[0,1,2]" :roles-permit="roles" type="primary" @click="exporOrdertOrder">导出拆单数据</el-button> -->
|
|
|
+ <el-button v-permit="[0,1,2]" :roles-permit="roles" type="primary" icon="el-icon-download" @click="dialog.export_order = true">导出</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
<!-- 合并订单 -->
|
|
|
<el-dialog
|
|
|
title="合并订单"
|
|
@@ -550,7 +552,7 @@
|
|
|
<el-button type="primary" @click="addStoreOrder">确定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
- <el-dialog title="导入数据" :visible.sync="dialog.import_wuliu" :before-close="resetImport">
|
|
|
+ <el-dialog title="导入单号" :visible.sync="dialog.import_wuliu" :before-close="resetImport">
|
|
|
<div class="upload-main" style="height:400px">
|
|
|
<!-- <div class="upload-container">
|
|
|
<el-button type="text" class="download" style="color: #606266; cursor: auto">导入类型</el-button>
|
|
@@ -584,7 +586,7 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<!-- 更新物流 -->
|
|
|
- <el-dialog title="更新物流" :visible.sync="dialog.import_wuliunew" :before-close="resetImportnew">
|
|
|
+ <el-dialog title="修改单号" :visible.sync="dialog.import_wuliunew" :before-close="resetImportnew">
|
|
|
<div class="upload-main" style="height:400px">
|
|
|
<div class="upload-container">
|
|
|
<el-button type="text" class="download" @click="exportTempnew">物流模板</el-button>
|
|
@@ -608,17 +610,20 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
- <el-dialog title="导出订单数据" :visible.sync="dialog.export_order" width="520px">
|
|
|
+ <el-dialog title="导出数据" :visible.sync="dialog.export_order" width="520px">
|
|
|
<el-form label-width="120">
|
|
|
<el-form-item label="导出类型">
|
|
|
- <el-select v-model="dialog.export_order_type" style="width: 350px">
|
|
|
- <el-option label="导出订单数据" value="0" />
|
|
|
- <el-option label="导出拆单数据" value="1" />
|
|
|
- </el-select>
|
|
|
+ <el-button type="primary" @click="exportOrder">订单明细</el-button>
|
|
|
+ <el-button type="primary" @click="exporOrdertOrder">拆单明细</el-button>
|
|
|
+ <el-button type="primary" @click="exportMoney">订单金额</el-button>
|
|
|
</el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button size="small" @click="dialog.export_order = false">取消</el-button>
|
|
|
- <el-button size="small" type="primary" @click="toExportOrder">导出</el-button>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog title="导入" :visible.sync="dialog.lead_order" width="520px">
|
|
|
+ <el-form label-width="120">
|
|
|
+ <el-form-item label="导入类型">
|
|
|
+ <el-button type="primary" @click="dialog.import_wuliu = true">导入单号</el-button>
|
|
|
+ <el-button type="primary" @click="dialog.import_wuliunew = true">修改单号</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</el-dialog>
|
|
@@ -629,7 +634,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getList, orderPass, orderreJect, downOrder, toExport, orderSpend, UpdateExpress, highSearch, machAuditOrder, getStore, addStoreOrder, cancelStoreOrder, toMergeOrder, mergeOrderInfo } from '@/api/order/list'
|
|
|
+import { getList, orderPass, orderreJect, downOrder, toExport, orderSpend, UpdateExpress, highSearch, machAuditOrder, getStore, addStoreOrder, cancelStoreOrder, toMergeOrder, mergeOrderInfo, downList } from '@/api/order/list'
|
|
|
import { cancelOrder } from '@/api/order/common'
|
|
|
import { orderStatus, payStatus } from '@/filters/common'
|
|
|
import ChangeAddress from './components/ChangeAddress'
|
|
@@ -689,6 +694,7 @@ const moduleList = {
|
|
|
export default {
|
|
|
name: 'OrderList',
|
|
|
components: { ChangeAddress, VDistpicker, examine },
|
|
|
+ // examine
|
|
|
data() {
|
|
|
const receiveMoney = (rule, value, cb) => {
|
|
|
if (!value) {
|
|
@@ -781,6 +787,7 @@ export default {
|
|
|
],
|
|
|
dialog: {
|
|
|
spending: false,
|
|
|
+ lead_order: false,
|
|
|
export: false,
|
|
|
express: false,
|
|
|
receive: false,
|
|
@@ -1229,8 +1236,12 @@ export default {
|
|
|
this.loadingFull = true
|
|
|
try {
|
|
|
this.$request(orderSpend(formdata), () => {
|
|
|
+ // if () {
|
|
|
+
|
|
|
+ // }
|
|
|
this.getList()
|
|
|
this.$message.success('上传成功')
|
|
|
+ this.dialog.lead_order = false
|
|
|
})
|
|
|
// this.$request(sendOrder(formdata), () => {
|
|
|
// this.getList()
|
|
@@ -1255,10 +1266,10 @@ export default {
|
|
|
this.$request(UpdateExpress(formdata), () => {
|
|
|
this.getList()
|
|
|
this.$message.success('上传成功')
|
|
|
+ this.dialog.lead_order = false
|
|
|
})
|
|
|
-
|
|
|
this.resetImportnew()
|
|
|
- this.$message.success('上传成功')
|
|
|
+ // this.$message.success('上传成功')
|
|
|
this.getList()
|
|
|
// this.$request(sendOrder(formdata), () => {
|
|
|
// this.getList()
|
|
@@ -1487,6 +1498,146 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ // 订单金额
|
|
|
+ exportMoney() {
|
|
|
+ if (this.chooseList.length) {
|
|
|
+ // this.$request(downList({ id: this.chooseList.map(e => e.id) }), (res) => {
|
|
|
+ // this.expressData = res
|
|
|
+ // const exportData = this.getExportModule()
|
|
|
+ // import('@/vendor/Export2Excel').then(excel => {
|
|
|
+ // excel.export_json_to_excel({
|
|
|
+ // header: Object.keys(moduleList),
|
|
|
+ // data: exportData.map(listItem => Object.keys(exportData[0]).map(j => listItem[j])),
|
|
|
+ // filename: `${new Date().toLocaleDateString()}快递单导出`,
|
|
|
+ // bookType: 'xlsx',
|
|
|
+ // isCSV: true
|
|
|
+ // })
|
|
|
+ // this.dialog.export_order = false
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ this.$request(downList({ id: this.chooseList.map(e => e.id) }), (res) => {
|
|
|
+ const exportData = res.list
|
|
|
+ import('@/vendor/Export2Excel').then(excel => {
|
|
|
+ const header = ['序号', '下单时间', '所属政委', '下单人昵称', '下单人姓名', '订单状态', '支付状态', '数量合计', '订单总额', '所属者姓名', '所属者手机号', '所属体验店', '收货人', '联系方式', '收货地址', '订单备注']
|
|
|
+ const exportK = ['index', 'updated_at', 'admin_name', 'nickname', 'realname', 'status', 'pay_status', 'total', 'money', 'belong_realname', 'belong_mobile', 'get_store', 'username', 'mobile', 'address', 'remark']
|
|
|
+ const exportV = exportData.map((item, i) => {
|
|
|
+ const obj = {
|
|
|
+ index: i + 1,
|
|
|
+ updated_at: item.updated_at || '',
|
|
|
+ admin_name: item.get_user && item.get_user.warea && item.get_user.warea.admin_name,
|
|
|
+ nickname: item.get_user.nickname || '',
|
|
|
+ realname: item.get_user.realname || '',
|
|
|
+ status: orderStatus(item.status).name || '',
|
|
|
+ pay_status: payStatus(item.pay_status).name,
|
|
|
+ total: item.total || '',
|
|
|
+ money: item.money || '',
|
|
|
+ get_store: item.get_store && item.get_store.name,
|
|
|
+ username: item.get_address.username || '',
|
|
|
+ mobile: +item.get_address.mobile,
|
|
|
+ belong_realname: item.belong_user && item.belong_user.realname,
|
|
|
+ belong_mobile: item.belong_user && item.belong_user.mobile,
|
|
|
+ address: item.get_address.province + item.get_address.city + item.get_address.town + item.get_address.address,
|
|
|
+ remark: item.remark || ''
|
|
|
+ }
|
|
|
+ return obj
|
|
|
+ })
|
|
|
+ const exportD = exportV.map(item => exportK.map(k => item[k]))
|
|
|
+ excel.export_json_to_excel({
|
|
|
+ header,
|
|
|
+ data: exportD,
|
|
|
+ filename: `${formatter(new Date(), 'yyyy-MM-dd')}订单金额`,
|
|
|
+ autoWidth: true,
|
|
|
+ bookType: 'xlsx'
|
|
|
+ })
|
|
|
+ this.dialog.export_order = false
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ let query = {}
|
|
|
+ if (!this.highSearchFlag) {
|
|
|
+ const { order_status, order_no, page_index, page_size, search_name, time, activity_id } = this.listQuery
|
|
|
+ query = {
|
|
|
+ order_status, order_no, page_index, page_size, search_name,
|
|
|
+ start_time: time.length > 0 ? time[0] : '',
|
|
|
+ end_time: time.length > 0 ? time[1] : '',
|
|
|
+ activity_id
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ let order_status
|
|
|
+ let pay_status
|
|
|
+ try {
|
|
|
+ order_status = this.$refs.status_tree.getCheckedKeys()
|
|
|
+ if (order_status.indexOf(-1) !== -1) order_status = [-1]
|
|
|
+ pay_status = this.$refs.pay_status_tree.getCheckedKeys()
|
|
|
+ if (pay_status.indexOf(-1) !== -1) pay_status = [-1]
|
|
|
+ } catch (e) {
|
|
|
+ order_status = []
|
|
|
+ pay_status = []
|
|
|
+ }
|
|
|
+ const { page_index, page_size, order_num, time, name, address, good, type, provice, city, area, activity_id } = this.exportForm
|
|
|
+ query = {
|
|
|
+ page_index,
|
|
|
+ page_size,
|
|
|
+ order_no: order_num,
|
|
|
+ start_time: time.length > 0 ? time[0] : '',
|
|
|
+ end_time: time.length > 0 ? time[1] : '',
|
|
|
+ user_name: name,
|
|
|
+ receive_info: address,
|
|
|
+ goods_info: good,
|
|
|
+ order_status,
|
|
|
+ pay_status,
|
|
|
+ order_type: type,
|
|
|
+ provice: provice || '',
|
|
|
+ city: city || '',
|
|
|
+ area: area || '',
|
|
|
+ activity_id
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$request(downList(query), (res) => {
|
|
|
+ // console.log(res.data)
|
|
|
+ const exportData = res.list
|
|
|
+ // console.log(exportData)
|
|
|
+ import('@/vendor/Export2Excel').then(excel => {
|
|
|
+ const header = ['序号', '下单时间', '所属政委', '下单人昵称', '下单人姓名', '订单状态', '支付状态', '数量合计', '订单总额', '所属者姓名', '所属者手机号', '所属体验店', '收货人', '联系方式', '收货地址', '订单备注']
|
|
|
+ const exportK = ['index', 'updated_at', 'admin_name', 'nickname', 'realname', 'status', 'pay_status', 'total', 'money', 'belong_realname', 'belong_mobile', 'get_store', 'username', 'mobile', 'address', 'remark']
|
|
|
+ // if(+this.collect == false) {
|
|
|
+ // header.splice(12,1)
|
|
|
+ // exportK.splice(12,1)
|
|
|
+ // }
|
|
|
+ const exportV = exportData.map((item, i) => {
|
|
|
+ const obj = {
|
|
|
+ index: i + 1,
|
|
|
+ updated_at: item.updated_at || '',
|
|
|
+ admin_name: item.get_user && item.get_user.warea && item.get_user.warea.admin_name,
|
|
|
+ nickname: item.get_user.nickname || '',
|
|
|
+ realname: item.get_user.realname || '',
|
|
|
+ status: orderStatus(item.status).name || '',
|
|
|
+ pay_status: payStatus(item.pay_status).name,
|
|
|
+ total: item.total || '',
|
|
|
+ money: item.money || '',
|
|
|
+ username: item.get_address.username || '',
|
|
|
+ get_store: item.get_store && item.get_store.name,
|
|
|
+ mobile: +item.get_address.mobile,
|
|
|
+ belong_realname: item.belong_user && item.belong_user.realname,
|
|
|
+ belong_mobile: item.belong_user && item.belong_user.mobile,
|
|
|
+ address: item.get_address.province + item.get_address.city + item.get_address.town + item.get_address.address,
|
|
|
+ remark: item.remark || ''
|
|
|
+ }
|
|
|
+ return obj
|
|
|
+ })
|
|
|
+ const exportD = exportV.map(item => exportK.map(k => item[k]))
|
|
|
+ excel.export_json_to_excel({
|
|
|
+ header,
|
|
|
+ data: exportD,
|
|
|
+ filename: `${formatter(new Date(), 'yyyy-MM-dd')}订单金额`,
|
|
|
+ autoWidth: true,
|
|
|
+ bookType: 'xlsx'
|
|
|
+ })
|
|
|
+ this.dialog.export_order = false
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
// 导出拆单
|
|
|
async exporOrdertOrder() {
|
|
|
if (this.chooseList.length) {
|
|
@@ -1770,6 +1921,7 @@ export default {
|
|
|
}
|
|
|
return out
|
|
|
},
|
|
|
+ getExportMoney() {},
|
|
|
formatJson(filterVal, jsonData) {
|
|
|
return jsonData.map(v => filterVal.map(j => {
|
|
|
return v[j]
|
|
@@ -1889,7 +2041,13 @@ export default {
|
|
|
this.loadingFull = false
|
|
|
if (res.code === 200) {
|
|
|
if (!this.highSearchFlag) {
|
|
|
- this.getList()
|
|
|
+ const index = Math.ceil(this.tableTotal / this.listQuery.page_size)
|
|
|
+ if (this.listQuery.page_index === index) {
|
|
|
+ this.listQuery.page_index = this.listQuery.page_index - 1
|
|
|
+ this.getList()
|
|
|
+ } else {
|
|
|
+ this.getList()
|
|
|
+ }
|
|
|
} else {
|
|
|
this.submitExport()
|
|
|
}
|