作者 雷海东

不能预览此文件类型
<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="品名">
<j-input placeholder="请输入品名" v-model="queryParam.productName"></j-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="申请日期">
<j-date v-model="queryParam.createTime" placeholder="请选择申请日期" />
</a-form-item>
</a-col>
<a-col :span="12">
<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: right; 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 -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('tbl_bidding_shenq')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
</a-dropdown>
</div>
<!-- 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"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
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>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<tbl-bidding-shenq-modal ref="modalForm" @ok="modalFormOk"></tbl-bidding-shenq-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import TblBiddingShenqModal from './modules/TblBiddingShenqModal'
export default {
name: 'TblBiddingShenqList',
mixins:[JeecgListMixin, mixinDevice],
components: {
TblBiddingShenqModal
},
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: '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: 'createTime',
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/tblBiddingShenq/list",
delete: "/trad/tblBiddingShenq/delete",
deleteBatch: "/trad/tblBiddingShenq/deleteBatch",
exportXlsUrl: "/trad/tblBiddingShenq/exportXls",
importExcelUrl: "trad/tblBiddingShenq/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
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>
\ No newline at end of file
... ...
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="品名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productName">
<a-input v-model="model.productName" placeholder="请输入品名"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="规格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="specifications">
<a-input v-model="model.specifications" placeholder="请输入规格"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num">
<a-input-number v-model="model.num" placeholder="请输入数量" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="danwei">
<a-input v-model="model.danwei" placeholder="请输入单位"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="到货日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deliveryTime">
<j-date v-model="model.deliveryTime" placeholder="请输入到货日期" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="品牌" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="brand">
<a-input v-model="model.brand" placeholder="请输入品牌"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="notes">
<a-input v-model="model.notes" placeholder="请输入备注"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="申请人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="applicant">
<a-input v-model="model.applicant" placeholder="请输入申请人"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<!-- <a-form-model-item label="一级审批人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="spOne">
</a-form-model-item> -->
<a-form-model-item label="一级审批" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="spOne">
<a-radio-group v-model="model.spOne" @change="handleSpChange('spOne')">
<a-radio value="同意">同意</a-radio>
<a-radio value="不同意">不同意</a-radio>
</a-radio-group>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="二级审批人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="spTwo">
<a-radio-group v-model="model.spTwo" @change="handleSpChange('spTwo')">
<a-radio value="同意">同意</a-radio>
<a-radio value="不同意">不同意</a-radio>
</a-radio-group>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item
label="不同意备注"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
prop="noNotes"
v-if="model.spOne === '不同意' || model.spTwo === '不同意'"
>
<a-input v-model="model.noNotes" placeholder="请输入不同意备注"></a-input>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
</a-spin>
</template>
<script >
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'TblBiddingShenqForm',
components: {},
props: {
//表单禁用
disabled: {
type: Boolean,
default: false,
required: false,
},
},
data() {
return {
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {},
url: {
add: '/trad/tblBiddingShenq/add',
edit: '/trad/tblBiddingShenq/edit',
queryById: '/trad/tblBiddingShenq/queryById',
},
}
},
computed: {
formDisabled() {
return this.disabled
},
},
created() {
//备份model原始值
this.modelDefault = JSON.parse(JSON.stringify(this.model))
},
methods: {
handleSpChange(type) {
if (type === 'spOne' && this.model.spOne === '同意') {
this.model.noNotes = ''
} else if (type === 'spTwo' && this.model.spTwo === '同意') {
this.model.noNotes = ''
}
},
add() {
this.edit(this.modelDefault)
},
edit(record) {
this.model = Object.assign({}, record)
this.visible = true
},
submitForm() {
const that = this
// 触发表单验证
this.$refs.form.validate((valid) => {
if (valid) {
that.confirmLoading = true
let httpurl = ''
let method = ''
if (!this.model.id) {
httpurl += this.url.add
method = 'post'
} else {
httpurl += this.url.edit
method = 'put'
}
httpAction(httpurl, this.model, method)
.then((res) => {
if (res.success) {
that.$message.success(res.message)
that.$emit('ok')
} else {
that.$message.warning(res.message)
}
})
.finally(() => {
that.confirmLoading = false
})
}
})
},
},
}
</script>
\ No newline at end of file
... ...
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<tbl-bidding-shenq-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></tbl-bidding-shenq-form>
<div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
</div>
</a-drawer>
</template>
<script>
import TblBiddingShenqForm from './TblBiddingShenqForm'
export default {
name: 'TblBiddingShenqModal',
components: {
TblBiddingShenqForm
},
data () {
return {
title:"操作",
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
});
},
close () {
this.$emit('close');
this.visible = false;
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
handleCancel () {
this.close()
}
}
}
</script>
<style lang="less" scoped>
/** Button按钮间距 */
.ant-btn {
margin-left: 30px;
margin-bottom: 30px;
float: right;
}
.drawer-footer{
position: absolute;
bottom: -8px;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>
\ No newline at end of file
... ...
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<tbl-bidding-shenq-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></tbl-bidding-shenq-form>
</j-modal>
</template>
<script>
import TblBiddingShenqForm from './TblBiddingShenqForm'
export default {
name: 'TblBiddingShenqModal',
components: {
TblBiddingShenqForm
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>
\ No newline at end of file
... ...