|
@@ -5,36 +5,66 @@
|
|
<div class="query-item">
|
|
<div class="query-item">
|
|
<div class="lable">供应商:</div>
|
|
<div class="lable">供应商:</div>
|
|
<div class="search-input">
|
|
<div class="search-input">
|
|
- <el-select v-model="vendor" clearable placeholder="请选择" popper-class="select">
|
|
|
|
- <el-option v-for="item in vendorArray" :key="item.company" :value="item.company" :label="item.company" />
|
|
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="vendor"
|
|
|
|
+ clearable
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ popper-class="select"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in vendorArray"
|
|
|
|
+ :key="item.company"
|
|
|
|
+ :value="item.company"
|
|
|
|
+ :label="item.company"
|
|
|
|
+ />
|
|
</el-select>
|
|
</el-select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="query-item">
|
|
<div class="query-item">
|
|
<div class="lable">采购单号:</div>
|
|
<div class="lable">采购单号:</div>
|
|
<div class="search-input">
|
|
<div class="search-input">
|
|
- <el-input placeholder="请输入描述" size="middle" v-model="ponum" clearable></el-input>
|
|
|
|
|
|
+ <el-input
|
|
|
|
+ placeholder="请输入描述"
|
|
|
|
+ size="middle"
|
|
|
|
+ v-model="ponum"
|
|
|
|
+ clearable
|
|
|
|
+ ></el-input>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="query-item">
|
|
<div class="query-item">
|
|
<div class="lable">仓库:</div>
|
|
<div class="lable">仓库:</div>
|
|
<div class="search-input">
|
|
<div class="search-input">
|
|
- <el-select v-model="warehouse" clearable placeholder="请选择" popper-class="select">
|
|
|
|
- <el-option v-for="item in warehouseArray" :key="item.warehouse" :value="item.warehouse" :label="item.warehouse" />
|
|
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="warehouse"
|
|
|
|
+ clearable
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ popper-class="select"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in warehouseArray"
|
|
|
|
+ :key="item.warehouse"
|
|
|
|
+ :value="item.warehouse"
|
|
|
|
+ :label="item.warehouse"
|
|
|
|
+ />
|
|
</el-select>
|
|
</el-select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="query-item">
|
|
<div class="query-item">
|
|
<div class="lable">日期:</div>
|
|
<div class="lable">日期:</div>
|
|
<div class="search-input">
|
|
<div class="search-input">
|
|
- <el-date-picker size="medium" v-model="dateArea" type="datetimerange"
|
|
|
|
- :picker-options="pickerOptions" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" align="right"
|
|
|
|
- >
|
|
|
|
|
|
+ <el-date-picker
|
|
|
|
+ size="medium"
|
|
|
|
+ v-model="dateArea"
|
|
|
|
+ type="datetimerange"
|
|
|
|
+ :picker-options="pickerOptions"
|
|
|
|
+ range-separator="至"
|
|
|
|
+ start-placeholder="开始日期"
|
|
|
|
+ end-placeholder="结束日期"
|
|
|
|
+ align="right"
|
|
|
|
+ >
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
-
|
|
|
|
</div>
|
|
</div>
|
|
<div class="query-actions" style="margin-right: 1500px">
|
|
<div class="query-actions" style="margin-right: 1500px">
|
|
<button class="btn green" @click="onClickSearch">查询</button>
|
|
<button class="btn green" @click="onClickSearch">查询</button>
|
|
@@ -54,9 +84,13 @@ export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
dateArea: [
|
|
dateArea: [
|
|
- this.fmtDate(new Date(new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 30))),
|
|
|
|
- this.fmtDate(new Date())
|
|
|
|
- ],
|
|
|
|
|
|
+ this.fmtDate(
|
|
|
|
+ new Date(
|
|
|
|
+ new Date().setTime(new Date().getTime() - 3600 * 1000 * 24 * 30)
|
|
|
|
+ )
|
|
|
|
+ ),
|
|
|
|
+ this.fmtDate(new Date()),
|
|
|
|
+ ],
|
|
pageSize: 100,
|
|
pageSize: 100,
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
ponum: "",
|
|
ponum: "",
|
|
@@ -176,57 +210,56 @@ export default {
|
|
created() {
|
|
created() {
|
|
// this.requestSafeList();
|
|
// this.requestSafeList();
|
|
this.value1 = this.getTime(1);
|
|
this.value1 = this.getTime(1);
|
|
- this.value2 = this.getTime(2);
|
|
|
|
|
|
+ this.value2 = this.getTime(2);
|
|
this.getVendor();
|
|
this.getVendor();
|
|
- this.getWarehouse();
|
|
|
|
- this.requestSafeList();
|
|
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- getTime(val) { //时间戳处理,val=1是默认开始时间(当前月第一天),val=2是默认结束时间(今天)
|
|
|
|
- var date = new Date();
|
|
|
|
- var year = date.getFullYear(),
|
|
|
|
- month = date.getMonth() + 1,
|
|
|
|
- day = date.getDate();
|
|
|
|
- month >= 1 && month <= 9 ? (month = '0' + month) : '';
|
|
|
|
- day >= 0 && day <= 9 ? (day = '0' + day) : '';
|
|
|
|
- var begin = year + '-' + month + '-01';
|
|
|
|
- var end = year + '-' + month + '-' + day;
|
|
|
|
- if (val == 1) {
|
|
|
|
- return begin;
|
|
|
|
- } else if (val == 2) {
|
|
|
|
- return end;
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
-// 获取厂家
|
|
|
|
- getVendor () {
|
|
|
|
|
|
+ getTime(val) {
|
|
|
|
+ //时间戳处理,val=1是默认开始时间(当前月第一天),val=2是默认结束时间(今天)
|
|
|
|
+ var date = new Date();
|
|
|
|
+ var year = date.getFullYear(),
|
|
|
|
+ month = date.getMonth() + 1,
|
|
|
|
+ day = date.getDate();
|
|
|
|
+ month >= 1 && month <= 9 ? (month = "0" + month) : "";
|
|
|
|
+ day >= 0 && day <= 9 ? (day = "0" + day) : "";
|
|
|
|
+ var begin = year + "-" + month + "-01";
|
|
|
|
+ var end = year + "-" + month + "-" + day;
|
|
|
|
+ if (val == 1) {
|
|
|
|
+ return begin;
|
|
|
|
+ } else if (val == 2) {
|
|
|
|
+ return end;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 获取厂家
|
|
|
|
+ getVendor() {
|
|
let that = this;
|
|
let that = this;
|
|
that.API.requestData({
|
|
that.API.requestData({
|
|
baseURL: "http://192.168.1.18:9988",
|
|
baseURL: "http://192.168.1.18:9988",
|
|
- subUrl: "companies/list",
|
|
|
|
- success (res) {
|
|
|
|
- console.log(res.data)
|
|
|
|
|
|
+ subUrl: "companies/list",
|
|
|
|
+ success(res) {
|
|
that.vendorArray = res.data;
|
|
that.vendorArray = res.data;
|
|
that.vendor = res.data[0].company;
|
|
that.vendor = res.data[0].company;
|
|
- }
|
|
|
|
|
|
+ that.getWarehouse();
|
|
|
|
+ },
|
|
});
|
|
});
|
|
},
|
|
},
|
|
// 获取仓库
|
|
// 获取仓库
|
|
- getWarehouse () {
|
|
|
|
|
|
+ getWarehouse() {
|
|
let that = this;
|
|
let that = this;
|
|
that.API.requestData({
|
|
that.API.requestData({
|
|
baseURL: "http://192.168.1.18:9988",
|
|
baseURL: "http://192.168.1.18:9988",
|
|
- subUrl: "warehouse/list",
|
|
|
|
- success (res) {
|
|
|
|
- console.log(res.data)
|
|
|
|
|
|
+ subUrl: "warehouse/list",
|
|
|
|
+ success(res) {
|
|
that.warehouseArray = res.data;
|
|
that.warehouseArray = res.data;
|
|
that.warehouse = res.data[0].warehouse;
|
|
that.warehouse = res.data[0].warehouse;
|
|
- }
|
|
|
|
|
|
+ that.requestSafeList();
|
|
|
|
+ },
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
|
|
// 格式化日期
|
|
// 格式化日期
|
|
- fmtDate (date) {
|
|
|
|
|
|
+ fmtDate(date) {
|
|
let curDate = date || new Date();
|
|
let curDate = date || new Date();
|
|
let year = curDate.getFullYear();
|
|
let year = curDate.getFullYear();
|
|
let mouth = curDate.getUTCMonth() + 1;
|
|
let mouth = curDate.getUTCMonth() + 1;
|
|
@@ -234,7 +267,19 @@ export default {
|
|
let hour = curDate.getHours();
|
|
let hour = curDate.getHours();
|
|
let minutes = curDate.getMinutes();
|
|
let minutes = curDate.getMinutes();
|
|
let seconds = curDate.getSeconds();
|
|
let seconds = curDate.getSeconds();
|
|
- return year + '-' + (mouth < 10 ? '0' + mouth : mouth) + '-' + (day < 10 ? '0' + day : day) + ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (minutes < 10 ? '0' + minutes : minutes) + ':' + (seconds < 10 ? '0' + seconds : seconds);
|
|
|
|
|
|
+ return (
|
|
|
|
+ year +
|
|
|
|
+ "-" +
|
|
|
|
+ (mouth < 10 ? "0" + mouth : mouth) +
|
|
|
|
+ "-" +
|
|
|
|
+ (day < 10 ? "0" + day : day) +
|
|
|
|
+ " " +
|
|
|
|
+ (hour < 10 ? "0" + hour : hour) +
|
|
|
|
+ ":" +
|
|
|
|
+ (minutes < 10 ? "0" + minutes : minutes) +
|
|
|
|
+ ":" +
|
|
|
|
+ (seconds < 10 ? "0" + seconds : seconds)
|
|
|
|
+ );
|
|
},
|
|
},
|
|
BeginChange(vl) {
|
|
BeginChange(vl) {
|
|
this.value1 = vl;
|
|
this.value1 = vl;
|
|
@@ -254,11 +299,15 @@ export default {
|
|
let that = this;
|
|
let that = this;
|
|
if (!that.dateArea || !that.dateArea.length) {
|
|
if (!that.dateArea || !that.dateArea.length) {
|
|
that.BASE.showMsg({
|
|
that.BASE.showMsg({
|
|
- msg:"请先选择要查询的日期区间后再试"
|
|
|
|
|
|
+ msg: "请先选择要查询的日期区间后再试",
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
- let starttime = (this.dateArea.length ? new Date(this.dateArea[0]).formatDate("yyyy-MM-dd hh:mm:ss") : '');
|
|
|
|
- let endtime = (this.dateArea.length ? new Date(this.dateArea[1]).formatDate("yyyy-MM-dd hh:mm:ss") : '');
|
|
|
|
|
|
+ let starttime = this.dateArea.length
|
|
|
|
+ ? new Date(this.dateArea[0]).formatDate("yyyy-MM-dd hh:mm:ss")
|
|
|
|
+ : "";
|
|
|
|
+ let endtime = this.dateArea.length
|
|
|
|
+ ? new Date(this.dateArea[1]).formatDate("yyyy-MM-dd hh:mm:ss")
|
|
|
|
+ : "";
|
|
|
|
|
|
// let data = {
|
|
// let data = {
|
|
// category1:'SYZ',
|
|
// category1:'SYZ',
|
|
@@ -273,8 +322,8 @@ export default {
|
|
that.API.requestData({
|
|
that.API.requestData({
|
|
// baseURL:"http://192.168.1.14:8075/",
|
|
// baseURL:"http://192.168.1.14:8075/",
|
|
baseURL: "http://192.168.1.18:9988",
|
|
baseURL: "http://192.168.1.18:9988",
|
|
- subUrl:"poline/list",
|
|
|
|
- method:"GET",
|
|
|
|
|
|
+ subUrl: "poline/list",
|
|
|
|
+ method: "GET",
|
|
data: {
|
|
data: {
|
|
vendor: that.vendor,
|
|
vendor: that.vendor,
|
|
ponum: that.ponum,
|
|
ponum: that.ponum,
|
|
@@ -284,11 +333,10 @@ export default {
|
|
pagenum: that.pageNum,
|
|
pagenum: that.pageNum,
|
|
pagesize: that.pageSize,
|
|
pagesize: that.pageSize,
|
|
},
|
|
},
|
|
- success(res){
|
|
|
|
- console.log(res.data.records);
|
|
|
|
|
|
+ success(res) {
|
|
if (res.data.records.length) {
|
|
if (res.data.records.length) {
|
|
- res.data.records.forEach((ele,index) => {
|
|
|
|
- ele.index = (index+1);
|
|
|
|
|
|
+ res.data.records.forEach((ele, index) => {
|
|
|
|
+ ele.index = index + 1;
|
|
ele.timeDate = that.fmtDate(new Date(ele.time));
|
|
ele.timeDate = that.fmtDate(new Date(ele.time));
|
|
if (ele.value > 0) {
|
|
if (ele.value > 0) {
|
|
ele.value = parseFloat(ele.value).toFixed(4);
|
|
ele.value = parseFloat(ele.value).toFixed(4);
|
|
@@ -297,17 +345,14 @@ export default {
|
|
that.tableData.data = res.data.records || [];
|
|
that.tableData.data = res.data.records || [];
|
|
} else {
|
|
} else {
|
|
that.BASE.showMsg({
|
|
that.BASE.showMsg({
|
|
- type:"warning",
|
|
|
|
- msg:"所选日期区间之内暂无数据,请重试"
|
|
|
|
|
|
+ type: "warning",
|
|
|
|
+ msg: "所选日期区间之内暂无数据,请重试",
|
|
});
|
|
});
|
|
}
|
|
}
|
|
that.showDialog = true;
|
|
that.showDialog = true;
|
|
- }
|
|
|
|
|
|
+ },
|
|
});
|
|
});
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
};
|