index.vue 71 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397
  1. <template>
  2. <div>
  3. <div v-if="pageDisplay" class="app-container">
  4. <formComponent
  5. v-if="searchWhether"
  6. :formOption="formOption"
  7. :dataList="dataList"
  8. :inDex="inDex"
  9. ref="avatar"
  10. @submitForm="submitForm"
  11. @returnToForm="returnToForm"
  12. />
  13. <listComponent
  14. :tableData="tableData"
  15. @selectionbox="selectionbox"
  16. @see="viewMethod"
  17. @modify="modification"
  18. @deletion="deletion"
  19. @buttonList="buttonList"
  20. @showSearch="showSearch"
  21. @feedback="feedback"
  22. @getList="getList"
  23. :hasPermi="hasPermi"
  24. :isItHidden="isItHidden"
  25. :customButton="customButton"
  26. :listStyle="listStyle"
  27. :queryList="queryList"
  28. :setRowList="setRowList"
  29. :tatolLabel="tatolLabel"
  30. />
  31. <!-- <el-pagination-->
  32. <!-- style="float: right;margin-top: 10px"-->
  33. <!-- @size-change="handleSizeChange"-->
  34. <!-- @current-change="handleCurrentChange"-->
  35. <!-- :page-sizes="[10, 20, 30, 50]"-->
  36. <!-- :page-size="this.formDataList.pageSize"-->
  37. <!-- background-->
  38. <!-- layout="sizes, prev, pager, next"-->
  39. <!-- :total="total"-->
  40. <!-- >-->
  41. <!-- </el-pagination>-->
  42. <div style="float: right; margin-bottom: 10px">
  43. <pagination
  44. v-show="total > 0"
  45. :total="total"
  46. :page.sync="formDataList.pageNum"
  47. :limit.sync="formDataList.pageSize"
  48. @pagination="feedback('搜索')"
  49. :page-sizes="[10, 100, 200, 500, 1000]"
  50. />
  51. </div>
  52. </div>
  53. <div v-else class="app-container">
  54. <div style="display: flex; margin-bottom: 10px">
  55. <el-breadcrumb>
  56. <el-breadcrumb-item style="margin-top: -7px">
  57. <el-button
  58. style="margin-left: 10px"
  59. size="mini"
  60. type="danger"
  61. plain
  62. @click="backToList"
  63. icon="el-icon-arrow-left"
  64. >
  65. 返回列表
  66. </el-button>
  67. </el-breadcrumb-item>
  68. </el-breadcrumb>
  69. </div>
  70. <h1 style="text-align: center; margin-top: -42px">销售出库单</h1>
  71. <formComponent
  72. v-if="searchWhether"
  73. :formOption="contentOption"
  74. :dataList="dataList"
  75. :inDex="inDex"
  76. ref="avatar"
  77. @writeOff="writeOff"
  78. @submitForm="submitForm"
  79. @returnToForm="returnToForm"
  80. @submitAndSave="submitAndSave"
  81. @selectTrigger="selectTrigger"
  82. />
  83. <listComponent
  84. ref="listComponent"
  85. :tableData="contentList"
  86. @selectionbox="selectionbox"
  87. @see="viewMethod"
  88. @modify="modification"
  89. @deletion="deletion"
  90. @buttonList="buttonList"
  91. @showSearch="showSearch"
  92. @feedback="feedback"
  93. @getList="getList"
  94. @deletRows="deletRows"
  95. @totalAmount="totalAmount"
  96. @change="change"
  97. :tatolLabel="tatolLabel"
  98. :isItHidden="isItHidden"
  99. :hasPermi="hasPermi"
  100. :customButton="contentButton"
  101. :listStyle="contentStyle"
  102. :queryList="purchaseList"
  103. :setRowList="setRowList"
  104. :listData="listData"
  105. />
  106. </div>
  107. <add-or-update
  108. v-if="addOrUpdateVisible"
  109. ref="addOrUpdate"
  110. @refreshDataList="getDataList"
  111. ></add-or-update>
  112. <approval-comments
  113. v-if="addOrUpdateVisib"
  114. ref="ApprovalComments"
  115. @refreshDataList="returnData"
  116. ></approval-comments>
  117. <div class="print_div">
  118. <el-dialog
  119. :visible.sync="dialogVisible"
  120. :fullscreen="true"
  121. width="70%"
  122. style="background-color: #1c84c6"
  123. >
  124. <div ref="print" style="color: #000000">
  125. <div v-if="formList.fsbuName === '青岛安品餐饮服务有限公司'">
  126. <h1 style="text-align: center; font-weight: bold">
  127. {{ formList.fsbuName }}
  128. </h1>
  129. <div
  130. style="
  131. display: flex;
  132. justify-content: space-between;
  133. margin-bottom: 10px;
  134. "
  135. >
  136. <div style="width: 250px; height: 20px; font-size: 14px">
  137. 客户项目:{{ projectName }}
  138. </div>
  139. <div style="width: 200px; height: 20px; font-size: 14px">
  140. 销售出库单
  141. </div>
  142. <div style="width: 250px; height: 20px; font-size: 14px">
  143. 出库日期:{{ formList.fBsdate }}
  144. </div>
  145. </div>
  146. <div
  147. style="
  148. display: flex;
  149. justify-content: space-between;
  150. margin-bottom: 10px;
  151. "
  152. >
  153. <div style="width: 250px; height: 20px; font-size: 14px">
  154. 公司电话:{{ formList.fsbuTel }}
  155. </div>
  156. <div style="width: 250px; height: 20px; font-size: 14px">
  157. 编号:{{ formList.corpsNo
  158. }}{{
  159. formList.fBillno
  160. ? formList.fBillno.substring(2)
  161. : formList.fBillno
  162. }}
  163. </div>
  164. </div>
  165. </div>
  166. <div v-else-if="formList.fsbuName === '青岛安品餐饮管理有限公司'">
  167. <h1 style="text-align: center; font-weight: bold">
  168. {{ formList.fsbuName }}-出库单
  169. </h1>
  170. <div
  171. style="
  172. display: flex;
  173. justify-content: space-between;
  174. margin-bottom: 10px;
  175. "
  176. >
  177. <div style="width: 250px; height: 20px; font-size: 14px">
  178. 客户项目:{{ projectName }}
  179. </div>
  180. <!-- <div style="width: 200px;height: 20px;font-size: 14px;">销售出库单</div>-->
  181. <div style="width: 250px; height: 20px; font-size: 14px">
  182. 出库日期:{{ formList.fBsdate }}
  183. </div>
  184. </div>
  185. <div
  186. style="
  187. display: flex;
  188. justify-content: space-between;
  189. margin-bottom: 10px;
  190. "
  191. >
  192. <div style="width: 250px; height: 20px; font-size: 14px">
  193. 公司电话:{{ formList.fsbuTel }}
  194. </div>
  195. <div style="width: 250px; height: 20px; font-size: 14px">
  196. 编号:{{ formList.corpsNo
  197. }}{{
  198. formList.fBillno
  199. ? formList.fBillno.substring(2)
  200. : formList.fBillno
  201. }}
  202. </div>
  203. </div>
  204. </div>
  205. <div v-else-if="formList.fsbuName === '青岛弘益祥粮油有限公司'">
  206. <h1 style="text-align: center; font-weight: bold">
  207. {{ formList.fsbuName }}
  208. </h1>
  209. <div
  210. style="
  211. display: flex;
  212. justify-content: space-between;
  213. margin-bottom: 10px;
  214. "
  215. >
  216. <div style="width: 250px; height: 20px; font-size: 14px">
  217. 公司电话:{{ formList.fsbuTel }}
  218. </div>
  219. <div style="width: 200px; height: 20px; font-size: 14px">
  220. 销售单
  221. </div>
  222. <div style="width: 250px; height: 20px; font-size: 14px">
  223. 出库日期:{{ formList.fBsdate }}
  224. </div>
  225. </div>
  226. <div
  227. style="
  228. display: flex;
  229. justify-content: space-between;
  230. margin-bottom: 10px;
  231. "
  232. >
  233. <div style="width: 250px; height: 20px; font-size: 14px">
  234. 客户项目:{{ projectName }}
  235. </div>
  236. <div style="width: 250px; height: 20px; font-size: 14px">
  237. 编号:{{ formList.corpsNo
  238. }}{{
  239. formList.fBillno
  240. ? formList.fBillno.substring(2)
  241. : formList.fBillno
  242. }}
  243. </div>
  244. </div>
  245. </div>
  246. <div v-else-if="formList.fsbuName === '青岛锦圣康海产品有限公司'">
  247. <h1 style="text-align: center; font-weight: bold">
  248. {{ formList.fsbuName }}-销售单
  249. </h1>
  250. <div
  251. style="
  252. display: flex;
  253. justify-content: space-between;
  254. margin-bottom: 10px;
  255. "
  256. >
  257. <div style="width: 250px; height: 20px; font-size: 14px">
  258. 编号:{{ formList.corpsNo
  259. }}{{
  260. formList.fBillno
  261. ? formList.fBillno.substring(2)
  262. : formList.fBillno
  263. }}
  264. </div>
  265. <!-- <div style="width: 200px;height: 20px;font-size: 14px;">销售出库单</div>-->
  266. <div style="width: 250px; height: 20px; font-size: 14px">
  267. 公司电话:{{ formList.fsbuTel }}
  268. </div>
  269. </div>
  270. <div
  271. style="
  272. display: flex;
  273. justify-content: space-between;
  274. margin-bottom: 10px;
  275. "
  276. >
  277. <div style="width: 250px; height: 20px; font-size: 14px">
  278. 出库日期:{{ formList.fBsdate }}
  279. </div>
  280. <div style="width: 250px; height: 20px; font-size: 14px">
  281. 客户项目:{{ projectName }}
  282. </div>
  283. </div>
  284. </div>
  285. <div v-else-if="formList.fsbuName === '青岛盛元嘉蔬菜配送有限公司'">
  286. <h1 style="text-align: center; font-weight: bold">
  287. 销售出库-{{ formList.fsbuName }}
  288. </h1>
  289. <div
  290. style="
  291. display: flex;
  292. justify-content: space-between;
  293. margin-bottom: 10px;
  294. "
  295. >
  296. <div style="width: 250px; height: 20px; font-size: 14px">
  297. 客户项目:{{ projectName }}
  298. </div>
  299. <!-- <div style="width: 200px;height: 20px;font-size: 14px;">销售出库单</div>-->
  300. <div style="width: 250px; height: 20px; font-size: 14px">
  301. 编号:{{ formList.corpsNo
  302. }}{{
  303. formList.fBillno
  304. ? formList.fBillno.substring(2)
  305. : formList.fBillno
  306. }}
  307. </div>
  308. </div>
  309. <div
  310. style="
  311. display: flex;
  312. justify-content: space-between;
  313. margin-bottom: 10px;
  314. "
  315. >
  316. <div style="width: 250px; height: 20px; font-size: 14px">
  317. 出库日期:{{ formList.fBsdate }}
  318. </div>
  319. <div style="width: 250px; height: 20px; font-size: 14px">
  320. 公司电话:{{ formList.fsbuTel }}
  321. </div>
  322. </div>
  323. </div>
  324. <div v-else-if="formList.fsbuName === '青岛优利安肉食有限公司'">
  325. <h1 style="text-align: center; font-weight: bold">
  326. 销售单 {{ formList.fsbuName }}
  327. </h1>
  328. <div
  329. style="
  330. display: flex;
  331. justify-content: space-between;
  332. margin-bottom: 10px;
  333. "
  334. >
  335. <div style="width: 250px; height: 20px; font-size: 14px">
  336. 编号:{{ formList.corpsNo
  337. }}{{
  338. formList.fBillno
  339. ? formList.fBillno.substring(2)
  340. : formList.fBillno
  341. }}
  342. </div>
  343. <!-- <div style="width: 200px;height: 20px;font-size: 14px;">销售出库单</div>-->
  344. <div style="width: 250px; height: 20px; font-size: 14px">
  345. 客户项目:{{ projectName }}
  346. </div>
  347. </div>
  348. <div
  349. style="
  350. display: flex;
  351. justify-content: space-between;
  352. margin-bottom: 10px;
  353. "
  354. >
  355. <div style="width: 250px; height: 20px; font-size: 14px">
  356. 出库日期:{{ formList.fBsdate }}
  357. </div>
  358. <div style="width: 250px; height: 20px; font-size: 14px">
  359. 公司电话:{{ formList.fsbuTel }}
  360. </div>
  361. </div>
  362. </div>
  363. <div v-else>
  364. <h1 style="text-align: center; font-weight: bold">
  365. {{ formList.fsbuName }}
  366. </h1>
  367. <div
  368. style="
  369. display: flex;
  370. justify-content: space-between;
  371. margin-bottom: 10px;
  372. "
  373. >
  374. <div style="width: 250px; height: 20px; font-size: 14px">
  375. 客户项目:{{ projectName }}
  376. </div>
  377. <div style="width: 200px; height: 20px; font-size: 14px">
  378. 销售出库单
  379. </div>
  380. <div style="width: 250px; height: 20px; font-size: 14px">
  381. 出库日期:{{ formList.fBsdate }}
  382. </div>
  383. </div>
  384. <div
  385. style="
  386. display: flex;
  387. justify-content: space-between;
  388. margin-bottom: 10px;
  389. "
  390. >
  391. <div style="width: 250px; height: 20px; font-size: 14px">
  392. 公司电话:{{ formList.fsbuTel }}
  393. </div>
  394. <div style="width: 250px; height: 20px; font-size: 14px">
  395. 编号:{{ formList.corpsNo
  396. }}{{
  397. formList.fBillno
  398. ? formList.fBillno.substring(2)
  399. : formList.fBillno
  400. }}
  401. </div>
  402. </div>
  403. </div>
  404. <table
  405. class="table table-striped table-bordered"
  406. align="center"
  407. valign="center"
  408. >
  409. <tr>
  410. <td class="column" style="width: 8%">行号</td>
  411. <td class="column" style="width: 20%">物料名称</td>
  412. <td class="column" style="width: 10%">规格型号</td>
  413. <td class="column" style="width: 8%">单位</td>
  414. <td class="column" style="width: 10%">数量</td>
  415. <td class="column" style="width: 10%">单价</td>
  416. <td class="column" style="width: 10%">金额</td>
  417. <td class="column" style="width: 10%">备注</td>
  418. </tr>
  419. <tr v-for="(item, index) in contentList" :key="index">
  420. <td class="column">{{ index + 1 }}</td>
  421. <td class="column">{{ item.feeName }}</td>
  422. <td class="column">{{ item.fCurrencyName }}</td>
  423. <td class="column">{{ item.fFeeunitName }}</td>
  424. <td class="column">{{ item.fQty }}</td>
  425. <td class="column">
  426. {{
  427. item.fUnitprice
  428. ? parseFloat(item.fUnitprice).toFixed(2)
  429. : item.fUnitprice
  430. }}
  431. </td>
  432. <td class="column">
  433. {{
  434. item.fAmount
  435. ? parseFloat(item.fAmount).toFixed(2)
  436. : item.fAmount
  437. }}
  438. </td>
  439. <td class="column">{{ item.remark }}</td>
  440. </tr>
  441. <!-- <tr>-->
  442. <!-- <td class="column" colspan="2">大写金额:</td>-->
  443. <!-- <td class="column" colspan="2" style="text-align: left">100亿元</td>-->
  444. <!-- <td class="column">总金额:</td>-->
  445. <!-- <td class="column" colspan="3">{{formList.fMoney}}</td>-->
  446. <!-- </tr>-->
  447. </table>
  448. <table
  449. class="table table-striped table-bordered"
  450. align="center"
  451. valign="center"
  452. >
  453. <tr>
  454. <td
  455. class="column"
  456. colspan="2"
  457. style="border-top: none; width: 15%"
  458. >
  459. 大写总金额:
  460. </td>
  461. <td
  462. class="column"
  463. colspan="2"
  464. style="text-align: left; border-top: none; width: 40%"
  465. >
  466. {{ chineseStr }}
  467. </td>
  468. <td class="column" style="border-top: none; width: 15%">
  469. 小写总金额:
  470. </td>
  471. <td
  472. class="column"
  473. colspan="3"
  474. style="border-top: none; text-align: left; width: 30%"
  475. >
  476. {{
  477. formList.fMoney
  478. ? parseFloat(formList.fMoney).toFixed(2)
  479. : formList.fMoney
  480. }}
  481. </td>
  482. </tr>
  483. </table>
  484. <div
  485. style="
  486. display: flex;
  487. justify-content: space-between;
  488. margin-top: 20px;
  489. "
  490. >
  491. <div style="width: 200px; height: 20px; font-size: 14px">
  492. 发货人:{{ formList.manage }}
  493. </div>
  494. <div style="width: 200px; height: 20px; font-size: 14px">
  495. 收货:
  496. </div>
  497. </div>
  498. </div>
  499. <span slot="footer" class="dialog-footer">
  500. <el-button @click="dialogVisible = false">取 消</el-button>
  501. <el-button type="primary" @click="Printing">打印</el-button>
  502. </span>
  503. </el-dialog>
  504. </div>
  505. </div>
  506. </template>
  507. <script>
  508. import { select } from "@/api/system/set";
  509. import {
  510. listQuery,
  511. submit,
  512. viewSingle,
  513. deleteQuery,
  514. productName,
  515. queryItem,
  516. company,
  517. warehouse,
  518. listDelete,
  519. tableDeleteQuery,
  520. exportDetail,
  521. confirmDeletion,
  522. pleaseCheck,
  523. revoke,
  524. queryUserVal,
  525. getName,
  526. revokeBill,
  527. copyNew,
  528. printingTiem,
  529. getExport,
  530. } from "@/api/purchaseIssue/index";
  531. import Cookies from "js-cookie";
  532. import Global from "@/layout/components/global";
  533. import moment from "moment";
  534. export default {
  535. name: "index",
  536. data() {
  537. return {
  538. form: {},
  539. before: "",
  540. hasPermi: {
  541. lookup: ["anpin:stockControl:query"],
  542. disappear: ["anpin:stockControl:remove"],
  543. },
  544. addOrUpdateVisib: false,
  545. addOrUpdateVisible: false,
  546. chineseStr: 0,
  547. total: 0,
  548. formDataList: {
  549. fBilltype: "XS",
  550. pageSize: 10,
  551. pageNum: 1,
  552. },
  553. formList: {},
  554. tatolLabel: ["金额"],
  555. dialogVisible: false,
  556. listData: {
  557. fFeeid: [],
  558. fFeeunitid: [],
  559. fStltypeid: [],
  560. },
  561. setTimeout: "",
  562. searchWhether: true,
  563. pageDisplay: true,
  564. projectName: "",
  565. dataList: {
  566. fGoodsid: [],
  567. fSbu: [],
  568. fWarehouseid: [],
  569. fCorpid: [],
  570. fMarketTypid: [],
  571. fFeeid: [],
  572. },
  573. contentList: [],
  574. inDex: 4,
  575. tableData: [],
  576. selection: [],
  577. tableList: [],
  578. isItHidden: true,
  579. listStyle: [
  580. {
  581. surface: "1",
  582. label: "serialNumber",
  583. name: "序号",
  584. checked: 0,
  585. width: 100,
  586. onabort: "",
  587. },
  588. {
  589. surface: "2",
  590. label: "fBillno",
  591. name: "系统编号",
  592. checked: 0,
  593. width: 100,
  594. onabort: "",
  595. },
  596. {
  597. surface: "3",
  598. label: "projectName",
  599. name: "项目名称",
  600. checked: 0,
  601. width: 100,
  602. onabort: "",
  603. },
  604. {
  605. surface: "4",
  606. label: "corpName",
  607. name: "客户名称",
  608. checked: 0,
  609. width: 100,
  610. onabort: "",
  611. },
  612. {
  613. surface: "5",
  614. label: "fMoney",
  615. name: "金额",
  616. checked: 0,
  617. width: 100,
  618. onabort: "",
  619. },
  620. {
  621. surface: "6",
  622. label: "fCurrencyName",
  623. name: "规格型号",
  624. checked: 0,
  625. width: 100,
  626. onabort: "",
  627. },
  628. {
  629. surface: "7",
  630. label: "createTime",
  631. name: "制单日期",
  632. checked: 0,
  633. width: 100,
  634. onabort: "",
  635. },
  636. {
  637. surface: "8",
  638. label: "createBy",
  639. name: "申请人",
  640. checked: 0,
  641. width: 100,
  642. onabort: "",
  643. },
  644. {
  645. surface: "9",
  646. label: "fBillstatusName",
  647. name: "状态",
  648. checked: 0,
  649. width: 100,
  650. onabort: "",
  651. },
  652. {
  653. surface: "10",
  654. label: "fReviewDate",
  655. name: "审核日期",
  656. checked: 0,
  657. width: 100,
  658. onabort: "",
  659. },
  660. {
  661. surface: "11",
  662. label: "fBsdate",
  663. name: "出库日期",
  664. checked: 0,
  665. width: 100,
  666. onabort: "",
  667. },
  668. {
  669. surface: "12",
  670. label: "remark",
  671. name: "备注",
  672. checked: 0,
  673. width: 100,
  674. onabort: "",
  675. },
  676. {
  677. surface: "13",
  678. label: "fPrintLog",
  679. name: "打印日志",
  680. checked: 0,
  681. width: 100,
  682. onabort: "",
  683. },
  684. {
  685. surface: "14",
  686. label: "fsbuName",
  687. name: "开票公司",
  688. checked: 0,
  689. width: 100,
  690. onabort: "",
  691. },
  692. {
  693. surface: "15",
  694. label: "operation",
  695. name: "操作",
  696. checked: 0,
  697. width: 160,
  698. fixed: "right",
  699. operation: "1",
  700. onabort: "",
  701. },
  702. ],
  703. contentStyle: [
  704. {
  705. surface: "1",
  706. label: "serialNumber",
  707. name: "序号",
  708. checked: 0,
  709. width: 100,
  710. disabled: false,
  711. onabort: "",
  712. },
  713. {
  714. surface: "2",
  715. label: "fFeeid",
  716. name: "品名",
  717. checked: 0,
  718. width: 100,
  719. onabort: "",
  720. disabled: false,
  721. changeable: 1,
  722. },
  723. {
  724. surface: "3",
  725. label: "fCurrencyName",
  726. name: "规格",
  727. checked: 0,
  728. width: 100,
  729. onabort: "",
  730. disabled: false,
  731. },
  732. {
  733. surface: "4",
  734. label: "fUnitprice",
  735. name: "单价",
  736. checked: 0,
  737. width: 100,
  738. disabled: false,
  739. onabort:
  740. 'this.value=this.value.replace(/[^\\-?\\d.]/g,"").replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/, "$1$2.$3")',
  741. changeable: 2,
  742. },
  743. {
  744. surface: "5",
  745. label: "fPurchase",
  746. name: "数量",
  747. checked: 0,
  748. width: 100,
  749. onabort: "",
  750. disabled: false,
  751. changeable: 2,
  752. },
  753. {
  754. surface: "6",
  755. label: "fQty",
  756. name: "实际数量",
  757. checked: 0,
  758. width: 100,
  759. onabort: "",
  760. disabled: false,
  761. changeable: 2,
  762. },
  763. {
  764. surface: "7",
  765. label: "fFeeunitid",
  766. name: "计量单位",
  767. checked: 0,
  768. width: 100,
  769. onabort: "",
  770. disabled: false,
  771. changeable: 1,
  772. },
  773. {
  774. surface: "8",
  775. label: "fAmount",
  776. name: "金额",
  777. checked: 0,
  778. width: 100,
  779. onabort:
  780. 'this.value=this.value.replace(/[^\\-?\\d.]/g,"").replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/, "$1$2.$3")',
  781. disabled: false,
  782. changeable: 2,
  783. },
  784. {
  785. surface: "9",
  786. label: "remark",
  787. name: "备注",
  788. checked: 0,
  789. width: 100,
  790. onabort: "",
  791. disabled: false,
  792. changeable: 2,
  793. },
  794. {
  795. surface: "10",
  796. label: "createTime",
  797. name: "制单日期",
  798. checked: 0,
  799. disabled: false,
  800. width: 100,
  801. onabort: "",
  802. },
  803. // {
  804. // surface: '11',
  805. // label: 'createBy',
  806. // name: '申请人',
  807. // disabled: false,
  808. // checked: 0,
  809. // width: 100,
  810. // onabort: ''
  811. // }, {
  812. // surface: '12',
  813. // label: 'fReviewDate',
  814. // name: '审核日期',
  815. // checked: 0,
  816. // disabled: false,
  817. // width: 100,
  818. // onabort: ''
  819. // },
  820. {
  821. surface: "13",
  822. label: "operation",
  823. name: "操作",
  824. checked: 0,
  825. disabled: false,
  826. fixed: "right",
  827. width: 160,
  828. operation: "2",
  829. onabort: "",
  830. },
  831. ],
  832. queryList: {
  833. tableName: "销售出库",
  834. columnList: [],
  835. },
  836. purchaseList: {
  837. tableName: "销售出库详情",
  838. columnList: [],
  839. },
  840. setRowList: [],
  841. customButton: [
  842. {
  843. type: "primary",
  844. size: "mini",
  845. icon: "el-icon-edit",
  846. name: "新单",
  847. disabled: false,
  848. hasPermi: ["anpin:stockControl:anPingApply"],
  849. },
  850. // {
  851. // type:'warning',
  852. // size:'mini',
  853. // icon:'el-icon-edit',
  854. // name:'立即修改',
  855. // disabled:false,
  856. // },
  857. {
  858. type: "warning",
  859. size: "mini",
  860. icon: "el-icon-upload2",
  861. name: "导出",
  862. disabled: false,
  863. hasPermi: ["anpin:stockControl:export"],
  864. },
  865. {
  866. type: "success",
  867. size: "mini",
  868. icon: "el-icon-c-scale-to-original",
  869. name: "复制新单",
  870. disabled: false,
  871. hasPermi: ["anpin:stockControl:generateReceipts"],
  872. },
  873. ],
  874. contentButton: [
  875. {
  876. type: "primary",
  877. size: "mini",
  878. icon: "el-icon-plus",
  879. name: "录入明细",
  880. disabled: false,
  881. },
  882. {
  883. type: "primary",
  884. size: "mini",
  885. icon: "el-icon-plus",
  886. name: "保存",
  887. plain: true,
  888. disabled: false,
  889. },
  890. {
  891. type: "primary",
  892. size: "mini",
  893. icon: "el-icon-edit-outline",
  894. name: "请核",
  895. disabled: false,
  896. },
  897. {
  898. type: "success",
  899. size: "mini",
  900. icon: "el-icon-edit",
  901. name: "修改",
  902. disabled: false,
  903. },
  904. {
  905. type: "primary",
  906. size: "mini",
  907. icon: "el-icon-plus",
  908. name: "新单",
  909. nameTwo: "详情页",
  910. plain: true,
  911. disabled: false,
  912. },
  913. {
  914. type: "primary",
  915. size: "mini",
  916. icon: "el-icon-plus",
  917. name: "复制新单",
  918. nameTwo: "详情页",
  919. plain: true,
  920. disabled: false,
  921. },
  922. {
  923. type: "primary",
  924. size: "mini",
  925. icon: "el-icon-edit-outline",
  926. name: "打印",
  927. disabled: false,
  928. },
  929. {
  930. type: "warning",
  931. size: "mini",
  932. icon: "el-icon-download",
  933. name: "导出明细",
  934. disabled: false,
  935. },
  936. // {
  937. // type: 'info',
  938. // size: 'mini',
  939. // icon: 'el-icon-edit-outline',
  940. // name: '打印',
  941. // disabled: false
  942. // },
  943. {
  944. type: "info",
  945. size: "mini",
  946. icon: "el-icon-edit-outline",
  947. name: "申请发票",
  948. disabled: false,
  949. },
  950. ],
  951. formOption: [
  952. {
  953. span: 6,
  954. label: "fBillno",
  955. name: "系统编号",
  956. inputType: 2,
  957. width: 200,
  958. labelSize: "80",
  959. rules: [{ required: false, message: " " }],
  960. },
  961. {
  962. span: 6,
  963. label: "fGoodsid",
  964. name: "项目名称",
  965. inputType: 1,
  966. width: 200,
  967. labelSize: "80",
  968. rules: [{ required: false, message: " " }],
  969. },
  970. {
  971. span: 6,
  972. label: "fCorpid",
  973. name: "客户名称",
  974. inputType: 1,
  975. width: 200,
  976. labelSize: "80",
  977. rules: [{ required: false, message: " " }],
  978. },
  979. {
  980. span: 6,
  981. label: "timeInterval",
  982. name: "出库日期",
  983. inputType: 3,
  984. width: 300,
  985. labelSize: "80",
  986. rules: [{ required: false, message: " " }],
  987. },
  988. {
  989. span: 6,
  990. label: "createBy",
  991. name: "申请人",
  992. inputType: 2,
  993. width: 200,
  994. labelSize: "80",
  995. rules: [{ required: false, message: " " }],
  996. },
  997. {
  998. span: 6,
  999. label: "fWarehouseid",
  1000. name: "仓库",
  1001. inputType: 1,
  1002. width: 200,
  1003. labelSize: "80",
  1004. rules: [{ required: false, message: " " }],
  1005. },
  1006. {
  1007. span: 6,
  1008. label: "fFeeid",
  1009. name: "品名",
  1010. inputType: 1,
  1011. width: 200,
  1012. labelSize: "80",
  1013. rules: [{ required: false, message: " " }],
  1014. },
  1015. {
  1016. span: 6,
  1017. label: "fSbu",
  1018. name: "开票公司",
  1019. inputType: 1,
  1020. width: 200,
  1021. labelSize: "80",
  1022. rules: [{ required: false, message: " " }],
  1023. },
  1024. ],
  1025. contentOption: [
  1026. {
  1027. index: "1",
  1028. span: 6,
  1029. label: "fBillno",
  1030. name: "系统编号",
  1031. inputType: 2,
  1032. width: 200,
  1033. labelSize: "80",
  1034. disabled: true,
  1035. rules: [{ required: false, message: " " }],
  1036. },
  1037. {
  1038. index: "2",
  1039. span: 6,
  1040. label: "fGoodsid",
  1041. name: "项目名称",
  1042. inputType: 1,
  1043. width: 200,
  1044. labelSize: "80",
  1045. disabled: true,
  1046. rules: [{ required: true, message: " " }],
  1047. },
  1048. {
  1049. index: "5",
  1050. span: 6,
  1051. label: "corpsName",
  1052. name: "客户名称",
  1053. inputType: 2,
  1054. width: 200,
  1055. labelSize: "80",
  1056. disabled: true,
  1057. rules: [{ required: false, message: " " }],
  1058. },
  1059. {
  1060. index: "3",
  1061. span: 6,
  1062. label: "fMarketTypid",
  1063. name: "出库类别",
  1064. inputType: 1,
  1065. width: 200,
  1066. labelSize: "80",
  1067. disabled: true,
  1068. rules: [{ required: false, message: " " }],
  1069. },
  1070. {
  1071. index: "4",
  1072. span: 6,
  1073. label: "fStudentsWeight",
  1074. name: "人数",
  1075. inputType: 2,
  1076. onabort: "this.value=this.value.replace(/[^0-9]/g,'')",
  1077. width: 200,
  1078. disabled: true,
  1079. labelSize: "80",
  1080. rules: [{ required: true, message: " " }],
  1081. },
  1082. {
  1083. index: "6",
  1084. span: 6,
  1085. label: "fWarehouseid",
  1086. name: "仓库",
  1087. inputType: 1,
  1088. width: 200,
  1089. disabled: true,
  1090. labelSize: "80",
  1091. rules: [{ required: true, message: " " }],
  1092. },
  1093. {
  1094. index: "7",
  1095. span: 6,
  1096. label: "fBsdate",
  1097. name: "出库日期",
  1098. inputType: 6,
  1099. width: 200,
  1100. disabled: true,
  1101. labelSize: "80",
  1102. rules: [{ required: true, message: " " }],
  1103. },
  1104. // {
  1105. // index:'8',
  1106. // span: 6,
  1107. // label: 'createBy',
  1108. // name: '申请人',
  1109. // inputType: 2,
  1110. // width: 200,
  1111. // disabled: true,
  1112. // labelSize: '80',
  1113. // rules: [{ required: false, message: ' ' }]
  1114. // },
  1115. {
  1116. index: "9",
  1117. span: 6,
  1118. label: "fSbu",
  1119. name: "开票公司",
  1120. inputType: 1,
  1121. width: 200,
  1122. disabled: true,
  1123. labelSize: "80",
  1124. rules: [{ required: true, message: " " }],
  1125. },
  1126. {
  1127. index: "10",
  1128. span: 6,
  1129. label: "remark",
  1130. name: "备注",
  1131. inputType: 4,
  1132. disabled: true,
  1133. width: 200,
  1134. labelSize: "80",
  1135. rules: [{ required: false, message: " " }],
  1136. },
  1137. ],
  1138. pendingPage: "",
  1139. };
  1140. },
  1141. activated() {
  1142. if (this.$route.query.list) {
  1143. this.pendingPage = JSON.parse(this.$route.query.list);
  1144. this.homePage();
  1145. }
  1146. },
  1147. created() {
  1148. //获取登陆人
  1149. queryUserVal().then((response) => {
  1150. this.lander = response.user.userName;
  1151. });
  1152. let data = {
  1153. tableName: this.queryList.tableName,
  1154. userId: Cookies.get("userName"),
  1155. };
  1156. this.getRow(data);
  1157. let y = moment(Date.parse(new Date())).format("YYYY-MM-DD");
  1158. this.$set(this.formDataList, "timeInterval", [
  1159. y + " 00:00:00",
  1160. y + " 23:59:59",
  1161. ]);
  1162. this.query(this.formDataList);
  1163. productName().then((res) => {
  1164. console.log(res);
  1165. if (res.code === 200) {
  1166. for (let item in res.rows) {
  1167. this.dataList.fFeeid.push({
  1168. label: res.rows[item].fName,
  1169. value: res.rows[item].fId,
  1170. });
  1171. this.listData.fFeeid.push({
  1172. label: res.rows[item].fName,
  1173. value: res.rows[item].fId,
  1174. fFeeunitid: res.rows[item].fFeeunitid,
  1175. fCurrency: res.rows[item].fCurrency,
  1176. });
  1177. }
  1178. }
  1179. });
  1180. this.getDicts("data_unitfees").then((res) => {
  1181. for (let item in res.data) {
  1182. this.listData.fFeeunitid.push({
  1183. label: res.data[item].dictLabel,
  1184. value: JSON.parse(res.data[item].dictValue),
  1185. });
  1186. }
  1187. });
  1188. this.getDicts("f_paymode").then((res) => {
  1189. for (let item in res.data) {
  1190. this.listData.fStltypeid.push({
  1191. label: res.data[item].dictLabel,
  1192. value: JSON.parse(res.data[item].dictValue),
  1193. });
  1194. }
  1195. });
  1196. this.getDicts("f_deliveryCategory").then((res) => {
  1197. for (let item in res.data) {
  1198. this.dataList.fMarketTypid.push({
  1199. label: res.data[item].dictLabel,
  1200. value: JSON.parse(res.data[item].dictValue),
  1201. });
  1202. }
  1203. });
  1204. queryItem().then((res) => {
  1205. for (let item in res.data) {
  1206. this.dataList.fGoodsid.push({
  1207. label: res.data[item].projectName,
  1208. value: res.data[item].fId,
  1209. personNaem: res.data[item].personNaem,
  1210. corpsName: res.data[item].corpsName,
  1211. fCorpid: res.data[item].fCorpid,
  1212. });
  1213. }
  1214. });
  1215. //查询仓库
  1216. warehouse().then((res) => {
  1217. for (let item in res.rows) {
  1218. this.dataList.fWarehouseid.push({
  1219. label: res.rows[item].fName,
  1220. value: res.rows[item].fId,
  1221. });
  1222. }
  1223. });
  1224. this.fCompany(3);
  1225. this.fCompany(2);
  1226. },
  1227. methods: {
  1228. toChies(amount) {
  1229. //形参
  1230. this.chineseStr = 0;
  1231. // 汉字的数字
  1232. const cnNums = [
  1233. "零",
  1234. "壹",
  1235. "贰",
  1236. "叁",
  1237. "肆",
  1238. "伍",
  1239. "陆",
  1240. "柒",
  1241. "捌",
  1242. "玖",
  1243. ];
  1244. // 基本单位
  1245. const cnIntRadice = ["", "拾", "佰", "仟"];
  1246. // 对应整数部分扩展单位
  1247. const cnIntUnits = ["", "万", "亿", "兆"];
  1248. // 对应小数部分单位
  1249. const cnDecUnits = ["角", "分"];
  1250. // 整数金额时后面跟的字符
  1251. const cnInteger = "整";
  1252. // 整型完以后的单位
  1253. const cnIntLast = "元";
  1254. // 最大处理的数字
  1255. const maxNum = 9999999999999999.99;
  1256. // 金额整数部分
  1257. let integerNum;
  1258. // 金额小数部分
  1259. let decimalNum;
  1260. // 输出的中文金额字符串
  1261. let chineseStr = "";
  1262. // 分离金额后用的数组,预定义
  1263. let parts;
  1264. if (amount === "") {
  1265. return "";
  1266. }
  1267. amount = parseFloat(amount);
  1268. if (amount >= maxNum) {
  1269. // 超出最大处理数字
  1270. return "";
  1271. }
  1272. if (amount === 0) {
  1273. chineseStr = cnNums[0] + cnIntLast + cnInteger;
  1274. return chineseStr;
  1275. }
  1276. // 转换为字符串
  1277. amount = amount.toString();
  1278. if (amount.indexOf(".") === -1) {
  1279. integerNum = amount;
  1280. decimalNum = "";
  1281. } else {
  1282. parts = amount.split(".");
  1283. integerNum = parts[0];
  1284. decimalNum = parts[1].substr(0, 4);
  1285. }
  1286. // 获取整型部分转换
  1287. if (parseInt(integerNum, 10) > 0) {
  1288. let zeroCount = 0;
  1289. const IntLen = integerNum.length;
  1290. for (let i = 0; i < IntLen; i++) {
  1291. const n = integerNum.substr(i, 1);
  1292. const p = IntLen - i - 1;
  1293. const q = p / 4;
  1294. const m = p % 4;
  1295. if (n === "0") {
  1296. zeroCount++;
  1297. } else {
  1298. if (zeroCount > 0) {
  1299. chineseStr += cnNums[0];
  1300. }
  1301. // 归零
  1302. zeroCount = 0;
  1303. //alert(cnNums[parseInt(n)])
  1304. chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
  1305. }
  1306. if (m === 0 && zeroCount < 4) {
  1307. chineseStr += cnIntUnits[q];
  1308. }
  1309. }
  1310. chineseStr += cnIntLast;
  1311. }
  1312. // 小数部分
  1313. if (decimalNum !== "") {
  1314. const decLen = decimalNum.length;
  1315. for (let i = 0; i < decLen; i++) {
  1316. const n = decimalNum.substr(i, 1);
  1317. if (n !== "0") {
  1318. chineseStr += cnNums[Number(n)] + cnDecUnits[i];
  1319. }
  1320. }
  1321. }
  1322. if (chineseStr === "") {
  1323. chineseStr += cnNums[0] + cnIntLast + cnInteger;
  1324. } else if (decimalNum === "") {
  1325. chineseStr += cnInteger;
  1326. }
  1327. if (chineseStr[chineseStr.length - 1] !== "整") {
  1328. this.chineseStr = chineseStr + "整";
  1329. } else {
  1330. this.chineseStr = chineseStr;
  1331. }
  1332. // return chineseStr;
  1333. },
  1334. change(scope) {
  1335. for (let item in this.contentList) {
  1336. for (let li in this.listData.fFeeid) {
  1337. if (this.contentList[item].fFeeid == this.listData.fFeeid[li].value) {
  1338. this.$set(
  1339. this.contentList[item],
  1340. "fFeeunitid",
  1341. this.listData.fFeeid[li].fFeeunitid
  1342. );
  1343. this.$set(
  1344. this.contentList[item],
  1345. "fCurrencyName",
  1346. this.listData.fFeeid[li].fCurrency
  1347. );
  1348. }
  1349. }
  1350. }
  1351. },
  1352. homePage() {
  1353. let date = this.$route.query;
  1354. if (this.$route.query.list) {
  1355. console.log(this.$route.query.list);
  1356. // this.contentButton = this.$options.data().contentButton
  1357. // this.contentButton.push(JSON.parse(this.$route.query.list))
  1358. console.log(this.contentButton);
  1359. let scope = {
  1360. row: {
  1361. fId: JSON.parse(this.$route.query.data).billId,
  1362. },
  1363. };
  1364. this.viewMethod(scope);
  1365. } else {
  1366. this.pageDisplay = true;
  1367. }
  1368. },
  1369. // 查看审批流
  1370. getDataList() {
  1371. this.addOrUpdateVisible = false;
  1372. },
  1373. returnData() {
  1374. this.addOrUpdateVisib = false;
  1375. this.open = false;
  1376. this.cancelTwo();
  1377. },
  1378. addOrUpdateHandle() {
  1379. this.addOrUpdateVisible = true;
  1380. this.$nextTick(() => {
  1381. this.$refs.addOrUpdate.init(this.$refs.avatar.form.fId, 550);
  1382. });
  1383. },
  1384. //首页审批跳转关闭返回首页
  1385. cancelTwo() {
  1386. let view = {};
  1387. if (this.pendingPage.pendingPage) {
  1388. view = {
  1389. fullPath: "/morePage/stock?open=true",
  1390. hash: "",
  1391. matched: Array(2),
  1392. meta: Object,
  1393. name: "MorePage/stock",
  1394. params: Object,
  1395. path: "/morePage/stock",
  1396. query: Object,
  1397. title: "待审数据",
  1398. };
  1399. this.$router.push({ path: "/morePage/stock" });
  1400. } else {
  1401. view = {
  1402. fullPath: "/purchaseIssue",
  1403. hash: "",
  1404. matched: Array(2),
  1405. meta: Object,
  1406. name: "PurchaseIssue",
  1407. params: Object,
  1408. path: "/purchaseIssue",
  1409. query: Object,
  1410. title: "销售出库",
  1411. };
  1412. this.$router.push({ path: "/index" });
  1413. }
  1414. this.$store
  1415. .dispatch("tagsView/delView", view)
  1416. .then(({ visitedViews }) => {
  1417. if (this.isActive(view)) {
  1418. this.toLastView(visitedViews, view);
  1419. }
  1420. });
  1421. Global.$emit("removeCache", "closeSelectedTag", view);
  1422. },
  1423. handleSizeChange(val) {
  1424. this.formDataList.pageSize = val;
  1425. this.query(this.formDataList);
  1426. },
  1427. handleCurrentChange(val) {
  1428. this.formDataList.pageNum = val;
  1429. this.query(this.formDataList);
  1430. },
  1431. //计算金额
  1432. totalAmount(scope, item) {
  1433. if (item.label === "fAmount") {
  1434. if (scope.row.fAmount && scope.row.fQty) {
  1435. this.$set(
  1436. scope.row,
  1437. "fUnitprice",
  1438. (scope.row.fAmount / scope.row.fQty).toFixed(2)
  1439. );
  1440. }
  1441. }
  1442. if (item.label === "fUnitprice" || item.label === "fQty") {
  1443. if (scope.row.fUnitprice && scope.row.fQty) {
  1444. this.$set(
  1445. scope.row,
  1446. "fAmount",
  1447. (scope.row.fUnitprice * scope.row.fQty).toFixed(2)
  1448. );
  1449. }
  1450. }
  1451. },
  1452. //查询公司
  1453. fCompany(name) {
  1454. company(name).then((res) => {
  1455. console.log(res);
  1456. if (name == 3) {
  1457. this.dataList.fCorpid = [];
  1458. for (let item in res.data) {
  1459. this.dataList.fCorpid.push({
  1460. label: res.data[item].fName,
  1461. value: res.data[item].fId,
  1462. });
  1463. }
  1464. } else if (name == 2) {
  1465. this.dataList.fSbu = [];
  1466. for (let item in res.data) {
  1467. this.dataList.fSbu.push({
  1468. label: res.data[item].fName,
  1469. value: res.data[item].fId,
  1470. });
  1471. }
  1472. }
  1473. });
  1474. },
  1475. //查询主页列数据
  1476. query(data) {
  1477. listQuery(data).then((res) => {
  1478. this.tableData = res.rows;
  1479. this.tableData.forEach((item) => {
  1480. console.log(item.fPrint);
  1481. console.log(item.fPrintLog);
  1482. if (item.fPrint && item.fPrintLog) {
  1483. item.fPrintLog = item.fPrint + "," + item.fPrintLog;
  1484. } else if (item.fPrint || item.fPrintLog == null) {
  1485. item.fPrintLog = item.fPrint;
  1486. } else if (item.fPrint == null || item.fPrintLog) {
  1487. item.fPrintLog = item.fPrintLog;
  1488. } else {
  1489. item.fPrintLog = "";
  1490. }
  1491. // item.fPrintLog = item.fPrint == null && item.fPrintLog == null ? '' :
  1492. // item.fPrint && item.fPrintLog == null? item.fPrint : item.fPrint && item.fPrintLog? item.fPrint + ',' + item.fPrintLog :item.fPrintLog
  1493. });
  1494. console.log(this.tableData);
  1495. this.total = res.total;
  1496. });
  1497. },
  1498. //查询列数据
  1499. getRow(data, list, add, i) {
  1500. select(data).then((res) => {
  1501. if (data.tableName === "销售出库详情") {
  1502. if (res.data.length != 0) {
  1503. this.purchaseList.columnList = res.data.filter(
  1504. (e) => e.checked == 0
  1505. );
  1506. this.purchaseList.columnList = res.data;
  1507. this.setRowList = res.data;
  1508. this.purchaseList.columnList = this.purchaseList.columnList.filter(
  1509. (e) => e.checked == 0
  1510. );
  1511. // this.waitFor = true
  1512. } else {
  1513. // this.waitFor = true
  1514. this.$set(
  1515. this.purchaseList,
  1516. "columnList",
  1517. this.$options.data().contentStyle
  1518. );
  1519. this.setRowList = this.$options.data().contentStyle;
  1520. }
  1521. if (add) {
  1522. this.purchaseList.columnList.forEach(
  1523. (item) => (item.disabled = false)
  1524. );
  1525. } else {
  1526. this.purchaseList.columnList.forEach(
  1527. (item) => (item.disabled = true)
  1528. );
  1529. }
  1530. this.pageDisplay = false;
  1531. this.isItHidden = false;
  1532. this.inDex = this.contentOption.length;
  1533. } else {
  1534. if (res.data.length != 0) {
  1535. this.queryList.columnList = res.data.filter((e) => e.checked == 0);
  1536. this.queryList.columnList = res.data;
  1537. this.setRowList = res.data;
  1538. this.queryList.columnList = this.queryList.columnList.filter(
  1539. (e) => e.checked == 0
  1540. );
  1541. // this.waitFor = true
  1542. } else {
  1543. this.$set(
  1544. this.queryList,
  1545. "columnList",
  1546. this.$options.data().listStyle
  1547. );
  1548. this.setRowList = this.$options.data().listStyle;
  1549. }
  1550. this.$refs.avatar.form = this.form;
  1551. this.pageDisplay = true;
  1552. this.isItHidden = true;
  1553. this.inDex = 4;
  1554. let y = moment(Date.parse(new Date())).format("YYYY-MM-DD");
  1555. if (this.formDataList.timeInterval === undefined) {
  1556. this.$set(this.formDataList, "timeInterval", [
  1557. y + " 00:00:00",
  1558. y + " 23:59:59",
  1559. ]);
  1560. } else {
  1561. this.$set(
  1562. this.formDataList,
  1563. "timeInterval",
  1564. this.formDataList.timeInterval
  1565. );
  1566. }
  1567. this.$refs.avatar.assignmentTime(this.formDataList);
  1568. }
  1569. if (list) {
  1570. this.$refs.avatar.form = list.warehouseBills;
  1571. this.contentList = list.tWarehousebillsfees;
  1572. this.contentButton = this.$options.data().contentButton;
  1573. console.log(this.pendingPage);
  1574. console.log(this.pendingPage.name);
  1575. if (this.pendingPage.name) {
  1576. this.contentButton.push(JSON.parse(this.$route.query.list));
  1577. if (JSON.parse(this.$route.query.list))
  1578. this.$router.push({ query: {} });
  1579. }
  1580. let data = {
  1581. actId: 550,
  1582. id: this.$refs.avatar.form.fId,
  1583. };
  1584. getName(data).then((response) => {
  1585. console.log(response);
  1586. if (response.data.length != 0) {
  1587. this.before = response.data[0].userName;
  1588. if (
  1589. this.$refs.avatar.form.fBillstatus == 6 &&
  1590. this.before == this.lander
  1591. ) {
  1592. console.log(this.contentButton);
  1593. this.contentButton.push({
  1594. type: "warning",
  1595. size: "mini",
  1596. icon: "el-icon-refresh-left",
  1597. name: "撤销出库",
  1598. disabled: false,
  1599. });
  1600. }
  1601. }
  1602. });
  1603. let operator = this.$refs.avatar.form.createBy;
  1604. if (
  1605. this.$refs.avatar.form.fBillstatus == 4 &&
  1606. this.lander === operator
  1607. ) {
  1608. this.contentButton.push({
  1609. type: "danger",
  1610. size: "mini",
  1611. icon: "el-icon-refresh-left",
  1612. name: "撤销审批",
  1613. disabled: false,
  1614. });
  1615. }
  1616. if (this.$refs.avatar.form.fBillstatus > 3) {
  1617. console.log(this.contentButton);
  1618. this.contentButton.push({
  1619. type: "primary",
  1620. size: "mini",
  1621. icon: "el-icon-edit-outline",
  1622. name: "查看审批",
  1623. disabled: false,
  1624. });
  1625. }
  1626. for (let li in this.contentButton) {
  1627. if (this.$refs.avatar.form.fBillstatus < 4) {
  1628. if (
  1629. this.contentButton[li].name == "录入明细" ||
  1630. this.contentButton[li].name == "保存"
  1631. ) {
  1632. this.contentButton[li].disabled = true;
  1633. } else {
  1634. this.contentButton[li].disabled = false;
  1635. }
  1636. } else {
  1637. if (
  1638. this.contentButton[li].name == "录入明细" ||
  1639. this.contentButton[li].name == "保存" ||
  1640. this.contentButton[li].name == "请核" ||
  1641. this.contentButton[li].name == "修改"
  1642. ) {
  1643. this.contentButton[li].disabled = true;
  1644. } else {
  1645. this.contentButton[li].disabled = false;
  1646. }
  1647. }
  1648. }
  1649. }
  1650. if (i == 1) this.submitAnd();
  1651. });
  1652. },
  1653. submitAnd() {
  1654. this.$refs.avatar.form.fId = "";
  1655. this.$refs.avatar.form.fBillno = "";
  1656. this.$refs.avatar.form.fCreateLog = "";
  1657. this.$refs.avatar.form.fBillstatus = 2;
  1658. this.$refs.avatar.form.fPrintLog = "";
  1659. this.$refs.avatar.form.fBillstatus = 2;
  1660. this.$refs.avatar.form.fPrint = 0;
  1661. this.contentList.forEach((item) => (item.fId = ""));
  1662. this.contentOption.forEach((item) => {
  1663. if (
  1664. item.label == "personNaem" ||
  1665. item.label == "corpsName" ||
  1666. item.label == "createBy" ||
  1667. item.label == "fBillno"
  1668. ) {
  1669. item.disabled = true;
  1670. } else {
  1671. item.disabled = false;
  1672. }
  1673. });
  1674. this.purchaseList.columnList.forEach((item) => (item.disabled = false));
  1675. this.contentButton.forEach((item) => (item.disabled = false));
  1676. this.contentStyle.forEach((item) => (item.disabled = false));
  1677. },
  1678. returnToForm(row) {},
  1679. //查看
  1680. viewMethod(scope, res, i) {
  1681. console.log(res);
  1682. if (this.form.length !== undefined) this.form = this.$refs.avatar.form;
  1683. if (res) {
  1684. this.contentButton.forEach((item) => {
  1685. item.disabled = false;
  1686. this.purchaseList.columnList.forEach(
  1687. (item) => (item.disabled = false)
  1688. );
  1689. this.contentStyle.forEach((item) => (item.disabled = false));
  1690. this.contentOption.forEach((item) => {
  1691. if (
  1692. item.label == "personNaem" ||
  1693. item.label == "corpsName" ||
  1694. item.label == "createBy" ||
  1695. item.label == "fBillno"
  1696. ) {
  1697. item.disabled = true;
  1698. } else {
  1699. item.disabled = false;
  1700. }
  1701. });
  1702. });
  1703. } else {
  1704. this.contentOption.forEach((item) => (item.disabled = true));
  1705. this.contentStyle.forEach((item) => (item.disabled = true));
  1706. }
  1707. viewSingle(scope.row.fId).then((res) => {
  1708. console.log(res);
  1709. if (res.code === 200) {
  1710. let data = {
  1711. tableName: this.purchaseList.tableName,
  1712. userId: Cookies.get("userName"),
  1713. };
  1714. let list = {
  1715. warehouseBills: res.data.warehouseBills,
  1716. tWarehousebillsfees: res.data.tWarehousebillsfees,
  1717. };
  1718. this.getRow(data, list, "", i);
  1719. }
  1720. });
  1721. },
  1722. //请核
  1723. writeOff() {
  1724. let formData = new window.FormData();
  1725. formData.append(
  1726. "tWarehousebills",
  1727. JSON.stringify(this.$refs.avatar.form)
  1728. );
  1729. formData.append("tWarehousebillsfees", JSON.stringify(this.contentList));
  1730. formData.append("fBilltype", "XS");
  1731. pleaseCheck(formData).then((res) => {
  1732. if (res.code == 200) {
  1733. this.$message.success("请核成功");
  1734. // this.$refs.avatar.form = res.data.warehouseBills
  1735. // this.contentList = res.data.tWarehousebillsCntrs
  1736. this.contentOption.forEach((item) => (item.disabled = true));
  1737. this.contentStyle.forEach((item) => (item.disabled = true));
  1738. let data = {
  1739. tableName: this.queryList.tableName,
  1740. userId: Cookies.get("userName"),
  1741. };
  1742. this.getRow(data);
  1743. this.query(this.formDataList);
  1744. }
  1745. });
  1746. },
  1747. //修改
  1748. modification(scope) {},
  1749. //删除
  1750. deletion(scope) {
  1751. tableDeleteQuery(scope.row.fId).then((res) => {
  1752. this.$confirm(
  1753. res.msg == 1
  1754. ? "主表数据为空"
  1755. : (res.msg == 2 ? "主表有数据" : "未知状态") +
  1756. "是否永久删除该条数据?",
  1757. "提示",
  1758. {
  1759. confirmButtonText: "确定",
  1760. cancelButtonText: "取消",
  1761. type: "warning",
  1762. }
  1763. )
  1764. .then(() => {
  1765. confirmDeletion(scope.row.fId).then((data) => {
  1766. this.$message({
  1767. type: "success",
  1768. message: "删除成功!",
  1769. });
  1770. this.query(this.formDataList);
  1771. });
  1772. })
  1773. .catch(() => {
  1774. this.$message({
  1775. type: "info",
  1776. message: "已取消删除",
  1777. });
  1778. });
  1779. });
  1780. },
  1781. //选择框
  1782. selectionbox(selection) {
  1783. if (selection.length > 1) {
  1784. this.customButton.forEach((item) => {
  1785. if (item.name === "复制新单") {
  1786. item.disabled = true;
  1787. } else {
  1788. item.disabled = false;
  1789. }
  1790. });
  1791. } else {
  1792. this.customButton.forEach((item) => (item.disabled = false));
  1793. this.selection = selection;
  1794. }
  1795. },
  1796. addOrUpdateHand() {
  1797. this.addOrUpdateVisib = true;
  1798. this.$nextTick(() => {
  1799. this.$refs.ApprovalComments.init(this.$refs.avatar.form.fId, 550);
  1800. });
  1801. },
  1802. //详情内容保存
  1803. submitAndSave(item, res) {
  1804. if (
  1805. this.$refs.avatar.form.fBillstatus <= 4 ||
  1806. !this.$refs.avatar.form.fBillstatus
  1807. ) {
  1808. console.log(this.$refs.avatar.form.fGoodsid);
  1809. console.log(this.dataList.fGoodsid);
  1810. let formData = new window.FormData();
  1811. this.$refs.avatar.form.fMoney = 0;
  1812. this.contentList.forEach(
  1813. (item) => (this.$refs.avatar.form.fMoney += Number(item.fAmount))
  1814. );
  1815. this.dataList.fGoodsid.forEach((item) => {
  1816. if (item.value == this.$refs.avatar.form.fGoodsid) {
  1817. this.$refs.avatar.form.fCorpid = item.fCorpid;
  1818. }
  1819. });
  1820. formData.append(
  1821. "tWarehousebills",
  1822. JSON.stringify(this.$refs.avatar.form)
  1823. );
  1824. formData.append(
  1825. "tWarehousebillsfees",
  1826. JSON.stringify(this.contentList)
  1827. );
  1828. formData.append("fBilltype", "XS");
  1829. if (item === 3) {
  1830. this.$refs.avatar.form.fId = "";
  1831. this.$refs.avatar.form.fBillno = "";
  1832. this.$refs.avatar.form.fCreateLog = "";
  1833. this.$refs.avatar.form.fReviewDate = "";
  1834. this.$refs.avatar.form.fPrintLog = "";
  1835. this.$refs.avatar.form.fBillstatus = 2;
  1836. this.$refs.avatar.form.fPrint = 0;
  1837. this.contentList.forEach((item) => (item.fId = ""));
  1838. this.contentOption.forEach((item) => {
  1839. if (
  1840. item.label == "personNaem" ||
  1841. item.label == "corpsName" ||
  1842. item.label == "createBy" ||
  1843. item.label == "fBillno"
  1844. ) {
  1845. item.disabled = true;
  1846. } else {
  1847. item.disabled = false;
  1848. }
  1849. });
  1850. this.purchaseList.columnList.forEach(
  1851. (item) => (item.disabled = false)
  1852. );
  1853. this.contentButton.forEach((item) => (item.disabled = false));
  1854. this.contentStyle.forEach((item) => (item.disabled = false));
  1855. } else {
  1856. submit(formData).then((res) => {
  1857. if (res.code == 200) {
  1858. if (res) {
  1859. this.$refs.avatar.form = res.data.warehouseBills;
  1860. }
  1861. this.contentList = res.data.tWarehousebillsCntrs;
  1862. this.$message.success("保存成功");
  1863. viewSingle(this.$refs.avatar.form.fId).then((res) => {
  1864. if (res.code === 200) {
  1865. let list = {
  1866. warehouseBills: res.data.warehouseBills,
  1867. tWarehousebillsfees: res.data.tWarehousebillsfees,
  1868. };
  1869. this.$refs.avatar.form = list.warehouseBills;
  1870. this.contentList = list.tWarehousebillsfees;
  1871. this.toChies(this.$refs.avatar.form.fMoney);
  1872. // this.dialogVisible = true
  1873. }
  1874. });
  1875. }
  1876. });
  1877. }
  1878. }
  1879. if (item == 1) {
  1880. // this.dialogVisible = true
  1881. } else if (item === 2) {
  1882. let data = {
  1883. tableName: this.queryList.tableName,
  1884. userId: Cookies.get("userName"),
  1885. };
  1886. this.getRow(data);
  1887. this.query(this.formDataList);
  1888. }
  1889. if (item === 3 && this.$refs.avatar.form.fBillstatus > 3) {
  1890. this.$refs.avatar.form.fId = "";
  1891. this.$refs.avatar.form.fBillno = "";
  1892. this.$refs.avatar.form.fCreateLog = "";
  1893. this.$refs.avatar.form.fReviewDate = "";
  1894. this.$refs.avatar.form.fPrintLog = "";
  1895. this.$refs.avatar.form.fBillstatus = 2;
  1896. this.$refs.avatar.form.fPrint = 0;
  1897. this.contentList.forEach((item) => (item.fId = ""));
  1898. this.contentOption.forEach((item) => {
  1899. if (
  1900. item.label == "personNaem" ||
  1901. item.label == "corpsName" ||
  1902. item.label == "createBy" ||
  1903. item.label == "fBillno"
  1904. ) {
  1905. item.disabled = true;
  1906. } else {
  1907. item.disabled = false;
  1908. }
  1909. });
  1910. this.purchaseList.columnList.forEach((item) => (item.disabled = false));
  1911. this.contentButton.forEach((item) => (item.disabled = false));
  1912. this.contentStyle.forEach((item) => (item.disabled = false));
  1913. // let datae = {
  1914. // fId:this.$refs.avatar.form.fId,
  1915. // fBilltype:'SQ'
  1916. // }
  1917. // copyNew(datae).then(res=> {
  1918. // this.$message({
  1919. // message: '复制新单成功',
  1920. // type: 'success',
  1921. // showClose: true
  1922. // });
  1923. // let scope = {
  1924. // row: {
  1925. // fId: res.data
  1926. // }
  1927. // }
  1928. // this.query(this.formDataList)
  1929. // this.viewMethod(scope,res)
  1930. // })
  1931. }
  1932. },
  1933. //表单选中后触发
  1934. selectTrigger(name, list, id) {
  1935. if (name == "fGoodsid") {
  1936. for (let item in list) {
  1937. if (list[item].value == id) {
  1938. this.$refs.avatar.form.personNaem = list[item].personNaem;
  1939. this.$refs.avatar.form.corpsName = list[item].corpsName;
  1940. }
  1941. }
  1942. }
  1943. },
  1944. //确认打印
  1945. Printing() {
  1946. this.$print(this.$refs.print);
  1947. let list = {
  1948. fId: this.$refs.avatar.form.fId,
  1949. };
  1950. printingTiem(list).then((res) => {});
  1951. },
  1952. //返回列表
  1953. backToList() {
  1954. let data;
  1955. if (
  1956. (!this.$refs.avatar.form.fId && this.contentList !== 0) ||
  1957. (this.$refs.avatar.form.fBillstatus >= 4 && !this.$route.query.data)
  1958. ) {
  1959. data = {
  1960. tableName: this.queryList.tableName,
  1961. userId: Cookies.get("userName"),
  1962. };
  1963. this.getRow(data);
  1964. this.query(this.formDataList);
  1965. } else if (this.$route.query.data) {
  1966. this.cancelTwo();
  1967. // this.$router.push({ path: '/index' })
  1968. } else {
  1969. this.$confirm("当前数据未保存是否保存?", "提示", {
  1970. confirmButtonText: "保存",
  1971. cancelButtonText: "取消",
  1972. type: "warning",
  1973. })
  1974. .then(() => {
  1975. this.submitAndSave(2, 1);
  1976. })
  1977. .catch(() => {
  1978. data = {
  1979. tableName: this.queryList.tableName,
  1980. userId: Cookies.get("userName"),
  1981. };
  1982. this.getRow(data);
  1983. this.query(this.formDataList);
  1984. });
  1985. }
  1986. },
  1987. //所有按钮
  1988. buttonList(row) {
  1989. let data;
  1990. switch (row.name) {
  1991. case "新单":
  1992. if (row.nameTwo == "详情页") {
  1993. if (this.$refs.avatar.form.fId) {
  1994. this.contentList = [];
  1995. data = {
  1996. tableName: this.purchaseList.tableName,
  1997. userId: Cookies.get("userName"),
  1998. };
  1999. this.$refs.avatar.form = {};
  2000. this.getRow(data, "", 1);
  2001. this.contentOption.forEach((item) => {
  2002. if (
  2003. item.label == "personNaem" ||
  2004. item.label == "corpsName" ||
  2005. item.label == "createBy" ||
  2006. item.label == "fBillno"
  2007. ) {
  2008. item.disabled = true;
  2009. } else {
  2010. item.disabled = false;
  2011. }
  2012. });
  2013. this.contentButton.forEach((item) => (item.disabled = false));
  2014. this.contentStyle.forEach((item) => (item.disabled = false));
  2015. this.$refs.avatar.clearVerification();
  2016. this.$refs.avatar.form.createBy = Cookies.get("userName");
  2017. } else {
  2018. this.$message.error("当前数据未保存,请先保存");
  2019. }
  2020. } else {
  2021. this.contentList = [];
  2022. data = {
  2023. tableName: this.purchaseList.tableName,
  2024. userId: Cookies.get("userName"),
  2025. };
  2026. this.$refs.avatar.form = {};
  2027. this.getRow(data, "", 1);
  2028. this.contentOption.forEach((item) => {
  2029. if (
  2030. item.label == "personNaem" ||
  2031. item.label == "corpsName" ||
  2032. item.label == "createBy" ||
  2033. item.label == "fBillno"
  2034. ) {
  2035. item.disabled = true;
  2036. } else {
  2037. item.disabled = false;
  2038. }
  2039. });
  2040. this.contentButton.forEach((item) => (item.disabled = false));
  2041. this.contentStyle.forEach((item) => (item.disabled = false));
  2042. this.$refs.avatar.clearVerification();
  2043. this.$refs.avatar.form.createBy = Cookies.get("userName");
  2044. }
  2045. break;
  2046. case "复制新单":
  2047. if (row.nameTwo === "详情页") {
  2048. this.$refs.avatar.submitForm("submit", 3);
  2049. } else {
  2050. if (this.selection.length > 0) {
  2051. let scope = {
  2052. row: {
  2053. fId: this.selection[0].fId,
  2054. },
  2055. };
  2056. this.query(this.formDataList);
  2057. this.viewMethod(scope, "", 1);
  2058. } else {
  2059. this.$message.warning("未选择列表,请选择后再点击");
  2060. }
  2061. }
  2062. break;
  2063. case "保存":
  2064. this.$refs.avatar.submitForm("submit");
  2065. break;
  2066. // case '打印':
  2067. // if (!this.$refs.avatar.form.fId){
  2068. // this.$message.error('未保存,不允许打印');
  2069. // }else {
  2070. // this.formList = this.$refs.avatar.form
  2071. // this.submitAndSave(1)
  2072. // }
  2073. // break
  2074. case "修改":
  2075. this.contentButton.forEach((item) => {
  2076. if (this.$refs.avatar.form.fBillstatus >= 4) {
  2077. if (
  2078. item.name === "返回列表" ||
  2079. item.name === "修改" ||
  2080. item.name === "申请发票" ||
  2081. item.name === "查看审批" ||
  2082. item.name === "审批" ||
  2083. item.name === "打印" ||
  2084. item.name === "撤销审批"
  2085. ) {
  2086. item.disabled = false;
  2087. } else {
  2088. item.disabled = true;
  2089. }
  2090. } else {
  2091. item.disabled = false;
  2092. this.purchaseList.columnList.forEach(
  2093. (item) => (item.disabled = false)
  2094. );
  2095. this.contentStyle.forEach((item) => (item.disabled = false));
  2096. this.contentOption.forEach((item) => {
  2097. if (
  2098. item.label == "personNaem" ||
  2099. item.label == "corpsName" ||
  2100. item.label == "fBillno"
  2101. ) {
  2102. item.disabled = true;
  2103. } else {
  2104. item.disabled = false;
  2105. }
  2106. });
  2107. }
  2108. });
  2109. break;
  2110. case "录入明细":
  2111. this.contentList.push({
  2112. fFeeid: "",
  2113. fUnitprice: "",
  2114. fPurchase: "",
  2115. fQty: "",
  2116. fFeeunitid: "",
  2117. fAmount: "",
  2118. fStltypeid: "",
  2119. remark: "",
  2120. createTime: "",
  2121. createBy: Cookies.get("userName"),
  2122. fReviewDate: "",
  2123. operation: "",
  2124. });
  2125. break;
  2126. case "返回列表":
  2127. if (
  2128. (!this.$refs.avatar.form.fId && this.contentList !== 0) ||
  2129. (this.$refs.avatar.form.fBillstatus >= 4 && !this.$route.query.data)
  2130. ) {
  2131. data = {
  2132. tableName: this.queryList.tableName,
  2133. userId: Cookies.get("userName"),
  2134. };
  2135. this.getRow(data);
  2136. this.query(this.formDataList);
  2137. } else if (this.$route.query.data) {
  2138. this.cancelTwo();
  2139. this.$router.push({ path: "/index" });
  2140. } else {
  2141. this.$confirm("当前数据未保存是否保存?", "提示", {
  2142. confirmButtonText: "保存",
  2143. cancelButtonText: "取消",
  2144. type: "warning",
  2145. })
  2146. .then(() => {
  2147. this.submitAndSave(2);
  2148. })
  2149. .catch(() => {
  2150. data = {
  2151. tableName: this.queryList.tableName,
  2152. userId: Cookies.get("userName"),
  2153. };
  2154. this.getRow(data);
  2155. this.query(this.formDataList);
  2156. });
  2157. }
  2158. break;
  2159. case "请核":
  2160. if (this.$refs.avatar.form.fBillstatus < 4) {
  2161. this.$refs.avatar.submitForm("check");
  2162. } else {
  2163. this.$message.error("请先保存");
  2164. }
  2165. break;
  2166. case "查看审批":
  2167. this.addOrUpdateHandle();
  2168. break;
  2169. case "审批":
  2170. this.addOrUpdateHand();
  2171. break;
  2172. case "撤销审批":
  2173. this.revocationOfApproval(1);
  2174. break;
  2175. case "撤销出库":
  2176. this.revocationOfApproval(2);
  2177. break;
  2178. case "导出明细":
  2179. if (!this.$refs.avatar.form.fId) {
  2180. this.$message.error("数据未保存,请先保存");
  2181. } else {
  2182. let id = this.$refs.avatar.form.fId;
  2183. this.$confirm("是否确认导出销售出库明细?", "警告", {
  2184. confirmButtonText: "确定",
  2185. cancelButtonText: "取消",
  2186. type: "warning",
  2187. })
  2188. .then(function () {
  2189. return exportDetail({ fPid: id });
  2190. })
  2191. .then((response) => {
  2192. this.download(response.msg);
  2193. });
  2194. }
  2195. break;
  2196. case "打印":
  2197. // console.log(this.listData.fFeeid,this.contentList)
  2198. this.formList.createBy = Cookies.get("userName");
  2199. for (let ul in this.dataList.fGoodsid) {
  2200. if (
  2201. this.$refs.avatar.form.fGoodsid ==
  2202. this.dataList.fGoodsid[ul].value
  2203. ) {
  2204. this.projectName = this.dataList.fGoodsid[ul].label;
  2205. }
  2206. }
  2207. for (let item in this.contentList) {
  2208. for (let li in this.listData.fFeeid) {
  2209. if (
  2210. this.contentList[item].fFeeid == this.listData.fFeeid[li].value
  2211. ) {
  2212. this.contentList[item].feeName = this.listData.fFeeid[li].label;
  2213. }
  2214. }
  2215. for (let i in this.listData.fFeeunitid) {
  2216. if (
  2217. this.contentList[item].fFeeunitid ==
  2218. this.listData.fFeeunitid[i].value
  2219. ) {
  2220. this.contentList[item].fFeeunitName =
  2221. this.listData.fFeeunitid[i].label;
  2222. }
  2223. }
  2224. }
  2225. console.log(this.$refs.avatar.form.fMoney);
  2226. this.toChies(this.$refs.avatar.form.fMoney);
  2227. if (!this.$refs.avatar.form.fId) {
  2228. this.$message.error("未保存,不允许打印");
  2229. } else if (this.$refs.avatar.form.fBillstatus >= 4) {
  2230. this.formList = this.$refs.avatar.form;
  2231. this.dialogVisible = true;
  2232. } else {
  2233. this.formList = this.$refs.avatar.form;
  2234. this.submitAndSave(1);
  2235. this.dialogVisible = true;
  2236. }
  2237. break;
  2238. case "导出":
  2239. let dataForm = this.$refs.avatar.form
  2240. this.$confirm("是否确认导出销售出库?", "警告", {
  2241. confirmButtonText: "确定",
  2242. cancelButtonText: "取消",
  2243. type: "warning",
  2244. })
  2245. .then(function () {
  2246. return getExport(dataForm);
  2247. })
  2248. .then((response) => {
  2249. this.download(response.msg);
  2250. });
  2251. break;
  2252. default:
  2253. this.$message.error("该按钮暂无功能");
  2254. }
  2255. },
  2256. //撤销审批
  2257. revocationOfApproval(res) {
  2258. if (res == 1) {
  2259. let data = {
  2260. id: this.$refs.avatar.form.fId,
  2261. actId: 550,
  2262. billId: this.$refs.avatar.form.fId,
  2263. };
  2264. revoke(data).then((res) => {
  2265. if (res.code == 200) {
  2266. this.$message.success("撤销成功");
  2267. this.getList();
  2268. this.isItHidden = true;
  2269. this.pageDisplay = true;
  2270. }
  2271. });
  2272. } else if (res == 2) {
  2273. let data = {
  2274. fId: this.$refs.avatar.form.fId,
  2275. };
  2276. revokeBill(data).then((res) => {
  2277. if (res.code == 200) {
  2278. this.$message.success("撤销成功");
  2279. this.getList();
  2280. this.isItHidden = true;
  2281. this.pageDisplay = true;
  2282. }
  2283. });
  2284. }
  2285. },
  2286. // 显示搜索条件、点击后会调用此方法
  2287. showSearch() {
  2288. console.log("到我了");
  2289. this.searchWhether = !this.searchWhether;
  2290. },
  2291. //搜索、重置、展开
  2292. feedback(res) {
  2293. if (res == "展开") {
  2294. if (this.inDex == 4) {
  2295. this.inDex = this.formOption.length;
  2296. } else {
  2297. this.inDex = 4;
  2298. }
  2299. } else if (res == "搜索") {
  2300. this.$refs.avatar.submitForm();
  2301. } else if (res == "重置") {
  2302. this.formDataList = {
  2303. pageNum: 1,
  2304. pageSize: 10,
  2305. timeInterval: null,
  2306. fBilltype: "XS",
  2307. };
  2308. this.$refs.avatar.assignmentTime(this.formDataList);
  2309. this.$refs.avatar.submitForm();
  2310. }
  2311. },
  2312. //表单验证通过执行搜索
  2313. submitForm() {
  2314. console.log(this.formDataList.timeInterval);
  2315. let list = this.formDataList;
  2316. this.formDataList = this.$refs.avatar.form;
  2317. this.formDataList.fBilltype = list.fBilltype;
  2318. this.formDataList.pageSize = list.pageSize;
  2319. this.formDataList.pageNum = list.pageNum;
  2320. this.formDataList.timeInterval = list.timeInterval;
  2321. this.query(this.formDataList);
  2322. },
  2323. //点击刷新会调用此方法
  2324. getList() {
  2325. this.feedback("重置");
  2326. this.submitForm();
  2327. console.log("到我了2");
  2328. },
  2329. //详情表内容移出
  2330. deletRows(index, rows) {
  2331. if (rows[index].fId) {
  2332. deleteQuery(
  2333. this.$refs.avatar.form.fId,
  2334. this.$refs.avatar.form.fDateChanged
  2335. ).then((res) => {
  2336. if (res.code === 200) {
  2337. listDelete(rows[index].fId).then((data) => {
  2338. rows.splice(index, 1);
  2339. });
  2340. }
  2341. });
  2342. } else {
  2343. rows.splice(index, 1);
  2344. }
  2345. },
  2346. },
  2347. };
  2348. </script>
  2349. <style scoped>
  2350. .table {
  2351. border-collapse: collapse;
  2352. border-spacing: 0;
  2353. background-color: transparent;
  2354. display: table;
  2355. width: 99%;
  2356. max-width: 100%;
  2357. margin: 0 auto;
  2358. }
  2359. .table td {
  2360. text-align: center;
  2361. vertical-align: middle;
  2362. font-size: 14px;
  2363. color: #000000;
  2364. padding: 8px 12px;
  2365. }
  2366. .column {
  2367. border: 1px solid #000;
  2368. }
  2369. .app-container >>> .el-form-item {
  2370. margin-bottom: 0;
  2371. }
  2372. .print_div ::v-deep .el-table__body-wrapper {
  2373. z-index: 2;
  2374. }
  2375. .print_div ::v-deep .el-dialog__header {
  2376. padding: 0;
  2377. }
  2378. .print_div ::v-deep .el-dialog__body {
  2379. padding: 0 20px;
  2380. }
  2381. .app-container ::v-deep .el-table__body-wrapper {
  2382. z-index: 2;
  2383. }
  2384. </style>