index.vue 63 KB

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