index.vue 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648
  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. disabled:false
  414. },
  415. {
  416. surface: "3",
  417. label: "fCurrencyName",
  418. name: "*规格",
  419. checked: 0,
  420. width: 100,
  421. disabled:false
  422. },
  423. {
  424. surface: "4",
  425. label: "fUnitprice",
  426. name: "*单价",
  427. checked: 0,
  428. width: 100,
  429. operation:2,
  430. changeable:2,
  431. disabled:false,
  432. onabort:'this.value=this.value.replace(/[^\\d^\\.]+/g,\'\')'
  433. },{
  434. surface: "5",
  435. label: "fQty",
  436. name: "*数量",
  437. checked: 0,
  438. width: 100,
  439. operation:2,
  440. changeable:2,
  441. disabled:false,
  442. onabort:'this.value=this.value.replace(/[^\\d^\\.]+/g,\'\')'
  443. },{
  444. surface: "6",
  445. label: "fFeeunitid",
  446. name: "*计量单位",
  447. checked: 0,
  448. width: 100,
  449. changeable:1,
  450. operation:2,
  451. data:[],
  452. disabled:false
  453. },{
  454. surface: "7",
  455. label: "fWarehouseid",
  456. name: "*库区",
  457. checked: 0,
  458. width: 100,
  459. operation:2,
  460. changeable:1,
  461. data:[],
  462. disabled:false
  463. },{
  464. surface: "8",
  465. label: "fAmount",
  466. name: "*金额",
  467. checked: 0,
  468. width: 100,
  469. operation:2,
  470. disabled:false
  471. },{
  472. surface: "9",
  473. label: "fStltypeid",
  474. name: "付费方式",
  475. checked: 0,
  476. width: 100,
  477. operation:2,
  478. changeable: 1,
  479. data:[],
  480. disabled:false
  481. },
  482. {
  483. surface: "10",
  484. label: "tProductdate",
  485. name: "生产日期",
  486. checked: 0,
  487. width: 100,
  488. operation:2,
  489. changeable: 3,
  490. data:[],
  491. disabled:false
  492. },{
  493. surface: "11",
  494. label: "fLotno",
  495. name: "批号",
  496. checked: 0,
  497. width: 100,
  498. operation:2,
  499. changeable: 2,
  500. data:[],
  501. disabled:false
  502. },
  503. {
  504. surface: "12",
  505. label: "fValid",
  506. name: "保质期限",
  507. checked: 0,
  508. width: 100,
  509. operation:2,
  510. changeable: 2,
  511. data:[],
  512. disabled:false,
  513. onabort:'this.value=this.value.replace(/[^\\d^\\.]+/g,\'\')'
  514. },
  515. {
  516. surface: "13",
  517. label: "fUnits",
  518. name: "单位",
  519. checked: 0,
  520. width: 100,
  521. operation:2,
  522. changeable: 1,
  523. data:[],
  524. disabled:false
  525. },
  526. {
  527. surface: "14",
  528. label: "fStoreEnv",
  529. name: "存储环境",
  530. checked: 0,
  531. width: 100,
  532. operation:2,
  533. changeable: 1,
  534. data:[],
  535. disabled:false
  536. },
  537. {
  538. surface: "15",
  539. label: "fIsfilles",
  540. name: "索证索票",
  541. checked: 0,
  542. width: 100,
  543. operation:2,
  544. changeable: 1,
  545. disabled:false
  546. },
  547. {
  548. surface: "16",
  549. label: "remark",
  550. name: "备注",
  551. checked: 0,
  552. width: 100,
  553. operation:2,
  554. changeable: 2,
  555. disabled:false
  556. },{
  557. surface: "17",
  558. label: "fReviewDate",
  559. name: "审核日期",
  560. checked: 0,
  561. width: 100,
  562. operation:2,
  563. disabled:false
  564. },
  565. {
  566. surface: "18",
  567. label: "createBy",
  568. name: "申请人",
  569. checked: 0,
  570. width: 100,
  571. operation:2,
  572. disabled:false
  573. },{
  574. surface: "19",
  575. label: "fMaterial10",
  576. name: "操作",
  577. checked: 0,
  578. width: 100,
  579. operation:2,
  580. disabled:false
  581. }
  582. ],
  583. //详情主表
  584. detailOption:[
  585. {
  586. index:'1',
  587. span:6,
  588. label: 'fBillno',
  589. name:"系统编号",
  590. form:2,
  591. width:200,
  592. labelSize:'80',
  593. rules:'',
  594. disabled:true,
  595. doNot:'1'
  596. },
  597. {
  598. index:'2',
  599. span:6,
  600. label: 'fCorpid',
  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:'3',
  611. span:6,
  612. label: 'fStorekeeper',
  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. {
  622. index:'4',
  623. span:6,
  624. label: 'fPurchase',
  625. name:"采购人",
  626. form:1,
  627. width:200,
  628. labelSize:'80',
  629. rules:{ required: true, message: ' ', trigger: 'blur' },
  630. data:[],
  631. disabled:false
  632. },
  633. {
  634. index:'5',
  635. span:6,
  636. label: 'fWarehouseid',
  637. name:"仓库",
  638. form:1,
  639. width:200,
  640. labelSize:'80',
  641. rules:{ required: true, message: ' ', trigger: 'blur' },
  642. data:[],
  643. disabled:false
  644. }, {
  645. index:'6',
  646. span:6,
  647. label: 'fSbu',
  648. name:"开票公司",
  649. form:1,
  650. width:200,
  651. labelSize:'80',
  652. rules:{ required: true, message: ' ', trigger: 'blur' },
  653. data:[],
  654. disabled:false
  655. },
  656. {
  657. index:'7',
  658. span:6,
  659. label: 'fBsdate',
  660. name:"入库日期",
  661. form:3,
  662. width:200,
  663. labelSize:'80',
  664. rules:{ required: true, message: ' ', trigger: 'blur' },
  665. disabled:false
  666. },
  667. {
  668. index:'8',
  669. span:6,
  670. label: 'remark',
  671. name:"备注",
  672. form:4,
  673. width:200,
  674. labelSize:'80',
  675. rules:'',
  676. disabled:false
  677. },
  678. ],
  679. //按钮
  680. customButton:[
  681. {
  682. type:'primary',
  683. size:'mini',
  684. icon:'el-icon-plus',
  685. name:'新单',
  686. disabled:false,
  687. hasPermi:['anpin:stockControl:anPingApply']
  688. },{
  689. type:'success',
  690. size:'mini',
  691. icon:'el-icon-edit',
  692. name:'修改',
  693. res:0,
  694. disabled:true,
  695. hasPermi:['anpin:stockControl:anPingApply']
  696. },{
  697. type:'info',
  698. size:'mini',
  699. icon:'el-icon-plus',
  700. name:'复制新增',
  701. disabled:true,
  702. hasPermi:['anpin:stockControl:generateReceipts']
  703. },
  704. ],
  705. seachButton:[
  706. {
  707. type:'',
  708. size:'mini',
  709. icon:'el-icon-search',
  710. name:'搜索',
  711. disabled:false,
  712. },{
  713. type:'',
  714. size:'mini',
  715. icon:'el-icon-refresh',
  716. name:'重置',
  717. disabled:false,
  718. },{
  719. type:'',
  720. size:'mini',
  721. icon:'el-icon-arrow-up',
  722. name:'展开',
  723. disabled:false
  724. }
  725. ],
  726. detailButton:[
  727. // {
  728. // type:'danger',
  729. // size:'mini',
  730. // icon:'el-icon-refresh-left',
  731. // name:'返回列表',
  732. // disabled:false,
  733. // },
  734. {
  735. type:'primary',
  736. size:'mini',
  737. icon:'el-icon-edit',
  738. name:'录入明细',
  739. disabled:false,
  740. },
  741. {
  742. type:'success',
  743. size:'mini',
  744. icon:'el-icon-check',
  745. name:'保存',
  746. disabled:false
  747. },
  748. {
  749. type:'primary',
  750. size:'mini',
  751. icon:'el-icon-edit',
  752. name:'新单',
  753. nameTwo:'详情页',
  754. plain: true,
  755. disabled:false,
  756. },
  757. {
  758. type:'primary',
  759. size:'mini',
  760. icon:'el-icon-edit',
  761. name:'复制新单',
  762. copyeRow:true,
  763. plain: true,
  764. disabled:false,
  765. },{
  766. type:'info',
  767. size:'mini',
  768. icon:'el-icon-edit',
  769. name:'修改',
  770. disabled:false,
  771. res:1
  772. },{
  773. type:'info',
  774. size:'mini',
  775. icon:'el-icon-edit',
  776. name:'打印',
  777. disabled:false,
  778. res:1
  779. },{
  780. type:'info',
  781. size:'mini',
  782. icon:'el-icon-edit',
  783. name:'入库确认',
  784. disabled:false,
  785. res:1
  786. },
  787. {
  788. type:'warning',
  789. size:'mini',
  790. icon:'el-icon-refresh',
  791. name:'刷新',
  792. disabled:false,
  793. res:1
  794. }
  795. ],
  796. confirmButton:[
  797. {
  798. type:'cyan',
  799. size:'mini',
  800. icon:'',
  801. name:'打印',
  802. disabled:false,
  803. },{
  804. type:'info',
  805. size:'mini',
  806. icon:'',
  807. name:'入库确认',
  808. disabled:false
  809. }
  810. ]
  811. }
  812. },
  813. activated(){
  814. if (this.$route.query.open === 'true'){
  815. // this.detailList.columnList = this.detailStyle
  816. this.detailForm = {}
  817. this.detailData = []
  818. // this.inDex = this.detailOption.length
  819. //从表修改按钮
  820. let data = {
  821. tableName: this.detailList.tableName,
  822. userId: Cookies.get('userName')
  823. }
  824. this.getRow(data,null,1)
  825. for(let li in this.detailList.columnList){
  826. if(!this.detailList.columnList[li].doNot){
  827. this.detailList.columnList[li].disabled = false
  828. }
  829. }
  830. for(let item in this.detailOption){
  831. if(!this.detailOption[item].doNot){
  832. this.detailOption[item].disabled = false
  833. }
  834. }
  835. for(let li in this.detailButton){
  836. this.detailButton[li].disabled = false
  837. }
  838. this.MainTable = true
  839. this.$router.push({ query: {} })
  840. }
  841. },
  842. created() {
  843. let data = {
  844. tableName: this.queryList.tableName,
  845. userId: Cookies.get("userName"),
  846. };
  847. this.getRow(data)
  848. let list = {
  849. fBilltype:'RK'
  850. }
  851. this.query(list)
  852. this.getList()
  853. this.selectMethods()
  854. },
  855. methods:{
  856. //返回列表
  857. goBack(){
  858. },
  859. change(scope){
  860. for(let item in this.detailData){
  861. for(let li in this.listData.fFeeid){
  862. if(this.detailData[item].fFeeid == this.listData.fFeeid[li].value){
  863. this.$set(this.detailData[item],'fFeeunitid',JSON.stringify(this.listData.fFeeid[li].fFeeunitid))
  864. this.$set(this.detailData[item],'fCurrencyName',this.listData.fFeeid[li].fCurrency)
  865. }
  866. }
  867. }
  868. },
  869. //确认打印
  870. Printing(){
  871. this.$print(this.$refs.print)
  872. },
  873. //查询主页列数据
  874. query(data){
  875. listQuery(data).then(res =>{
  876. this.tableData = res.rows
  877. })
  878. },
  879. //更换仓库
  880. changeWarehouse(){
  881. if(this.detailData.length != 0){
  882. for(let li in this.detailData){
  883. this.detailData[li].fWarehouseid = ''
  884. }
  885. }
  886. getArea(this.detailForm.fWarehouseid).then(res=>{
  887. this.listData.fWarehouseid = []
  888. for(let item in res.data){
  889. this.listData.fWarehouseid.push({
  890. label:res.data[item].fWarehouseInformation,
  891. value:res.data[item].id
  892. })
  893. }
  894. })
  895. },
  896. //自动合计金额
  897. totalAmount(){
  898. for(let li in this.detailData){
  899. if(this.detailData[li].fUnitprice && this.detailData[li].fQty){
  900. this.detailData[li].fAmount = (this.detailData[li].fUnitprice * this.detailData[li].fQty).toFixed(2)
  901. }
  902. }
  903. },
  904. //搜索、重置、展开
  905. feedback(res){
  906. if (res == '展开'){
  907. if (this.inDex == 4){
  908. this.inDex = this.formOption.length
  909. }else {
  910. this.inDex = 4
  911. }
  912. }else if (res == '搜索'){
  913. this.handleQuery()
  914. }else if (res == '重置'){
  915. this.resetQuery()
  916. }
  917. },
  918. selectMethods(){
  919. this.mainMethods()
  920. this.detailMethods()
  921. },
  922. //主页面下拉获取名称
  923. mainMethods(){
  924. for(let li in this.formOption){
  925. if(this.formOption[li].name == '仓库'){
  926. let queryParams = { pageNum: 1,}
  927. getwarehouse(queryParams).then(res=>{
  928. for(let item in res.rows){
  929. this.formOption[li].data.push({
  930. label:res.rows[item].fName,
  931. value:res.rows[item].fId
  932. })
  933. }
  934. })
  935. }
  936. else
  937. if(this.formOption[li].name == '供应商'){
  938. let queryParams = { pageNum: 1, fTypeid: 1}
  939. getustomer(queryParams).then(res => {
  940. for(let item in res.data){
  941. this.formOption[li].data.push({
  942. label:res.data[item].fName,
  943. value:res.data[item].fId
  944. })
  945. }
  946. })
  947. }
  948. }
  949. },
  950. //弹窗页获取下拉名称
  951. detailMethods(){
  952. for(let li in this.detailOption){
  953. if(this.detailOption[li].name == '仓库'){
  954. //获取仓库
  955. let queryParams = { pageNum: 1 }
  956. getwarehouse(queryParams).then(res=>{
  957. for(let item in res.rows){
  958. this.detailOption[li].data.push({
  959. label:res.rows[item].fName,
  960. value:res.rows[item].fId
  961. })
  962. }
  963. })
  964. }
  965. if(this.detailOption[li].name == '供应商'){
  966. //获取供应商
  967. let queryParams = { pageNum: 1, fTypeid: 1}
  968. getustomer(queryParams).then(res => {
  969. for(let item in res.data){
  970. this.detailOption[li].data.push({
  971. label:res.data[item].fName,
  972. value:res.data[item].fId
  973. })
  974. }
  975. })
  976. }
  977. if(this.detailOption[li].name == '开票公司'){
  978. //获取付款单位
  979. let queryParams = { pageNum: 1, fTypeid: 2}
  980. getustomer(queryParams).then(res => {
  981. for(let item in res.data){
  982. this.detailOption[li].data.push({
  983. label:res.data[item].fName,
  984. value:res.data[item].fId
  985. })
  986. }
  987. })
  988. }
  989. if(this.detailOption[li].name == '库管员'){
  990. let queryParams = { pageNum: 1,roleName:'库管'}
  991. getWarehousekeeper(queryParams).then(res=>{
  992. for(let item in res.rows){
  993. this.detailOption[li].data.push({
  994. label:res.rows[item].userName,
  995. value:res.rows[item].userId
  996. })
  997. }
  998. })
  999. }
  1000. if(this.detailOption[li].name == '采购人'){
  1001. getliable().then((res) => {
  1002. for(let item in res.rows){
  1003. this.detailOption[li].data.push({
  1004. label:res.rows[item].userName,
  1005. value:res.rows[item].userId
  1006. })
  1007. }
  1008. })
  1009. }
  1010. }
  1011. //获取计量单位字典表
  1012. this.getDicts('data_unitfees').then((response) => {
  1013. if (response.data) {
  1014. for (let item in response.data) {
  1015. this.listData.fFeeunitid.push({
  1016. label: response.data[item].dictLabel,
  1017. value: response.data[item].dictValue
  1018. })
  1019. }
  1020. }
  1021. })
  1022. //获取浮点单位字典表
  1023. this.getDicts('f_floatunit').then((response) => {
  1024. if (response.data) {
  1025. for (let item in response.data) {
  1026. this.listData.fUnits.push({
  1027. label: response.data[item].dictLabel,
  1028. value: JSON.parse(response.data[item].dictValue)
  1029. })
  1030. }
  1031. }
  1032. })
  1033. //获取存储环境字典表
  1034. this.getDicts('f_StorageEnvironment').then((response) => {
  1035. if (response.data) {
  1036. for (let item in response.data) {
  1037. this.listData.fStoreEnv.push({
  1038. label: response.data[item].dictLabel,
  1039. value: JSON.parse(response.data[item].dictValue)
  1040. })
  1041. }
  1042. }
  1043. })
  1044. this.getDicts('f_evidence').then((response) => {
  1045. if (response.data) {
  1046. for (let item in response.data) {
  1047. this.listData.fIsfilles.push({
  1048. label: response.data[item].dictLabel,
  1049. value: JSON.parse(response.data[item].dictValue)
  1050. })
  1051. }
  1052. }
  1053. })
  1054. //获取品名
  1055. let queryParams = { pageNum: 1 }
  1056. getGoodName(queryParams).then(res=>{
  1057. for(let item in res.rows){
  1058. this.listData.fFeeid.push({
  1059. label:res.rows[item].fName,
  1060. value:res.rows[item].fId,
  1061. fFeeunitid: res.rows[item].fFeeunitid,
  1062. fCurrency: res.rows[item].fCurrency
  1063. })
  1064. }
  1065. })
  1066. //付费方式
  1067. this.getDicts('f_paymode').then((response) => {
  1068. if (response.data) {
  1069. for (let item in response.data) {
  1070. this.listData.fStltypeid.push({
  1071. label: response.data[item].dictLabel,
  1072. value: response.data[item].dictValue
  1073. })
  1074. }
  1075. }
  1076. })
  1077. },
  1078. handleQuery(){
  1079. this.$refs.MainForm.hide()
  1080. this.getList();
  1081. },
  1082. resetQuery(){
  1083. this.queryParms = {}
  1084. this.getList();
  1085. },
  1086. //查询列数据
  1087. getRow(data,list,iem) {
  1088. select(data).then((res) => {
  1089. if (data.tableName === '仓库入库详情') {
  1090. if (res.data.length != 0) {
  1091. this.detailList.columnList = res.data.filter((e) => e.checked == 0);
  1092. this.detailList.columnList = res.data;
  1093. this.setRowList = res.data
  1094. this.detailList.columnList = this.detailList.columnList.filter((e) => e.checked == 0);
  1095. // this.waitFor = true
  1096. console.log("000")
  1097. }else {
  1098. // this.waitFor = true
  1099. this.$set(this.detailList,'columnList',this.$options.data().detailStyle)
  1100. this.setRowList = this.$options.data().detailStyle
  1101. }
  1102. this.isItHidden = false
  1103. this.inDex = this.detailOption.length
  1104. if (iem === undefined){
  1105. console.log("111")
  1106. this.detailList.columnList.forEach(item => item.disabled = true)
  1107. }else if(iem == 1){
  1108. for(let li in this.detailList.columnList){
  1109. if(!this.detailList.columnList[li].doNot){
  1110. this.detailList.columnList[li].disabled = false
  1111. }
  1112. }
  1113. }
  1114. }else {
  1115. if (res.data.length != 0) {
  1116. this.queryList.columnList = res.data.filter((e) => e.checked == 0);
  1117. this.queryList.columnList = res.data;
  1118. this.setRowList = res.data
  1119. this.queryList.columnList = this.queryList.columnList.filter((e) => e.checked == 0);
  1120. this.waitFor = true
  1121. }else {
  1122. this.waitFor = true
  1123. this.$set(this.queryList,'columnList',this.$options.data().listStyle)
  1124. this.setRowList = this.$options.data().listStyle
  1125. }
  1126. this.isItHidden = true
  1127. this.inDex = 4
  1128. }
  1129. if(list){
  1130. console.log("333")
  1131. this.detailForm = list.warehouseBills
  1132. this.detailData = list.tWarehousebillsfees
  1133. this.$set(this.detailForm,'fStorekeeper',JSON.parse(this.detailForm.fStorekeeper))
  1134. for(let li in this.detailData){
  1135. this.$set(this.detailData[li],'fFeeunitid',JSON.stringify(this.detailData[li].fFeeunitid))
  1136. this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
  1137. }
  1138. this.detailButton = this.$options.data().detailButton
  1139. for(let li in this.detailButton){
  1140. if(this.detailForm.fBillstatus == '6'){
  1141. if(this.detailButton[li].name == '录入明细' || this.detailButton[li].name == '保存' ||
  1142. this.detailButton[li].name == '入库确认' || this.detailButton[li].name == '刷新' || this.detailButton[li].name == '修改'){
  1143. this.detailButton[li].disabled = true
  1144. }else{
  1145. this.detailButton[li].disabled = false
  1146. }
  1147. } else {
  1148. if (iem === undefined){
  1149. if(this.detailButton[li].name == '录入明细' || this.detailButton[li].name == '保存' ||
  1150. this.detailButton[li].name == '入库确认' || this.detailButton[li].name == '刷新'){
  1151. this.detailButton[li].disabled = true
  1152. }else{
  1153. this.detailButton[li].disabled = false
  1154. }
  1155. }
  1156. }
  1157. }
  1158. }
  1159. });
  1160. },
  1161. //选择框
  1162. selectionbox(selection){
  1163. this.selection = selection
  1164. this.ids = selection.map((item) => item.fId)
  1165. this.single = selection.length !== 1
  1166. for(let li in this.customButton){
  1167. if(this.customButton[li].name == '修改' || this.customButton[li].name == '复制新增'){
  1168. this.customButton[li].disabled = this.single
  1169. }
  1170. }
  1171. },
  1172. //查看
  1173. viewMethod(scope,res,iem){
  1174. // this.detailList.columnList = this.detailStyle
  1175. let fId = ''
  1176. if(scope){
  1177. fId = scope.row.fId
  1178. for(let item in this.detailOption){
  1179. this.detailOption[item].disabled = true
  1180. }
  1181. }else if(res){
  1182. fId = this.copyeId
  1183. this.detailButton.forEach(item => item.disabled = false)
  1184. this.detailList.columnList.forEach(item => {
  1185. if(!item.doNot){
  1186. item.disabled = false
  1187. }
  1188. })
  1189. this.detailOption.forEach(item => {
  1190. if(!item.doNot){
  1191. item.disabled = false
  1192. }
  1193. })
  1194. } else{
  1195. fId = this.ids
  1196. }
  1197. getSave(fId).then(res=>{
  1198. if(res.code == 200){
  1199. let data = {
  1200. tableName: this.detailList.tableName,
  1201. userId: Cookies.get('userName')
  1202. }
  1203. let list ={
  1204. warehouseBills:res.data.warehouseBills,
  1205. tWarehousebillsfees:res.data.tWarehousebillsfees
  1206. }
  1207. this.getRow(data,list,iem)
  1208. }
  1209. if(res.data.warehouseBills){
  1210. getArea(res.data.warehouseBills.fWarehouseid).then(res=>{
  1211. if(res.code == 200){
  1212. this.listData.fWarehouseid = []
  1213. for(let item in res.data){
  1214. this.listData.fWarehouseid.push({
  1215. label:res.data[item].fWarehouseInformation,
  1216. value:res.data[item].id
  1217. })
  1218. }
  1219. }
  1220. })
  1221. }
  1222. this.MainTable = true
  1223. this.inDex = this.detailOption.length
  1224. })
  1225. },
  1226. //修改
  1227. modification(scope){
  1228. },
  1229. //删除
  1230. deletion(scope){
  1231. const fIds = scope.row.fId || this.ids;
  1232. let tips = "";
  1233. deletMain(fIds).then(res=>{
  1234. switch (res.msg) {
  1235. case "0": {
  1236. this.$message.error("当前数据已被其他操作员操作,请刷新页面");
  1237. break;
  1238. }
  1239. case "1": {
  1240. tips = "当前主表有数据,确认是否删除?";
  1241. this.delete_s(fIds, tips);
  1242. break;
  1243. }
  1244. case "2": {
  1245. tips = "当前主表有数据,从表有数据,确认是否删除?";
  1246. this.delete_s(fIds, tips);
  1247. break;
  1248. }
  1249. default: {
  1250. return this.$message.error("未知错误,无状态");
  1251. }
  1252. }
  1253. })
  1254. },
  1255. delete_s(fIds, tips) {
  1256. this.$confirm(tips, "警告", {
  1257. confirmButtonText: "确定",
  1258. cancelButtonText: "取消",
  1259. type: "warning",
  1260. })
  1261. .then(function () {
  1262. return delFee(fIds);
  1263. })
  1264. .then(() => {
  1265. this.getList();
  1266. this.msgSuccess("删除成功");
  1267. });
  1268. },
  1269. //删除从表行
  1270. deletRows(index,rows){
  1271. if(rows[index].fId){
  1272. let formData = {
  1273. fId:this.detailForm.fId,
  1274. fDateChanged:this.detailForm.fDateChanged
  1275. }
  1276. canBedelet(formData).then(res=>{
  1277. return delRows(rows[index].fId)
  1278. })
  1279. .then(()=>{
  1280. getSave(this.detailForm.fId).then(res=>{
  1281. if(res.code == 200){
  1282. if(res.data.warehouseBills){
  1283. this.detailForm = res.data.warehouseBills
  1284. this.$set(this.detailForm,'fStorekeeper',JSON.parse(this.detailForm.fStorekeeper))
  1285. }
  1286. if(res.data.tWarehousebillsfees){
  1287. this.detailData = res.data.tWarehousebillsfees
  1288. for(let li in this.detailData){
  1289. this.$set(this.detailData[li],'fFeeunitid',JSON.stringify(this.detailData[li].fFeeunitid))
  1290. this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
  1291. }
  1292. }
  1293. this.msgSuccess("删除成功");
  1294. }
  1295. })
  1296. })
  1297. .catch(res=>{
  1298. this.$message.error(res)
  1299. })
  1300. }else {
  1301. rows.splice(index, 1)
  1302. }
  1303. },
  1304. //必填项新行
  1305. verificationRules(valid){
  1306. if(valid){
  1307. this.detailData.push({
  1308. serialNumber:null,
  1309. fFeeid:null,
  1310. fUnitprice:null,
  1311. fQty:null,
  1312. fFeeunitid:null,
  1313. fWarehouseid:null,
  1314. fAmount:null,
  1315. fStltypeid:'1',
  1316. tProductdate:null,
  1317. fLotno:null,
  1318. fValid:null,
  1319. fUnits:null,
  1320. fStoreEnv:null,
  1321. fIsfilles:0,
  1322. remark:null,
  1323. fReviewDate:null,
  1324. createBy:null,
  1325. })
  1326. }
  1327. },
  1328. //返回列表是否保存
  1329. backRules(){
  1330. for(let li in this.detailOption) {
  1331. if(this.detailOption[li].name == '供应商'){
  1332. if(this.detailOption[li].disabled == true){
  1333. this.inDex = 4
  1334. this.getList();
  1335. this.isItHidden = true
  1336. this.MainTable = false
  1337. } else {
  1338. this.$confirm("返回列表,是否保存?", "提示", {
  1339. confirmButtonText: "保存",
  1340. cancelButtonText: "取消",
  1341. type: "warning",
  1342. }).then(() => {
  1343. this.$refs.detailForm.saveRules('1')
  1344. }).catch(() => {
  1345. this.inDex = 4
  1346. this.isItHidden = true
  1347. this.MainTable = false
  1348. this.getList();
  1349. });
  1350. }
  1351. }
  1352. }
  1353. },
  1354. backSave(valid,i){
  1355. if(valid){
  1356. if(this.detailForm.fBillstatus < 4 || !this.detailForm.fBillstatus){
  1357. this.detailForm.fMoney = 0
  1358. for(let li in this.detailData){
  1359. if(this.detailData[li]){
  1360. this.detailForm.fMoney += Number(this.detailData[li].fAmount)
  1361. }
  1362. }
  1363. let formData = new window.FormData();
  1364. formData.append('tWarehousebills', JSON.stringify(this.detailForm))
  1365. formData.append('tWarehousebillsfees', JSON.stringify(this.detailData))
  1366. formData.append('fBilltype', 'RK')
  1367. addSave(formData).then(res=> {
  1368. if (res.code == 200) {
  1369. this.detailForm = res.data.warehouseBills
  1370. this.$set(this.detailForm, 'fStorekeeper', JSON.parse(this.detailForm.fStorekeeper))
  1371. this.detailData = res.data.tWarehousebillsCntrs
  1372. for (let li in this.detailData) {
  1373. this.$set(this.detailData[li], 'fFeeunitid', JSON.stringify(this.detailData[li].fFeeunitid))
  1374. this.$set(this.detailData[li], 'fStltypeid', JSON.stringify(this.detailData[li].fStltypeid))
  1375. }
  1376. this.getList();
  1377. if(i == 2){
  1378. let data ={
  1379. fBilltype:'RK',
  1380. fId:this.detailForm.fId
  1381. }
  1382. copyNew(data).then(res=>{
  1383. if(res.code == 200) {
  1384. this.$message.success("操作成功")
  1385. this.copyeId = res.data
  1386. this.getList()
  1387. this.viewMethod(null,1,2)
  1388. }
  1389. })
  1390. }else{
  1391. this.$message.success("保存成功")
  1392. }
  1393. }
  1394. })
  1395. } else if(i == 2 && this.detailForm.fBillstatus > 3 ){
  1396. let data = {
  1397. fBilltype:'RK',
  1398. fId:this.detailForm.fId
  1399. }
  1400. copyNew(data).then(res=>{
  1401. if(res.code == 200) {
  1402. this.$message.success("操作成功")
  1403. this.copyeId = res.data
  1404. this.getList()
  1405. this.viewMethod(null,1,2)
  1406. }
  1407. })
  1408. }
  1409. if(i == 1){
  1410. this.isItHidden = true
  1411. this.MainTable = false
  1412. this.inDex = 4
  1413. }
  1414. }
  1415. },
  1416. //所以按钮
  1417. buttonList(row){
  1418. switch (row.name) {
  1419. case '新单':
  1420. if(row.nameTwo == '详情页'){
  1421. if(this.detailForm.fId){
  1422. this.detailList.columnList = this.detailStyle
  1423. this.detailForm = {}
  1424. this.detailData = []
  1425. this.inDex = this.detailOption.length
  1426. //从表修改按钮
  1427. for(let li in this.detailStyle){
  1428. if(!this.detailStyle[li].doNot){
  1429. this.detailStyle[li].disabled = false
  1430. }
  1431. }
  1432. for(let item in this.detailOption){
  1433. if(!this.detailOption[item].doNot){
  1434. this.detailOption[item].disabled = false
  1435. }
  1436. }
  1437. for(let li in this.detailButton){
  1438. this.detailButton[li].disabled = false
  1439. }
  1440. this.MainTable = true
  1441. }else{
  1442. this.$message.error("当前数据为保存,请保存")
  1443. }
  1444. }else{
  1445. this.detailList.columnList = this.detailStyle
  1446. this.detailForm = {}
  1447. this.detailData = []
  1448. this.inDex = this.detailOption.length
  1449. //从表修改按钮
  1450. for(let li in this.detailStyle){
  1451. if(!this.detailStyle[li].doNot){
  1452. this.detailStyle[li].disabled = false
  1453. }
  1454. }
  1455. for(let item in this.detailOption){
  1456. if(!this.detailOption[item].doNot){
  1457. this.detailOption[item].disabled = false
  1458. }
  1459. }
  1460. for(let li in this.detailButton){
  1461. this.detailButton[li].disabled = false
  1462. }
  1463. this.MainTable = true
  1464. }
  1465. break
  1466. case '录入明细':
  1467. this.$refs.detailForm.rules()
  1468. break
  1469. case '返回列表':
  1470. this.backRules()
  1471. break
  1472. case '保存':
  1473. this.$refs.detailForm.saveRules()
  1474. break
  1475. case '入库确认':
  1476. if(this.detailData.length == 0){
  1477. this.$message.error("请维护明细")
  1478. }else{
  1479. for(let item in this.detailData) {
  1480. let num = Number(item) + 1
  1481. if (!this.detailData[item].fFeeid) {
  1482. this.$message.error("请维护第" + num + "行品名")
  1483. return false
  1484. }
  1485. if (!this.detailData[item].fCurrencyName) {
  1486. this.$message.error("请维护第" + num + "行规格")
  1487. return false
  1488. }
  1489. if (!this.detailData[item].fUnitprice) {
  1490. this.$message.error("请维护第" + num + "行单价")
  1491. return false
  1492. }
  1493. if(!this.detailData[item].fQty){
  1494. this.$message.error("请维护第" + num + "数量")
  1495. return false
  1496. }
  1497. if (!this.detailData[item].fFeeunitid) {
  1498. this.$message.error("请维护第" + num + "行计量单位")
  1499. return false
  1500. }
  1501. if (!this.detailData[item].fWarehouseid) {
  1502. this.$message.error("请维护第" + num + "行库区")
  1503. return false
  1504. }
  1505. if (!this.detailData[item].fAmount) {
  1506. this.$message.error("请维护第" + num + "行金额")
  1507. return false
  1508. }
  1509. }
  1510. this.detailForm.fMoney = 0
  1511. for(let li in this.detailData){
  1512. if(this.detailData[li]){
  1513. this.detailForm.fMoney += Number(this.detailData[li].fAmount)
  1514. }
  1515. }
  1516. let formData = new window.FormData();
  1517. formData.append('tWarehousebills', JSON.stringify(this.detailForm))
  1518. formData.append('tWarehousebillsfees', JSON.stringify(this.detailData))
  1519. formData.append('fBilltype', 'RK')
  1520. addWarehous(formData).then(res=>{
  1521. if(res.data.warehouseBills){
  1522. this.detailForm = res.data.warehouseBills
  1523. this.$set(this.detailForm,'fStorekeeper',JSON.parse(this.detailForm.fStorekeeper))
  1524. }
  1525. if(res.data.tWarehousebillsCntrs){
  1526. this.detailData = res.data.tWarehousebillsCntrs
  1527. for(let li in this.detailData){
  1528. this.$set(this.detailData[li],'fFeeunitid',JSON.stringify(this.detailData[li].fFeeunitid))
  1529. this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
  1530. }
  1531. }
  1532. this.$message.success("操作成功")
  1533. for(let li in this.detailList.columnList){
  1534. this.detailList.columnList[li].disabled = true
  1535. }
  1536. for(let item in this.detailOption){
  1537. this.detailOption[item].disabled = true
  1538. }
  1539. for(let li in this.detailButton) {
  1540. if(this.detailButton[li].name == '录入明细' || this.detailButton[li].name == '保存' ||
  1541. this.detailButton[li].name == '入库确认' || this.detailButton[li].name == '刷新' || this.detailButton[li].name == '修改'){
  1542. this.detailButton[li].disabled = true
  1543. }else{
  1544. this.detailButton[li].disabled = false
  1545. }
  1546. }
  1547. })
  1548. }
  1549. break
  1550. case '刷新':
  1551. if(this.detailForm.fId){
  1552. getSave(this.detailForm.fId).then(res=>{
  1553. if(res.data.warehouseBills){
  1554. this.detailForm = res.data.warehouseBills
  1555. this.$set(this.detailForm,'fStorekeeper',JSON.parse(this.detailForm.fStorekeeper))
  1556. }
  1557. if(res.data.tWarehousebillsfees){
  1558. this.detailData = res.data.tWarehousebillsfees
  1559. for(let li in this.detailData){
  1560. this.$set(this.detailData[li],'fFeeunitid',JSON.stringify(this.detailData[li].fFeeunitid))
  1561. this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
  1562. }
  1563. }
  1564. })
  1565. }
  1566. break
  1567. case '复制新增':
  1568. let formDate = {
  1569. fBilltype:'RK',
  1570. fId:this.selection[0].fId
  1571. }
  1572. copyNew(formDate).then(res=>{
  1573. if(res.code == 200) {
  1574. this.$message.success("操作成功")
  1575. this.copyeId = res.data
  1576. this.getList()
  1577. this.viewMethod(null,1)
  1578. }
  1579. })
  1580. break
  1581. case '复制新单':
  1582. this.$refs.detailForm.saveRules('2')
  1583. break
  1584. case '打印':
  1585. this.formList = this.detailForm
  1586. this.dialogVisible = true
  1587. break
  1588. }
  1589. if(row.name == '修改' && row.res == '0'){
  1590. this.viewMethod()
  1591. }
  1592. if(row.res === 1){
  1593. //从表修改按钮
  1594. for(let li in this.detailList.columnList){
  1595. if(!this.detailList.columnList[li].doNot){
  1596. this.detailList.columnList[li].disabled = false
  1597. }
  1598. }
  1599. for(let item in this.detailOption){
  1600. if(!this.detailOption[item].doNot){
  1601. this.detailOption[item].disabled = false
  1602. }
  1603. }
  1604. for(let li in this.detailButton){
  1605. this.detailButton[li].disabled = false
  1606. }
  1607. }
  1608. },
  1609. // 显示搜索条件、点击后会调用此方法
  1610. showSearch(){
  1611. this.getList()
  1612. },
  1613. //点击刷新会调用此方法
  1614. getList(res){
  1615. this.queryParms.fBilltype = 'RK'
  1616. listInStock(this.queryParms).then(response=>{
  1617. this.tableData = response.rows
  1618. this.total = response.total
  1619. if(res == 1){
  1620. this.copyeId = this.tableData[0].fId
  1621. this.viewMethod(null,1)
  1622. }
  1623. })
  1624. },
  1625. }
  1626. }
  1627. </script>
  1628. <style scoped lang="scss">
  1629. .app-container ::v-deep .el-form-item {
  1630. margin-bottom: 4px;
  1631. }
  1632. .app-container ::v-deep .el-table__body-wrapper{
  1633. z-index: 2;
  1634. }
  1635. </style>