|
@@ -82,6 +82,7 @@
|
82
|
82
|
:auto-upload="false" >
|
83
|
83
|
<el-button plain slot="trigger" type="success" v-show="false" style= "margin-left: 5px" size="small">询单导入</el-button>
|
84
|
84
|
<el-button type="success" @click="handleExport" style="margin-left: 2px" size="small">导出记录</el-button>
|
|
85
|
+ <el-button type="success" @click="handleExport_addPrice" style="margin-left: 2px" size="small">导出价格</el-button>
|
85
|
86
|
</el-upload>
|
86
|
87
|
</el-form-item>
|
87
|
88
|
|
|
@@ -920,7 +921,140 @@
|
920
|
921
|
return v[j]
|
921
|
922
|
}))
|
922
|
923
|
},
|
|
924
|
+
|
|
925
|
+ handleExport_addPrice() {
|
|
926
|
+ var imptData = [];
|
|
927
|
+
|
|
928
|
+
|
|
929
|
+ var url = 'WareOutRecord/query.do'
|
|
930
|
+ var param = {
|
|
931
|
+ page: -1,
|
|
932
|
+ rows: -1,
|
|
933
|
+ wareName: this.query.wareName,
|
|
934
|
+ stackName: this.query.stackName,
|
|
935
|
+ model: this.query.model,
|
|
936
|
+ materialName: this.query.materialName,
|
|
937
|
+ standard: this.query.standard,
|
|
938
|
+ customerName: this.query.customerName,
|
|
939
|
+ pFromDate:(!this.query.RecordDate[0]) ? "1970-01-01 00:00:00" : this.query.RecordDate[0].Format("yyyy-MM-dd HH:mm:ss"), //date类型
|
|
940
|
+ pToDate :(!this.query.RecordDate[1]) ? new Date().Format("yyyy-MM-dd HH:mm:ss") :this.query.RecordDate[1].Format("yyyy-MM-dd HH:mm:ss"),
|
|
941
|
+ carNo:this.query.carNo,
|
|
942
|
+ tallyPeople:this.query.tallyPeople,
|
|
943
|
+ fkComponyName:this.query.fkComponyName,
|
|
944
|
+ plateNo: this.query.plateNo.length == 0 ? '' : this.query.plateNo.join(','),
|
|
945
|
+ ordNo: this.query.ordNo == 0 ? '' : this.query.ordNo.join(','),
|
|
946
|
+ contractNo: this.query.contractNo == 0 ? '' : this.query.contractNo.join(','),
|
|
947
|
+ packNo: this.query.packNo == 0 ? '' : this.query.packNo.join(','),
|
|
948
|
+ }
|
|
949
|
+ // alert(JSON.stringify(param))
|
|
950
|
+
|
|
951
|
+ axios.get(url, param).then(response => {
|
|
952
|
+ // alert(JSON.stringify(response))
|
|
953
|
+ if (response.data.code == 0) {
|
|
954
|
+ var imptData = response.data.data;
|
|
955
|
+ if (imptData.length == 0) {
|
|
956
|
+ this.$alert('无法导出,选择时间段无记录', '提示', {
|
|
957
|
+ confirmButtonText: '确定',
|
|
958
|
+ callback: action => {}
|
|
959
|
+ });
|
|
960
|
+ } else {
|
|
961
|
+
|
|
962
|
+ this.exportExcel2(imptData)
|
|
963
|
+ }
|
|
964
|
+ } else {
|
|
965
|
+ this.$message({
|
|
966
|
+ type: 'error',
|
|
967
|
+ message: '操作失败;' + response.data.msg,
|
|
968
|
+ });
|
|
969
|
+ }
|
|
970
|
+
|
|
971
|
+ });
|
|
972
|
+
|
|
973
|
+ },
|
|
974
|
+
|
|
975
|
+ exportExcel2(imptData) {
|
|
976
|
+ console.log(JSON.stringify(imptData))
|
|
977
|
+ const header = ["仓库名称",
|
|
978
|
+ "垛位",
|
|
979
|
+ "层号",
|
|
980
|
+ "品名",
|
|
981
|
+ "钢种",
|
|
982
|
+ "产品编号",
|
|
983
|
+ "订单号",
|
|
984
|
+ "规格型号",
|
|
985
|
+ "出库重量",
|
|
986
|
+ "出库数量",
|
|
987
|
+ "合约号",
|
|
988
|
+ "出库车号",
|
|
989
|
+ "出库时间",
|
|
990
|
+ "货权单位",
|
|
991
|
+ "客户名称",
|
|
992
|
+ "收货地址",
|
|
993
|
+ "产地",
|
|
994
|
+ "捆包号",
|
|
995
|
+ "备注",
|
|
996
|
+ "出库操作人",
|
|
997
|
+ "吊装工",
|
|
998
|
+ "入库车号",
|
|
999
|
+ "入库时间",
|
|
1000
|
+ "入库操作人",
|
|
1001
|
+ "计量方式",
|
|
1002
|
+ "在库时间",
|
|
1003
|
+ "结算价格",
|
|
1004
|
+ "支付方式",
|
|
1005
|
+ "类型"
|
|
1006
|
+
|
|
1007
|
+ ] // 导出的表头名
|
|
1008
|
+ const filterVal = [
|
|
1009
|
+ "wareName",
|
|
1010
|
+ "stackName",
|
|
1011
|
+ "layer",
|
|
1012
|
+ "materialName",
|
|
1013
|
+ "standard",
|
|
1014
|
+ "plateNo",
|
|
1015
|
+ "ordNo",
|
|
1016
|
+ "model",
|
|
1017
|
+ "weight",
|
|
1018
|
+ "count",
|
|
1019
|
+ "contractNo",
|
|
1020
|
+ "outCarNo",
|
|
1021
|
+ "addTime",
|
|
1022
|
+ "fkComponyName",
|
|
1023
|
+ "customerName",
|
|
1024
|
+ "receiveAddress",
|
|
1025
|
+ "productionPlace",
|
|
1026
|
+ "packNo",
|
|
1027
|
+ "remark",
|
|
1028
|
+ "addId",
|
|
1029
|
+ "tallyPeople",
|
|
1030
|
+ "inCarNo",
|
|
1031
|
+ "inTime",
|
|
1032
|
+ "inUser",
|
|
1033
|
+ "wgtDcnMtcCd",
|
|
1034
|
+ "inWareDays",
|
|
1035
|
+ "invoicePrice",
|
|
1036
|
+ "payWay",
|
|
1037
|
+ "recordType"
|
|
1038
|
+ ]
|
|
1039
|
+
|
|
1040
|
+ for(var i=0;i<imptData.length;i++){
|
|
1041
|
+ /*imptData[i]["addUserUserDesc"] = imptData[i].addUser.userDesc;
|
|
1042
|
+ imptData[i]["distributionTruckNo"] = imptData[i].distribution.truckNo;*/
|
|
1043
|
+ imptData[i]["recordType"] = imptData[i]["recordType"] == 0 ? "出库取消" : "出库";
|
|
1044
|
+ }
|
|
1045
|
+ const list = imptData
|
|
1046
|
+ const data = this.formatJson(filterVal, list)
|
|
1047
|
+
|
|
1048
|
+ const filename = '出库单(含价格)' + (new Date()).toLocaleDateString();
|
|
1049
|
+ Export2Excel.export_json_to_excel({
|
|
1050
|
+ header,
|
|
1051
|
+ data,
|
|
1052
|
+ filename
|
|
1053
|
+ })
|
|
1054
|
+ },
|
923
|
1055
|
},
|
|
1056
|
+
|
|
1057
|
+
|
924
|
1058
|
}
|
925
|
1059
|
</script>
|
926
|
1060
|
|