资源管理1.0

This commit is contained in:
xbx 2023-11-18 15:50:30 +08:00
parent 3ba408c424
commit 834b9ded87
26 changed files with 4194 additions and 0 deletions

View File

@ -0,0 +1,299 @@
<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-dict-select-tag placeholder="请选择审批状态" v-model="queryParam.demandStatus"
dictCode="procurement_approval_status" />
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="采购类别">
<j-dict-select-tag placeholder="请选择审批状态" v-model="queryParam.procurementCategory"
dictCode="purchasing_categories" />
</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 -->
<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, record, index">
<a-button @click="handleButtonClick(record)">详情</a-button>
</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" v-if="record.isReceiving == 0">
<a-button v-if="record.demandStatus == 3" type="primary" @click="pass(record)">通过</a-button>
<a-button v-else-if="record.demandStatus == 2" type="primary" @click="openNoPassModal(record)">不通过</a-button>
<div v-else>
<a-button type="primary" @click="pass(record)">通过</a-button>
<a-divider type="vertical" />
<a-button type="primary" @click="openNoPassModal(record)">不通过</a-button>
</div>
</span>
<span v-else>
<a>已被接单,不可修改</a>
</span>
</a-table>
<a-modal title="采购内容详情" :visible="see" @ok="handleOk" @cancel="handleOk">
<a-table :columns="contentColumns" :dataSource="content" rowKey="name"></a-table>
</a-modal>
<a-modal title="不通过原因" :visible="noPassSee" @ok="noPassOk" @cancel="noPassCancel">
<a-textarea v-model="tempRecord.auditResults" placeholder="请输入不通过原因" />
</a-modal>
<purchase-request-modal ref="modalForm" @ok="modalFormOk"></purchase-request-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import PurchaseRequestModal from './modules/PurchaseRequestModal.vue'
import { filterMultiDictText } from '@/components/dict/JDictSelectUtil'
import { postAction } from '@/api/manage'
import { USER_INFO } from "@/store/mutation-types"
import Vue from 'vue'
export default {
name: 'PurchaseRequestList',
mixins: [JeecgListMixin, mixinDevice],
components: {
PurchaseRequestModal
},
data() {
return {
description: '采购表管理页面',
//
see: false,
noPassSee: false,
columns: [
{
title: '审批状态',
align: "center",
dataIndex: 'demandStatus_dictText'
},
{
title: '审核结果',
align: "center",
dataIndex: 'auditResults'
},
{
title: '申请人',
align: "center",
dataIndex: 'createBy_dictText'
},
{
title: '申请日期',
align: "center",
dataIndex: 'createTime'
},
{
title: '需求编号',
align: "center",
dataIndex: 'requirementNumber',
customRender: (text, record, index) => {
//
if (text == null || text == '') {
return ''
}
return 'HL-' + text
}
},
{
title: '申请部门',
align: "center",
dataIndex: 'sysOrgCode'
},
{
title: '采购类别',
align: "center",
dataIndex: 'procurementCategory_dictText'
},
{
title: '采购方向',
align: "center",
dataIndex: 'procurementDirection'
},
{
title: '采购内容',
align: 'center',
dataIndex: 'procurementContent',
scopedSlots: { customRender: 'htmlSlot' }
},
{
title: '采购预算',
align: "center",
dataIndex: 'procurementBudget'
},
{
title: '附件',
align: "center",
dataIndex: 'annex',
scopedSlots: { customRender: 'fileSlot' }
},
{
title: '操作',
dataIndex: 'action',
align: "center",
fixed: "right",
width: 147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/Try/purchaseRequest/list",
edit: "/Try/purchaseRequest/edit",
delete: "/Try/purchaseRequest/delete",
deleteBatch: "/Try/purchaseRequest/deleteBatch",
exportXlsUrl: "/Try/purchaseRequest/exportXls",
importExcelUrl: "Try/purchaseRequest/importExcel",
},
dictOptions: {},
superFieldList: [],
content: [
{
name: '',
number: '',
unit: '',
},
],
contentColumns: [
{
title: '名称',
dataIndex: 'name',
key: 'name',
width: 200
},
{
title: '数量',
dataIndex: 'number',
key: 'number',
width: 80
},
{
title: '单位',
dataIndex: 'unit',
key: 'unit',
width: 80
}
],
//
tempRecord: {},
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig() {
},
openNoPassModal(record) {
this.noPassSee = true
this.tempRecord = Object.assign({}, record);
this.tempRecord.auditResults = '';
},
noPassOk() {
this.noPassSee = false
//
let record = Object.assign({}, this.tempRecord);
record.demandStatus = 3;
record.approvedBy = Vue.ls.get(USER_INFO).username;
record.auditResults = this.tempRecord.auditResults;
postAction(this.url.edit, record).then(res => {
if (res.success) {
this.$message.success('重新审批成功');
this.loadData();
} else {
this.$message.error(res.message);
}
})
},
noPassCancel() {
this.noPassSee = false
},
handleOk() {
this.see = false
},
handleButtonClick(record) {
this.see = true
if (record.procurementContent == null || record.procurementContent == '') {
this.content = {
name: '',
number: '',
unit: '',
}
} else {
this.content = JSON.parse(record.procurementContent)
}
},
getSuperFieldList() {
let fieldList = [];
fieldList.push({ type: 'sel_user', value: 'createBy', text: '申请人' })
fieldList.push({ type: 'datetime', value: 'createTime', text: '申请日期' })
fieldList.push({ type: 'string', value: 'requirementNumber', text: '需求编号', dictCode: '' })
fieldList.push({ type: 'string', value: 'sysOrgCode', text: '申请部门', dictCode: '' })
fieldList.push({ type: 'int', value: 'demandStatus', text: '需求状态', dictCode: 'procurement_approval_status' })
fieldList.push({ type: 'sel_user', value: 'updateBy', text: '审批人' })
fieldList.push({ type: 'datetime', value: 'updateTime', text: '更新日期' })
fieldList.push({ type: 'int', value: 'procurementCategory', text: '采购类别', dictCode: 'purchasing_categories' })
fieldList.push({ type: 'string', value: 'procurementDirection', text: '采购方向', dictCode: '' })
fieldList.push({ type: 'Text', value: 'procurementContent', text: '采购内容', dictCode: '' })
fieldList.push({ type: 'string', value: 'procurementBudget', text: '采购预算', dictCode: '' })
fieldList.push({ type: 'string', value: 'annex', text: '附件', dictCode: '' })
fieldList.push({ type: 'Text', value: 'auditResults', text: '审核结果', dictCode: '' })
this.superFieldList = fieldList
},
pass(record) {
record.demandStatus = 2;
record.approvedBy = Vue.ls.get(USER_INFO).username;
record.auditResults = '通过';
postAction(this.url.edit, record).then(res => {
if (res.success) {
this.$message.success('重新提交成功');
this.loadData();
} else {
this.$message.error(res.message);
}
})
},
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

View File

@ -0,0 +1,103 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="审核结果" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="auditResults">
<a-textarea v-model="model.auditResults" placeholder="请输入审核结果"></a-textarea>
</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: 'PurchaseRequestForm',
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,
url: {
add: "/Try/purchaseRequest/add",
edit: "/Try/purchaseRequest/edit",
queryById: "/Try/purchaseRequest/queryById"
}
}
},
computed: {
formDisabled() {
return this.disabled
},
},
created() {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add() {
this.edit(this.modelDefault);
},
edit(record, id) {
this.model = Object.assign({}, record);
this.visible = true;
console.log(id)
},
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>

View File

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<purchase-request-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></purchase-request-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 PurchaseRequestForm from './PurchaseRequestForm.vue'
export default {
name: 'PurchaseRequestModal',
components: {
PurchaseRequestForm
},
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>

View File

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<purchase-request-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></purchase-request-form>
</j-modal>
</template>
<script>
import PurchaseRequestForm from './PurchaseRequestForm.vue'
export default {
name: 'PurchaseRequestModal',
components: {
PurchaseRequestForm
},
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>

View File

@ -0,0 +1,480 @@
<template>
<a-card title="订单处理" :bordered="false">
<template #extra>
<a-button style="margin-left: 10px;" type="primary" @click="Refresh()">刷新</a-button>
</template>
<a-collapse v-model:activeKey="activeKey" accordion v-if="dataShow">
<a-collapse-panel v-for="(item, index) in tableData" :key="index.toString()">
<template slot="header">
<div style="font-size: 18px; font-weight: bold;">
采购订单号:HL-{{ item.requirementNumber }} &nbsp;&nbsp;部门:{{ item.sysOrgCode }}
&nbsp;&nbsp;采购方向:{{ item.procurementDirection }}
<a-button type="primary" style="float: right;margin-left: 10px;"
@click="finish(item)">开始采购</a-button>
<a-button style="float: right;margin-left: 10px;" @click="GenerateQRcode(item)">生成二维码</a-button>
<a-button style="float: right;margin-left: 10px;" @click="generateOrder(item)">生成订单</a-button>
<a-button style="float: right;" @click="receiveNO(item)">取消接单</a-button>
</div>
</template>
<div>
<a-descriptions title="订单详情" bordered>
<a-descriptions-item label="申请人">{{ item.createBy_dictText }}</a-descriptions-item>
<a-descriptions-item label="申请时间">{{ item.createTime }}</a-descriptions-item>
<a-descriptions-item label="申请部门">{{ item.sysOrgCode }}</a-descriptions-item>
<a-descriptions-item label="采购类型">{{ item.procurementCategory_dictText }}</a-descriptions-item>
<a-descriptions-item label="采购预算" :span="3">{{ item.procurementBudget }}</a-descriptions-item>
<a-descriptions-item label="审批人">{{ item.approvedBy_dictText }}</a-descriptions-item>
<a-descriptions-item label="附件" :span="3">
<template>
<span v-if="!item.annex" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button v-else :ghost="true" type="primary" icon="download" size="small"
@click="downloadFile(item.annex)">
下载
</a-button>
</template>
</a-descriptions-item>
<a-descriptions-item label="采购详情(未整理)"
v-if="item.supplierSelection == null || item.supplierSelection == ''">
<div v-for="(item2, index2) in item.procurementContent" :key="index2.toString()">
<a-row>
<a-col :span="2">{{ item2.name }}</a-col>
<a-col :span="2">{{ item2.number }}{{ item2.unit }}</a-col>
</a-row>
</div>
<a-button style="float: right;" type="primary" @click="arrangeOpen(item)">物品和供应商整理</a-button>
</a-descriptions-item>
<a-descriptions-item label="采购详情" v-else>
<a-card style="margin-top: 20px;margin-right: 20px;"
v-for="(item2, index2) in item.supplierSelection" :key="index2.toString()">
<template #title>
{{ item2.supplier }}
</template>
<div v-for="(item3, index3) in item2.goods" :key="index3.toString()">
<a-row :gutter="16" style="margin-top: 5px;">
<a-col :span="8">
<a-input v-model="item3.name" placeholder="物品名称" disabled />
</a-col>
<a-col :span="6">
<a-input v-model="item3.number" placeholder="数量" disabled />
</a-col>
<a-col :span="6">
<a-input v-model="item3.unit" placeholder="单位" disabled />
</a-col>
</a-row>
</div>
</a-card>
<a-button style="margin-top: 10px;float: right;" type="primary"
@click="arrangeOpen(item)">物品和供应商整理</a-button>
</a-descriptions-item>
</a-descriptions>
</div>
</a-collapse-panel>
</a-collapse>
<a-empty v-else>
<template #description>
<span>
订单为空
</span>
</template>
</a-empty>
<a-modal title="采购整理" :visible="arrange" @ok="arrangeOk" @cancel="arrangeCancel">
<div v-if="classifyData.length == 0">
暂无数据
</div>
<div v-else>
<div>
<a-card style="margin-top: 20px;margin-right: 20px;" v-for="(item, index) in classifyData"
:key="index.toString()">
<template #title>
{{ item.supplier }}
<a-button style="float: right;" type="primary" @click="delSupplier(item)">删除公司</a-button>
</template>
<div style="margin-bottom: 20px;">
<a-select v-model:value="selectedFoods" mode="multiple" style="width: 60%"
placeholder="Please select">
<a-select-option v-for="food in classFood" :key="food.name" :value="food.name">
{{ food.name }}
</a-select-option>
</a-select>
<a-button style="float: right;" @click="importFoods(index)">导入</a-button>
<br>
</div>
<div v-for="(item2, index2) in item.goods" :key="index2.toString()">
<a-row :gutter="16" style="margin-top: 5px;">
<a-col :span="8">
<a-input v-model="item2.name" placeholder="物品名称" />
</a-col>
<a-col :span="6">
<a-input v-model="item2.number" placeholder="数量" />
</a-col>
<a-col :span="6">
<a-input v-model="item2.unit" placeholder="单位" />
</a-col>
<a-col :span="2">
<!-- 通过点击按钮触发新增行 -->
<a-icon type="plus-circle" @click="addRow(item2, index)" />
</a-col>
<a-col :span="2">
<!-- 通过点击按钮触发删除行 -->
<a-icon type="minus-circle" @click="removeRow(index, index2)" />
</a-col>
</a-row>
</div>
</a-card>
</div>
</div>
<div>
<a-select mode="default" v-model="selectedSuppliers" style="width: 160px;">
<a-select-option v-for="supplier in classSupplier" :key="supplier.id" :value="supplier.id">
{{ supplier.name }}
</a-select-option>
</a-select>
<a-button type="primary" style="margin-top: 20px;margin-left: 20px;" @click="addSupplier()">添加供应商</a-button>
</div>
</a-modal>
<a-modal title="生成二维码" :visible="QRvis" @ok="QRvis = false" @cancel="QRvis = false">
生成失败
</a-modal>
</a-card>
</template>
<script>
import { getAction, postAction } from '@/api/manage'
import { USER_INFO } from "@/store/mutation-types"
import Vue from 'vue'
export default {
name: 'PurchaseOrderConfirmationList',
data() {
return {
QRvis: false,
url: {
getPurchaseSupplier: "Try/purchaseSupplier/list",
getdata: "/Try/purchaseOrderConfirmation/joinList",
receiveNOurl: "/Try/purchaseOrderConfirmation/cancelReceiving",
editUrl: '/Try/purchaseOrderConfirmation/edit',
finshUrl: '/Try/purchaseOrderConfirmation/finish'
},
activeKey: [],
username: Vue.ls.get(USER_INFO).username,
sysOrgCode: Vue.ls.get(USER_INFO).orgCode,
supplierList: [],
tableData: [],
dataShow: false,
arrange: false,
classifyData: [],
classSupplier: [],
selectedSuppliers: '',
classFood: [],
selectedFoods: [],
poenNmber: '',
QRcode: '',
}
},
computed: {
getPurchaseSupplier: function () {
return `${window._CONFIG['domianURL']}/${this.url.getPurchaseSupplier}`;
},
getdata: function () {
return `${window._CONFIG['domianURL']}/${this.url.getdata}`;
},
receiveNOurl: function () {
return `${window._CONFIG['domianURL']}/${this.url.receiveNOurl}`;
},
editUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.editUrl}`;
},
finshUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.finshUrl}`;
},
},
created() {
this.getSupplierData();
this.getTableData();
},
methods: {
finish(item) {
let newItem = Object.assign({}, item);
newItem.procurementContent = JSON.stringify(newItem.procurementContent);
if (newItem.supplierSelection != null && newItem.supplierSelection != '') {
newItem.supplierSelection = JSON.stringify(newItem.supplierSelection);
} else {
newItem.supplierSelection = '';
}
// procurementLog
newItem.procurementLog = {
'0': newItem.supplierSelection
}
newItem.procurementLog = JSON.stringify(newItem.procurementLog);
//newItemrequirementNumberassociationNumber
newItem.associationNumber = newItem.requirementNumber;
postAction(this.finshUrl, newItem).then(res => {
//200
if (res.code == 200) {
this.$message.success('完成订单成功');
this.getTableData();
} else {
this.$message.error(res.message);
}
})
},
getSupplierData() {
getAction(this.getPurchaseSupplier).then(res => {
//200
if (res.code == 200) {
this.supplierList = res.result.records;
} else {
this.$message.error(res.message);
}
})
},
getTableData() {
this.dataShow = false;
getAction(this.getdata).then(res => {
//200
if (res.code == 200) {
this.tableData = res.result.records;
//
if (this.tableData.length == 0) {
this.dataShow = false;
} else {
this.activeKey = [''];
//
this.tableData.forEach(item => {
item.procurementContent = JSON.parse(item.procurementContent);
});
//supplierSelection
this.tableData.forEach(item => {
if (item.supplierSelection != null && item.supplierSelection != '') {
item.supplierSelection = JSON.parse(item.supplierSelection);
}
});
this.dataShow = true;
}
} else {
this.$message.error(res.message);
}
})
},
receiveNO(item) {
//item
let newItem = Object.assign({}, item);
newItem.procurementContent = JSON.stringify(newItem.procurementContent);
newItem.supplierSelection = JSON.stringify(newItem.supplierSelection);
postAction(this.receiveNOurl, newItem).then(res => {
//200
if (res.code == 200) {
this.$message.success('取消成功');
this.getTableData();
} else {
this.$message.error(res.message);
}
})
},
Refresh() {
this.getSupplierData();
this.getTableData();
},
downloadFile(text) {
if (!text) {
this.$message.warning("未知的文件")
return;
}
if (text.indexOf(",") > 0) {
text = text.substring(0, text.indexOf(","))
}
let url = this.getFileAccessHttpUrl(text)
window.open(url);
},
getFileAccessHttpUrl(avatar, subStr) {
if (!subStr) subStr = 'http'
try {
if (avatar && avatar.startsWith(subStr)) {
return avatar;
} else {
if (avatar && avatar.length > 0 && avatar.indexOf('[') == -1) {
return window._CONFIG['staticDomainURL'] + "/" + avatar;
}
}
} catch (err) {
return;
}
},
generateOrder(item) {
this.$message.success('生成订单成功');
},
//
arrangeOk() {
this.classifyData.forEach((item, index) => {
//itemgoods
item.goods.forEach((item2, index2) => {
//
let flag1 = item2.name == null || item2.name == '' || item2.name == undefined;
let flag2 = item2.number == null || item2.number == '' || item2.number == undefined;
let flag3 = item2.unit == null || item2.unit == '' || item2.unit == undefined;
if (flag1 && flag2 && flag3) {
item.goods.splice(index2, 1);
}
});
});
let data = {
associationNumber: this.poenNmber,
supplierSelection: JSON.stringify(this.classifyData),
}
if (data.supplierSelection == '[]') {
data.supplierSelection = '';
}
postAction(this.editUrl, data).then(res => {
if (res.code == 200) {
this.$message.success('整理成功');
this.arrange = false;
this.getTableData();
//
this.classifyData = [];
this.classSupplier = [];
this.classFood = [];
this.selectedSuppliers = '';
this.selectedFoods = [];
this.poenNmber = '';
} else {
this.$message.error(res.message);
}
})
},
//
arrangeCancel() {
this.arrange = false;
//
this.classifyData = [];
this.classSupplier = [];
this.classFood = [];
this.selectedSuppliers = '';
this.selectedFoods = [];
this.poenNmber = '';
},
//,
arrangeOpen(item) {
//
this.classifyData = [];
this.classSupplier = [];
this.supplierList.forEach(item => {
this.classSupplier.push({
id: item.id,
name: item.name,
});
});
this.classSupplier = Object.assign([], this.classSupplier);
//
this.classFood = Object.assign([], item.procurementContent);
this.poenNmber = item.requirementNumber;
//supplierSelectionnull
if (item.supplierSelection == null || item.supplierSelection == '') {
this.arrange = true;
}
else {
//
let newData = JSON.parse(JSON.stringify(item.supplierSelection))
//classSupplier
newData.forEach(item => {
this.classSupplier.forEach((item2, index2) => {
if (item2.id == item.supplierID) {
this.classSupplier.splice(index2, 1);
}
});
});
//classifyData
this.classifyData = JSON.parse(JSON.stringify(newData))
this.arrange = true;
}
},
//
delSupplier(item) {
//IDclassifyData
this.classifyData.forEach((item2, index2) => {
if (item2.supplierID == item.supplierID) {
this.classifyData.splice(index2, 1);
}
});
//classSupplier
this.classSupplier.push({
id: item.supplierID,
name: item.supplier,
});
},
addSupplier() {
//
if (this.selectedSuppliers == '') {
this.$message.warning('请选择供应商');
return;
}
let selectedID = this.selectedSuppliers;
let selectedSupplier = {};
this.classSupplier.forEach((item, index) => {
if (item.id == selectedID) {
selectedSupplier = Object.assign({}, item);
this.classSupplier.splice(index, 1);
}
});
this.classifyData.push({
supplierID: selectedSupplier.id,
supplier: selectedSupplier.name,
goods: [{
name: '',
number: '',
unit: '',
}
],
});
//
this.selectedSuppliers = '';
},
addRow(item, index) {
this.classifyData[index].goods.push({
name: '',
number: '',
unit: '',
});
},
removeRow(index1, index2) {
this.classifyData[index1].goods.splice(index2, 1);
},
importFoods(index) {
let selectedFoods = this.selectedFoods;
let selectedGoods = [];
this.classFood.forEach(item => {
selectedFoods.forEach(item2 => {
if (item.name == item2) {
selectedGoods.push(item);
}
});
});
//push
selectedGoods.forEach(item => {
this.classifyData[index].goods.push({
name: item.name,
number: item.number,
unit: item.unit,
});
});
this.selectedFoods = [];
},
GenerateQRcode(item) {
this.QRvis = true;
}
},
}
</script>
<style></style>

View File

@ -0,0 +1,184 @@
<template>
<a-card title="采购进程" :bordered="false">
<a-collapse v-model:activeKey="activeKey" accordion>
<a-collapse-panel v-for="(item, index) in dataList" :key="index.toString()">
<template slot="header">
<div style="font-size: 18px; font-weight: bold;">
采购订单号:HL-{{ item.reqirementNumber }}
</div>
</template>
<a-timeline mode="alternate">
<a-timeline-item>
物品整理完毕开始采购
<a-button @click="see(item.procurementLog[0])">查看详情</a-button>
</a-timeline-item>
<a-timeline-item v-for="(item2, index2) in item.procurementLog" :key="index2.toString()" v-if="index2 > 0">
{{ item2 }}
</a-timeline-item>
<a-timeline-item v-if="item.isDone == 1">
采购结束
</a-timeline-item>
</a-timeline>
<div v-if="item.isDone == 0">
<a-button type="primary" style="float: right;margin-bottom: 10px;margin-left: 10px;"
@click="addLog(item)">添加日志</a-button>
<a-button type="primary" style="float: right;margin-bottom: 10px;" @click="endLog(item)">采购结束</a-button>
</div>
<div v-if="item.isDone == 1&&item.qualityIsPass == 0">
<a-button type="primary" style="float: right;margin-bottom: 10px;" @click="end(item)">完成质检</a-button>
</div>
<div v-if="item.isDone == 1&&item.qualityIsPass == 1">
<a-button type="primary" style="float: center;margin-bottom: 10px;" disabled>已完成质检</a-button>
</div>
</a-collapse-panel>
</a-collapse>
<a-modal v-model="seeModal" title="整理详情" width="800px" @ok="seeModal = false" @cancel="seeModal = false">
<a-card style="margin-top: 20px;margin-right: 20px;" v-for="(item2, index2) in supplierSelection"
:key="index2.toString()">
<template #title>
{{ item2.supplier }}
</template>
<div v-for="(item3, index3) in item2.goods" :key="index3.toString()">
<a-row :gutter="16" style="margin-top: 5px;">
<a-col :span="8">
<a-input v-model="item3.name" placeholder="物品名称" disabled />
</a-col>
<a-col :span="6">
<a-input v-model="item3.number" placeholder="数量" disabled />
</a-col>
<a-col :span="6">
<a-input v-model="item3.unit" placeholder="单位" disabled />
</a-col>
</a-row>
</div>
</a-card>
</a-modal>
<a-modal v-model="logModal" title="新增日志" width="800px" @ok="addLogText()" @cancel="logModal = false">
<a-textarea v-model="log" :autosize="{ minRows: 4, maxRows: 8 }" />
</a-modal>
</a-card>
</template>
<script>
import { getAction, postAction } from '@/api/manage'
export default {
data() {
return {
dataList: [],
url: {
list: "/Try/procurementProgress/list",
edit: "/Try/procurementProgress/edit",
},
activeKey: [''],
supplierSelection: [],
seeModal: false,
logModal: false,
log: '',
addData: {}
}
},
created() {
this.getData()
},
computed: {
list: function () {
return `${window._CONFIG['domianURL']}/${this.url.list}`;
},
edit: function () {
return `${window._CONFIG['domianURL']}/${this.url.edit}`;
},
},
methods: {
getData() {
getAction(this.list, {}).then(res => {
let dataList = res.result.records
dataList.forEach(element => {
let Log = JSON.parse(element.procurementLog)
element.procurementLog = Log
})
this.dataList = Object.assign({}, dataList)
console.log(this.dataList)
})
},
see(item) {
this.supplierSelection = item
this.seeModal = true
},
addLog(item) {
this.logModal = true
this.log = ''
this.addData = Object.assign({}, item)
},
addLogText() {
//procurementLog.index
let index = 0
for (const key in this.addData.procurementLog)
if (this.addData.procurementLog.hasOwnProperty(key))
index = key
index = parseInt(index) + 1
//addData
const date = new Date()
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
let currentTime = `${year}-${month}-${day} ${hour}:${minute}:${second}`
this.log = currentTime + ' ' + this.log
this.addData.procurementLog[index] = this.log
//dataJSON
this.addData.procurementLog = JSON.stringify(this.addData.procurementLog)
postAction(this.edit, this.addData).then(res => {
if (res.success) {
this.$message.success(res.message)
this.getData()
} else {
this.$message.error(res.message)
}
})
this.getData()
this.logModal = false
},
endLog(item) {
//isDone1
this.addData = Object.assign({}, item)
this.addData.isDone = 1
//dataJSON
this.addData.procurementLog = JSON.stringify(this.addData.procurementLog)
postAction(this.edit, this.addData).then(res => {
if (res.success) {
this.$message.success(res.message)
this.getData()
} else {
this.$message.error(res.message)
}
})
},
end(item) {
this.addData = Object.assign({}, item)
this.addData.qualityIsPass = 1
//dataJSON
this.addData.procurementLog = JSON.stringify(this.addData.procurementLog)
postAction(this.edit, this.addData).then(res => {
if (res.success) {
this.$message.success(res.message)
this.getData()
} else {
this.$message.error(res.message)
}
})
}
}
}
</script>

View File

@ -0,0 +1,137 @@
<template>
<a-card title="订单接收" :bordered="false">
<template #extra>
<a-button type="primary" @click="getdata()">刷新</a-button>
</template>
<a-collapse v-model:activeKey="activeKey" accordion v-if="dataShow">
<a-collapse-panel v-for="(item, index) in dataList" :key="index.toString()">
<template slot="header">
<div style="font-size: 18px; font-weight: bold;">
采购订单号:HL-{{ item.requirementNumber }} &nbsp;&nbsp;部门:{{ item.sysOrgCode }}
&nbsp;&nbsp;采购方向:{{ item.procurementDirection }}
<a-button style="float: right;" @click="receiveData(item)">接收</a-button>
</div>
</template>
<div>
<a-descriptions title="订单详情" bordered>
<a-descriptions-item label="申请人">{{ item.createBy_dictText }}</a-descriptions-item>
<a-descriptions-item label="申请时间">{{ item.createTime }}</a-descriptions-item>
<a-descriptions-item label="申请部门">{{ item.sysOrgCode }}</a-descriptions-item>
<a-descriptions-item label="采购类型">{{ item.procurementCategory_dictText }}</a-descriptions-item>
<a-descriptions-item label="采购预算" :span="3">{{ item.procurementBudget }}</a-descriptions-item>
<a-descriptions-item label="审批人" :span="3">{{ item.approvedBy_dictText }}</a-descriptions-item>
<a-descriptions-item label="采购详情">
<div v-for="(item2, index2) in item.procurementContent" :key="index2.toString()">
<a-row>
<a-col :span="2">{{ item2.name }}</a-col>
<a-col :span="2">{{ item2.number }}{{ item2.unit }}</a-col>
</a-row>
</div>
</a-descriptions-item>
</a-descriptions>
</div>
</a-collapse-panel>
</a-collapse>
<a-empty v-else>
<template #description>
<span>
订单为空
</span>
</template>
</a-empty>
<a-modal title="填写接收备注" :visible="receive" @ok="receiveOk" @cancel="receiveCancel">
<a-textarea v-model="auditResults" placeholder="请输入接收备注" />
</a-modal>
</a-card>
</template>
<script>
import { getAction, postAction } from '@/api/manage'
import { USER_INFO } from "@/store/mutation-types"
import Vue from 'vue'
export default {
name: 'PurchaseOrderConfirmationList',
data() {
return {
description: '采购订单确认管理页面',
dataList: [],
activeKey: [],
url: {
list: "/Try/purchaseRequest/waitForReceiveList",
acceptReceiving: "Try/purchaseOrderConfirmation/acceptReceiving",
},
receive: false,
tempNO: '',
auditResults: '',
username: Vue.ls.get(USER_INFO).username,
sysOrgCode: Vue.ls.get(USER_INFO).orgCode,
dataShow: false,
}
},
computed: {
list: function () {
return `${window._CONFIG['domianURL']}/${this.url.list}`;
},
acceptReceiving: function () {
return `${window._CONFIG['domianURL']}/${this.url.acceptReceiving}`;
}
},
created() {
this.getdata();
},
methods: {
receiveData(item) {
this.tempNO = item.requirementNumber;
this.receive = true;
},
receiveOk() {
let data = {
associationNumber: this.tempNO,
receiver: this.username,
notes: this.auditResults,
receivingTime: new Date(),
}
postAction(this.acceptReceiving, data).then(res => {
//200
if (res.code == 200) {
this.$message.success('接收成功');
this.getdata();
} else {
this.$message.error(res.message);
}
})
this.receive = false;
},
receiveCancel() {
this.receive = false;
},
getdata() {
this.dataShow = false;
getAction(this.list, {}).then(res => {
//200
if (res.code == 200) {
this.dataList = res.result.records;
if (this.dataList.length == 0) {
this.dataShow = false;
} else {
this.activeKey = [''];
//procurementContentjson
this.dataList.forEach(item => {
item.procurementContent = JSON.parse(item.procurementContent);
});
this.dataShow = true;
console.log(this.dataList);
}
} else {
this.$message.error(res.message);
}
})
}
}
}
</script>

View File

@ -0,0 +1,290 @@
<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-dict-select-tag placeholder="请选择审批状态" v-model="queryParam.demandStatus"
dictCode="procurement_approval_status" />
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="采购类别">
<j-dict-select-tag placeholder="请选择审批状态" v-model="queryParam.procurementCategory"
dictCode="purchasing_categories" />
</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 -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<!-- 高级查询区域 -->
<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, record, index">
<a-button @click="handleButtonClick(record)">详情</a-button>
</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" v-if="record.demandStatus == 3">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
<a-divider type="vertical" v-if="record.demandStatus == 3" />
<a-button type="primary" v-if="record.demandStatus == 3" @click="reSubmit(record)">重新提交</a-button>
</span>
<span v-else-if="record.demandStatus == 2">
<a>已通过申请不可修改</a>
</span>
<span v-else-if="record.demandStatus == 1">
<a>审核中不可修改</a>
</span>
</a-table>
</div>
<a-modal title="采购内容详情" :visible="see" @ok="handleOk" @cancel="handleOk">
<a-table :columns="contentColumns" :dataSource="content" rowKey="name"></a-table>
</a-modal>
<purchase-request-modal ref="modalForm" @ok="modalFormOk"></purchase-request-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import PurchaseRequestModal from './modules/PurchaseRequestModal.vue'
import { postAction } from '@/api/manage'
export default {
name: 'PurchaseRequestList',
mixins: [JeecgListMixin, mixinDevice],
components: {
PurchaseRequestModal
},
data() {
return {
description: '采购表管理页面',
//
columns: [
{
title: '审批状态',
align: "center",
dataIndex: 'demandStatus_dictText'
},
{
title: '审批人',
align: "center",
dataIndex: 'approvedBy_dictText'
},
{
title: '审核结果',
align: "center",
dataIndex: 'auditResults'
},
{
title: '需求编号',
align: "center",
dataIndex: 'requirementNumber',
customRender: (text, record, index) => {
//
if (text == null || text == '') {
return ''
}
return 'HL-' + text
}
},
{
title: '申请日期',
align: "center",
dataIndex: 'createTime'
},
{
title: '采购类别',
align: "center",
dataIndex: 'procurementCategory_dictText',
customRender: (text, record, index) => {
//
if (text == null || text == '') {
return ''
}
return 'HL-' + text
}
},
{
title: '采购方向',
align: "center",
dataIndex: 'procurementDirection',
},
{
title: '采购内容',
align: 'center',
dataIndex: 'procurementContent',
scopedSlots: { customRender: 'htmlSlot' }
},
{
title: '采购预算',
align: "center",
dataIndex: 'procurementBudget'
},
{
title: '附件',
align: "center",
dataIndex: 'annex',
scopedSlots: { customRender: 'fileSlot' }
},
{
title: '操作',
dataIndex: 'action',
align: "center",
fixed: "right",
width: 147,
scopedSlots: { customRender: 'action' }
}
],
see: false,
url: {
list: "/Try/purchaseRequest/selfList",
delete: "/Try/purchaseRequest/delete",
deleteBatch: "/Try/purchaseRequest/deleteBatch",
exportXlsUrl: "/Try/purchaseRequest/exportXls",
importExcelUrl: "Try/purchaseRequest/importExcel",
reSubmit: "/Try/purchaseRequest/reSubmit",
},
content: [
{
name: '',
number: '',
},
],
contentColumns: [
{
title: '名称',
dataIndex: 'name',
key: 'name',
width: 200
},
{
title: '数量',
dataIndex: 'number',
key: 'number',
width: 80
},
{
title: '单位',
dataIndex: 'unit',
key: 'unit',
width: 80
}
],
dictOptions: {},
superFieldList: [],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.reSubmit}`;
},
},
methods: {
initDictConfig() {
},
handleOk() {
this.see = false
},
handleButtonClick(record) {
this.see = true
if (record.procurementContent == null || record.procurementContent == '') {
this.content = {
name: '',
number: '',
}
} else {
this.content = JSON.parse(record.procurementContent)
}
},
getSuperFieldList() {
let fieldList = [];
fieldList.push({ type: 'sel_user', value: 'createBy', text: '申请人' })
fieldList.push({ type: 'datetime', value: 'createTime', text: '申请日期' })
fieldList.push({ type: 'string', value: 'requirementNumber', text: '需求编号', dictCode: '' })
fieldList.push({ type: 'string', value: 'sysOrgCode', text: '申请部门', dictCode: '' })
fieldList.push({ type: 'int', value: 'demandStatus', text: '审批状态', dictCode: 'procurement_approval_status' })
fieldList.push({ type: 'sel_user', value: 'updateBy', text: '审批人' })
fieldList.push({ type: 'datetime', value: 'updateTime', text: '更新日期' })
fieldList.push({ type: 'int', value: 'procurementCategory', text: '采购类别', dictCode: 'purchasing_categories' })
fieldList.push({ type: 'string', value: 'procurementDirection', text: '采购方向', dictCode: '' })
fieldList.push({ type: 'Text', value: 'procurementContent', text: '采购内容', dictCode: '' })
fieldList.push({ type: 'string', value: 'procurementBudget', text: '采购预算', dictCode: '' })
fieldList.push({ type: 'string', value: 'annex', text: '附件', dictCode: '' })
fieldList.push({ type: 'Text', value: 'auditResults', text: '审核结果', dictCode: '' })
this.superFieldList = fieldList
},
reSubmit(record) {
postAction(this.url.reSubmit, record).then(res => {
if (res.success) {
this.$message.success('重新提交成功');
this.loadData();
} else {
this.$message.error(res.message);
}
})
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

View File

@ -0,0 +1,202 @@
<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="procurementCategory">
<j-dict-select-tag type="list" v-model="model.procurementCategory" dictCode="purchasing_categories"
placeholder="请选择采购类别" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="采购方向" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="procurementDirection">
<a-input v-model="model.procurementDirection" placeholder="请输入采购方向"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="采购内容" :labelCol="labelCol" :wrapperCol="wrapperCol">
<!-- 循环渲染 content 数组中的每个对象 -->
<div v-for="(item, index) in content" :key="index">
<a-row :gutter="16">
<a-col :span="8">
<a-input v-model="item.name" placeholder="物品名称" />
</a-col>
<a-col :span="6">
<a-input v-model="item.number" placeholder="数量" />
</a-col>
<a-col :span="6">
<a-input v-model="item.unit" placeholder="单位" />
</a-col>
<a-col :span="2">
<!-- 通过点击按钮触发新增行 -->
<a-icon type="plus-circle" @click="addRow(index)" />
</a-col>
<a-col :span="2">
<!-- 通过点击按钮触发删除行 -->
<a-icon type="minus-circle" @click="removeRow(index)" />
</a-col>
</a-row>
</div>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="采购预算" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="procurementBudget">
<a-input v-model="model.procurementBudget" placeholder="请输入采购预算"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="附件" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="annex">
<j-upload v-model="model.annex"></j-upload>
</a-form-model-item>
</a-col>
<a-col :span="24" style="display:none">
<a-form-model-item label="申请人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="annex">
<j-upload v-model="model.createBy"></j-upload>
</a-form-model-item>
</a-col>
<a-col :span="24" style="display:none">
<a-form-model-item label="申请部门" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="annex">
<j-upload v-model="model.sysOrgCode"></j-upload>
</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 { USER_INFO } from "@/store/mutation-types"
import Vue from 'vue'
export default {
name: 'PurchaseRequestForm',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data() {
return {
model: {
createBy: Vue.ls.get(USER_INFO).username,
sysOrgCode: Vue.ls.get(USER_INFO).orgCode,
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
procurementCategory: [
{ required: true, message: '请输入采购类别!' },
],
procurementDirection: [
{ required: true, message: '请输入采购方向!' },
],
procurementContent: [
{ required: true, message: '请输入采购内容!' },
],
procurementBudget: [
{ required: true, message: '请输入采购预算!' },
],
},
url: {
add: "/Try/purchaseRequest/add",
edit: "/Try/purchaseRequest/edit",
queryById: "/Try/purchaseRequest/queryById",
},
content: [
{
name: '',
number: '',
unit: '',
},
]
}
},
computed: {
formDisabled() {
return this.disabled
},
},
created() {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add() {
this.edit(this.modelDefault);
},
addRow(index) {
this.content.splice(index + 1, 0, {
name: '',
number: '',
unit: '',
});
},
//
removeRow(index) {
//
if (this.content.length === 1) {
return;
}
this.content.splice(index, 1);
},
edit(record) {
this.model = Object.assign({}, record);
//procurementContent
console.log(this.model.procurementContent)
if (this.model.procurementContent != undefined && this.model.procurementContent != null) {
this.content = JSON.parse(this.model.procurementContent);
}
console.log(this.content)
this.visible = true;
},
submitForm() {
//contentJSONmodel.procurementContent
this.model.procurementContent = JSON.stringify(this.content);
//
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>

View File

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<purchase-request-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></purchase-request-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 PurchaseRequestForm from './PurchaseRequestForm.vue'
export default {
name: 'PurchaseRequestModal',
components: {
PurchaseRequestForm
},
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>

View File

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<purchase-request-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></purchase-request-form>
</j-modal>
</template>
<script>
import PurchaseRequestForm from './PurchaseRequestForm.vue'
export default {
name: 'PurchaseRequestModal',
components: {
PurchaseRequestForm
},
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>

View File

@ -0,0 +1,288 @@
<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-select-user-by-dep placeholder="请选择领用人" v-model="queryParam.recipient"/>
</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 -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('家具信息表')">导出</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>
<rms-furniture-modal ref="modalForm" @ok="modalFormOk"></rms-furniture-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import RmsFurnitureModal from './modules/RmsFurnitureModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
export default {
name: 'RmsFurnitureList',
mixins:[JeecgListMixin, mixinDevice],
components: {
RmsFurnitureModal
},
data () {
return {
description: '家具信息表管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'领用单位号',
align:"center",
dataIndex: 'collectingUnitNumber_dictText'
},
{
title:'家具编号',
align:"center",
dataIndex: 'furnitureNumber'
},
{
title:'家具名称',
align:"center",
dataIndex: 'furnitureName'
},
{
title:'分类号',
align:"center",
dataIndex: 'categoryId'
},
{
title:'型号',
align:"center",
dataIndex: 'model'
},
{
title:'规格',
align:"center",
dataIndex: 'specifications'
},
{
title:'数量',
align:"center",
dataIndex: 'number'
},
{
title:'单价',
align:"center",
dataIndex: 'unitPrice'
},
{
title:'金额',
align:"center",
dataIndex: 'amount'
},
{
title:'厂家',
align:"center",
dataIndex: 'manufactuer'
},
{
title:'购置日期',
align:"center",
dataIndex: 'purchaseDate',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
}
},
{
title:'领用人',
align:"center",
dataIndex: 'recipient_dictText'
},
{
title:'单据号',
align:"center",
dataIndex: 'documentNumber'
},
{
title:'存放地id',
align:"center",
dataIndex: 'locationId'
},
{
title:'备注',
align:"center",
dataIndex: 'note'
},
{
title:'审核状态',
align:"center",
dataIndex: 'approvalStatus_dictText'
},
{
title:'初审状态',
align:"center",
dataIndex: 'initialAudit_dictText'
},
{
title:'使用年限',
align:"center",
dataIndex: 'usageYears'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/rms/rmsFurniture/list",
delete: "/rms/rmsFurniture/delete",
deleteBatch: "/rms/rmsFurniture/deleteBatch",
exportXlsUrl: "/rms/rmsFurniture/exportXls",
importExcelUrl: "rms/rmsFurniture/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'sel_depart',value:'collectingUnitNumber',text:'领用单位号'})
fieldList.push({type:'string',value:'furnitureNumber',text:'家具编号',dictCode:''})
fieldList.push({type:'string',value:'furnitureName',text:'家具名称',dictCode:''})
fieldList.push({type:'string',value:'categoryId',text:'分类号',dictCode:''})
fieldList.push({type:'string',value:'model',text:'型号',dictCode:''})
fieldList.push({type:'string',value:'specifications',text:'规格',dictCode:''})
fieldList.push({type:'string',value:'number',text:'数量',dictCode:''})
fieldList.push({type:'string',value:'unitPrice',text:'单价',dictCode:''})
fieldList.push({type:'string',value:'amount',text:'金额',dictCode:''})
fieldList.push({type:'string',value:'manufactuer',text:'厂家',dictCode:''})
fieldList.push({type:'date',value:'purchaseDate',text:'购置日期'})
fieldList.push({type:'sel_user',value:'recipient',text:'领用人'})
fieldList.push({type:'string',value:'documentNumber',text:'单据号',dictCode:''})
fieldList.push({type:'string',value:'locationId',text:'存放地id',dictCode:''})
fieldList.push({type:'string',value:'note',text:'备注',dictCode:''})
fieldList.push({type:'string',value:'approvalStatus',text:'审核状态',dictCode:'approval_status'})
fieldList.push({type:'string',value:'initialAudit',text:'初审状态',dictCode:'initial_audit'})
fieldList.push({type:'string',value:'usageYears',text:'使用年限',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

View File

@ -0,0 +1,189 @@
<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="collectingUnitNumber">
<j-select-depart v-model="model.collectingUnitNumber" :multi="true" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="家具编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="furnitureNumber">
<a-input v-model="model.furnitureNumber" placeholder="请输入家具编号" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="家具名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="furnitureName">
<a-input v-model="model.furnitureName" placeholder="请输入家具名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="分类号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="categoryId">
<a-input v-model="model.categoryId" placeholder="请输入分类号" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="型号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="model">
<a-input v-model="model.model" 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="number">
<a-input v-model="model.number" placeholder="请输入数量" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="单价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="unitPrice">
<a-input v-model="model.unitPrice" placeholder="请输入单价" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="金额" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="amount">
<a-input v-model="model.amount" placeholder="请输入金额" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="厂家" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="manufactuer">
<a-input v-model="model.manufactuer" placeholder="请输入厂家" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="购置日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="purchaseDate">
<j-date placeholder="请选择购置日期" v-model="model.purchaseDate" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="领用人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="recipient">
<j-select-user-by-dep v-model="model.recipient" :multi="true" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="单据号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="documentNumber">
<a-input v-model="model.documentNumber" placeholder="请输入单据号" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="存放地id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="locationId">
<a-input v-model="model.locationId" placeholder="请输入存放地id" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="note">
<a-input v-model="model.note" placeholder="请输入备注" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="审核状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="approvalStatus">
<j-dict-select-tag type="radio" v-model="model.approvalStatus" dictCode="approval_status" placeholder="请选择审核状态" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="初审状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="initialAudit">
<j-dict-select-tag type="radio" v-model="model.initialAudit" dictCode="initial_audit" placeholder="请选择初审状态" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="使用年限" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="usageYears">
<a-input v-model="model.usageYears" 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: 'RmsFurnitureForm',
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: "/rms/rmsFurniture/add",
edit: "/rms/rmsFurniture/edit",
queryById: "/rms/rmsFurniture/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
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>

View File

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<rms-furniture-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></rms-furniture-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 RmsFurnitureForm from './RmsFurnitureForm'
export default {
name: 'RmsFurnitureModal',
components: {
RmsFurnitureForm
},
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>

View File

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<rms-furniture-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></rms-furniture-form>
</j-modal>
</template>
<script>
import RmsFurnitureForm from './RmsFurnitureForm'
export default {
name: 'RmsFurnitureModal',
components: {
RmsFurnitureForm
},
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>

View File

@ -0,0 +1,285 @@
<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-select-user-by-dep placeholder="请选择领用人" v-model="queryParam.recipient"/>
</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 -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('仪器信息表')">导出</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>
<rms-instrument-modal ref="modalForm" @ok="modalFormOk"></rms-instrument-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import RmsInstrumentModal from './modules/RmsInstrumentModal'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
export default {
name: 'RmsInstrumentList',
mixins:[JeecgListMixin, mixinDevice],
components: {
RmsInstrumentModal
},
data () {
return {
description: '仪器信息表管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'领用单位号',
align:"center",
dataIndex: 'collectingUnitNumber_dictText'
},
{
title:'仪器编号',
align:"center",
dataIndex: 'instrumentNumber'
},
{
title:'仪器名称',
align:"center",
dataIndex: 'instrumentName'
},
{
title:'分类号',
align:"center",
dataIndex: 'categoryId'
},
{
title:'型号',
align:"center",
dataIndex: 'model'
},
{
title:'规格',
align:"center",
dataIndex: 'specifications'
},
{
title:'单价',
align:"center",
dataIndex: 'unitPrice'
},
{
title:'厂家',
align:"center",
dataIndex: 'manufactuer'
},
{
title:'购置日期',
align:"center",
dataIndex: 'purchasedate',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
}
},
{
title:'领用人',
align:"center",
dataIndex: 'recipient_dictText'
},
{
title:'入库时间',
align:"center",
dataIndex: 'entryDate',
customRender:function (text) {
return !text?"":(text.length>10?text.substr(0,10):text)
}
},
{
title:'单据号',
align:"center",
dataIndex: 'documentNumber'
},
{
title:'存放地id',
align:"center",
dataIndex: 'locationId'
},
{
title:'备注',
align:"center",
dataIndex: 'note'
},
{
title:'审核状态',
align:"center",
dataIndex: 'approvalStatus_dictText'
},
{
title:'初审状态',
align:"center",
dataIndex: 'initialAudit_dictText'
},
{
title:'ID',
align:"center",
dataIndex: 'instrumentId'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/rms/rmsInstrument/list",
delete: "/rms/rmsInstrument/delete",
deleteBatch: "/rms/rmsInstrument/deleteBatch",
exportXlsUrl: "/rms/rmsInstrument/exportXls",
importExcelUrl: "rms/rmsInstrument/importExcel",
},
dictOptions:{},
superFieldList:[],
}
},
created() {
this.getSuperFieldList();
},
computed: {
importExcelUrl: function(){
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'sel_depart',value:'collectingUnitNumber',text:'领用单位号'})
fieldList.push({type:'string',value:'instrumentNumber',text:'仪器编号',dictCode:''})
fieldList.push({type:'string',value:'instrumentName',text:'仪器名称',dictCode:''})
fieldList.push({type:'string',value:'categoryId',text:'分类号',dictCode:''})
fieldList.push({type:'string',value:'model',text:'型号',dictCode:''})
fieldList.push({type:'string',value:'specifications',text:'规格',dictCode:''})
fieldList.push({type:'string',value:'unitPrice',text:'单价',dictCode:''})
fieldList.push({type:'string',value:'manufactuer',text:'厂家',dictCode:''})
fieldList.push({type:'date',value:'purchasedate',text:'购置日期'})
fieldList.push({type:'sel_user',value:'recipient',text:'领用人'})
fieldList.push({type:'date',value:'entryDate',text:'入库时间'})
fieldList.push({type:'string',value:'documentNumber',text:'单据号',dictCode:''})
fieldList.push({type:'string',value:'locationId',text:'存放地id',dictCode:''})
fieldList.push({type:'string',value:'note',text:'备注',dictCode:''})
fieldList.push({type:'string',value:'approvalStatus',text:'审核状态',dictCode:'approval_status'})
fieldList.push({type:'string',value:'initialAudit',text:'初审状态',dictCode:'initial_audit'})
fieldList.push({type:'string',value:'instrumentId',text:'ID',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

View File

@ -0,0 +1,184 @@
<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="collectingUnitNumber">
<j-select-depart v-model="model.collectingUnitNumber" :multi="true" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="仪器编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="instrumentNumber">
<a-input v-model="model.instrumentNumber" placeholder="请输入仪器编号" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="仪器名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="instrumentName">
<a-input v-model="model.instrumentName" placeholder="请输入仪器名称" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="分类号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="categoryId">
<a-input v-model="model.categoryId" placeholder="请输入分类号" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="型号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="model">
<a-input v-model="model.model" 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="unitPrice">
<a-input v-model="model.unitPrice" placeholder="请输入单价" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="厂家" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="manufactuer">
<a-input v-model="model.manufactuer" placeholder="请输入厂家" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="购置日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="purchasedate">
<j-date placeholder="请选择购置日期" v-model="model.purchasedate" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="领用人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="recipient">
<j-select-user-by-dep v-model="model.recipient" :multi="true" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="入库时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="entryDate">
<j-date placeholder="请选择入库时间" v-model="model.entryDate" style="width: 100%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="单据号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="documentNumber">
<a-input v-model="model.documentNumber" placeholder="请输入单据号" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="存放地id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="locationId">
<a-input v-model="model.locationId" placeholder="请输入存放地id" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="note">
<a-input v-model="model.note" placeholder="请输入备注" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="审核状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="approvalStatus">
<j-dict-select-tag type="radio" v-model="model.approvalStatus" dictCode="approval_status" placeholder="请选择审核状态" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="初审状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="initialAudit">
<j-dict-select-tag type="radio" v-model="model.initialAudit" dictCode="initial_audit" placeholder="请选择初审状态" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="instrumentId">
<a-input v-model="model.instrumentId" placeholder="请输入ID" ></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: 'RmsInstrumentForm',
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: "/rms/rmsInstrument/add",
edit: "/rms/rmsInstrument/edit",
queryById: "/rms/rmsInstrument/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
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>

View File

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<rms-instrument-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></rms-instrument-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 RmsInstrumentForm from './RmsInstrumentForm'
export default {
name: 'RmsInstrumentModal',
components: {
RmsInstrumentForm
},
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>

View File

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<rms-instrument-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></rms-instrument-form>
</j-modal>
</template>
<script>
import RmsInstrumentForm from './RmsInstrumentForm'
export default {
name: 'RmsInstrumentModal',
components: {
RmsInstrumentForm
},
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>

View File

@ -0,0 +1,177 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</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('存放地表')">导出</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>
<rms-location-modal ref="modalForm" @ok="modalFormOk"></rms-location-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import RmsLocationModal from './modules/RmsLocationModal'
export default {
name: 'RmsLocationList',
mixins:[JeecgListMixin, mixinDevice],
components: {
RmsLocationModal
},
data () {
return {
description: '存放地表管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'存放地id',
align:"center",
dataIndex: 'locationId'
},
{
title:'存放地名称',
align:"center",
dataIndex: 'locationName'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: "/rms/rmsLocation/list",
delete: "/rms/rmsLocation/delete",
deleteBatch: "/rms/rmsLocation/deleteBatch",
exportXlsUrl: "/rms/rmsLocation/exportXls",
importExcelUrl: "rms/rmsLocation/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:'locationId',text:'存放地id',dictCode:''})
fieldList.push({type:'string',value:'locationName',text:'存放地名称',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

View File

@ -0,0 +1,109 @@
<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="存放地id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="locationId">
<a-input v-model="model.locationId" placeholder="请输入存放地id" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="存放地名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="locationName">
<a-input v-model="model.locationName" 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: 'RmsLocationForm',
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: "/rms/rmsLocation/add",
edit: "/rms/rmsLocation/edit",
queryById: "/rms/rmsLocation/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
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>

View File

@ -0,0 +1,84 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="false"
@close="close"
destroyOnClose
:visible="visible">
<rms-location-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></rms-location-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 RmsLocationForm from './RmsLocationForm'
export default {
name: 'RmsLocationModal',
components: {
RmsLocationForm
},
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>

View File

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<rms-location-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></rms-location-form>
</j-modal>
</template>
<script>
import RmsLocationForm from './RmsLocationForm'
export default {
name: 'RmsLocationModal',
components: {
RmsLocationForm
},
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>

View File

@ -0,0 +1,236 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</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('仪器信息表')">导出</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"
bordered
rowKey="id"
class="j-table-force-nowrap"
:scroll="{x:true}"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@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>
<rms-instrument-modal ref="modalForm" @ok="modalFormOk"/>
</a-card>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import RmsInstrumentModal from './modules/RmsInstrumentModal.vue'
import '@/assets/less/TableExpand.less'
export default {
name: "RmsInstrumentList",
mixins:[JeecgListMixin],
components: {
RmsInstrumentModal
},
data () {
return {
description: '仪器信息表管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key:'rowIndex',
width:60,
align:"center",
customRender:function (t,r,index) {
return parseInt(index)+1;
}
},
{
title:'仪器id',
align:"center",
dataIndex: 'instrumentId'
},
{
title:'资产编号',
align:"center",
dataIndex: 'assetNumber'
},
{
title:'单价',
align:"center",
dataIndex: 'unitPrice'
},
{
title:'厂家',
align:"center",
dataIndex: 'manufactuer'
},
{
title:'购置日期',
align:"center",
dataIndex: 'purchaseDate'
},
{
title:'入库时间',
align:"center",
dataIndex: 'entryDate'
},
{
title:'单据号',
align:"center",
dataIndex: 'documentNumber'
},
{
title:'存放地id',
align:"center",
dataIndex: 'locationId'
},
{
title:'备注',
align:"center",
dataIndex: 'note'
},
{
title:'领用单位id',
align:"center",
dataIndex: 'unitId'
},
{
title:'领用人',
align:"center",
dataIndex: 'recipient'
},
{
title:'审核状态id',
align:"center",
dataIndex: 'approvalStatusId'
},
{
title: '操作',
dataIndex: 'action',
align:"center",
fixed:"right",
width:147,
scopedSlots: { customRender: 'action' },
}
],
url: {
list: "/rms/rmsInstrument/list",
delete: "/rms/rmsInstrument/delete",
deleteBatch: "/rms/rmsInstrument/deleteBatch",
exportXlsUrl: "/rms/rmsInstrument/exportXls",
importExcelUrl: "rms/rmsInstrument/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:'instrumentId',text:'仪器id',dictCode:''})
fieldList.push({type:'string',value:'assetNumber',text:'资产编号',dictCode:''})
fieldList.push({type:'string',value:'unitPrice',text:'单价',dictCode:''})
fieldList.push({type:'string',value:'manufactuer',text:'厂家',dictCode:''})
fieldList.push({type:'string',value:'purchaseDate',text:'购置日期',dictCode:''})
fieldList.push({type:'string',value:'entryDate',text:'入库时间',dictCode:''})
fieldList.push({type:'string',value:'documentNumber',text:'单据号',dictCode:''})
fieldList.push({type:'string',value:'locationId',text:'存放地id',dictCode:''})
fieldList.push({type:'string',value:'note',text:'备注',dictCode:''})
fieldList.push({type:'string',value:'unitId',text:'领用单位id',dictCode:''})
fieldList.push({type:'string',value:'recipient',text:'领用人',dictCode:''})
fieldList.push({type:'string',value:'approvalStatusId',text:'审核状态id',dictCode:''})
this.superFieldList = fieldList
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

View File

@ -0,0 +1,247 @@
<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="仪器id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="instrumentId">
<a-input v-model="model.instrumentId" placeholder="请输入仪器id" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24" >
<a-form-model-item label="资产编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="assetNumber">
<a-input v-model="model.assetNumber" placeholder="请输入资产编号" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24" >
<a-form-model-item label="单价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="unitPrice">
<a-input v-model="model.unitPrice" placeholder="请输入单价" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24" >
<a-form-model-item label="厂家" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="manufactuer">
<a-input v-model="model.manufactuer" placeholder="请输入厂家" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24" >
<a-form-model-item label="购置日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="purchaseDate">
<a-input v-model="model.purchaseDate" placeholder="请输入购置日期" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24" >
<a-form-model-item label="入库时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="entryDate">
<a-input v-model="model.entryDate" placeholder="请输入入库时间" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24" >
<a-form-model-item label="单据号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="documentNumber">
<a-input v-model="model.documentNumber" placeholder="请输入单据号" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24" >
<a-form-model-item label="存放地id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="locationId">
<a-input v-model="model.locationId" placeholder="请输入存放地id" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24" >
<a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="note">
<a-input v-model="model.note" placeholder="请输入备注" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24" >
<a-form-model-item label="领用单位id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="unitId">
<a-input v-model="model.unitId" placeholder="请输入领用单位id" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24" >
<a-form-model-item label="领用人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="recipient">
<a-input v-model="model.recipient" placeholder="请输入领用人" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24" >
<a-form-model-item label="审核状态id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="approvalStatusId">
<a-input v-model="model.approvalStatusId" placeholder="请输入审核状态id" ></a-input>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
<!-- 子表单区域 -->
<a-tabs v-model="activeKey" @change="handleChangeTabs">
<a-tab-pane tab="资产属性表" :key="refKeys[0]" :forceRender="true">
<j-vxe-table
keep-source
:ref="refKeys[0]"
:loading="rmsAssetAttributesTable.loading"
:columns="rmsAssetAttributesTable.columns"
:dataSource="rmsAssetAttributesTable.dataSource"
:maxHeight="300"
:disabled="formDisabled"
:rowNumber="true"
:rowSelection="true"
:toolbar="true"
/>
</a-tab-pane>
</a-tabs>
</a-spin>
</template>
<script>
import { getAction } from '@/api/manage'
import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js'
import { JVXETypes } from '@/components/jeecg/JVxeTable'
import { getRefPromise,VALIDATE_FAILED} from '@/components/jeecg/JVxeTable/utils/vxeUtils.js'
import { validateDuplicateValue } from '@/utils/util'
import JFormContainer from '@/components/jeecg/JFormContainer'
export default {
name: 'RmsInstrumentForm',
mixins: [JVxeTableModelMixin],
components: {
JFormContainer,
},
data() {
return {
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
model:{
},
//
addDefaultRowNum: 1,
validatorRules: {
},
refKeys: ['rmsAssetAttributes', ],
tableKeys:['rmsAssetAttributes', ],
activeKey: 'rmsAssetAttributes',
//
rmsAssetAttributesTable: {
loading: false,
dataSource: [],
columns: [
{
title: '资产编号',
key: 'assetNumber',
type: JVXETypes.input,
width:"200px",
placeholder: '请输入${title}',
defaultValue:'',
},
{
title: '资产名称',
key: 'assetName',
type: JVXETypes.input,
width:"200px",
placeholder: '请输入${title}',
defaultValue:'',
},
{
title: '分类号',
key: 'cateGoryId',
type: JVXETypes.input,
width:"200px",
placeholder: '请输入${title}',
defaultValue:'',
},
{
title: '型号',
key: 'model',
type: JVXETypes.input,
width:"200px",
placeholder: '请输入${title}',
defaultValue:'',
},
{
title: '规格',
key: 'specifications',
type: JVXETypes.input,
width:"200px",
placeholder: '请输入${title}',
defaultValue:'',
},
]
},
url: {
add: "/rms/rmsInstrument/add",
edit: "/rms/rmsInstrument/edit",
queryById: "/rms/rmsInstrument/queryById",
rmsAssetAttributes: {
list: '/rms/rmsInstrument/queryRmsAssetAttributesByMainId'
},
}
}
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
},
methods: {
addBefore(){
this.rmsAssetAttributesTable.dataSource=[]
},
getAllTable() {
let values = this.tableKeys.map(key => getRefPromise(this, key))
return Promise.all(values)
},
/** 调用完edit()方法之后会自动调用此方法 */
editAfter() {
this.$nextTick(() => {
})
//
if (this.model.id) {
let params = { id: this.model.id }
this.requestSubTableData(this.url.rmsAssetAttributes.list, params, this.rmsAssetAttributesTable)
}
},
//
validateSubForm(allValues){
return new Promise((resolve,reject)=>{
Promise.all([
]).then(() => {
resolve(allValues)
}).catch(e => {
if (e.error === VALIDATE_FAILED) {
// tab
this.activeKey = e.index == null ? this.activeKey : this.refKeys[e.index]
} else {
console.error(e)
}
})
})
},
/** 整理成formData */
classifyIntoFormData(allValues) {
let main = Object.assign(this.model, allValues.formValue)
return {
...main, //
rmsAssetAttributesList: allValues.tablesValue[0].tableData,
}
},
validateError(msg){
this.$message.error(msg)
},
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,64 @@
<template>
<j-modal
:title="title"
:width="1200"
:visible="visible"
:maskClosable="false"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel">
<rms-instrument-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"/>
</j-modal>
</template>
<script>
import RmsInstrumentForm from './RmsInstrumentForm.vue'
export default {
name: 'RmsInstrumentModal',
components: {
RmsInstrumentForm
},
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.handleOk();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>
<style scoped>
</style>