index.vue 46 KB

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