| | |
| | | |
| | | <!-- 查询区域 --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-form |
| | | layout="inline" |
| | | @keyup.enter.native="searchQuery" |
| | | > |
| | | <a-row :gutter="24"> |
| | | |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-col |
| | | :xl="6" |
| | | :lg="7" |
| | | :md="8" |
| | | :sm="24" |
| | | > |
| | | <a-form-item label="删除标记"> |
| | | <a-input placeholder="请输入删除标记" v-model="queryParam.delFlag"></a-input> |
| | | <a-input |
| | | placeholder="请输入删除标记" |
| | | v-model="queryParam.delFlag" |
| | | ></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-col |
| | | :xl="6" |
| | | :lg="7" |
| | | :md="8" |
| | | :sm="24" |
| | | > |
| | | <a-form-item label="领用单编码"> |
| | | <a-input placeholder="请输入领用单编码" v-model="queryParam.receiveCode"></a-input> |
| | | <a-input |
| | | placeholder="请输入领用单编码" |
| | | v-model="queryParam.receiveCode" |
| | | ></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <template v-if="toggleSearchStatus"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-col |
| | | :xl="6" |
| | | :lg="7" |
| | | :md="8" |
| | | :sm="24" |
| | | > |
| | | <a-form-item label="领用人"> |
| | | <a-input placeholder="请输入领用人" v-model="queryParam.receiveUser"></a-input> |
| | | <a-input |
| | | placeholder="请输入领用人" |
| | | v-model="queryParam.receiveUser" |
| | | ></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-col |
| | | :xl="6" |
| | | :lg="7" |
| | | :md="8" |
| | | :sm="24" |
| | | > |
| | | <a-form-item label="领用事由"> |
| | | <a-input placeholder="请输入领用事由" v-model="queryParam.receiveReason"></a-input> |
| | | <a-input |
| | | placeholder="请输入领用事由" |
| | | v-model="queryParam.receiveReason" |
| | | ></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-col |
| | | :xl="6" |
| | | :lg="7" |
| | | :md="8" |
| | | :sm="24" |
| | | > |
| | | <a-form-item label="领用状态"> |
| | | <a-input placeholder="请输入领用状态" v-model="queryParam.receiveStatus"></a-input> |
| | | <a-input |
| | | placeholder="请输入领用状态" |
| | | v-model="queryParam.receiveStatus" |
| | | ></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | </template> |
| | | <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> |
| | | <a @click="handleToggleSearch" style="margin-left: 8px"> |
| | | <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> |
| | | <a |
| | | @click="handleToggleSearch" |
| | | style="margin-left: 8px" |
| | | > |
| | | {{ toggleSearchStatus ? '收起' : '展开' }} |
| | | <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> |
| | | </a> |
| | |
| | | |
| | | <!-- 操作按钮区域 --> |
| | | <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-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> |
| | | <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-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> |
| | |
| | | |
| | | <!-- table区域-begin --> |
| | | <div> |
| | | <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
| | | <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> |
| | | <a |
| | | style="margin-left: 24px" |
| | | @click="onClearSelected" |
| | | >清空</a> |
| | | </div> |
| | | |
| | | <a-table |
| | |
| | | :loading="loading" |
| | | class="j-table-force-nowrap" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | @change="handleTableChange"> |
| | | @change="handleTableChange" |
| | | > |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <span |
| | | slot="action" |
| | | slot-scope="text, record" |
| | | > |
| | | <a @click="handleEdit(record)">编辑</a> |
| | | |
| | | <a-divider type="vertical" /> |
| | |
| | | <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> |
| | | <a-popconfirm |
| | | title="确定删除吗?" |
| | | @confirm="() => handleDelete(record.id)" |
| | | > |
| | | <a>删除</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | |
| | | <!-- table区域-end --> |
| | | |
| | | <!-- 表单区域 --> |
| | | <eamSparePartReceive-modal ref="modalForm" @ok="modalFormOk"></eamSparePartReceive-modal> |
| | | <eamSparePartReceive-modal |
| | | ref="modalForm" |
| | | @ok="modalFormOk" |
| | | ></eamSparePartReceive-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | |
| | | type="primary" |
| | | icon="plus" |
| | | >新增</a-button> |
| | | <a-button |
| | | <!-- <a-button |
| | | type="primary" |
| | | icon="download" |
| | | @click="handleExportXls('备件请购单')" |
| | |
| | | type="primary" |
| | | icon="import" |
| | | >导入</a-button> |
| | | </a-upload> |
| | | </a-upload> --> |
| | | </div> |
| | | |
| | | <!-- table区域-begin --> |
| | |
| | | slot="action" |
| | | slot-scope="text, record" |
| | | > |
| | | <a @click="handleOpen(record)">明细</a> |
| | | <a-divider |
| | | v-if="record.requisitionStatus !== '3' && record.requisitionStatus !== '5'" |
| | | type="vertical" |
| | | /> |
| | | <a-dropdown v-if="record.requisitionStatus === '1' || record.requisitionStatus === '4'"> |
| | | <!-- <a @click="handleOpen(record)">明细</a> --> |
| | | <!-- <a |
| | | v-if="record.requisitionStatus === '1'" |
| | | @click="handleConfirm(record)" |
| | | >提交</a> --> |
| | | <a-popconfirm |
| | | v-if="record.requisitionStatus === '1'" |
| | | title="确定提交吗?" |
| | | @confirm="() => handleConfirm(record)" |
| | | > <a>提交</a> |
| | | </a-popconfirm> |
| | | <a-divider type="vertical" /> |
| | | <a-dropdown v-if="record.requisitionStatus === '1'"> |
| | | <a class="ant-dropdown-link">更多 <a-icon type="down" /></a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <!-- <a-menu-item> |
| | | <a @click="handleConfirm(record)">提交</a> |
| | | </a-menu-item> |
| | | </a-menu-item> --> |
| | | <a-menu-item> |
| | | <a @click="handleEdit(record)">编辑</a> |
| | | </a-menu-item> |
| | |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | <a |
| | | <!-- <a |
| | | v-if="record.requisitionStatus === '2'" |
| | | @click="handleExamine(record)" |
| | | >审核</a> |
| | | >审核</a> --> |
| | | </span> |
| | | |
| | | </a-table> |
| | |
| | | @ok="modalFormOk" |
| | | ></eamSparePartRequisition-modal> |
| | | |
| | | <eamSparePartRequisitionExamine-modal |
| | | <!-- <eamSparePartRequisitionExamine-modal |
| | | ref="modalExamine" |
| | | @ok="modalFormOk2" |
| | | ></eamSparePartRequisitionExamine-modal> |
| | | ></eamSparePartRequisitionExamine-modal> --> |
| | | |
| | | </a-card> |
| | | </a-col> |
| | |
| | | :sm="24" |
| | | v-if="this.rightColVal === 1" |
| | | > |
| | | <a-card :bordered="false"> |
| | | <div style="text-align: right;"> |
| | | <a-card |
| | | title="备件请购明细" |
| | | :bordered="false" |
| | | > |
| | | <div style="text-align: left;"> |
| | | <a-icon |
| | | type="close-circle" |
| | | @click="hideSpareDetailList" |
| | | /> |
| | | </div> |
| | | <!-- 查询区域 --> |
| | | <div class="table-page-search-wrapper"> |
| | | <!-- <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline"> |
| | | <a-row :gutter="24"> |
| | | <a-col |
| | |
| | | |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | </div> --> |
| | | |
| | | <!-- 操作按钮区域 --> |
| | | <div |
| | | <!-- <div |
| | | class="table-operator" |
| | | :md="24" |
| | | :sm="24" |
| | |
| | | <a-icon type="down" /> |
| | | </a-button> |
| | | </a-dropdown> |
| | | </div> |
| | | </div> --> |
| | | |
| | | <!-- table区域-begin --> |
| | | <!-- table区域-begin |
| | | <div> |
| | | <div |
| | | class="ant-alert ant-alert-info" |
| | |
| | | style="margin-left: 24px" |
| | | @click="onClearSelected2" |
| | | >清空</a> |
| | | </div> |
| | | </div>--> |
| | | |
| | | <a-table |
| | | style="height:500px" |
| | |
| | | :pagination="iPagination2" |
| | | :loading="loading2" |
| | | class="j-table-force-nowrap" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys2, onChange: onSelectChange2}" |
| | | @change="handleTableChange2" |
| | | > |
| | | <!-- :rowSelection="{selectedRowKeys: selectedRowKeys2, onChange: onSelectChange2}" --> |
| | | |
| | | <span |
| | | slot="action" |
| | |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | |
| | | <!-- table区域-end --> |
| | | </a-card> |
| | | </a-col> |
| | |
| | | <script> |
| | | import '@assets/less/TableExpand.less' |
| | | import EamSparePartRequisitionModal from './modules/EamSparePartRequisition/EamSparePartRequisitionModal.vue' |
| | | import EamSparePartRequisitionExamineModal from './modules/EamSparePartRequisition/EamSparePartRequisitionExamineModal.vue' |
| | | // import EamSparePartRequisitionExamineModal from './modules/EamSparePartRequisition/EamSparePartRequisitionExamineModal.vue' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import { deleteAction, getAction, postAction } from '@api/manage' |
| | | import { filterObj } from '@/utils/util' |
| | |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | EamSparePartRequisitionModal, |
| | | EamSparePartRequisitionExamineModal |
| | | // EamSparePartRequisitionExamineModal |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: '请购单号', |
| | | align: "center", |
| | | dataIndex: 'requisitionCode' |
| | |
| | | // 子表表头 |
| | | columns2: [ |
| | | { |
| | | title: '备品备件ID', |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: '备品编码', |
| | | align: "center", |
| | | dataIndex: 'partId' |
| | | dataIndex: 'partCode' |
| | | }, |
| | | { |
| | | title: '名称', |
| | | align: "center", |
| | | dataIndex: 'partName' |
| | | }, |
| | | { |
| | | title: '型号', |
| | | align: "center", |
| | | dataIndex: 'partModel' |
| | | }, |
| | | { |
| | | title: '请购数量', |
| | | align: "center", |
| | | dataIndex: 'requisitionNum' |
| | | }, |
| | | { |
| | | title: '操作', |
| | | dataIndex: 'action', |
| | | align: "center", |
| | | scopedSlots: { customRender: 'action' }, |
| | | } |
| | | // { |
| | | // title: '操作', |
| | | // dataIndex: 'action', |
| | | // align: "center", |
| | | // scopedSlots: { customRender: 'action' }, |
| | | // } |
| | | ], |
| | | url: { |
| | | list: "/eam/eamSparePartRequisition/list", |
| | |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | }, |
| | | leftColMd() { |
| | | return this.selectedRowKeys1.length === 0 ? 24 : 12 |
| | | return this.selectedRowKeys1.length === 0 ? 24 : 14 |
| | | }, |
| | | rightColMd() { |
| | | return this.selectedRowKeys1.length === 0 ? 0 : 12 |
| | | return this.selectedRowKeys1.length === 0 ? 0 : 10 |
| | | } |
| | | }, |
| | | methods: { |
| | | customRow(record) { |
| | | return { |
| | | on: { |
| | | dblclick: () => { |
| | | click: () => { |
| | | this.handleOpen(record) |
| | | } |
| | | } |
| | |
| | | this.onClearSelected2() |
| | | this.loadData2() |
| | | }, |
| | | |
| | | // handleAdd: function () { |
| | | // // if (this.spareRequisitionId === '') { |
| | | // // this.$message.error('请选择一个请购单!') |
| | | // // } else { |
| | | // // this.$refs.modalForm2.roleDisabled = true |
| | | // this.$refs.sparePartRequisitionModalForm.title = '新增' |
| | | // this.$refs.sparePartRequisitionModalForm.add() |
| | | // // } |
| | | // }, |
| | | searchQuery: function () { |
| | | this.loadData(1) |
| | | this.dataSource2 = [] |
| | | }, |
| | | searchReset: function () { |
| | | this.queryParam = {} |
| | | this.loadData(1) |
| | | this.dataSource2 = [] |
| | | }, |
| | | searchQuery2: function () { |
| | | this.loadData2(1) |
| | | }, |
| | |
| | | onClearSelected2: function () { |
| | | this.selectedRowKeys2 = [] |
| | | this.selectionRows2 = [] |
| | | }, |
| | | loadData(arg) { |
| | | if (!this.url.list) { |
| | | this.$message.error("请设置url.list属性!") |
| | | return |
| | | } |
| | | //加载数据 若传入参数1则加载第一页的内容 |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1; |
| | | } |
| | | var params = this.getQueryParams();//查询条件 |
| | | if (!params) { |
| | | return false; |
| | | } |
| | | this.loading = true; |
| | | getAction(this.url.list, params).then((res) => { |
| | | if (res.success) { |
| | | // console.log(res) |
| | | //update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ |
| | | this.dataSource = res.result.records || res.result; |
| | | if (res.result.total) { |
| | | this.ipagination.total = res.result.total; |
| | | } else { |
| | | this.ipagination.total = 0; |
| | | } |
| | | //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | loadData2: function (arg) { |
| | | if (!this.url.list2) { |
| | |
| | | this.selectionRows1 = [] |
| | | }, |
| | | handleConfirm(record) { |
| | | setTimeout(() => { |
| | | this.loading = true |
| | | }, 100); |
| | | |
| | | if (!this.url.submit) { |
| | | this.$message.error('请设置url.submit属性!') |
| | | return |
| | | } |
| | | var that = this |
| | | this.$confirm({ |
| | | title: '确认提交', |
| | | content: '确定提交吗?', |
| | | onOk: function () { |
| | | // this.$confirm({ |
| | | // title: '确认提交', |
| | | // content: '确定提交吗?', |
| | | // onOk: function () { |
| | | |
| | | postAction(that.url.submit, record).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message) |
| | |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | that.loading = false |
| | | }) |
| | | } |
| | | }) |
| | | // } |
| | | // }) |
| | | this.loading = false |
| | | }, |
| | | handleExamine: function (record) { |
| | | this.$refs.modalExamine.examine(record); |
| | |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: '备件编码', |
| | | align: "center", |
| | | dataIndex: 'partCode' |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="800" |
| | | :width="900" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | switchFullscreen |
| | | centered |
| | | :mask-closable="false" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="关闭" |
| | | > |
| | | |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-spin :spinning="spinning"> |
| | | <a-form-model |
| | | ref="form" |
| | | :model="model" |
| | | :rules="validatorRules" |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | > |
| | | <a-form-model-item |
| | | :labelCol="labelCol" |
| | |
| | | v-model="model.remark" |
| | | /> |
| | | </a-form-model-item> |
| | | <a-row :gutter="24"> |
| | | <j-vxe-table |
| | | ref="editableDetailTable" |
| | | :rowNumber="true" |
| | | :rowSelection="true" |
| | | :bordered="true" |
| | | :alwaysEdit="true" |
| | | :toolbar="true" |
| | | keep-source |
| | | :height="300" |
| | | :loading="detail.loading" |
| | | :dataSource="detail.dataSource" |
| | | :columns="detail.columns" |
| | | style="margin-top: 8px;" |
| | | /> |
| | | </a-row> |
| | | </a-form-model> |
| | | </a-spin> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { httpAction, getAction } from '@api/manage' |
| | | import moment from "moment" |
| | | import { getAction, httpAction } from '@/api/manage' |
| | | import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' |
| | | import { JVXETypes } from '@/components/jeecg/JVxeTable' |
| | | |
| | | export default { |
| | | name: "EamSparePartRequisitionModal", |
| | | name: 'EamSparePartIntoModal', |
| | | mixins: [JVxeTableModelMixin], |
| | | components: {}, |
| | | data() { |
| | | return { |
| | | title: "操作", |
| | | title: '操作', |
| | | visible: false, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | sm: { span: 6 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | sm: { span: 15 } |
| | | }, |
| | | |
| | | confirmLoading: false, |
| | | spinning: false, |
| | | disabled: false, |
| | | validatorRules: {}, |
| | | url: { |
| | | //add: '/eam/eamSparePartInventory/add', |
| | | //edit: '/eam/eamSparePartInventory/edit', |
| | | add: "/eam/eamSparePartRequisition/add", |
| | | edit: "/eam/eamSparePartRequisition/edit", |
| | | getDetails: "/eam/eamSparePartRequisitionDetail/list", |
| | | generateRequisitionCode: "sys/sysBusinessCodeRule/generateBusinessCodeSeq" |
| | | }, |
| | | detail: { |
| | | loading: false, |
| | | dataSource: [], |
| | | columns: [ |
| | | { |
| | | title: '备件', |
| | | key: 'partId', |
| | | type: JVXETypes.select, |
| | | width: '30%', |
| | | align: 'center', |
| | | dictCode: 'eam_spare_parts,part_name,id, del_flag!=\'1\'', |
| | | validateRules: [ |
| | | { required: true, message: '备件不能为空!' } |
| | | ] |
| | | }, |
| | | // { |
| | | // title: '批次号', |
| | | // key: 'batchNum', |
| | | // type: JVXETypes.input, |
| | | // width: '10%', |
| | | // align: 'center', |
| | | // validateRules: [ |
| | | // { required: true, message: '批次号不能为空!' } |
| | | // ] |
| | | // }, |
| | | { |
| | | title: '数量', |
| | | key: 'requisitionNum', |
| | | type: JVXETypes.inputNumber, |
| | | width: '30%', |
| | | align: 'center', |
| | | validateRules: [ |
| | | { required: true, message: '数量不能为空!' } |
| | | ] |
| | | }, |
| | | // { |
| | | // title: '出厂日期(生产日期)', |
| | | // key: 'manufactureDate', |
| | | // type: JVXETypes.datetime, |
| | | // width: '16%', |
| | | // align: 'center', |
| | | // validateRules: [ |
| | | // { required: false, message: '出厂日期(生产日期)不能为空!' } |
| | | // ] |
| | | // }, |
| | | |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | add() { |
| | | |
| | | const that = this |
| | | this.visible = true; |
| | | let params = { |
| | | businessCode: "SpareRequisitionCodeRule" |
| | | } |
| | |
| | | }, |
| | | edit(record) { |
| | | this.model = Object.assign({}, record); |
| | | this.detail.dataSource = record.sparePartRequisitionDetails |
| | | this.visible = true; |
| | | }, |
| | | close() { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | this.$refs.form.clearValidate(); |
| | | }, |
| | | handleOk() { |
| | | const that = this; |
| | | |
| | | async handleOk() { |
| | | const that = this |
| | | let errMap = await that.$refs.editableDetailTable.validateTable() |
| | | if (errMap) { |
| | | this.$message.warning('数据校验失败!') |
| | | return |
| | | } |
| | | // 触发表单验证 |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = true; |
| | | let httpurl = ''; |
| | | let method = ''; |
| | | let tableData = that.$refs.editableDetailTable.getTableData() |
| | | let removeData = that.$refs.editableDetailTable.getDeleteData() |
| | | that.model.sparePartRequisitionDetails = [...tableData] |
| | | that.model.removeDetailList = [...removeData] |
| | | |
| | | that.confirmLoading = that.spinning = true |
| | | let httpurl = '' |
| | | let method = '' |
| | | if (!this.model.id) { |
| | | httpurl += this.url.add; |
| | | method = 'post'; |
| | | httpurl += this.url.add |
| | | method = 'post' |
| | | } else { |
| | | httpurl += this.url.edit; |
| | | method = 'put'; |
| | | httpurl += this.url.edit |
| | | method = 'put' |
| | | } |
| | | httpAction(httpurl, this.model, method).then((res) => { |
| | | |
| | | if (res.success) { |
| | | that.$message.success(res.message); |
| | | that.$emit('ok'); |
| | | that.$message.success(res.message) |
| | | that.$emit('ok') |
| | | that.close() |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | that.close(); |
| | | that.confirmLoading = that.spinning = false |
| | | }) |
| | | } else { |
| | | return false; |
| | | return false |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | |
| | | |
| | | handleCancel() { |
| | | this.close() |
| | | }, |
| | | |
| | | close() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | this.$refs.form.clearValidate() |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | type="primary" |
| | | icon="close" |
| | | >取消</a-button> |
| | | <a-button @click="submitForm">提交</a-button> |
| | | <a-button |
| | | :loading="spinning" |
| | | @click="submitForm" |
| | | >提交</a-button> |
| | | </div> |
| | | </a-form-model> |
| | | </div> |
| | |
| | | }, |
| | | submitForm() { |
| | | const that = this; |
| | | that.spinning = true |
| | | if (!that.assignFileStream.status == null || that.assignFileStream.status === undefined) { |
| | | this.$message.warning('请选择审批状态!') |
| | | return false; |
| | |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | that.spinning = false |
| | | }) |
| | | } |
| | | |