库存记录报表:前端首次查询默认当天日期,后端sql优化
This commit is contained in:
@@ -85,3 +85,26 @@ new Vue({
|
||||
store,
|
||||
render: h => h(App)
|
||||
})
|
||||
|
||||
// var time1 = new Date().format("yyyy-MM-dd hh:mm:ss");
|
||||
// eslint-disable-next-line no-extend-native
|
||||
Date.prototype.format = function(fmt) {
|
||||
var o = {
|
||||
'M+': this.getMonth() + 1, // 月份
|
||||
'd+': this.getDate(), // 日
|
||||
'h+': this.getHours(), // 小时
|
||||
'm+': this.getMinutes(), // 分
|
||||
's+': this.getSeconds(), // 秒
|
||||
'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
|
||||
'S': this.getMilliseconds() // 毫秒
|
||||
}
|
||||
if (/(y+)/.test(fmt)) {
|
||||
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
|
||||
}
|
||||
for (var k in o) {
|
||||
if (new RegExp('(' + k + ')').test(fmt)) {
|
||||
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
|
||||
}
|
||||
}
|
||||
return fmt
|
||||
}
|
||||
|
||||
@@ -27,14 +27,13 @@
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="supplierCode" label="客户编码" min-width="100" />
|
||||
<el-table-column prop="supplierName" label="客户名称" min-width="150" />
|
||||
<el-table-column prop="productName" label="物料编码" in-width="150" />
|
||||
<el-table-column prop="date" label="日期" />
|
||||
<el-table-column prop="specification" label="规格" />
|
||||
<el-table-column prop="batch" label="来料批次" />
|
||||
<el-table-column prop="barLevel" label="棒源等级" />
|
||||
<el-table-column prop="supplierCode" label="客户编码" :min-width="flexWidth('supplierCode',crud.data,'客户编码')" />
|
||||
<el-table-column prop="supplierName" label="客户名称" :min-width="flexWidth('supplierName',crud.data,'客户名称')" />
|
||||
<el-table-column prop="productName" label="物料编码" :min-width="flexWidth('productName',crud.data,'物料编码')" />
|
||||
<el-table-column prop="date" label="日期" :min-width="flexWidth('date',crud.data,'日期')" />
|
||||
<el-table-column prop="specification" label="规格" :min-width="flexWidth('specification',crud.data,'规格')" />
|
||||
<el-table-column prop="batch" label="来料批次" :min-width="flexWidth('batch',crud.data,'来料批次')" />
|
||||
<el-table-column prop="barLevel" label="棒源等级" :min-width="flexWidth('barLevel',crud.data,'棒源等级')" />
|
||||
<el-table-column label="昨日结存">
|
||||
<el-table-column prop="sy_length" label="实际长度(mm)" />
|
||||
<el-table-column prop="sy_weight" label="实际重量(KG)" />
|
||||
@@ -43,7 +42,7 @@
|
||||
<el-table-column prop="ll_length" label="实际长度(mm)" />
|
||||
<el-table-column prop="ll_weight" label="实际重量(KG)" />
|
||||
</el-table-column>
|
||||
<el-table-column prop="pickingBatch" label="领料批次" />
|
||||
<el-table-column prop="pickingBatch" label="领料批次" :min-width="flexWidth('pickingBatch',crud.data,'领料批次')" />
|
||||
<el-table-column label="生产领料">
|
||||
<el-table-column prop="sc_length" label="实际长度(mm)" />
|
||||
<el-table-column prop="sc_weight" label="实际重量(KG)" />
|
||||
@@ -63,12 +62,11 @@
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
export default {
|
||||
name: 'Data',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
components: { pagination, crudOperation, rrOperation },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -84,7 +82,7 @@ export default {
|
||||
reset: false
|
||||
},
|
||||
query: {
|
||||
// start_time: new Date().format('yyyy-MM-dd')
|
||||
start_time: new Date().format('yyyy-MM-dd')
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user