123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278 |
- <template>
- <div class="changeApply">
- <div class="applyList" v-if="isList">
- <el-row :gutter="10" class="mb10">
- <!-- <el-select size="small" v-model="textValue" placeholder="请选择">
- <el-option
- v-for="item in text"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- <el-select size="small" v-model="ruleValue" placeholder="请选择">
- <el-option
- v-for="item in rule"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select> -->
- <el-col :span="1.5">
- <span style="font-size: 14px;margin-right: 5px;">物料编码</span>
- <el-input
- v-model="queryParams.code"
- size="small"
- placeholder="请输入物料编码查询"
- clearable
- style="width: 240px"
- />
- </el-col>
- <el-col :span="1.5">
- <span style="font-size: 14px;margin-right: 5px;">物料名称</span>
- <el-input
- v-model="queryParams.materialName"
- size="small"
- placeholder="请输入物料名称查询"
- clearable
- style="width: 240px"
- />
- </el-col>
- <el-col :span="1.5">
- <span style="font-size: 14px;margin-right: 5px;">单据状态</span>
- <el-select
- v-model="queryParams.status"
- size="small"
- placeholder="请选择单据状态"
- clearable
- style="width: 240px">
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </el-col>
- <el-col :span="1.5">
- <el-button type="primary" size="small" plain @click="getList(queryParams)">查询</el-button>
- </el-col>
- <!-- <el-col :span="1.5">
- <el-button type="primary" size="small" plain>高级查询</el-button>
- </el-col> -->
- <el-col :span="1.5">
- <el-button type="primary" size="small" plain @click="reset">重置</el-button>
- </el-col>
- </el-row>
- <el-row :gutter="10" class="mb10">
- <el-col :span="1.5">
- <el-button type="primary" size="small" plain @click="newAdd">新增</el-button>
- </el-col>
- <!-- <el-col :span="1.5">
- <el-button type="primary" size="small" plain>导入</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button type="primary" size="small" plain>导出</el-button>
- </el-col> -->
- <!-- <el-col :span="1.5">
- <el-button type="primary" size="small" plain>批量提交</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button type="primary" size="small" plain>批量删除</el-button>
- </el-col> -->
- </el-row>
- <el-card>
- <el-table
- :data="tableList"
- class="request-table"
- fit
- max-height="680"
- @selection-change="handleSelectionChange"
- >
- <!-- <el-table-column type="selection" width="55" /> -->
- <el-table-column label="序号" align="center" type="index" width="50" />
- <el-table-column label="申请组织" align="center" width="200" prop="orgId" />
- <el-table-column label="单据编码" align="center" width="200" prop="code" />
- <el-table-column label="申请时间" align="center" width="150" prop="createTime" />
- <el-table-column label="单据状态" align="center" prop="status" :formatter="statusJug" />
- <el-table-column label="物料编码" align="center" width="150" prop="materialCode" />
- <el-table-column label="物料名称" align="center" width="150" prop="materialName" />
- <!-- <el-table-column label="最后审批人" align="center" width="120" prop="approver" />
- <el-table-column label="最后审核时间" align="center" width="150" prop="approvalTime" /> -->
- <el-table-column label="创建人" align="center" prop="createByName" />
- <el-table-column label="创建时间" align="center" width="150" prop="createTime" />
- <el-table-column label="最后修改人" align="center" width="120" prop="updateByName" />
- <el-table-column label="最后修改时间" align="center" width="150" prop="updateTime" />
- <el-table-column
- fixed="right"
- label="操作"
- align="center"
- width="150"
- >
- <template slot-scope="scope">
- <el-button type="text" size="small" @click="check(scope.row)">查看</el-button>
- <el-button @click="edit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text" size="small">编辑</el-button>
- <el-button type="text" size="small" @click="deleteRow(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :page-sizes="[5, 10, 15, 20]"
- :page-size=queryParams.pageSize
- layout="total, sizes, prev, pager, next, jumper"
- :total="total"
- style="text-align: center;">
- </el-pagination>
- </el-card>
- </div>
- <component :is="isComponent" v-model="isList" :pageStu="page" :disable="disable" :row="rowDetail" @refresh="getList" v-if="!isList"/>
- </div>
- </template>
- <script>
- import addApply from './add.vue';
- import { getChangeList , deleteChangeList} from '@/api/changeApply/basic'
- export default {
- name: 'changeApply',
- components: {
- addApply
- },
- data() {
- return{
- tableList: [],
- queryParams: {
- code: '',
- materialName: '',
- status: '',
- pageNum: 1,
- pageSize: 10
- },
- options: [{
- value: 0, label: '未提交'
- },{
- value: 1, label: '审批中'
- },{
- value: 2, label: '已完成'
- },{
- value: 3, label: '已驳回'
- },],
- total:0,
- // isComponent
- isComponent:'addApply',
- isList: true,
- // 页面状态
- page: '',
- rowDetail: {},
- disable: false
- }
- },
- created() {
-
- },
- mounted() {
- this.getList(this.queryParams)
- },
- methods: {
- reset() {
- this.queryParams.code = ''
- this.queryParams.materialName = ''
- this.queryParams.pageNum = 1
- this.queryParams.status = ''
- this.getList(this.queryParams)
- },
- newAdd() {
- this.isList = false
- this.isComponent = 'addApply'
- this.page = 'add'
- this.disable = false
- },
- getList(val) {
- console.log('val',val)
- getChangeList(val).then(res => {
- if (res.code === 200) {
- this.tableList = res.rows
- this.total = res.total
- }
- })
- },
- // 表格内状态栏判断值
- statusJug(row) {
- if (row.status === 0) {
- return '未提交'
- } else if (row.status === 1) {
- return '审批中'
- } else if (row.status === 2) {
- return '已完成'
- } else if (row.status === 3) {
- return '已驳回'
- }
- },
- //
- handleSelectionChange () {
- },
- check(row) {
- console.log('查看详情', row)
- this.isList = false
- this.isComponent = 'addApply'
- this.page = 'check'
- this.rowDetail = row
- this.disable = true
- },
- edit(row) {
- console.log('修改先加载详情', row)
- this.isList = false
- this.isComponent = 'addApply'
- this.page = 'edit'
- this.rowDetail = row
- this.disable = false
- },
- deleteRow(row) {
- this.$confirm('是否删除此条数据?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- deleteChangeList({id: row.id}).then(res => {
- if(res.code === 200) {
- this.$message({
- message: res.msg,
- type: 'success'
- });
- this.getList(this.queryParams)
- }
- })
- }).catch(() => {})
- },
- handleSizeChange(val) {
- console.log(`每页 ${val} 条`);
- this.queryParams.pageSize = val
- this.getList(this.queryParams)
- },
- handleCurrentChange(val) {
- console.log(`当前页: ${val}`);
- this.queryParams.pageNum = val
- this.getList(this.queryParams)
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .changeApply {
- height: calc(100vh - 84px);
- padding: 12px;
- box-sizing: border-box;
- }
- </style>
|