index1.vue 103 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530
  1. <template>
  2. <div class="app-container">
  3. <div v-if="isPercentage" class="percentage" style="width: 210px;height: 90px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 9999999999999;">
  4. <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
  5. <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
  6. </div>
  7. <el-tabs v-model="activeName" @tab-click="handleClick">
  8. <el-tab-pane v-if="isDistributionSheet" label="采购配单" name="first">
  9. <div class="purchaseDistributionSheet">
  10. <el-table
  11. :key="tableKey1"
  12. v-loading="listLoading1"
  13. element-loading-text="给我一点时间"
  14. :data="list1"
  15. border
  16. fit
  17. :row-style="tableRowStyle"
  18. :cell-style="tableCellStyle"
  19. highlight-current-row
  20. style="width: 100%;"
  21. class="elTable table-fixed"
  22. @cell-click="cellClick"
  23. @sort-change="tableSort"
  24. :max-height="myHeight"
  25. >
  26. <el-table-column label="序号" align="center" type="index" width="50px">
  27. <template slot-scope="scope">
  28. <span>{{ scope.$index + (pageNum1-1) * pageSize1 + 1 }}</span>
  29. </template>
  30. </el-table-column>
  31. <el-table-column label="备件编号" align="center" min-width="150px">
  32. <template slot-scope="scope">
  33. <span>{{ scope.row.partCode }}</span>
  34. </template>
  35. </el-table-column>
  36. <el-table-column label="备件名称" align="center" min-width="120px">
  37. <template slot-scope="scope">
  38. <span>{{ scope.row.partName }}</span>
  39. </template>
  40. </el-table-column>
  41. <el-table-column label="备件规格" align="center" min-width="120px">
  42. <template slot-scope="scope">
  43. <span>{{ scope.row.specification }}</span>
  44. </template>
  45. </el-table-column>
  46. <el-table-column label="备件品牌" min-width="100px" align="center">
  47. <template slot-scope="scope">
  48. <span>{{ scope.row.brand }}</span>
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="计量单位" min-width="80px" align="center">
  52. <template slot-scope="scope">
  53. <span>{{ scope.row.unit }}</span>
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="图片" min-width="110px" align="center">
  57. <template slot-scope="scope">
  58. <el-popover placement="right" title="" trigger="hover">
  59. <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
  60. <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  61. </el-popover>
  62. </template>
  63. </el-table-column>
  64. <el-table-column label="供应商" min-width="110px" align="center">
  65. <template slot-scope="scope">
  66. <span>{{ scope.row.providerName }}</span>
  67. </template>
  68. </el-table-column>
  69. <el-table-column sortable prop="price" label="单价" min-width="70px" align="center">
  70. <template slot-scope="scope">
  71. <span>{{ scope.row.price }}</span>
  72. </template>
  73. </el-table-column>
  74. <el-table-column sortable prop="sumAmount" label="申购数量" min-width="90px" align="center">
  75. <template slot-scope="scope">
  76. <span>{{ scope.row.sumAmount }}</span>
  77. </template>
  78. </el-table-column>
  79. <el-table-column label="采购数量" min-width="110px" align="center">
  80. <template slot-scope="scope">
  81. <el-form :model="scope.row" :rules="rules">
  82. <el-form-item prop="amount">
  83. <el-input
  84. v-model="scope.row.amount"
  85. style="width:80px;margin-top:25px;height:10px"
  86. />
  87. </el-form-item>
  88. </el-form>
  89. </template>
  90. </el-table-column>
  91. </el-table>
  92. <el-button :disabled="confirmationSheetDisabled" type="primary" style="float: right;margin-top: 10px;" @click="confirmationSheet()">确认配单</el-button>
  93. <el-dialog :title="textMap[dialogStatusConfirmation]" :visible.sync="dialogFormVisibleConfirmation" :close-on-click-modal="false" style="width:100%;margin: 0 auto;overflow:auto">
  94. <div class="app-contentConfirmationSheet">
  95. <el-form ref="temp1" :rules="rules" :model="temp1" label-position="right" label-width="90px" style="width:100%;margin-bottom:50px">
  96. <el-row>
  97. <el-col :span="8">
  98. <el-form-item label="配单号:" prop="matchCode">
  99. <el-input ref="matchCode" v-model="temp1.matchCode" disabled />
  100. </el-form-item>
  101. </el-col>
  102. <el-col :span="8">
  103. <el-form-item label="提交日期:" prop="buyerDate">
  104. <el-date-picker
  105. v-model="temp1.buyerDate"
  106. :picker-options="pickerOptions"
  107. type="date"
  108. placeholder="提交日期"
  109. format="yyyy-MM-dd"
  110. value-format="yyyy-MM-dd"
  111. style="width:170px;"
  112. />
  113. </el-form-item>
  114. </el-col>
  115. <el-col :span="8">
  116. <el-form-item label="采购员:" prop="buyerPerson">
  117. <el-select v-model="temp1.buyerPerson" placeholder="采购员" class="filter-item">
  118. <el-option
  119. v-for="item in findAllEmploye"
  120. :key="item.id"
  121. :label="item.name"
  122. :value="item.id"
  123. />
  124. </el-select>
  125. </el-form-item>
  126. </el-col>
  127. </el-row>
  128. </el-form>
  129. <div v-for="(item,index) in listConfirmationSheet" :key="index" class="app-content">
  130. <div class="title">
  131. <div>
  132. <b>采购单号:</b>
  133. <span>{{ item.orderNumber }}</span>
  134. </div>
  135. <div>
  136. <b>供应商:</b>
  137. <span>{{ item.providerName }}</span>
  138. </div>
  139. </div>
  140. <el-table
  141. :key="tableKey1"
  142. v-loading="listLoading1"
  143. element-loading-text="给我一点时间"
  144. :data="item.list"
  145. border
  146. fit
  147. highlight-current-row
  148. style="width: 97%;margin:0 auto"
  149. :row-style="rowStyle"
  150. :cell-style="cellStyle"
  151. class="elTable table-fixed"
  152. >
  153. <!-- table表格 -->
  154. <el-table-column label="序号" align="center" type="index" width="50px">
  155. <template slot-scope="scope">
  156. <span>{{ scope.$index + (pageNum1-1) * pageSize1 + 1 }}</span>
  157. </template>
  158. </el-table-column>
  159. <el-table-column label="备件编号" align="center" min-width="150px">
  160. <template slot-scope="scope">
  161. <span>{{ scope.row.partCode }}</span>
  162. </template>
  163. </el-table-column>
  164. <el-table-column label="备件名称" align="center" min-width="120px">
  165. <template slot-scope="scope">
  166. <span>{{ scope.row.partName }}</span>
  167. </template>
  168. </el-table-column>
  169. <el-table-column label="备件规格" align="center" min-width="120px">
  170. <template slot-scope="scope">
  171. <span>{{ scope.row.specification }}</span>
  172. </template>
  173. </el-table-column>
  174. <el-table-column label="图片" min-width="110px" align="center">
  175. <template slot-scope="scope">
  176. <el-popover placement="right" title="" trigger="hover">
  177. <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
  178. <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  179. </el-popover>
  180. </template>
  181. </el-table-column>
  182. <el-table-column label="备件品牌" min-width="100px" align="center">
  183. <template slot-scope="scope">
  184. <span>{{ scope.row.brand }}</span>
  185. </template>
  186. </el-table-column>
  187. <el-table-column label="计量单位" min-width="80px" align="center">
  188. <template slot-scope="scope">
  189. <span>{{ scope.row.unit }}</span>
  190. </template>
  191. </el-table-column>
  192. <el-table-column label="单价" min-width="70px" align="center">
  193. <template slot-scope="scope">
  194. <span>{{ scope.row. price }}</span>
  195. </template>
  196. </el-table-column>
  197. <el-table-column label="申购数量" min-width="90px" align="center">
  198. <template slot-scope="scope">
  199. <span>{{ scope.row.sumAmount }}</span>
  200. </template>
  201. </el-table-column>
  202. <el-table-column label="合计采购数量" min-width="90px" align="center">
  203. <template slot-scope="scope">
  204. <span>{{ scope.row.amount }}</span>
  205. </template>
  206. </el-table-column>
  207. <el-table-column label="总价" min-width="90px" align="center">
  208. <template slot-scope="scope">
  209. <span>{{ (scope.row.sumPrice = scope.row.price * parseFloat(scope.row.amount))| keepTwoNum }}</span>
  210. </template>
  211. </el-table-column>
  212. </el-table>
  213. <div ref="total" class="total">
  214. 合计:
  215. <span>{{ item.Sum }}</span>
  216. </div>
  217. </div>
  218. <div slot="footer" class="dialog-footer" style="bottom:10px">
  219. <el-button type="primary" :disabled="isokDisable" @click="confirmationSheetData()">确认</el-button>
  220. <el-button @click="dialogFormVisibleConfirmation= false;get_table_data1();">取消</el-button>
  221. </div>
  222. </div>
  223. </el-dialog>
  224. </div>
  225. </el-tab-pane>
  226. <el-tab-pane v-if="isDistributionManagement" label="配单管理" name="fouth">
  227. <div class="DistributionManagement">
  228. <div class="filter-container">
  229. <el-select v-model="getdataListParm4.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item">
  230. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  231. </el-select>
  232. <el-input v-model="getdataListParm4.parammaps.matchCode" placeholder="配单号" clearable style="width: 200px;" class="filter-item" />
  233. <el-select v-model="getdataListParm4.parammaps.statue" clearable placeholder="审核状态" class="filter-item" style="width: 120px;">
  234. <el-option v-for="item in status2" :key="item.id" :label="item.name" :value="item.id" />
  235. </el-select>
  236. <el-date-picker ref="inputDatetime4" v-model="getdataListParm4.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 270px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始提交日期" end-placeholder="结束提交日期" />
  237. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search4">搜索</el-button>
  238. </div>
  239. <el-table
  240. :key="tableKey4"
  241. v-loading="listLoading4"
  242. element-loading-text="给我一点时间"
  243. :data="list4"
  244. border
  245. fit
  246. highlight-current-row
  247. style="width: 100%;"
  248. :row-style="rowStyle"
  249. :cell-style="cellStyle"
  250. class="elTable table-fixed"
  251. @sort-change="tableSort"
  252. @current-change="handleCurrentChange"
  253. :max-height="myHeight"
  254. >
  255. <el-table-column label="序号" align="center" type="index" width="50px">
  256. <template slot-scope="scope">
  257. <span>{{ scope.$index + (pageNum2-1) * pageSize2 + 1 }}</span>
  258. </template>
  259. </el-table-column>
  260. <el-table-column label="牧场" min-width="110px" align="center">
  261. <template slot-scope="scope">
  262. <span>{{ scope.row.pastureName }}</span>
  263. </template>
  264. </el-table-column>
  265. <el-table-column label="配单号" min-width="110px" align="center">
  266. <template slot-scope="scope">
  267. <span>{{ scope.row.matchCode }}</span>
  268. </template>
  269. </el-table-column>
  270. <el-table-column label="采购员" min-width="130px" align="center">
  271. <template slot-scope="scope">
  272. <span>{{ scope.row.empname }}</span>
  273. </template>
  274. </el-table-column>
  275. <el-table-column label="提交日期" sortable prop="dealTime" min-width="110px" align="center" />
  276. <el-table-column sortable prop="cou" label="采购单数" min-width="110px" align="center">
  277. <template slot-scope="scope">
  278. <span>{{ scope.row.cou }}</span>
  279. </template>
  280. </el-table-column>
  281. <el-table-column label="审核状态" min-width="80px" align="center" :formatter="statue" />
  282. <el-table-column label="操作" align="center" width="250px" class-name="small-padding fixed-width" fixed="right">
  283. <template slot-scope="{row}">
  284. <el-button v-if="isPurchaseSee" type="primary" size="mini" @click="form_see4(row)">查看</el-button>
  285. <el-button v-if="parseFloat(row.statue) === 0 && isExamineDM" style="display:inline-block" type="success" size="mini" @click="handleExamine(row)">审核</el-button>
  286. <el-button v-else style="display:none;" type="success" size="mini" @click="handleExamine(row)">审核</el-button>
  287. <el-button v-if="parseFloat(row.statue) === 2" type="success" style="display:inline-block" size="mini" @click="form_edit(row)">编辑</el-button>
  288. <el-button v-else style="display:none;" type="success" size="mini" @click="form_edit(row)">编辑</el-button>
  289. </template>
  290. </el-table-column>
  291. </el-table>
  292. <pagination v-show="total4>0" :total="total4" :page.sync="getdataListParm4.offset" :limit.sync="getdataListParm4.pagecount" @pagination="get_table_data4" />
  293. <el-dialog :title="textMap[dialogStatusSee4]" :visible.sync="dialogFormVisibleSee4" :close-on-click-modal="false">
  294. <div class="app-contentSee">
  295. <el-form ref="temp4" :rules="rules" :model="temp4" label-position="right" label-width="80px" style="width: 800px;margin-bottom:30px">
  296. <el-row>
  297. <el-col :span="8">
  298. <el-form-item label="配单号:" prop="matchCode">
  299. <span>{{ temp4.matchCode }}</span>
  300. </el-form-item>
  301. </el-col>
  302. <el-col :span="8">
  303. <el-form-item label="采购员:" prop="empname">
  304. <span>{{ temp4.empname }}</span>
  305. </el-form-item>
  306. </el-col>
  307. <el-col :span="8">
  308. <el-form-item label="配单日期:" prop="dealTime">
  309. <span>{{ temp4.dealTime }}</span>
  310. </el-form-item>
  311. </el-col>
  312. </el-row>
  313. </el-form>
  314. <el-table
  315. :key="tableKeySee4"
  316. v-loading="listLoadingSee4"
  317. element-loading-text="给我一点时间"
  318. :data="listSee4"
  319. border
  320. fit
  321. highlight-current-row
  322. style="width: 100%;margin-bottom:100px"
  323. :row-style="rowStyle"
  324. :cell-style="cellStyle"
  325. class="elTable table-fixed"
  326. >
  327. <el-table-column label="序号" align="center" type="index" width="50px" />
  328. <el-table-column label="采购单号" min-width="110px" align="center">
  329. <template slot-scope="scope">
  330. <span>{{ scope.row.buyeCode }}</span>
  331. </template>
  332. </el-table-column>
  333. <el-table-column label="备件编号" min-width="110px" align="center">
  334. <template slot-scope="scope">
  335. <span>{{ scope.row.partCode }}</span>
  336. </template>
  337. </el-table-column>
  338. <el-table-column label="备件名称" min-width="110px" align="center">
  339. <template slot-scope="scope">
  340. <span>{{ scope.row.partName }}</span>
  341. </template>
  342. </el-table-column>
  343. <el-table-column label="备件规格" min-width="110px" align="center">
  344. <template slot-scope="scope">
  345. <span>{{ scope.row.specification }}</span>
  346. </template>
  347. </el-table-column>
  348. <el-table-column label="备件品牌" min-width="110px" align="center">
  349. <template slot-scope="scope">
  350. <span>{{ scope.row.brand }}</span>
  351. </template>
  352. </el-table-column>
  353. <el-table-column label="计量单位" min-width="60px" align="center">
  354. <template slot-scope="scope">
  355. <span>{{ scope.row.unit }}</span>
  356. </template>
  357. </el-table-column>
  358. <el-table-column label="供应商" min-width="110px" align="center">
  359. <template slot-scope="scope">
  360. <span>{{ scope.row.providerName }}</span>
  361. </template>
  362. </el-table-column>
  363. <el-table-column sortable prop="price" label="单价" min-width="60px" align="center">
  364. <template slot-scope="scope">
  365. <span>{{ scope.row.price }}</span>
  366. </template>
  367. </el-table-column>
  368. <el-table-column sortable prop="sumAmount" label="申购数量" min-width="60px" align="center">
  369. <template slot-scope="scope">
  370. <span>{{ scope.row.sumAmount }}</span>
  371. </template>
  372. </el-table-column>
  373. <el-table-column sortable prop="amount" label="采购数量" min-width="60px" align="center">
  374. <template slot-scope="scope">
  375. <span>{{ scope.row.amount }}</span>
  376. </template>
  377. </el-table-column>
  378. <el-table-column sortable prop="sumPrice" label="总价" min-width="60px" align="center">
  379. <template slot-scope="scope">
  380. <span>{{ scope.row.sumPrice }}</span>
  381. </template>
  382. </el-table-column>
  383. <el-table-column label="备件图片" min-width="110px" align="center">
  384. <template slot-scope="scope">
  385. <el-popover placement="right" title="" trigger="hover">
  386. <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
  387. <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  388. </el-popover>
  389. </template>
  390. </el-table-column>
  391. <el-table-column prop="SGremark" label="备注" min-width="60px" align="center" />
  392. </el-table>
  393. <el-form ref="temp4" :rules="rules" :model="temp4" label-position="right" label-width="120px" style="width: 90%;margin:0 auto;">
  394. <el-row>
  395. <el-col>
  396. <el-form-item label="流程进度" />
  397. <el-steps :active="active" align-center finish-status="success">
  398. <el-step
  399. v-for="(item,index) in activeList"
  400. :key="index"
  401. :title="item.title"
  402. :status="item.status"
  403. >
  404. <template slot="description">
  405. <div class="step-row">
  406. <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
  407. <div>{{ item.reason }}</div>
  408. </div>
  409. </template>
  410. </el-step>
  411. </el-steps>
  412. </el-col>
  413. </el-row>
  414. <el-row>
  415. <el-col>
  416. <el-form-item label="操作:">
  417. <!-- 审核 -->
  418. <el-button v-if="isExamineDM && temp4.statue == 0" type="success" style="display:inline-block" @click="handleExamine()">审核</el-button>
  419. <el-button v-else type="success" style="display:none" @click="handleExamine()">审核</el-button>
  420. </el-form-item>
  421. </el-col>
  422. </el-row>
  423. </el-form>
  424. <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
  425. <el-button @click="dialogFormVisibleSee4 = false;">关闭</el-button>
  426. </div>
  427. </div>
  428. </el-dialog>
  429. <el-dialog :title="textMap[dialogStatusUpdate4]" width="90%" :visible.sync="dialogFormVisibleUpdate4" :close-on-click-modal="false">
  430. <div class="app-contentUpdate">
  431. <el-form
  432. ref="updateTemp4"
  433. :rules="rules"
  434. :model="updateTemp4"
  435. label-position="right"
  436. label-width="80px"
  437. style="width:80%;margin-bottom:30px"
  438. >
  439. <el-row>
  440. <el-col :span="8">
  441. <el-form-item label="配单号:" prop="matchCode">
  442. <span>{{ updateTemp4.matchCode }}</span>
  443. </el-form-item>
  444. </el-col>
  445. <el-col :span="8">
  446. <el-form-item label="采购员:" prop="empname">
  447. <span>{{ updateTemp4.empname }}</span>
  448. </el-form-item>
  449. </el-col>
  450. <el-col :span="8">
  451. <el-form-item label="配单日期:" prop="dealTime">
  452. <span>{{ updateTemp4.dealTime }}</span>
  453. </el-form-item>
  454. </el-col>
  455. </el-row>
  456. </el-form>
  457. <el-table
  458. :key="tableKeyUpdate4"
  459. v-loading="listLoadingUpdate4"
  460. element-loading-text="给我一点时间"
  461. :data="listUpdate4"
  462. border
  463. fit
  464. highlight-current-row
  465. style="width: 100%;margin-bottom:100px"
  466. :row-style="rowStyle"
  467. :cell-style="cellStyle"
  468. class="elTable table-fixed"
  469. >
  470. <!-- table表格 -->
  471. <el-table-column label="序号" align="center" type="index" width="50px" />
  472. <el-table-column label="采购单号" min-width="110px" align="center">
  473. <template slot-scope="scope">
  474. <span>{{ scope.row.buyeCode }}</span>
  475. </template>
  476. </el-table-column>
  477. <el-table-column label="备件编号" min-width="110px" align="center">
  478. <template slot-scope="scope">
  479. <span>{{ scope.row.partCode }}</span>
  480. </template>
  481. </el-table-column>
  482. <el-table-column label="备件名称" min-width="110px" align="center">
  483. <template slot-scope="scope">
  484. <span>{{ scope.row.partName }}</span>
  485. </template>
  486. </el-table-column>
  487. <el-table-column label="备件规格" min-width="110px" align="center">
  488. <template slot-scope="scope">
  489. <span>{{ scope.row.specification }}</span>
  490. </template>
  491. </el-table-column>
  492. <el-table-column label="备件品牌" min-width="110px" align="center">
  493. <template slot-scope="scope">
  494. <span>{{ scope.row.brand }}</span>
  495. </template>
  496. </el-table-column>
  497. <el-table-column label="计量单位" min-width="60px" align="center">
  498. <template slot-scope="scope">
  499. <span>{{ scope.row.unit }}</span>
  500. </template>
  501. </el-table-column>
  502. <el-table-column label="供应商" min-width="110px" align="center">
  503. <template slot-scope="scope">
  504. <span>{{ scope.row.providerName }}</span>
  505. </template>
  506. </el-table-column>
  507. <el-table-column label="单价" min-width="60px" align="center">
  508. <template slot-scope="scope">
  509. <span>{{ scope.row.price }}</span>
  510. </template>
  511. </el-table-column>
  512. <el-table-column label="申购数量" min-width="60px" align="center">
  513. <template slot-scope="scope">
  514. <span>{{ scope.row.sumAmount }}</span>
  515. </template>
  516. </el-table-column>
  517. <el-table-column label="采购数量" min-width="100px" align="center">
  518. <template slot-scope="scope">
  519. <el-form :model="scope.row" :rules="rules">
  520. <el-form-item prop="amount">
  521. <el-input
  522. v-model="scope.row.amount"
  523. style="width:80px;margin-top:25px;height:10px"
  524. />
  525. </el-form-item>
  526. </el-form>
  527. </template>
  528. </el-table-column>
  529. <el-table-column label="总价" min-width="60px" align="center">
  530. <template slot-scope="scope">
  531. <span>{{ (parseFloat(scope.row.price) * parseFloat(scope.row.amount)) | keepTwoNum2 }}</span>
  532. </template>
  533. </el-table-column>
  534. <el-table-column label="备件图片" min-width="110px" align="center">
  535. <template slot-scope="scope">
  536. <el-popover placement="right" title="" trigger="hover">
  537. <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
  538. <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  539. </el-popover>
  540. </template>
  541. </el-table-column>
  542. </el-table>
  543. <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
  544. <el-button type="primary" :disabled="isokDisable" @click="edit_dialog_save()">确认</el-button>
  545. <el-button @click="dialogFormVisibleUpdate4 = false;">关闭</el-button>
  546. </div>
  547. </div>
  548. </el-dialog>
  549. <el-dialog :title="textMap[dialogStatus_Examine]" :visible.sync="dialogFormVisible_Examine" :close-on-click-modal="false" width="30%">
  550. <div class="app-examine">
  551. <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请确认审核结果:</h3>
  552. <el-form ref="examineTemp" :rules="rules" :model="examineTemp" label-position="right" style="width: 50%;margin:0 auto;">
  553. <el-row style="width:88%;height:150px;margin:0 auto;">
  554. <el-col :span="20">
  555. <el-form-item>
  556. <el-radio-group v-model="examineTemp.SHstatue" @change="changeSHStatue">
  557. <el-radio :label="1" checked>通过</el-radio>
  558. <el-radio :label="2">不通过</el-radio>
  559. </el-radio-group>
  560. </el-form-item>
  561. </el-col>
  562. <el-col v-if="statueReason" :span="20">
  563. <el-input v-model="examineTemp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入不通过原因" />
  564. </el-col>
  565. </el-row>
  566. </el-form>
  567. </div>
  568. <div slot="footer" class="dialog-footer">
  569. <el-button type="primary" :disabled="isokDisable" @click="dialogStatus_Examine==='examine'?createExamineData():createExamineData()">确认</el-button>
  570. <el-button @click="dialogFormVisible_Examine = false;">关闭</el-button>
  571. </div>
  572. </el-dialog>
  573. </div>
  574. </el-tab-pane>
  575. <el-tab-pane label="采购单管理" name="second">
  576. <div class="purchaseOrderManagement">
  577. <div class="filter-container">
  578. <el-select v-model="getdataListParm2.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item">
  579. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  580. </el-select>
  581. <el-input v-model="getdataListParm2.parammaps.buyeCode" placeholder="采购单号" clearable style="width: 200px;" class="filter-item" />
  582. <el-select v-model="getdataListParm2.parammaps.statu" clearable placeholder="单据状态" class="filter-item" style="width: 120px;">
  583. <el-option v-for="item in status" :key="item.id" :label="item.name" :value="item.id" />
  584. </el-select>
  585. <el-autocomplete v-model="getdataListParm2.parammaps.providerName" value-key="providerName" class="inline-input" :fetch-suggestions="providerSearch" placeholder="供应商" style="width:150px;top:-3px;" @select="handleSelectProvider" />
  586. <el-date-picker ref="inputDatetime2" v-model="getdataListParm2.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 270px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始提交日期" end-placeholder="结束提交日期" />
  587. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search2">搜索</el-button>
  588. <el-button v-waves v-if="isPurchaseSap" class="filter-item" type="primary" @click="sapUpload">SAP上传</el-button>
  589. <el-button v-waves v-if="isPurchaseSrm" class="filter-item" type="primary" @click="srmUpload">SRM上传</el-button>
  590. </div>
  591. <el-table
  592. :key="tableKey2"
  593. v-loading="listLoading2"
  594. element-loading-text="给我一点时间"
  595. :data="list2"
  596. border
  597. fit
  598. highlight-current-row
  599. style="width: 100%;"
  600. :row-style="rowStyle"
  601. :cell-style="cellStyle"
  602. class="elTable table-fixed"
  603. @sort-change="tableSort"
  604. @selection-change="change_table_selection"
  605. >
  606. <el-table-column type="selection" :selectable="checkboxInit" align="center" width="50" />
  607. <el-table-column label="序号" align="center" type="index" width="50px">
  608. <template slot-scope="scope">
  609. <span>{{ scope.$index + (pageNum2-1) * pageSize2 + 1 }}</span>
  610. </template>
  611. </el-table-column>
  612. <el-table-column label="牧场" min-width="110px" align="center">
  613. <template slot-scope="scope">
  614. <span>{{ scope.row.pastureName }}</span>
  615. </template>
  616. </el-table-column>
  617. <el-table-column label="采购单号" min-width="110px" align="center">
  618. <template slot-scope="scope">
  619. <span>{{ scope.row.buyeCode }}</span>
  620. </template>
  621. </el-table-column>
  622. <el-table-column label="供应商" min-width="130px" align="center">
  623. <template slot-scope="scope">
  624. <span>{{ scope.row.providerName }}</span>
  625. </template>
  626. </el-table-column>
  627. <el-table-column label="采购员" min-width="110px" align="center">
  628. <template slot-scope="scope">
  629. <span>{{ scope.row.empname }}</span>
  630. </template>
  631. </el-table-column>
  632. <el-table-column label="提交日期" sortable prop="buyerDate" min-width="110px" align="center" />
  633. <el-table-column label="最近到货日期" sortable prop="DoneDate" min-width="110px" align="center" />
  634. <el-table-column label="单据状态" min-width="80px" align="center" :formatter="statu" />
  635. <el-table-column prop="sapNumber" label="sap编码" min-width="80px" align="center">
  636. <template slot-scope="scope">
  637. <span>{{scope.row.sapNumber}}</span>
  638. </template>
  639. </el-table-column>
  640. <el-table-column prop
  641. <el-table-column prop="sapstatus" label="sap上传状态" min-width="80px" align="center">
  642. <template slot-scope="scope">
  643. <span v-show="scope.row.sapstatus == 1">上传失败</span>
  644. <span v-show="scope.row.sapstatus == -1">未上传</span>
  645. <span v-show="scope.row.sapstatus == 0">上传成功</span>
  646. </template>
  647. </el-table-column>
  648. <el-table-column prop="srmstatus" label="srm上传状态" min-width="80px" align="center">
  649. <template slot-scope="scope">
  650. <span v-show="scope.row.srmstatus == 1">上传失败</span>
  651. <span v-show="scope.row.srmstatus == -1">未上传</span>
  652. <span v-show="scope.row.srmstatus == 0">上传成功</span>
  653. </template>
  654. </el-table-column>
  655. <el-table-column label="操作" align="center" width="250px" class-name="small-padding fixed-width" fixed="right">
  656. <template slot-scope="{row}">
  657. <el-button v-if="isPurchaseSee" type="primary" size="mini" @click="form_see2(row)">查看</el-button>
  658. <el-button v-if="(row.statu === 2 || row.statu === 4) && isPurchaseClose" style="display:none" type="danger" size="mini" @click="handleClose2(row)">关闭</el-button>
  659. <el-button v-else-if="isPurchaseClose" style="display:inline-block" type="danger" size="mini" @click="handleClose2(row)">关闭</el-button>
  660. </template>
  661. </el-table-column>
  662. </el-table>
  663. <pagination v-show="total2>0" :total="total2" :page.sync="getdataListParm2.offset" :limit.sync="getdataListParm2.pagecount" @pagination="get_table_data2" />
  664. <el-dialog :title="textMap[dialogStatusSee2]" :visible.sync="dialogFormVisibleSee2" :close-on-click-modal="false">
  665. <div class="app-contentSee">
  666. <el-form
  667. ref="temp2"
  668. :rules="rules"
  669. :model="temp2"
  670. label-position="right"
  671. label-width="80px"
  672. style="width: 800px;margin-bottom:30px"
  673. >
  674. <el-row>
  675. <el-col :span="8">
  676. <el-form-item label="采购单号:" prop="buyeCode">
  677. <span>{{ temp2.buyeCode }}</span>
  678. </el-form-item>
  679. </el-col>
  680. <el-col :span="6">
  681. <el-form-item label="供应商:" prop="providerName">
  682. <span>{{ temp2.providerName }}</span>
  683. </el-form-item>
  684. </el-col>
  685. <el-col :span="5">
  686. <el-form-item label="采购员:" prop="empname">
  687. <span>{{ temp2.empname }}</span>
  688. </el-form-item>
  689. </el-col>
  690. <el-col :span="5">
  691. <el-form-item label="提交日期:" prop="buyerDate">
  692. <span>{{ temp2.buyerDate }}</span>
  693. </el-form-item>
  694. </el-col>
  695. </el-row>
  696. </el-form>
  697. <el-table
  698. :key="tableKeySee2"
  699. v-loading="listLoadingSee2"
  700. element-loading-text="给我一点时间"
  701. :data="listSee2"
  702. border
  703. fit
  704. highlight-current-row
  705. style="width: 100%;margin-bottom:100px"
  706. :row-style="rowStyle"
  707. :cell-style="cellStyle"
  708. class="elTable table-fixed"
  709. @sort-change="tableSort2"
  710. >
  711. <el-table-column label="序号" align="center" type="index" width="50px" />
  712. <el-table-column label="备件编号" min-width="110px" align="center">
  713. <template slot-scope="scope">
  714. <span>{{ scope.row.partCode }}</span>
  715. </template>
  716. </el-table-column>
  717. <el-table-column label="备件名称" min-width="110px" align="center">
  718. <template slot-scope="scope">
  719. <span>{{ scope.row.partName }}</span>
  720. </template>
  721. </el-table-column>
  722. <el-table-column label="备件规格" min-width="110px" align="center">
  723. <template slot-scope="scope">
  724. <span>{{ scope.row.specification }}</span>
  725. </template>
  726. </el-table-column>
  727. <el-table-column label="备件图片" min-width="110px" align="center">
  728. <template slot-scope="scope">
  729. <el-popover placement="right" title="" trigger="hover">
  730. <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
  731. <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  732. </el-popover>
  733. </template>
  734. </el-table-column>
  735. <el-table-column label="备件品牌" min-width="110px" align="center">
  736. <template slot-scope="scope">
  737. <span>{{ scope.row.brand }}</span>
  738. </template>
  739. </el-table-column>
  740. <el-table-column label="计量单位" min-width="130px" align="center">
  741. <template slot-scope="scope">
  742. <span>{{ scope.row.unit }}</span>
  743. </template>
  744. </el-table-column>
  745. <el-table-column sortable prop="price" label="单价(元)" min-width="110px" align="center">
  746. <template slot-scope="scope">
  747. <span>{{ scope.row.price }}</span>
  748. </template>
  749. </el-table-column>
  750. <el-table-column sortable prop="sumAmount" label="申购数量" min-width="110px" align="center">
  751. <template slot-scope="scope">
  752. <span>{{ scope.row.sumAmount }}</span>
  753. </template>
  754. </el-table-column>
  755. <el-table-column sortable prop="amount" label="采购数量" min-width="130px" align="center">
  756. <template slot-scope="scope">
  757. <span>{{ scope.row.amount }}</span>
  758. </template>
  759. </el-table-column>
  760. <el-table-column sortable prop="sumPrice" label="总价(元)" min-width="110px" align="center">
  761. <template slot-scope="scope">
  762. <span>{{ scope.row.sumPrice }}</span>
  763. </template>
  764. </el-table-column>
  765. <el-table-column sortable prop="receiveAmount" label="入库数" min-width="110px" align="center">
  766. <template slot-scope="scope">
  767. <span>{{ scope.row.receiveAmount }}</span>
  768. </template>
  769. </el-table-column>
  770. <el-table-column prop="SGremark" label="备注" min-width="110px" align="center">
  771. <template slot-scope="scope">
  772. <span>{{ scope.row.SGremark }}</span>
  773. </template>
  774. </el-table-column>
  775. </el-table>
  776. <div class="sum" style="right:30px;position:absolute;bottom:90px">
  777. <b>总计:{{ temp2.sumPrices }}元</b>
  778. </div>
  779. <div class="stuts" style="left:30px;position:absolute;bottom:70px">
  780. <b>单据状态:{{ temp2.statu }}</b>
  781. <b v-if="isStatu">关闭原因:{{ temp2.note }}</b>
  782. <div v-if="isExtensionDays">延期天数:{{ temp2.extensionDays }}</div>
  783. </div>
  784. <div
  785. slot="footer"
  786. class="dialog-footer"
  787. style="right:30px;position:absolute;bottom:10px"
  788. >
  789. <el-button @click="dialogFormVisibleSee2 = false;get_table_data2()">关闭</el-button>
  790. </div>
  791. </div>
  792. </el-dialog>
  793. <el-dialog :title="textMap[dialogStatusClose]" :visible.sync="dialogFormVisibleClose" :close-on-click-modal="false" style="width:70%;margin: 0 auto">
  794. <div class="app-contentClose">
  795. <el-form
  796. ref="temp2"
  797. :rules="rules"
  798. :model="temp2"
  799. label-position="right"
  800. label-width="80px"
  801. style="width: 300px;margin-bottom:30px"
  802. >
  803. <el-row>
  804. <el-col :span="24">
  805. <el-form-item label="采购单号:" prop="orderNo">
  806. <span>{{ temp2.buyeCode }}</span>
  807. </el-form-item>
  808. </el-col>
  809. </el-row>
  810. <el-row>
  811. <el-col :span="24">
  812. <el-form-item label="" prop="note">
  813. <el-input ref="note" v-model="temp2.note" type="textarea" placeholder="请输入关闭该采购单原因" />
  814. </el-form-item>
  815. </el-col>
  816. </el-row>
  817. </el-form>
  818. <div
  819. slot="footer"
  820. class="dialog-footer"
  821. style="right:30px;position:absolute;bottom:10px"
  822. >
  823. <el-button @click="dialogFormVisibleClose = false;get_table_data2();">取消</el-button>
  824. <el-button type="primary" :disabled="isokDisable" @click="closeData()">确认关闭</el-button>
  825. </div>
  826. </div>
  827. </el-dialog>
  828. </div>
  829. </el-tab-pane>
  830. <el-tab-pane label="采购明细" name="third">
  831. <div class="procurementDetails">
  832. <div class="filter-container">
  833. <el-select v-model="getdataListParm3.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item">
  834. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  835. </el-select>
  836. <el-input v-model="getdataListParm3.parammaps.partCode" placeholder="备件编号" style="width: 200px;" class="filter-item" />
  837. <el-input v-model="getdataListParm3.parammaps.partName" placeholder="备件名称" style="width: 140px;" class="filter-item" />
  838. <el-autocomplete v-model="getdataListParm3.parammaps.providerName" value-key="providerName" class="inline-input" :fetch-suggestions="providerSearch" placeholder="供应商" style="width:150px;top:-3px;" @select="handleSelectProvider" />
  839. <el-input v-model="getdataListParm3.parammaps.matchCode" placeholder="配单号" style="width: 140px;" class="filter-item" />
  840. <el-input v-model="getdataListParm3.parammaps.buyeCode" placeholder="采购单号" style="width: 140px;" class="filter-item" />
  841. <el-select v-model="getdataListParm3.parammaps.isStorage" clearable placeholder="到货情况" class="filter-item" style="width: 120px;">
  842. <el-option v-for="item in isStorages" :key="item.id" :label="item.name" :value="item.id" />
  843. </el-select>
  844. <el-date-picker ref="inputDatetime3" v-model="getdataListParm3.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 270px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
  845. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search3">搜索</el-button>
  846. <el-button v-if="isPurchaseExport" class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-edit" @click="handleDownload3">导出</el-button>
  847. </div>
  848. <el-table
  849. :key="tableKey3"
  850. v-loading="listLoading3"
  851. element-loading-text="给我一点时间"
  852. :data="list3"
  853. border
  854. fit
  855. highlight-current-row
  856. style="width: 100%;"
  857. :row-style="rowStyle"
  858. :cell-style="cellStyle"
  859. class="elTable table-fixed"
  860. @sort-change="tableSort"
  861. :max-height="myHeight"
  862. >
  863. <el-table-column label="序号" align="center" type="index" width="50px">
  864. <template slot-scope="scope">
  865. <span>{{ scope.$index + (pageNum3-1) * pageSize3 + 1 }}</span>
  866. </template>
  867. </el-table-column>
  868. <el-table-column label="牧场" min-width="110px" align="center">
  869. <template slot-scope="scope">
  870. <span>{{ scope.row.pastureName }}</span>
  871. </template>
  872. </el-table-column>
  873. <el-table-column label="配单号" min-width="110px" align="center">
  874. <template slot-scope="scope">
  875. <span>{{ scope.row.matchCode }}</span>
  876. </template>
  877. </el-table-column>
  878. <el-table-column label="采购单号" min-width="110px" align="center">
  879. <template slot-scope="scope">
  880. <span>{{ scope.row.buyeCode }}</span>
  881. </template>
  882. </el-table-column>
  883. <el-table-column label="备件编号" min-width="110px" align="center">
  884. <template slot-scope="scope">
  885. <span>{{ scope.row.partCode }}</span>
  886. </template>
  887. </el-table-column>
  888. <el-table-column label="备件名称" min-width="130px" align="center">
  889. <template slot-scope="scope">
  890. <span>{{ scope.row.partName }}</span>
  891. </template>
  892. </el-table-column>
  893. <el-table-column label="备件规格" min-width="130px" align="center">
  894. <template slot-scope="scope">
  895. <span>{{ scope.row.specification }}</span>
  896. </template>
  897. </el-table-column>
  898. <el-table-column label="备件品牌" min-width="130px" align="center">
  899. <template slot-scope="scope">
  900. <span>{{ scope.row.brand }}</span>
  901. </template>
  902. </el-table-column>
  903. <el-table-column label="计量单位" min-width="130px" align="center">
  904. <template slot-scope="scope">
  905. <span>{{ scope.row.unit }}</span>
  906. </template>
  907. </el-table-column>
  908. <el-table-column label="供应商" min-width="110px" align="center">
  909. <template slot-scope="scope">
  910. <span>{{ scope.row.providerName }}</span>
  911. </template>
  912. </el-table-column>
  913. <el-table-column sortable prop="price" label="单价" min-width="110px" align="center">
  914. <template slot-scope="scope">
  915. <span>{{ scope.row.price }}</span>
  916. </template>
  917. </el-table-column>
  918. <el-table-column sortable prop="sumAmount" label="申购数量" min-width="110px" align="center">
  919. <template slot-scope="scope">
  920. <span>{{ scope.row.sumAmount }}</span>
  921. </template>
  922. </el-table-column>
  923. <el-table-column sortable prop="amount" label="采购数量" min-width="110px" align="center">
  924. <template slot-scope="scope">
  925. <span>{{ scope.row.amount }}</span>
  926. </template>
  927. </el-table-column>
  928. <el-table-column sortable prop="receiveAmount" label="入库数" min-width="110px" align="center">
  929. <template slot-scope="scope">
  930. <span>{{ scope.row.receiveAmount }}</span>
  931. </template>
  932. </el-table-column>
  933. <el-table-column label="申购部门" min-width="110px" align="center">
  934. <template slot-scope="scope">
  935. <span>{{ scope.row.departmentName }}</span>
  936. </template>
  937. </el-table-column>
  938. <el-table-column label="采购人" min-width="110px" align="center">
  939. <template slot-scope="scope">
  940. <span>{{ scope.row.empname }}</span>
  941. </template>
  942. </el-table-column>
  943. <el-table-column label="配单日期" sortable prop="buyerDate" min-width="110px" align="center" />
  944. <!-- <el-table-column label="备注" min-width="110px" align="center">
  945. <template slot-scope="scope">
  946. <span>{{ scope.row.note }}</span>
  947. </template>
  948. </el-table-column> -->
  949. </el-table>
  950. <pagination v-show="total3>=0" :total="total3" :page.sync="getdataListParm3.offset" :limit.sync="getdataListParm3.pagecount" @pagination="get_table_data3" />
  951. </div>
  952. </el-tab-pane>
  953. </el-tabs>
  954. </div>
  955. </template>
  956. <script>
  957. // 引入
  958. import { GetDataByName, GetDataByNames, ExecDataByConfig, PostDataByName, failproccess, checkButtons, GetAccount,SapOrder,SrmOrder } from '@/api/common'
  959. import waves from '@/directive/waves' // waves directive
  960. import Pagination from '@/components/Pagination' // secondary package based on el-pagination
  961. import Cookies from 'js-cookie'
  962. import { parseTime, sortChange, json2excel } from '@/utils/index.js'
  963. export default {
  964. name: 'Purchase',
  965. components: { Pagination },
  966. directives: { waves },
  967. filters: {
  968. keepTwoNum(value) {
  969. value = Number(value)
  970. return value.toFixed(3)
  971. },
  972. keepTwoNum2(value) {
  973. value = Number(value)
  974. return value.toFixed(2)
  975. }
  976. },
  977. data() {
  978. return {
  979. myHeight:document.documentElement.clientHeight - 85- 150,
  980. isSap:1,
  981. isSrm:1,
  982. selectList: [],
  983. isPurchaseSap: [],isPurchaseSrm: [],
  984. isPurchaseSee: [], isPurchaseClose: [], isPurchaseExport: [], isDistributionSheet: [], isDistributionManagement: [], isExamineDM: [],
  985. stripe: true,
  986. activeName: 'first',
  987. listLoading1: false,
  988. tableKey1: 0,
  989. list1: [],
  990. confirmationSheetDisabled: false,
  991. isokDisable: false,
  992. pickerOptions: {
  993. disabledDate(time) {
  994. return time.getTime() > Date.now() // 当天之前的时间可选
  995. }
  996. },
  997. temp: {},
  998. total: 0,
  999. total1: 0,
  1000. listParmConfirmation: [],
  1001. listConfirmationSheet: null,
  1002. getParmPurchaseOrderNumber: {
  1003. name: 'autoCreatCode',
  1004. page: 1,
  1005. offset: 1,
  1006. returntype: 'Map',
  1007. parammaps: {
  1008. pastureId: Cookies.get('pastureid'),
  1009. codeType: 'CG'
  1010. }
  1011. },
  1012. postDataPramas: {},
  1013. requestProvider: {
  1014. name: 'getProviderList',
  1015. page: 1,
  1016. offset: 1,
  1017. pagecount: 10,
  1018. returntype: 'Map',
  1019. parammaps: {}
  1020. },
  1021. listLoading2: false,
  1022. tableKey2: 0,
  1023. list2: [],
  1024. status2: [
  1025. { id: '0', name: '审核中' },
  1026. { id: '1', name: '审核通过' },
  1027. { id: '2', name: '审核驳回' }
  1028. ],
  1029. status: [
  1030. { id: '0', name: '未到货' },
  1031. { id: '1', name: '部分到货' },
  1032. { id: '2', name: '按时到货' },
  1033. { id: '3', name: '已延期' },
  1034. { id: '4', name: '已关闭' },
  1035. { id: '5', name: '部分到货-延期' },
  1036. { id: '6', name: '全部到货-延期' }
  1037. ],
  1038. isStorages: [
  1039. { id: '0', name: '未入库' },
  1040. { id: '1', name: '已入库' }
  1041. ],
  1042. isStatu: false,
  1043. listLoadingSee2: false,
  1044. tableKeySee2: 0,
  1045. total2: 0,
  1046. total3: 0,
  1047. listLoading3: false,
  1048. tableKey3: 0,
  1049. list3: [],
  1050. findAllEmploye: [],
  1051. findAllPasture: [],
  1052. requestParams: [
  1053. { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
  1054. { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}
  1055. ],
  1056. getdataListParm1: {
  1057. name: 'getbuydetailParts',
  1058. page: 1,
  1059. // offset: 1,
  1060. // pagecount: 10,
  1061. returntype: 'Map',
  1062. parammaps: {
  1063. pastureId: Cookies.get('pastureid')
  1064. }
  1065. },
  1066. getdataListPart: {
  1067. name: 'getpartpurchasebg',
  1068. page: 1,
  1069. // offset: 1,
  1070. // pagecount: 10,
  1071. returntype: 'Map',
  1072. parammaps: {
  1073. id: Cookies.get('pastureid')
  1074. }
  1075. },
  1076. partData: [],
  1077. getParmCreateNumber: {
  1078. name: 'autoCreatCode',
  1079. page: 1,
  1080. offset: 1,
  1081. returntype: 'Map',
  1082. parammaps: {
  1083. pastureId: Cookies.get('pastureid'),
  1084. codeType: 'PD'
  1085. }
  1086. },
  1087. pageNum1: 0,
  1088. pageSize1: 0,
  1089. temp1: {
  1090. pastureId: Cookies.get('pastureid'),
  1091. buyerPerson: this.$store.state.user.employeid,
  1092. buyerDate: parseTime(new Date(), '{y}-{m}-{d}')
  1093. },
  1094. getdataListParm2: {
  1095. name: 'getBigbuydetailList',
  1096. page: 1,
  1097. offset: 1,
  1098. pagecount: 10,
  1099. returntype: 'Map',
  1100. parammaps: {
  1101. providerName: '',
  1102. buyeCode: '',
  1103. inputDatetime: '',
  1104. // pastureId: Cookies.get('pastureid'),
  1105. pastureName: Cookies.get('pasturename')
  1106. }
  1107. },
  1108. dialogFormVisibleConfirmation: false,
  1109. dialogStatusConfirmation: '',
  1110. pageNum2: 0,
  1111. pageSize2: 0,
  1112. temp2: {
  1113. note: ''
  1114. },
  1115. getdataListParm3: {
  1116. name: 'getbuydetailList',
  1117. page: 1,
  1118. offset: 1,
  1119. pagecount: 10,
  1120. returntype: 'Map',
  1121. parammaps: {
  1122. pastureName: Cookies.get('pasturename'),
  1123. providerName: '',
  1124. partCode: '',
  1125. partName: '',
  1126. matchCode: '',
  1127. buyeCode: '',
  1128. isStorage: '',
  1129. startTime: '',
  1130. stopTime: '',
  1131. inputDatetime: ''
  1132. }
  1133. },
  1134. isExtensionDays: false,
  1135. listSee2: [],
  1136. getdataListSee2: {
  1137. name: 'getbuydetailListbyBig',
  1138. returntype: 'Map',
  1139. parammaps: {}
  1140. },
  1141. requestParamStute: {
  1142. name: 'updateBigbuydetailStatu',
  1143. returntype: 'Map',
  1144. parammaps: {}
  1145. },
  1146. pageNum3: 0,
  1147. pageSize3: 0,
  1148. temp3: {},
  1149. dialogFormVisibleSee2: false,
  1150. dialogStatusSee2: '',
  1151. // 配单管理
  1152. listLoading4: false,
  1153. tableKey4: 0,
  1154. list4: [],
  1155. pageNum4: 0,
  1156. pageSize4: 0,
  1157. total4: 0,
  1158. getdataListParm4: {
  1159. name: 'getbigpartdeallist',
  1160. page: 1,
  1161. offset: 1,
  1162. pagecount: 10,
  1163. returntype: 'Map',
  1164. parammaps: {
  1165. pastureName: Cookies.get('pasturename'),
  1166. matchCode: '',
  1167. statue: '',
  1168. inputDatetime: '',
  1169. startTime: '',
  1170. stopTime: ''
  1171. }
  1172. },
  1173. dialogFormVisibleSee4: false,
  1174. dialogStatusSee4: '',
  1175. temp4: {},
  1176. listSee4: [],
  1177. tableKeySee4: 0,
  1178. listLoadingSee4: false,
  1179. getdataListSee4: {
  1180. name: 'getbigpartdealdetiallist',
  1181. returntype: 'Map',
  1182. parammaps: {}
  1183. },
  1184. activeList: [],
  1185. active: 3,
  1186. currentRow:{},
  1187. dialogStatusUpdate4: '',
  1188. dialogFormVisibleUpdate4: false,
  1189. updateTemp4: {},
  1190. listUpdate4: [],
  1191. tableKeyUpdate4: 0,
  1192. listLoadingUpdate4: false,
  1193. dialogFormVisible_Examine: false,
  1194. dialogStatus_Examine: '',
  1195. examineTemp: {
  1196. SHstatue: 1,
  1197. workflowNote: ''
  1198. },
  1199. statueReason: false,
  1200. dialogFormVisibleClose: false,
  1201. dialogStatusClose: '',
  1202. textMap: {
  1203. confirmation: '确认配单',
  1204. see: '查看详情',
  1205. close: '关闭提示',
  1206. examine: '审核',
  1207. update: '编辑'
  1208. },
  1209. // 校验规则
  1210. rules: {
  1211. equipmentName: [{ required: true, message: '必填', trigger: 'blur' }],
  1212. note: [{ required: true, message: '必填', trigger: 'blur' }]
  1213. },
  1214. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  1215. cellStyle: { padding: 0 + 'px' },
  1216. buttons: [],
  1217. downloadListParm3: {},
  1218. downloadList3: [],
  1219. isPercentage: false,
  1220. percentage: 1
  1221. }
  1222. },
  1223. created() {
  1224. const that = this
  1225. // GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
  1226. // that.buttons = response.data.list
  1227. // that.get_auto_buttons()
  1228. // if (this.isDistributionSheet == true) {
  1229. // this.activeName = 'first'
  1230. // console.log(1, this.isDistributionSheet, this.isDistributionManagement)
  1231. // } else if (this.isDistributionManagement == true) {
  1232. // this.activeName = 'fouth'
  1233. // console.log(2, this.isDistributionSheet, this.isDistributionManagement)
  1234. // } else if (this.isDistributionSheet == false && this.isDistributionManagement == false) {
  1235. // this.activeName = 'second'
  1236. // console.log(3, this.isDistributionSheet, this.isDistributionManagement)
  1237. // }
  1238. // })
  1239. // this.get_select_list()
  1240. // this.get_table_data1()
  1241. // this.get_table_data2()
  1242. // this.get_table_data3()
  1243. // this.get_table_data4()
  1244. // if (this.$route.query.activeName !== undefined) {
  1245. // this.activeName = this.$route.query.activeName
  1246. // }
  1247. },
  1248. methods: {
  1249. tableSort(column) {
  1250. if (this.activeName == 'first') {
  1251. sortChange(column, this.list1)
  1252. } else if (this.activeName == 'second') {
  1253. sortChange(column, this.list2)
  1254. } else if (this.activeName == 'third') {
  1255. sortChange(column, this.list3)
  1256. } else if (this.activeName == 'fouth') {
  1257. sortChange(column, this.list4)
  1258. }
  1259. },
  1260. tableSort2(column) {
  1261. sortChange(column, this.listSee2)
  1262. },
  1263. get_auto_buttons() {
  1264. const DistributionSheet = 'customs:purchase:distributionSheet'
  1265. const isDistributionSheet = checkButtons(this.$store.state.user.buttons, DistributionSheet)
  1266. this.isDistributionSheet = isDistributionSheet
  1267. const PurchaseSee = 'customs:purchase:see'
  1268. const isPurchaseSee = checkButtons(this.$store.state.user.buttons, PurchaseSee)
  1269. this.isPurchaseSee = isPurchaseSee
  1270. const PurchaseClose = 'customs:purchase:close'
  1271. const isPurchaseClose = checkButtons(this.$store.state.user.buttons, PurchaseClose)
  1272. this.isPurchaseClose = isPurchaseClose
  1273. const PurchaseSap = 'customs:purchase:sap'
  1274. const isPurchaseSap = checkButtons(this.$store.state.user.buttons, PurchaseSap)
  1275. this.isPurchaseSap = isPurchaseSap
  1276. const PurchaseSrm = 'customs:purchase:srm'
  1277. const isPurchaseSrm = checkButtons(this.$store.state.user.buttons, PurchaseSrm)
  1278. this.isPurchaseSrm = isPurchaseSrm
  1279. const PurchaseExport = 'customs:purchase:export'
  1280. const isPurchaseExport = checkButtons(this.$store.state.user.buttons, PurchaseExport)
  1281. this.isPurchaseExport = isPurchaseExport
  1282. const ExamineDM = 'customs:purchase:shenhe'
  1283. const isExamineDM = checkButtons(this.$store.state.user.buttons, ExamineDM)
  1284. this.isExamineDM = isExamineDM
  1285. const DistributionManagement = 'customs:purchase:peidanjiemian'
  1286. const isDistributionManagement = checkButtons(this.$store.state.user.buttons, DistributionManagement)
  1287. this.isDistributionManagement = isDistributionManagement
  1288. },
  1289. cellClick(row, column, cell, event) {
  1290. console.log(cell)
  1291. console.log('column', column)
  1292. console.log('行索引', row.id)
  1293. console.log('列索引', column.id)
  1294. return {
  1295. background: '#eceb3c'
  1296. }
  1297. // console.log('event',event)
  1298. },
  1299. tableRowStyle({ row, rowIndex }) {
  1300. console.log(row, row)
  1301. console.log(' row.isParity', row.isParity)
  1302. console.log(parseInt(row.isParity) % 2 == 0)
  1303. if (parseInt(row.isParity) % 2 == 0) {
  1304. return {
  1305. background: '#eee'
  1306. }
  1307. }
  1308. return {
  1309. background: ''
  1310. }
  1311. },
  1312. tableCellStyle({ row, column, rowIndex, columnIndex }) {
  1313. if (row.isNo == 'No' && columnIndex === 10) {
  1314. return {
  1315. background: 'red'
  1316. }
  1317. }
  1318. return {
  1319. background: ''
  1320. }
  1321. },
  1322. handleClick(tab, event) {
  1323. console.log(tab, event)
  1324. if (tab.name === 'first') {
  1325. this.get_table_data1()
  1326. } else if (tab.name === 'fouth') {
  1327. this.get_table_data4()
  1328. } else if (tab.name === 'second') {
  1329. this.get_table_data2()
  1330. } else if (tab.name === 'third') {
  1331. this.get_table_data3()
  1332. }
  1333. },
  1334. get_select_list() {
  1335. GetDataByNames(this.requestParams).then(response => {
  1336. this.findAllEmploye = response.data.findAllEmploye.list
  1337. this.findAllPasture = response.data.findAllPasture.list
  1338. })
  1339. },
  1340. providerSearch(queryString, cb) {
  1341. console.log('供应商模糊查询输入值', queryString)
  1342. this.requestProvider.parammaps['providerName'] = queryString
  1343. GetDataByName(this.requestProvider).then(response => {
  1344. console.log('供应商模糊查询搜索data', response.data.list)
  1345. cb(response.data.list)
  1346. })
  1347. },
  1348. handleSelectProvider(item) {
  1349. console.log('供应商模糊查询选中值', item)
  1350. },
  1351. get_table_data1() {
  1352. this.listLoading1 = true
  1353. GetDataByName(this.getdataListPart).then(response => {
  1354. console.log(response)
  1355. this.partData = response.data.list
  1356. })
  1357. GetDataByName(this.getdataListParm1).then(response => {
  1358. console.log('this.list1', response.data.list)
  1359. if (response.data.list === null) {
  1360. this.list1 = []
  1361. this.confirmationSheetDisabled = true
  1362. } else {
  1363. // eslint-disable-next-line no-unused-vars
  1364. var list1
  1365. list1 = response.data.list
  1366. var result = []
  1367. list1.forEach((i, j) => {
  1368. // eslint-disable-next-line no-irregular-whitespace
  1369. Array.from(new Set(list1.map(function(item) { return item.partCode }))).forEach((x, y) => {
  1370. if (i.partCode === x) {
  1371. result.push({
  1372. 'amount': i.amount,
  1373. 'amountPre': i.amountPre,
  1374. 'bigId': i.bigId,
  1375. 'brand': i.brand,
  1376. 'brandId': i.brandId,
  1377. 'contractCode': i.contractCode,
  1378. 'count': i.count,
  1379. 'enable': i.enable,
  1380. 'id': i.id,
  1381. 'inventoryType': i.inventoryType,
  1382. 'isZeroStock': i.isZeroStock,
  1383. 'orderNumber': i.orderNumber,
  1384. 'partCode': i.partCode,
  1385. 'partId': i.partId,
  1386. 'partName': i.partName,
  1387. 'pastureId': i.pastureId,
  1388. 'pastureName': i.pastureName,
  1389. 'planAmount': i.planAmount,
  1390. 'price': i.price,
  1391. 'providerId': i.providerId,
  1392. 'providerName': i.providerName,
  1393. 'purpose': i.purpose,
  1394. 'remark': i.remark,
  1395. 'specification': i.specification,
  1396. 'sumAmount': i.sumAmount,
  1397. 'unit': i.unit,
  1398. 'isNo': i.isNo,
  1399. 'srcpath': i.srcpath,
  1400. 'picpath': i.picpath,
  1401. 'departmentName': i.departmentName,
  1402. 'isParity': y
  1403. })
  1404. }
  1405. })
  1406. })
  1407. console.log(result)
  1408. if (result !== null) {
  1409. for (let i = 0; i < result.length; i++) {
  1410. console.log(result[i].srcpath)
  1411. if (result[i].srcpath !== null && result[i].picpath !== null && result[i].srcpath !== undefined && result[i].picpath !== undefined) {
  1412. result[i].srcpath = process.env.VUE_APP_BASE_API + result[i].srcpath
  1413. result[i].picpath = process.env.VUE_APP_BASE_API + result[i].picpath
  1414. } else {
  1415. // this.$set(result[i], 'srcpath', '')
  1416. // this.$set(result[i], 'picpath', '')
  1417. result[i].srcpath = ''
  1418. result[i].picpath = ''
  1419. }
  1420. }
  1421. }
  1422. // console.log(result)
  1423. this.list1 = result
  1424. console.log('处理后table数', this.list1)
  1425. this.confirmationSheetDisabled = false
  1426. }
  1427. var tem = ''
  1428. for (var i = 0; i < this.list1.length; i++) {
  1429. if (tem !== this.list1[i].partCode) {
  1430. this.list1[i].amount = this.list1[i].sumAmount
  1431. tem = this.list1[i].partCode
  1432. } else {
  1433. this.list1[i].amount = 0
  1434. }
  1435. }
  1436. // var a = 0
  1437. // var b = 0
  1438. // for (var i = 0; i < this.list1.length; i++) {
  1439. // if (parseInt(this.list1[i].amountPre) !== 0) {
  1440. // console.log(parseInt(this.list1[i].amountPre))
  1441. // if (a <= 0) {
  1442. // a = this.list1[i].count - 1
  1443. // if (b === 0) {
  1444. // b = parseInt(this.list1[i].amountPre)
  1445. // }
  1446. // } else {
  1447. // a--
  1448. // }
  1449. // if (b > 0) {
  1450. // this.list1[i].amount = this.list1[i].amount + 1
  1451. // b--
  1452. // }
  1453. // }
  1454. // }
  1455. if (response.data.total) {
  1456. this.total1 = response.data.total
  1457. }
  1458. // Just to simulate the time of the request
  1459. setTimeout(() => {
  1460. this.listLoading1 = false
  1461. }, 300)
  1462. })
  1463. },
  1464. confirmationSheet() {
  1465. console.log('点击立确认配单')
  1466. this.temp1.matchCode = ''
  1467. console.log(this.list1) // table表格数据
  1468. // -------------------------------------------
  1469. function groupBy1(array, f) {
  1470. var groups1 = {}
  1471. array.forEach(function(o) {
  1472. var group2 = JSON.stringify(f(o))
  1473. console.log("group2",group2)
  1474. groups1[group2] = groups1[group2] || []
  1475. groups1[group2].push(o)
  1476. })
  1477. return Object.keys(groups1).map(function(group2) {
  1478. return groups1[group2]
  1479. })
  1480. }
  1481. var sorted1 = groupBy1(this.list1, function(item) {
  1482. return [item.partCode]
  1483. })
  1484. console.log('表格数据根据供应商分划', sorted1)
  1485. for (var i = 0; i < sorted1.length; i++) {
  1486. var b = 0
  1487. var c = 0
  1488. for (var j = 0; j < sorted1[i].length; j++) {
  1489. // eslint-disable-next-line no-self-compare
  1490. if (sorted1[i][j].partCode === sorted1[i][j].partCode) {
  1491. // console.log(sorted1[i][j])
  1492. var element = sorted1[i][j]
  1493. b += parseInt(element.amount)
  1494. c = parseInt(element.sumAmount)
  1495. // console.log("amount", element.amount);
  1496. }
  1497. }
  1498. if (b > c || b < c) {
  1499. console.log('No')
  1500. console.log(element.id)
  1501. for (var a = 0; a < this.list1.length; a++) {
  1502. if (element.id === this.list1[a].id) {
  1503. console.log(this.list1[a].partCode)
  1504. for (var b = 0; b < this.list1.length; b++) {
  1505. if (this.list1[b].partCode === this.list1[a].partCode) {
  1506. console.log(this.list1[b])
  1507. this.$set(this.list1[b], 'isNo', 'No')
  1508. } else {
  1509. this.$set(this.list1[b], 'isNo', 'Yes')
  1510. }
  1511. }
  1512. } else {
  1513. this.$set(this.list1[a], 'isNo', 'Yes')
  1514. }
  1515. }
  1516. console.log(b)
  1517. this.$message({
  1518. type: 'warning',
  1519. message: '同一备件多个供应商合计采购数量总和等于申购数量'
  1520. })
  1521. return
  1522. } else {
  1523. for (var a = 0; a < this.list1.length; a++) {
  1524. this.$set(this.list1[a], 'isNo', 'Yes')
  1525. var rulesAmount = /^[0-9]\d*$/
  1526. if (!rulesAmount.test(this.list1[a].amount)) {
  1527. this.$message({
  1528. type: 'error',
  1529. message: '采购数量请输入正整数',
  1530. duration: 2000
  1531. })
  1532. return false
  1533. }
  1534. }
  1535. // console.log('Yes')
  1536. }
  1537. }
  1538. this.getCreateNumber()
  1539. // -------------------------------------------
  1540. this.dialogStatusConfirmation = 'confirmation'
  1541. this.dialogFormVisibleConfirmation = true
  1542. console.log('确认配单data------', JSON.stringify(this.list1) )
  1543. // this.list1 = this.list1.filter(i => parseFloat(i.amount) !== 0)
  1544. console.log(this.list1)
  1545. console.log('根据供应商分类', sorted1)
  1546. console.log('根据供应商分类表格listConfirmationSheet', this.listConfirmationSheet)
  1547. // 处理渲染数据
  1548. var providerNameMap = {}
  1549. var providerNameDest = []
  1550. var departmentNameMap = {}
  1551. // // eslint-disable-next-line no-redeclare
  1552. // for (var i = 0; i < this.list1.length; i++) {
  1553. // console.log(this.list1[i])
  1554. // var ai = this.list1[i]
  1555. // var price = this.list1[i].price
  1556. // var amount = this.list1[i].amount
  1557. // // console.log(price, amount)
  1558. // var sumPrice = 0
  1559. // sumPrice = parseFloat(price) * parseFloat(amount)
  1560. // if (!providerNameMap[ai.providerName]) {
  1561. // providerNameDest.push({
  1562. // price: [price],
  1563. // amount: [amount],
  1564. // sumPrice: [sumPrice],
  1565. // providerId: ai.providerId,
  1566. // providerName: ai.providerName,
  1567. // purpose: ai.purpose,
  1568. // list: [ai]
  1569. // })
  1570. // providerNameMap[ai.providerName] = ai
  1571. // providerNameMap[ai.providerId] = ai
  1572. // } else {
  1573. // // eslint-disable-next-line no-redeclare
  1574. // for (var j = 0; j < providerNameDest.length; j++) {
  1575. // console.log(providerNameDest[j])
  1576. // var dj = providerNameDest[j]
  1577. // if (dj.providerName === ai.providerName) {
  1578. // dj.sumPrice.push(sumPrice)
  1579. // dj.price.push(price)
  1580. // // eslint-disable-next-line no-mixed-spaces-and-tabs
  1581. // dj.amount.push(amount)
  1582. // dj.list.push(ai)
  1583. // break
  1584. // }
  1585. // }
  1586. // }
  1587. // }
  1588. // var providerNameArray = []
  1589. // // eslint-disable-next-line no-redeclare
  1590. // for (var i = 0; i < this.list1.length; i++) {
  1591. // providerNameArray.push(this.list1[i].providerName)
  1592. // }
  1593. // // console.log('原供应商', providerNameArray)
  1594. // function unique(providerNameArray) {
  1595. // return Array.from(new Set(providerNameArray))
  1596. // }
  1597. // var uniqueProviderNameArray = unique(providerNameArray)
  1598. // console.log('去重后供应商', uniqueProviderNameArray) // ["泰森机电", "浩祥晟机电", "国宇商贸", "赛娜牧业"]
  1599. // // ------------------------------------------
  1600. // var OrderNumberArray = []
  1601. // this.postDataPramas.common = { 'returnmap': '0' }
  1602. // this.postDataPramas.data = []
  1603. // for (var i = 0; i < uniqueProviderNameArray.length; i++) {
  1604. // this.postDataPramas.data[i] = { 'name': 'autoCreatCode', 'type': 'sm', 'parammaps': {
  1605. // pastureId: Cookies.get('pastureid'),
  1606. // codeType: 'CG'
  1607. // }}
  1608. // }
  1609. // ExecDataByConfig(this.postDataPramas).then(response => {
  1610. // console.log('采购单请求发送参数', this.postDataPramas)
  1611. // for (var i = 0; i < response.data.length; i++) {
  1612. // // console.log(response.data[i].resultmaps[0].orderCode)
  1613. // OrderNumberArray.push(response.data[i].resultmaps[0].orderCode)
  1614. // }
  1615. // console.log(OrderNumberArray)
  1616. // this.listConfirmationSheet.map((item, index) => {
  1617. // item.orderNumber = OrderNumberArray[index]
  1618. // return item
  1619. // })
  1620. // this.$forceUpdate()
  1621. // })
  1622. // console.log(OrderNumberArray)
  1623. // this.listConfirmationSheet = providerNameDest
  1624. // // console.log(JSON.stringify(this.listConfirmationSheet))
  1625. // console.log('根据供应商分类表格listConfirmationSheet', this.listConfirmationSheet)
  1626. // var SumArray = []
  1627. // this.listConfirmationSheet.forEach((item, index) => {
  1628. // console.log(item.sumPrice)
  1629. // // console.log(item.sumPrice.reduce((count, v) => count + v, 0))
  1630. // SumArray.push(item.sumPrice.reduce((count, v) => count + v, 0).toFixed(3))
  1631. // })
  1632. // this.listConfirmationSheet.map((item, index) => {
  1633. // // console.log(item, index)
  1634. // item.Sum = SumArray[index]
  1635. // return item
  1636. // })
  1637. // console.log('根据供应商分类表格listConfirmationSheet', this.listConfirmationSheet)
  1638. // -------------------------------------------
  1639. },
  1640. getCreateNumber() {
  1641. GetDataByName(this.getParmCreateNumber).then(response => {
  1642. this.$nextTick(() => {
  1643. this.show = false
  1644. console.log('配单号', response.data.list[0].orderCode)
  1645. this.temp1.matchCode = response.data.list[0].orderCode
  1646. this.$forceUpdate()
  1647. })
  1648. })
  1649. },
  1650. confirmationSheetData() {
  1651. this.isokDisable = true
  1652. setTimeout(() => {
  1653. this.isokDisable = false
  1654. }, 1000)
  1655. console.log('点击了确认配单提交')
  1656. this.$refs['temp1'].validate(valid => {
  1657. if (valid) {
  1658. // orderNumber
  1659. if (this.temp1.matchCode == '' || this.temp1.matchCode == null || this.temp1.matchCode == undefined) {
  1660. this.getCreateNumber()
  1661. }
  1662. this.postDataPramas.common = { 'returnmap': '0' }
  1663. this.postDataPramas.data = []
  1664. console.log(this.listConfirmationSheet)
  1665. for (let i = 0; i < this.listConfirmationSheet.length; i++) {
  1666. if (this.listConfirmationSheet[i].orderNumber == null || this.listConfirmationSheet[i].orderNumber == undefined) {
  1667. this.$notify({
  1668. title: '保存失败',
  1669. message: '网络异常未生成采购单,请刷新后重新进行配单',
  1670. type: 'warning',
  1671. duration: 2000
  1672. })
  1673. return false
  1674. }
  1675. }
  1676. var a = this.listConfirmationSheet.length
  1677. this.listConfirmationSheet.forEach((item, index) => {
  1678. console.log(item)
  1679. this.postDataPramas.data[index] = { 'name': 'insertBigbuydetail', 'resultname': 'insertBigbuydetail' + index, 'type': 'e', 'parammaps': {
  1680. pastureId: Cookies.get('pastureid'),
  1681. buyeCode: item.orderNumber,
  1682. providerId: item.providerId,
  1683. buyerPerson: this.temp1.buyerPerson,
  1684. buyerDate: this.temp1.buyerDate,
  1685. matchCode: this.temp1.matchCode
  1686. }}
  1687. this.postDataPramas.data[a] = { 'name': 'insertSpotList', 'resultmaps': { 'list': item.list }}
  1688. this.postDataPramas.data[a].children = []
  1689. this.postDataPramas.data[a].children[0] = { 'name': 'insertbuydetail', 'type': 'e', 'parammaps': {
  1690. bigId: '@insertBigbuydetail' + index + '.LastInsertId',
  1691. pastureId: '@insertSpotList.pastureId',
  1692. contractCode: '@insertSpotList.contractCode',
  1693. amount: '@insertSpotList.amount',
  1694. sumAmount: '@insertSpotList.sumAmount',
  1695. contractId: '@insertSpotList.id',
  1696. departmentName: '@insertSpotList.departmentName',
  1697. remark: '@insertSpotList.purpose'
  1698. }}
  1699. a = a + 1
  1700. })
  1701. this.postDataPramas.data[a] = { 'name': 'insertSpotListbpp', 'resultmaps': { 'list': this.partData }}
  1702. this.postDataPramas.data[a].children = []
  1703. this.postDataPramas.data[a].children[0] = { 'name': 'updateBigpartpurchaseStatu', 'type': 'e', 'parammaps': {
  1704. id: '@insertSpotListbpp.id',
  1705. matchCode: this.temp1.matchCode
  1706. }}
  1707. this.postDataPramas.data.push({ 'name': 'insertbigpartdeal', 'type': 'e', 'parammaps': {
  1708. empId: this.temp1.buyerPerson,
  1709. pastureId: Cookies.get('pastureid'),
  1710. matchCode: this.temp1.matchCode
  1711. }}
  1712. )
  1713. ExecDataByConfig(this.postDataPramas).then(response => {
  1714. if (response.msg === 'fail') {
  1715. var buyeCode = new RegExp('buyeCode')
  1716. if (buyeCode.test(response.data)) {
  1717. this.$notify({
  1718. title: '',
  1719. message: '网络异常未生成采购单,请刷新后重新进行配单',
  1720. type: 'warning',
  1721. duration: 2000
  1722. })
  1723. } else {
  1724. this.$notify({
  1725. title: '保存失败',
  1726. message: response.data,
  1727. type: 'warning',
  1728. duration: 2000
  1729. })
  1730. }
  1731. } else {
  1732. this.dialogFormVisibleConfirmation = false
  1733. this.activeName = 'fouth'
  1734. this.get_table_data4()
  1735. this.$notify({
  1736. title: '',
  1737. message: '保存成功',
  1738. type: 'success',
  1739. duration: 2000
  1740. })
  1741. }
  1742. })
  1743. }
  1744. })
  1745. },
  1746. get_table_data2() {
  1747. this.listLoading2 = true
  1748. if (this.$refs['inputDatetime2'] !== undefined && this.$refs['inputDatetime2'].value !== null) {
  1749. this.getdataListParm2.parammaps.startTime = this.$refs['inputDatetime2'].value[0]
  1750. this.getdataListParm2.parammaps.stopTime = this.$refs['inputDatetime2'].value[1]
  1751. } else {
  1752. this.getdataListParm2.parammaps.startTime = ''
  1753. this.getdataListParm2.parammaps.stopTime = ''
  1754. }
  1755. GetDataByName(this.getdataListParm2).then(response => {
  1756. this.list2 = response.data.list
  1757. this.pageNum2 = response.data.pageNum
  1758. this.pageSize2 = response.data.pageSize
  1759. if (response.data.total) {
  1760. this.total2 = response.data.total
  1761. }
  1762. // Just to simulate the time of the request
  1763. setTimeout(() => {
  1764. this.listLoading2 = false
  1765. }, 300)
  1766. })
  1767. },
  1768. form_search2() {
  1769. this.listLoading = true
  1770. if (this.getdataListParm2.parammaps.inputDatetime === null) {
  1771. this.getdataListParm2.parammaps.inputDatetime = ''
  1772. }
  1773. this.getdataListParm2.offset = 1
  1774. this.get_table_data2()
  1775. },
  1776. statu: function(cellValue) {
  1777. if (cellValue.statu === 0) {
  1778. return '未到货'
  1779. } else if (cellValue.statu === 1) {
  1780. return '部分到货'
  1781. } else if (cellValue.statu === 2) {
  1782. return '按时到货'
  1783. } else if (cellValue.statu === 3) {
  1784. return '已延期'
  1785. } else if (cellValue.statu === 4) {
  1786. return '已关闭'
  1787. } else if (cellValue.statu === 5) {
  1788. return '部分到货-延期'
  1789. } else if (cellValue.statu === 6) {
  1790. return '全部到货-延期'
  1791. }
  1792. },
  1793. statue: function(cellValue) {
  1794. if (cellValue.statue === 0) {
  1795. return '审核中'
  1796. } else if (cellValue.statue === 1) {
  1797. return '审核通过'
  1798. } else if (cellValue.statue === 2) {
  1799. return '未通过'
  1800. }
  1801. },
  1802. form_see2(row) {
  1803. this.temp2 = Object.assign({}, row)
  1804. if (this.temp2.statu === 0) {
  1805. this.isStatu = false
  1806. this.temp2.statu = '未到货'
  1807. this.isExtensionDays = false
  1808. } else if (this.temp2.statu === 1) {
  1809. this.isStatu = false
  1810. this.temp2.statu = '部分到货'
  1811. this.isExtensionDays = false
  1812. } else if (this.temp2.statu === 2) {
  1813. this.isStatu = false
  1814. this.temp2.statu = '按时到货'
  1815. this.isExtensionDays = false
  1816. } else if (this.temp2.statu === 3) {
  1817. this.isStatu = false
  1818. this.temp2.statu = '已延期'
  1819. this.isExtensionDays = true
  1820. } else if (this.temp2.statu === 4) {
  1821. this.temp2.statu = '已关闭'
  1822. this.isStatu = true
  1823. this.isExtensionDays = false
  1824. } else if (this.temp2.statu === 5) {
  1825. this.isStatu = false
  1826. this.temp2.statu = '部分到货-延期'
  1827. this.isExtensionDays = true
  1828. } else if (this.temp2.statu === 6) {
  1829. this.isStatu = false
  1830. this.temp2.statu = '全部到货-延期'
  1831. this.isExtensionDays = true
  1832. }
  1833. this.dialogStatusSee2 = 'see'
  1834. this.dialogFormVisibleSee2 = true
  1835. this.getdataListSee2.parammaps.id = row.id
  1836. this.getSeeList2()
  1837. },
  1838. getSeeList2() {
  1839. GetDataByName(this.getdataListSee2).then(response => {
  1840. this.listSee2 = response.data.list
  1841. if (response.data.list !== null) {
  1842. for (let i = 0; i < response.data.list.length; i++) {
  1843. if (response.data.list[i].srcpath !== null && response.data.list[i].picpath !== null && response.data.list[i].srcpath !== undefined && response.data.list[i].picpath !== undefined) {
  1844. this.listSee2[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  1845. this.listSee2[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  1846. } else {
  1847. this.listSee2[i].srcpath = ''
  1848. this.listSee2[i].picpath = ''
  1849. }
  1850. }
  1851. }
  1852. console.log('查看下方table数据', response.data.list)
  1853. // this.pageNum2 = response.data.pageNum
  1854. // this.pageSize2 = response.data.pageSize
  1855. var sumArray = []
  1856. for (var i = 0; i < this.listSee2.length; i++) {
  1857. console.log()
  1858. sumArray.push(
  1859. this.listSee2[i].sumPrice
  1860. )
  1861. }
  1862. console.log('总价', sumArray)
  1863. var arrvalue = 0
  1864. for (var i = 0; i < sumArray.length; i++) {
  1865. console.log('table内总价每一个值', sumArray[i])
  1866. arrvalue += parseFloat(sumArray[i])// 数组的索引是从0开始的
  1867. }
  1868. this.temp2.sumPrices = arrvalue.toFixed(3)
  1869. setTimeout(() => {
  1870. this.listLoadingSee = false
  1871. }, 100)
  1872. })
  1873. },
  1874. resetCloseTemp() {
  1875. this.temp2.note = ''
  1876. },
  1877. handleClose2(row) {
  1878. this.resetCloseTemp()
  1879. this.temp2 = Object.assign({}, row)
  1880. this.dialogStatusClose = 'close'
  1881. this.dialogFormVisibleClose = true
  1882. },
  1883. handleCurrentChange(val) {
  1884. this.currentRow = val;
  1885. console.log("currentRow",this.currentRow)
  1886. },
  1887. sapUpload(){
  1888. const that = this
  1889. console.log("currentRow",this.currentRow.sapstatus)
  1890. var send_data = this.selectList
  1891. if(send_data.length == 0){
  1892. that.$notify({ title: '失败', message: '请勾选数据!' , type: 'error', duration: 2000 })
  1893. return false
  1894. }
  1895. console.log(that.isSap)
  1896. if(that.isSap == 1){
  1897. that.isSap = 0
  1898. SapOrder(send_data).then(response => {
  1899. console.log('response', response)
  1900. if (response.msg !== 'fail') {
  1901. that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
  1902. that.selectList = []
  1903. that.get_table_data2()
  1904. } else {
  1905. that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
  1906. }
  1907. })
  1908. } else {
  1909. that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击' , type: 'error', duration: 2000 })
  1910. }
  1911. setTimeout(() => {
  1912. that.isSap = 1
  1913. }, 3000)
  1914. // if(this.currentRow.sapstatus){
  1915. // if(this.currentRow.sapstatus != 0){
  1916. // const sapArr = this.currentRow.sapbuyeCode.split(",")
  1917. // console.log("sapArr",sapArr)
  1918. // sapArr.forEach(function(item){
  1919. // console.log("sapArr item",item)
  1920. // var send_data = {
  1921. // "code":item,
  1922. // "pastureid":Cookies.get('pastureid')
  1923. // }
  1924. // SapOrder(send_data).then(response => {
  1925. // console.log('response', response)
  1926. // if (response.msg !== 'fail') {
  1927. // that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
  1928. // that.get_table_data()
  1929. // } else {
  1930. // that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
  1931. // }
  1932. // })
  1933. // })
  1934. // }
  1935. // }
  1936. },
  1937. checkboxInit(row,index){
  1938. // console.log(row)
  1939. var data1 = new Date(row.creatTime)
  1940. var data2 = new Date('2022-10-25')
  1941. if(data1 > data2){ return 1 } else {return 0}
  1942. },
  1943. //监听 - 表格 - 勾选
  1944. change_table_selection(val) {
  1945. this.selectList = val
  1946. console.log('勾选数据selectList', this.selectList)
  1947. },
  1948. srmUpload(){
  1949. const that = this
  1950. console.log("currentRow",this.currentRow.srmstatus)
  1951. console.log('勾选数据selectList', this.selectList)
  1952. var send_data = this.selectList
  1953. if(send_data.length == 0){
  1954. that.$notify({ title: '失败', message: '请勾选数据!' , type: 'error', duration: 2000 })
  1955. return false
  1956. }
  1957. console.log(that.isSrm)
  1958. if(that.isSrm == 1){
  1959. that.isSrm = 0
  1960. SrmOrder(send_data).then(response => {
  1961. console.log('response', response)
  1962. if (response.msg !== 'fail') {
  1963. that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
  1964. that.selectList = []
  1965. that.get_table_data2()
  1966. } else {
  1967. that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
  1968. }
  1969. })
  1970. } else {
  1971. that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击' , type: 'error', duration: 2000 })
  1972. }
  1973. setTimeout(() => {
  1974. that.isSrm = 1
  1975. }, 3000)
  1976. // if(this.currentRow.srmstatus){
  1977. // if(this.currentRow.srmstatus != 0){
  1978. // const srmArr = this.currentRow.srmbuyeCode.split(",")
  1979. // console.log("srmArr",srmArr)
  1980. // srmArr.forEach(function(item){
  1981. // console.log("srmArr item",item)
  1982. // var send_data = {
  1983. // "code":item,
  1984. // "pastureid":Cookies.get('pastureid')
  1985. // }
  1986. // SrmOrder(send_data).then(response => {
  1987. // console.log('response', response)
  1988. // if (response.msg !== 'fail') {
  1989. // that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
  1990. // that.get_table_data()
  1991. // } else {
  1992. // that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
  1993. // }
  1994. // })
  1995. // })
  1996. // }
  1997. // }
  1998. },
  1999. closeData() {
  2000. this.isokDisable = true
  2001. setTimeout(() => {
  2002. this.isokDisable = false
  2003. }, 1000)
  2004. console.log('点击确认关闭', this.temp2)
  2005. this.$refs['temp2'].validate(valid => {
  2006. if (valid) {
  2007. this.requestParamStute.parammaps.id = this.temp2.id
  2008. this.requestParamStute.parammaps.note = this.temp2.note
  2009. PostDataByName(this.requestParamStute).then(response => {
  2010. console.log('新增保存发送参数', this.requestParamStute)
  2011. if (response.msg !== 'fail') {
  2012. this.get_table_data2()
  2013. this.dialogFormVisibleClose = false
  2014. this.$notify({
  2015. title: '成功',
  2016. message: '关闭成功',
  2017. type: 'success',
  2018. duration: 2000
  2019. })
  2020. } else {
  2021. failproccess(response, this.$notify)
  2022. }
  2023. })
  2024. }
  2025. })
  2026. },
  2027. get_table_data3() {
  2028. this.listLoading3 = true
  2029. if (this.$refs['inputDatetime3'] !== undefined && this.$refs['inputDatetime3'].value !== null) {
  2030. this.getdataListParm3.parammaps.startTime = this.$refs['inputDatetime3'].value[0]
  2031. this.getdataListParm3.parammaps.stopTime = this.$refs['inputDatetime3'].value[1]
  2032. } else {
  2033. this.getdataListParm3.parammaps.startTime = ''
  2034. this.getdataListParm3.parammaps.stopTime = ''
  2035. }
  2036. GetDataByName(this.getdataListParm3).then(response => {
  2037. this.list3 = response.data.list
  2038. this.pageNum3 = response.data.pageNum
  2039. this.pageSize3 = response.data.pageSize
  2040. if (response.data.total) {
  2041. this.total3 = response.data.total
  2042. }
  2043. // Just to simulate the time of the request
  2044. setTimeout(() => {
  2045. this.listLoading3 = false
  2046. }, 300)
  2047. })
  2048. },
  2049. form_search3() {
  2050. this.listLoading = true
  2051. if (this.getdataListParm3.parammaps.inputDatetime === null) {
  2052. this.getdataListParm3.parammaps.inputDatetime = ''
  2053. }
  2054. this.getdataListParm3.offset = 1
  2055. this.get_table_data3()
  2056. },
  2057. handleDownload3() {
  2058. console.log('点击了采购明细导出')
  2059. this.$alert('采购明细正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  2060. this.isPercentage = true
  2061. this.percentage = 1
  2062. var timer = setInterval(() => {
  2063. this.percentage += 5
  2064. if (this.percentage > 95) {
  2065. this.percentage = 99
  2066. clearInterval(timer)
  2067. }
  2068. this.percentage = this.percentage
  2069. }, 1000)
  2070. this.downloadListParm3.name = this.getdataListParm3.name
  2071. this.downloadListParm3.parammaps = this.getdataListParm3.parammaps
  2072. GetAccount(this.downloadListParm3).then(response => {
  2073. if (response.data.list !== '') {
  2074. this.percentage = 99
  2075. setTimeout(() => {
  2076. this.isPercentage = false
  2077. }, 2000)
  2078. }
  2079. this.downloadList3 = response.data.list
  2080. const elecExcelDatas = [
  2081. {
  2082. tHeader: ['配单号', '采购单号', '备件编号', '备件名称', '备件规格', '备件品牌', '计量单位', '供应商', '单价', '申购数量', '采购数量', '入库数', '申购部门', '采购人', '配单日期'],
  2083. filterVal: ['matchCode', 'buyeCode', 'partCode', 'partName', 'specification', 'brand', 'unit', 'providerName', 'price', 'sumAmount', 'amount', 'receiveAmount', 'departmentName', 'empname', 'buyerDate'],
  2084. tableDatas: this.downloadList3,
  2085. sheetName: '采购明细'
  2086. }
  2087. ]
  2088. json2excel(elecExcelDatas, '采购明细', true, 'xlsx')
  2089. })
  2090. },
  2091. get_table_data4() {
  2092. this.listLoading4 = true
  2093. if (this.$refs['inputDatetime4'] !== undefined && this.$refs['inputDatetime4'].value !== null) {
  2094. this.getdataListParm4.parammaps.startTime = this.$refs['inputDatetime4'].value[0]
  2095. this.getdataListParm4.parammaps.stopTime = this.$refs['inputDatetime4'].value[1]
  2096. } else {
  2097. this.getdataListParm4.parammaps.startTime = ''
  2098. this.getdataListParm4.parammaps.stopTime = ''
  2099. }
  2100. GetDataByName(this.getdataListParm4).then(response => {
  2101. this.list4 = response.data.list
  2102. this.pageNum4 = response.data.pageNum
  2103. this.pageSize4 = response.data.pageSize
  2104. if (response.data.total) {
  2105. this.total4 = response.data.total
  2106. }
  2107. // Just to simulate the time of the request
  2108. setTimeout(() => {
  2109. this.listLoading4 = false
  2110. }, 300)
  2111. })
  2112. },
  2113. form_search4() {
  2114. this.listLoading = true
  2115. if (this.getdataListParm4.parammaps.inputDatetime === null) {
  2116. this.getdataListParm4.parammaps.inputDatetime = ''
  2117. }
  2118. this.getdataListParm4.offset = 1
  2119. this.get_table_data4()
  2120. },
  2121. form_see4(row) {
  2122. this.dialogStatusSee4 = 'see'
  2123. this.dialogFormVisibleSee4 = true
  2124. this.temp4 = Object.assign({}, row)
  2125. this.getdataListSee4.parammaps.matchCode = row.matchCode
  2126. this.getSeeList4()
  2127. var reason = '未通过原因:' + this.temp4.workflowNote
  2128. if (this.temp4.statue === 0) {
  2129. this.activeList = [{ title: '配单', date: this.temp4.dealTime, name: this.temp4.empname }, { title: '办公室主任审核' }]
  2130. this.active = 1
  2131. } else if (this.temp4.statue === 1) {
  2132. this.activeList = [{ title: '配单', date: this.temp4.dealTime, name: this.temp4.empname }, { title: '办公室主任审核', date: this.temp4.chargeDate, name: this.temp4.chargeName }]
  2133. this.active = 2
  2134. } else if (this.temp4.statue === 2) {
  2135. this.activeList = [{ title: '配单', date: this.temp4.dealTime, name: this.temp4.empname }, { title: '办公室主任审核', date: this.temp4.chargeDate, name: this.temp4.chargeName, status: 'error', reason: reason }]
  2136. this.active = 2
  2137. }
  2138. },
  2139. getSeeList4() {
  2140. GetDataByName(this.getdataListSee4).then(response => {
  2141. this.listSee4 = response.data.list
  2142. this.listUpdate4 = response.data.list
  2143. if (response.data.list !== null) {
  2144. for (let i = 0; i < response.data.list.length; i++) {
  2145. console.log(response.data.list[i].srcpath)
  2146. console.log(response.data.list[i].picpath)
  2147. console.log(process.env.VUE_APP_BASE_API + response.data.list[i].srcpath)
  2148. if (response.data.list[i].srcpath !== null && response.data.list[i].picpath !== null && response.data.list[i].srcpath !== undefined && response.data.list[i].picpath !== undefined) {
  2149. if (this.dialogStatusSee4 == 'see') {
  2150. this.listSee4[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  2151. this.listSee4[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  2152. } else {
  2153. this.listUpdate4[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  2154. this.listUpdate4[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  2155. }
  2156. } else {
  2157. this.listSee4[i].srcpath = ''
  2158. this.listSee4[i].picpath = ''
  2159. this.listUpdate4[i].srcpath = ''
  2160. this.listUpdate4[i].picpath = ''
  2161. }
  2162. }
  2163. }
  2164. console.log('查看下方table数据', response.data.list)
  2165. this.pageNum4 = response.data.pageNum
  2166. this.pageSize4 = response.data.pageSize
  2167. })
  2168. },
  2169. handleExamine(row) {
  2170. if (row == undefined) {
  2171. this.examineTemp = this.temp4
  2172. this.$set(this.temp4, 'SHstatue', 1)
  2173. this.$set(this.temp4, 'workflowNote', '')
  2174. } else {
  2175. this.examineTemp = Object.assign({}, row)
  2176. this.$set(this.examineTemp, 'SHstatue', 1)
  2177. this.$set(this.examineTemp, 'workflowNote', '')
  2178. }
  2179. this.dialogStatus_Examine = 'examine'
  2180. this.dialogFormVisible_Examine = true
  2181. this.statueReason = false
  2182. },
  2183. changeSHStatue(val) {
  2184. if (val == 2) {
  2185. this.statueReason = true
  2186. } else {
  2187. this.statueReason = false
  2188. }
  2189. },
  2190. createExamineData() {
  2191. console.log(this.examineTemp)
  2192. this.$refs['examineTemp'].validate(valid => {
  2193. if (valid) {
  2194. if (this.examineTemp.SHstatue == 1) {
  2195. console.log('通过')
  2196. this.postDataPramas.common = { 'returnmap': '0' }
  2197. this.postDataPramas.data = []
  2198. this.postDataPramas.data[0] = { 'name': 'partdealCharge', 'type': 'e', 'parammaps': {
  2199. 'id': this.examineTemp.id,
  2200. 'statue': this.examineTemp.SHstatue,
  2201. 'empId': Cookies.get('employeid'),
  2202. 'workflowNote': this.examineTemp.workflowNote
  2203. }}
  2204. this.postDataPramas.data[1] = { 'name': 'updatebigbuydetailenable', 'type': 'e', 'parammaps': {
  2205. 'matchCode': this.examineTemp.matchCode
  2206. }}
  2207. this.postDataPramas.data[2] = { 'name': 'updatebigbuydetailZero', 'type': 'e', 'parammaps': {
  2208. 'matchCode': this.examineTemp.matchCode
  2209. }}
  2210. ExecDataByConfig(this.postDataPramas).then(response => {
  2211. console.log('审核保存发送参数', this.postDataPramas)
  2212. if (response.msg === 'fail') {
  2213. this.$notify({
  2214. title: '审核失败',
  2215. message: response.data,
  2216. type: 'warning',
  2217. duration: 2000
  2218. })
  2219. } else {
  2220. this.dialogFormVisible_Examine = false
  2221. this.get_table_data4()
  2222. this.$notify({
  2223. title: '',
  2224. message: '审核成功',
  2225. type: 'success',
  2226. duration: 2000
  2227. })
  2228. }
  2229. })
  2230. } else if (this.examineTemp.SHstatue == 2) {
  2231. console.log('不通过')
  2232. this.postDataPramas.common = { 'returnmap': '0' }
  2233. this.postDataPramas.data = []
  2234. this.postDataPramas.data[0] = { 'name': 'partdealCharge', 'type': 'e', 'parammaps': {
  2235. 'id': this.examineTemp.id,
  2236. 'statue': this.examineTemp.SHstatue,
  2237. 'empId': Cookies.get('employeid'),
  2238. 'workflowNote': this.examineTemp.workflowNote
  2239. }}
  2240. // this.postDataPramas.data[1] = { 'name': 'updatepartpurchase', 'type': 'e', 'parammaps': {
  2241. // 'matchCode': this.examineTemp.matchCode
  2242. // }}
  2243. ExecDataByConfig(this.postDataPramas).then(response => {
  2244. console.log('审核保存发送参数', this.postDataPramas)
  2245. if (response.msg === 'fail') {
  2246. this.$notify({
  2247. title: '审核失败',
  2248. message: response.data,
  2249. type: 'warning',
  2250. duration: 2000
  2251. })
  2252. } else {
  2253. this.dialogFormVisible_Examine = false
  2254. this.get_table_data4()
  2255. this.$notify({
  2256. title: '',
  2257. message: '审核成功',
  2258. type: 'success',
  2259. duration: 2000
  2260. })
  2261. }
  2262. })
  2263. }
  2264. }
  2265. })
  2266. },
  2267. form_edit(row) {
  2268. this.dialogStatusUpdate4 = 'update'
  2269. this.dialogFormVisibleUpdate4 = true
  2270. this.getdataListSee4.parammaps.matchCode = row.matchCode
  2271. this.updateTemp4 = Object.assign(row, {})
  2272. this.getSeeList4()
  2273. },
  2274. edit_dialog_save() {
  2275. this.$refs['updateTemp4'].validate(valid => {
  2276. if (valid) {
  2277. // for (let i = 0; i < this.listUpdate4.length; i++) {
  2278. // var rulesAmount = /^\d+$/
  2279. // if ((this.listUpdate4[i].amount == '' || this.listUpdate4[i].amount == undefined) && parseFloat(this.listUpdate4[i].amount) !== 0) {
  2280. // this.$message({
  2281. // type: 'error',
  2282. // message: '采购数量不可为空',
  2283. // duration: 2000
  2284. // })
  2285. // return false
  2286. // } else if (!rulesAmount.test(parseFloat(this.listUpdate4[i].amount))) {
  2287. // this.$message({
  2288. // type: 'error',
  2289. // message: '采购数量不可为空',
  2290. // duration: 2000
  2291. // })
  2292. // return false
  2293. // }
  2294. // }
  2295. for (let i = 0; i < this.listUpdate4.length; i++) {
  2296. console.log(this.listUpdate4[i].amount)
  2297. var rulesAmount = /^\d+$/
  2298. if ((this.listUpdate4[i].amount == '' || this.listUpdate4[i].amount == undefined) && parseFloat(this.listUpdate4[i].amount) !== 0) {
  2299. this.$message({
  2300. type: 'error',
  2301. message: '采购数量不可为空',
  2302. duration: 2000
  2303. })
  2304. return false
  2305. } else if (!rulesAmount.test(parseFloat(this.listUpdate4[i].amount))) {
  2306. this.$message({
  2307. type: 'error',
  2308. message: '采购数量请输入大于等于0的整数',
  2309. duration: 2000
  2310. })
  2311. return false
  2312. } else {
  2313. this.postDataPramas.common = { 'returnmap': '0' }
  2314. this.postDataPramas.data = []
  2315. this.postDataPramas.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listUpdate4 }}
  2316. this.postDataPramas.data[0].children = []
  2317. this.postDataPramas.data[0].children[0] = { 'name': 'updatePDbuydetail', 'type': 'e', 'parammaps': {
  2318. amount: '@insertSpotList.amount',
  2319. id: '@insertSpotList.id'
  2320. }}
  2321. this.postDataPramas.data[1] = { 'name': 'partdealCharge', 'type': 'e', 'parammaps': {
  2322. id: this.updateTemp4.id,
  2323. statue: '0',
  2324. empId: Cookies.get('employeid')
  2325. }}
  2326. }
  2327. }
  2328. ExecDataByConfig(this.postDataPramas).then(response => {
  2329. console.log('新增保存发送参数', this.postDataPramas)
  2330. if (response.msg === 'fail') {
  2331. this.$notify({
  2332. title: '保存失败',
  2333. message: response.data,
  2334. type: 'warning',
  2335. duration: 2000
  2336. })
  2337. } else {
  2338. this.dialogFormVisibleUpdate4 = false
  2339. this.getdataListParm4.parammaps.inputDatetime = ''
  2340. this.get_table_data4()
  2341. this.$notify({
  2342. title: '',
  2343. message: '保存成功',
  2344. type: 'success',
  2345. duration: 2000
  2346. })
  2347. }
  2348. })
  2349. return true
  2350. }
  2351. })
  2352. }
  2353. }
  2354. }
  2355. </script>
  2356. <style lang="scss" >
  2357. .el-table .warning-row {
  2358. background: red;
  2359. }
  2360. .el-table .color-row {
  2361. background: #eee;
  2362. }
  2363. </style>
  2364. <style lang="scss" scoped>
  2365. .app-contentClose .el-form-item__content {
  2366. margin-left: 0 !important;
  2367. }
  2368. </style>
  2369. <style lang="scss" scoped>
  2370. .app-contentConfirmationSheet {
  2371. margin-bottom: 50px;
  2372. }
  2373. .app-content {
  2374. background: #eee;
  2375. margin-bottom: 50px;
  2376. .title {
  2377. line-height: 40px;
  2378. div {
  2379. float: left;
  2380. margin-right: 50px;
  2381. b {
  2382. padding-left: 10px;
  2383. }
  2384. }
  2385. }
  2386. .total {
  2387. margin-left: 80%;
  2388. line-height: 30px;
  2389. }
  2390. }
  2391. </style>