index.vue 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428
  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. :tatolLabel="mainTatol"
  27. :seachButton="seachButton"
  28. :setRowList="listStyle"
  29. :listStyle="listStyle"
  30. :isItHidden="isItHidden"
  31. :queryList="queryList"/>
  32. <pagination
  33. v-show="total > 0"
  34. :total="total"
  35. :page.sync="queryParms.pageNum"
  36. :limit.sync="queryParms.pageSize"
  37. @pagination="getList"
  38. />
  39. </div>
  40. <div v-if="MainTable == true">
  41. <MainForm
  42. ref="detailForm"
  43. :searchdata="detailOption"
  44. :display="display"
  45. :form="detailForm"
  46. :show="show = true"
  47. :inDex="inDex"
  48. @backRules="backRules"
  49. @backSave="backSave"
  50. @verificationRules="verificationRules"
  51. @changeWarehouse="changeWarehouse"
  52. />
  53. <list-component
  54. v-if="waitFor"
  55. :tableData="detailData"
  56. @selectionbox="selectionbox"
  57. @see="viewMethod"
  58. @modify="modification"
  59. @deletion="deletion"
  60. @buttonList="buttonList"
  61. @showSearch="showSearch"
  62. @getList="getList"
  63. @deletRows="deletRows"
  64. @feedback="feedback"
  65. @totalAmount="totalAmount"
  66. :seachButton="confirmButton"
  67. :customButton="detailButton"
  68. :listStyle="detailStyle"
  69. :setRowList="detailStyle"
  70. :tatolLabel="tatolLabel"
  71. :listData="listData"
  72. :queryList="detailList"/>
  73. </div>
  74. <el-dialog
  75. title="打印入库"
  76. :visible.sync="dialogVisible"
  77. :fullscreen="true"
  78. style="padding: 0;margin:0"
  79. width="70%">
  80. <div ref="print">
  81. <table class="table table-striped table-bordered" align="center" valign="center" style="font-size: 12px;border-collapse: collapse; border: none;margin-top: 10px;" >
  82. <tr>
  83. <td style="font-size: 24px;font-weight:bold" class="column" colspan="15" align="center">入库明细</td>
  84. </tr>
  85. <tr>
  86. <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">入库时间</td>
  87. <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">产品名称</td>
  88. <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">规格</td>
  89. <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">数量</td>
  90. <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">供货商</td>
  91. <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">供货人</td>
  92. <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">联系电话</td>
  93. <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">生产日期或批号</td>
  94. <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">保质期限</td>
  95. <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">保存条件</td>
  96. <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">索证索票情况</td>
  97. <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">采购人</td>
  98. <td class="column" style="border: 1px solid #000; padding:10px" align="center" colspan="2">检验结果</td>
  99. <td class="column" style="border: 1px solid #000; padding:10px" align="center" rowspan="2">验收人</td>
  100. </tr>
  101. <tr>
  102. <td class="column" style="border: 1px solid #000; padding:10px" align="center" >感官</td>
  103. <td class="column" style="border: 1px solid #000; padding:10px" align="center" >数量</td>
  104. </tr>
  105. <tr v-for="(item,index) in this.detailData" :key="index">
  106. <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{detailForm.fBsdate}}</td>
  107. <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.feeName}}</td>
  108. <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.fFeeunitid}}</td>
  109. <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.fQty}}</td>
  110. <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{detailForm.corpName}}</td>
  111. <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.fAmount}}</td>
  112. <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.fStltypeid}}</td>
  113. <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.tProductdate}}/{{item.fLotno}}</td>
  114. <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.fValidName}}</td>
  115. <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.fStoreEnvName}}</td>
  116. <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{item.fIsfillesName}}</td>
  117. <td class="column" style="border: 1px solid #000; padding:10px" align="center" >{{detailForm.fpurchaseName}}</td>
  118. <td class="column" style="border: 1px solid #000; padding:10px" align="center" ></td>
  119. <td class="column" style="border: 1px solid #000; padding:10px" align="center" ></td>
  120. <td class="column" style="border: 1px solid #000; padding:10px" align="center" ></td>
  121. </tr>
  122. </table>
  123. </div>
  124. <span slot="footer" class="dialog-footer">
  125. <el-button @click="dialogVisible = false">取 消</el-button>
  126. <el-button type="primary" @click="Printing">打印</el-button>
  127. </span>
  128. </el-dialog>
  129. </div>
  130. </template>
  131. <script>
  132. import { select } from '@/api/system/set'
  133. import MainForm from '@/combination/MainForm'
  134. import { listInStock, addSave, getSave, getArea,
  135. getustomer,getEntry, getwarehouse, getGoodName,
  136. canBedelet, delRows, getWarehousekeeper, addWarehous,
  137. deletMain, delFee, copyNew, listQuery} from '@/api/warehouse/inStock'
  138. import Cookies from 'js-cookie'
  139. import { getliable } from '@/api/project'
  140. export default {
  141. name: 'inStock',
  142. data(){
  143. return{
  144. formList:{},
  145. dialogVisible: false,
  146. mainTatol:['金额'],
  147. ids:[],
  148. listData:{
  149. fFeeid:[],
  150. fFeeunitid:[],
  151. fStltypeid:[],
  152. fWarehouseid:[],
  153. fUnits:[],
  154. fStoreEnv:[],
  155. fIsfilles:[],
  156. },
  157. selection:[],
  158. isItHidden:true,
  159. // 非单个禁用
  160. single: true,
  161. // 总条数
  162. total: 0,
  163. inDex:4,
  164. tatolLabel:['单价','数量','金额'],
  165. MainTable:false,
  166. show: false,
  167. arrow:'el-icon-arrow-up',
  168. queryList:{
  169. tableName:'入库主表',
  170. columnList:[]
  171. },
  172. detailList:{
  173. tableName:'仓库入库详情',
  174. columnList:[]
  175. },
  176. //判断自定义列是否有值再渲染组件
  177. waitFor:false,
  178. display:3,
  179. queryParms:{
  180. pageNum: 1,
  181. pageSize: 10,
  182. fBilltype:'RK'
  183. },
  184. detailForm:{
  185. },
  186. //主页面默认显示4个表单数据
  187. formOption:[
  188. {
  189. span:6,
  190. label: 'fBillno',
  191. name:"系统编号",
  192. form:2,
  193. width:200,
  194. labelSize:'80',
  195. rules: { required:false }
  196. },
  197. {
  198. span:6,
  199. label: 'fWarehouseid',
  200. name:"仓库",
  201. form:1,
  202. width:200,
  203. labelSize:'80',
  204. rules: { required:false },
  205. data:[]
  206. },
  207. {
  208. span:6,
  209. label: 'fCorpid',
  210. name:"供应商",
  211. form:1,
  212. width:200,
  213. labelSize:'80',
  214. rules: { required:false },
  215. data:[]
  216. },
  217. {
  218. span:6,
  219. label: 'timeInterval',
  220. name:"入库日期",
  221. form:6,
  222. width:250,
  223. labelSize:'80',
  224. rules: { required:false },
  225. },
  226. {
  227. span:6,
  228. label: 'cLoadDate',
  229. name:"申请日期",
  230. form:6,
  231. width:200,
  232. labelSize:'80',
  233. rules: { required:false }
  234. },
  235. {
  236. span:6,
  237. label: 'moneys',
  238. name:"金额范围",
  239. form:5,
  240. width:200,
  241. labelSize:'80',
  242. rules: { required:false }
  243. },
  244. {
  245. span:6,
  246. label: 'createBy',
  247. name:"申请人",
  248. form:2,
  249. width:200,
  250. labelSize:'80',
  251. rules: { required:false }
  252. },
  253. {
  254. span:6,
  255. label: 'fGoodsid',
  256. name:"项目名称",
  257. form:1,
  258. width:200,
  259. labelSize:'80',
  260. rules: { required:false },
  261. data:[]
  262. },
  263. {
  264. span:6,
  265. label: 'remark',
  266. name:"备注",
  267. form:2,
  268. width:200,
  269. labelSize:'80',
  270. rules: { required:false }
  271. },
  272. ],
  273. //表名称
  274. tableData:[],
  275. //从表表名
  276. detailData:[],
  277. //传输表
  278. mainStyle:[],
  279. //表数据
  280. listStyle: [
  281. {
  282. surface: "1",
  283. label: "serialNumber",
  284. name: "序号",
  285. checked: 0,
  286. width: 100,
  287. onabort:''
  288. },{
  289. surface: "2",
  290. label: "fBillno",
  291. name: "申请编号",
  292. checked: 0,
  293. width: 100,
  294. }, {
  295. surface: "3",
  296. label: "fWarehouseName",
  297. name: "仓库",
  298. checked: 0,
  299. width: 200,
  300. operation:1
  301. },
  302. {
  303. surface: "4",
  304. label: "corpName",
  305. name: "供应商",
  306. checked: 0,
  307. width: 200,
  308. operation:1
  309. },{
  310. surface: "5",
  311. label: "fMoney",
  312. name: "金额",
  313. checked: 0,
  314. width: 200,
  315. operation:1
  316. },{
  317. surface: "6",
  318. label: "createTime",
  319. name: "申请日期",
  320. checked: 0,
  321. width: 200,
  322. operation:1
  323. },{
  324. surface: "7",
  325. label: "fBsdate",
  326. name: "入库日期",
  327. checked: 0,
  328. width: 200,
  329. operation:1
  330. },
  331. {
  332. surface: "8",
  333. label: "createBy",
  334. name: "申请人",
  335. checked: 0,
  336. width: 200,
  337. operation:1
  338. },{
  339. surface: "9",
  340. label: "fBillstatusName",
  341. name: "状态",
  342. checked: 0,
  343. width: 200,
  344. operation:1
  345. },{
  346. surface: "10",
  347. label: "fReviewDate",
  348. name: "审核日期",
  349. checked: 0,
  350. width: 200,
  351. operation:1,
  352. },
  353. {
  354. surface: "11",
  355. label: "projectName",
  356. name: "项目名称",
  357. checked: 0,
  358. width: 200,
  359. operation:1
  360. },{
  361. surface: "12",
  362. label: "remark",
  363. name: "备注",
  364. checked: 0,
  365. width: 200,
  366. operation:1
  367. },{
  368. surface: "13",
  369. label: "fMaterial2",
  370. name: "操作",
  371. checked: 0,
  372. width: 200,
  373. operation:1
  374. }
  375. ],
  376. //从表数据
  377. detailStyle: [
  378. {
  379. surface: "1",
  380. label: "serialNumber",
  381. name: "序号",
  382. checked: 0,
  383. width: 100,
  384. onabort:''
  385. },{
  386. surface: "2",
  387. label: "fFeeid",
  388. name: "品名",
  389. checked: 0,
  390. width: 200,
  391. changeable:1,
  392. data:[],
  393. },{
  394. surface: "3",
  395. label: "fUnitprice",
  396. name: "单价",
  397. checked: 0,
  398. width: 100,
  399. operation:2,
  400. changeable:2,
  401. disabled:false,
  402. onabort:'this.value=this.value.replace(/[^\\d^\\.]+/g,\'\')'
  403. },{
  404. surface: "4",
  405. label: "fQty",
  406. name: "数量",
  407. checked: 0,
  408. width: 100,
  409. operation:2,
  410. changeable:2,
  411. disabled:false,
  412. onabort:'this.value=this.value.replace(/[^\\d^\\.]+/g,\'\')'
  413. },{
  414. surface: "5",
  415. label: "fFeeunitid",
  416. name: "计量单位",
  417. checked: 0,
  418. width: 100,
  419. changeable:1,
  420. operation:2,
  421. data:[],
  422. disabled:false
  423. },{
  424. surface: "6",
  425. label: "fWarehouseid",
  426. name: "库区",
  427. checked: 0,
  428. width: 100,
  429. operation:2,
  430. changeable:1,
  431. data:[],
  432. disabled:false
  433. },{
  434. surface: "7",
  435. label: "fAmount",
  436. name: "金额",
  437. checked: 0,
  438. width: 100,
  439. operation:2,
  440. changeable: 2,
  441. disabled: true,
  442. doNot:'1'
  443. },{
  444. surface: "8",
  445. label: "fStltypeid",
  446. name: "付费方式",
  447. checked: 0,
  448. width: 100,
  449. operation:2,
  450. changeable: 1,
  451. data:[],
  452. disabled:false
  453. },
  454. {
  455. surface: "9",
  456. label: "tProductdate",
  457. name: "生产日期",
  458. checked: 0,
  459. width: 100,
  460. operation:2,
  461. changeable: 3,
  462. data:[],
  463. disabled:false
  464. },{
  465. surface: "10",
  466. label: "fLotno",
  467. name: "批号",
  468. checked: 0,
  469. width: 100,
  470. operation:2,
  471. changeable: 2,
  472. data:[],
  473. disabled:false
  474. },
  475. {
  476. surface: "11",
  477. label: "fValid",
  478. name: "保质期限",
  479. checked: 0,
  480. width: 100,
  481. operation:2,
  482. changeable: 2,
  483. data:[],
  484. disabled:false,
  485. onabort:'this.value=this.value.replace(/[^\\d^\\.]+/g,\'\')'
  486. },
  487. {
  488. surface: "12",
  489. label: "fUnits",
  490. name: "单位",
  491. checked: 0,
  492. width: 100,
  493. operation:2,
  494. changeable: 1,
  495. data:[],
  496. disabled:false
  497. },
  498. {
  499. surface: "13",
  500. label: "fStoreEnv",
  501. name: "存储环境",
  502. checked: 0,
  503. width: 100,
  504. operation:2,
  505. changeable: 1,
  506. data:[],
  507. disabled:false
  508. },
  509. {
  510. surface: "14",
  511. label: "fIsfilles",
  512. name: "索证索票",
  513. checked: 0,
  514. width: 100,
  515. operation:2,
  516. changeable: 1,
  517. disabled:false
  518. },
  519. {
  520. surface: "15",
  521. label: "remark",
  522. name: "备注",
  523. checked: 0,
  524. width: 100,
  525. operation:2,
  526. changeable: 2,
  527. disabled:false
  528. },{
  529. surface: "16",
  530. label: "fReviewDate",
  531. name: "审核日期",
  532. checked: 0,
  533. width: 100,
  534. operation:2,
  535. changeable: 3,
  536. disabled:true,
  537. doNot:'1'
  538. },
  539. {
  540. surface: "17",
  541. label: "createBy",
  542. name: "申请人",
  543. checked: 0,
  544. width: 100,
  545. operation:2,
  546. changeable: 2,
  547. disabled:true,
  548. doNot:'1'
  549. },{
  550. surface: "18",
  551. label: "fMaterial10",
  552. name: "操作",
  553. checked: 0,
  554. width: 100,
  555. operation:2,
  556. disabled:false
  557. }
  558. ],
  559. //详情主表
  560. detailOption:[
  561. {
  562. index:'1',
  563. span:6,
  564. label: 'fBillno',
  565. name:"系统编号",
  566. form:2,
  567. width:200,
  568. labelSize:'80',
  569. rules:'',
  570. disabled:true,
  571. doNot:'1'
  572. },
  573. {
  574. index:'2',
  575. span:6,
  576. label: 'fCorpid',
  577. name:"供应商",
  578. form:1,
  579. width:200,
  580. labelSize:'80',
  581. rules:{ required: true, message: ' ', trigger: 'blur' },
  582. data:[],
  583. disabled:false
  584. },
  585. {
  586. index:'3',
  587. span:6,
  588. label: 'fStorekeeper',
  589. name:"库管员",
  590. form:1,
  591. width:200,
  592. labelSize:'80',
  593. rules:{ required: true, message: ' ', trigger: 'blur' },
  594. data:[],
  595. disabled:false
  596. },
  597. {
  598. index:'4',
  599. span:6,
  600. label: 'fPurchase',
  601. name:"采购人",
  602. form:1,
  603. width:200,
  604. labelSize:'80',
  605. rules:{ required: true, message: ' ', trigger: 'blur' },
  606. data:[],
  607. disabled:false
  608. },
  609. {
  610. index:'5',
  611. span:6,
  612. label: 'fWarehouseid',
  613. name:"仓库",
  614. form:1,
  615. width:200,
  616. labelSize:'80',
  617. rules:{ required: true, message: ' ', trigger: 'blur' },
  618. data:[],
  619. disabled:false
  620. }, {
  621. index:'6',
  622. span:6,
  623. label: 'fSbu',
  624. name:"出票单位",
  625. form:1,
  626. width:200,
  627. labelSize:'80',
  628. rules:{ required: true, message: ' ', trigger: 'blur' },
  629. data:[],
  630. disabled:false
  631. },
  632. {
  633. index:'7',
  634. span:6,
  635. label: 'fBsdate',
  636. name:"入库日期",
  637. form:3,
  638. width:200,
  639. labelSize:'80',
  640. rules:{ required: true, message: ' ', trigger: 'blur' },
  641. disabled:false
  642. },
  643. {
  644. index:'8',
  645. span:6,
  646. label: 'remark',
  647. name:"备注",
  648. form:4,
  649. width:200,
  650. labelSize:'80',
  651. rules:'',
  652. disabled:false
  653. },
  654. ],
  655. //按钮
  656. customButton:[
  657. {
  658. type:'primary',
  659. size:'mini',
  660. icon:'el-icon-plus',
  661. name:'新增',
  662. disabled:false,
  663. },{
  664. type:'success',
  665. size:'mini',
  666. icon:'el-icon-edit',
  667. name:'修改',
  668. res:0,
  669. disabled:true
  670. },{
  671. type:'info',
  672. size:'mini',
  673. icon:'el-icon-plus',
  674. name:'复制新增',
  675. disabled:true
  676. },
  677. ],
  678. seachButton:[
  679. {
  680. type:'',
  681. size:'mini',
  682. icon:'el-icon-search',
  683. name:'搜索',
  684. disabled:false,
  685. },{
  686. type:'',
  687. size:'mini',
  688. icon:'el-icon-refresh',
  689. name:'重置',
  690. disabled:false,
  691. },{
  692. type:'',
  693. size:'mini',
  694. icon:'el-icon-arrow-up',
  695. name:'展开',
  696. disabled:false
  697. }
  698. ],
  699. detailButton:[
  700. {
  701. type:'danger',
  702. size:'mini',
  703. icon:'el-icon-refresh-left',
  704. name:'返回列表',
  705. disabled:false,
  706. },{
  707. type:'primary',
  708. size:'mini',
  709. icon:'el-icon-edit',
  710. name:'录入',
  711. disabled:false,
  712. },{
  713. type:'success',
  714. size:'mini',
  715. icon:'el-icon-check',
  716. name:'保存',
  717. disabled:false
  718. },{
  719. type:'info',
  720. size:'mini',
  721. icon:'el-icon-edit',
  722. name:'修改',
  723. disabled:false,
  724. res:1
  725. },{
  726. type:'info',
  727. size:'mini',
  728. icon:'el-icon-edit',
  729. name:'打印',
  730. disabled:false,
  731. res:1
  732. },{
  733. type:'info',
  734. size:'mini',
  735. icon:'el-icon-edit',
  736. name:'入库确认',
  737. disabled:false,
  738. res:1
  739. },
  740. {
  741. type:'warning',
  742. size:'mini',
  743. icon:'el-icon-refresh',
  744. name:'刷新',
  745. disabled:false,
  746. res:1
  747. }
  748. ],
  749. confirmButton:[
  750. {
  751. type:'cyan',
  752. size:'mini',
  753. icon:'',
  754. name:'打印',
  755. disabled:false,
  756. },{
  757. type:'info',
  758. size:'mini',
  759. icon:'',
  760. name:'入库确认',
  761. disabled:false
  762. }
  763. ]
  764. }
  765. },
  766. created() {
  767. let data = {
  768. tableName: this.queryList.tableName,
  769. userId: Cookies.get("userName"),
  770. };
  771. this.getRow(data)
  772. let list = {
  773. fBilltype:'RK'
  774. }
  775. this.query(list)
  776. this.getRow()
  777. this.getList()
  778. this.selectMethods()
  779. },
  780. methods:{
  781. //确认打印
  782. Printing(){
  783. this.$print(this.$refs.print)
  784. },
  785. //查询主页列数据
  786. query(data){
  787. listQuery(data).then(res =>{
  788. this.tableData = res.rows
  789. })
  790. },
  791. //更换仓库
  792. changeWarehouse(){
  793. if(this.detailData.length != 0){
  794. for(let li in this.detailData){
  795. this.detailData[li].fWarehouseid = ''
  796. }
  797. }
  798. getArea(this.detailForm.fWarehouseid).then(res=>{
  799. this.listData.fWarehouseid = []
  800. for(let item in res.data){
  801. this.listData.fWarehouseid.push({
  802. label:res.data[item].fWarehouseInformation,
  803. value:res.data[item].id
  804. })
  805. }
  806. })
  807. },
  808. //自动合计金额
  809. totalAmount(){
  810. for(let li in this.detailData){
  811. if(this.detailData[li].fUnitprice && this.detailData[li].fQty){
  812. this.detailData[li].fAmount = (this.detailData[li].fUnitprice * this.detailData[li].fQty).toFixed(2)
  813. }
  814. }
  815. },
  816. //搜索、重置、展开
  817. feedback(res){
  818. if (res == '展开'){
  819. if (this.inDex == 4){
  820. this.inDex = this.formOption.length
  821. }else {
  822. this.inDex = 4
  823. }
  824. }else if (res == '搜索'){
  825. this.handleQuery()
  826. }else if (res == '重置'){
  827. this.resetQuery()
  828. }
  829. },
  830. selectMethods(){
  831. this.mainMethods()
  832. this.detailMethods()
  833. },
  834. //主页面下拉获取名称
  835. mainMethods(){
  836. for(let li in this.formOption){
  837. if(this.formOption[li].name == '仓库'){
  838. let queryParams = { pageNum: 1,}
  839. getwarehouse(queryParams).then(res=>{
  840. for(let item in res.rows){
  841. this.formOption[li].data.push({
  842. label:res.rows[item].fName,
  843. value:res.rows[item].fId
  844. })
  845. }
  846. })
  847. }
  848. else
  849. if(this.formOption[li].name == '供应商'){
  850. let queryParams = { pageNum: 1, fTypeid: 1}
  851. getustomer(queryParams).then(res => {
  852. for(let item in res.data){
  853. this.formOption[li].data.push({
  854. label:res.data[item].fName,
  855. value:res.data[item].fId
  856. })
  857. }
  858. })
  859. }
  860. }
  861. },
  862. //弹窗页获取下拉名称
  863. detailMethods(){
  864. for(let li in this.detailOption){
  865. if(this.detailOption[li].name == '仓库'){
  866. //获取仓库
  867. let queryParams = { pageNum: 1 }
  868. getwarehouse(queryParams).then(res=>{
  869. for(let item in res.rows){
  870. this.detailOption[li].data.push({
  871. label:res.rows[item].fName,
  872. value:res.rows[item].fId
  873. })
  874. }
  875. })
  876. }else if(this.detailOption[li].name == '供应商'){
  877. //获取供应商
  878. let queryParams = { pageNum: 1, fTypeid: 1}
  879. getustomer(queryParams).then(res => {
  880. for(let item in res.data){
  881. this.detailOption[li].data.push({
  882. label:res.data[item].fName,
  883. value:res.data[item].fId
  884. })
  885. }
  886. })
  887. }else if(this.detailOption[li].name == '付款单位'){
  888. //获取付款单位
  889. let queryParams = { pageNum: 1, fTypeid: 1}
  890. getustomer(queryParams).then(res => {
  891. for(let item in res.data){
  892. this.detailOption[li].data.push({
  893. label:res.data[item].fName,
  894. value:res.data[item].fId
  895. })
  896. }
  897. })
  898. }else if(this.detailOption[li].name == '库管员'){
  899. let queryParams = { pageNum: 1,roleName:'库管'}
  900. getWarehousekeeper(queryParams).then(res=>{
  901. for(let item in res.rows){
  902. this.detailOption[li].data.push({
  903. label:res.rows[item].userName,
  904. value:res.rows[item].userId
  905. })
  906. }
  907. })
  908. }else if(this.detailOption[li].name == '采购人'){
  909. getliable().then((res) => {
  910. console.log(res)
  911. for(let item in res.rows){
  912. this.detailOption[li].data.push({
  913. label:res.rows[item].userName,
  914. value:res.rows[item].userId
  915. })
  916. }
  917. })
  918. }
  919. }
  920. //获取计量单位字典表
  921. this.getDicts('data_unitfees').then((response) => {
  922. if (response.data) {
  923. for (let item in response.data) {
  924. this.listData.fFeeunitid.push({
  925. label: response.data[item].dictLabel,
  926. value: response.data[item].dictValue
  927. })
  928. }
  929. }
  930. })
  931. //获取浮点单位字典表
  932. this.getDicts('f_floatunit').then((response) => {
  933. if (response.data) {
  934. for (let item in response.data) {
  935. this.listData.fUnits.push({
  936. label: response.data[item].dictLabel,
  937. value: JSON.parse(response.data[item].dictValue)
  938. })
  939. }
  940. }
  941. })
  942. //获取存储环境字典表
  943. this.getDicts('f_StorageEnvironment').then((response) => {
  944. if (response.data) {
  945. for (let item in response.data) {
  946. this.listData.fStoreEnv.push({
  947. label: response.data[item].dictLabel,
  948. value: JSON.parse(response.data[item].dictValue)
  949. })
  950. }
  951. }
  952. })
  953. this.getDicts('f_evidence').then((response) => {
  954. if (response.data) {
  955. for (let item in response.data) {
  956. this.listData.fIsfilles.push({
  957. label: response.data[item].dictLabel,
  958. value: JSON.parse(response.data[item].dictValue)
  959. })
  960. }
  961. }
  962. })
  963. //获取品名
  964. let queryParams = { pageNum: 1 }
  965. getGoodName(queryParams).then(res=>{
  966. for(let item in res.rows){
  967. this.listData.fFeeid.push({
  968. label:res.rows[item].fName,
  969. value:res.rows[item].fId
  970. })
  971. }
  972. })
  973. //付费方式
  974. this.getDicts('f_paymode').then((response) => {
  975. if (response.data) {
  976. for (let item in response.data) {
  977. this.listData.fStltypeid.push({
  978. label: response.data[item].dictLabel,
  979. value: response.data[item].dictValue
  980. })
  981. }
  982. }
  983. })
  984. },
  985. handleQuery(){
  986. this.$refs.MainForm.hide()
  987. this.getList();
  988. },
  989. resetQuery(){
  990. this.queryParms = {}
  991. this.getList();
  992. },
  993. //查询列数据
  994. getRow() {
  995. let data = {
  996. tableName: this.queryList.tableName,
  997. userId: Cookies.get("userName"),
  998. };
  999. select(data).then((res) => {
  1000. if (data.tableName === '仓库入库详情') {
  1001. if (res.data.length != 0) {
  1002. this.detailList.columnList = res.data.filter((e) => e.checked == 0);
  1003. this.detailList.columnList = res.data;
  1004. this.setRowList = res.data
  1005. this.detailList.columnList = this.detailList.columnList.filter((e) => e.checked == 0);
  1006. // this.waitFor = true
  1007. }else {
  1008. // this.waitFor = true
  1009. this.detailList.columnList = this.detailStyle
  1010. this.setRowList = this.detailStyle
  1011. }
  1012. // this.pageDisplay = false
  1013. this.isItHidden = false
  1014. this.inDex = this.detailOption.length
  1015. }else {
  1016. if (res.data.length != 0) {
  1017. this.queryList.columnList = res.data.filter((e) => e.checked == 0);
  1018. this.queryList.columnList = res.data;
  1019. this.setRowList = res.data
  1020. this.queryList.columnList = this.queryList.columnList.filter((e) => e.checked == 0);
  1021. this.waitFor = true
  1022. }else {
  1023. this.waitFor = true
  1024. this.queryList.columnList = this.listStyle
  1025. this.setRowList = this.listStyle
  1026. }
  1027. // this.pageDisplay = true
  1028. this.isItHidden = true
  1029. this.inDex = 4
  1030. }
  1031. });
  1032. },
  1033. //选择框
  1034. selectionbox(selection){
  1035. this.selection = selection
  1036. this.ids = selection.map((item) => item.fId)
  1037. this.single = selection.length !== 1
  1038. for(let li in this.customButton){
  1039. if(this.customButton[li].name == '修改' || this.customButton[li].name == '复制新增'){
  1040. this.customButton[li].disabled = this.single
  1041. }
  1042. }
  1043. },
  1044. //查看
  1045. viewMethod(scope){
  1046. this.detailList.columnList = this.detailStyle
  1047. let fId = ''
  1048. if(scope){
  1049. fId = scope.row.fId
  1050. }else{
  1051. fId = this.ids
  1052. }
  1053. getSave(fId).then(res=>{
  1054. if(res.code == 200){
  1055. if(res.data.warehouseBills){
  1056. this.detailForm = res.data.warehouseBills
  1057. this.$set(this.detailForm,'fStorekeeper',JSON.parse(this.detailForm.fStorekeeper))
  1058. }
  1059. if(res.data.tWarehousebillsfees){
  1060. this.detailData = res.data.tWarehousebillsfees
  1061. for(let li in this.detailData){
  1062. this.$set(this.detailData[li],'fFeeunitid',JSON.stringify(this.detailData[li].fFeeunitid))
  1063. this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
  1064. }
  1065. }
  1066. }
  1067. for(let li in this.detailStyle){
  1068. this.detailStyle[li].disabled = true
  1069. }
  1070. for(let item in this.detailOption){
  1071. this.detailOption[item].disabled = true
  1072. }
  1073. for(let li in this.detailButton){
  1074. if(this.detailForm.fBillstatus == '6'){
  1075. if(this.detailButton[li].name == '返回列表'){
  1076. this.detailButton[li].disabled = false
  1077. }else {
  1078. this.detailButton[li].disabled = true
  1079. }
  1080. } else {
  1081. if(this.detailButton[li].name == '返回列表' || this.detailButton[li].name == '修改'){
  1082. this.detailButton[li].disabled = false
  1083. }else{
  1084. this.detailButton[li].disabled = true
  1085. }
  1086. }
  1087. }
  1088. getArea(this.detailForm.fWarehouseid).then(res=>{
  1089. if(res.code == 200){
  1090. this.listData.fWarehouseid = []
  1091. for(let item in res.data){
  1092. this.listData.fWarehouseid.push({
  1093. label:res.data[item].fWarehouseInformation,
  1094. value:res.data[item].id
  1095. })
  1096. }
  1097. }
  1098. })
  1099. this.MainTable = true
  1100. this.inDex = this.detailOption.length
  1101. })
  1102. },
  1103. //修改
  1104. modification(scope){
  1105. },
  1106. //删除
  1107. deletion(scope){
  1108. const fIds = scope.row.fId || this.ids;
  1109. let tips = "";
  1110. deletMain(fIds).then(res=>{
  1111. switch (res.msg) {
  1112. case "0": {
  1113. this.$message.error("当前数据已被其他操作员操作,请刷新页面");
  1114. break;
  1115. }
  1116. case "1": {
  1117. tips = "当前主表有数据,确认是否删除?";
  1118. this.delete_s(fIds, tips);
  1119. break;
  1120. }
  1121. case "2": {
  1122. tips = "当前主表有数据,从表有数据,确认是否删除?";
  1123. this.delete_s(fIds, tips);
  1124. break;
  1125. }
  1126. default: {
  1127. return this.$message.error("未知错误,无状态");
  1128. }
  1129. }
  1130. })
  1131. },
  1132. delete_s(fIds, tips) {
  1133. this.$confirm(tips, "警告", {
  1134. confirmButtonText: "确定",
  1135. cancelButtonText: "取消",
  1136. type: "warning",
  1137. })
  1138. .then(function () {
  1139. return delFee(fIds);
  1140. })
  1141. .then(() => {
  1142. this.getList();
  1143. this.msgSuccess("删除成功");
  1144. });
  1145. },
  1146. //删除从表行
  1147. deletRows(index,rows){
  1148. if(rows[index].fId){
  1149. let formData = {
  1150. fId:this.detailForm.fId,
  1151. fDateChanged:this.detailForm.fDateChanged
  1152. }
  1153. canBedelet(formData).then(res=>{
  1154. return delRows(rows[index].fId)
  1155. })
  1156. .then(()=>{
  1157. getSave(this.detailForm.fId).then(res=>{
  1158. if(res.code == 200){
  1159. if(res.data.warehouseBills){
  1160. this.detailForm = res.data.warehouseBills
  1161. this.$set(this.detailForm,'fStorekeeper',JSON.parse(this.detailForm.fStorekeeper))
  1162. }
  1163. if(res.data.tWarehousebillsfees){
  1164. this.detailData = res.data.tWarehousebillsfees
  1165. for(let li in this.detailData){
  1166. this.$set(this.detailData[li],'fFeeunitid',JSON.stringify(this.detailData[li].fFeeunitid))
  1167. this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
  1168. }
  1169. }
  1170. this.msgSuccess("删除成功");
  1171. }
  1172. })
  1173. })
  1174. .catch(res=>{
  1175. this.$message.error(res)
  1176. })
  1177. }else {
  1178. rows.splice(index, 1)
  1179. }
  1180. },
  1181. //必填项新行
  1182. verificationRules(valid){
  1183. if(valid){
  1184. this.detailData.push({
  1185. serialNumber:null,
  1186. fFeeid:null,
  1187. fUnitprice:null,
  1188. fQty:null,
  1189. fFeeunitid:'1',
  1190. fWarehouseid:null,
  1191. fAmount:null,
  1192. fStltypeid:'1',
  1193. tProductdate:null,
  1194. fLotno:null,
  1195. fValid:null,
  1196. fUnits:null,
  1197. fStoreEnv:null,
  1198. fIsfilles:0,
  1199. remark:null,
  1200. fReviewDate:null,
  1201. createBy:null,
  1202. })
  1203. }
  1204. },
  1205. //返回列表是否保存
  1206. backRules(){
  1207. for(let li in this.detailOption) {
  1208. if(this.detailOption[li].name == '供应商'){
  1209. if(this.detailOption[li].disabled == true){
  1210. this.getList();
  1211. this.MainTable = false
  1212. } else {
  1213. this.$confirm("返回列表,是否保存?", "提示", {
  1214. confirmButtonText: "保存",
  1215. cancelButtonText: "取消",
  1216. type: "warning",
  1217. }).then(() => {
  1218. this.$refs.detailForm.saveRules('1')
  1219. }).catch(() => {
  1220. this.inDex = 4
  1221. this.MainTable = false
  1222. this.getList();
  1223. });
  1224. }
  1225. }
  1226. }
  1227. },
  1228. backSave(valid,i){
  1229. if(valid){
  1230. this.detailForm.fMoney = 0
  1231. for(let li in this.detailData){
  1232. if(this.detailData[li]){
  1233. this.detailForm.fMoney += Number(this.detailData[li].fAmount)
  1234. }
  1235. }
  1236. let formData = new window.FormData();
  1237. formData.append('tWarehousebills', JSON.stringify(this.detailForm))
  1238. formData.append('tWarehousebillsfees', JSON.stringify(this.detailData))
  1239. formData.append('fBilltype', 'RK')
  1240. addSave(formData).then(res=>{
  1241. if(res.code == 200){
  1242. this.detailForm = res.data.warehouseBills
  1243. this.$set(this.detailForm,'fStorekeeper',JSON.parse(this.detailForm.fStorekeeper))
  1244. this.detailData = res.data.tWarehousebillsCntrs
  1245. for(let li in this.detailData){
  1246. this.$set(this.detailData[li],'fFeeunitid',JSON.stringify(this.detailData[li].fFeeunitid))
  1247. this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
  1248. }
  1249. this.$message.success("操作成功")
  1250. this.getList();
  1251. if(i == 1){
  1252. this.MainTable = false
  1253. this.inDex = 4
  1254. }
  1255. }
  1256. })
  1257. }
  1258. },
  1259. //所以按钮
  1260. buttonList(row){
  1261. switch (row.name) {
  1262. case '新增':
  1263. this.detailList.columnList = this.detailStyle
  1264. this.detailForm = {}
  1265. this.detailData = []
  1266. this.inDex = this.detailOption.length
  1267. //从表修改按钮
  1268. for(let li in this.detailStyle){
  1269. if(!this.detailStyle[li].doNot){
  1270. this.detailStyle[li].disabled = false
  1271. }
  1272. }
  1273. for(let item in this.detailOption){
  1274. if(!this.detailOption[item].doNot){
  1275. this.detailOption[item].disabled = false
  1276. }
  1277. }
  1278. for(let li in this.detailButton){
  1279. this.detailButton[li].disabled = false
  1280. }
  1281. this.MainTable = true
  1282. break
  1283. case '录入':
  1284. this.$refs.detailForm.rules()
  1285. break
  1286. case '返回列表':
  1287. this.backRules()
  1288. break
  1289. case '保存':
  1290. this.$refs.detailForm.saveRules()
  1291. break
  1292. case '入库确认':
  1293. console.log(this.detailData)
  1294. if(this.detailData.length == 0){
  1295. this.$message.error("请维护明细")
  1296. }else{
  1297. for(let item in this.detailData) {
  1298. let num = Number(item) + 1
  1299. if(!this.detailData[item].fQty){
  1300. this.$message.error("请维护第" + num + "数量")
  1301. return false
  1302. }
  1303. if (!this.detailData[item].fWarehouseid) {
  1304. this.$message.error("请维护第" + num + "行库区")
  1305. return false
  1306. }
  1307. }
  1308. this.detailForm.fMoney = 0
  1309. for(let li in this.detailData){
  1310. if(this.detailData[li]){
  1311. this.detailForm.fMoney += Number(this.detailData[li].fAmount)
  1312. }
  1313. }
  1314. let formData = new window.FormData();
  1315. formData.append('tWarehousebills', JSON.stringify(this.detailForm))
  1316. formData.append('tWarehousebillsfees', JSON.stringify(this.detailData))
  1317. formData.append('fBilltype', 'RK')
  1318. addWarehous(formData).then(res=>{
  1319. if(res.data.warehouseBills){
  1320. this.detailForm = res.data.warehouseBills
  1321. this.$set(this.detailForm,'fStorekeeper',JSON.parse(this.detailForm.fStorekeeper))
  1322. }
  1323. if(res.data.tWarehousebillsCntrs){
  1324. this.detailData = res.data.tWarehousebillsCntrs
  1325. for(let li in this.detailData){
  1326. this.$set(this.detailData[li],'fFeeunitid',JSON.stringify(this.detailData[li].fFeeunitid))
  1327. this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
  1328. }
  1329. }
  1330. this.$message.success("操作成功")
  1331. for(let li in this.detailStyle){
  1332. this.detailStyle[li].disabled = true
  1333. }
  1334. for(let item in this.detailOption){
  1335. this.detailOption[item].disabled = true
  1336. }
  1337. for(let li in this.detailButton) {
  1338. if (this.detailButton[li].name == '返回列表') {
  1339. this.detailButton[li].disabled = false
  1340. }else{
  1341. this.detailButton[li].disabled = true
  1342. }
  1343. }
  1344. })
  1345. }
  1346. break
  1347. case '刷新':
  1348. if(this.detailForm.fId){
  1349. getSave(this.detailForm.fId).then(res=>{
  1350. if(res.data.warehouseBills){
  1351. this.detailForm = res.data.warehouseBills
  1352. this.$set(this.detailForm,'fStorekeeper',JSON.parse(this.detailForm.fStorekeeper))
  1353. }
  1354. if(res.data.tWarehousebillsfees){
  1355. this.detailData = res.data.tWarehousebillsfees
  1356. for(let li in this.detailData){
  1357. this.$set(this.detailData[li],'fFeeunitid',JSON.stringify(this.detailData[li].fFeeunitid))
  1358. this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
  1359. }
  1360. }
  1361. })
  1362. }
  1363. break
  1364. case '复制新增':
  1365. let formDate = {
  1366. fBilltype:'RK',
  1367. fId:this.selection[0].fId
  1368. }
  1369. copyNew(formDate).then(res=>{
  1370. this.$message.success("操作成功")
  1371. this.getList()
  1372. })
  1373. break
  1374. case '打印':
  1375. this.formList = this.detailForm
  1376. this.dialogVisible = true
  1377. break
  1378. }
  1379. if(row.name == '修改' && row.res == '0'){
  1380. this.viewMethod()
  1381. }
  1382. if(row.res === 1){
  1383. //从表修改按钮
  1384. for(let li in this.detailStyle){
  1385. if(!this.detailStyle[li].doNot){
  1386. this.detailStyle[li].disabled = false
  1387. }
  1388. }
  1389. for(let item in this.detailOption){
  1390. if(!this.detailOption[item].doNot){
  1391. this.detailOption[item].disabled = false
  1392. }
  1393. }
  1394. for(let li in this.detailButton){
  1395. this.detailButton[li].disabled = false
  1396. }
  1397. }
  1398. },
  1399. // 显示搜索条件、点击后会调用此方法
  1400. showSearch(){
  1401. this.getList()
  1402. },
  1403. //点击刷新会调用此方法
  1404. getList(){
  1405. this.queryParms.fBilltype = 'RK'
  1406. listInStock(this.queryParms).then(res=>{
  1407. this.tableData = res.rows
  1408. this.total = res.total
  1409. })
  1410. },
  1411. }
  1412. }
  1413. </script>
  1414. <style scoped lang="scss">
  1415. .app-container ::v-deep .el-form-item {
  1416. margin-bottom: 4px;
  1417. }
  1418. </style>