index.vue 70 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438
  1. <template>
  2. <div class="app-container">
  3. <div v-if="MainTable == false">
  4. <MainForm
  5. ref="MainForm"
  6. :searchdata="formOption"
  7. :display="display"
  8. :form="queryParms"
  9. :show="show"
  10. :inDex="inDex"
  11. />
  12. <listComponent
  13. style="clear: both"
  14. v-if="waitFor"
  15. :tableData="tableData"
  16. @selectionbox="selectionbox"
  17. @see="viewMethod"
  18. @modify="modification"
  19. @deletion="deletion"
  20. @buttonList="buttonList"
  21. @showSearch="showSearch"
  22. @getList="getList"
  23. @feedback="feedback"
  24. :customButton="customButton"
  25. :arrow="arrow"
  26. :hasPermi="hasPermi"
  27. :tatolLabel="mainTatol"
  28. :seachButton="seachButton"
  29. :setRowList="setRowList"
  30. :listStyle="listStyle"
  31. :isItHidden="isItHidden"
  32. :queryList="queryList"
  33. />
  34. <div style="float: right; margin-bottom: 10px">
  35. <pagination
  36. v-show="total > 0"
  37. :total="total"
  38. :page.sync="queryParms.pageNum"
  39. :limit.sync="queryParms.pageSize"
  40. @pagination="getList"
  41. :page-sizes="[10, 100, 200, 500, 1000]"
  42. />
  43. </div>
  44. </div>
  45. <div v-if="MainTable == true">
  46. <el-breadcrumb
  47. separator="/"
  48. style="display: flex; align-items: center; margin-bottom: 10px"
  49. >
  50. <el-breadcrumb-item>
  51. <el-button
  52. plain
  53. size="mini"
  54. type="danger"
  55. icon="el-icon-arrow-left"
  56. @click="backRules"
  57. >
  58. 返回列表
  59. </el-button>
  60. </el-breadcrumb-item>
  61. </el-breadcrumb>
  62. <h1 style="text-align: center; margin-top: -42px">仓库入库</h1>
  63. <MainForm
  64. ref="detailForm"
  65. :searchdata="detailOption"
  66. :display="display"
  67. :form="detailForm"
  68. :show="(show = true)"
  69. :inDex="inDex"
  70. @backRules="backRules"
  71. @backSave="backSave"
  72. @verificationRules="verificationRules"
  73. @changeWarehouse="changeWarehouse"
  74. />
  75. <list-component
  76. v-if="waitFor"
  77. :tableData="detailData"
  78. @selectionbox="selectionbox"
  79. @see="viewMethod"
  80. @modify="modification"
  81. @deletion="deletion"
  82. @buttonList="buttonList"
  83. @showSearch="showSearch"
  84. @getList="getList"
  85. @deletRows="deletRows"
  86. @feedback="feedback"
  87. @totalAmount="totalAmount"
  88. @change="change"
  89. :seachButton="confirmButton"
  90. :customButton="detailButton"
  91. :listStyle="detailStyle"
  92. :hasPermi="hasPermi"
  93. :setRowList="setRowList"
  94. :tatolLabel="tatolLabel"
  95. :listData="listData"
  96. :queryList="detailList"
  97. />
  98. </div>
  99. <el-dialog
  100. title="打印入库"
  101. :visible.sync="dialogVisible"
  102. :fullscreen="true"
  103. style="padding: 0; margin: 0"
  104. width="70%"
  105. >
  106. <div ref="print">
  107. <table
  108. class="table table-striped table-bordered"
  109. align="center"
  110. valign="center"
  111. style="
  112. font-size: 12px;
  113. border-collapse: collapse;
  114. border: none;
  115. margin-top: 10px;
  116. "
  117. >
  118. <tr>
  119. <td
  120. style="font-size: 24px; font-weight: bold"
  121. class="column"
  122. colspan="15"
  123. align="center"
  124. >
  125. 入库明细
  126. </td>
  127. </tr>
  128. <tr>
  129. <td
  130. class="column"
  131. style="border: 1px solid #000; padding: 10px"
  132. align="center"
  133. rowspan="2"
  134. >
  135. 入库时间
  136. </td>
  137. <td
  138. class="column"
  139. style="border: 1px solid #000; padding: 10px"
  140. align="center"
  141. rowspan="2"
  142. >
  143. 产品名称
  144. </td>
  145. <td
  146. class="column"
  147. style="border: 1px solid #000; padding: 10px"
  148. align="center"
  149. rowspan="2"
  150. >
  151. 规格
  152. </td>
  153. <td
  154. class="column"
  155. style="border: 1px solid #000; padding: 10px"
  156. align="center"
  157. rowspan="2"
  158. >
  159. 数量
  160. </td>
  161. <td
  162. class="column"
  163. style="border: 1px solid #000; padding: 10px"
  164. align="center"
  165. rowspan="2"
  166. >
  167. 供货商
  168. </td>
  169. <td
  170. class="column"
  171. style="border: 1px solid #000; padding: 10px"
  172. align="center"
  173. rowspan="2"
  174. >
  175. 供货人
  176. </td>
  177. <td
  178. class="column"
  179. style="border: 1px solid #000; padding: 10px"
  180. align="center"
  181. rowspan="2"
  182. >
  183. 联系电话
  184. </td>
  185. <td
  186. class="column"
  187. style="border: 1px solid #000; padding: 10px"
  188. align="center"
  189. rowspan="2"
  190. >
  191. 生产日期或批号
  192. </td>
  193. <td
  194. class="column"
  195. style="border: 1px solid #000; padding: 10px"
  196. align="center"
  197. rowspan="2"
  198. >
  199. 保质期限
  200. </td>
  201. <td
  202. class="column"
  203. style="border: 1px solid #000; padding: 10px"
  204. align="center"
  205. rowspan="2"
  206. >
  207. 保存条件
  208. </td>
  209. <td
  210. class="column"
  211. style="border: 1px solid #000; padding: 10px"
  212. align="center"
  213. rowspan="2"
  214. >
  215. 索证索票情况
  216. </td>
  217. <td
  218. class="column"
  219. style="border: 1px solid #000; padding: 10px"
  220. align="center"
  221. rowspan="2"
  222. >
  223. 采购人
  224. </td>
  225. <td
  226. class="column"
  227. style="border: 1px solid #000; padding: 10px"
  228. align="center"
  229. colspan="2"
  230. >
  231. 检验结果
  232. </td>
  233. <td
  234. class="column"
  235. style="border: 1px solid #000; padding: 10px"
  236. align="center"
  237. rowspan="2"
  238. >
  239. 验收人
  240. </td>
  241. </tr>
  242. <tr>
  243. <td
  244. class="column"
  245. style="border: 1px solid #000; padding: 10px"
  246. align="center"
  247. >
  248. 感官
  249. </td>
  250. <td
  251. class="column"
  252. style="border: 1px solid #000; padding: 10px"
  253. align="center"
  254. >
  255. 数量
  256. </td>
  257. </tr>
  258. <tr v-for="(item, index) in this.detailData" :key="index">
  259. <td
  260. class="column"
  261. style="border: 1px solid #000; padding: 10px"
  262. align="center"
  263. >
  264. {{ detailForm.fBsdate }}
  265. </td>
  266. <td
  267. class="column"
  268. style="border: 1px solid #000; padding: 10px"
  269. align="center"
  270. >
  271. {{ item.feeName }}
  272. </td>
  273. <td
  274. class="column"
  275. style="border: 1px solid #000; padding: 10px"
  276. align="center"
  277. >
  278. {{ item.fFeeunitid }}
  279. </td>
  280. <td
  281. class="column"
  282. style="border: 1px solid #000; padding: 10px"
  283. align="center"
  284. >
  285. {{ item.fQty }}
  286. </td>
  287. <td
  288. class="column"
  289. style="border: 1px solid #000; padding: 10px"
  290. align="center"
  291. >
  292. {{ detailForm.corpName }}
  293. </td>
  294. <td
  295. class="column"
  296. style="border: 1px solid #000; padding: 10px"
  297. align="center"
  298. >
  299. {{ item.fAmount }}
  300. </td>
  301. <td
  302. class="column"
  303. style="border: 1px solid #000; padding: 10px"
  304. align="center"
  305. ></td>
  306. <!-- <td class="column" style="border: 1px solid #000; padding:10px" align="center">{{ item.fStltypeid }}</td>-->
  307. <td
  308. class="column"
  309. style="border: 1px solid #000; padding: 10px"
  310. align="center"
  311. >
  312. {{ item.tProductdate }}/{{ item.fLotno }}
  313. </td>
  314. <td
  315. class="column"
  316. style="border: 1px solid #000; padding: 10px"
  317. align="center"
  318. >
  319. {{ item.fValid }}{{ item.fUnitsName }}
  320. </td>
  321. <td
  322. class="column"
  323. style="border: 1px solid #000; padding: 10px"
  324. align="center"
  325. >
  326. {{ item.fStoreEnvName }}
  327. </td>
  328. <td
  329. class="column"
  330. style="border: 1px solid #000; padding: 10px"
  331. align="center"
  332. >
  333. {{ item.fIsfillesName }}
  334. </td>
  335. <td
  336. class="column"
  337. style="border: 1px solid #000; padding: 10px"
  338. align="center"
  339. >
  340. {{ detailForm.fpurchaseName }}
  341. </td>
  342. <td
  343. class="column"
  344. style="border: 1px solid #000; padding: 10px"
  345. align="center"
  346. ></td>
  347. <td
  348. class="column"
  349. style="border: 1px solid #000; padding: 10px"
  350. align="center"
  351. ></td>
  352. <td
  353. class="column"
  354. style="border: 1px solid #000; padding: 10px"
  355. align="center"
  356. ></td>
  357. </tr>
  358. </table>
  359. </div>
  360. <span slot="footer" class="dialog-footer">
  361. <el-button @click="dialogVisible = false">取 消</el-button>
  362. <el-button type="primary" @click="Printing">打印</el-button>
  363. </span>
  364. </el-dialog>
  365. </div>
  366. </template>
  367. <script>
  368. import { select } from "@/api/system/set";
  369. import MainForm from "@/combination/MainForm";
  370. import {
  371. listInStock,
  372. addSave,
  373. getSave,
  374. getArea,
  375. getustomer,
  376. getEntry,
  377. getwarehouse,
  378. getGoodName,
  379. canBedelet,
  380. delRows,
  381. getWarehousekeeper,
  382. addWarehous,
  383. deletMain,
  384. delFee,
  385. copyNew,
  386. listQuery,
  387. revokeBill,
  388. queryUserVal,
  389. exportInstock,
  390. getExport,
  391. } from "@/api/warehouse/inStock";
  392. import Cookies from "js-cookie";
  393. import { getliable } from "@/api/project";
  394. import moment from "moment";
  395. export default {
  396. name: "inStock",
  397. data() {
  398. return {
  399. lander: "",
  400. copyeId: "",
  401. hasPermi: {
  402. lookup: ["anpin:stockControl:query"],
  403. disappear: ["anpin:stockControl:remove"],
  404. },
  405. formList: {},
  406. dialogVisible: false,
  407. mainTatol: ["金额"],
  408. ids: [],
  409. listData: {
  410. fFeeid: [],
  411. fFeeunitid: [],
  412. fStltypeid: [],
  413. fWarehouseid: [],
  414. fUnits: [],
  415. fStoreEnv: [],
  416. fIsfilles: [],
  417. },
  418. selection: [],
  419. isItHidden: true,
  420. // 非单个禁用
  421. single: true,
  422. // 总条数
  423. total: 0,
  424. inDex: 4,
  425. tatolLabel: ["单价", "数量", "金额"],
  426. MainTable: false,
  427. show: false,
  428. arrow: "el-icon-arrow-up",
  429. queryList: {
  430. tableName: "入库主表",
  431. columnList: [],
  432. },
  433. detailList: {
  434. tableName: "仓库入库详情",
  435. columnList: [],
  436. },
  437. //判断自定义列是否有值再渲染组件
  438. waitFor: false,
  439. display: 3,
  440. queryParms: {
  441. pageNum: 1,
  442. pageSize: 10,
  443. fBilltype: "RK",
  444. },
  445. detailForm: {},
  446. setRowList: [],
  447. //主页面默认显示4个表单数据
  448. formOption: [
  449. {
  450. span: 6,
  451. label: "fBillno",
  452. name: "系统编号",
  453. form: 2,
  454. width: 200,
  455. labelSize: "80",
  456. rules: { required: false },
  457. },
  458. {
  459. span: 6,
  460. label: "fWarehouseid",
  461. name: "仓库",
  462. form: 1,
  463. width: 200,
  464. labelSize: "80",
  465. rules: { required: false },
  466. data: [],
  467. },
  468. {
  469. span: 6,
  470. label: "fCorpid",
  471. name: "供应商",
  472. form: 1,
  473. width: 200,
  474. labelSize: "80",
  475. rules: { required: false },
  476. data: [],
  477. },
  478. {
  479. span: 6,
  480. label: "timeInterval",
  481. name: "入库日期",
  482. form: 6,
  483. width: 250,
  484. labelSize: "80",
  485. rules: { required: false },
  486. },
  487. {
  488. span: 6,
  489. label: "cLoadDate",
  490. name: "制单日期",
  491. form: 6,
  492. width: 200,
  493. labelSize: "80",
  494. rules: { required: false },
  495. },
  496. {
  497. span: 6,
  498. label: "moneys",
  499. name: "金额范围",
  500. form: 5,
  501. width: 200,
  502. labelSize: "80",
  503. rules: { required: false },
  504. },
  505. {
  506. span: 6,
  507. label: "createBy",
  508. name: "申请人",
  509. form: 2,
  510. width: 200,
  511. labelSize: "80",
  512. rules: { required: false },
  513. },
  514. {
  515. span: 6,
  516. label: "fGoodsid",
  517. name: "项目名称",
  518. form: 1,
  519. width: 200,
  520. labelSize: "80",
  521. rules: { required: false },
  522. data: [],
  523. },
  524. {
  525. span: 6,
  526. label: "remark",
  527. name: "备注",
  528. form: 2,
  529. width: 200,
  530. labelSize: "80",
  531. rules: { required: false },
  532. },
  533. {
  534. span: 6,
  535. label: "fFeeid",
  536. name: "品名",
  537. form: 1,
  538. width: 200,
  539. labelSize: "80",
  540. data: [],
  541. rules: { required: false },
  542. },
  543. ],
  544. //表名称
  545. tableData: [],
  546. //从表表名
  547. detailData: [],
  548. //传输表
  549. mainStyle: [],
  550. //表数据
  551. listStyle: [
  552. {
  553. surface: "1",
  554. label: "serialNumber",
  555. name: "序号",
  556. checked: 0,
  557. width: 100,
  558. onabort: "",
  559. },
  560. {
  561. surface: "2",
  562. label: "fBillno",
  563. name: "系统编号",
  564. checked: 0,
  565. width: 100,
  566. },
  567. {
  568. surface: "3",
  569. label: "fWarehouseName",
  570. name: "仓库",
  571. checked: 0,
  572. width: 200,
  573. operation: 1,
  574. },
  575. {
  576. surface: "4",
  577. label: "corpName",
  578. name: "供应商",
  579. checked: 0,
  580. width: 200,
  581. operation: 1,
  582. },
  583. {
  584. surface: "5",
  585. label: "fMoney",
  586. name: "金额",
  587. checked: 0,
  588. width: 200,
  589. operation: 1,
  590. },
  591. {
  592. surface: "6",
  593. label: "createTime",
  594. name: "制单日期",
  595. checked: 0,
  596. width: 200,
  597. operation: 1,
  598. },
  599. {
  600. surface: "7",
  601. label: "fBsdate",
  602. name: "入库日期",
  603. checked: 0,
  604. width: 200,
  605. operation: 1,
  606. },
  607. {
  608. surface: "8",
  609. label: "createBy",
  610. name: "申请人",
  611. checked: 0,
  612. width: 200,
  613. operation: 1,
  614. },
  615. {
  616. surface: "9",
  617. label: "fBillstatusName",
  618. name: "状态",
  619. checked: 0,
  620. width: 200,
  621. operation: 1,
  622. },
  623. {
  624. surface: "10",
  625. label: "fReviewDate",
  626. name: "审核日期",
  627. checked: 0,
  628. width: 200,
  629. operation: 1,
  630. },
  631. {
  632. surface: "11",
  633. label: "projectName",
  634. name: "项目名称",
  635. checked: 0,
  636. width: 200,
  637. operation: 1,
  638. },
  639. {
  640. surface: "12",
  641. label: "remark",
  642. name: "备注",
  643. checked: 0,
  644. width: 200,
  645. operation: 1,
  646. },
  647. {
  648. surface: "13",
  649. label: "fCreateLog",
  650. name: "生成日志",
  651. checked: 0,
  652. width: 160,
  653. operation: "1",
  654. onabort: "",
  655. },
  656. {
  657. surface: "14",
  658. label: "fMaterial2",
  659. name: "操作",
  660. checked: 0,
  661. width: 200,
  662. operation: 1,
  663. fixed: "right",
  664. },
  665. ],
  666. //从表数据
  667. detailStyle: [
  668. {
  669. surface: "1",
  670. label: "serialNumber",
  671. name: "序号",
  672. checked: 0,
  673. width: 100,
  674. onabort: "",
  675. },
  676. {
  677. surface: "2",
  678. label: "fFeeid",
  679. name: "*品名",
  680. checked: 0,
  681. width: 200,
  682. changeable: 1,
  683. data: [],
  684. disabled: false,
  685. },
  686. {
  687. surface: "3",
  688. label: "fCurrencyName",
  689. name: "*规格",
  690. checked: 0,
  691. width: 100,
  692. disabled: false,
  693. },
  694. {
  695. surface: "4",
  696. label: "fUnitprice",
  697. name: "*单价",
  698. checked: 0,
  699. width: 100,
  700. operation: 2,
  701. changeable: 2,
  702. disabled: false,
  703. onabort: "this.value=this.value.replace(/[^\\d^\\.]+/g,'')",
  704. },
  705. {
  706. surface: "5",
  707. label: "fQty",
  708. name: "*数量",
  709. checked: 0,
  710. width: 100,
  711. operation: 2,
  712. changeable: 2,
  713. disabled: false,
  714. onabort: "this.value=this.value.replace(/[^\\d^\\.]+/g,'')",
  715. },
  716. {
  717. surface: "6",
  718. label: "fFeeunitid",
  719. name: "*计量单位",
  720. checked: 0,
  721. width: 100,
  722. changeable: 1,
  723. operation: 2,
  724. data: [],
  725. disabled: false,
  726. },
  727. {
  728. surface: "7",
  729. label: "fWarehouseid",
  730. name: "*库区",
  731. checked: 0,
  732. width: 100,
  733. operation: 2,
  734. changeable: 1,
  735. data: [],
  736. disabled: false,
  737. },
  738. {
  739. surface: "8",
  740. label: "fAmount",
  741. name: "*金额",
  742. checked: 0,
  743. width: 100,
  744. operation: 2,
  745. changeable: 2,
  746. disabled: false,
  747. onabort:
  748. 'this.value=this.value.replace(/[^\\-?\\d.]/g,"").replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/, "$1$2.$3")',
  749. },
  750. {
  751. surface: "9",
  752. label: "fStltypeid",
  753. name: "付费方式",
  754. checked: 0,
  755. width: 100,
  756. operation: 2,
  757. changeable: 1,
  758. data: [],
  759. disabled: false,
  760. },
  761. {
  762. surface: "10",
  763. label: "tProductdate",
  764. name: "生产日期",
  765. checked: 0,
  766. width: 100,
  767. operation: 2,
  768. changeable: 3,
  769. data: [],
  770. disabled: false,
  771. },
  772. {
  773. surface: "11",
  774. label: "fLotno",
  775. name: "批号",
  776. checked: 0,
  777. width: 100,
  778. operation: 2,
  779. changeable: 2,
  780. data: [],
  781. disabled: false,
  782. },
  783. {
  784. surface: "12",
  785. label: "fValid",
  786. name: "保质期限",
  787. checked: 0,
  788. width: 100,
  789. operation: 2,
  790. changeable: 2,
  791. data: [],
  792. disabled: false,
  793. onabort: "this.value=this.value.replace(/[^\\d^\\.]+/g,'')",
  794. },
  795. {
  796. surface: "13",
  797. label: "fUnits",
  798. name: "单位",
  799. checked: 0,
  800. width: 100,
  801. operation: 2,
  802. changeable: 1,
  803. data: [],
  804. disabled: false,
  805. },
  806. {
  807. surface: "14",
  808. label: "fStoreEnv",
  809. name: "存储环境",
  810. checked: 0,
  811. width: 100,
  812. operation: 2,
  813. changeable: 1,
  814. data: [],
  815. disabled: false,
  816. },
  817. {
  818. surface: "15",
  819. label: "fIsfilles",
  820. name: "索证索票",
  821. checked: 0,
  822. width: 100,
  823. operation: 2,
  824. changeable: 1,
  825. disabled: false,
  826. },
  827. {
  828. surface: "16",
  829. label: "remark",
  830. name: "备注",
  831. checked: 0,
  832. width: 100,
  833. operation: 2,
  834. changeable: 2,
  835. disabled: false,
  836. },
  837. {
  838. surface: "17",
  839. label: "fReviewDate",
  840. name: "审核日期",
  841. checked: 0,
  842. width: 100,
  843. operation: 2,
  844. disabled: false,
  845. },
  846. {
  847. surface: "18",
  848. label: "createBy",
  849. name: "申请人",
  850. checked: 0,
  851. width: 100,
  852. operation: 2,
  853. disabled: false,
  854. },
  855. {
  856. surface: "19",
  857. label: "fMaterial10",
  858. name: "操作",
  859. checked: 0,
  860. width: 100,
  861. operation: 2,
  862. disabled: false,
  863. },
  864. ],
  865. //详情主表
  866. detailOption: [
  867. {
  868. index: "1",
  869. span: 6,
  870. label: "fBillno",
  871. name: "系统编号",
  872. form: 2,
  873. width: 200,
  874. labelSize: "80",
  875. rules: "",
  876. disabled: true,
  877. doNot: "1",
  878. },
  879. {
  880. index: "2",
  881. span: 6,
  882. label: "fCorpid",
  883. name: "供应商",
  884. form: 1,
  885. width: 200,
  886. labelSize: "80",
  887. rules: { required: true, message: " ", trigger: "blur" },
  888. data: [],
  889. disabled: false,
  890. },
  891. {
  892. index: "3",
  893. span: 6,
  894. label: "fStorekeeper",
  895. name: "库管员",
  896. form: 1,
  897. width: 200,
  898. labelSize: "80",
  899. rules: { required: true, message: " ", trigger: "blur" },
  900. data: [],
  901. disabled: false,
  902. },
  903. {
  904. index: "4",
  905. span: 6,
  906. label: "fPurchase",
  907. name: "采购人",
  908. form: 1,
  909. width: 200,
  910. labelSize: "80",
  911. rules: { required: true, message: " ", trigger: "blur" },
  912. data: [],
  913. disabled: false,
  914. },
  915. {
  916. index: "5",
  917. span: 6,
  918. label: "fWarehouseid",
  919. name: "仓库",
  920. form: 1,
  921. width: 200,
  922. labelSize: "80",
  923. rules: { required: true, message: " ", trigger: "blur" },
  924. data: [],
  925. disabled: false,
  926. },
  927. {
  928. index: "6",
  929. span: 6,
  930. label: "fSbu",
  931. name: "开票公司",
  932. form: 1,
  933. width: 200,
  934. labelSize: "80",
  935. rules: { required: true, message: " ", trigger: "blur" },
  936. data: [],
  937. disabled: false,
  938. },
  939. {
  940. index: "7",
  941. span: 6,
  942. label: "fBsdate",
  943. name: "入库日期",
  944. form: 3,
  945. width: 200,
  946. labelSize: "80",
  947. rules: { required: true, message: " ", trigger: "blur" },
  948. disabled: false,
  949. },
  950. {
  951. index: "8",
  952. span: 6,
  953. label: "remark",
  954. name: "备注",
  955. form: 4,
  956. width: 200,
  957. labelSize: "80",
  958. rules: "",
  959. disabled: false,
  960. },
  961. ],
  962. //按钮
  963. customButton: [
  964. {
  965. type: "primary",
  966. size: "mini",
  967. icon: "el-icon-plus",
  968. name: "新单",
  969. disabled: false,
  970. hasPermi: ["anpin:stockControl:anPingApply"],
  971. },
  972. {
  973. type: "success",
  974. size: "mini",
  975. icon: "el-icon-edit",
  976. name: "修改",
  977. res: 0,
  978. disabled: true,
  979. hasPermi: ["anpin:stockControl:anPingApply"],
  980. },
  981. {
  982. type: "warning",
  983. size: "mini",
  984. icon: "el-icon-upload2",
  985. name: "导出",
  986. disabled: false,
  987. hasPermi: ["anpin:stockControl:export"],
  988. },
  989. {
  990. type: "info",
  991. size: "mini",
  992. icon: "el-icon-plus",
  993. name: "复制新增",
  994. disabled: true,
  995. hasPermi: ["anpin:stockControl:generateReceipts"],
  996. },
  997. ],
  998. seachButton: [
  999. {
  1000. type: "",
  1001. size: "mini",
  1002. icon: "el-icon-search",
  1003. name: "搜索",
  1004. disabled: false,
  1005. },
  1006. {
  1007. type: "",
  1008. size: "mini",
  1009. icon: "el-icon-refresh",
  1010. name: "重置",
  1011. disabled: false,
  1012. },
  1013. {
  1014. type: "",
  1015. size: "mini",
  1016. icon: "el-icon-arrow-up",
  1017. name: "展开",
  1018. disabled: false,
  1019. },
  1020. ],
  1021. detailButton: [
  1022. // {
  1023. // type:'danger',
  1024. // size:'mini',
  1025. // icon:'el-icon-refresh-left',
  1026. // name:'返回列表',
  1027. // disabled:false,
  1028. // },
  1029. {
  1030. type: "primary",
  1031. size: "mini",
  1032. icon: "el-icon-edit",
  1033. name: "录入明细",
  1034. disabled: false,
  1035. },
  1036. {
  1037. type: "success",
  1038. size: "mini",
  1039. icon: "el-icon-check",
  1040. name: "保存",
  1041. disabled: false,
  1042. },
  1043. {
  1044. type: "primary",
  1045. size: "mini",
  1046. icon: "el-icon-edit",
  1047. name: "新单",
  1048. nameTwo: "详情页",
  1049. plain: true,
  1050. disabled: false,
  1051. },
  1052. {
  1053. type: "primary",
  1054. size: "mini",
  1055. icon: "el-icon-edit",
  1056. name: "复制新单",
  1057. copyeRow: true,
  1058. plain: true,
  1059. disabled: false,
  1060. },
  1061. {
  1062. type: "info",
  1063. size: "mini",
  1064. icon: "el-icon-edit",
  1065. name: "修改",
  1066. disabled: false,
  1067. res: 1,
  1068. },
  1069. {
  1070. type: "info",
  1071. size: "mini",
  1072. icon: "el-icon-edit",
  1073. name: "打印",
  1074. disabled: false,
  1075. },
  1076. {
  1077. type: "info",
  1078. size: "mini",
  1079. icon: "el-icon-edit",
  1080. name: "入库确认",
  1081. disabled: false,
  1082. res: 1,
  1083. },
  1084. {
  1085. type: "warning",
  1086. size: "mini",
  1087. icon: "el-icon-refresh",
  1088. name: "刷新",
  1089. disabled: false,
  1090. // res: 1
  1091. },
  1092. {
  1093. type: "info",
  1094. size: "mini",
  1095. icon: "el-icon-edit-outline",
  1096. name: "生成出库单",
  1097. disabled: false,
  1098. },
  1099. {
  1100. type: "primary",
  1101. size: "mini",
  1102. icon: "el-icon-download",
  1103. name: "导出明细",
  1104. disabled: false,
  1105. },
  1106. ],
  1107. confirmButton: [
  1108. {
  1109. type: "cyan",
  1110. size: "mini",
  1111. icon: "",
  1112. name: "打印",
  1113. disabled: false,
  1114. },
  1115. {
  1116. type: "info",
  1117. size: "mini",
  1118. icon: "",
  1119. name: "入库确认",
  1120. disabled: false,
  1121. },
  1122. ],
  1123. };
  1124. },
  1125. activated() {
  1126. if (this.$route.query.open === "true") {
  1127. // this.detailList.columnList = this.detailStyle
  1128. this.detailForm = {};
  1129. this.detailData = [];
  1130. // this.inDex = this.detailOption.length
  1131. //从表修改按钮
  1132. let data = {
  1133. tableName: this.detailList.tableName,
  1134. userId: Cookies.get("userName"),
  1135. };
  1136. this.getRow(data, null, 1);
  1137. for (let li in this.detailList.columnList) {
  1138. if (!this.detailList.columnList[li].doNot) {
  1139. this.detailList.columnList[li].disabled = false;
  1140. }
  1141. }
  1142. for (let item in this.detailOption) {
  1143. if (!this.detailOption[item].doNot) {
  1144. this.detailOption[item].disabled = false;
  1145. }
  1146. }
  1147. for (let li in this.detailButton) {
  1148. this.detailButton[li].disabled = false;
  1149. }
  1150. this.MainTable = true;
  1151. this.$router.push({ query: {} });
  1152. }
  1153. },
  1154. created() {
  1155. let y = moment(Date.parse(new Date())).format("YYYY-MM-DD");
  1156. this.$set(this.queryParms, "timeInterval", [
  1157. y + " 00:00:00",
  1158. y + " 23:59:59",
  1159. ]);
  1160. //获取登陆人
  1161. queryUserVal().then((response) => {
  1162. this.lander = response.user.userName;
  1163. });
  1164. let data = {
  1165. tableName: this.queryList.tableName,
  1166. userId: Cookies.get("userName"),
  1167. };
  1168. this.getRow(data);
  1169. // let list = {
  1170. // fBilltype: 'RK',
  1171. // pageNum: 1,
  1172. // pageSize: 10
  1173. // }
  1174. // this.query(list)
  1175. this.getList();
  1176. this.selectMethods();
  1177. },
  1178. methods: {
  1179. //返回列表
  1180. goBack() {},
  1181. change(scope) {
  1182. for (let item in this.detailData) {
  1183. for (let li in this.listData.fFeeid) {
  1184. if (this.detailData[item].fFeeid == this.listData.fFeeid[li].value) {
  1185. this.$set(
  1186. this.detailData[item],
  1187. "fFeeunitid",
  1188. JSON.stringify(this.listData.fFeeid[li].fFeeunitid)
  1189. );
  1190. this.$set(
  1191. this.detailData[item],
  1192. "fCurrencyName",
  1193. this.listData.fFeeid[li].fCurrency
  1194. );
  1195. }
  1196. }
  1197. }
  1198. },
  1199. //确认打印
  1200. Printing() {
  1201. this.$print(this.$refs.print);
  1202. },
  1203. //查询主页列数据
  1204. query(data) {
  1205. listQuery(data).then((res) => {
  1206. this.tableData = res.rows;
  1207. });
  1208. },
  1209. //更换仓库
  1210. changeWarehouse(item) {
  1211. if (item.label == "fWarehouseid") {
  1212. if (this.detailData.length != 0) {
  1213. for (let li in this.detailData) {
  1214. this.detailData[li].fWarehouseid = "";
  1215. }
  1216. }
  1217. getArea(this.detailForm.fWarehouseid).then((res) => {
  1218. this.listData.fWarehouseid = [];
  1219. for (let item in res.data) {
  1220. this.listData.fWarehouseid.push({
  1221. label: res.data[item].fWarehouseInformation,
  1222. value: res.data[item].id,
  1223. });
  1224. }
  1225. });
  1226. }
  1227. },
  1228. //自动合计金额
  1229. totalAmount(scope, item) {
  1230. if (item.label === "fAmount") {
  1231. if (scope.row.fAmount && scope.row.fQty) {
  1232. this.$set(
  1233. scope.row,
  1234. "fUnitprice",
  1235. (scope.row.fAmount / scope.row.fQty).toFixed(2)
  1236. );
  1237. }
  1238. }
  1239. if (item.label === "fUnitprice" || item.label === "fQty") {
  1240. if (scope.row.fUnitprice && scope.row.fQty) {
  1241. this.$set(
  1242. scope.row,
  1243. "fAmount",
  1244. (scope.row.fUnitprice * scope.row.fQty).toFixed(2)
  1245. );
  1246. }
  1247. }
  1248. },
  1249. //搜索、重置、展开
  1250. feedback(res) {
  1251. if (res == "展开") {
  1252. if (this.inDex == 4) {
  1253. this.inDex = this.formOption.length;
  1254. } else {
  1255. this.inDex = 4;
  1256. }
  1257. } else if (res == "搜索") {
  1258. this.handleQuery();
  1259. } else if (res == "重置") {
  1260. this.resetQuery();
  1261. }
  1262. },
  1263. selectMethods() {
  1264. this.mainMethods();
  1265. this.detailMethods();
  1266. },
  1267. //主页面下拉获取名称
  1268. mainMethods() {
  1269. for (let li in this.formOption) {
  1270. if (this.formOption[li].name == "仓库") {
  1271. let queryParams = { pageNum: 1 };
  1272. getwarehouse(queryParams).then((res) => {
  1273. for (let item in res.rows) {
  1274. this.formOption[li].data.push({
  1275. label: res.rows[item].fName,
  1276. value: res.rows[item].fId,
  1277. });
  1278. }
  1279. });
  1280. }
  1281. if (this.formOption[li].name == "项目名称") {
  1282. getEntry().then((res) => {
  1283. for (let item in res.data) {
  1284. this.formOption[li].data.push({
  1285. label: res.data[item].projectName,
  1286. value: res.data[item].fId,
  1287. });
  1288. }
  1289. });
  1290. }
  1291. if (this.formOption[li].name == "供应商") {
  1292. let queryParams = { pageNum: 1, fTypeid: 1 };
  1293. getustomer(queryParams).then((res) => {
  1294. for (let item in res.data) {
  1295. this.formOption[li].data.push({
  1296. label: res.data[item].fName,
  1297. value: res.data[item].fId,
  1298. });
  1299. }
  1300. });
  1301. }
  1302. if (this.formOption[li].name == "品名") {
  1303. getGoodName().then((res) => {
  1304. console.log(res);
  1305. for (let item in res.rows) {
  1306. this.formOption[li].data.push({
  1307. label: res.rows[item].fName,
  1308. value: res.rows[item].fId,
  1309. });
  1310. }
  1311. });
  1312. }
  1313. }
  1314. },
  1315. //弹窗页获取下拉名称
  1316. detailMethods() {
  1317. for (let li in this.detailOption) {
  1318. if (this.detailOption[li].name == "仓库") {
  1319. //获取仓库
  1320. let queryParams = { pageNum: 1 };
  1321. getwarehouse(queryParams).then((res) => {
  1322. for (let item in res.rows) {
  1323. this.detailOption[li].data.push({
  1324. label: res.rows[item].fName,
  1325. value: res.rows[item].fId,
  1326. });
  1327. }
  1328. });
  1329. }
  1330. if (this.detailOption[li].name == "供应商") {
  1331. //获取供应商
  1332. let queryParams = { pageNum: 1, fTypeid: 1 };
  1333. getustomer(queryParams).then((res) => {
  1334. for (let item in res.data) {
  1335. this.detailOption[li].data.push({
  1336. label: res.data[item].fName,
  1337. value: res.data[item].fId,
  1338. });
  1339. }
  1340. });
  1341. }
  1342. if (this.detailOption[li].name == "开票公司") {
  1343. //获取付款单位
  1344. let queryParams = { pageNum: 1, fTypeid: 2 };
  1345. getustomer(queryParams).then((res) => {
  1346. for (let item in res.data) {
  1347. this.detailOption[li].data.push({
  1348. label: res.data[item].fName,
  1349. value: res.data[item].fId,
  1350. });
  1351. }
  1352. });
  1353. }
  1354. if (this.detailOption[li].name == "库管员") {
  1355. let queryParams = { pageNum: 1, roleName: "库管" };
  1356. getWarehousekeeper(queryParams).then((res) => {
  1357. for (let item in res.rows) {
  1358. this.detailOption[li].data.push({
  1359. label: res.rows[item].userName,
  1360. value: res.rows[item].userId,
  1361. });
  1362. }
  1363. });
  1364. }
  1365. if (this.detailOption[li].name == "采购人") {
  1366. getliable().then((res) => {
  1367. for (let item in res.rows) {
  1368. this.detailOption[li].data.push({
  1369. label: res.rows[item].userName,
  1370. value: res.rows[item].userId,
  1371. });
  1372. }
  1373. });
  1374. }
  1375. }
  1376. //获取计量单位字典表
  1377. this.getDicts("data_unitfees").then((response) => {
  1378. if (response.data) {
  1379. for (let item in response.data) {
  1380. this.listData.fFeeunitid.push({
  1381. label: response.data[item].dictLabel,
  1382. value: response.data[item].dictValue,
  1383. });
  1384. }
  1385. }
  1386. });
  1387. //获取浮点单位字典表
  1388. this.getDicts("f_floatunit").then((response) => {
  1389. if (response.data) {
  1390. for (let item in response.data) {
  1391. this.listData.fUnits.push({
  1392. label: response.data[item].dictLabel,
  1393. value: JSON.parse(response.data[item].dictValue),
  1394. });
  1395. }
  1396. }
  1397. });
  1398. //获取存储环境字典表
  1399. this.getDicts("f_StorageEnvironment").then((response) => {
  1400. if (response.data) {
  1401. for (let item in response.data) {
  1402. this.listData.fStoreEnv.push({
  1403. label: response.data[item].dictLabel,
  1404. value: JSON.parse(response.data[item].dictValue),
  1405. });
  1406. }
  1407. }
  1408. });
  1409. this.getDicts("f_evidence").then((response) => {
  1410. if (response.data) {
  1411. for (let item in response.data) {
  1412. this.listData.fIsfilles.push({
  1413. label: response.data[item].dictLabel,
  1414. value: JSON.parse(response.data[item].dictValue),
  1415. });
  1416. }
  1417. }
  1418. });
  1419. //获取品名
  1420. let queryParams = { pageNum: 1 };
  1421. getGoodName(queryParams).then((res) => {
  1422. for (let item in res.rows) {
  1423. this.listData.fFeeid.push({
  1424. label: res.rows[item].fName,
  1425. value: res.rows[item].fId,
  1426. fFeeunitid: res.rows[item].fFeeunitid,
  1427. fCurrency: res.rows[item].fCurrency,
  1428. });
  1429. }
  1430. });
  1431. //付费方式
  1432. this.getDicts("f_paymode").then((response) => {
  1433. if (response.data) {
  1434. for (let item in response.data) {
  1435. this.listData.fStltypeid.push({
  1436. label: response.data[item].dictLabel,
  1437. value: response.data[item].dictValue,
  1438. });
  1439. }
  1440. }
  1441. });
  1442. },
  1443. handleQuery() {
  1444. this.$refs.MainForm.hide();
  1445. console.log(this.queryParms);
  1446. this.getList();
  1447. },
  1448. resetQuery() {
  1449. this.queryParms = {
  1450. pageNum: 1,
  1451. pageSize: this.queryParms.pageSize,
  1452. };
  1453. this.getList();
  1454. },
  1455. //查询列数据
  1456. getRow(data, list, iem) {
  1457. select(data).then((res) => {
  1458. if (data.tableName === "仓库入库详情") {
  1459. if (res.data.length != 0) {
  1460. this.detailList.columnList = res.data.filter((e) => e.checked == 0);
  1461. this.detailList.columnList = res.data;
  1462. this.setRowList = res.data;
  1463. this.detailList.columnList = this.detailList.columnList.filter(
  1464. (e) => e.checked == 0
  1465. );
  1466. // this.waitFor = true
  1467. } else {
  1468. // this.waitFor = true
  1469. this.$set(
  1470. this.detailList,
  1471. "columnList",
  1472. this.$options.data().detailStyle
  1473. );
  1474. this.setRowList = this.$options.data().detailStyle;
  1475. }
  1476. this.isItHidden = false;
  1477. this.inDex = this.detailOption.length;
  1478. if (iem === undefined) {
  1479. this.detailList.columnList.forEach(
  1480. (item) => (item.disabled = false)
  1481. );
  1482. this.detailButton.forEach((item) => (item.disabled = false));
  1483. }
  1484. } else {
  1485. if (res.data.length != 0) {
  1486. this.queryList.columnList = res.data.filter((e) => e.checked == 0);
  1487. this.queryList.columnList = res.data;
  1488. this.setRowList = res.data;
  1489. this.queryList.columnList = this.queryList.columnList.filter(
  1490. (e) => e.checked == 0
  1491. );
  1492. this.waitFor = true;
  1493. } else {
  1494. this.waitFor = true;
  1495. this.$set(
  1496. this.queryList,
  1497. "columnList",
  1498. this.$options.data().listStyle
  1499. );
  1500. this.setRowList = this.$options.data().listStyle;
  1501. }
  1502. this.isItHidden = true;
  1503. // this.inDex = 4
  1504. }
  1505. if (list) {
  1506. this.detailForm = list.warehouseBills;
  1507. this.detailData = list.tWarehousebillsfees;
  1508. this.$set(
  1509. this.detailForm,
  1510. "fStorekeeper",
  1511. JSON.parse(this.detailForm.fStorekeeper)
  1512. );
  1513. for (let li in this.detailData) {
  1514. this.$set(
  1515. this.detailData[li],
  1516. "fFeeunitid",
  1517. JSON.stringify(this.detailData[li].fFeeunitid)
  1518. );
  1519. this.$set(
  1520. this.detailData[li],
  1521. "fStltypeid",
  1522. JSON.stringify(this.detailData[li].fStltypeid)
  1523. );
  1524. }
  1525. this.detailButton = this.$options.data().detailButton;
  1526. if (
  1527. this.lander == this.detailForm.createBy &&
  1528. this.detailForm.fBillstatus == 6
  1529. ) {
  1530. // console.log(this.detailForm.createBy)
  1531. this.detailButton.push({
  1532. type: "danger",
  1533. size: "mini",
  1534. icon: "el-icon-edit-outline",
  1535. name: "撤销入库",
  1536. disabled: false,
  1537. });
  1538. }
  1539. if (iem === undefined) {
  1540. this.detailButton.forEach((item) => (item.disabled = false));
  1541. this.detailForm.fId = "";
  1542. this.detailForm.fBillno = "";
  1543. this.detailForm.fCreateLog = "";
  1544. this.detailForm.fPrintLog = "";
  1545. this.detailForm.fReviewDate = "";
  1546. this.detailForm.fBillstatus = 2;
  1547. this.detailForm.fPrint = 0;
  1548. this.detailList.columnList.forEach((item) => (item.fId = ""));
  1549. this.detailButton = this.$options.data().detailButton;
  1550. } else if (iem == 1) {
  1551. if (this.detailForm.fBillstatus >= "4") {
  1552. for (let li in this.detailButton) {
  1553. if (
  1554. this.detailButton[li].name == "录入明细" ||
  1555. this.detailButton[li].name == "保存" ||
  1556. this.detailButton[li].name == "入库确认" ||
  1557. this.detailButton[li].name == "刷新" ||
  1558. this.detailButton[li].name == "修改"
  1559. ) {
  1560. this.detailButton[li].disabled = true;
  1561. }
  1562. }
  1563. this.detailList.columnList.forEach(
  1564. (item) => (item.disabled = true)
  1565. );
  1566. } else {
  1567. for (let li in this.detailButton) {
  1568. if (
  1569. this.detailButton[li].name == "录入明细" ||
  1570. this.detailButton[li].name == "保存" ||
  1571. this.detailButton[li].name == "入库确认"
  1572. ) {
  1573. this.detailButton[li].disabled = true;
  1574. }
  1575. }
  1576. this.detailList.columnList.forEach(
  1577. (item) => (item.disabled = true)
  1578. );
  1579. }
  1580. }
  1581. }
  1582. });
  1583. },
  1584. //选择框
  1585. selectionbox(selection) {
  1586. this.selection = selection;
  1587. this.ids = selection.map((item) => item.fId);
  1588. this.single = selection.length !== 1;
  1589. for (let li in this.customButton) {
  1590. if (
  1591. this.customButton[li].name == "修改" ||
  1592. this.customButton[li].name == "复制新增"
  1593. ) {
  1594. this.customButton[li].disabled = this.single;
  1595. }
  1596. }
  1597. },
  1598. //查看
  1599. viewMethod(scope, res, iem) {
  1600. // this.detailList.columnList = this.detailStyle
  1601. let fId = "";
  1602. if (scope) {
  1603. fId = scope.row.fId;
  1604. for (let item in this.detailOption) {
  1605. this.detailOption[item].disabled = true;
  1606. }
  1607. getSave(fId).then((res) => {
  1608. if (res.code == 200) {
  1609. let data = {
  1610. tableName: this.detailList.tableName,
  1611. userId: Cookies.get("userName"),
  1612. };
  1613. let list = {
  1614. warehouseBills: res.data.warehouseBills,
  1615. tWarehousebillsfees: res.data.tWarehousebillsfees,
  1616. };
  1617. this.getRow(data, list, 1);
  1618. }
  1619. if (res.data.warehouseBills) {
  1620. getArea(res.data.warehouseBills.fWarehouseid).then((res) => {
  1621. if (res.code == 200) {
  1622. this.listData.fWarehouseid = [];
  1623. for (let item in res.data) {
  1624. this.listData.fWarehouseid.push({
  1625. label: res.data[item].fWarehouseInformation,
  1626. value: res.data[item].id,
  1627. });
  1628. }
  1629. }
  1630. });
  1631. }
  1632. // if(){
  1633. // let data = {
  1634. // fId: this.$refs.avatar.form.fId
  1635. // }
  1636. // revokeBill(data).then(res => {
  1637. // if (res.code == 200) {
  1638. // this.$message.success('撤销成功')
  1639. // this.getList()
  1640. // this.pageDisplay = true
  1641. // }
  1642. // })
  1643. // }
  1644. this.MainTable = true;
  1645. this.inDex = this.detailOption.length;
  1646. });
  1647. } else if (res) {
  1648. console.log(res);
  1649. fId = res;
  1650. this.detailButton.forEach((item) => (item.disabled = false));
  1651. this.detailList.columnList.forEach((item) => {
  1652. if (!item.doNot) {
  1653. item.disabled = false;
  1654. }
  1655. });
  1656. this.detailOption.forEach((item) => {
  1657. if (!item.doNot) {
  1658. item.disabled = false;
  1659. }
  1660. });
  1661. getSave(fId).then((res) => {
  1662. if (res.code == 200) {
  1663. let data = {
  1664. tableName: this.detailList.tableName,
  1665. userId: Cookies.get("userName"),
  1666. };
  1667. let list = {
  1668. warehouseBills: res.data.warehouseBills,
  1669. tWarehousebillsfees: res.data.tWarehousebillsfees,
  1670. };
  1671. this.getRow(data, list, iem);
  1672. }
  1673. if (res.data.warehouseBills) {
  1674. getArea(res.data.warehouseBills.fWarehouseid).then((res) => {
  1675. if (res.code == 200) {
  1676. this.listData.fWarehouseid = [];
  1677. for (let item in res.data) {
  1678. this.listData.fWarehouseid.push({
  1679. label: res.data[item].fWarehouseInformation,
  1680. value: res.data[item].id,
  1681. });
  1682. }
  1683. }
  1684. });
  1685. }
  1686. // if(){
  1687. // let data = {
  1688. // fId: this.$refs.avatar.form.fId
  1689. // }
  1690. // revokeBill(data).then(res => {
  1691. // if (res.code == 200) {
  1692. // this.$message.success('撤销成功')
  1693. // this.getList()
  1694. // this.pageDisplay = true
  1695. // }
  1696. // })
  1697. // }
  1698. this.MainTable = true;
  1699. this.inDex = this.detailOption.length;
  1700. });
  1701. } else {
  1702. fId = this.ids;
  1703. getSave(fId).then((res) => {
  1704. if (res.code == 200) {
  1705. let data = {
  1706. tableName: this.detailList.tableName,
  1707. userId: Cookies.get("userName"),
  1708. };
  1709. let list = {
  1710. warehouseBills: res.data.warehouseBills,
  1711. tWarehousebillsfees: res.data.tWarehousebillsfees,
  1712. };
  1713. this.getRow(data, list, 1);
  1714. }
  1715. if (res.data.warehouseBills) {
  1716. getArea(res.data.warehouseBills.fWarehouseid).then((res) => {
  1717. if (res.code == 200) {
  1718. this.listData.fWarehouseid = [];
  1719. for (let item in res.data) {
  1720. this.listData.fWarehouseid.push({
  1721. label: res.data[item].fWarehouseInformation,
  1722. value: res.data[item].id,
  1723. });
  1724. }
  1725. }
  1726. });
  1727. }
  1728. // if(){
  1729. // let data = {
  1730. // fId: this.$refs.avatar.form.fId
  1731. // }
  1732. // revokeBill(data).then(res => {
  1733. // if (res.code == 200) {
  1734. // this.$message.success('撤销成功')
  1735. // this.getList()
  1736. // this.pageDisplay = true
  1737. // }
  1738. // })
  1739. // }
  1740. this.MainTable = true;
  1741. this.inDex = this.detailOption.length;
  1742. });
  1743. }
  1744. },
  1745. //修改
  1746. modification(scope) {},
  1747. //删除
  1748. deletion(scope) {
  1749. const fIds = scope.row.fId || this.ids;
  1750. let tips = "";
  1751. deletMain(fIds).then((res) => {
  1752. switch (res.msg) {
  1753. case "0": {
  1754. this.$message.error("当前数据已被其他操作员操作,请刷新页面");
  1755. break;
  1756. }
  1757. case "1": {
  1758. tips = "当前主表有数据,确认是否删除?";
  1759. this.delete_s(fIds, tips);
  1760. break;
  1761. }
  1762. case "2": {
  1763. tips = "当前主表有数据,从表有数据,确认是否删除?";
  1764. this.delete_s(fIds, tips);
  1765. break;
  1766. }
  1767. default: {
  1768. return this.$message.error("未知错误,无状态");
  1769. }
  1770. }
  1771. });
  1772. },
  1773. delete_s(fIds, tips) {
  1774. this.$confirm(tips, "警告", {
  1775. confirmButtonText: "确定",
  1776. cancelButtonText: "取消",
  1777. type: "warning",
  1778. })
  1779. .then(function () {
  1780. return delFee(fIds);
  1781. })
  1782. .then(() => {
  1783. this.getList();
  1784. this.msgSuccess("删除成功");
  1785. });
  1786. },
  1787. //删除从表行
  1788. deletRows(index, rows) {
  1789. if (rows[index].fId) {
  1790. let formData = {
  1791. fId: this.detailForm.fId,
  1792. fDateChanged: this.detailForm.fDateChanged,
  1793. };
  1794. canBedelet(formData)
  1795. .then((res) => {
  1796. return delRows(rows[index].fId);
  1797. })
  1798. .then(() => {
  1799. getSave(this.detailForm.fId).then((res) => {
  1800. if (res.code == 200) {
  1801. if (res.data.warehouseBills) {
  1802. this.detailForm = res.data.warehouseBills;
  1803. this.$set(
  1804. this.detailForm,
  1805. "fStorekeeper",
  1806. JSON.parse(this.detailForm.fStorekeeper)
  1807. );
  1808. }
  1809. if (res.data.tWarehousebillsfees) {
  1810. this.detailData = res.data.tWarehousebillsfees;
  1811. for (let li in this.detailData) {
  1812. this.$set(
  1813. this.detailData[li],
  1814. "fFeeunitid",
  1815. JSON.stringify(this.detailData[li].fFeeunitid)
  1816. );
  1817. this.$set(
  1818. this.detailData[li],
  1819. "fStltypeid",
  1820. JSON.stringify(this.detailData[li].fStltypeid)
  1821. );
  1822. }
  1823. }
  1824. this.msgSuccess("删除成功");
  1825. }
  1826. });
  1827. })
  1828. .catch((res) => {
  1829. this.$message.error(res);
  1830. });
  1831. } else {
  1832. rows.splice(index, 1);
  1833. }
  1834. },
  1835. //必填项新行
  1836. verificationRules(valid) {
  1837. if (valid) {
  1838. this.detailData.push({
  1839. serialNumber: null,
  1840. fFeeid: null,
  1841. fUnitprice: null,
  1842. fQty: null,
  1843. fFeeunitid: null,
  1844. fWarehouseid: null,
  1845. fAmount: null,
  1846. fStltypeid: "1",
  1847. tProductdate: null,
  1848. fLotno: null,
  1849. fValid: null,
  1850. fUnits: null,
  1851. fStoreEnv: null,
  1852. fIsfilles: 0,
  1853. remark: null,
  1854. fReviewDate: null,
  1855. createBy: null,
  1856. });
  1857. }
  1858. },
  1859. //返回列表是否保存
  1860. backRules() {
  1861. let data;
  1862. for (let li in this.detailOption) {
  1863. if (this.detailOption[li].name == "供应商") {
  1864. if (this.detailOption[li].disabled == true) {
  1865. data = {
  1866. tableName: this.queryList.tableName,
  1867. userId: Cookies.get("userName"),
  1868. };
  1869. this.inDex = 4;
  1870. this.getList();
  1871. this.getRow(data);
  1872. this.isItHidden = true;
  1873. this.MainTable = false;
  1874. } else {
  1875. this.$confirm("返回列表,是否保存?", "提示", {
  1876. confirmButtonText: "保存",
  1877. cancelButtonText: "取消",
  1878. type: "warning",
  1879. })
  1880. .then(() => {
  1881. this.$refs.detailForm.saveRules("1");
  1882. })
  1883. .catch(() => {
  1884. data = {
  1885. tableName: this.queryList.tableName,
  1886. userId: Cookies.get("userName"),
  1887. };
  1888. this.inDex = 4;
  1889. this.isItHidden = true;
  1890. this.MainTable = false;
  1891. this.getList();
  1892. this.getRow(data);
  1893. });
  1894. }
  1895. }
  1896. }
  1897. },
  1898. backSave(valid, i) {
  1899. if (valid) {
  1900. if (this.detailForm.fBillstatus < 4 || !this.detailForm.fBillstatus) {
  1901. this.detailForm.fMoney = 0;
  1902. for (let li in this.detailData) {
  1903. if (this.detailData[li]) {
  1904. this.detailForm.fMoney += Number(this.detailData[li].fAmount);
  1905. }
  1906. }
  1907. let formData = new window.FormData();
  1908. formData.append("tWarehousebills", JSON.stringify(this.detailForm));
  1909. formData.append(
  1910. "tWarehousebillsfees",
  1911. JSON.stringify(this.detailData)
  1912. );
  1913. formData.append("fBilltype", "RK");
  1914. addSave(formData).then((res) => {
  1915. if (res.code == 200) {
  1916. this.detailForm = res.data.warehouseBills;
  1917. this.$set(
  1918. this.detailForm,
  1919. "fStorekeeper",
  1920. JSON.parse(this.detailForm.fStorekeeper)
  1921. );
  1922. this.detailData = res.data.tWarehousebillsCntrs;
  1923. for (let li in this.detailData) {
  1924. this.$set(
  1925. this.detailData[li],
  1926. "fFeeunitid",
  1927. JSON.stringify(this.detailData[li].fFeeunitid)
  1928. );
  1929. this.$set(
  1930. this.detailData[li],
  1931. "fStltypeid",
  1932. JSON.stringify(this.detailData[li].fStltypeid)
  1933. );
  1934. }
  1935. this.getList();
  1936. if (i == 2) {
  1937. // let data ={
  1938. // fBilltype:'RK',
  1939. // fId:this.detailForm.fId
  1940. // }
  1941. // copyNew(data).then(res=>{
  1942. // if(res.code == 200) {
  1943. // this.$message.success("操作成功")
  1944. // this.copyeId = res.data
  1945. // this.getList()
  1946. // this.viewMethod(null,1,2)
  1947. // }
  1948. // })
  1949. } else {
  1950. this.$message.success("保存成功");
  1951. let data = {
  1952. tableName: this.queryList.tableName,
  1953. userId: Cookies.get("userName"),
  1954. };
  1955. this.getRow(data);
  1956. }
  1957. }
  1958. });
  1959. } else if (i == 2 && this.detailForm.fBillstatus > 3) {
  1960. // let data = {
  1961. // fBilltype:'RK',
  1962. // fId:this.detailForm.fId
  1963. // }
  1964. // copyNew(data).then(res=>{
  1965. // if(res.code == 200) {
  1966. // this.$message.success("操作成功")
  1967. // this.copyeId = res.data
  1968. // this.getList()
  1969. // this.viewMethod(null,1,2)
  1970. this.detailForm.fId = "";
  1971. this.detailForm.fBillno = "";
  1972. this.detailForm.fCreateLog = "";
  1973. this.detailForm.fPrintLog = "";
  1974. this.detailForm.fReviewDate = "";
  1975. this.detailForm.fBillstatus = 2;
  1976. this.detailForm.fPrint = 0;
  1977. this.detailList.columnList.forEach((item) => (item.fId = ""));
  1978. // }
  1979. // })
  1980. }
  1981. if (i == 1) {
  1982. this.isItHidden = true;
  1983. this.MainTable = false;
  1984. this.inDex = 4;
  1985. }
  1986. }
  1987. },
  1988. //所以按钮
  1989. buttonList(row) {
  1990. switch (row.name) {
  1991. case "新单":
  1992. if (row.nameTwo == "详情页") {
  1993. if (this.detailForm.fId) {
  1994. this.detailList.columnList = this.detailStyle;
  1995. this.detailForm = {};
  1996. this.detailData = [];
  1997. this.inDex = this.detailOption.length;
  1998. //从表修改按钮
  1999. for (let li in this.detailStyle) {
  2000. if (!this.detailStyle[li].doNot) {
  2001. this.detailStyle[li].disabled = false;
  2002. }
  2003. }
  2004. for (let item in this.detailOption) {
  2005. if (!this.detailOption[item].doNot) {
  2006. this.detailOption[item].disabled = false;
  2007. }
  2008. }
  2009. for (let li in this.detailButton) {
  2010. this.detailButton[li].disabled = false;
  2011. }
  2012. this.MainTable = true;
  2013. } else {
  2014. this.$message.error("当前数据为保存,请保存");
  2015. }
  2016. } else {
  2017. this.detailList.columnList = this.detailStyle;
  2018. this.detailForm = {};
  2019. this.detailData = [];
  2020. this.inDex = this.detailOption.length;
  2021. //从表修改按钮
  2022. for (let li in this.detailStyle) {
  2023. if (!this.detailStyle[li].doNot) {
  2024. this.detailStyle[li].disabled = false;
  2025. }
  2026. }
  2027. for (let item in this.detailOption) {
  2028. if (!this.detailOption[item].doNot) {
  2029. this.detailOption[item].disabled = false;
  2030. }
  2031. }
  2032. for (let li in this.detailButton) {
  2033. this.detailButton[li].disabled = false;
  2034. }
  2035. this.MainTable = true;
  2036. }
  2037. break;
  2038. case "录入明细":
  2039. this.$refs.detailForm.rules();
  2040. break;
  2041. case "返回列表":
  2042. this.backRules();
  2043. break;
  2044. case "保存":
  2045. this.$refs.detailForm.saveRules();
  2046. break;
  2047. case "入库确认":
  2048. if (this.detailData.length == 0) {
  2049. this.$message.error("请维护明细");
  2050. } else {
  2051. for (let item in this.detailData) {
  2052. let num = Number(item) + 1;
  2053. if (!this.detailData[item].fFeeid) {
  2054. this.$message.error("请维护第" + num + "行品名");
  2055. return false;
  2056. }
  2057. if (!this.detailData[item].fCurrencyName) {
  2058. this.$message.error("请维护第" + num + "行规格");
  2059. return false;
  2060. }
  2061. if (!this.detailData[item].fUnitprice) {
  2062. this.$message.error("请维护第" + num + "行单价");
  2063. return false;
  2064. }
  2065. if (!this.detailData[item].fQty) {
  2066. this.$message.error("请维护第" + num + "数量");
  2067. return false;
  2068. }
  2069. if (!this.detailData[item].fFeeunitid) {
  2070. this.$message.error("请维护第" + num + "行计量单位");
  2071. return false;
  2072. }
  2073. if (!this.detailData[item].fWarehouseid) {
  2074. this.$message.error("请维护第" + num + "行库区");
  2075. return false;
  2076. }
  2077. if (!this.detailData[item].fAmount) {
  2078. this.$message.error("请维护第" + num + "行金额");
  2079. return false;
  2080. }
  2081. }
  2082. this.detailForm.fMoney = 0;
  2083. for (let li in this.detailData) {
  2084. if (this.detailData[li]) {
  2085. this.detailForm.fMoney += Number(this.detailData[li].fAmount);
  2086. }
  2087. }
  2088. let formData = new window.FormData();
  2089. formData.append("tWarehousebills", JSON.stringify(this.detailForm));
  2090. formData.append(
  2091. "tWarehousebillsfees",
  2092. JSON.stringify(this.detailData)
  2093. );
  2094. formData.append("fBilltype", "RK");
  2095. addWarehous(formData).then((res) => {
  2096. if (res.data.warehouseBills) {
  2097. this.detailForm = res.data.warehouseBills;
  2098. this.$set(
  2099. this.detailForm,
  2100. "fStorekeeper",
  2101. JSON.parse(this.detailForm.fStorekeeper)
  2102. );
  2103. }
  2104. if (res.data.tWarehousebillsCntrs) {
  2105. this.detailData = res.data.tWarehousebillsCntrs;
  2106. for (let li in this.detailData) {
  2107. this.$set(
  2108. this.detailData[li],
  2109. "fFeeunitid",
  2110. JSON.stringify(this.detailData[li].fFeeunitid)
  2111. );
  2112. this.$set(
  2113. this.detailData[li],
  2114. "fStltypeid",
  2115. JSON.stringify(this.detailData[li].fStltypeid)
  2116. );
  2117. }
  2118. }
  2119. this.$message.success("操作成功");
  2120. for (let li in this.detailList.columnList) {
  2121. this.detailList.columnList[li].disabled = true;
  2122. }
  2123. for (let item in this.detailOption) {
  2124. this.detailOption[item].disabled = true;
  2125. }
  2126. for (let li in this.detailButton) {
  2127. if (
  2128. this.detailButton[li].name == "录入明细" ||
  2129. this.detailButton[li].name == "保存" ||
  2130. this.detailButton[li].name == "入库确认" ||
  2131. this.detailButton[li].name == "刷新" ||
  2132. this.detailButton[li].name == "修改"
  2133. ) {
  2134. this.detailButton[li].disabled = true;
  2135. } else {
  2136. this.detailButton[li].disabled = false;
  2137. }
  2138. }
  2139. this.detailButton = this.$options.data().detailButton;
  2140. if (
  2141. this.lander == this.detailForm.createBy &&
  2142. this.detailForm.fBillstatus == 6
  2143. ) {
  2144. console.log(this.detailForm.createBy);
  2145. this.detailButton.push({
  2146. type: "danger",
  2147. size: "mini",
  2148. icon: "el-icon-edit-outline",
  2149. name: "撤销入库",
  2150. disabled: false,
  2151. });
  2152. this.detailButton.forEach((item) => {
  2153. if (
  2154. item.name === "录入明细" ||
  2155. item.name === "保存" ||
  2156. item.name === "修改" ||
  2157. item.name === "刷新" ||
  2158. item.name === "入库确认"
  2159. ) {
  2160. item.disabled = true;
  2161. }
  2162. });
  2163. }
  2164. });
  2165. }
  2166. break;
  2167. case "刷新":
  2168. if (this.detailForm.fId) {
  2169. getSave(this.detailForm.fId).then((res) => {
  2170. if (res.code == 200) {
  2171. let list = {
  2172. warehouseBills: res.data.warehouseBills,
  2173. tWarehousebillsfees: res.data.tWarehousebillsfees,
  2174. };
  2175. this.detailForm = list.warehouseBills;
  2176. this.detailData = list.tWarehousebillsfees;
  2177. this.$set(
  2178. this.detailForm,
  2179. "fStorekeeper",
  2180. JSON.parse(this.detailForm.fStorekeeper)
  2181. );
  2182. if (res.data.tWarehousebillsfees) {
  2183. this.detailData = res.data.tWarehousebillsfees;
  2184. for (let li in this.detailData) {
  2185. this.$set(
  2186. this.detailData[li],
  2187. "fFeeunitid",
  2188. JSON.stringify(this.detailData[li].fFeeunitid)
  2189. );
  2190. this.$set(
  2191. this.detailData[li],
  2192. "fStltypeid",
  2193. JSON.stringify(this.detailData[li].fStltypeid)
  2194. );
  2195. }
  2196. }
  2197. this.$message.success("刷新成功");
  2198. }
  2199. });
  2200. }
  2201. break;
  2202. case "生成出库单":
  2203. let listd = {
  2204. fId: this.detailForm.fId,
  2205. fBilltype: "CK",
  2206. };
  2207. copyNew(listd).then((res) => {
  2208. this.$message({
  2209. message: "生成成功",
  2210. type: "success",
  2211. showClose: true,
  2212. });
  2213. });
  2214. break;
  2215. case "撤销入库":
  2216. let data = {
  2217. fId: this.detailForm.fId,
  2218. fBilltype: "RK",
  2219. };
  2220. revokeBill(data).then((res) => {
  2221. if (res.code == 200) {
  2222. this.$message.success("撤销成功");
  2223. this.getList();
  2224. this.isItHidden = true;
  2225. this.MainTable = false;
  2226. }
  2227. });
  2228. break;
  2229. case "复制新增":
  2230. let fId = this.selection[0].fId;
  2231. // copyNew(formDate).then(res=>{
  2232. // if(res.code == 200) {
  2233. // this.$message.success("操作成功")
  2234. // this.copyeId = res.data
  2235. // this.getList()
  2236. this.viewMethod(null, fId);
  2237. // }
  2238. // })
  2239. break;
  2240. case "复制新单":
  2241. // this.$refs.detailForm.saveRules('2')
  2242. if (this.detailForm.fId) {
  2243. this.detailForm.fId = "";
  2244. this.detailForm.fBillno = "";
  2245. this.detailForm.fCreateLog = "";
  2246. this.detailForm.fPrintLog = "";
  2247. this.detailForm.fReviewDate = "";
  2248. this.detailForm.fBillstatus = 2;
  2249. this.detailForm.fPrint = 0;
  2250. this.detailList.columnList.forEach((item) => (item.fId = ""));
  2251. this.detailList.columnList.forEach(
  2252. (item) => (item.disabled = false)
  2253. );
  2254. this.detailButton = this.$options.data().detailButton;
  2255. for (let item in this.detailOption) {
  2256. if (!this.detailOption[item].doNot) {
  2257. this.detailOption[item].disabled = false;
  2258. }
  2259. }
  2260. for (let li in this.detailButton) {
  2261. this.detailButton[li].disabled = false;
  2262. }
  2263. this.$message.success("新增成功");
  2264. } else {
  2265. this.$message.error("数据未保存,请先保存");
  2266. }
  2267. break;
  2268. case "导出明细":
  2269. if (!this.detailForm.fId) {
  2270. this.$message.error("数据未保存,请先保存");
  2271. } else {
  2272. let id = this.detailForm.fId;
  2273. this.$confirm("是否确认导出入库明细?", "警告", {
  2274. confirmButtonText: "确定",
  2275. cancelButtonText: "取消",
  2276. type: "warning",
  2277. })
  2278. .then(function () {
  2279. return exportInstock({ fPid: id });
  2280. })
  2281. .then((response) => {
  2282. this.download(response.msg);
  2283. });
  2284. }
  2285. break;
  2286. case "打印":
  2287. let formData = new window.FormData();
  2288. formData.append("tWarehousebills", JSON.stringify(this.detailForm));
  2289. formData.append(
  2290. "tWarehousebillsfees",
  2291. JSON.stringify(this.detailData)
  2292. );
  2293. formData.append("fBilltype", "RK");
  2294. addSave(formData).then((res) => {
  2295. if (res.code == 200) {
  2296. this.detailForm = res.data.warehouseBills;
  2297. this.$set(
  2298. this.detailForm,
  2299. "fStorekeeper",
  2300. JSON.parse(this.detailForm.fStorekeeper)
  2301. );
  2302. this.detailData = res.data.tWarehousebillsCntrs;
  2303. for (let li in this.detailData) {
  2304. this.$set(
  2305. this.detailData[li],
  2306. "fFeeunitid",
  2307. JSON.stringify(this.detailData[li].fFeeunitid)
  2308. );
  2309. this.$set(
  2310. this.detailData[li],
  2311. "fStltypeid",
  2312. JSON.stringify(this.detailData[li].fStltypeid)
  2313. );
  2314. }
  2315. // this.getList()
  2316. this.$message.success("保存成功");
  2317. getSave(this.detailForm.fId).then((res) => {
  2318. if (res.code == 200) {
  2319. let list = {
  2320. warehouseBills: res.data.warehouseBills,
  2321. tWarehousebillsfees: res.data.tWarehousebillsfees,
  2322. };
  2323. this.detailForm = list.warehouseBills;
  2324. this.detailData = list.tWarehousebillsfees;
  2325. this.$set(
  2326. this.detailForm,
  2327. "fStorekeeper",
  2328. JSON.parse(this.detailForm.fStorekeeper)
  2329. );
  2330. if (res.data.tWarehousebillsfees) {
  2331. this.detailData = res.data.tWarehousebillsfees;
  2332. for (let li in this.detailData) {
  2333. this.$set(
  2334. this.detailData[li],
  2335. "fFeeunitid",
  2336. JSON.stringify(this.detailData[li].fFeeunitid)
  2337. );
  2338. this.$set(
  2339. this.detailData[li],
  2340. "fStltypeid",
  2341. JSON.stringify(this.detailData[li].fStltypeid)
  2342. );
  2343. }
  2344. }
  2345. }
  2346. });
  2347. }
  2348. });
  2349. this.formList = this.detailForm;
  2350. this.dialogVisible = true;
  2351. break;
  2352. case "导出":
  2353. let dataForm = this.$refs.MainForm.form
  2354. this.$confirm("是否确认导出仓库入库?", "警告", {
  2355. confirmButtonText: "确定",
  2356. cancelButtonText: "取消",
  2357. type: "warning",
  2358. }).then(function () {
  2359. return getExport(dataForm);
  2360. })
  2361. .then((response) => {
  2362. this.download(response.msg);
  2363. });
  2364. break;
  2365. }
  2366. if (row.name == "修改" && row.res == "0") {
  2367. this.viewMethod();
  2368. }
  2369. if (row.res === 1) {
  2370. //从表修改按钮
  2371. for (let li in this.detailList.columnList) {
  2372. if (!this.detailList.columnList[li].doNot) {
  2373. this.detailList.columnList[li].disabled = false;
  2374. }
  2375. }
  2376. for (let item in this.detailOption) {
  2377. if (!this.detailOption[item].doNot) {
  2378. this.detailOption[item].disabled = false;
  2379. }
  2380. }
  2381. for (let li in this.detailButton) {
  2382. this.detailButton[li].disabled = false;
  2383. }
  2384. }
  2385. },
  2386. // 显示搜索条件、点击后会调用此方法
  2387. showSearch() {
  2388. this.getList();
  2389. },
  2390. //点击刷新会调用此方法
  2391. getList(res) {
  2392. this.queryParms.fBilltype = "RK";
  2393. listInStock(this.queryParms).then((response) => {
  2394. this.tableData = response.rows;
  2395. this.total = response.total;
  2396. if (res == 1) {
  2397. this.copyeId = this.tableData[0].fId;
  2398. this.viewMethod(null, 1);
  2399. }
  2400. });
  2401. },
  2402. },
  2403. };
  2404. </script>
  2405. <style scoped lang="scss">
  2406. .app-container ::v-deep .el-form-item {
  2407. margin-bottom: 4px;
  2408. }
  2409. .table {
  2410. border-collapse: collapse;
  2411. border-spacing: 0;
  2412. background-color: transparent;
  2413. display: table;
  2414. width: 100%;
  2415. max-width: 100%;
  2416. margin: 0 auto;
  2417. }
  2418. .table td {
  2419. text-align: center;
  2420. vertical-align: middle;
  2421. font-size: 14px;
  2422. color: #000000;
  2423. padding: 8px 12px;
  2424. }
  2425. .column {
  2426. border: 1px solid #000;
  2427. }
  2428. .app-container ::v-deep .el-table__body-wrapper {
  2429. z-index: 2;
  2430. }
  2431. </style>