TblBiddingShenqApproval1List.vue 8.9 KB
<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="品名">
              <a-input placeholder="请输入品名" v-model="queryParam.productName"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="工作令">
              <a-input placeholder="请输入工作令" v-model="queryParam.workOrder"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="使用日期">
              <j-date v-model="queryParam.deliveryTime" placeholder="请选择使用日期" />
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->

    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>

      <a-table
        ref="table"
        size="middle"
        :scroll="{x:true}"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        class="j-table-force-nowrap"
        @change="handleTableChange">

        <!-- <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template> -->
        <!-- <template slot="imgSlot" slot-scope="text,record">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template> -->
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)">
            下载
          </a-button>
        </template>
        <template slot="chooseStatusSlot" slot-scope="text, record">
          <span v-if="record.chooseStatus == 0">是</span>
          <span v-if="record.chooseStatus == 1">否</span>
        </template>
        <span slot="action" slot-scope="text, record">
          <a @click="handleApproval1(record)">审批</a>
        </span>
      </a-table>
    </div>
    <TblBiddingShenqApproval1Model ref="TblBiddingShenqApproval1Model" @ok="modalFormOk"></TblBiddingShenqApproval1Model>
  </a-card>
</template>

<script>

  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import TblBiddingShenqModal from './modules/TblBiddingShenqModal'
  import store from '@/store/'
  import { ROLES } from "@/store/mutation-types"
  import  TblBiddingShenqApproval1Model from './modules/TblBiddingShenqApproval1Model'
  export default {
    name: 'TblBiddingShenqList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      TblBiddingShenqApproval1Model
    },
    data () {
      return {
        description: 'tbl_bidding_shenq管理页面',
        // 表头
        columns: [
          {
            title: '序号',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'品名',
            align:"center",
            dataIndex: 'productName'
          },
          {
            title:'规格',
            align:"center",
            dataIndex: 'specifications'
          },
          {
            title:'数量',
            align:"center",
            dataIndex: 'num'
          },
           {
            title:'单位',
            align:"center",
            dataIndex: 'danwei'
          },
          {
            title:'物料类别',
            align:"center",
            dataIndex: 'wuType'
          },
          {
            title:'工作令',
            align:"center",
            dataIndex: 'workOrder'
          },
          {
            title:'用途',
            align:"center",
            dataIndex: 'purpose'
          },
          {
            title:'当前库存',
            align:"center",
            dataIndex: 'operNumber'
          },
          {
            title:'是否从基础表选择',
            align:"center",
            dataIndex: 'chooseStatus',
            scopedSlots: { customRender: 'chooseStatusSlot' }
          },
           {
            title:'使用日期',
            align:"center",
            dataIndex: 'deliveryTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'品牌',
            align:"center",
            dataIndex: 'brand'
          },
          {
            title:'备注',
            align:"center",
            dataIndex: 'notes'
          },
          {
            title:'申请人',
            align:"center",
            dataIndex: 'applicant'
          },
          {
            title:'一级审批人',
            align:"center",
            dataIndex: 'spOne'
          },
          {
            title:'二级审批人',
            align:"center",
            dataIndex: 'spTwo'
          },
          {
            title:'不同意备注',
            align:"center",
            dataIndex: 'noNotes'
          },
          {
            title:'申请日期',
            align:"center",
            dataIndex: 'sqTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/trad/biddingSq/list",
          delete: "/trad/tblBiddingShenq/delete",
          deleteBatch: "/trad/tblBiddingShenq/deleteBatch",
          exportXlsUrl: "/trad/tblBiddingShenq/exportXls",
          importExcelUrl: "trad/tblBiddingShenq/importExcel",
          
        },
        dictOptions:{},
        superFieldList:[],
        roleList:[],
        roleCodeList:[],
        cgzg:false,
        cjgly:false,
      }
    },
    created() {
      // console.log('store.getters.roles',JSON.parse(sessionStorage.getItem(ROLES)))
      this.loadRoles()

      this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
      loadRoles(){
          this.roleList = JSON.parse(sessionStorage.getItem(ROLES))
          for(let i = 0;i<this.roleList.length; i++){
            this.roleCodeList.push(this.roleList[i].role_code)
          }
          //采购主管
          const cgzg =  this.roleCodeList.includes('ProcurementSupervisor')
          this.cgzg = cgzg
          //车间管理员
          const cjgly =  this.roleCodeList.includes('WorkshopDirector')
          this.cjgly = cjgly
      },
      handleApproval1(record){
        this.$refs.TblBiddingShenqApproval1Model.edit(record);
        this.$refs.TblBiddingShenqApproval1Model.disableSubmit = false;
      },
      initDictConfig(){
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'string',value:'productName',text:'品名'})
        fieldList.push({type:'string',value:'specifications',text:'规格'})
        fieldList.push({type:'int',value:'num',text:'数量'})
        fieldList.push({type:'string',value:'brand',text:'品牌'})
        fieldList.push({type:'string',value:'notes',text:'备注'})
        fieldList.push({type:'string',value:'applicant',text:'申请人'})
        fieldList.push({type:'string',value:'spOne',text:'一级审批人'})
        fieldList.push({type:'string',value:'spTwo',text:'二级审批人'})
        this.superFieldList = fieldList
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>