timeDetailsWeight.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. // 计费详单
  2. <template>
  3. <div class="steel_inbound">
  4. <div class="sache">
  5. <span>详单时间:</span>
  6. <el-date-picker
  7. v-model="startTime"
  8. type="datetime"
  9. placeholder="选择日期"
  10. >
  11. </el-date-picker>
  12. <span>至</span>
  13. <el-date-picker
  14. v-model="endTime"
  15. type="datetime"
  16. placeholder="选择日期"
  17. >
  18. </el-date-picker>
  19.       <el-button type="primary" class="btn" @click="onclick">
  20.         <i class="el-icon-search"></i>查询
  21.       </el-button>
  22. <el-button type="primary" @click="exportData()"><i class="el-icon-download"></i>导出(Excel)</el-button>
  23. <span style="margin-left: 1rem;">合计时间:</span>
  24. <el-input v-model="totalTime" :disabled="true" style="width: 140px;"></el-input>
  25. <span style="margin-left: 1rem;">合计金额:</span>
  26. <el-input v-model="totalMoney" :disabled="true" style="width: 100px;"></el-input>
  27. </div>
  28. <div class="table">
  29. <el-tabs v-model="activeName">
  30. <!-- 未结算 -->
  31. <el-tab-pane label="未结算" name="first">
  32. <dilTable v-bind.sync="options1" ref="excelDom" @func="func">
  33. </dilTable>
  34. </el-tab-pane>
  35. <!-- 已结算 -->
  36. <el-tab-pane label="已结算" name="second">
  37. <dilTable v-bind.sync="options2">
  38. </dilTable>
  39. </el-tab-pane>
  40. </el-tabs>
  41. </div>
  42. </div>
  43. </template>
  44. <script>
  45. import { sjTime } from '@/utils/sharedJsFile';
  46. import { getCookie } from '@/utils/util.js';
  47. export default {
  48. data(){
  49. return{
  50. startTime: null,
  51. endTime: null,
  52. totalMoney:null,
  53. totalTime:null,
  54. //单价
  55. Fee:null,
  56. //加载
  57. selectLineLoading:false,
  58. input:"",
  59. activeName:"first",
  60. ssoId:null,
  61. //详单Id
  62. detailsId:null,
  63. options1:{
  64. // first请求数据的地址
  65. requestUrl: "",
  66. },
  67. options2:{
  68. // second请求数据的地址
  69. requestUrl: "",
  70. },
  71. //是否打开修改详单地址弹出框
  72. dialogFormVisible:false,
  73. //原详单单价
  74. originalPriceValue:null,
  75. //新详单单价
  76. newPriceValue:null,
  77. //原详单地址
  78. originalAddress:null,
  79. //新详单地址
  80. newAddress:null,
  81. //新单价Id
  82. priceId:null,
  83. //是否打开运输单价的模态框
  84. addressDrawer:false,
  85. //运输单价的表格
  86. Address: {
  87. requestUrl: "/api/v1/ams/getAddressDeliveryAddress?apiId=255",
  88. selectionType: "radio",
  89. },
  90. // addressText:null,
  91. //缓存当前选中的运输单价
  92. priceMap:{},
  93. formLabelWidth: '125px',
  94. tableTitle:'内转计时计费详单'
  95. }
  96. },
  97. created(){
  98. this.options1GetRequestUrl();
  99. this.options2GetRequestUrl();
  100. },
  101. methods:{
  102. //未结算数据
  103. options1GetRequestUrl(){
  104. if(getCookie("orgCode") == "chengyunshang"){
  105. this.ssoId=getCookie('userId');
  106. this.options1.requestUrl = "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=0&carrierSsoId="+ getCookie('userId');
  107. }else if(getCookie("orgCode") == "dagangadmin"||getCookie("orgCode")=="zidonghuabu"||getCookie("orgCode")=="wuliuchuyunzhongxin"){
  108. this.options1.requestUrl = "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=0"
  109. }else{
  110. this.options1.requestUrl = "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=0&userId=" + getCookie("orgCode");
  111. }
  112. },
  113. //已结算数据
  114. options2GetRequestUrl(){
  115. if(getCookie("orgCode") == "chengyunshang"){
  116. this.ssoId=getCookie('userId');
  117. this.options2.requestUrl = "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=1&carrierSsoId="+ getCookie('userId');
  118. }else if(getCookie("orgCode") == "dagangadmin"||getCookie("orgCode")=="zidonghuabu"||getCookie("orgCode")=="wuliuchuyunzhongxin"){
  119. this.options2.requestUrl = "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=1"
  120. }else{
  121. this.options2.requestUrl = "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=1&userId=" + getCookie("orgCode");
  122. }
  123. },
  124. toInsert() {
  125. this.$router.push("/insertCheckInventory");
  126. },
  127. func(res){
  128. console.log(res);
  129. var totalAllTime = 0;
  130. var totalAllMoney = 0;
  131. res.list.forEach(e => {
  132. totalAllTime = totalAllTime + e.resultTime
  133. totalAllMoney = totalAllMoney + e.detailsAmount
  134. });
  135. this.totalMoney = totalAllMoney;
  136. this.totalTime = totalAllTime;
  137. },
  138. onclick(){
  139. let startTime = null;
  140. let endTime = null;
  141. if(this.startTime){
  142. startTime = sjTime(this.startTime);
  143. }
  144. if(this.endTime){
  145. endTime = sjTime(this.endTime);
  146. }
  147. if(startTime && endTime){
  148. if(startTime < endTime){
  149. if(getCookie("orgCode") == "dagangadmin" || getCookie("orgCode") == "zidonghuabu"||getCookie("orgCode")=="wuliuchuyunzhongxin"){
  150. this.options1.requestUrl = "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=0" + "&startTime=" + startTime + "&endTime=" + endTime + "&i" +new Date();
  151. this.options2.requestUrl = "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=1" + "&startTime=" + startTime + "&endTime=" + endTime + "&i" +new Date();
  152. }else if(getCookie("orgCode") == "chengyunshang"){
  153. this.options1.requestUrl = "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=0&carrierSsoId="+ getCookie('userId') + "&startTime=" + startTime + "&endTime=" + endTime + "&i" +new Date();
  154. this.options2.requestUrl = "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=1&carrierSsoId="+ getCookie('userId') + "&startTime=" + startTime + "&endTime=" + endTime + "&i" +new Date();
  155. }else{
  156. this.options1.requestUrl = "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=0&userId=" + getCookie("orgCode") + "&startTime=" + startTime + "&endTime=" + endTime + "&i" +new Date();
  157. this.options2.requestUrl = "/api/v1/bms/getInwardWeightDetailsOrder?apiId=465&orderType=21&detailStatus=1&userId=" + getCookie("orgCode") + "&startTime=" + startTime + "&endTime=" + endTime + "&i" +new Date();
  158. }
  159. }else{
  160. this.startTime = null;
  161. this.endTime = null;
  162. this.$message.warning('开始时间要比结束时间早')
  163. }
  164. }else{
  165. }
  166. },
  167. //运输订单点击浏览的事件
  168. select(){
  169. this.addressDrawer = true;
  170. },
  171. //运输单价模态窗口的框计算
  172. selectAddressClick(){
  173. this.Price.requestUrl = '/api/v1/ams/getAddressDeliveryAddress?apiId=255&con='+this.addressText;
  174. },
  175. }
  176. }
  177. </script>
  178. <style lang="scss" scode>
  179. .steel_inbound{
  180. .sache{
  181. padding: 1.25rem 0.375rem;
  182. .el-input {
  183. width: 20%;
  184. margin-right: 1.25rem;
  185. }
  186. }
  187. }
  188. </style>