index.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="query"
  5. ref="queryForm"
  6. v-show="showSearch"
  7. :inline="true"
  8. >
  9. <el-row>
  10. <el-form-item label="货主" prop="fCorpid">
  11. <el-select
  12. v-model="query.fCorpid"
  13. filterable
  14. remote
  15. style="width: 80%"
  16. :remote-method="corpsRemoteMethod"
  17. placeholder="请输入模糊查找"
  18. >
  19. <el-option
  20. v-for="(dict, index) in fMblnoOptions"
  21. :key="index.fId"
  22. :label="dict.fName"
  23. :value="dict.fId"
  24. ></el-option>
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item label="提单号" prop="fMblno">
  28. <el-input
  29. v-model="query.fMblno"
  30. placeholder="请输入提单号"
  31. clearable
  32. size="small"
  33. />
  34. </el-form-item>
  35. <el-form-item label="日期" prop="bsdateList">
  36. <el-date-picker
  37. v-model="query.bsdateList"
  38. type="daterange"
  39. range-separator="至"
  40. start-placeholder="开始日期"
  41. value-format="yyyy-MM-dd HH:mm:ss"
  42. :default-time="['00:00:00', '23:59:59']"
  43. end-placeholder="结束日期">
  44. </el-date-picker>
  45. </el-form-item>
  46. </el-row>
  47. </el-form>
  48. <el-row :gutter="10" class="mb8">
  49. <el-col :span="1.5">
  50. <el-button
  51. type="primary"
  52. icon="el-icon-plus"
  53. size="mini"
  54. @click="getList"
  55. v-hasPermi="['warehouseBusiness:containerPort:add']"
  56. >查询
  57. </el-button>
  58. </el-col>
  59. <el-col :span="1.5">
  60. <el-button
  61. type="warning"
  62. icon="el-icon-download"
  63. size="mini"
  64. @click="exportOne"
  65. >导出
  66. </el-button>
  67. </el-col>
  68. <!-- <el-col :span="1.5">-->
  69. <!-- <el-button-->
  70. <!-- type="danger"-->
  71. <!-- icon="el-icon-delete"-->
  72. <!-- size="mini"-->
  73. <!-- :disabled="multiple"-->
  74. <!-- @click="handleDelete"-->
  75. <!-- v-hasPermi="['agreement:agreementTask:remove']"-->
  76. <!-- >删除-->
  77. <!-- </el-button>-->
  78. <!-- </el-col>-->
  79. <!-- <el-col :span="1.5">-->
  80. <!-- <el-button-->
  81. <!-- type="info"-->
  82. <!-- icon="el-icon-download"-->
  83. <!-- size="mini"-->
  84. <!-- :disabled="single"-->
  85. <!-- @click="handleUpdate(null, 2)"-->
  86. <!-- v-hasPermi="['agreement:agreementStorage:export']"-->
  87. <!-- >复制新增-->
  88. <!-- </el-button>-->
  89. <!-- </el-col>-->
  90. <right-toolbar
  91. :showSearch.sync="showSearch"
  92. @queryTable="getList"
  93. ></right-toolbar>
  94. </el-row>
  95. <el-form :inline="true" :model="formInline" class="demo-form-inline">
  96. <el-form-item label="货主">
  97. <el-select
  98. v-model="query.fCorpid"
  99. filterable
  100. remote
  101. style="width: 80%"
  102. :remote-method="corpsRemoteMethod"
  103. placeholder="请输入模糊查找"
  104. disabled
  105. >
  106. <el-option
  107. v-for="(dict, index) in fMblnoOptions"
  108. :key="index.fId"
  109. :label="dict.fName"
  110. :value="dict.fId"
  111. ></el-option>
  112. </el-select>
  113. </el-form-item>
  114. <el-form-item label="提单号">
  115. <el-input v-model="query.fMblno" placeholder="提单号" disabled></el-input>
  116. </el-form-item>
  117. <el-form-item label="品名">
  118. <el-input v-model="formInline.goodsName" placeholder="请输入品名" disabled></el-input>
  119. </el-form-item>
  120. </el-form>
  121. <el-table
  122. :data="tableData"
  123. style="width: 100%"
  124. ref="table1"
  125. :height="tableHeight1"
  126. >
  127. <el-table-column type="selection" width="60" align="center" />
  128. <el-table-column type="index" label="行号" align="center"/>
  129. <el-table-column prop="fBusinessType" label="作业类型" width="180" align="center"/>
  130. <el-table-column prop="fCntval" label="箱型箱量" width="180" align="center"/>
  131. <el-table-column prop="inBsdate" label="入库日期" width="180" align="center"/>
  132. <el-table-column prop="inQty" label="入库件数" width="180" align="center"/>
  133. <el-table-column prop="inGrossweight" label="入库毛重" width="180" align="center"/>
  134. <el-table-column prop="outBsdate" label="出库日期" width="180" align="center"/>
  135. <el-table-column prop="outQty" label="出库件数" width="180" align="center"/>
  136. <el-table-column prop="outGrossweight" label="出库毛重" width="180" align="center"/>
  137. <el-table-column prop="fQtyblc" label="结余件数" width="180" align="center"/>
  138. <el-table-column prop="fGrossweightblc" label="结余毛重" width="180" align="center"/>
  139. <el-table-column prop="fBilltype" label="业务类型" width="180" align="center"/>
  140. <el-table-column prop="remark" label="备注" width="180" align="center"/>
  141. </el-table>
  142. <h3>
  143. <i class="el-icon-coin"></i>费用明细
  144. <el-button
  145. type="warning"
  146. icon="el-icon-download"
  147. size="mini"
  148. @click="exportTwo"
  149. >导出
  150. </el-button>
  151. </h3>
  152. <el-table
  153. :data="costData"
  154. style="width: 100%"
  155. ref="table2"
  156. :height="tableHeight2"
  157. >
  158. <el-table-column type="selection" width="60" align="center" />
  159. <el-table-column type="index" label="行号" align="center"/>
  160. <el-table-column prop="createTime" label="日期" width="180" align="center"/>
  161. <el-table-column prop="fBusinessType" label="作业类型" width="180" align="center"/>
  162. <el-table-column prop="fFeeid" label="费用" width="180" align="center"/>
  163. <el-table-column prop="fQty" label="数量" align="center"/>
  164. <el-table-column prop="fUnitprice" label="单价" align="center"/>
  165. <el-table-column prop="fAmount" label="金额" align="center"/>
  166. <el-table-column prop="remark" label="备注" align="center"/>
  167. </el-table>
  168. </div>
  169. </template>
  170. <script>
  171. import { listpayable , exportOne , exportTwo} from '@/api/singleTicket'
  172. import {listCorps} from "@/api/basicdata/corps";
  173. export default {
  174. name: "index",
  175. data(){
  176. return{
  177. tableHeight1: '0',
  178. tableHeight2: '0',
  179. query:{},
  180. costData:[],
  181. formInline:{},
  182. tableData:[],
  183. showSearch: true,
  184. fMblnoOptions:[]
  185. }
  186. },
  187. created() {
  188. let date = new Date();
  189. let year = parseInt(date.getFullYear())
  190. let month = parseInt(date.getMonth() + 1)
  191. let currentMonth = date.getMonth()
  192. let nextMonth = ++currentMonth
  193. let nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1) // 下个月的第一天
  194. let oneDay = 1000*60*60*24
  195. let lastTime = new Date(nextMonthFirstDay - oneDay) // 下个月的第一天减去一天,就是上个月的最后一天
  196. let day = lastTime.getDate()
  197. if (day < 10) {
  198. day = '0' + day
  199. }
  200. this.$set(this.query,'bsdateList', [year + '-' + month + '-' + '01 00:00:00', year + '-' + month + '-' + day + ' 23:59:59'])
  201. },
  202. mounted() {
  203. this.$nextTick(() => {
  204. // 根据浏览器高度设置初始高度
  205. this.tableHeight1 = (window.innerHeight - this.$refs.table1.$el.offsetTop - 160) / 2
  206. // 监听浏览器高度变化,改变表格高度
  207. window.onresize = () => {
  208. this.tableHeight1 = (window.innerHeight - this.$refs.table1.$el.offsetTop - 70) /2
  209. }
  210. });
  211. this.$nextTick(() => {
  212. // 根据浏览器高度设置初始高度
  213. this.tableHeight2 = (window.innerHeight - this.$refs.table1.$el.offsetTop - 160) / 2
  214. // 监听浏览器高度变化,改变表格高度
  215. window.onresize = () => {
  216. this.tableHeight2 = (window.innerHeight - this.$refs.table1.$el.offsetTop - 70) /2
  217. }
  218. })
  219. },
  220. methods:{
  221. getList(){
  222. listpayable(this.query).then(res=>{
  223. this.costData = res.data.feeList
  224. this.tableData = res.data.singleAnalysis
  225. for (let item in this.tableData){
  226. if (this.tableData[item].inQty == 0){
  227. this.tableData[item].inQty = ''
  228. }
  229. if (this.tableData[item].inGrossweight == 0){
  230. this.tableData[item].inGrossweight = ''
  231. }
  232. if (this.tableData[item].outGrossweight == 0){
  233. this.tableData[item].outGrossweight = ''
  234. }
  235. if (this.tableData[item].fQtyblc == 0){
  236. this.tableData[item].fQtyblc = ''
  237. }
  238. if (this.tableData[item].fGrossweightblc == 0){
  239. this.tableData[item].fGrossweightblc = ''
  240. }
  241. if (this.tableData[item].outQty == 0){
  242. this.tableData[item].outQty = ''
  243. }
  244. }
  245. this.formInline.goodsName = res.data.goodsName
  246. })
  247. },
  248. exportOne(){
  249. let query = this.query
  250. this.$confirm("是否确认导出", "警告", {
  251. confirmButtonText: "确定",
  252. cancelButtonText: "取消",
  253. type: "warning",
  254. }).then(function () {
  255. return exportOne(query);
  256. }).then((response) => {
  257. this.download(response.msg);
  258. });
  259. },
  260. exportTwo(){
  261. let query = this.query
  262. this.$confirm("是否确认导出", "警告", {
  263. confirmButtonText: "确定",
  264. cancelButtonText: "取消",
  265. type: "warning",
  266. }).then(function () {
  267. return exportTwo(query);
  268. }).then((response) => {
  269. this.download(response.msg);
  270. });
  271. },
  272. corpsRemoteMethod(name) {
  273. if (name == null || name === "") {
  274. return false;
  275. }
  276. let queryParams = { pageNum: 1, fName: name, type: 1 };
  277. listCorps(queryParams).then((response) => {
  278. this.fMblnoOptions = response.rows;
  279. });
  280. },
  281. resetQuery(){},
  282. }
  283. }
  284. </script>
  285. <style scoped>
  286. </style>