diff --git a/ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountDetailList.vue b/ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountDetailList.vue index 456bc65..bf31449 100644 --- a/ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountDetailList.vue +++ b/ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountDetailList.vue @@ -273,31 +273,31 @@ } }, - watch: { - record: { - immediate: true, - handler() { - if (this.record != null) { - this.loadData(this.record) - } - } - } - }, + // watch: { + // record: { + // immediate: true, + // handler() { + // if (this.record != null) { + // this.loadData(this.record) + // } + // } + // } + // }, methods: { - loadData(record) { - this.loading = true - this.dataSource = [] - getAction(this.url.list, { - cycleCountHeadId: record.id - }).then((res) => { - if (res.success) { - this.dataSource = res.result.records - } - }).finally(() => { - this.loading = false - }) - - }, + // loadData(record) { + // this.loading = true + // this.dataSource = [] + // getAction(this.url.list, { + // cycleCountHeadId: record.id + // }).then((res) => { + // if (res.success) { + // this.dataSource = res.result.records + // } + // }).finally(() => { + // this.loading = false + // }) + // + // }, selectPort(record) { this.$refs.modalForm2.edit(record); this.$refs.modalForm2.title = "选择出库口"; @@ -305,7 +305,6 @@ loadDatas(record) { this.loading = true this.dataSource = [] - console.log("loadDatas " + record) getAction(this.url.list, { cycleCountHeadId: record }).then((res) => { diff --git a/ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountHeaderList.vue b/ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountHeaderList.vue index e3610f1..9138841 100644 --- a/ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountHeaderList.vue +++ b/ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountHeaderList.vue @@ -49,21 +49,24 @@ size="middle" bordered rowKey="id" + :scroll="{x:true}" :columns="columns" :dataSource="dataSource" :pagination="ipagination" :loading="loading" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + :customRow="clickThenSelect" + :rowClassName="rowClassName" class="j-table-force-nowrap" @change="handleTableChange"> <!-- 内嵌table区域 begin --> - <template slot="expandedRowRender" slot-scope="record"> - <a-tabs tabPosition="top"> - <a-tab-pane tab="盘点明细" key="cycleCountDetailId" forceRender> - <cycle-count-detail-list :record="record" :isLoad="true"/> - </a-tab-pane> - </a-tabs> - </template> +<!-- <template slot="expandedRowRender" slot-scope="record">--> +<!-- <a-tabs tabPosition="top">--> +<!-- <a-tab-pane tab="盘点明细" key="cycleCountDetailId" forceRender>--> +<!-- <cycle-count-detail-list :record="record" :isLoad="true"/>--> +<!-- </a-tab-pane>--> +<!-- </a-tabs>--> +<!-- </template>--> <!-- 内嵌table区域 end --> <span slot="companyCode" slot-scope="companyCode"> <a-tag :key="companyCode" color=blue> @@ -106,6 +109,12 @@ </a-table> </div> + + <a-tabs defaultActiveKey="1"> + <a-tab-pane tab="盘点明细" key="1"> + <Cycle-Count-Detail-List ref="CycleCountDetailList"></Cycle-Count-Detail-List> + </a-tab-pane> + </a-tabs> <cycle-count-header-modal ref="modalForm" @ok="modalFormOk"></cycle-count-header-modal> <cycle-count-detail-modal ref="detailModalForm" @ok="detailModalFormOk"/> </a-card> @@ -263,6 +272,30 @@ export default { fieldList.push({type: 'string', value: 'closedBy', text: '关闭人', dictCode: ''}) this.superFieldList = fieldList }, + onClearSelected() { + this.selectedRowKeys = []; + this.selectionRows = []; + this.selectedMainId = '' + }, + onSelectChange(selectedRowKeys, selectionRows) { + this.selectedMainId = selectedRowKeys[0].toString(); + this.selectedRowKeys = selectedRowKeys; + this.selectionRows = selectionRows; + this.$refs.CycleCountDetailList.loadDatas(this.selectedRowKeys[0]); + }, + clickThenSelect(record,index) { + return { + on: { + click: () => { + this.selectIndex=index + this.onSelectChange(record.id.toString().split(","), [record]); + } + } + } + }, + rowClassName(record, index) { + return index === this.selectIndex ? 'Rowactive' : '' + }, loadFrom() { getCompanyList().then((res) => { if (res.success) {