index.vue 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="76px">
  4. <el-form-item label="客户" prop="fCorpid">
  5. <el-select v-model="queryParams.fCorpid" filterable remote style="width: 200px" clearable size="small"
  6. @keyup.enter.native="handleQuery" :remote-method="corpsRemoteMethod" placeholder="请选择客户">
  7. <el-option v-for="(dict, index) in fMblnoOptions" :key="index.fId" :label="dict.fName" :value="dict.fId">
  8. </el-option>
  9. </el-select>
  10. </el-form-item>
  11. <el-form-item label="提单号" prop="fMblno">
  12. <el-input v-model="queryParams.fMblno" placeholder="请输入提单号" clearable style="width: 200px" size="small"
  13. @keyup.enter.native="handleQuery" />
  14. </el-form-item>
  15. <el-form-item label="箱号" prop="fCntrno">
  16. <el-input v-model="queryParams.fCntrno" placeholder="请输入箱号" clearable style="width: 200px" size="small"
  17. @keyup.enter.native="handleQuery" />
  18. </el-form-item>
  19. <el-form-item label="入库日期" prop="createTime">
  20. <el-date-picker v-model="queryParams.orgStorageDate" type="daterange" value-format="yyyy-MM-dd" clearable
  21. size="small" style="width: 240px" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
  22. @keyup.enter.native="handleQuery" :picker-options="pickerOptions" unlink-panels>
  23. </el-date-picker>
  24. </el-form-item>
  25. <el-form-item label="仓库" prop="fwarehouseid">
  26. <treeselect style="width: 200px" v-model="queryParams.fWarehouseLocationid" :options="fWarehouseidOption"
  27. @select="treeseLect" :show-count="true" size="small" placeholder="请选择归属库区" />
  28. </el-form-item>
  29. <el-form-item label="货物名称" prop="fgoodsid">
  30. <el-select v-model="queryParams.fGoodsid" filterable remote style="width: 200px" clearable size="small"
  31. :remote-method="goodsRemoteMethod" @keyup.enter.native="handleQuery" placeholder="请选择货物名称">
  32. <el-option v-for="(dict, index) in goodsOptions" :key="index.fId" :label="dict.fName" :value="dict.fId">
  33. </el-option>
  34. </el-select>
  35. </el-form-item>
  36. <el-form-item label="贸易方式" prop="fTrademodeid">
  37. <el-select v-model="queryParams.fTrademodeid" placeholder="请选择贸易方式" clearable style="width: 200px" size="small"
  38. @keyup.enter.native="handleQuery">
  39. <el-option v-for="(dict, index) in fTrademodeidOptions" :key="index.dictValue" :label="dict.dictLabel"
  40. :value="dict.dictValue" />
  41. </el-select>
  42. </el-form-item>
  43. <el-form-item label="分组条件">
  44. <el-select v-model="queryParams.isCntrno" filterable remote style="width: 200px" clearable size="small"
  45. placeholder="请选择分组条件">
  46. <el-option v-for="(dict, index) in isCntrnoOptions" :key="index.id" :label="dict.name" :value="dict.id">
  47. </el-option>
  48. </el-select>
  49. </el-form-item>
  50. <el-form-item label="库存箱号" prop="fLocalcntrno">
  51. <el-input v-model="queryParams.fLocalcntrno" placeholder="库存箱号" clearable style="width: 200px" size="small"
  52. @keyup.enter.native="handleQuery" />
  53. </el-form-item>
  54. <el-form-item label="属性详情" prop="fMarks">
  55. <el-input v-model="queryParams.fMarks" placeholder="属性详情" clearable style="width: 200px" size="small" />
  56. </el-form-item>
  57. <el-form-item label="显示0库存" prop="isMblno">
  58. <el-select v-model="queryParams.isMblno" filterable remote style="width: 200px" clearable size="small">
  59. <el-option label="是" :value="1"></el-option>
  60. <el-option label="否" :value="0"></el-option>
  61. </el-select>
  62. </el-form-item>
  63. <el-form-item label="核注清单" prop="checklists">
  64. <el-input v-model="queryParams.checklists" placeholder="核注清单" clearable @keyup.enter.native="handleQuery"
  65. style="width: 200px" />
  66. </el-form-item>
  67. <!-- <el-form-item>-->
  68. <!-- -->
  69. <!-- </el-form-item>-->
  70. </el-form>
  71. <el-row :gutter="10" class="mb8">
  72. <div class="tabSetting">
  73. <el-col :span="1.5">
  74. <el-button type="primary" icon="el-icon-download" size="mini" @click="warehouseSupervise">分类监管仓库导出</el-button>
  75. <el-button type="primary" icon="el-icon-download" size="mini" @click="superviseExport"
  76. v-hasPermi="['warehouseBusiness:whgenleg:superviseExport']">分类监管导出</el-button>
  77. <el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport"
  78. v-hasPermi="['warehouseBusiness:whgenleg:export']">导出</el-button>
  79. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  80. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  81. </el-col>
  82. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  83. <div style="margin: 0 12px">
  84. <el-button icon="el-icon-setting" size="mini" circle @click="showSetting = !showSetting"></el-button>
  85. </div>
  86. </div>
  87. </el-row>
  88. <el-dialog title="自定义列显示" :visible.sync="showSetting" width="700px">
  89. <div>配置排序列数据(拖动调整顺序)</div>
  90. <div style="margin-left: 17px">
  91. <el-checkbox v-model="allCheck" label="全选" @change="allChecked"></el-checkbox>
  92. </div>
  93. <div style="padding: 4px; display: flex; justify-content: center">
  94. <draggable v-model="setRowList" group="site" animation="300" @start="onStart" @end="onEnd"
  95. handle=".indraggable">
  96. <transition-group>
  97. <div v-for="item in setRowList" :key="item.surface" class="listStyle">
  98. <div style="width: 500px" class="indraggable">
  99. <div class="progress" :style="{ width: item.width + 'px' }">
  100. <el-checkbox :label="item.name" v-model="item.checked" :true-label="0" :false-label="1">{{ item.name
  101. }}
  102. </el-checkbox>
  103. </div>
  104. </div>
  105. <el-input-number v-model.number="item.width" controls-position="right" :min="1" :max="500" size="mini">
  106. </el-input-number>
  107. </div>
  108. </transition-group>
  109. </draggable>
  110. </div>
  111. <span slot="footer" class="dialog-footer">
  112. <el-button @click="showSetting = false">取 消</el-button>
  113. <el-button @click="delRow" type="danger">重 置</el-button>
  114. <el-button type="primary" @click="save()">确 定</el-button>
  115. </span>
  116. </el-dialog>
  117. <el-table v-loading="loading" :data="whgenlegList" show-summary :summary-method="getSum" ref="table"
  118. :height="tableHeight">
  119. <el-table-column type="index" label="行号" align="center" width="100" fixed />
  120. <el-table-column v-for="(item, index) in getRowList" :key="index" :label="item.name" :width="item.width"
  121. :prop="item.label" align="center" :show-overflow-tooltip="true" sortable :fixed="item.fixed">
  122. <template slot-scope="scope">
  123. <span v-if="item.label == 'fMblno'">
  124. <span v-if="queryParams.isCntrno == 2">{{ scope.row.fMblno }}</span>
  125. <el-link v-else :underline="false" type="primary">
  126. <div @click="goDetail(scope.row)">
  127. {{ scope.row.fMblno }}
  128. </div>
  129. </el-link>
  130. </span>
  131. <span v-else>{{ scope.row[item.label] }}</span>
  132. </template>
  133. </el-table-column>
  134. </el-table>
  135. <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
  136. :page-sizes="[50, 100, 200, 500, 1000]" @pagination="getList" />
  137. <!-- 添加或修改库存总账对话框 -->
  138. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  139. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  140. <el-form-item label="原始入库业务编号" prop="fOriginalbillno">
  141. <el-input v-model="form.fOriginalbillno" placeholder="请输入原始入库业务编号" />
  142. </el-form-item>
  143. <el-form-item label="上期件数" prop="fPreqty">
  144. <el-input v-model="form.fPreqty" placeholder="请输入上期件数" />
  145. </el-form-item>
  146. <el-form-item label="上期毛重,单位为吨,保留6位小数" prop="fPregrossweight">
  147. <el-input v-model="form.fPregrossweight" placeholder="请输入上期毛重,单位为吨,保留6位小数" />
  148. </el-form-item>
  149. <el-form-item label="上期净重," prop="fPrenetweight">
  150. <el-input v-model="form.fPrenetweight" placeholder="请输入上期净重," />
  151. </el-form-item>
  152. <el-form-item label="入库件数" prop="fQtyd">
  153. <el-input v-model="form.fQtyd" placeholder="请输入入库件数" />
  154. </el-form-item>
  155. <el-form-item label="入库尺码" prop="fVolumnd">
  156. <el-input v-model="form.fVolumnd" placeholder="请输入入库尺码" />
  157. </el-form-item>
  158. <el-form-item label="入库毛重" prop="fGrossweightd">
  159. <el-input v-model="form.fGrossweightd" placeholder="请输入入库毛重" />
  160. </el-form-item>
  161. <el-form-item label="入库净重" prop="fNetweightd">
  162. <el-input v-model="form.fNetweightd" placeholder="请输入入库净重" />
  163. </el-form-item>
  164. <el-form-item label="出口尺码" prop="fVolumnc">
  165. <el-input v-model="form.fVolumnc" placeholder="请输入出口尺码" />
  166. </el-form-item>
  167. <el-form-item label="出库件数" prop="fQtyc">
  168. <el-input v-model="form.fQtyc" placeholder="请输入出库件数" />
  169. </el-form-item>
  170. <el-form-item label="结余件数" prop="fQtyblc">
  171. <el-input v-model="form.fQtyblc" placeholder="请输入结余件数" />
  172. </el-form-item>
  173. <el-form-item label="出库毛重,单位为吨" prop="fGrossweightc">
  174. <el-input v-model="form.fGrossweightc" placeholder="请输入出库毛重,单位为吨" />
  175. </el-form-item>
  176. <el-form-item label="出库净重" prop="fNetweightc">
  177. <el-input v-model="form.fNetweightc" placeholder="请输入出库净重" />
  178. </el-form-item>
  179. <el-form-item label="结余毛重" prop="fGrossweightblc">
  180. <el-input v-model="form.fGrossweightblc" placeholder="请输入结余毛重" />
  181. </el-form-item>
  182. <el-form-item label="结余净重" prop="fNetweightblc">
  183. <el-input v-model="form.fNetweightblc" placeholder="请输入结余净重" />
  184. </el-form-item>
  185. <el-form-item label="箱号" prop="fCntrno">
  186. <el-input v-model="form.fCntrno" placeholder="请输入箱号" />
  187. </el-form-item>
  188. <el-form-item label="状态,默认 T ,正常T 停用F 下拉选择">
  189. <el-radio-group v-model="form.fStatus">
  190. <el-radio label="1">请选择字典生成</el-radio>
  191. </el-radio-group>
  192. </el-form-item>
  193. <el-form-item label="删除状态" prop="delFlag">
  194. <el-input v-model="form.delFlag" placeholder="请输入删除状态" />
  195. </el-form-item>
  196. <el-form-item label="唛头" prop="fMarks">
  197. <el-input v-model="form.fMarks" placeholder="请输入唛头" />
  198. </el-form-item>
  199. <el-form-item label="备注" prop="remark">
  200. <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
  201. </el-form-item>
  202. </el-form>
  203. <div slot="footer" class="dialog-footer">
  204. <el-button type="primary" @click="submitForm">确 定</el-button>
  205. <el-button @click="cancel">取 消</el-button>
  206. </div>
  207. </el-dialog>
  208. </div>
  209. </template>
  210. <script>
  211. import {
  212. mapListWhgenleg,
  213. getWhgenleg,
  214. delWhgenleg,
  215. addWhgenleg,
  216. updateWhgenleg,
  217. exportWhgenleg,
  218. superviseExportWhgenleg,
  219. warehouseSupervise
  220. } from '@/api/reportManagement/whgenleg'
  221. import { listWarehouse, treeselect } from "@/api/basicdata/warehouse";
  222. import { listArea } from "@/api/basicdata/area";
  223. import { listGoods } from "@/api/basicdata/goods";
  224. import { listCorps } from "@/api/basicdata/corps";
  225. import Treeselect from "@riophae/vue-treeselect";
  226. import { addSet, select, resetModule } from "@/api/system/set";
  227. import Cookies from "js-cookie";
  228. import draggable from "vuedraggable";
  229. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  230. export default {
  231. name: "Whgenleg",
  232. components: {
  233. Treeselect,
  234. draggable,
  235. },
  236. data() {
  237. return {
  238. pickerOptions: {
  239. shortcuts: [{
  240. text: '最近一周',
  241. onClick(picker) {
  242. const end = new Date();
  243. const start = new Date();
  244. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  245. picker.$emit('pick', [start, end]);
  246. }
  247. }, {
  248. text: '最近一个月',
  249. onClick(picker) {
  250. const end = new Date();
  251. const start = new Date();
  252. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  253. picker.$emit('pick', [start, end]);
  254. }
  255. }, {
  256. text: '最近三个月',
  257. onClick(picker) {
  258. const end = new Date();
  259. const start = new Date();
  260. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  261. picker.$emit('pick', [start, end]);
  262. }
  263. }]
  264. },
  265. tableHeight: '0',
  266. //仓库树状下拉
  267. fWarehouseidOption: [],
  268. // 客户(客户数据)
  269. fMblnoOptions: [],
  270. // 贸易方式(数据字典),对应t_trademodels 字典
  271. fTrademodeidOptions: [],
  272. // 货物
  273. goodsOptions: [],
  274. // 仓库(仓库数据)
  275. warehouseOptions: [],
  276. kqhouseOptions: [],
  277. // 遮罩层
  278. loading: true,
  279. // 显示搜索条件
  280. showSearch: true,
  281. // 总条数
  282. total: 0,
  283. // 库存总账表格数据
  284. whgenlegList: [],
  285. // 弹出层标题
  286. title: "",
  287. // 是否显示弹出层
  288. open: false,
  289. // 查询参数
  290. queryParams: {
  291. pageNum: 1,
  292. pageSize: 50,
  293. fOriginalbillno: null,
  294. isCntrno: null,
  295. fPreqty: null,
  296. fLocalcntrno: null,
  297. fPregrossweight: null,
  298. fPrenetweight: null,
  299. fQtyd: null,
  300. fVolumnd: null,
  301. fGrossweightd: null,
  302. fNetweightd: null,
  303. fVolumnc: null,
  304. fQtyc: null,
  305. fQtyblc: null,
  306. fGrossweightc: null,
  307. fNetweightc: null,
  308. fGrossweightblc: null,
  309. fNetweightblc: null,
  310. fCntrno: null,
  311. fStatus: null,
  312. fMarks: null,
  313. orgStorageDate: null,
  314. fBusinessType: null,
  315. fBusinessTypes: null,
  316. },
  317. // 表单参数
  318. form: {},
  319. // 表单校验
  320. rules: {
  321. fMarks: [{ required: true, message: "唛头不能为空", trigger: "blur" }],
  322. },
  323. showSetting: false,
  324. drag: false,
  325. setRowList: [],
  326. getRowList: [],
  327. tableDate: [
  328. {
  329. surface: "0",
  330. label: "fMblno",
  331. name: "提单号",
  332. checked: 0,
  333. width: 100,
  334. fixed: "left",
  335. },
  336. {
  337. surface: "1",
  338. label: "fCorpid",
  339. name: "客户",
  340. checked: 0,
  341. width: 100,
  342. fixed: "left",
  343. },
  344. {
  345. surface: "2",
  346. label: "fOriginalbilldate",
  347. name: "入库日期",
  348. checked: 0,
  349. width: 100,
  350. fixed: "left",
  351. },
  352. {
  353. surface: "3",
  354. label: "fChargedate",
  355. name: "仓储费日期",
  356. checked: 0,
  357. width: 150,
  358. fixed: "left",
  359. },
  360. {
  361. surface: "4",
  362. label: "fBusinessTypes",
  363. name: "货物属性",
  364. checked: 0,
  365. width: 100,
  366. },
  367. {
  368. surface: "5",
  369. label: "fMarks",
  370. name: "属性详情",
  371. checked: 0,
  372. width: 100,
  373. },
  374. {
  375. surface: "6",
  376. label: "fGoodsids",
  377. name: "品名",
  378. checked: 0,
  379. width: 100,
  380. },
  381. {
  382. surface: "8",
  383. label: "fWarehouseids",
  384. name: "仓库",
  385. checked: 0,
  386. width: 100,
  387. },
  388. {
  389. surface: "9",
  390. label: "fTrademodeid",
  391. name: "贸易方式",
  392. checked: 0,
  393. width: 100,
  394. },
  395. {
  396. surface: "10",
  397. label: "fQtyD",
  398. name: "入库件数",
  399. checked: 0,
  400. width: 100,
  401. },
  402. {
  403. surface: "11",
  404. label: "fGrossweightD",
  405. name: "入库毛重(kg)",
  406. checked: 0,
  407. width: 200,
  408. },
  409. {
  410. surface: "12",
  411. label: "fNetweightD",
  412. name: "入库净重(kg)",
  413. checked: 0,
  414. width: 200,
  415. },
  416. {
  417. surface: "13",
  418. label: "fQtyC",
  419. name: "出库件数",
  420. checked: 0,
  421. width: 100,
  422. },
  423. {
  424. surface: "14",
  425. label: "fGrossweightC",
  426. name: "出库毛重(kg)",
  427. checked: 0,
  428. width: 200,
  429. },
  430. {
  431. surface: "15",
  432. label: "fNetweightC",
  433. name: "出库净重(kg)",
  434. checked: 0,
  435. width: 200,
  436. },
  437. {
  438. surface: "16",
  439. label: "fQtyblc",
  440. name: "结余件数",
  441. checked: 0,
  442. width: 100,
  443. },
  444. {
  445. surface: "17",
  446. label: "fGrossweightblc",
  447. name: "结余毛重(kg)",
  448. checked: 0,
  449. width: 200,
  450. },
  451. {
  452. surface: "18",
  453. label: "fNetweightblc",
  454. name: "结余净重(kg)",
  455. checked: 0,
  456. width: 200,
  457. },
  458. {
  459. surface: "19",
  460. label: "fCntrno",
  461. name: "箱号",
  462. checked: 0,
  463. width: 100,
  464. },
  465. {
  466. surface: "20",
  467. label: "remark",
  468. name: "备注",
  469. checked: 0,
  470. width: 100,
  471. },
  472. {
  473. surface: "21",
  474. label: "fLocalcntrno",
  475. name: "库存箱号",
  476. checked: 0,
  477. width: 100,
  478. },
  479. {
  480. surface: "22",
  481. label: "lockStatus",
  482. name: "是否出质",
  483. checked: 0,
  484. width: 100,
  485. },
  486. {
  487. surface: "23",
  488. label: "belongTo",
  489. name: "质押归属人",
  490. checked: 0,
  491. width: 100,
  492. },
  493. {
  494. surface: "24",
  495. label: "lockTime",
  496. name: "锁定时间",
  497. checked: 0,
  498. width: 100,
  499. },
  500. {
  501. surface: "25",
  502. label: "unlockTime",
  503. name: "解锁时间",
  504. checked: 0,
  505. width: 100,
  506. },
  507. {
  508. surface: "26",
  509. label: "wrNumber",
  510. name: "仓单编号",
  511. checked: 0,
  512. width: 100,
  513. }
  514. ],
  515. allCheck: false,
  516. isCntrnoOptions: [
  517. {
  518. id: 1,
  519. name: "箱号",
  520. },
  521. {
  522. id: 2,
  523. name: "提单号",
  524. },
  525. ],
  526. };
  527. },
  528. created() {
  529. // let date = new Date();
  530. // let year = parseInt(date.getFullYear())
  531. // let month = parseInt(date.getMonth() + 1)
  532. // let currentMonth = date.getMonth()
  533. // let nextMonth = ++currentMonth
  534. // let nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1) // 下个月的第一天
  535. // let oneDay = 1000*60*60*24
  536. // let lastTime = new Date(nextMonthFirstDay - oneDay) // 下个月的第一天减去一天,就是上个月的最后一天
  537. // let day = lastTime.getDate()
  538. // if (day < 10) {
  539. // day = '0' + day
  540. // }
  541. // this.queryParams.orgStorageDate = [year + '-' + month + '-' + '01 00:00:00', year + '-' + month + '-' + day + ' 23:59:59']
  542. this.setRowList = this.tableDate;
  543. this.getRowList = this.tableDate;
  544. this.getList();
  545. this.getDicts("data_trademodes").then((response) => {
  546. this.fTrademodeidOptions = response.data;
  547. });
  548. treeselect().then((response) => {
  549. this.fWarehouseidOption = response.data;
  550. });
  551. this.getRow();
  552. },
  553. mounted() {
  554. this.$nextTick(() => {
  555. // 监听浏览器高度变化,改变表格高度
  556. window.onresize = () => {
  557. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
  558. }
  559. })
  560. },
  561. methods: {
  562. //列设置全选
  563. allChecked() {
  564. if (this.allCheck == true) {
  565. this.setRowList.map((e) => {
  566. return (e.checked = 0);
  567. });
  568. } else {
  569. this.setRowList.map((e) => {
  570. return (e.checked = 1);
  571. });
  572. }
  573. },
  574. //查询列数据
  575. getRow() {
  576. let that = this;
  577. this.data = {
  578. tableName: "库存总账",
  579. userId: Cookies.get("userName"),
  580. };
  581. select(this.data).then((res) => {
  582. if (res.data.length != 0) {
  583. this.getRowList = res.data.filter((e) => e.checked == 0);
  584. this.setRowList = res.data;
  585. this.setRowList = this.setRowList.reduce((res, item) => {
  586. res.push({
  587. surface: item.surface,
  588. label: item.label,
  589. name: item.name,
  590. checked: item.checked,
  591. width: item.width,
  592. fixed: item.fixed,
  593. });
  594. return res;
  595. }, []);
  596. }
  597. console.log(this.getRowList);
  598. });
  599. },
  600. delRow() {
  601. this.data = {
  602. tableName: "库存总账",
  603. userId: Cookies.get("userName"),
  604. };
  605. resetModule(this.data).then((res) => {
  606. if (res.code == 200) {
  607. this.showSetting = false;
  608. this.setRowList = this.tableDate;
  609. this.getRowList = this.tableDate;
  610. console.log(this.getRowList);
  611. }
  612. });
  613. },
  614. //保存列设置
  615. save() {
  616. this.showSetting = false;
  617. this.data = {
  618. tableName: "库存总账",
  619. userId: Cookies.get("userName"),
  620. sysTableSetList: this.setRowList,
  621. };
  622. addSet(this.data).then((res) => {
  623. if (res.code == 200) {
  624. this.showSetting = false;
  625. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  626. }
  627. });
  628. },
  629. //开始拖拽事件
  630. onStart() {
  631. this.drag = true;
  632. },
  633. //拖拽结束事件
  634. onEnd() {
  635. this.drag = false;
  636. },
  637. //合计
  638. getSum(param) {
  639. const { columns, data } = param;
  640. const sums = [];
  641. var values = [];
  642. columns.forEach((column, index) => {
  643. if (index === 0) {
  644. sums[index] = "总计";
  645. }
  646. if (column.property === "fGrossweightD") {
  647. values = data.map((item) => Number(item["fGrossweightD"]));
  648. }
  649. if (column.property === "fNetweightD") {
  650. values = data.map((item) => Number(item["fNetweightD"]));
  651. }
  652. if (column.property === "fQtyD") {
  653. values = data.map((item) => Number(item["fQtyD"]));
  654. }
  655. if (column.property === "fGrossweightC") {
  656. values = data.map((item) => Number(item["fGrossweightC"]));
  657. }
  658. if (column.property === "fNetweightC") {
  659. values = data.map((item) => Number(item["fNetweightC"]));
  660. }
  661. if (column.property === "fQtyC") {
  662. values = data.map((item) => Number(item["fQtyC"]));
  663. }
  664. if (column.property === "fQtyblc") {
  665. values = data.map((item) => Number(item["fQtyblc"]));
  666. }
  667. if (column.property === "fGrossweightblc") {
  668. values = data.map((item) => Number(item["fGrossweightblc"]));
  669. }
  670. if (column.property === "fNetweightblc") {
  671. values = data.map((item) => Number(item["fNetweightblc"]));
  672. }
  673. if (
  674. column.property === "fGrossweightD" ||
  675. column.property === "fNetweightD" ||
  676. column.property === "fQtyD" ||
  677. column.property === "fGrossweightC" ||
  678. column.property === "fNetweightC" ||
  679. column.property === "fQtyC" ||
  680. column.property === "fQtyblc" ||
  681. column.property === "fGrossweightblc" ||
  682. column.property === "fNetweightblc"
  683. ) {
  684. const values = data.map((item) => Number(item[column.property]));
  685. if (!values.every((value) => isNaN(value))) {
  686. sums[index] = values.reduce((prev, curr) => {
  687. const value = Number(curr);
  688. if (!isNaN(value)) {
  689. return prev + curr;
  690. } else {
  691. return prev;
  692. }
  693. }, 0);
  694. if (column.property === "fGrossweightD") {
  695. sums[index] = (sums[index] / 1000).toFixed(4) + "吨";
  696. }
  697. if (column.property === "fNetweightD") {
  698. sums[index] = (sums[index] / 1000).toFixed(4) + "吨";
  699. }
  700. if (column.property === "fQtyD") {
  701. sums[index] = sums[index];
  702. }
  703. if (column.property === "fGrossweightC") {
  704. sums[index] = (sums[index] / 1000).toFixed(4) + "吨";
  705. }
  706. if (column.property === "fNetweightC") {
  707. sums[index] = (sums[index] / 1000).toFixed(4) + "吨";
  708. }
  709. if (column.property === "fQtyC") {
  710. sums[index] = sums[index];
  711. }
  712. if (column.property === "fGrossweightblc") {
  713. sums[index] = (sums[index] / 1000).toFixed(4) + "吨";
  714. }
  715. if (column.property === "fNetweightblc") {
  716. sums[index] = (sums[index] / 1000).toFixed(4) + "吨";
  717. }
  718. if (column.property === "fQtyblc") {
  719. sums[index] = sums[index];
  720. }
  721. }
  722. }
  723. });
  724. return sums;
  725. },
  726. treeseLect(tree) {
  727. this.queryParams.fWarehouseLocationid = tree.id;
  728. },
  729. getTreeselect() {
  730. treeselect().then((response) => {
  731. this.warehousesOptions = response.data;
  732. });
  733. },
  734. // 贸易方式(数据字典),对���t_trademodels 字典翻译
  735. fTrademodeidFormat(row, column) {
  736. return this.selectDictLabel(this.fTrademodeidOptions, row.fTrademodeid);
  737. },
  738. /* 远程模糊查询仓库 */
  739. warehouseRemoteMethod(name) {
  740. if (name == null || name === "") {
  741. return false;
  742. }
  743. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  744. listWarehouse(queryParams).then((response) => {
  745. this.warehouseOptions = response.rows;
  746. });
  747. },
  748. /* 远程模糊查询库区 */
  749. kqhouseRemoteMethod(name) {
  750. if (name == null || name === "") {
  751. return false;
  752. }
  753. if (!this.queryParams.fWarehouseid) {
  754. this.$message.error("请输入仓库!");
  755. return false;
  756. }
  757. let queryParams = {
  758. pageNum: 1,
  759. pageSize: 10,
  760. fWarehouseid: this.queryParams.fWarehouseid,
  761. fName: name,
  762. };
  763. listArea(queryParams).then((response) => {
  764. this.kqhouseOptions = response.rows;
  765. });
  766. },
  767. /* 远程模糊查询商品 */
  768. goodsRemoteMethod(name) {
  769. if (name == null || name === "") {
  770. return false;
  771. }
  772. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  773. listGoods(queryParams).then((response) => {
  774. this.goodsOptions = response.rows;
  775. });
  776. },
  777. /* 远程模糊查询用户 */
  778. corpsRemoteMethod(name) {
  779. if (name == null || name === "") {
  780. return false;
  781. }
  782. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  783. listCorps(queryParams).then((response) => {
  784. this.fMblnoOptions = response.rows;
  785. this.KHblnoOptions = response.rows;
  786. });
  787. },
  788. /** 查询库存总账列表 */
  789. getList() {
  790. this.loading = true;
  791. mapListWhgenleg(this.queryParams).then((response) => {
  792. response.rows.map((e) => {
  793. e.fCntrno = this.queryParams.isCntrno == 1 ? null : e.fCntrno
  794. })
  795. this.whgenlegList = response.rows;
  796. this.total = response.total;
  797. this.loading = false;
  798. // 根据浏览器高度设置初始高度
  799. setTimeout(() => {
  800. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
  801. }, 300)
  802. });
  803. },
  804. // 取消按钮
  805. cancel() {
  806. this.open = false;
  807. this.reset();
  808. },
  809. // 表单重置
  810. reset() {
  811. this.form = {
  812. fAccyear: null,
  813. fId: null,
  814. fAccmonth: null,
  815. fCorpid: null,
  816. fMblno: null,
  817. fOriginalbillno: null,
  818. fWarehouseLocationid: null,
  819. fGoodsid: null,
  820. fTrademodeid: null,
  821. fPreqty: null,
  822. fPregrossweight: null,
  823. fPrenetweight: null,
  824. fQtyd: null,
  825. fVolumnd: null,
  826. fGrossweightd: null,
  827. fNetweightd: null,
  828. fVolumnc: null,
  829. fQtyc: null,
  830. fQtyblc: null,
  831. fGrossweightc: null,
  832. fNetweightc: null,
  833. fGrossweightblc: null,
  834. fNetweightblc: null,
  835. fCntrno: null,
  836. fStatus: "0",
  837. delFlag: null,
  838. createBy: null,
  839. fMarks: null,
  840. createTime: null,
  841. updateBy: null,
  842. updateTime: null,
  843. remark: null,
  844. };
  845. this.resetForm("form");
  846. },
  847. /** 搜索按钮操作 */
  848. handleQuery() {
  849. this.queryParams.pageNum = 1;
  850. this.getList();
  851. },
  852. /** 重置按钮操作 */
  853. resetQuery() {
  854. this.queryParams = {
  855. pageNum: 1,
  856. pageSize: 10,
  857. fOriginalbillno: null,
  858. fPreqty: null,
  859. fPregrossweight: null,
  860. fPrenetweight: null,
  861. fQtyd: null,
  862. fVolumnd: null,
  863. fGrossweightd: null,
  864. fNetweightd: null,
  865. fVolumnc: null,
  866. fQtyc: null,
  867. fQtyblc: null,
  868. fGrossweightc: null,
  869. fNetweightc: null,
  870. fGrossweightblc: null,
  871. fNetweightblc: null,
  872. fCntrno: null,
  873. fStatus: null,
  874. fMarks: null,
  875. fBusinessType: null,
  876. fBusinessTypes: null,
  877. fBilltype: null,
  878. fwarehouseid: null,
  879. };
  880. // this.resetForm("queryForm");
  881. this.handleQuery();
  882. },
  883. /** 新增按钮操作 */
  884. handleAdd() {
  885. this.reset();
  886. this.open = true;
  887. this.title = "添加库存总账";
  888. },
  889. /** 提交按钮 */
  890. submitForm() {
  891. this.$refs["form"].validate((valid) => {
  892. if (valid) {
  893. if (this.form.fAccyear != null) {
  894. updateWhgenleg(this.form).then((response) => {
  895. this.msgSuccess("修改成功");
  896. this.open = false;
  897. this.getList();
  898. });
  899. } else {
  900. addWhgenleg(this.form).then((response) => {
  901. this.msgSuccess("新增成功");
  902. this.open = false;
  903. this.getList();
  904. });
  905. }
  906. }
  907. });
  908. },
  909. /** 分类监管导出 */
  910. superviseExport() {
  911. const queryParams = this.queryParams;
  912. this.$confirm("确认是否导出分类监管数据?", "警告", {
  913. confirmButtonText: "确定",
  914. cancelButtonText: "取消",
  915. type: "warning",
  916. }).then(function () {
  917. return superviseExportWhgenleg(queryParams);
  918. }).then((response) => {
  919. this.download(response.msg);
  920. })
  921. },
  922. /** 分类监管仓库导出 */
  923. warehouseSupervise() {
  924. this.$confirm("确认是否导出分类监管仓库数据?", "警告", {
  925. confirmButtonText: "确定",
  926. cancelButtonText: "取消",
  927. type: "warning",
  928. }).then(function () {
  929. return warehouseSupervise();
  930. }).then((response) => {
  931. this.download(response.msg);
  932. })
  933. },
  934. /** 导出按钮操作 */
  935. handleExport() {
  936. const queryParams = this.queryParams;
  937. this.$confirm("是否确认导出所有库存总账数据项?", "警告", {
  938. confirmButtonText: "确定",
  939. cancelButtonText: "取消",
  940. type: "warning",
  941. })
  942. .then(function () {
  943. return exportWhgenleg(queryParams);
  944. })
  945. .then((response) => {
  946. this.download(response.msg);
  947. });
  948. },
  949. goDetail(row) {
  950. this.$router.push({
  951. path: "/analysis/stockDetail",
  952. query: {
  953. fId: row.fId,
  954. fWarehouseLocationid: row.fWarehouseLocationid,
  955. fTrademodeids: row.fTrademodeids,
  956. fBusinessType: row.fBusinessType,
  957. fGoodsid: row.fGoodsid,
  958. fCorpIds: row.fCorpIds,
  959. fMarks: row.fMarks,
  960. fMblno: row.fMblno,
  961. },
  962. });
  963. },
  964. },
  965. };
  966. </script>
  967. <style lang="scss">
  968. .el-table {
  969. .el-table__body-wrapper {
  970. z-index: 2;
  971. }
  972. }
  973. .tabSetting {
  974. display: flex;
  975. justify-content: flex-end;
  976. }
  977. .listStyle {
  978. display: flex;
  979. border-top: 1px solid #dcdfe6;
  980. border-left: 1px solid #dcdfe6;
  981. border-right: 1px solid #dcdfe6;
  982. }
  983. .listStyle:last-child {
  984. border-bottom: 1px solid #dcdfe6;
  985. }
  986. .progress {
  987. display: flex;
  988. align-items: center;
  989. padding: 2px;
  990. background-color: rgba(0, 0, 0, 0.05);
  991. height: 100%;
  992. }
  993. </style>