123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232 |
- <template>
- <a-modal
- title="存货列表"
- width="60%"
- :visible="visible"
- :maskClosable="false"
- switchFullscreen
- @cancel="handleCancel"
- @ok='handleOk'
- >
- <a-card :bordered="false" class="top" style="margin-bottom:1%;margin-top:1%">
- <a-form-model ref="formRef">
- <a-table
- ref="table"
- size="middle"
- bordered
- id='sonList1'
- :loading="loading"
- :columns="columns"
- rowKey="rowIndex"
- :dataSource="dataSource"
- :pagination="pagination"
- :scroll="{ x: 800, y: 300 }"
- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
- @change="handleTableChange"
- :customRow ="clickRow"
- >
- </a-table>
- </a-form-model>
- </a-card >
- </a-modal>
- </template>
- <script>
-
- import { FormTypes } from '@/utils/JEditableTableUtil'
- import { JEditableTableModelMixin } from '@/mixins/JEditableTableModelMixin'
- import moment from "moment"
- import { httpAction ,getAction,postAction,putAction} from '@/api/manage'
- export default {
- name: 'inventoryPopup',
- mixins: [JEditableTableModelMixin],
- components: {
- },
- data() {
- return {
- visible:false,
- selectedRowKeys:[],
- selectedRows:[],
- dataSource:[],
- loading:false,
- pagination:{
- current: 1,
- pageSize: 5,
- pageSizeOptions: ['5', '10', '20'],
- showTotal: (total, range) => {
- return range[0] + "-" + range[1] + " 共" + total + "条"
- },
- showQuickJumper: true,
- showSizeChanger: true,
- total: 0
- },
- queryParam:{
- pageNo:1
- },
- record:{},
- columns:[
- {
- title: '行号',
- dataIndex: '',
- key: 'rowIndex',
- width: 60,
- align: "center",
- customRender:function (t, r, index) {
- return parseInt(index)+1;
- }
- },
- {
- title: '存货名称',
- align:"center",
- dataIndex: 'Name',
- ellipsis: true,
- },
- {
- title: '存货编码',
- align:"center",
- dataIndex: 'Code',
- ellipsis: true,
- },
- {
- title: '规格',
- align:"center",
- dataIndex: 'SPECS',
- ellipsis: true,
- },
- {
- title: '主单位',
- align:"center",
- dataIndex: 'unit',
- ellipsis: true,
- },
- {
- title: '料品属性1',
- align:"center",
- dataIndex: 'Code1',
- ellipsis: true,
- },
- ]
- }
- },
- created() {
-
- },
- methods: {
- handleCancel(){
- this.visible=false
- this.dataSource = []
- this.selectedRowKeys = []
- this.selectedRows = []
- },
- handleOk(){
- if(this.selectedRowKeys.length!==1){
- this.$message.warning('请选择一条数据!')
- }else{
- this.$emit('okData',this.selectedRows[0],this.record)
- this.handleCancel()
- }
- },
- getData(data){
- this.loading = true
- this.queryParam.Org = data
- getAction('/production/safetyStock/selectItemMaster',this.queryParam).then(res=>{
- if(res.success){
- this.dataSource = res.result.records
- this.pagination = {
- total: res.result.total,
- current: res.result.current,
- pageSize: res.result.size
- }
- }else{
- this.$message.error(res.message);
-
- }
- }).finally(()=>{
- this.loading = false
- })
- },
- handleTableChange(pagination, filters, sorter) {
- this.queryParam.pageNo = pagination.current
- this.queryParam.pageSize = pagination.pageSize
- this.getData()
- },
- onSelectChange(selectedRowKeys, selectionRows) {
- this.selectedRowKeys = selectedRowKeys;
- this.selectedRows = selectionRows;
- },
- clickRow(record, index){
- return {
- on: {
- click: () => {
- this.selectedRowKeys.push(index)
- this.selectedRows.push(record)
- },
- }
- }
- },
- }
- }
- </script>
-
- <style scoped lang="less">
- /* @import '~@assets/less/common.less' */
- /deep/.ant-input{
- height:29px;
- }
- /deep/.ant-select-selection--single {
- height: 29px;
- }
- /deep/.ant-select{
- font-size: 12px;
- }
- /deep/.ant-form label{
- font-size: 12px;
- }
- /deep/.table-page-search-wrapper .ant-form-inline .ant-form-item{
- margin-bottom:9px
- }
- /deep/.moddle>.ant-card-body{
- padding-bottom:0px;
- padding-top: 12px;
- }
- /deep/.top>.ant-card-body{
- padding-bottom: 12px;
- padding-top: 12px;
- }
- /deep/.ant-btn{
- height:28px
- }
- /deep/.ant-modal-body{
- padding-bottom: 0px;
- padding-top: 0px;
- }
- // /deep/.ant-modal-body{
- // background: #f0f2f5;
- // }
- /deep/.ant-modal-content{
- background: #f0f2f5;
- }
- /deep/.ant-card-body .table-operator {
- margin-bottom: 0px;
- }
- /deep/.three>.ant-card-body{
- padding-bottom:12px;
- padding-top: 12px;
- }
- /deep/.bottom>.ant-card-body{
- padding-bottom:0px;
- padding-top: 12px;
- }
- /deep/.ant-calendar-picker{
- min-width: 0px !important;
- }
- /deep/.sonItem {
- margin-bottom:0px !important
- }
- /deep/#sonList1>.ant-spin-nested-loading>.ant-spin-container>.ant-table>.ant-table-content>.ant-table-scroll>.ant-table-body>.ant-table-fixed>.ant-table-tbody > tr > td {
- padding: 8px 8px !important;
- }
- /deep/.ant-table-fixed-header .ant-table-scroll .ant-table-header{
- width: calc(100% + 9px);//减去滚动条的宽度
- }
- </style>
|