123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- <template>
- <a-card :bordered="false" class="storeTransferOutList-wrap">
- <!-- 搜索条件 -->
- <div class="table-page-search-wrapper">
- <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
- <a-row :gutter="15">
- <a-col :md="6" :sm="24">
- <a-form-item label="创建时间">
- <a-range-picker
- style="width:100%"
- id="storeTransferOutList-bundleNamesss"
- :disabledDate="disabledDate"
- v-model="createDate"
- :format="dateFormat"
- :placeholder="['开始时间', '结束时间']" />
- </a-form-item>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-item label="调往对象">
- <v-select
- v-model="queryParam.putPersonName"
- ref="putPersonName"
- id="storeTransferOutList-putPersonName"
- code="PAYMENT_TYPE"
- placeholder="请选择调往对象"
- allowClear></v-select>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-item label="调拨类型">
- <v-select
- v-model="queryParam.callOutType"
- ref="callOutType"
- id="storeTransferOutList-callOutType"
- code="PAYMENT_TYPE"
- placeholder="请选择调拨类型"
- allowClear></v-select>
- </a-form-item>
- </a-col>
- <template v-if="advanced">
- <a-col :md="6" :sm="24">
- <a-form-item label="单据状态">
- <v-select
- v-model="queryParam.state"
- ref="state"
- id="storeTransferOutList-state"
- code="PAYMENT_TYPE"
- placeholder="请选择单据状态"
- allowClear></v-select>
- </a-form-item>
- </a-col>
- </template>
- <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
- <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="storeTransferOutList-refresh">查询</a-button>
- <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="storeTransferOutList-reset">重置</a-button>
- <a @click="advanced=!advanced" style="margin-left: 8px">
- {{ advanced ? '收起' : '展开' }}
- <a-icon :type="advanced ? 'up' : 'down'"/>
- </a>
- </a-col>
- </a-row>
- </a-form>
- </div>
- <!-- 操作按钮 -->
- <div class="table-operator">
- <a-button id="storeTransferOutList-add" type="primary" @click="handleEdit()">新增店内调出单</a-button>
- </div>
- <!-- 列表 -->
- <s-table
- class="sTable"
- ref="table"
- size="default"
- :rowKey="(record) => record.id"
- :columns="columns"
- :data="loadData"
- bordered>
- <!-- 状态 -->
- <template slot="state" slot-scope="text, record">
- <span :class="record.state==1?'green':'red'"> {{ record.state==1? '待提交': '待审核' }} </span>
- </template>
- <!-- 操作 -->
- <template slot="action" slot-scope="text, record">
- <a-button size="small" type="primary" @click="handleExamine(record)" id="storeTransferOutList-examine-btn">审核</a-button>
- <a-button size="small" @click="handleEdit(record)" id="storeTransferOutList-edit-btn" style="margin: 0 0 10px 8px;">编辑</a-button>
- <a-button size="small" type="primary" @click="handleOut(record)" id="storeTransferOutList-out-btn" style="margin: 0 0 10px 8px;">出库</a-button>
- <a-button size="small" type="primary" @click="handleDetail(record)" id="storeTransferOutList-detail-btn" style="margin: 0 0 0 8px;">详情</a-button>
- <a-button size="small" type="danger" @click="handleDel(record)" id="storeTransferOutList-del-btn" style="margin: 0 0 0 8px;">删除</a-button>
- </template>
- </s-table>
- <!-- 新增/编辑 -->
- <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
- </a-card>
- </template>
- <script>
- import { storeCallOutList } from '@/api/storeCallOut'
- import { STable, VSelect } from '@/components'
- import basicInfoModal from './basicInfoModal.vue'
- export default {
- components: { STable, VSelect, basicInfoModal },
- data () {
- return {
- advanced: false, // 高级搜索 展开/关闭
- createDate: undefined, // 创建时间
- queryParam: { // 查询条件
- putPersonName: undefined, // 调往对象
- callOutType: undefined, // 调拨类型
- state: undefined, // 单据状态
- },
- disabled: false, // 查询、重置按钮是否可操作
- dateFormat: 'YYYY-MM-DD',
- columns: [
- { title: '创建时间', dataIndex: 'createDate', width: 70, align: 'center', width: 180 },
- { title: '店内调出单号', dataIndex: 'storeCallOutNo', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
- { title: '调往对象', dataIndex: 'putPersonName', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
- { title: '调拨类型', dataIndex: 'callOutType', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
- { title: '总款数', dataIndex: 'productTotalCategory', width: 180, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
- { title: '总数量', dataIndex: 'productTotalQty', width: 180, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
- { title: '总成本', dataIndex: 'productTotalCost', width: 180, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
- { title: '审核时间', dataIndex: 'auditTime', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
- { title: '状态', scopedSlots: { customRender: 'state' }, width: 180, align: 'center' },
- { title: '操作', scopedSlots: { customRender: 'action' }, width: 300, align: 'center' }
- ],
- // 加载数据方法 必须为 Promise 对象
- loadData: parameter => {
- this.disabled = true
- this.queryParam = {}
- return storeCallOutList( Object.assign(parameter, this.queryParam) ).then(res => {
- const data = res.data
- const no = (data.pageNo - 1) * data.pageSize
- for (var i = 0; i < data.list.length; i++) {
- data.list[i].no = no + i + 1
- }
- this.disabled = false
- return data
- })
- },
- openModal: false, // 新增编辑 弹框
- itemId: '' // 当前品牌id
- }
- },
- methods: {
- // 不可选日期
- disabledDate (date, dateStrings) {
- return date && date.valueOf() > Date.now()
- },
- // 重置
- resetSearchForm () {
- this.queryParam.putPersonName = undefined
- this.queryParam.callOutType = undefined
- this.queryParam.state = undefined
- this.createDate = undefined
- this.$refs.table.refresh(true)
- },
- // 基本信息 保存
- handleOk(){
- this.$router.push({ path: `/allocationManagement/storeTransferOut/add` })
- },
- // 删除
- handleDel (row) {
- const _this = this
- this.$confirm({
- title: '提示',
- content: '删除后不可恢复,确定要进行删除吗?',
- okText: '确定',
- cancelText: '取消',
- centered: true,
- onOk () {
- // delectRolePower({
- // id: row.id
- // }).then(res => {
- // console.log(res, 'res1111')
- // if (res.status == 200) {
- // _this.$message.success(res.message)
- // _this.$refs.table.refresh()
- // }
- // })
- }
- })
- },
- // 出库
- handleOut(row){},
- // 审核
- handleExamine(){
- const _this = this
- this.$confirm({
- title: '提示',
- content: '确认要审核通过吗?',
- okText: '确定',
- cancelText: '取消',
- centered: true,
- onOk () {
- // delectRolePower({
- // id: row.id
- // }).then(res => {
- // console.log(res, 'res1111')
- // if (res.status == 200) {
- // _this.$message.success(res.message)
- // _this.$refs.table.refresh()
- // }
- // })
- }
- })
- },
- // 详情
- handleDetail(row){
- this.$router.push({ path: `/allocationManagement/storeTransferOut/detail/${row.id}/${row.storeCallOutSn}` })
- },
- // 新增/编辑
- handleEdit(row){
- this.openModal = true
- },
- }
- }
- </script>
- <style lang="less">
- .storeTransferOutList-wrap{
- .sTable{
- table{
- width: auto;
- }
- }
- }
- </style>
|