index.vue 43 KB

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