|
@@ -7,22 +7,21 @@
|
|
|
<a id="intelligentReplenishmentImport-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
|
</template>
|
|
|
</a-page-header>
|
|
|
- <a-card :bordered="false" class="intelligentReplenishmentImport-cont">
|
|
|
+ <a-card size="small" :bordered="false" class="intelligentReplenishmentImport-cont">
|
|
|
<div>
|
|
|
<p class="total">共 <span>{{ listData.length }}</span> 条数据,红色字体表示数据不符合规范,请返回上一步修改文件后重新上传</p>
|
|
|
- <s-table
|
|
|
- class="sTable"
|
|
|
- ref="table"
|
|
|
- size="small"
|
|
|
- :rowKey="(record) => record.id"
|
|
|
- :columns="columns"
|
|
|
- :data="loadData"
|
|
|
- :scroll="{ x: 1440 }"
|
|
|
- :rowClassName="(record, index) => record.cost ? 'redBg-row':''"
|
|
|
- :showPagination="false"
|
|
|
- :defaultLoadData="false"
|
|
|
- bordered>
|
|
|
- </s-table>
|
|
|
+
|
|
|
+ <ve-table
|
|
|
+ border-y
|
|
|
+ :border-around="false"
|
|
|
+ :max-height="tableHeight"
|
|
|
+ :row-style-option="{clickHighlight: true}"
|
|
|
+ :cellSelectionOption="{enable: false}"
|
|
|
+ :virtual-scroll-option="{enable: true}"
|
|
|
+ :columns="columns"
|
|
|
+ :table-data="listData"
|
|
|
+ row-key-field-name="id"
|
|
|
+ />
|
|
|
<div class="btn-cont">
|
|
|
<a-button
|
|
|
type="primary"
|
|
@@ -64,32 +63,18 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
spinning: false,
|
|
|
+ tableHeight: 500,
|
|
|
columns: [
|
|
|
- { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
|
|
|
- { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '产品状态', dataIndex: 'productStateDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '订货周期(天)', dataIndex: 'cycle', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '是否淘汰', dataIndex: 'eliminateText', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '淘汰描述', dataIndex: 'eliminateDesc', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '备注', dataIndex: 'remark', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '错误原因', dataIndex: 'errorDesc', width: 200, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
|
|
|
+ { title: '序号', field: 'no',key: "a", width: 80, align: 'center', fixed: 'left',operationColumn: false },
|
|
|
+ { title: '产品编码', field: 'productCode',key: "b", width: 220, align: 'center',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'} },
|
|
|
+ { title: '产品名称', field: 'productName',key: "c", align: 'center',operationColumn: false , ellipsis: { showTitle: true },renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
|
|
|
+ { title: '产品状态', field: 'productStateDictValue',key: "d", width: 100, align: 'center',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'} },
|
|
|
+ { title: '订货周期(天)', field: 'cycle',key: "e", width: 120, align: 'center',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || row[column.field] == 0 ? row[column.field] : '--'}},
|
|
|
+ { title: '是否淘汰', field: 'eliminateText',key: "f", width: 100, align: 'center',operationColumn: false,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
|
|
|
+ { title: '淘汰描述', field: 'eliminateDesc',key: "g", width: 200, align: 'center',operationColumn: false, ellipsis: { showTitle: true },renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}},
|
|
|
+ { title: '备注', field: 'remark', width: 200,key: "h", align: 'center',operationColumn: false, ellipsis: { showTitle: true },renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'} },
|
|
|
+ { title: '错误原因', field: 'errorDesc',key: "i", width: 200, align: 'center',operationColumn: false, ellipsis: { showTitle: true } ,renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--'}}
|
|
|
],
|
|
|
- // 加载数据方法 必须为 Promise 对象
|
|
|
- loadData: parameter => {
|
|
|
- return predictProductInfoGoods({ path: JSON.parse(this.$cookies.get('REPLENISHMENT_PATH')) }).then(res => {
|
|
|
- let data
|
|
|
- if (res.status == 200) {
|
|
|
- data = res.data
|
|
|
- for (var i = 0; i < data.list.length; i++) {
|
|
|
- data.list[i].no = i + 1
|
|
|
- this.errorFlag.push(data.list[i].errorFlag)
|
|
|
- }
|
|
|
- this.listData = data.list
|
|
|
- }
|
|
|
- return data
|
|
|
- })
|
|
|
- },
|
|
|
listData: [],
|
|
|
errorFlag: []
|
|
|
}
|
|
@@ -103,6 +88,22 @@ export default {
|
|
|
handleBackSet () {
|
|
|
this.$router.push({ path: `/inventoryManagement/intelligentReplenishment/set` })
|
|
|
},
|
|
|
+ getTable(){
|
|
|
+ this.tableHeight = window.innerHeight - 325
|
|
|
+ this.spinning = true
|
|
|
+ predictProductInfoGoods({ path: JSON.parse(this.$cookies.get('REPLENISHMENT_PATH')) }).then(res => {
|
|
|
+ let data
|
|
|
+ if (res.status == 200) {
|
|
|
+ data = res.data
|
|
|
+ for (var i = 0; i < data.list.length; i++) {
|
|
|
+ data.list[i].no = i + 1
|
|
|
+ this.errorFlag.push(data.list[i].errorFlag)
|
|
|
+ }
|
|
|
+ this.listData = data.list
|
|
|
+ }
|
|
|
+ this.spinning = false
|
|
|
+ })
|
|
|
+ },
|
|
|
// 确认导入
|
|
|
handleSubmit () {
|
|
|
const _this = this
|
|
@@ -129,13 +130,13 @@ export default {
|
|
|
},
|
|
|
mounted () {
|
|
|
if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
|
|
|
- this.$refs.table.refresh(true)
|
|
|
+ this.getTable()
|
|
|
}
|
|
|
},
|
|
|
activated () {
|
|
|
// 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
|
|
|
if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
|
|
|
- this.$refs.table.refresh(true)
|
|
|
+ this.getTable()
|
|
|
}
|
|
|
}
|
|
|
}
|