index.vue 57 KB

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