cuijian
2025-07-09 9b6bd0c014b73456edb095ee53b22324437ae646
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
<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 :md="6" :sm="8">
            <a-form-item label="入库申请单编号">
              <j-input placeholder="请输入入库申请单编号" v-model="queryParam.inboundNum" />
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
              <a-form-item label="入库类型">
                <j-search-select-tag
                  placeholder="请选择入库类型"
                  v-model="queryParam.inStorehouseType"
                  dict="in_storehouse_type"
                />
              </a-form-item>
            </a-col>
          <!-- <a-col :md="6" :sm="8">
              <a-form-item label="经手人">
                <j-search-select-tag
                  placeholder="请选择经手人"
                  v-model="queryParam.handler"
                  dict="sys_user,realname,id,del_flag!=1"
                />
              </a-form-item>
            </a-col> -->
        </a-row>
      </a-form>
    </div>
 
    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
      <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
    </div>
 
    <!-- table区域-begin -->
    <a-table
      ref="table"
      size="middle"
      bordered
      rowKey="id"
      :customRow="customRow"
      :columns="columns"
      :dataSource="dataSource"
      :pagination="ipagination"
      :loading="loading"
      :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:'radio'}"
      @change="handleTableChange"
    >
      <!--状态栏个性展示-->
      <span slot="action" slot-scope="text, record">
        <a href="javascript:;" @click="handleEdit(record)" v-if="record.orderStatus == '1'">编辑</a>
        <a-divider type="vertical" v-if="record.orderStatus == '1'" />
        <a href="javascript:;" @click="handleDetail(record)">详情</a>
        <a-divider type="vertical"  v-if="record.orderStatus == '1'"/>
        <a href="javascript:;" @click="handleSubmit(record)" v-if="record.orderStatus == '1'">提交</a>
      </span>
    </a-table>
    <a-tabs defaultActiveKey="1">
      <a-tab-pane tab="工具入库明细" key="1">
        <inbound-detail-list ref="inboundDetailList"></inbound-detail-list>
      </a-tab-pane>
    </a-tabs>
    <!-- table区域-end -->
    <inbound-order-model ref="modalForm" @ok="modalFormOk"></inbound-order-model>
  </a-card>
</template>
 
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import InboundOrderModel from './modules/inboundOrder/InboundOrderModel'
import InboundDetailList from './modules/inboundOrder/InboundDetailList'
import { requestPut } from '@/api/manage'
import JDictSelectTag from '@/components/dict/JDictSelectTag'
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
import { postAction,getAction } from '../../api/manage'
 
export default {
  name: 'InboundOrderList',
  mixins: [JeecgListMixin],
  components: {
    InboundOrderModel,
    InboundDetailList,
    JDictSelectTag,
    JSearchSelectTag,
  },
  data() {
    return {
      description: '入库申请单',
      url: {
        list: '/tms/inboundOrder/list',
        importExcelUrl: '/tms/inboundOrder/importExcel',
        exportXlsUrl: '/tms/inboundOrder/exportXls',
        edit:'/tms/inboundOrder/edit',
        submit:'/tms/inboundOrder/submit'
      },
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '入库申请单编号',
          align: 'center',
          dataIndex: 'inboundNum',
          sorter: true,
        },
        {
          title: '入库单类型',
          align: 'center',
          dataIndex: 'inStorehouseType_dictText',
        },
        {
          title: '经手人',
          align: 'center',
          dataIndex: 'handler_dictText',
        },
        {
          title: '申请原因',
          align: 'center',
          dataIndex: 'applicationReason',
        },
        {
          title: '入库时间',
          align: 'center',
          dataIndex: 'inboundTime',
          sorter: true,
        },
        {
          title: '审核人',
          align: 'center',
          dataIndex: 'reviewer_dictText',
        },
        {
          title: '审核时间',
          align: 'center',
          dataIndex: 'approvalDate',
          sorter: true,
        },
        {
          title: '审核状态',
          align: 'center',
          dataIndex: 'orderStatus_dictText',
        },
         {
          title: '审批意见',
          align: 'center',
          dataIndex: 'approvalOpinion',
        },
        {
          width: 150,
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' },
        },
      ],
      loading:false
    }
  },
  computed: {
    /* 导入路径页面重新计算 */
    importExcelUrl: function () {
      //  return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;//开发环境指向
      return `${window._CONFIG['hxFileURL']}/${this.url.importExcelUrl}`
    },
  },
  methods: {
    searchReset() {
      this.queryParam = {}
      this.$refs.inboundDetailList.dataSource = []
      this.loadData(1);
    },
    customRow(record) {
      return {
        on: {
          click: (e) => {
            this.onSelectChange(record.id.split(","), [record]); 
            //点击当前行变色
            // let oldList = document.querySelectorAll('.checked-td-of-add-table')
            // if (oldList) {
            //   for (let j = 0; j < oldList.length; j++) {
            //     oldList[j].classList.remove('checked-td-of-add-table')
            //   }
            // }
            // let children = e.target.parentNode.children
            // for (let i = 0; i < children.length; i++) {
            //   children[i].classList.add('checked-td-of-add-table')
            // }
          },
        },
      }
    },
    onSelectChange(selectedRowKeys, selectionRows) {
        this.selectedRowKeys = selectedRowKeys;
        this.selectionRows = selectionRows;
        //将当前选中的记录传到子页面
        this.$bus.$emit('getToolingStorageData', this.selectionRows[0])
      },
    handleEdit: function (record) {
        this.$refs.modalForm.edit(record)
        this.$refs.modalForm.title = '编辑'
        this.$refs.modalForm.disableSubmit = false
    },
    handleAdd() {
      this.$refs.modalForm.add()
      this.$refs.modalForm.title = '新增'
      this.$refs.modalForm.disableSubmit = false
    },
    handleSubmit(record) {
        let that = this;
        that.loading = true
        getAction(that.url.submit, { id:record.id}).then((res) => {
          if (res.success) {
            that.$message.success(res.message);
            that.loadData();
          } else {
            that.$message.warning(res.message);
          }
        }).finally(() => {
          that.loading = false
        })
      },
  },
}
</script>
 
<style lang="less" scoped>
@import '~@assets/less/common.less';
/deep/ .notshow {
  display: none;
}
/deep/ .checked-td-of-add-table {
  background-color: rgba(220, 220, 220, 1);
}
</style>