作者 雷海东

不能预览此文件类型
  1 +<template>
  2 + <a-card :bordered="false">
  3 + <!-- 查询区域 -->
  4 + <div class="table-page-search-wrapper">
  5 + <a-form layout="inline" @keyup.enter.native="searchQuery">
  6 + <a-row :gutter="24">
  7 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  8 + <a-form-item label="品名">
  9 + <j-input placeholder="请输入品名" v-model="queryParam.productName"></j-input>
  10 + </a-form-item>
  11 + </a-col>
  12 + <a-col :span="12">
  13 + <a-form-item label="申请日期">
  14 + <j-date v-model="queryParam.createTime" placeholder="请选择申请日期" />
  15 + </a-form-item>
  16 + </a-col>
  17 + <a-col :span="12">
  18 + <a-form-item label="到货日期">
  19 + <j-date v-model="queryParam.deliveryTime" placeholder="请选择到货日期" />
  20 + </a-form-item>
  21 + </a-col>
  22 + <a-col :xl="6" :lg="7" :md="8" :sm="24">
  23 + <span style="float: right; overflow: hidden" class="table-page-search-submitButtons">
  24 + <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  25 + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  26 + </span>
  27 + </a-col>
  28 + </a-row>
  29 + </a-form>
  30 + </div>
  31 + <!-- 查询区域-END -->
  32 +
  33 + <!-- 操作按钮区域 -->
  34 + <div class="table-operator">
  35 + <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  36 + <a-button type="primary" icon="download" @click="handleExportXls('tbl_bidding_shenq')">导出</a-button>
  37 + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  38 + <a-button type="primary" icon="import">导入</a-button>
  39 + </a-upload>
  40 + <!-- 高级查询区域 -->
  41 + <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
  42 + <a-dropdown v-if="selectedRowKeys.length > 0">
  43 + <a-menu slot="overlay">
  44 + <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  45 + </a-menu>
  46 + <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  47 + </a-dropdown>
  48 + </div>
  49 +
  50 + <!-- table区域-begin -->
  51 + <div>
  52 + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  53 + <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  54 + <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  55 + </div>
  56 +
  57 + <a-table
  58 + ref="table"
  59 + size="middle"
  60 + :scroll="{x:true}"
  61 + bordered
  62 + rowKey="id"
  63 + :columns="columns"
  64 + :dataSource="dataSource"
  65 + :pagination="ipagination"
  66 + :loading="loading"
  67 + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  68 + class="j-table-force-nowrap"
  69 + @change="handleTableChange">
  70 +
  71 + <template slot="htmlSlot" slot-scope="text">
  72 + <div v-html="text"></div>
  73 + </template>
  74 + <template slot="imgSlot" slot-scope="text,record">
  75 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  76 + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  77 + </template>
  78 + <template slot="fileSlot" slot-scope="text">
  79 + <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  80 + <a-button
  81 + v-else
  82 + :ghost="true"
  83 + type="primary"
  84 + icon="download"
  85 + size="small"
  86 + @click="downloadFile(text)">
  87 + 下载
  88 + </a-button>
  89 + </template>
  90 +
  91 + <span slot="action" slot-scope="text, record">
  92 + <a @click="handleEdit(record)">编辑</a>
  93 +
  94 + <a-divider type="vertical" />
  95 + <a-dropdown>
  96 + <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  97 + <a-menu slot="overlay">
  98 + <a-menu-item>
  99 + <a @click="handleDetail(record)">详情</a>
  100 + </a-menu-item>
  101 + <a-menu-item>
  102 + <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  103 + <a>删除</a>
  104 + </a-popconfirm>
  105 + </a-menu-item>
  106 + </a-menu>
  107 + </a-dropdown>
  108 + </span>
  109 +
  110 + </a-table>
  111 + </div>
  112 +
  113 + <tbl-bidding-shenq-modal ref="modalForm" @ok="modalFormOk"></tbl-bidding-shenq-modal>
  114 + </a-card>
  115 +</template>
  116 +
  117 +<script>
  118 +
  119 + import '@/assets/less/TableExpand.less'
  120 + import { mixinDevice } from '@/utils/mixin'
  121 + import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  122 + import TblBiddingShenqModal from './modules/TblBiddingShenqModal'
  123 +
  124 + export default {
  125 + name: 'TblBiddingShenqList',
  126 + mixins:[JeecgListMixin, mixinDevice],
  127 + components: {
  128 + TblBiddingShenqModal
  129 + },
  130 + data () {
  131 + return {
  132 + description: 'tbl_bidding_shenq管理页面',
  133 + // 表头
  134 + columns: [
  135 + {
  136 + title: '序号',
  137 + dataIndex: '',
  138 + key:'rowIndex',
  139 + width:60,
  140 + align:"center",
  141 + customRender:function (t,r,index) {
  142 + return parseInt(index)+1;
  143 + }
  144 + },
  145 + {
  146 + title:'品名',
  147 + align:"center",
  148 + dataIndex: 'productName'
  149 + },
  150 + {
  151 + title:'规格',
  152 + align:"center",
  153 + dataIndex: 'specifications'
  154 + },
  155 + {
  156 + title:'数量',
  157 + align:"center",
  158 + dataIndex: 'num'
  159 + },
  160 + {
  161 + title:'单位',
  162 + align:"center",
  163 + dataIndex: 'danwei'
  164 + },
  165 + {
  166 + title:'到货日期',
  167 + align:"center",
  168 + dataIndex: 'deliveryTime',
  169 + customRender:function (text) {
  170 + return !text?"":(text.length>10?text.substr(0,10):text)
  171 + }
  172 + },
  173 + {
  174 + title:'品牌',
  175 + align:"center",
  176 + dataIndex: 'brand'
  177 + },
  178 + {
  179 + title:'备注',
  180 + align:"center",
  181 + dataIndex: 'notes'
  182 + },
  183 + {
  184 + title:'申请人',
  185 + align:"center",
  186 + dataIndex: 'applicant'
  187 + },
  188 + {
  189 + title:'一级审批人',
  190 + align:"center",
  191 + dataIndex: 'spOne'
  192 + },
  193 + {
  194 + title:'二级审批人',
  195 + align:"center",
  196 + dataIndex: 'spTwo'
  197 + },
  198 + {
  199 + title:'不同意备注',
  200 + align:"center",
  201 + dataIndex: 'noNotes'
  202 + },
  203 + {
  204 + title:'申请日期',
  205 + align:"center",
  206 + dataIndex: 'createTime',
  207 + customRender:function (text) {
  208 + return !text?"":(text.length>10?text.substr(0,10):text)
  209 + }
  210 + },
  211 + {
  212 + title: '操作',
  213 + dataIndex: 'action',
  214 + align:"center",
  215 + fixed:"right",
  216 + width:147,
  217 + scopedSlots: { customRender: 'action' }
  218 + }
  219 + ],
  220 + url: {
  221 + list: "/trad/tblBiddingShenq/list",
  222 + delete: "/trad/tblBiddingShenq/delete",
  223 + deleteBatch: "/trad/tblBiddingShenq/deleteBatch",
  224 + exportXlsUrl: "/trad/tblBiddingShenq/exportXls",
  225 + importExcelUrl: "trad/tblBiddingShenq/importExcel",
  226 +
  227 + },
  228 + dictOptions:{},
  229 + superFieldList:[],
  230 + }
  231 + },
  232 + created() {
  233 + this.getSuperFieldList();
  234 + },
  235 + computed: {
  236 + importExcelUrl: function(){
  237 + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  238 + },
  239 + },
  240 + methods: {
  241 + initDictConfig(){
  242 + },
  243 + getSuperFieldList(){
  244 + let fieldList=[];
  245 + fieldList.push({type:'string',value:'productName',text:'品名'})
  246 + fieldList.push({type:'string',value:'specifications',text:'规格'})
  247 + fieldList.push({type:'int',value:'num',text:'数量'})
  248 + fieldList.push({type:'string',value:'brand',text:'品牌'})
  249 + fieldList.push({type:'string',value:'notes',text:'备注'})
  250 + fieldList.push({type:'string',value:'applicant',text:'申请人'})
  251 + fieldList.push({type:'string',value:'spOne',text:'一级审批人'})
  252 + fieldList.push({type:'string',value:'spTwo',text:'二级审批人'})
  253 + this.superFieldList = fieldList
  254 + }
  255 + }
  256 + }
  257 +</script>
  258 +<style scoped>
  259 + @import '~@assets/less/common.less';
  260 +</style>
  1 +<template>
  2 + <a-spin :spinning="confirmLoading">
  3 + <j-form-container :disabled="formDisabled">
  4 + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
  5 + <a-row>
  6 + <a-col :span="24">
  7 + <a-form-model-item label="品名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productName">
  8 + <a-input v-model="model.productName" placeholder="请输入品名"></a-input>
  9 + </a-form-model-item>
  10 + </a-col>
  11 + <a-col :span="24">
  12 + <a-form-model-item label="规格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="specifications">
  13 + <a-input v-model="model.specifications" placeholder="请输入规格"></a-input>
  14 + </a-form-model-item>
  15 + </a-col>
  16 + <a-col :span="24">
  17 + <a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num">
  18 + <a-input-number v-model="model.num" placeholder="请输入数量" style="width: 100%" />
  19 + </a-form-model-item>
  20 + </a-col>
  21 + <a-col :span="24">
  22 + <a-form-model-item label="单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="danwei">
  23 + <a-input v-model="model.danwei" placeholder="请输入单位"></a-input>
  24 + </a-form-model-item>
  25 + </a-col>
  26 + <a-col :span="24">
  27 + <a-form-model-item label="到货日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryTime">
  28 + <j-date v-model="model.deliveryTime" placeholder="请输入到货日期" />
  29 + </a-form-model-item>
  30 + </a-col>
  31 + <a-col :span="24">
  32 + <a-form-model-item label="品牌" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="brand">
  33 + <a-input v-model="model.brand" placeholder="请输入品牌"></a-input>
  34 + </a-form-model-item>
  35 + </a-col>
  36 + <a-col :span="24">
  37 + <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="notes">
  38 + <a-input v-model="model.notes" placeholder="请输入备注"></a-input>
  39 + </a-form-model-item>
  40 + </a-col>
  41 + <a-col :span="24">
  42 + <a-form-model-item label="申请人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicant">
  43 + <a-input v-model="model.applicant" placeholder="请输入申请人"></a-input>
  44 + </a-form-model-item>
  45 + </a-col>
  46 + <a-col :span="24">
  47 + <!-- <a-form-model-item label="一级审批人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="spOne">
  48 +
  49 + </a-form-model-item> -->
  50 + <a-form-model-item label="一级审批" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="spOne">
  51 + <a-radio-group v-model="model.spOne" @change="handleSpChange('spOne')">
  52 + <a-radio value="同意">同意</a-radio>
  53 + <a-radio value="不同意">不同意</a-radio>
  54 + </a-radio-group>
  55 + </a-form-model-item>
  56 + </a-col>
  57 + <a-col :span="24">
  58 + <a-form-model-item label="二级审批人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="spTwo">
  59 + <a-radio-group v-model="model.spTwo" @change="handleSpChange('spTwo')">
  60 + <a-radio value="同意">同意</a-radio>
  61 + <a-radio value="不同意">不同意</a-radio>
  62 + </a-radio-group>
  63 + </a-form-model-item>
  64 + </a-col>
  65 + <a-col :span="24">
  66 + <a-form-model-item
  67 + label="不同意备注"
  68 + :labelCol="labelCol"
  69 + :wrapperCol="wrapperCol"
  70 + prop="noNotes"
  71 + v-if="model.spOne === '不同意' || model.spTwo === '不同意'"
  72 + >
  73 + <a-input v-model="model.noNotes" placeholder="请输入不同意备注"></a-input>
  74 + </a-form-model-item>
  75 + </a-col>
  76 + </a-row>
  77 + </a-form-model>
  78 + </j-form-container>
  79 + </a-spin>
  80 +</template>
  81 +
  82 +<script >
  83 +import { httpAction, getAction } from '@/api/manage'
  84 +import { validateDuplicateValue } from '@/utils/util'
  85 +
  86 +export default {
  87 + name: 'TblBiddingShenqForm',
  88 + components: {},
  89 + props: {
  90 + //表单禁用
  91 + disabled: {
  92 + type: Boolean,
  93 + default: false,
  94 + required: false,
  95 + },
  96 + },
  97 + data() {
  98 + return {
  99 + model: {},
  100 + labelCol: {
  101 + xs: { span: 24 },
  102 + sm: { span: 5 },
  103 + },
  104 + wrapperCol: {
  105 + xs: { span: 24 },
  106 + sm: { span: 16 },
  107 + },
  108 + confirmLoading: false,
  109 + validatorRules: {},
  110 + url: {
  111 + add: '/trad/tblBiddingShenq/add',
  112 + edit: '/trad/tblBiddingShenq/edit',
  113 + queryById: '/trad/tblBiddingShenq/queryById',
  114 + },
  115 + }
  116 + },
  117 + computed: {
  118 + formDisabled() {
  119 + return this.disabled
  120 + },
  121 + },
  122 + created() {
  123 + //备份model原始值
  124 + this.modelDefault = JSON.parse(JSON.stringify(this.model))
  125 + },
  126 + methods: {
  127 + handleSpChange(type) {
  128 + if (type === 'spOne' && this.model.spOne === '同意') {
  129 + this.model.noNotes = ''
  130 + } else if (type === 'spTwo' && this.model.spTwo === '同意') {
  131 + this.model.noNotes = ''
  132 + }
  133 + },
  134 + add() {
  135 + this.edit(this.modelDefault)
  136 + },
  137 + edit(record) {
  138 + this.model = Object.assign({}, record)
  139 + this.visible = true
  140 + },
  141 + submitForm() {
  142 + const that = this
  143 + // 触发表单验证
  144 + this.$refs.form.validate((valid) => {
  145 + if (valid) {
  146 + that.confirmLoading = true
  147 + let httpurl = ''
  148 + let method = ''
  149 + if (!this.model.id) {
  150 + httpurl += this.url.add
  151 + method = 'post'
  152 + } else {
  153 + httpurl += this.url.edit
  154 + method = 'put'
  155 + }
  156 + httpAction(httpurl, this.model, method)
  157 + .then((res) => {
  158 + if (res.success) {
  159 + that.$message.success(res.message)
  160 + that.$emit('ok')
  161 + } else {
  162 + that.$message.warning(res.message)
  163 + }
  164 + })
  165 + .finally(() => {
  166 + that.confirmLoading = false
  167 + })
  168 + }
  169 + })
  170 + },
  171 + },
  172 +}
  173 +</script>
  1 +<template>
  2 + <a-drawer
  3 + :title="title"
  4 + :width="width"
  5 + placement="right"
  6 + :closable="false"
  7 + @close="close"
  8 + destroyOnClose
  9 + :visible="visible">
  10 + <tbl-bidding-shenq-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></tbl-bidding-shenq-form>
  11 + <div class="drawer-footer">
  12 + <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
  13 + <a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
  14 + </div>
  15 + </a-drawer>
  16 +</template>
  17 +
  18 +<script>
  19 +
  20 + import TblBiddingShenqForm from './TblBiddingShenqForm'
  21 +
  22 + export default {
  23 + name: 'TblBiddingShenqModal',
  24 + components: {
  25 + TblBiddingShenqForm
  26 + },
  27 + data () {
  28 + return {
  29 + title:"操作",
  30 + width:800,
  31 + visible: false,
  32 + disableSubmit: false
  33 + }
  34 + },
  35 + methods: {
  36 + add () {
  37 + this.visible=true
  38 + this.$nextTick(()=>{
  39 + this.$refs.realForm.add();
  40 + })
  41 + },
  42 + edit (record) {
  43 + this.visible=true
  44 + this.$nextTick(()=>{
  45 + this.$refs.realForm.edit(record);
  46 + });
  47 + },
  48 + close () {
  49 + this.$emit('close');
  50 + this.visible = false;
  51 + },
  52 + submitCallback(){
  53 + this.$emit('ok');
  54 + this.visible = false;
  55 + },
  56 + handleOk () {
  57 + this.$refs.realForm.submitForm();
  58 + },
  59 + handleCancel () {
  60 + this.close()
  61 + }
  62 + }
  63 + }
  64 +</script>
  65 +
  66 +<style lang="less" scoped>
  67 +/** Button按钮间距 */
  68 + .ant-btn {
  69 + margin-left: 30px;
  70 + margin-bottom: 30px;
  71 + float: right;
  72 + }
  73 + .drawer-footer{
  74 + position: absolute;
  75 + bottom: -8px;
  76 + width: 100%;
  77 + border-top: 1px solid #e8e8e8;
  78 + padding: 10px 16px;
  79 + text-align: right;
  80 + left: 0;
  81 + background: #fff;
  82 + border-radius: 0 0 2px 2px;
  83 + }
  84 +</style>
  1 +<template>
  2 + <j-modal
  3 + :title="title"
  4 + :width="width"
  5 + :visible="visible"
  6 + switchFullscreen
  7 + @ok="handleOk"
  8 + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
  9 + @cancel="handleCancel"
  10 + cancelText="关闭">
  11 + <tbl-bidding-shenq-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tbl-bidding-shenq-form>
  12 + </j-modal>
  13 +</template>
  14 +
  15 +<script>
  16 +
  17 + import TblBiddingShenqForm from './TblBiddingShenqForm'
  18 + export default {
  19 + name: 'TblBiddingShenqModal',
  20 + components: {
  21 + TblBiddingShenqForm
  22 + },
  23 + data () {
  24 + return {
  25 + title:'',
  26 + width:800,
  27 + visible: false,
  28 + disableSubmit: false
  29 + }
  30 + },
  31 + methods: {
  32 + add () {
  33 + this.visible=true
  34 + this.$nextTick(()=>{
  35 + this.$refs.realForm.add();
  36 + })
  37 + },
  38 + edit (record) {
  39 + this.visible=true
  40 + this.$nextTick(()=>{
  41 + this.$refs.realForm.edit(record);
  42 + })
  43 + },
  44 + close () {
  45 + this.$emit('close');
  46 + this.visible = false;
  47 + },
  48 + handleOk () {
  49 + this.$refs.realForm.submitForm();
  50 + },
  51 + submitCallback(){
  52 + this.$emit('ok');
  53 + this.visible = false;
  54 + },
  55 + handleCancel () {
  56 + this.close()
  57 + }
  58 + }
  59 + }
  60 +</script>