|
@@ -59,7 +59,7 @@
|
|
</div>
|
|
</div>
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
<s-table
|
|
<s-table
|
|
- class="sTable fixPagination"
|
|
|
|
|
|
+ class="sTable"
|
|
ref="table"
|
|
ref="table"
|
|
:style="{ height: tableHeight+84.5+'px' }"
|
|
:style="{ height: tableHeight+84.5+'px' }"
|
|
size="small"
|
|
size="small"
|
|
@@ -69,7 +69,7 @@
|
|
:rowKey="(record) => record.productSn"
|
|
:rowKey="(record) => record.productSn"
|
|
:columns="columns"
|
|
:columns="columns"
|
|
:data="loadData"
|
|
:data="loadData"
|
|
- :scroll="{ y: tableHeight }"
|
|
|
|
|
|
+ :scroll="modes=='modals'?{ y: tableHeight }:{ x:tableWidth, y: tableHeight }"
|
|
:defaultLoadData="false"
|
|
:defaultLoadData="false"
|
|
bordered>
|
|
bordered>
|
|
<!-- 采购数量 -->
|
|
<!-- 采购数量 -->
|
|
@@ -129,6 +129,7 @@ export default {
|
|
return {
|
|
return {
|
|
loading: false,
|
|
loading: false,
|
|
tableHeight: 0,
|
|
tableHeight: 0,
|
|
|
|
+ tableWidth: 950,
|
|
productType: [],
|
|
productType: [],
|
|
queryParam: { // 查询条件
|
|
queryParam: { // 查询条件
|
|
code: '', // 产品编码
|
|
code: '', // 产品编码
|
|
@@ -189,15 +190,27 @@ export default {
|
|
// 设置表头
|
|
// 设置表头
|
|
getColumns () {
|
|
getColumns () {
|
|
const _this = this
|
|
const _this = this
|
|
- this.columns = [
|
|
|
|
- { title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '20%', align: 'center' },
|
|
|
|
- { title: '产品名称', dataIndex: 'productEntity.name', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
- { title: '可用库存数量', dataIndex: 'currentStockQty', width: '13%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '成本价', dataIndex: 'productEntity.purchasePrice', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
|
- { title: '单位', dataIndex: 'productEntity.unit', width: '8%', align: 'center', customRender: function (text) { return (!text || text == ' ') ? '--' : text } },
|
|
|
|
- { title: '包装数', scopedSlots: { customRender: 'baozh' }, dataIndex: 'productEntity.packQty', width: '8%', align: 'center' },
|
|
|
|
- { title: '采购数量', scopedSlots: { customRender: 'purchaseQty' }, width: '12%', align: 'center' }
|
|
|
|
- ]
|
|
|
|
|
|
+ if (this.modes == 'pages') {
|
|
|
|
+ this.columns = [
|
|
|
|
+ { title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '20%', align: 'center' },
|
|
|
|
+ { title: '产品名称', dataIndex: 'productEntity.name', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
+ { title: '可用库存数量', dataIndex: 'currentStockQty', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '成本价', dataIndex: 'productEntity.purchasePrice', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
|
+ { title: '单位', dataIndex: 'productEntity.unit', width: '8%', align: 'center', customRender: function (text) { return (!text || text == ' ') ? '--' : text } },
|
|
|
|
+ { title: '包装数', scopedSlots: { customRender: 'baozh' }, dataIndex: 'productEntity.packQty', width: '8%', align: 'center' },
|
|
|
|
+ { title: '采购数量', scopedSlots: { customRender: 'purchaseQty' }, width: '12%', align: 'center' }
|
|
|
|
+ ]
|
|
|
|
+ } else {
|
|
|
|
+ this.columns = [
|
|
|
|
+ { title: '产品编码', dataIndex: 'productEntity.code', scopedSlots: { customRender: 'productCode' }, width: '200px', align: 'center' },
|
|
|
|
+ { title: '产品名称', dataIndex: 'productEntity.name', width: '250px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
+ { title: '可用库存数量', dataIndex: 'currentStockQty', width: '140px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '成本价', dataIndex: 'productEntity.purchasePrice', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
|
+ { title: '单位', dataIndex: 'productEntity.unit', width: '80px', align: 'center', customRender: function (text) { return (!text || text == ' ') ? '--' : text } },
|
|
|
|
+ { title: '包装数', scopedSlots: { customRender: 'baozh' }, dataIndex: 'productEntity.packQty', width: '80px', align: 'center' },
|
|
|
|
+ { title: '采购数量', scopedSlots: { customRender: 'purchaseQty' }, width: '120px', align: 'center', fixed: 'right' }
|
|
|
|
+ ]
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 产品分类 change
|
|
// 产品分类 change
|
|
changeProductType (val, opt) {
|
|
changeProductType (val, opt) {
|