index.vue 46 KB

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