| | |
| | | <div class="left"> |
| | | <div class="id"> |
| | | 订单编号/产品名称 |
| | | <el-input v-model="inputText" placeholder="请输入"></el-input> |
| | | <el-input |
| | | style="width: 140px" |
| | | v-model="inputText" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | </div> |
| | | |
| | | <div class="cluster"> |
| | |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | :default-time="['00:00:00', '23:59:59']" |
| | | style="width: 212px" |
| | | ></el-date-picker> |
| | | </div> |
| | | |
| | | <div class="id"> |
| | | 状态 |
| | | <el-select |
| | | class="selectStatus" |
| | | v-model="status" |
| | | @change="searchingBtn" |
| | | > |
| | | <el-option label="全部" :value="-10"></el-option> |
| | | <el-option label="已取消" :value="-1"></el-option> |
| | | <el-option label="未下单" :value="0"></el-option> |
| | | <el-option label="待支付" :value="1"></el-option> |
| | | <el-option label="已支付" :value="2"></el-option> |
| | | <el-option label="审核中" :value="11"></el-option> |
| | | <el-option label="已驳回" :value="12"></el-option> |
| | | </el-select> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <div class="button searchBtn" @click="searchingBtn">搜索</div> |
| | | <div class="button resetBtn" @click="clearSearch">重置</div> |
| | | </div> |
| | | <div class="to-excel"> |
| | | <div class="to-excel" @click="exportList"> |
| | | <span class="iconfont"></span> <span>导出</span> |
| | | </div> |
| | | </div> |
| | |
| | | prop="createTime" |
| | | label="创建时间" |
| | | show-overflow-tooltip |
| | | sortable |
| | | width="180" |
| | | ></el-table-column> |
| | | <el-table-column prop="orderMoney" label="订单金额"></el-table-column> |
| | | <el-table-column |
| | | prop="orderMoney" |
| | | label="订单金额(元)" |
| | | sortable |
| | | width="140" |
| | | ></el-table-column> |
| | | <el-table-column label="支付方式"> |
| | | <template slot-scope="scope"> |
| | | <div v-if="scope.row.payMethod == 0">线下汇款</div> |
| | |
| | | <div v-if="scope.row.payMethod == 2">微信</div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="status" label="订单状态"></el-table-column> |
| | | <el-table-column |
| | | prop="status" |
| | | label="订单状态" |
| | | sortable |
| | | ></el-table-column> |
| | | |
| | | <el-table-column label="操作"> |
| | | <el-table-column label="操作" width="140"> |
| | | <template slot-scope="scope"> |
| | | <span class="option" @click="showDetail(scope.row)">订单详情</span> |
| | | <span class="option" @click="showDetail(scope.row)">详情</span> |
| | | <span |
| | | class="option" |
| | | v-if="scope.row.status === '待支付'" |
| | | @click="showPayBox(scope.row.id)" |
| | | >支付</span |
| | | > |
| | | <span |
| | | class="option" |
| | | v-if="scope.row.status === '待支付'" |
| | | @click="cancel(scope.row.id)" |
| | | >取消</span |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | ></el-pagination> |
| | | </div> |
| | | </div> |
| | | |
| | | <ConfirmOrder |
| | | v-if="showOrder" |
| | | :orderId="orderId" |
| | | @close="closeBox" |
| | | ></ConfirmOrder> |
| | | </div> |
| | | |
| | | <div class="order-detail" v-else> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getOrders } from "@/api/order"; |
| | | import { getOrders, getAuthFile, cancelOrder } from "@/api/order"; |
| | | import { getOrderById } from "@/api/product"; |
| | | import ConfirmOrder from "@/views/productDetail/components/ConfirmOrder"; |
| | | |
| | | export default { |
| | | components: {}, |
| | | components: { |
| | | ConfirmOrder, |
| | | }, |
| | | created() { |
| | | let type = sessionStorage.getItem("type"); |
| | | if (type) { |
| | | this.status = +type; |
| | | sessionStorage.removeItem("type"); |
| | | } |
| | | this.searchingBtn(); |
| | | }, |
| | | data() { |
| | | return { |
| | | searchTime: [ |
| | | this.$moment().format("YYYY-MM-DD 00:00:00"), |
| | | this.$moment().format("YYYY-MM-DD HH:mm:ss"), |
| | | ], //搜索时间 |
| | | searchTime: [], //搜索时间 |
| | | page: 1, |
| | | size: 10, //分页相关 |
| | | inputText: "", //输入框内容 |
| | |
| | | form: {}, //处理中的设备 |
| | | isShowDetail: false, |
| | | showTable: false, |
| | | orderId: "", |
| | | showOrder: false, |
| | | status: -10, |
| | | }; |
| | | }, |
| | | methods: { |
| | |
| | | let param = { |
| | | page: this.page, |
| | | size: this.size, |
| | | startTime: this.searchTime[0], |
| | | endTime: this.searchTime[1], |
| | | startTime: this.searchTime ? this.searchTime[0] : "", |
| | | endTime: this.searchTime ? this.searchTime[1] : "", |
| | | inputText: this.inputText, |
| | | productBaseId: "0", |
| | | orderName: "", |
| | | orderType: "", |
| | | status: 0, |
| | | status: this.status, |
| | | }; |
| | | getOrders(param).then((res) => { |
| | | this.dataList = res.data.list.map((item, indez) => { |
| | | let status = ""; |
| | | switch (item.orderStatus) { |
| | | case -1: |
| | | status = "已取消"; |
| | | break; |
| | | case 0: |
| | | status = "未下单"; |
| | | break; |
| | | case 1: |
| | | status = "待支付"; |
| | | break; |
| | | case 2: |
| | | status = "已支付"; |
| | | break; |
| | | case 11: |
| | | status = "审核中"; |
| | | break; |
| | | case 12: |
| | | status = "已驳回"; |
| | | break; |
| | | default: |
| | | status = ""; |
| | | } |
| | | let name = ""; |
| | | let downFlag = false; |
| | | let products = []; |
| | | item.products.forEach((every, index) => { |
| | | // 判断本订单是否存在可下载的内容(软件,sdk) |
| | | if (every.productType == 1 || every.productType == 3) { |
| | | downFlag = true; |
| | | getOrders(param) |
| | | .then((res) => { |
| | | this.dataList = res.data.list.map((item, indez) => { |
| | | let status = ""; |
| | | switch (item.orderStatus) { |
| | | case -1: |
| | | status = "已取消"; |
| | | break; |
| | | case 0: |
| | | status = "未下单"; |
| | | break; |
| | | case 1: |
| | | status = "待支付"; |
| | | break; |
| | | case 2: |
| | | status = "已支付"; |
| | | break; |
| | | case 11: |
| | | status = "审核中"; |
| | | break; |
| | | case 12: |
| | | status = "已驳回"; |
| | | break; |
| | | default: |
| | | status = ""; |
| | | } |
| | | // 归类产品和激活码以供下载 |
| | | products.push({ |
| | | productId: every.productId, |
| | | productName: every.productName, |
| | | activateCode: every.activateCode, |
| | | productTypeName: every.productTypeName, |
| | | let name = ""; |
| | | let downFlag = false; |
| | | let products = []; |
| | | item.products.forEach((every, index) => { |
| | | // 判断本订单是否存在可下载的内容(软件,sdk) |
| | | if (every.productType == 1 || every.productType == 3) { |
| | | downFlag = true; |
| | | } |
| | | // 归类产品和激活码以供下载 |
| | | products.push({ |
| | | productId: every.productId, |
| | | productName: every.productName, |
| | | activateCode: every.activateCode, |
| | | productTypeName: every.productTypeName, |
| | | }); |
| | | if (index == 0) { |
| | | name += every.productName + "(" + every.productTypeName + ")"; |
| | | } else { |
| | | name += |
| | | " / " + every.productName + "(" + every.productTypeName + ")"; |
| | | } |
| | | }); |
| | | if (index == 0) { |
| | | name += every.productName + "(" + every.productTypeName + ")"; |
| | | } else { |
| | | name += |
| | | " / " + every.productName + "(" + every.productTypeName + ")"; |
| | | } |
| | | return { |
| | | id: item.id, |
| | | sn: item.sn, |
| | | name: name, |
| | | source: item.source == 0 ? "激活码下载" : "线上购买", |
| | | createTime: item.createTime, |
| | | status: status, |
| | | orderStatus: item.orderStatus, |
| | | orderMoney: item.orderMoney, |
| | | payMethod: item.payMethod, |
| | | code: |
| | | item.products.length > 1 ? "-" : item.products[0].activateCode, |
| | | canDownLoad: downFlag, |
| | | products: products, |
| | | }; |
| | | }); |
| | | return { |
| | | id: item.id, |
| | | sn: item.sn, |
| | | name: name, |
| | | source: item.source == 0 ? "激活码下载" : "线上购买", |
| | | createTime: item.createTime, |
| | | status: status, |
| | | orderStatus: item.orderStatus, |
| | | orderMoney: item.orderMoney, |
| | | payMethod: item.payMethod, |
| | | code: |
| | | item.products.length > 1 ? "-" : item.products[0].activateCode, |
| | | canDownLoad: downFlag, |
| | | products: products, |
| | | }; |
| | | this.total = res.data.total; |
| | | if (res.data.total <= this.size) { |
| | | this.page = 1; |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | this.$notify.error(err.msg); |
| | | }); |
| | | this.total = res.data.total; |
| | | if (res.data.total <= this.size) { |
| | | this.page = 1; |
| | | } |
| | | }); |
| | | }, |
| | | //分页功能 |
| | | handleSizeChange(size) { |
| | |
| | | }, |
| | | |
| | | clearSearch() { |
| | | this.searchTime = this.getDateInit(); |
| | | debugger; |
| | | this.searchTime = []; |
| | | debugger; |
| | | this.inputText = ""; |
| | | this.searchingBtn(); |
| | | }, |
| | |
| | | }, |
| | | |
| | | openImg(url) { |
| | | window.open("http://" + url); |
| | | window.open("/httpImage/" + url); |
| | | }, |
| | | |
| | | async exportList() { |
| | | let param = { |
| | | page: this.page, |
| | | size: this.size, |
| | | startTime: this.searchTime ? this.searchTime[0] : "", |
| | | endTime: this.searchTime ? this.searchTime[1] : "", |
| | | inputText: this.inputText, |
| | | productBaseId: "0", |
| | | orderName: "", |
| | | orderType: "", |
| | | status: 0, |
| | | }; |
| | | |
| | | const result = await getAuthFile(param); |
| | | |
| | | console.log(result); |
| | | |
| | | var blob = new Blob([result.body.data], { |
| | | type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8", |
| | | }), |
| | | Temp = document.createElement("a"); |
| | | |
| | | Temp.href = window.URL.createObjectURL(blob); |
| | | |
| | | console.log(result); |
| | | console.log(result.fileName); |
| | | |
| | | Temp.download = window.decodeURI(result.fileName); |
| | | |
| | | Temp.setAttribute("download", result.fileName); |
| | | |
| | | document.body.appendChild(Temp); |
| | | |
| | | Temp.click(); |
| | | |
| | | document.body.removeChild(Temp); |
| | | |
| | | window.URL.revokeObjectURL(Temp); |
| | | }, |
| | | |
| | | showPayBox(id) { |
| | | this.showOrder = true; |
| | | this.orderId = id; |
| | | }, |
| | | |
| | | cancel(id) { |
| | | cancelOrder("/saas/api-s/saasOrder/cancel/" + id).then((res) => { |
| | | if (res && res.success) { |
| | | this.$notify({ |
| | | type: "success", |
| | | message: "订单取消成功", |
| | | duration: 2500, |
| | | offset: 57, |
| | | }); |
| | | this.searchingBtn(); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | closeBox() { |
| | | this.showOrder = false; |
| | | this.searchingBtn(); |
| | | }, |
| | | }, |
| | | mounted() {}, |
| | |
| | | color: #fff; |
| | | background: #0065ff; |
| | | border-radius: 3px; |
| | | margin-right: 20px; |
| | | margin-right: 10px; |
| | | } |
| | | .right { |
| | | display: flex; |
| | |
| | | color: #fff; |
| | | align-items: center; |
| | | justify-content: center; |
| | | margin-left: 195px; |
| | | margin-left: 20px; |
| | | cursor: pointer; |
| | | } |
| | | .resetBtn { |
| | | width: 60px; |
| | |
| | | } |
| | | } |
| | | |
| | | .selectStatus { |
| | | margin: 0 10px; |
| | | margin-right: 30px; |
| | | width: 100px; |
| | | } |
| | | |
| | | .el-input ::v-deep { |
| | | width: 200px; |
| | | margin-left: 10px; |