123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268 |
- <template>
- <div class="subPage">
- <div class="system-table-search">
- <div class="flex-h">
- <ul class="searchFilterLine" style="white-space: normal;">
- <li>
- <el-select v-model="postData.caseid" placeholder="请选择案场">
- <el-option
- v-for="item in cases"
- :key="item.CaseId"
- :label="item.CaseName"
- :value="item.CaseId">
- </el-option>
- </el-select>
- </li>
- <li>
- <el-select v-model="postData.usertype" placeholder="请选择下单用户类型">
- <el-option
- v-for="item in typeList"
- :key="item.id"
- :label="item.value"
- :value="item.id">
- </el-option>
- </el-select>
- </li>
- <li>
- <el-select v-model="postData.status" placeholder="请选择订单状态">
- <el-option
- v-for="item in statusList"
- :key="item.id"
- :label="item.value"
- :value="item.id">
- </el-option>
- </el-select>
- </li>
- <li style="white-space: nowrap;">
- <span>下单时间:</span>
- <el-date-picker
- value-format="yyyy-MM-dd"
- v-model="postData.begindate"
- type="date"
- placeholder="选择起始日期">
- </el-date-picker>
- <span>至</span>
- <el-date-picker
- value-format="yyyy-MM-dd"
- v-model="postData.enddate"
- type="date"
- placeholder="选择截止日期">
- </el-date-picker>
- </li>
- </ul>
- </div>
- <div class="flex-h">
- <div class="flex-item flex-h"></div>
- <el-button
- size="mini"
- type="primary" @click="search">搜索</el-button>
- <el-button
- size="mini"
- type="success" @click="exportExcel">导出Excel</el-button>
- </div>
- <div class="moreFilter"></div>
- </div>
- <table>
- <tr v-for="(item,index) in goodsOrderList.length*2" :key="index">
- <td v-if="index%2 === 0" colspan="16" class="title">
- <div class="flex-h">
- <div class="flex-item" style="text-align:left;">
- <span>订单编号:{{returnListItem(goodsOrderList, index).OrdersNo}}</span>
- <span>案场:{{returnListItem(goodsOrderList, index).CaseName}}</span>
- <span>用户类型:{{returnListItem(goodsOrderList, index).UserType === 'sales' ? '销售' : returnListItem(goodsOrderList, index).UserType === 'manager' ? '主管' : '用户'}}</span>
- <span>下单时间:{{toolClass.dateFormat(returnListItem(goodsOrderList, index).CreateDate)}}</span>
- </div>
- <span>{{returnStatus(returnListItem(goodsOrderList, index).MakeStatus)}}</span>
- </div>
- </td>
- <td v-if="index%2 !== 0" colspan="4" class="noborder">
- <span v-for="(subItem,subIndex) in returnListItem(goodsOrderList, index).Details" :key="subIndex">{{subItem.GoodsName}}({{subItem.SpecName}})</span>
- </td>
- <td v-if="index%2 !== 0" colspan="1" class="noborder">
- <span v-for="(subItem,subIndex) in returnListItem(goodsOrderList, index).Details" :key="subIndex">x{{subItem.Number}}</span>
- </td>
- <td v-if="index%2 !== 0" colspan="1" class="noborder">
- <span v-for="(subItem,subIndex) in returnListItem(goodsOrderList, index).Details" :key="subIndex">¥{{subItem.Price}}</span>
- </td>
- <td v-if="index%2 !== 0" colspan="4">
- <span>{{returnListItem(goodsOrderList, index).AreaName}}{{returnListItem(goodsOrderList, index).TableNo}}</span>
- </td>
- <td v-if="index%2 !== 0" colspan="4">
- <span>{{returnListItem(goodsOrderList, index).Name}}/{{returnListItem(goodsOrderList, index).Phone}}</span>
- </td>
- <td v-if="index%2 !== 0" colspan="2">
- <el-button
- size="mini"
- type="success" @click="printPdf(`item${(index + 1) / 2}`)">重打</el-button>
- </td>
- <div v-if="index%2 !== 0" class="print-area" :class="'item' + (index + 1) / 2" style="width:180px;left:0;position: absolute;opacity: 0;">
- <div style="padding:0px 10px 5px;border-bottom:2px solid #cccccc;">
- <div style="display:inline-block;">
- <img class="topIcon" style="display:block;width:60%;margin:0 0 20px 0px;" src="http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/111101940020.png" alt="">
- <span style="display:block;font-size:20px;font-weight:700;text-align: center;">{{returnListItem(goodsOrderList, index).AreaName}}{{returnListItem(goodsOrderList, index).TableNo}}</span>
- </div>
- </div>
- <div style="padding:10px 10px 5px;border-bottom:1px solid #cccccc;" v-for="(subItem,subIndex) in returnListItem(goodsOrderList, index).Details" :key="subIndex">
- <div style="font-size:12px;"><span style="display:inline-block;width:75%;text-align:left;">{{subItem.GoodsName}}</span><span style="display:inline-block;width:22%;text-align:right;font-size:12px;" v-if='!subItem.SpecName'>× {{subItem.Number}}</span></div>
- <div style="margin-top:8px;" v-if='subItem.SpecName'>
- <span style="display:inline-block;width:75%;text-align:left;color:#cccccc;font-size:12px;">{{subItem.SpecName}}</span>
- <span style="display:inline-block;width:20%;text-align:right;font-size:12px;">× {{subItem.Number}}</span>
- </div>
- </div>
- <div style="padding:10px 10px 5px;border-bottom:1px solid #cccccc;">
- <div style="font-size:12px;">下单人:{{returnListItem(goodsOrderList, index).CustomerName}}</div>
- <span style="display:block;margin-top:10px;font-size:12px;">下单时间:{{toolClass.dateFormat(returnListItem(goodsOrderList, index).CreateDate)}}</span>
- </div>
- <div style="padding:10px 10px;font-size:12px;">备注:{{item.Remark}}</div>
- <div style="text-align: right;font-size: 12px;">城的空间.诚咖啡</div>
- <div style="height:10px"></div>
- </div>
- </tr>
- </table>
- <el-pagination
- @current-change="handleCurrentChange"
- :current-page.sync="postData.page"
- :page-size="postData.pagesize"
- layout="prev, pager, next, jumper"
- :total="total">
- </el-pagination>
- </div>
- </template>
-
- <script>
- import { mapState, createNamespacedHelpers } from 'vuex'
- import { getLodop } from '@/util/LodopFuncs'
- import tableSearch from '@/components/tableSearch/index'
- const { mapState: mapStaState, mapActions: mapStaActions } = createNamespacedHelpers('sta')
- var LODOP
- export default {
- name: '',
- data () {
- return {
- total: 0,
- postData: { // 表格搜索条件
- status: '', // 状态
- caseid: '', // 案场id
- usertype: '', // 用户类型
- begindate: '', // 起始日期
- enddate: '', // 截止日期
- page: 1, // 当前页码
- pagesize: 10, // 请求数据量
- },
- typeList: [{
- value: '',
- id: ''
- }, {
- value: '销售',
- id: 'sales'
- }, {
- value: '主管',
- id: 'manager'
- }, {
- value: '用户',
- id: 'customer'
- }],
- statusList: [{
- value: '',
- id: ''
- }, {
- value: '已下单',
- id: 'not started'
- }, {
- value: '制作中',
- id: 'doing'
- }, {
- value: '已完成',
- id: 'finished'
- }, {
- value: '已取消',
- id: 'cancel'
- }],
- }
- },
- computed: {
- ...mapState({
- cases: x => x.app.cases.list,
- defaultCaseId: x => x.app.cases.default
- }),
- ...mapStaState({
- goodsOrderList: x => x.goodsOrder.list || [],
- }),
- CaseId: {
- get () {
- return this.postData.caseid || this.defaultCaseId
- },
- set (val) {
- this.postData.caseid = val
- }
- }
- },
- components: {
- tableSearch,
- },
- mounted () {
- this.$nextTick(function () {
- this.getList()
- })
- },
- methods: {
- ...mapStaActions([
- 'getGoodsOrderList',
- ]),
- returnStatus (val) {
- switch (val) {
- case 'not started':
- return '已下单'
- case 'doing':
- return '制作中'
- case 'finished':
- return '已完成'
- case 'cancel':
- return '已取消'
- }
- },
- returnListItem (target, index) {
- return target[Math.ceil((index + 1) / 2) - 1]
- },
- search () { // 搜索
- this.page = 1
- this.getList()
- },
- handleCurrentChange (val) { // 跳转到分页
- this.page = val
- this.getList()
- },
- getList () {
- this.getGoodsOrderList(this.postData).then((res) => {
- // console.log(JSON.stringify(res))
- this.postData.page = res.page
- this.total = res.total
- })
- },
- printPdf (cl) {
- this.CreateOneFormPage(cl)
- LODOP.PRINT()
- // LODOP.PREVIEW()
- },
- CreateOneFormPage (cl) {
- LODOP = getLodop()
- LODOP.PRINT_INIT('订单')
- LODOP.SET_PRINT_PAGESIZE(3, 480, 40, '')
- LODOP.ADD_PRINT_HTM(0, 0, document.getElementsByClassName(cl)[0].offsetWidth, document.getElementsByClassName(cl)[0].offsetHeight, document.getElementsByClassName(cl)[0].innerHTML)
- },
- exportExcel () {
- window.location.href = `${this.toolClass.ReplaceOrg(this.$api.statistics.goodsOrderExcel.url)}?token=${localStorage.getItem('JWT')}`
- },
- }
- }
- </script>
-
- <!-- Add "scoped" attribute to limit CSS to this component only -->
- <style lang="scss" scoped>
- @import "page.scss";
- .searchFilterLine {
- > li {
- margin-bottom: 20px;
- }
- }
- </style>
|