index.vue 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302
  1. <template>
  2. <div class="app-container">
  3. <basic-container v-show="pageShow">
  4. <avue-crud
  5. :option="option"
  6. :data="warehousebillsList"
  7. @search-change="handleQuery"
  8. >
  9. <template slot="menuLeft">
  10. <el-button
  11. type="primary"
  12. icon="el-icon-plus"
  13. size="mini"
  14. @click="handleAdd"
  15. v-hasPermi="['warehouseBusiness:outStock:add']"
  16. >新增
  17. </el-button>
  18. <el-button
  19. type="success"
  20. icon="el-icon-edit"
  21. size="mini"
  22. :disabled="single"
  23. @click="handleUpdate"
  24. v-hasPermi="['warehouseBusiness:outStock:edit']"
  25. >修改
  26. </el-button>
  27. <el-button
  28. type="warning"
  29. icon="el-icon-download"
  30. size="mini"
  31. @click="handleExport"
  32. v-hasPermi="['warehouseBusiness:outStock:export']"
  33. >导出
  34. </el-button>
  35. <el-button
  36. type="warning"
  37. icon="el-icon-download"
  38. size="mini"
  39. @click="handleExport"
  40. :disabled="multiple"
  41. v-hasPermi="['warehouseBusiness:outStock:export']"
  42. >导入
  43. </el-button>
  44. <el-button
  45. type="info"
  46. icon="el-icon-download"
  47. size="mini"
  48. :disabled="single"
  49. @click="copyUpdate"
  50. v-hasPermi="['agreement:agreementStorage:export']"
  51. >复制新增
  52. </el-button>
  53. </template>
  54. <template slot-scope="scope" slot="menu">
  55. <el-button
  56. size="mini"
  57. type="text"
  58. icon="el-icon-edit"
  59. @click="handleUpdate(scope.row, true)"
  60. v-hasPermi="['warehouseBusiness:outStock:edit']"
  61. >查看
  62. </el-button>
  63. <el-button
  64. size="mini"
  65. type="text"
  66. icon="el-icon-edit"
  67. v-if="
  68. scope.row.billstatus == '录入' ||
  69. scope.row.billstatus == '暂存' ||
  70. scope.row.billstatus == '驳回'
  71. "
  72. @click="handleUpdate(scope.row, false)"
  73. v-hasPermi="['warehouseBusiness:outStock:edit']"
  74. >修改
  75. </el-button>
  76. <el-button
  77. size="mini"
  78. type="text"
  79. icon="el-icon-delete"
  80. v-if="
  81. (scope.row.billstatus == '录入' ||
  82. scope.row.billstatus == '暂存' ||
  83. scope.row.billstatus == '驳回')
  84. &&
  85. scope.row.isCreate == 0
  86. ||
  87. (scope.row.billstatus == '录入' ||
  88. scope.row.billstatus == '暂存' ||
  89. scope.row.billstatus == '驳回')
  90. &&
  91. scope.row.isCreate == 1
  92. "
  93. @click="handleDelete(scope.row)"
  94. v-hasPermi="['warehouseBusiness:outStock:remove']"
  95. >删除
  96. <!-- v-if="scope.row.itemsStatus == '计划'"-->
  97. </el-button>
  98. <el-button
  99. size="mini"
  100. type="text"
  101. icon="el-icon-delete"
  102. v-if="
  103. scope.row.billstatus == '请核' ||
  104. scope.row.billstatus == '审核中'
  105. "
  106. @click="handleUpdate(scope.row, true)"
  107. >审核进度
  108. </el-button>
  109. </template>
  110. </avue-crud>
  111. </basic-container>
  112. <div v-if="false">
  113. <el-form
  114. :model="queryParams"
  115. ref="queryForm"
  116. v-show="showSearch"
  117. label-width="70px"
  118. size="small"
  119. >
  120. <el-row>
  121. <el-col :span="6">
  122. <el-form-item label="客户" prop="corpid">
  123. <el-select
  124. v-model="queryParams.corpid"
  125. clearable
  126. filterable
  127. placeholder="请输入关键词"
  128. style="width: 200px"
  129. >
  130. <el-option
  131. v-for="(item, index) in mblnoOptions"
  132. :key="index.id"
  133. :label="item.name"
  134. :value="item.id"
  135. ></el-option>
  136. </el-select>
  137. </el-form-item>
  138. </el-col>
  139. <el-col :span="6">
  140. <el-form-item label="提单号" prop="mblno">
  141. <el-input
  142. v-model="queryParams.mblno"
  143. placeholder="请输入提单号"
  144. clearable
  145. style="width: 200px"
  146. @keyup.enter.native="handleQuery"
  147. />
  148. </el-form-item>
  149. </el-col>
  150. <el-col :span="6">
  151. <el-form-item label="出库日期" prop="timeInterval">
  152. <el-date-picker
  153. v-model="queryParams.timeInterval"
  154. type="daterange"
  155. value-format="yyyy-MM-dd"
  156. clearable
  157. style="width: 230px"
  158. range-separator="至"
  159. start-placeholder="开始日期"
  160. end-placeholder="结束日期"
  161. @keyup.enter.native="handleQuery"
  162. >
  163. </el-date-picker>
  164. </el-form-item>
  165. </el-col>
  166. <el-col :span="6">
  167. <el-form-item label="车号" prop="warehouseid">
  168. <el-select
  169. v-model="queryParams.truckno"
  170. clearable
  171. filterable
  172. placeholder="请选择车号"
  173. style="width: 200px"
  174. @keyup.enter.native="handleQuery"
  175. >
  176. <el-option
  177. v-for="(item, index) in trucknoList"
  178. :key="index"
  179. :label="item.truckno"
  180. :value="item.truckno"
  181. ></el-option>
  182. </el-select>
  183. </el-form-item>
  184. </el-col>
  185. </el-row>
  186. <el-collapse-transition>
  187. <div v-show="show">
  188. <el-row>
  189. <el-col :span="6">
  190. <el-form-item label="货物名称" prop="goodsid">
  191. <el-select
  192. v-model="queryParams.goodsid"
  193. clearable
  194. filterable
  195. placeholder="请选择货物名称"
  196. style="width: 200px"
  197. @keyup.enter.native="handleQuery"
  198. >
  199. <el-option
  200. v-for="(item, index) in goodsOptions"
  201. :key="index.id"
  202. :label="item.name"
  203. :value="item.id"
  204. ></el-option>
  205. </el-select>
  206. </el-form-item>
  207. </el-col>
  208. <el-col :span="6">
  209. <el-form-item label="品牌" prop="marks">
  210. <el-input
  211. v-model="queryParams.marks"
  212. placeholder="请输入品牌"
  213. clearable
  214. style="width: 200px"
  215. @keyup.enter.native="handleQuery"
  216. />
  217. </el-form-item>
  218. </el-col>
  219. <el-col :span="6">
  220. <el-form-item label="出库状态" prop="itemsStatus">
  221. <el-select
  222. style="width: 200px"
  223. v-model="queryParams.itemsStatus"
  224. placeholder="请选择出库状态"
  225. >
  226. <el-option label="计划" value="1"></el-option>
  227. <el-option label="卸货中" value="2" />
  228. <el-option label="已装货" value="3" />
  229. <el-option label="已出库" value="4" />
  230. </el-select>
  231. </el-form-item>
  232. </el-col>
  233. <el-col :span="6">
  234. <el-form-item label="费用状态" prop="feeStatus">
  235. <el-select
  236. style="width: 200px"
  237. v-model="queryParams.feeStatus"
  238. placeholder="请选择费用状态"
  239. >
  240. <el-option label="暂存" :value="1"></el-option>
  241. <el-option label="部分" :value="2"></el-option>
  242. <el-option label="全部入账" :value="3"></el-option>
  243. </el-select>
  244. </el-form-item>
  245. </el-col>
  246. </el-row>
  247. <el-row>
  248. <el-col :span="6">
  249. <el-form-item label="业务编号" prop="billno">
  250. <el-input
  251. v-model="queryParams.billno"
  252. placeholder="请输入业务编号"
  253. clearable
  254. @keyup.enter.native="handleQuery"
  255. style="width: 200px"
  256. />
  257. </el-form-item>
  258. </el-col>
  259. <el-col :span="6">
  260. <el-form-item label="制单人" prop="createBy">
  261. <el-select
  262. v-model="queryParams.createBy"
  263. filterable
  264. clearable
  265. placeholder="请输入关键词"
  266. style="width: 200px"
  267. >
  268. <el-option
  269. v-for="(item, index) in userOptions"
  270. :key="index.userName"
  271. :label="item.nickName"
  272. :value="item.userName"
  273. >
  274. </el-option>
  275. </el-select>
  276. </el-form-item>
  277. </el-col>
  278. <el-col :span="6">
  279. <el-form-item label="仓库" prop="warehouseid">
  280. <el-select
  281. v-model="queryParams.warehouseid"
  282. clearable
  283. filterable
  284. placeholder="请选择仓库"
  285. style="width: 200px"
  286. @keyup.enter.native="handleQuery"
  287. >
  288. <el-option
  289. v-for="(item, index) in warehouseOptions"
  290. :key="index.id"
  291. :label="item.name"
  292. :value="item.id"
  293. ></el-option>
  294. </el-select>
  295. </el-form-item>
  296. <!-- <el-form-item label="经营单位" prop="sbu">-->
  297. <!-- <el-select-->
  298. <!-- v-model="queryParams.sbu"-->
  299. <!-- clearable-->
  300. <!-- filterable-->
  301. <!-- placeholder="请输入关键词"-->
  302. <!-- style="width: 200px"-->
  303. <!-- >-->
  304. <!-- <el-option-->
  305. <!-- v-for="(item, index) in mblnoOptions"-->
  306. <!-- :key="index.id"-->
  307. <!-- :label="item.name"-->
  308. <!-- :value="item.id"-->
  309. <!-- ></el-option>-->
  310. <!-- </el-select>-->
  311. <!-- </el-form-item>-->
  312. </el-col>
  313. <el-col :span="6">
  314. <el-form-item label="贸易方式" prop="trademodeid">
  315. <el-select
  316. v-model="queryParams.trademodeid"
  317. placeholder="请选择贸易方式"
  318. clearable
  319. @keyup.enter.native="handleQuery"
  320. style="width: 200px"
  321. >
  322. <el-option
  323. v-for="(item, index) in trademodeidOptions"
  324. :key="index.dictValue"
  325. :label="item.dictLabel"
  326. :value="item.dictValue"
  327. />
  328. </el-select>
  329. </el-form-item>
  330. </el-col>
  331. </el-row>
  332. </div>
  333. </el-collapse-transition>
  334. </el-form>
  335. <el-row :gutter="10" class="mb8">
  336. <el-col :span="1.5">
  337. <el-button
  338. type="primary"
  339. icon="el-icon-plus"
  340. size="mini"
  341. @click="handleAdd"
  342. v-hasPermi="['warehouseBusiness:outStock:add']"
  343. >新增
  344. </el-button>
  345. </el-col>
  346. <el-col :span="1.5">
  347. <el-button
  348. type="success"
  349. icon="el-icon-edit"
  350. size="mini"
  351. :disabled="single"
  352. @click="handleUpdate"
  353. v-hasPermi="['warehouseBusiness:outStock:edit']"
  354. >修改
  355. </el-button>
  356. </el-col>
  357. <el-col :span="1.5">
  358. <el-button
  359. type="warning"
  360. icon="el-icon-download"
  361. size="mini"
  362. @click="handleExport"
  363. v-hasPermi="['warehouseBusiness:outStock:export']"
  364. >导出
  365. </el-button>
  366. </el-col>
  367. <el-col :span="1.5">
  368. <el-button
  369. type="warning"
  370. icon="el-icon-download"
  371. size="mini"
  372. @click="handleExport"
  373. :disabled="multiple"
  374. v-hasPermi="['warehouseBusiness:outStock:export']"
  375. >导入
  376. </el-button>
  377. </el-col>
  378. <el-col :span="1.5">
  379. <el-button
  380. type="info"
  381. icon="el-icon-download"
  382. size="mini"
  383. :disabled="single"
  384. @click="copyUpdate"
  385. v-hasPermi="['agreement:agreementStorage:export']"
  386. >复制新增
  387. </el-button>
  388. </el-col>
  389. <div class="tabSetting">
  390. <div style="margin-right: 20px">
  391. <el-button
  392. type="cyan"
  393. icon="el-icon-search"
  394. size="mini"
  395. @click="handleQuery"
  396. >搜索</el-button
  397. >
  398. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  399. >重置</el-button
  400. >
  401. <el-button
  402. v-show="show"
  403. @click="show = !show"
  404. icon="el-icon-arrow-up"
  405. size="mini"
  406. >展开</el-button
  407. >
  408. <el-button
  409. v-show="!show"
  410. @click="show = !show"
  411. icon="el-icon-arrow-down"
  412. size="mini"
  413. >展开</el-button
  414. >
  415. </div>
  416. <right-toolbar
  417. :showSearch.sync="showSearch"
  418. @queryTable="getList"
  419. ></right-toolbar>
  420. <div style="margin: 0 12px">
  421. <el-button
  422. icon="el-icon-setting"
  423. size="mini"
  424. circle
  425. @click="showSetting = !showSetting"
  426. ></el-button>
  427. </div>
  428. </div>
  429. </el-row>
  430. <el-dialog
  431. title="自定义列显示"
  432. :visible.sync="showSetting"
  433. width="700px"
  434. v-dialogDrag
  435. :close-on-click-modal="false"
  436. >
  437. <template slot="title">
  438. <div class="avue-crud__dialog__header">
  439. <span class="el-dialog__title">
  440. <span
  441. style="
  442. display: inline-block;
  443. width: 3px;
  444. height: 20px;
  445. margin-right: 5px;
  446. float: left;
  447. margin-top: 2px;
  448. "
  449. ></span>
  450. </span>
  451. </div>
  452. </template>
  453. <div>配置排序列数据(拖动调整顺序)</div>
  454. <div style="margin-left: 17px">
  455. <el-checkbox
  456. v-model="allCheck"
  457. label="全选"
  458. @change="allChecked"
  459. ></el-checkbox>
  460. </div>
  461. <div style="padding: 4px; display: flex; justify-content: center">
  462. <draggable
  463. v-model="setRowList"
  464. group="site"
  465. animation="300"
  466. @start="onStart"
  467. @end="onEnd"
  468. handle=".indraggable"
  469. >
  470. <transition-group>
  471. <div
  472. v-for="item in setRowList"
  473. :key="item.surface"
  474. class="listStyle"
  475. >
  476. <div style="width: 500px" class="indraggable">
  477. <div class="progress" :style="{ width: item.width + 'px' }">
  478. <el-checkbox
  479. :label="item.name"
  480. v-model="item.checked"
  481. :true-label="0"
  482. :false-label="1"
  483. >{{ item.name }}
  484. </el-checkbox>
  485. </div>
  486. </div>
  487. <el-input-number
  488. v-model.number="item.width"
  489. controls-position="right"
  490. :min="1"
  491. :max="500"
  492. size="mini"
  493. ></el-input-number>
  494. </div>
  495. </transition-group>
  496. </draggable>
  497. </div>
  498. <span slot="footer" class="dialog-footer">
  499. <el-button @click="showSetting = false">取 消</el-button>
  500. <el-button @click="delRow" type="danger">重 置</el-button>
  501. <el-button type="primary" @click="save()">确 定</el-button>
  502. </span>
  503. </el-dialog>
  504. <el-table
  505. v-loading="loading"
  506. :data="warehousebillsList"
  507. @selection-change="handleSelectionChange"
  508. show-summary
  509. :summary-method="getSum">
  510. <el-table-column type="selection" width="60" fixed align="center" />
  511. <el-table-column
  512. type="index"
  513. label="行号"
  514. width="50"
  515. align="center"
  516. fixed
  517. />
  518. <el-table-column
  519. v-for="(item, index) in getRowList"
  520. :key="index"
  521. :label="item.name"
  522. :width="item.width"
  523. :prop="item.label"
  524. align="center"
  525. :fixed="item.fixed"
  526. :show-overflow-tooltip="true"
  527. sortable
  528. >
  529. <template slot-scope="scope">
  530. <span v-if="item.label == 'mblno'">
  531. <el-link :underline="false" type="primary"
  532. ><div @click="handleUpdate(scope.row)">
  533. {{ scope.row.mblno }}
  534. </div></el-link
  535. >
  536. </span>
  537. <span v-else>{{ scope.row[item.label] }}</span>
  538. </template>
  539. </el-table-column>
  540. <el-table-column
  541. label="操作"
  542. align="center"
  543. class-name="small-padding fixed-width"
  544. min-width="200"
  545. fixed="right"
  546. >
  547. <template slot-scope="scope">
  548. <el-button
  549. size="mini"
  550. type="text"
  551. icon="el-icon-edit"
  552. @click="handleUpdate(scope.row, true)"
  553. v-hasPermi="['warehouseBusiness:outStock:edit']"
  554. >查看
  555. </el-button>
  556. <el-button
  557. size="mini"
  558. type="text"
  559. icon="el-icon-edit"
  560. v-if="
  561. scope.row.billstatus == '录入' ||
  562. scope.row.billstatus == '暂存' ||
  563. scope.row.billstatus == '驳回'
  564. "
  565. @click="handleUpdate(scope.row, false)"
  566. v-hasPermi="['warehouseBusiness:outStock:edit']"
  567. >修改
  568. </el-button>
  569. <el-button
  570. size="mini"
  571. type="text"
  572. icon="el-icon-delete"
  573. v-if="
  574. (scope.row.billstatus == '录入' ||
  575. scope.row.billstatus == '暂存' ||
  576. scope.row.billstatus == '驳回')
  577. &&
  578. scope.row.isCreate == 0
  579. ||
  580. (scope.row.billstatus == '录入' ||
  581. scope.row.billstatus == '暂存' ||
  582. scope.row.billstatus == '驳回')
  583. &&
  584. scope.row.isCreate == 1
  585. "
  586. @click="handleDelete(scope.row)"
  587. v-hasPermi="['warehouseBusiness:outStock:remove']"
  588. >删除
  589. <!-- v-if="scope.row.itemsStatus == '计划'"-->
  590. </el-button>
  591. <el-button
  592. size="mini"
  593. type="text"
  594. icon="el-icon-delete"
  595. v-if="
  596. scope.row.billstatus == '请核' ||
  597. scope.row.billstatus == '审核中'
  598. "
  599. @click="handleUpdate(scope.row, true)"
  600. >审核进度
  601. </el-button>
  602. </template>
  603. </el-table-column>
  604. </el-table>
  605. <pagination
  606. v-show="total > 0"
  607. :total="total"
  608. :page.sync="queryParams.pageNum"
  609. :limit.sync="queryParams.pageSize"
  610. @pagination="getList"
  611. />
  612. </div>
  613. <add-or-update
  614. v-show="pageShow2"
  615. @changeShow="showAddOrUpdate"
  616. ref="addOrUpdateRef"
  617. :chiId="formId"
  618. :copyStatus="copyStatus"
  619. :key="timer"
  620. ></add-or-update>
  621. </div>
  622. </template>
  623. <script>
  624. import AddOrUpdate from "./AddOrUpdate.vue";
  625. // import {
  626. // addWhgenleg,
  627. // listWarehousebills,
  628. // getWarehousebills,
  629. // delWarehousebills,
  630. // addWarehousebills,
  631. // updateCredit,
  632. // addJoblist,
  633. // disChargelist,
  634. // warehouseSubmission,
  635. // updateWarehousebills,
  636. // exportWarehousebills,
  637. // revokeTwo,
  638. // revoke,
  639. // delOutStock_s,
  640. // serialNumber,
  641. // } from "@/api/warehouseBusiness/warehouseInAndOutStock";
  642. // import { listCorps } from "@/api/basicdata/corps";
  643. // import { listWarehousesss } from "@/api/basicdata/warehouse";
  644. // import {listGoods, queryVehicle} from "@/api/basicdata/goods";
  645. // import { listUser, queryUserVal } from "@/api/system/user";
  646. // import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  647. import Cookies from "js-cookie";
  648. // import { addSet, select, resetModule } from "@/api/system/set";
  649. import draggable from "vuedraggable";
  650. export default {
  651. name: "plans",
  652. data() {
  653. return {
  654. option:{
  655. align: 'center',
  656. stripe: true,
  657. index: true,
  658. menu: true,
  659. addBtn: false,
  660. editBtn: false,
  661. delBtn: false,
  662. height: "auto",
  663. searchSpan: 8,
  664. searchIcon: true,
  665. searchIndex: 2,
  666. highlightCurrentRow: true,
  667. column:[
  668. {
  669. index: "0",
  670. prop: "mblno",
  671. label: "提单号",
  672. width: 200,
  673. search: true,
  674. },
  675. {
  676. index: "1",
  677. prop: "createBy",
  678. label: "制单人",
  679. width: 100,
  680. },
  681. {
  682. index: "2",
  683. prop: "storekeeper",
  684. label: "仓管员",
  685. width: 100,
  686. },
  687. {
  688. index: "3",
  689. prop: "itemsStatus",
  690. label: "直装状态",
  691. width: 100,
  692. },
  693. {
  694. index: "4",
  695. prop: "corpid",
  696. label: "客户",
  697. width: 100,
  698. search: true,
  699. },
  700. {
  701. index: "6",
  702. prop: "productName",
  703. label: "品名",
  704. width: 100,
  705. },
  706. {
  707. index: "7",
  708. prop: "marks",
  709. label: "品牌",
  710. width: 100,
  711. search: true,
  712. },
  713. {
  714. index: "8",
  715. prop: "bsdate",
  716. label: "出库日期",
  717. width: 100,
  718. search: true,
  719. },
  720. {
  721. index: "9",
  722. prop: "warehouseid",
  723. label: "仓库",
  724. width: 100,
  725. },
  726. {
  727. index: "10",
  728. prop: "planqty",
  729. label: "计划件数",
  730. width: 100,
  731. },
  732. {
  733. index: "11",
  734. prop: "qty",
  735. label: "出库件数",
  736. width: 100,
  737. },
  738. {
  739. index: "12",
  740. prop: "grossweight",
  741. label: "出库毛重",
  742. width: 100,
  743. },
  744. {
  745. index: "13",
  746. prop: "netweight",
  747. label: "出库净重",
  748. width: 100,
  749. },
  750. {
  751. index: "14",
  752. prop: "truckno",
  753. label: "车号",
  754. width: 100,
  755. search: true,
  756. },
  757. {
  758. index: "15",
  759. prop: "driverName",
  760. label: "司机名称",
  761. width: 100,
  762. },
  763. {
  764. index: "16",
  765. prop: "driverTel",
  766. label: "司机电话",
  767. width: 100,
  768. },
  769. {
  770. index: "17",
  771. prop: "driverIdCar",
  772. label: "司机身份证",
  773. width: 100,
  774. },
  775. {
  776. index: "18",
  777. prop: "businessType",
  778. label: "业务类别",
  779. width: 100,
  780. },
  781. {
  782. index: "19",
  783. prop: "feeStatus",
  784. label: "费用状态",
  785. width: 100,
  786. },
  787. {
  788. index: "20",
  789. prop: "billno",
  790. label: "系统编号",
  791. width: 100,
  792. }
  793. ]
  794. },
  795. timer: "",
  796. pageShow: true,
  797. pageShow2: false,
  798. queryParams: {
  799. pageNum: 1,
  800. pageSize: 10,
  801. billno: null,
  802. createBy: null,
  803. trademodeid: null,
  804. corpid: null,
  805. mblno: null,
  806. sbu: null,
  807. goodsid: null,
  808. warehouseid: null,
  809. marks: null,
  810. billstatus: null,
  811. itemsStatus: null,
  812. timeInterval: null,
  813. feeStatus:null,
  814. },
  815. // 显示搜索条件
  816. showSearch: true,
  817. userOptions: [],
  818. trademodeidOptions: [],
  819. warehouseOptions: [],
  820. goodsOptions: [],
  821. mblnoOptions: [],
  822. show: false,
  823. drag: false,
  824. tableDate: [
  825. {
  826. surface: "0",
  827. label: "mblno",
  828. name: "提单号",
  829. checked: 0,
  830. width: 200,
  831. fixed: "left",
  832. },
  833. {
  834. surface: "1",
  835. label: "createBy",
  836. name: "制单人",
  837. checked: 0,
  838. width: 100,
  839. },
  840. {
  841. surface: "2",
  842. label: "storekeeper",
  843. name: "仓管员",
  844. checked: 0,
  845. width: 100,
  846. },
  847. {
  848. surface: "3",
  849. label: "itemsStatus",
  850. name: "直装状态",
  851. checked: 0,
  852. width: 100,
  853. },
  854. {
  855. surface: "4",
  856. label: "corpid",
  857. name: "客户",
  858. checked: 0,
  859. width: 100,
  860. },
  861. {
  862. surface: "6",
  863. label: "productName",
  864. name: "品名",
  865. checked: 0,
  866. width: 100,
  867. },
  868. {
  869. surface: "7",
  870. label: "marks",
  871. name: "品牌",
  872. checked: 0,
  873. width: 100,
  874. },
  875. {
  876. surface: "8",
  877. label: "bsdate",
  878. name: "出库日期",
  879. checked: 0,
  880. width: 100,
  881. },
  882. {
  883. surface: "9",
  884. label: "warehouseid",
  885. name: "仓库",
  886. checked: 0,
  887. width: 100,
  888. },
  889. {
  890. surface: "10",
  891. label: "planqty",
  892. name: "计划件数",
  893. checked: 0,
  894. width: 100,
  895. },
  896. {
  897. surface: "11",
  898. label: "qty",
  899. name: "出库件数",
  900. checked: 0,
  901. width: 100,
  902. },
  903. {
  904. surface: "12",
  905. label: "grossweight",
  906. name: "出库毛重",
  907. checked: 0,
  908. width: 100,
  909. },
  910. {
  911. surface: "13",
  912. label: "netweight",
  913. name: "出库净重",
  914. checked: 0,
  915. width: 100,
  916. },
  917. {
  918. surface: "14",
  919. label: "truckno",
  920. name: "车号",
  921. checked: 0,
  922. width: 100,
  923. },
  924. {
  925. surface: "15",
  926. label: "driverName",
  927. name: "司机名称",
  928. checked: 0,
  929. width: 100,
  930. },
  931. {
  932. surface: "16",
  933. label: "driverTel",
  934. name: "司机电话",
  935. checked: 0,
  936. width: 100,
  937. },
  938. {
  939. surface: "17",
  940. label: "driverIdCar",
  941. name: "司机身份证",
  942. checked: 0,
  943. width: 100,
  944. },
  945. {
  946. surface: "18",
  947. label: "businessType",
  948. name: "业务类别",
  949. checked: 0,
  950. width: 100,
  951. },
  952. {
  953. surface: "19",
  954. label: "feeStatus",
  955. name: "费用状态",
  956. checked: 0,
  957. width: 100,
  958. },
  959. {
  960. surface: "20",
  961. label: "billno",
  962. name: "系统编号",
  963. checked: 0,
  964. width: 100,
  965. },
  966. ],
  967. setRowList: [],
  968. getRowList: [],
  969. allCheck: false,
  970. showSetting: false,
  971. total: 0,
  972. warehousebillsList: [],
  973. loading: true,
  974. single: true,
  975. multiple: true,
  976. formId: null,
  977. ids: [],
  978. copyStatus: null,
  979. trucknoList:[],
  980. };
  981. },
  982. // 使用子组件
  983. components: { draggable, AddOrUpdate },
  984. created() {
  985. let i = 0;
  986. this.option.column.forEach(item => {
  987. if (item.search) i++
  988. })
  989. if (i % 3 !== 0) {
  990. const num = 3 - Number(i % 3)
  991. this.option.searchMenuSpan = num * 8;
  992. this.option.searchMenuPosition = "right";
  993. }
  994. queryVehicle().then(res=>{
  995. this.trucknoList = res.data
  996. })
  997. this.setRowList = this.tableDate;
  998. this.getRowList = this.tableDate;
  999. this.getDicts("data_trademodes").then((response) => {
  1000. this.trademodeidOptions = response.data;
  1001. });
  1002. listGoods({ status: 0, delFlag: 0 }).then((response) => {
  1003. this.goodsOptions = response.rows;
  1004. });
  1005. listWarehousesss({ status: 0, delFlag: 0 }).then((response) => {
  1006. this.warehouseOptions = response.rows;
  1007. });
  1008. listUser().then((response) => {
  1009. this.userOptions = response.rows;
  1010. });
  1011. listCorps({ type: 1 }).then((response) => {
  1012. this.mblnoOptions = response.rows;
  1013. });
  1014. this.getRow();
  1015. this.getList();
  1016. },
  1017. activated() {
  1018. if (this.$route.query.id) {
  1019. this.handleUpdate(this.$route.query.id);
  1020. }
  1021. },
  1022. methods: {
  1023. //列设置全选
  1024. allChecked() {
  1025. if (this.allCheck == true) {
  1026. this.setRowList.map((e) => {
  1027. return (e.checked = 0);
  1028. });
  1029. } else {
  1030. this.setRowList.map((e) => {
  1031. return (e.checked = 1);
  1032. });
  1033. }
  1034. },
  1035. //查询列数据
  1036. getRow() {
  1037. let that = this;
  1038. this.data = {
  1039. tableName: "出库",
  1040. userId: Cookies.get("userName"),
  1041. };
  1042. select(this.data).then((res) => {
  1043. if (res.data.length != 0) {
  1044. this.getRowList = res.data.filter((e) => e.checked == 0);
  1045. this.setRowList = res.data;
  1046. this.setRowList = this.setRowList.reduce((res, item) => {
  1047. res.push({
  1048. surface: item.surface,
  1049. label: item.label,
  1050. name: item.name,
  1051. checked: item.checked,
  1052. width: item.width,
  1053. fixed: item.fixed,
  1054. });
  1055. return res;
  1056. }, []);
  1057. }
  1058. });
  1059. },
  1060. //重置列表
  1061. delRow() {
  1062. this.data = {
  1063. tableName: "出库",
  1064. userId: Cookies.get("userName"),
  1065. };
  1066. resetModule(this.data).then((res) => {
  1067. if (res.code == 200) {
  1068. this.showSetting = false;
  1069. this.setRowList = this.$options.data().tableDate;
  1070. this.getRowList = this.$options.data().tableDate;
  1071. }
  1072. });
  1073. },
  1074. //保存列设置
  1075. save() {
  1076. this.showSetting = false;
  1077. this.data = {
  1078. tableName: "出库",
  1079. userId: Cookies.get("userName"),
  1080. sysTableSetList: this.setRowList,
  1081. };
  1082. addSet(this.data).then((res) => {
  1083. if (res.code == 200) {
  1084. this.showSetting = false;
  1085. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  1086. console.log(this.tableDate);
  1087. }
  1088. });
  1089. },
  1090. //开始拖拽事件
  1091. onStart() {
  1092. this.drag = true;
  1093. },
  1094. //拖拽结束事件
  1095. onEnd() {
  1096. this.drag = false;
  1097. },
  1098. getList() {
  1099. //获取仓库
  1100. listWarehousebills(this.queryParams).then((response) => {
  1101. this.warehousebillsList = response.rows;
  1102. this.total = response.total;
  1103. this.loading = false;
  1104. });
  1105. },
  1106. //合计
  1107. getSum(param) {
  1108. const { columns, data } = param;
  1109. const sums = [];
  1110. var values = [];
  1111. columns.forEach((column, index) => {
  1112. if (index === 0) {
  1113. sums[index] = "合计";
  1114. return;
  1115. }
  1116. if (column.property === "grossweight") {
  1117. values = data.map((item) => Number(item["grossweight"]));
  1118. }
  1119. if (column.property === "netweight") {
  1120. values = data.map((item) => Number(item["netweight"]));
  1121. }
  1122. if (column.property === "qty") {
  1123. values = data.map((item) => Number(item["qty"]));
  1124. }
  1125. if (column.property === "planqty") {
  1126. values = data.map((item) => Number(item.planqty));
  1127. }
  1128. if (
  1129. column.property === "grossweight" ||
  1130. column.property === "netweight" ||
  1131. column.property === "qty" ||
  1132. column.property === "planqty"
  1133. ) {
  1134. sums[index] = values.reduce((prev, curr) => {
  1135. const value = Number(curr);
  1136. if (!isNaN(value)) {
  1137. return prev + curr;
  1138. } else {
  1139. return prev;
  1140. }
  1141. }, 0);
  1142. if (column.property === "grossweight") {
  1143. sums[index] = sums[index].toFixed(4) + "吨";
  1144. }
  1145. if (column.property === "netweight") {
  1146. sums[index] = sums[index].toFixed(4) + "吨";
  1147. }
  1148. if (column.property === "qty") {
  1149. sums[index] = sums[index].toFixed(2);
  1150. }
  1151. if (column.property === "planqty") {
  1152. if (sums[index]) {
  1153. sums[index] = sums[index];
  1154. }
  1155. }
  1156. }
  1157. });
  1158. return sums;
  1159. },
  1160. handleAdd() {
  1161. this.timer = new Date().getTime();
  1162. this.pageShow = false;
  1163. this.pageShow2 = true;
  1164. },
  1165. // 多选框选中数据
  1166. handleSelectionChange(selection) {
  1167. this.ids = selection.map((item) => item.id);
  1168. this.single =
  1169. selection.length !== 1 ||
  1170. selection.map((item) => item.billstatus) == 6 ||
  1171. selection.map((item) => item.billstatus) == 4;
  1172. this.multiple = !selection.length;
  1173. },
  1174. /** 修改按钮操作 */
  1175. handleUpdate(row) {
  1176. const id = row.id || this.ids[0]|| row;
  1177. this.copyStatus = null;
  1178. this.formId = id;
  1179. this.$nextTick(() => {
  1180. this.$refs.addOrUpdateRef.init();
  1181. });
  1182. setTimeout(() => {
  1183. this.pageShow = false;
  1184. this.pageShow2 = true;
  1185. }, 200);
  1186. },
  1187. copyUpdate() {
  1188. this.formId = this.ids[0];
  1189. this.copyStatus = 2;
  1190. this.$nextTick(() => {
  1191. this.$refs.addOrUpdateRef.init();
  1192. });
  1193. setTimeout(() => {
  1194. this.pageShow = false;
  1195. this.pageShow2 = true;
  1196. }, 200);
  1197. },
  1198. /** 删除按钮操作 */
  1199. handleDelete(row) {
  1200. const ids = row.id || this.ids;
  1201. delOutStock_s(ids).then((data) => {
  1202. switch (data.msg) {
  1203. case "0": {
  1204. this.$message.error("当前数据已被其他操作员操作请刷新页面");
  1205. break;
  1206. }
  1207. case "1": {
  1208. this.delete(ids, "当前主表有数据从表无数据是否删除");
  1209. break;
  1210. }
  1211. case "2": {
  1212. this.delete(ids, "当前主表有数据从表有数据是否删除");
  1213. break;
  1214. }
  1215. default: {
  1216. return this.$message.error("未知错误,无状态");
  1217. }
  1218. }
  1219. });
  1220. },
  1221. delete(ids, tips) {
  1222. this.$confirm(tips, "警告", {
  1223. confirmButtonText: "确定",
  1224. cancelButtonText: "取消",
  1225. type: "warning",
  1226. }).then(() => {
  1227. delWarehousebills(ids).then(res => {
  1228. this.msgSuccess("删除成功");
  1229. this.getList();
  1230. });
  1231. });
  1232. },
  1233. /** 导出按钮操作 */
  1234. handleExport() {
  1235. this.$confirm('是否确认导出所有场地直装数据项?', '警告', {
  1236. confirmButtonText: "确定",
  1237. cancelButtonText: "取消",
  1238. type: "warning",
  1239. }).then(() => {
  1240. exportWarehousebills(this.queryParams).then(res => {
  1241. this.download(res.msg);
  1242. })
  1243. })
  1244. // this.$message.warning('功能开发中')
  1245. // require.ensure([], () => {
  1246. // const { export_json_to_excel } = require("../../../excel/Export2Excel");
  1247. // const tHeader = ["客户名称", "制单日期"];
  1248. // // 上面设置Excel的表格第一行的标题
  1249. // const filterVal = ["corpId", "createTime"];
  1250. // // 上面的index、nickName、name是tableData里对象的属性
  1251. // const list = this.ftmsorderbillsList; //把data里的tableData存到list
  1252. // const data = this.formatJson(filterVal, list);
  1253. // export_json_to_excel(
  1254. // tHeader,
  1255. // data,
  1256. // "列表excel",
  1257. // true,
  1258. // );
  1259. // });
  1260. },
  1261. formatJson(filterVal, jsonData) {
  1262. return jsonData.map((v) => filterVal.map((j) => v[j]));
  1263. },
  1264. /** 搜索按钮操作 */
  1265. handleQuery(params) {
  1266. this.queryParams = params
  1267. this.queryParams.pageNum = 1;
  1268. this.getList();
  1269. },
  1270. /** 重置按钮操作 */
  1271. resetQuery() {
  1272. this.queryParams = {
  1273. pageNum: 1,
  1274. pageSize: 10,
  1275. billno: null,
  1276. createBy: null,
  1277. trademodeid: null,
  1278. corpid: null,
  1279. mblno: null,
  1280. sbu: null,
  1281. goodsid: null,
  1282. warehouseid: null,
  1283. marks: null,
  1284. billstatus: null,
  1285. itemsStatus: null,
  1286. timeInterval: null,
  1287. feeStatus: null,
  1288. };
  1289. this.handleQuery();
  1290. },
  1291. showAddOrUpdate(data) {
  1292. if (data) {
  1293. this.getList();
  1294. this.pageShow = true;
  1295. this.pageShow2 = false;
  1296. }
  1297. },
  1298. },
  1299. };
  1300. </script>