123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273 |
- <!-- 订单 -->
- <template>
- <div class="order">
- <el-form :inline="true" :model="dataForm" @keyup.enter.native="queryData()">
- <el-form-item label="业务类型">
- <el-select
- v-model="dataForm.businessType"
- placeholder="请选择">
- <el-option
- v-for="item in optionsType"
- :key="item.code"
- :label="item.value"
- :value="item.code">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="状态">
- <el-select
- v-model="dataForm.state"
- placeholder="请选择">
- <el-option
- v-for="item in optionsState"
- :key="item.code"
- :label="item.value"
- :value="item.code">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="申请日期">
- <el-date-picker
- v-model="dataForm.createTime"
- value-format="yyyy-MM-dd"
- type="date">
- </el-date-picker>
- </el-form-item>
- <el-form-item>
- <el-button @click="queryData()">查询</el-button>
- </el-form-item>
- </el-form>
- <el-table
- :data="dataList"
- border
- v-loading="dataListLoading"
- @selection-change="selectionChangeHandle"
- style="width: 100%;">
- <el-table-column
- label="序号"
- type="index"
- width="50"
- align="center">
- </el-table-column>
- <el-table-column
- prop="businessTypeName"
- header-align="center"
- align="center"
- min-width="180"
- label="流程类别">
- </el-table-column>
- <el-table-column
- prop="createTime"
- header-align="center"
- align="center"
- min-width="140"
- :show-overflow-tooltip="true"
- label="申请时间">
- </el-table-column>
- <el-table-column
- prop="updateTime"
- header-align="center"
- align="center"
- min-width="140"
- label="更新时间">
- </el-table-column>
- <el-table-column
- prop="state"
- header-align="center"
- align="center"
- min-width="100"
- label="状态">
- <template slot-scope="scope">
- <span>{{ optionsState[Number(scope.row.state) + 1].value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- prop="creatorName"
- header-align="center"
- align="center"
- min-width="120"
- label="申请人">
- </el-table-column>
- <el-table-column
- prop="orgName"
- header-align="center"
- align="center"
- label="申请部门">
- </el-table-column>
- <el-table-column
- prop="completeDate"
- header-align="center"
- align="center"
- min-width="150"
- label="处理意见">
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- width="80"
- label="操作">
- <template slot-scope="scope">
- <el-button v-if="Number(scope.row.state) !== 3 && checkUser(scope.row)" type="text" size="small" @click="addOrUpdateHandle(scope.row.businessType, scope.row.businessId)">处理</el-button>
- <el-button v-else type="text" size="small" @click="detailHandle(scope.row.businessType, scope.row.businessId)">查看</el-button>
- </template>
- </el-table-column>
- </el-table>
- <el-pagination
- @size-change="sizeChangeHandle"
- @current-change="currentChangeHandle"
- :current-page="pageIndex"
- :page-sizes="[10, 20, 50, 100]"
- :page-size="pageSize"
- :total="totalPage"
- layout="total, sizes, prev, pager, next, jumper">
- </el-pagination>
- <!-- 弹窗, 新增 / 修改 -->
- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getApprovalList"/>
- </div>
- </template>
- <script>
- import AddOrUpdate from './approve-add-or-update'
- import { getApprovalList } from '@/api/msg'
- import { getCusList } from '@/api/cus'
- import { checkStr } from '@/api/util'
- export default {
- name: 'order',
- components: {
- // Detail,
- AddOrUpdate
- },
- created () {
- this.optionsState = this.$store.state.common.approveStates
- this.queryData()
- },
- data () {
- return {
- addOrUpdateVisible: false,
- dataForm: {},
- dataList: [],
- pageIndex: 1,
- pageSize: 10,
- totalPage: 0,
- dataListLoading: false,
- dataListSelections: [],
- optionsState: [],
- optionsType: [
- {
- code: null, value: '全部'
- },
- {
- code: 'warehouse_flow_in', value: '入库申请'
- },
- {
- code: 'warehouse_flow_out', value: '出库申请'
- },
- {
- code: 'contract_review', value: '合同评审'
- },
- {
- code: 'sale_order_flow', value: '订单评审'
- },
- {
- code: 'sale_purchase_flow', value: '采购申请'
- },
- {
- code: 'wh_template_record_flow', value: '模板出库'
- },
- {
- code: 'pro_technology_flow', value: '工艺评审'
- },
- // {
- // code: 'pro_product_flow', value: '产品'
- // },
- {
- code: 'wh_inventory_record_flow', value: '盘点评审'
- }
- ],
- optionsCustomer: []
- }
- },
- methods: {
- // 查询
- queryData () {
- this.pageIndex = 1
- this.getApprovalList()
- },
- // 获取数据列表
- getApprovalList () {
- this.dataListLoading = true
- let params = {
- 'current': this.pageIndex,
- 'size': this.pageSize,
- 'createTime': this.dataForm.createTime ? this.dataForm.createTime : null,
- 'state': this.dataForm.state ? this.dataForm.state : null,
- 'businessType': this.dataForm.businessType ? this.dataForm.businessType : null
- }
- getApprovalList(params).then(({data}) => {
- if (data && data.code === '200') {
- this.dataList = data.data.records
- this.totalPage = Number(data.data.total)
- } else {
- this.dataList = []
- this.totalPage = 0
- }
- this.dataListLoading = false
- })
- },
- // 每页数
- sizeChangeHandle (val) {
- this.pageSize = val
- this.pageIndex = 1
- this.getApprovalList()
- },
- // 当前页
- currentChangeHandle (val) {
- this.pageIndex = val
- this.getApprovalList()
- },
- // 多选
- selectionChangeHandle (val) {
- this.dataListSelections = val
- },
- // 远程方法:获取客户列表
- async remoteCustomer (query) {
- if (!query) {
- query = ''
- }
- await getCusList({'customerName': query}).then(({data}) => {
- if (data && data.code === '200') {
- this.optionsCustomer = []
- data.data.records.forEach((item) => {
- this.optionsCustomer.push({
- code: item.customerId,
- value: item.customerName
- })
- })
- }
- })
- },
- checkUser (row) {
- let currentUser = this.$store.state.user.name
- return checkStr(currentUser, row.approver)
- },
- // 新增 / 修改
- addOrUpdateHandle (businessType, businessId) {
- this.addOrUpdateVisible = true
- this.$nextTick(() => {
- this.$refs.addOrUpdate.init(businessType, businessId)
- })
- },
- // 详情
- detailHandle (businessType, businessId) {
- this.addOrUpdateVisible = true
- this.$nextTick(() => {
- this.$refs.addOrUpdate.init(businessType, businessId, true)
- })
- }
- }
- }
- </script>
- <style scoped>
- </style>
|