index.vue 12 KB

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