index.vue 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029
  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 { listWarehouse, treeselect, nominateTreeselect } from "@/api/basicdata/warehouse";
  223. import { listArea } from "@/api/basicdata/area";
  224. import { listGoods } from "@/api/basicdata/goods";
  225. import { listCorps } from "@/api/basicdata/corps";
  226. import Treeselect from "@riophae/vue-treeselect";
  227. import { addSet, select, resetModule } from "@/api/system/set";
  228. import Cookies from "js-cookie";
  229. import draggable from "vuedraggable";
  230. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  231. export default {
  232. name: "Whgenleg",
  233. components: {
  234. Treeselect,
  235. draggable,
  236. },
  237. data() {
  238. return {
  239. pickerOptions: {
  240. shortcuts: [{
  241. text: '最近一周',
  242. onClick(picker) {
  243. const end = new Date();
  244. const start = new Date();
  245. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  246. picker.$emit('pick', [start, end]);
  247. }
  248. }, {
  249. text: '最近一个月',
  250. onClick(picker) {
  251. const end = new Date();
  252. const start = new Date();
  253. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  254. picker.$emit('pick', [start, end]);
  255. }
  256. }, {
  257. text: '最近三个月',
  258. onClick(picker) {
  259. const end = new Date();
  260. const start = new Date();
  261. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  262. picker.$emit('pick', [start, end]);
  263. }
  264. }]
  265. },
  266. tableHeight: '0',
  267. //仓库树状下拉
  268. fWarehouseidOption: [],
  269. // 客户(客户数据)
  270. fMblnoOptions: [],
  271. // 贸易方式(数据字典),对应t_trademodels 字典
  272. fTrademodeidOptions: [],
  273. // 货物
  274. goodsOptions: [],
  275. // 仓库(仓库数据)
  276. warehouseOptions: [],
  277. kqhouseOptions: [],
  278. // 遮罩层
  279. loading: true,
  280. // 显示搜索条件
  281. showSearch: true,
  282. // 总条数
  283. total: 0,
  284. // 库存总账表格数据
  285. whgenlegList: [],
  286. // 弹出层标题
  287. title: "",
  288. // 是否显示弹出层
  289. open: false,
  290. // 查询参数
  291. queryParams: {
  292. pageNum: 1,
  293. pageSize: 50,
  294. fOriginalbillno: null,
  295. isCntrno: null,
  296. fPreqty: null,
  297. fLocalcntrno: null,
  298. fPregrossweight: null,
  299. fPrenetweight: null,
  300. fQtyd: null,
  301. fVolumnd: null,
  302. fGrossweightd: null,
  303. fNetweightd: null,
  304. fVolumnc: null,
  305. fQtyc: null,
  306. fQtyblc: null,
  307. fGrossweightc: null,
  308. fNetweightc: null,
  309. fGrossweightblc: null,
  310. fNetweightblc: null,
  311. fCntrno: null,
  312. fStatus: null,
  313. fMarks: null,
  314. orgStorageDate: null,
  315. fBusinessType: null,
  316. fBusinessTypes: null,
  317. },
  318. // 表单参数
  319. form: {},
  320. // 表单校验
  321. rules: {
  322. fMarks: [{ required: true, message: "唛头不能为空", trigger: "blur" }],
  323. },
  324. showSetting: false,
  325. drag: false,
  326. setRowList: [],
  327. getRowList: [],
  328. tableDate: [
  329. {
  330. surface: "0",
  331. label: "fMblno",
  332. name: "提单号",
  333. checked: 0,
  334. width: 100,
  335. fixed: "left",
  336. },
  337. {
  338. surface: "1",
  339. label: "fCorpid",
  340. name: "客户",
  341. checked: 0,
  342. width: 100,
  343. fixed: "left",
  344. },
  345. {
  346. surface: "2",
  347. label: "fOriginalbilldate",
  348. name: "入库日期",
  349. checked: 0,
  350. width: 100,
  351. fixed: "left",
  352. },
  353. {
  354. surface: "3",
  355. label: "fChargedate",
  356. name: "仓储费日期",
  357. checked: 0,
  358. width: 150,
  359. fixed: "left",
  360. },
  361. {
  362. surface: "4",
  363. label: "fBusinessTypes",
  364. name: "货物属性",
  365. checked: 0,
  366. width: 100,
  367. },
  368. {
  369. surface: "5",
  370. label: "fMarks",
  371. name: "属性详情",
  372. checked: 0,
  373. width: 100,
  374. },
  375. {
  376. surface: "6",
  377. label: "fGoodsids",
  378. name: "品名",
  379. checked: 0,
  380. width: 100,
  381. },
  382. {
  383. surface: "8",
  384. label: "fWarehouseInformation",
  385. name: "仓库",
  386. checked: 0,
  387. width: 100,
  388. },
  389. {
  390. surface: "9",
  391. label: "fTrademodeid",
  392. name: "贸易方式",
  393. checked: 0,
  394. width: 100,
  395. },
  396. {
  397. surface: "10",
  398. label: "fQtyD",
  399. name: "入库件数",
  400. checked: 0,
  401. width: 100,
  402. },
  403. {
  404. surface: "11",
  405. label: "fGrossweightD",
  406. name: "入库毛重(kg)",
  407. checked: 0,
  408. width: 200,
  409. },
  410. {
  411. surface: "12",
  412. label: "fNetweightD",
  413. name: "入库净重(kg)",
  414. checked: 0,
  415. width: 200,
  416. },
  417. {
  418. surface: "13",
  419. label: "fQtyC",
  420. name: "出库件数",
  421. checked: 0,
  422. width: 100,
  423. },
  424. {
  425. surface: "14",
  426. label: "fGrossweightC",
  427. name: "出库毛重(kg)",
  428. checked: 0,
  429. width: 200,
  430. },
  431. {
  432. surface: "15",
  433. label: "fNetweightC",
  434. name: "出库净重(kg)",
  435. checked: 0,
  436. width: 200,
  437. },
  438. {
  439. surface: "16",
  440. label: "fQtyblc",
  441. name: "结余件数",
  442. checked: 0,
  443. width: 100,
  444. },
  445. {
  446. surface: "17",
  447. label: "fGrossweightblc",
  448. name: "结余毛重(kg)",
  449. checked: 0,
  450. width: 200,
  451. },
  452. {
  453. surface: "18",
  454. label: "fNetweightblc",
  455. name: "结余净重(kg)",
  456. checked: 0,
  457. width: 200,
  458. },
  459. {
  460. surface: "19",
  461. label: "fCntrno",
  462. name: "箱号",
  463. checked: 0,
  464. width: 100,
  465. },
  466. {
  467. surface: "20",
  468. label: "remark",
  469. name: "备注",
  470. checked: 0,
  471. width: 100,
  472. },
  473. {
  474. surface: "21",
  475. label: "fLocalcntrno",
  476. name: "库存箱号",
  477. checked: 0,
  478. width: 100,
  479. },
  480. {
  481. surface: "22",
  482. label: "lockStatus",
  483. name: "是否出质",
  484. checked: 0,
  485. width: 100,
  486. },
  487. {
  488. surface: "23",
  489. label: "belongTo",
  490. name: "质押归属人",
  491. checked: 0,
  492. width: 100,
  493. },
  494. {
  495. surface: "24",
  496. label: "lockTime",
  497. name: "锁定时间",
  498. checked: 0,
  499. width: 100,
  500. },
  501. {
  502. surface: "25",
  503. label: "unlockTime",
  504. name: "解锁时间",
  505. checked: 0,
  506. width: 100,
  507. },
  508. {
  509. surface: "26",
  510. label: "wrNumber",
  511. name: "仓单编号",
  512. checked: 0,
  513. width: 100,
  514. }
  515. ],
  516. allCheck: false,
  517. isCntrnoOptions: [
  518. {
  519. id: 1,
  520. name: "箱号",
  521. },
  522. {
  523. id: 2,
  524. name: "提单号",
  525. },
  526. ],
  527. };
  528. },
  529. created() {
  530. // let date = new Date();
  531. // let year = parseInt(date.getFullYear())
  532. // let month = parseInt(date.getMonth() + 1)
  533. // let currentMonth = date.getMonth()
  534. // let nextMonth = ++currentMonth
  535. // let nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1) // 下个月的第一天
  536. // let oneDay = 1000*60*60*24
  537. // let lastTime = new Date(nextMonthFirstDay - oneDay) // 下个月的第一天减去一天,就是上个月的最后一天
  538. // let day = lastTime.getDate()
  539. // if (day < 10) {
  540. // day = '0' + day
  541. // }
  542. // this.queryParams.orgStorageDate = [year + '-' + month + '-' + '01 00:00:00', year + '-' + month + '-' + day + ' 23:59:59']
  543. // nominateTreeselect().then((response) => {
  544. // this.fWarehouseidOption = response.data;
  545. // console.log("仓库")
  546. // console.log(this.fWarehouseidOption)
  547. // console.log(this.fWarehouseidOption[0].id);
  548. // if (this.fWarehouseidOption.length > 0) {
  549. // this.queryParams.fWarehouseLocationid = this.fWarehouseidOption[0].id;
  550. // this.getList();
  551. // } else {
  552. // this.$alert('您没有所属仓库', '提示', {
  553. // confirmButtonText: '确定',
  554. // callback: action => {
  555. // // const visitedViews = this.$store.state.tagsView.visitedViews
  556. // // this.$store.state.tagsView.visitedViews = visitedViews.filter(v => {
  557. // // return v.path !== this.$route.path
  558. // // })
  559. // // this.$router.go(-1)
  560. // }
  561. // });
  562. //
  563. // }
  564. // });
  565. this.setRowList = this.tableDate;
  566. this.getRowList = this.tableDate;
  567. this.getList();
  568. this.getDicts("data_trademodes").then((response) => {
  569. this.fTrademodeidOptions = response.data;
  570. });
  571. treeselect().then((response) => {
  572. this.fWarehouseidOption = response.data;
  573. });
  574. this.getRow();
  575. },
  576. mounted() {
  577. this.$nextTick(() => {
  578. // 监听浏览器高度变化,改变表格高度
  579. window.onresize = () => {
  580. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
  581. }
  582. })
  583. },
  584. methods: {
  585. //列设置全选
  586. allChecked() {
  587. if (this.allCheck == true) {
  588. this.setRowList.map((e) => {
  589. return (e.checked = 0);
  590. });
  591. } else {
  592. this.setRowList.map((e) => {
  593. return (e.checked = 1);
  594. });
  595. }
  596. },
  597. //查询列数据
  598. getRow() {
  599. let that = this;
  600. this.data = {
  601. tableName: "库存总账",
  602. userId: Cookies.get("userName"),
  603. };
  604. select(this.data).then((res) => {
  605. if (res.data.length != 0) {
  606. this.getRowList = res.data.filter((e) => e.checked == 0);
  607. this.setRowList = res.data;
  608. this.setRowList = this.setRowList.reduce((res, item) => {
  609. res.push({
  610. surface: item.surface,
  611. label: item.label,
  612. name: item.name,
  613. checked: item.checked,
  614. width: item.width,
  615. fixed: item.fixed,
  616. });
  617. return res;
  618. }, []);
  619. }
  620. console.log(this.getRowList);
  621. });
  622. },
  623. delRow() {
  624. this.data = {
  625. tableName: "库存总账",
  626. userId: Cookies.get("userName"),
  627. };
  628. resetModule(this.data).then((res) => {
  629. if (res.code == 200) {
  630. this.showSetting = false;
  631. this.setRowList = this.tableDate;
  632. this.getRowList = this.tableDate;
  633. console.log(this.getRowList);
  634. }
  635. });
  636. },
  637. //保存列设置
  638. save() {
  639. this.showSetting = false;
  640. this.data = {
  641. tableName: "库存总账",
  642. userId: Cookies.get("userName"),
  643. sysTableSetList: this.setRowList,
  644. };
  645. addSet(this.data).then((res) => {
  646. if (res.code == 200) {
  647. this.showSetting = false;
  648. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  649. }
  650. });
  651. },
  652. //开始拖拽事件
  653. onStart() {
  654. this.drag = true;
  655. },
  656. //拖拽结束事件
  657. onEnd() {
  658. this.drag = false;
  659. },
  660. //合计
  661. getSum(param) {
  662. const { columns, data } = param;
  663. const sums = [];
  664. var values = [];
  665. columns.forEach((column, index) => {
  666. if (index === 0) {
  667. sums[index] = "总计";
  668. }
  669. if (column.property === "fGrossweightD") {
  670. values = data.map((item) => Number(item["fGrossweightD"]));
  671. }
  672. if (column.property === "fNetweightD") {
  673. values = data.map((item) => Number(item["fNetweightD"]));
  674. }
  675. if (column.property === "fQtyD") {
  676. values = data.map((item) => Number(item["fQtyD"]));
  677. }
  678. if (column.property === "fGrossweightC") {
  679. values = data.map((item) => Number(item["fGrossweightC"]));
  680. }
  681. if (column.property === "fNetweightC") {
  682. values = data.map((item) => Number(item["fNetweightC"]));
  683. }
  684. if (column.property === "fQtyC") {
  685. values = data.map((item) => Number(item["fQtyC"]));
  686. }
  687. if (column.property === "fQtyblc") {
  688. values = data.map((item) => Number(item["fQtyblc"]));
  689. }
  690. if (column.property === "fGrossweightblc") {
  691. values = data.map((item) => Number(item["fGrossweightblc"]));
  692. }
  693. if (column.property === "fNetweightblc") {
  694. values = data.map((item) => Number(item["fNetweightblc"]));
  695. }
  696. if (
  697. column.property === "fGrossweightD" ||
  698. column.property === "fNetweightD" ||
  699. column.property === "fQtyD" ||
  700. column.property === "fGrossweightC" ||
  701. column.property === "fNetweightC" ||
  702. column.property === "fQtyC" ||
  703. column.property === "fQtyblc" ||
  704. column.property === "fGrossweightblc" ||
  705. column.property === "fNetweightblc"
  706. ) {
  707. const values = data.map((item) => Number(item[column.property]));
  708. if (!values.every((value) => isNaN(value))) {
  709. sums[index] = values.reduce((prev, curr) => {
  710. const value = Number(curr);
  711. if (!isNaN(value)) {
  712. return prev + curr;
  713. } else {
  714. return prev;
  715. }
  716. }, 0);
  717. if (column.property === "fGrossweightD") {
  718. sums[index] = (sums[index] / 1000).toFixed(4) + "吨";
  719. }
  720. if (column.property === "fNetweightD") {
  721. sums[index] = (sums[index] / 1000).toFixed(4) + "吨";
  722. }
  723. if (column.property === "fQtyD") {
  724. sums[index] = sums[index];
  725. }
  726. if (column.property === "fGrossweightC") {
  727. sums[index] = (sums[index] / 1000).toFixed(4) + "吨";
  728. }
  729. if (column.property === "fNetweightC") {
  730. sums[index] = (sums[index] / 1000).toFixed(4) + "吨";
  731. }
  732. if (column.property === "fQtyC") {
  733. sums[index] = sums[index];
  734. }
  735. if (column.property === "fGrossweightblc") {
  736. sums[index] = (sums[index] / 1000).toFixed(4) + "吨";
  737. }
  738. if (column.property === "fNetweightblc") {
  739. sums[index] = (sums[index] / 1000).toFixed(4) + "吨";
  740. }
  741. if (column.property === "fQtyblc") {
  742. sums[index] = sums[index];
  743. }
  744. }
  745. }
  746. });
  747. return sums;
  748. },
  749. treeseLect(tree) {
  750. this.queryParams.fWarehouseLocationid = tree.id;
  751. },
  752. getTreeselect() {
  753. treeselect().then((response) => {
  754. // nominateTreeselect().then((response) => {
  755. this.warehousesOptions = response.data;
  756. });
  757. },
  758. // 贸易方式(数据字典),对���t_trademodels 字典翻译
  759. fTrademodeidFormat(row, column) {
  760. return this.selectDictLabel(this.fTrademodeidOptions, row.fTrademodeid);
  761. },
  762. /* 远程模糊查询仓库 */
  763. warehouseRemoteMethod(name) {
  764. if (name == null || name === "") {
  765. return false;
  766. }
  767. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  768. listWarehouse(queryParams).then((response) => {
  769. this.warehouseOptions = response.rows;
  770. });
  771. },
  772. /* 远程模糊查询库区 */
  773. kqhouseRemoteMethod(name) {
  774. if (name == null || name === "") {
  775. return false;
  776. }
  777. if (!this.queryParams.fWarehouseid) {
  778. this.$message.error("请输入仓库!");
  779. return false;
  780. }
  781. let queryParams = {
  782. pageNum: 1,
  783. pageSize: 10,
  784. fWarehouseid: this.queryParams.fWarehouseid,
  785. fName: name,
  786. };
  787. listArea(queryParams).then((response) => {
  788. this.kqhouseOptions = response.rows;
  789. });
  790. },
  791. /* 远程模糊查询商品 */
  792. goodsRemoteMethod(name) {
  793. if (name == null || name === "") {
  794. return false;
  795. }
  796. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  797. listGoods(queryParams).then((response) => {
  798. this.goodsOptions = response.rows;
  799. });
  800. },
  801. /* 远程模糊查询用户 */
  802. corpsRemoteMethod(name) {
  803. if (name == null || name === "") {
  804. return false;
  805. }
  806. let queryParams = { pageNum: 1, pageSize: 10, fName: name };
  807. listCorps(queryParams).then((response) => {
  808. this.fMblnoOptions = response.rows;
  809. this.KHblnoOptions = response.rows;
  810. });
  811. },
  812. /** 查询库存总账列表 */
  813. getList() {
  814. this.loading = true;
  815. mapListWhgenleg(this.queryParams).then((response) => {
  816. response.rows.map((e) => {
  817. e.fCntrno = this.queryParams.isCntrno == 1 ? null : e.fCntrno
  818. })
  819. this.whgenlegList = response.rows;
  820. this.total = response.total;
  821. this.loading = false;
  822. // 根据浏览器高度设置初始高度
  823. setTimeout(() => {
  824. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
  825. }, 300)
  826. });
  827. },
  828. // 取消按钮
  829. cancel() {
  830. this.open = false;
  831. this.reset();
  832. },
  833. // 表单重置
  834. reset() {
  835. this.form = {
  836. fAccyear: null,
  837. fId: null,
  838. fAccmonth: null,
  839. fCorpid: null,
  840. fMblno: null,
  841. fOriginalbillno: null,
  842. fWarehouseLocationid: null,
  843. fGoodsid: null,
  844. fTrademodeid: null,
  845. fPreqty: null,
  846. fPregrossweight: null,
  847. fPrenetweight: null,
  848. fQtyd: null,
  849. fVolumnd: null,
  850. fGrossweightd: null,
  851. fNetweightd: null,
  852. fVolumnc: null,
  853. fQtyc: null,
  854. fQtyblc: null,
  855. fGrossweightc: null,
  856. fNetweightc: null,
  857. fGrossweightblc: null,
  858. fNetweightblc: null,
  859. fCntrno: null,
  860. fStatus: "0",
  861. delFlag: null,
  862. createBy: null,
  863. fMarks: null,
  864. createTime: null,
  865. updateBy: null,
  866. updateTime: null,
  867. remark: null,
  868. };
  869. this.resetForm("form");
  870. },
  871. /** 搜索按钮操作 */
  872. handleQuery() {
  873. this.queryParams.pageNum = 1;
  874. this.getList();
  875. },
  876. /** 重置按钮操作 */
  877. resetQuery() {
  878. this.queryParams = {
  879. pageNum: 1,
  880. pageSize: 10,
  881. fOriginalbillno: null,
  882. fPreqty: null,
  883. fPregrossweight: null,
  884. fPrenetweight: null,
  885. fQtyd: null,
  886. fVolumnd: null,
  887. fGrossweightd: null,
  888. fNetweightd: null,
  889. fVolumnc: null,
  890. fQtyc: null,
  891. fQtyblc: null,
  892. fGrossweightc: null,
  893. fNetweightc: null,
  894. fGrossweightblc: null,
  895. fNetweightblc: null,
  896. fCntrno: null,
  897. fStatus: null,
  898. fMarks: null,
  899. fBusinessType: null,
  900. fBusinessTypes: null,
  901. fBilltype: null,
  902. fwarehouseid: null,
  903. };
  904. // this.resetForm("queryForm");
  905. this.handleQuery();
  906. },
  907. /** 新增按钮操作 */
  908. handleAdd() {
  909. this.reset();
  910. this.open = true;
  911. this.title = "添加库存总账";
  912. },
  913. /** 提交按钮 */
  914. submitForm() {
  915. this.$refs["form"].validate((valid) => {
  916. if (valid) {
  917. if (this.form.fAccyear != null) {
  918. updateWhgenleg(this.form).then((response) => {
  919. this.msgSuccess("修改成功");
  920. this.open = false;
  921. this.getList();
  922. });
  923. } else {
  924. addWhgenleg(this.form).then((response) => {
  925. this.msgSuccess("新增成功");
  926. this.open = false;
  927. this.getList();
  928. });
  929. }
  930. }
  931. });
  932. },
  933. /** 分类监管导出 */
  934. superviseExport() {
  935. const queryParams = this.queryParams;
  936. this.$confirm("确认是否导出分类监管数据?", "警告", {
  937. confirmButtonText: "确定",
  938. cancelButtonText: "取消",
  939. type: "warning",
  940. }).then(function () {
  941. return superviseExportWhgenleg(queryParams);
  942. }).then((response) => {
  943. this.download(response.msg);
  944. })
  945. },
  946. /** 分类监管仓库导出 */
  947. warehouseSupervise() {
  948. this.$confirm("确认是否导出分类监管仓库数据?", "警告", {
  949. confirmButtonText: "确定",
  950. cancelButtonText: "取消",
  951. type: "warning",
  952. }).then(function () {
  953. return warehouseSupervise();
  954. }).then((response) => {
  955. this.download(response.msg);
  956. })
  957. },
  958. /** 导出按钮操作 */
  959. handleExport() {
  960. const queryParams = this.queryParams;
  961. this.$confirm("是否确认导出所有库存总账数据项?", "警告", {
  962. confirmButtonText: "确定",
  963. cancelButtonText: "取消",
  964. type: "warning",
  965. })
  966. .then(function () {
  967. return exportWhgenleg(queryParams);
  968. })
  969. .then((response) => {
  970. this.download(response.msg);
  971. });
  972. },
  973. goDetail(row) {
  974. this.$router.push({
  975. path: "/analysis/stockDetail",
  976. query: {
  977. fId: row.fId,
  978. fWarehouseLocationid: row.fWarehouseLocationid,
  979. fTrademodeids: row.fTrademodeids,
  980. fBusinessType: row.fBusinessType,
  981. fGoodsid: row.fGoodsid,
  982. fCorpIds: row.fCorpIds,
  983. fMarks: row.fMarks,
  984. fMblno: row.fMblno,
  985. },
  986. });
  987. },
  988. },
  989. };
  990. </script>
  991. <style lang="scss">
  992. .el-table {
  993. .el-table__body-wrapper {
  994. z-index: 2;
  995. }
  996. }
  997. .tabSetting {
  998. display: flex;
  999. justify-content: flex-end;
  1000. }
  1001. .listStyle {
  1002. display: flex;
  1003. border-top: 1px solid #dcdfe6;
  1004. border-left: 1px solid #dcdfe6;
  1005. border-right: 1px solid #dcdfe6;
  1006. }
  1007. .listStyle:last-child {
  1008. border-bottom: 1px solid #dcdfe6;
  1009. }
  1010. .progress {
  1011. display: flex;
  1012. align-items: center;
  1013. padding: 2px;
  1014. background-color: rgba(0, 0, 0, 0.05);
  1015. height: 100%;
  1016. }
  1017. </style>