index.vue 143 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524
  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. <div class="filter-container">
  11. <el-select v-model="getdataListParm1.parammaps.departmentId" style="width: 140px;" placeholder="部门" class="filter-item" @change="change_dept">
  12. <el-option v-for="item in deptNameList" :key="item.id" :label="item.name" :value="item.id" />
  13. </el-select>
  14. </div>
  15. <el-table
  16. :key="tableKey1"
  17. v-loading="listLoading1"
  18. element-loading-text="给我一点时间"
  19. :data="list1"
  20. border
  21. fit
  22. :row-style="tableRowStyle"
  23. :cell-style="tableCellStyle"
  24. highlight-current-row
  25. style="width: 100%;"
  26. class="elTable table-fixed"
  27. :max-height="myHeight"
  28. @cell-click="cellClick"
  29. @sort-change="tableSort"
  30. >
  31. <el-table-column label="序号" align="center" type="index" width="50px">
  32. <template slot-scope="scope">
  33. <span>{{ scope.$index + (pageNum1-1) * pageSize1 + 1 }}</span>
  34. </template>
  35. </el-table-column>
  36. <el-table-column label="备件编号" align="center" min-width="150px">
  37. <template slot-scope="scope">
  38. <span>{{ scope.row.partCode }}</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.partName }}</span>
  44. </template>
  45. </el-table-column>
  46. <el-table-column label="备件规格" align="center" min-width="120px">
  47. <template slot-scope="scope">
  48. <span>{{ scope.row.specification }}</span>
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="备件品牌" min-width="100px" align="center">
  52. <template slot-scope="scope">
  53. <span>{{ scope.row.brand }}</span>
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="计量单位" min-width="80px" align="center">
  57. <template slot-scope="scope">
  58. <span>{{ scope.row.unit }}</span>
  59. </template>
  60. </el-table-column>
  61. <el-table-column label="图片" min-width="110px" align="center">
  62. <template slot-scope="scope">
  63. <el-popover placement="right" title="" trigger="hover">
  64. <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
  65. <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  66. </el-popover>
  67. </template>
  68. </el-table-column>
  69. <el-table-column label="供应商" min-width="110px" align="center">
  70. <template slot-scope="scope">
  71. <span>{{ scope.row.providerName }}</span>
  72. </template>
  73. </el-table-column>
  74. <el-table-column sortable prop="price" label="单价" min-width="70px" align="center">
  75. <template slot-scope="scope">
  76. <span>{{ scope.row.price }}</span>
  77. </template>
  78. </el-table-column>
  79. <el-table-column sortable prop="sumAmount" label="申购数量" min-width="90px" align="center">
  80. <template slot-scope="scope">
  81. <span>{{ scope.row.sumAmount }}</span>
  82. </template>
  83. </el-table-column>
  84. <el-table-column label="采购数量" min-width="110px" align="center">
  85. <template slot-scope="scope">
  86. <el-form :model="scope.row" :rules="rules">
  87. <el-form-item prop="amount">
  88. <el-input v-model="scope.row.amount" style="width:80px;margin-top:25px;height:10px" />
  89. <!-- 白少让先注释了 -->
  90. <!-- <el-input v-if ="scope.row.amount == 0" v-model="scope.row.amount" style="width:80px;margin-top:25px;height:10px" disabled/>
  91. <el-input v-else v-model="scope.row.amount" style="width:80px;margin-top:25px;height:10px" /> -->
  92. </el-form-item>
  93. </el-form>
  94. </template>
  95. </el-table-column>
  96. </el-table>
  97. <el-button :disabled="confirmationSheetDisabled" type="primary" style="float: right;margin-top: 10px;" @click="confirmationSheet()">确认配单</el-button>
  98. <el-dialog :title="textMap[dialogStatusConfirmation]" :visible.sync="dialogFormVisibleConfirmation" :close-on-click-modal="false" style="width:100%;margin: 0 auto;overflow:auto">
  99. <div class="app-contentConfirmationSheet">
  100. <el-form ref="temp1" :rules="rules" :model="temp1" label-position="right" label-width="90px" style="width:100%;margin-bottom:50px">
  101. <el-row>
  102. <el-col :span="8">
  103. <el-form-item label="配单号:" prop="matchCode">
  104. <el-input ref="matchCode" v-model="temp1.matchCode" disabled />
  105. </el-form-item>
  106. </el-col>
  107. <el-col :span="8">
  108. <el-form-item label="提交日期:" prop="buyerDate">
  109. <el-date-picker
  110. v-model="temp1.buyerDate"
  111. :picker-options="pickerOptions"
  112. type="date"
  113. placeholder="提交日期"
  114. format="yyyy-MM-dd"
  115. value-format="yyyy-MM-dd"
  116. style="width:170px;"
  117. />
  118. </el-form-item>
  119. </el-col>
  120. <el-col :span="8">
  121. <el-form-item label="采购员:" prop="buyerPerson">
  122. <el-select v-model="temp1.buyerPerson" placeholder="采购员" class="filter-item">
  123. <el-option
  124. v-for="item in findAllEmploye"
  125. :key="item.id"
  126. :label="item.name"
  127. :value="item.id"
  128. />
  129. </el-select>
  130. </el-form-item>
  131. </el-col>
  132. </el-row>
  133. </el-form>
  134. <div v-for="(item,index) in listConfirmationSheet" :key="index" class="app-content">
  135. <div class="title">
  136. <div>
  137. <b>采购单号:</b>
  138. <span>{{ item.orderNumber }}</span>
  139. </div>
  140. <div>
  141. <b>供应商:</b>
  142. <span>{{ item.providerName }}</span>
  143. </div>
  144. </div>
  145. <el-table
  146. :key="tableKey1"
  147. v-loading="listLoading1"
  148. element-loading-text="给我一点时间"
  149. :data="item.list"
  150. border
  151. fit
  152. highlight-current-row
  153. style="width: 97%;margin:0 auto"
  154. :row-style="rowStyle"
  155. :cell-style="cellStyle"
  156. class="elTable table-fixed"
  157. >
  158. <!-- table表格 -->
  159. <el-table-column label="序号" align="center" type="index" width="50px">
  160. <template slot-scope="scope">
  161. <span>{{ scope.$index + (pageNum1-1) * pageSize1 + 1 }}</span>
  162. </template>
  163. </el-table-column>
  164. <el-table-column label="备件编号" align="center" min-width="150px">
  165. <template slot-scope="scope">
  166. <span>{{ scope.row.partCode }}</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.partName }}</span>
  172. </template>
  173. </el-table-column>
  174. <el-table-column label="备件规格" align="center" min-width="120px">
  175. <template slot-scope="scope">
  176. <span>{{ scope.row.specification }}</span>
  177. </template>
  178. </el-table-column>
  179. <el-table-column label="图片" min-width="110px" align="center">
  180. <template slot-scope="scope">
  181. <el-popover placement="right" title="" trigger="hover">
  182. <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
  183. <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  184. </el-popover>
  185. </template>
  186. </el-table-column>
  187. <el-table-column label="备件品牌" min-width="100px" align="center">
  188. <template slot-scope="scope">
  189. <span>{{ scope.row.brand }}</span>
  190. </template>
  191. </el-table-column>
  192. <el-table-column label="计量单位" min-width="80px" align="center">
  193. <template slot-scope="scope">
  194. <span>{{ scope.row.unit }}</span>
  195. </template>
  196. </el-table-column>
  197. <el-table-column label="单价" min-width="70px" align="center">
  198. <template slot-scope="scope">
  199. <span>{{ scope.row. price }}</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.sumAmount }}</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.amount }}</span>
  210. </template>
  211. </el-table-column>
  212. <el-table-column label="总价" min-width="90px" align="center">
  213. <template slot-scope="scope">
  214. <span>{{ (scope.row.sumPrice = scope.row.price * parseFloat(scope.row.amount))| keepTwoNum }}</span>
  215. </template>
  216. </el-table-column>
  217. </el-table>
  218. <div ref="total" class="total">
  219. 合计:
  220. <span>{{ item.Sum }}</span>
  221. </div>
  222. </div>
  223. <div slot="footer" class="dialog-footer" style="bottom:10px">
  224. <el-button type="primary" :disabled="isokDisable" @click="confirmationSheetData()">确认</el-button>
  225. <el-button @click="dialogFormVisibleConfirmation= false;get_table_data1();">取消</el-button>
  226. </div>
  227. </div>
  228. </el-dialog>
  229. </div>
  230. </el-tab-pane>
  231. <el-tab-pane v-if="isDistributionManagement" label="配单管理" name="fouth">
  232. <div class="DistributionManagement">
  233. <div class="filter-container">
  234. <el-select v-model="getdataListParm4.parammaps.pastureArr" style="width: 210px;" placeholder="牧场" class="filter-item" multiple
  235. collapse-tags collapse-tags-tooltip >
  236. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  237. </el-select>
  238. <el-input v-model="getdataListParm4.parammaps.matchCode" placeholder="配单号" clearable style="width: 200px;" class="filter-item" />
  239. <el-select v-model="getdataListParm4.parammaps.statue" clearable placeholder="审核状态" class="filter-item" style="width: 120px;">
  240. <el-option v-for="item in status2" :key="item.id" :label="item.name" :value="item.id" />
  241. </el-select>
  242. <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="结束提交日期" />
  243. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search4">搜索</el-button>
  244. </div>
  245. <el-table
  246. :key="tableKey4"
  247. v-loading="listLoading4"
  248. element-loading-text="给我一点时间"
  249. :data="list4"
  250. border
  251. fit
  252. highlight-current-row
  253. style="width: 100%;"
  254. :row-style="rowStyle"
  255. :cell-style="cellStyle"
  256. class="elTable table-fixed"
  257. :max-height="myHeight"
  258. @sort-change="tableSort"
  259. @current-change="handleCurrentChange"
  260. >
  261. <el-table-column label="序号" align="center" type="index" width="50px">
  262. <template slot-scope="scope">
  263. <span>{{ scope.$index + (pageNum2-1) * pageSize2 + 1 }}</span>
  264. </template>
  265. </el-table-column>
  266. <el-table-column label="牧场" min-width="110px" align="center">
  267. <template slot-scope="scope">
  268. <span>{{ scope.row.pastureName }}</span>
  269. </template>
  270. </el-table-column>
  271. <el-table-column label="配单号" min-width="110px" align="center">
  272. <template slot-scope="scope">
  273. <span>{{ scope.row.matchCode }}</span>
  274. </template>
  275. </el-table-column>
  276. <el-table-column label="采购员" min-width="130px" align="center">
  277. <template slot-scope="scope">
  278. <span>{{ scope.row.empname }}</span>
  279. </template>
  280. </el-table-column>
  281. <el-table-column label="提交日期" sortable prop="dealTime" min-width="110px" align="center" />
  282. <el-table-column sortable prop="cou" label="采购单数" min-width="110px" align="center">
  283. <template slot-scope="scope">
  284. <span>{{ scope.row.cou }}</span>
  285. </template>
  286. </el-table-column>
  287. <el-table-column label="审核状态" min-width="80px" align="center" :formatter="statue" />
  288. <el-table-column label="操作" align="center" width="250px" class-name="small-padding fixed-width" fixed="right">
  289. <template slot-scope="{row}">
  290. <el-button v-if="isPurchaseSee" type="primary" size="mini" @click="form_see4(row)">查看</el-button>
  291. <el-button v-if="parseFloat(row.statue) === 0 && isExamineDM" style="display:inline-block" type="success" size="mini" @click="handleExamine(row)">审核</el-button>
  292. <el-button v-else style="display:none;" type="success" size="mini" @click="handleExamine(row)">审核</el-button>
  293. <el-button v-if="parseFloat(row.statue) === 2" type="success" style="display:inline-block" size="mini" @click="form_edit(row)">编辑</el-button>
  294. <el-button v-else style="display:none;" type="success" size="mini" @click="form_edit(row)">编辑</el-button>
  295. </template>
  296. </el-table-column>
  297. </el-table>
  298. <pagination v-show="total4>0" :total="total4" :page.sync="getdataListParm4.offset" :limit.sync="getdataListParm4.pagecount" @pagination="get_table_data4" />
  299. <el-dialog :title="textMap[dialogStatusSee4]" :visible.sync="dialogFormVisibleSee4" :close-on-click-modal="false">
  300. <div class="app-contentSee">
  301. <el-form ref="temp4" :rules="rules" :model="temp4" label-position="right" label-width="80px" style="width: 800px;margin-bottom:30px">
  302. <el-row>
  303. <el-col :span="8">
  304. <el-form-item label="配单号:" prop="matchCode">
  305. <span>{{ temp4.matchCode }}</span>
  306. </el-form-item>
  307. </el-col>
  308. <el-col :span="8">
  309. <el-form-item label="采购员:" prop="empname">
  310. <span>{{ temp4.empname }}</span>
  311. </el-form-item>
  312. </el-col>
  313. <el-col :span="8">
  314. <el-form-item label="配单日期:" prop="dealTime">
  315. <span>{{ temp4.dealTime }}</span>
  316. </el-form-item>
  317. </el-col>
  318. </el-row>
  319. </el-form>
  320. <el-table
  321. :key="tableKeySee4"
  322. v-loading="listLoadingSee4"
  323. element-loading-text="给我一点时间"
  324. :data="listSee4"
  325. border
  326. fit
  327. highlight-current-row
  328. style="width: 100%;margin-bottom:100px"
  329. :row-style="rowStyle"
  330. :cell-style="cellStyle"
  331. class="elTable table-fixed"
  332. >
  333. <el-table-column label="序号" align="center" type="index" width="50px" />
  334. <el-table-column label="采购单号" min-width="110px" align="center">
  335. <template slot-scope="scope">
  336. <span>{{ scope.row.buyeCode }}</span>
  337. </template>
  338. </el-table-column>
  339. <el-table-column label="备件编号" min-width="110px" align="center">
  340. <template slot-scope="scope">
  341. <span>{{ scope.row.partCode }}</span>
  342. </template>
  343. </el-table-column>
  344. <el-table-column label="备件名称" min-width="110px" align="center">
  345. <template slot-scope="scope">
  346. <span>{{ scope.row.partName }}</span>
  347. </template>
  348. </el-table-column>
  349. <el-table-column label="备件规格" min-width="110px" align="center">
  350. <template slot-scope="scope">
  351. <span>{{ scope.row.specification }}</span>
  352. </template>
  353. </el-table-column>
  354. <el-table-column label="备件品牌" min-width="110px" align="center">
  355. <template slot-scope="scope">
  356. <span>{{ scope.row.brand }}</span>
  357. </template>
  358. </el-table-column>
  359. <el-table-column label="计量单位" min-width="60px" align="center">
  360. <template slot-scope="scope">
  361. <span>{{ scope.row.unit }}</span>
  362. </template>
  363. </el-table-column>
  364. <el-table-column label="供应商" min-width="110px" align="center">
  365. <template slot-scope="scope">
  366. <span>{{ scope.row.providerName }}</span>
  367. </template>
  368. </el-table-column>
  369. <el-table-column sortable prop="price" label="单价" min-width="60px" align="center">
  370. <template slot-scope="scope">
  371. <span>{{ scope.row.price }}</span>
  372. </template>
  373. </el-table-column>
  374. <el-table-column sortable prop="sumAmount" label="申购数量" min-width="60px" align="center">
  375. <template slot-scope="scope">
  376. <span>{{ scope.row.sumAmount }}</span>
  377. </template>
  378. </el-table-column>
  379. <el-table-column sortable prop="amount" label="采购数量" min-width="60px" align="center">
  380. <template slot-scope="scope">
  381. <span>{{ scope.row.amount }}</span>
  382. </template>
  383. </el-table-column>
  384. <el-table-column sortable prop="sumPrice" label="总价" min-width="60px" align="center">
  385. <template slot-scope="scope">
  386. <span>{{ scope.row.sumPrice }}</span>
  387. </template>
  388. </el-table-column>
  389. <el-table-column label="备件图片" min-width="110px" align="center">
  390. <template slot-scope="scope">
  391. <el-popover placement="right" title="" trigger="hover">
  392. <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
  393. <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  394. </el-popover>
  395. </template>
  396. </el-table-column>
  397. <el-table-column prop="SGremark" label="备注" min-width="60px" align="center" />
  398. </el-table>
  399. <el-form ref="temp4" :rules="rules" :model="temp4" label-position="right" label-width="120px" style="width: 90%;margin:0 auto;">
  400. <el-row>
  401. <el-col>
  402. <el-form-item label="流程进度" />
  403. <el-steps :active="active" align-center finish-status="success">
  404. <el-step
  405. v-for="(item,index) in activeList"
  406. :key="index"
  407. :title="item.title"
  408. :status="item.status"
  409. >
  410. <template slot="description">
  411. <div class="step-row">
  412. <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
  413. <div>{{ item.reason }}</div>
  414. </div>
  415. </template>
  416. </el-step>
  417. </el-steps>
  418. </el-col>
  419. </el-row>
  420. <el-row>
  421. <el-col>
  422. <el-form-item label="操作:">
  423. <!-- 审核 -->
  424. <el-button v-if="isExamineDM && temp4.statue == 0" type="success" style="display:inline-block" @click="handleExamine()">审核</el-button>
  425. <el-button v-else type="success" style="display:none" @click="handleExamine()">审核</el-button>
  426. </el-form-item>
  427. </el-col>
  428. </el-row>
  429. </el-form>
  430. <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
  431. <el-button @click="dialogFormVisibleSee4 = false;">关闭</el-button>
  432. </div>
  433. </div>
  434. </el-dialog>
  435. <el-dialog :title="textMap[dialogStatusUpdate4]" width="90%" :visible.sync="dialogFormVisibleUpdate4" :close-on-click-modal="false">
  436. <div class="app-contentUpdate">
  437. <el-form
  438. ref="updateTemp4"
  439. :rules="rules"
  440. :model="updateTemp4"
  441. label-position="right"
  442. label-width="80px"
  443. style="width:80%;margin-bottom:30px"
  444. >
  445. <el-row>
  446. <el-col :span="8">
  447. <el-form-item label="配单号:" prop="matchCode">
  448. <span>{{ updateTemp4.matchCode }}</span>
  449. </el-form-item>
  450. </el-col>
  451. <el-col :span="8">
  452. <el-form-item label="采购员:" prop="empname">
  453. <span>{{ updateTemp4.empname }}</span>
  454. </el-form-item>
  455. </el-col>
  456. <el-col :span="8">
  457. <el-form-item label="配单日期:" prop="dealTime">
  458. <span>{{ updateTemp4.dealTime }}</span>
  459. </el-form-item>
  460. </el-col>
  461. </el-row>
  462. </el-form>
  463. <el-table
  464. :key="tableKeyUpdate4"
  465. v-loading="listLoadingUpdate4"
  466. element-loading-text="给我一点时间"
  467. :data="listUpdate4"
  468. border
  469. fit
  470. highlight-current-row
  471. style="width: 100%;margin-bottom:100px"
  472. :row-style="rowStyle"
  473. :cell-style="cellStyle"
  474. class="elTable table-fixed"
  475. >
  476. <!-- table表格 -->
  477. <el-table-column label="序号" align="center" type="index" width="50px" />
  478. <el-table-column label="采购单号" min-width="110px" align="center">
  479. <template slot-scope="scope">
  480. <span>{{ scope.row.buyeCode }}</span>
  481. </template>
  482. </el-table-column>
  483. <el-table-column label="备件编号" min-width="110px" align="center">
  484. <template slot-scope="scope">
  485. <span>{{ scope.row.partCode }}</span>
  486. </template>
  487. </el-table-column>
  488. <el-table-column label="备件名称" min-width="110px" align="center">
  489. <template slot-scope="scope">
  490. <span>{{ scope.row.partName }}</span>
  491. </template>
  492. </el-table-column>
  493. <el-table-column label="备件规格" min-width="110px" align="center">
  494. <template slot-scope="scope">
  495. <span>{{ scope.row.specification }}</span>
  496. </template>
  497. </el-table-column>
  498. <el-table-column label="备件品牌" min-width="110px" align="center">
  499. <template slot-scope="scope">
  500. <span>{{ scope.row.brand }}</span>
  501. </template>
  502. </el-table-column>
  503. <el-table-column label="计量单位" min-width="60px" align="center">
  504. <template slot-scope="scope">
  505. <span>{{ scope.row.unit }}</span>
  506. </template>
  507. </el-table-column>
  508. <el-table-column label="供应商" min-width="110px" align="center">
  509. <template slot-scope="scope">
  510. <span>{{ scope.row.providerName }}</span>
  511. </template>
  512. </el-table-column>
  513. <el-table-column label="单价" min-width="60px" align="center">
  514. <template slot-scope="scope">
  515. <span>{{ scope.row.price }}</span>
  516. </template>
  517. </el-table-column>
  518. <el-table-column label="申购数量" min-width="60px" align="center">
  519. <template slot-scope="scope">
  520. <span>{{ scope.row.sumAmount }}</span>
  521. </template>
  522. </el-table-column>
  523. <el-table-column label="采购数量" min-width="100px" align="center">
  524. <template slot-scope="scope">
  525. <el-form :model="scope.row" :rules="rules">
  526. <el-form-item prop="amount">
  527. <el-input
  528. v-model="scope.row.amount"
  529. style="width:80px;margin-top:25px;height:10px"
  530. />
  531. </el-form-item>
  532. </el-form>
  533. </template>
  534. </el-table-column>
  535. <el-table-column label="总价" min-width="60px" align="center">
  536. <template slot-scope="scope">
  537. <span>{{ (parseFloat(scope.row.price) * parseFloat(scope.row.amount)) | keepTwoNum2 }}</span>
  538. </template>
  539. </el-table-column>
  540. <el-table-column label="备件图片" min-width="110px" align="center">
  541. <template slot-scope="scope">
  542. <el-popover placement="right" title="" trigger="hover">
  543. <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
  544. <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  545. </el-popover>
  546. </template>
  547. </el-table-column>
  548. </el-table>
  549. <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
  550. <el-button type="primary" :disabled="isokDisable" @click="edit_dialog_save()">确认</el-button>
  551. <el-button @click="dialogFormVisibleUpdate4 = false;">关闭</el-button>
  552. </div>
  553. </div>
  554. </el-dialog>
  555. <el-dialog :title="textMap[dialogStatus_Examine]" :visible.sync="dialogFormVisible_Examine" :close-on-click-modal="false" width="30%">
  556. <div class="app-examine">
  557. <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请确认审核结果:</h3>
  558. <el-form ref="examineTemp" :rules="rules" :model="examineTemp" label-position="right" style="width: 50%;margin:0 auto;">
  559. <el-row style="width:88%;height:150px;margin:0 auto;">
  560. <el-col :span="20">
  561. <el-form-item>
  562. <el-radio-group v-model="examineTemp.SHstatue" @change="changeSHStatue">
  563. <el-radio :label="1" checked>通过</el-radio>
  564. <el-radio :label="2">不通过</el-radio>
  565. </el-radio-group>
  566. </el-form-item>
  567. </el-col>
  568. <el-col v-if="statueReason" :span="20">
  569. <el-input v-model="examineTemp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入不通过原因" />
  570. </el-col>
  571. </el-row>
  572. </el-form>
  573. </div>
  574. <div slot="footer" class="dialog-footer">
  575. <el-button type="primary" :disabled="isokDisable" @click="dialogStatus_Examine==='examine'?createExamineData():createExamineData()">确认</el-button>
  576. <el-button @click="dialogFormVisible_Examine = false;">关闭</el-button>
  577. </div>
  578. </el-dialog>
  579. </div>
  580. </el-tab-pane>
  581. <el-tab-pane label="采购单管理" name="second">
  582. <div class="purchaseOrderManagement">
  583. <div class="filter-container">
  584. <el-select v-model="getdataListParm2.parammaps.pastureArr" style="width: 210px;" placeholder="牧场" class="filter-item" multiple
  585. collapse-tags collapse-tags-tooltip>
  586. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  587. </el-select>
  588. <el-input v-model="getdataListParm2.parammaps.buyeCode" placeholder="采购单号" clearable style="width: 200px;" class="filter-item" />
  589. <el-select v-model="getdataListParm2.parammaps.statu" clearable placeholder="单据状态" class="filter-item" style="width: 120px;">
  590. <el-option v-for="item in status" :key="item.id" :label="item.name" :value="item.id" />
  591. </el-select>
  592. <el-autocomplete v-model="getdataListParm2.parammaps.providerName" value-key="providerName" class="inline-input" :fetch-suggestions="providerSearch" placeholder="供应商" style="width:150px;top:-3px;" @select="handleSelectProvider" />
  593. <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="结束提交日期" />
  594. <el-select v-model="getdataListParm2.parammaps.purchase_type" clearable style="width: 140px;" placeholder="申购类型" class="filter-item">
  595. <el-option v-for="item in subscriptionStatusList" :key="item.id" :label="item.name" :value="item.id" />
  596. </el-select>
  597. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search2">搜索</el-button>
  598. <el-button v-if="isPurchaseSap" v-waves class="filter-item" type="primary" @click="sapUpload">SAP上传</el-button>
  599. <el-button v-if="isPurchaseSrm" v-waves class="filter-item" type="primary" @click="srmUpload">SRM上传</el-button>
  600. </div>
  601. <el-table
  602. :key="tableKey2"
  603. v-loading="listLoading2"
  604. element-loading-text="给我一点时间"
  605. :data="list2"
  606. border
  607. fit
  608. highlight-current-row
  609. style="width: 100%;"
  610. :row-style="rowStyle"
  611. :cell-style="cellStyle"
  612. class="elTable table-fixed"
  613. :max-height="myHeight"
  614. @sort-change="tableSort"
  615. @selection-change="change_table_selection"
  616. >
  617. <el-table-column type="selection" :selectable="checkboxInit" align="center" width="50" disabled />
  618. <el-table-column label="序号1" align="center" type="index" width="50px">
  619. <template slot-scope="scope">
  620. <span>{{ scope.$index + (pageNum2-1) * pageSize2 + 1 }}</span>
  621. </template>
  622. </el-table-column>
  623. <el-table-column label="牧场" min-width="110px" align="center">
  624. <template slot-scope="scope">
  625. <span>{{ scope.row.pastureName }}</span>
  626. </template>
  627. </el-table-column>
  628. <el-table-column label="采购单号" min-width="110px" align="center">
  629. <template slot-scope="scope">
  630. <span>{{ scope.row.buyeCode }}</span>
  631. </template>
  632. </el-table-column>
  633. <el-table-column label="供应商" min-width="130px" align="center">
  634. <template slot-scope="scope">
  635. <span>{{ scope.row.providerName }}</span>
  636. </template>
  637. </el-table-column>
  638. <el-table-column label="采购员" min-width="110px" align="center">
  639. <template slot-scope="scope">
  640. <span>{{ scope.row.empname }}</span>
  641. </template>
  642. </el-table-column>
  643. <el-table-column label="提交日期" sortable prop="buyerDate" min-width="110px" align="center" />
  644. <el-table-column label="最近到货日期" sortable prop="DoneDate" min-width="110px" align="center" />
  645. <el-table-column label="单据状态" min-width="80px" align="center" :formatter="statu" />
  646. <el-table-column prop="sapNumber" label="sap编码" min-width="80px" align="center">
  647. <template slot-scope="scope">
  648. <span>{{ scope.row.sapNumber }}</span>
  649. </template>
  650. </el-table-column>
  651. <el-table-column label="申购类型" min-width="80px" align="center">
  652. <template slot-scope="scope">
  653. <span v-if="scope.row.purchase_type == 1">暂估申购</span>
  654. <span v-else-if="scope.row.purchase_type == 3">赠品申购</span>
  655. <span v-else-if="scope.row.purchase_type == 4">奶厅申购</span>
  656. <span v-else>新增申购</span>
  657. </template>
  658. </el-table-column>
  659. <el-table-column prop="sapstatus" label="sap上传状态" min-width="80px" align="center">
  660. <template slot-scope="scope">
  661. <span v-show="scope.row.sapstatus == 1">上传失败</span>
  662. <span v-show="scope.row.sapstatus == -1">未上传</span>
  663. <span v-show="scope.row.sapstatus == 0">上传成功</span>
  664. </template>
  665. </el-table-column>
  666. <el-table-column prop="srmstatus" label="srm上传状态" min-width="80px" align="center">
  667. <template slot-scope="scope">
  668. <span v-show="scope.row.srmstatus == 1">上传失败</span>
  669. <span v-show="scope.row.srmstatus == -1">未上传</span>
  670. <span v-show="scope.row.srmstatus == 0">上传成功</span>
  671. </template>
  672. </el-table-column>
  673. <el-table-column label="srm错误" prop="srmError" min-width="110px" align="center" />
  674. <el-table-column label="sap错误" prop="sapError" min-width="110px" align="center" />
  675. <el-table-column label="操作" align="center" width="250px" class-name="small-padding fixed-width" fixed="right">
  676. <template slot-scope="{row}">
  677. <el-button v-if="isPurchaseSee" type="primary" size="mini" @click="form_see2(row)">查看</el-button>
  678. <el-button v-if="(row.statu === 2 || row.statu === 4) && isPurchaseClose" style="display:none" type="danger" size="mini" @click="handleClose2(row)">关闭</el-button>
  679. <el-button v-else-if="isPurchaseClose" style="display:inline-block" type="danger" size="mini" @click="handleClose2(row)">关闭</el-button>
  680. </template>
  681. </el-table-column>
  682. </el-table>
  683. <pagination v-show="total2>0" :total="total2" :page.sync="getdataListParm2.offset" :limit.sync="getdataListParm2.pagecount" @pagination="get_table_data2" />
  684. <el-dialog :title="textMap[dialogStatusSee2]" :visible.sync="dialogFormVisibleSee2" :close-on-click-modal="false">
  685. <div class="app-contentSee">
  686. <el-form
  687. ref="temp2"
  688. :rules="rules"
  689. :model="temp2"
  690. label-position="right"
  691. label-width="80px"
  692. style="width: 800px;margin-bottom:30px"
  693. >
  694. <el-row>
  695. <el-col :span="8">
  696. <el-form-item label="采购单号:" prop="buyeCode">
  697. <span>{{ temp2.buyeCode }}</span>
  698. </el-form-item>
  699. </el-col>
  700. <el-col :span="6">
  701. <el-form-item label="供应商:" prop="providerName">
  702. <span>{{ temp2.providerName }}</span>
  703. </el-form-item>
  704. </el-col>
  705. <el-col :span="5">
  706. <el-form-item label="采购员:" prop="empname">
  707. <span>{{ temp2.empname }}</span>
  708. </el-form-item>
  709. </el-col>
  710. <el-col :span="5">
  711. <el-form-item label="提交日期:" prop="buyerDate">
  712. <span>{{ temp2.buyerDate }}</span>
  713. </el-form-item>
  714. </el-col>
  715. </el-row>
  716. </el-form>
  717. <el-table
  718. :key="tableKeySee2"
  719. v-loading="listLoadingSee2"
  720. element-loading-text="给我一点时间"
  721. :data="listSee2"
  722. border
  723. fit
  724. highlight-current-row
  725. style="width: 100%;margin-bottom:100px"
  726. :row-style="rowStyle"
  727. :cell-style="cellStyle"
  728. class="elTable table-fixed"
  729. @sort-change="tableSort2"
  730. >
  731. <el-table-column label="序号" align="center" type="index" width="50px" />
  732. <el-table-column label="备件编号" min-width="110px" align="center">
  733. <template slot-scope="scope">
  734. <span>{{ scope.row.partCode }}</span>
  735. </template>
  736. </el-table-column>
  737. <el-table-column label="备件名称" min-width="110px" align="center">
  738. <template slot-scope="scope">
  739. <span>{{ scope.row.partName }}</span>
  740. </template>
  741. </el-table-column>
  742. <el-table-column label="备件规格" min-width="110px" align="center">
  743. <template slot-scope="scope">
  744. <span>{{ scope.row.specification }}</span>
  745. </template>
  746. </el-table-column>
  747. <el-table-column label="备件图片" min-width="110px" align="center">
  748. <template slot-scope="scope">
  749. <el-popover placement="right" title="" trigger="hover">
  750. <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
  751. <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  752. </el-popover>
  753. </template>
  754. </el-table-column>
  755. <el-table-column label="备件品牌" min-width="110px" align="center">
  756. <template slot-scope="scope">
  757. <span>{{ scope.row.brand }}</span>
  758. </template>
  759. </el-table-column>
  760. <el-table-column label="计量单位" min-width="130px" align="center">
  761. <template slot-scope="scope">
  762. <span>{{ scope.row.unit }}</span>
  763. </template>
  764. </el-table-column>
  765. <el-table-column sortable prop="price" label="单价(元)" min-width="110px" align="center">
  766. <template slot-scope="scope">
  767. <span>{{ scope.row.price }}</span>
  768. </template>
  769. </el-table-column>
  770. <el-table-column sortable prop="sumAmount" label="申购数量" min-width="110px" align="center">
  771. <template slot-scope="scope">
  772. <span>{{ scope.row.sumAmount }}</span>
  773. </template>
  774. </el-table-column>
  775. <el-table-column sortable prop="amount" label="采购数量" min-width="130px" align="center">
  776. <template slot-scope="scope">
  777. <span>{{ scope.row.amount }}</span>
  778. </template>
  779. </el-table-column>
  780. <el-table-column sortable prop="sumPrice" label="总价(元)" min-width="110px" align="center">
  781. <template slot-scope="scope">
  782. <span>{{ scope.row.sumPrice }}</span>
  783. </template>
  784. </el-table-column>
  785. <el-table-column sortable prop="receiveAmount" label="入库数" min-width="110px" align="center">
  786. <template slot-scope="scope">
  787. <span>{{ scope.row.receiveAmount }}</span>
  788. </template>
  789. </el-table-column>
  790. <el-table-column prop="SGremark" label="备注" min-width="110px" align="center">
  791. <template slot-scope="scope">
  792. <span>{{ scope.row.SGremark }}</span>
  793. </template>
  794. </el-table-column>
  795. </el-table>
  796. <div class="sum" style="right:30px;position:absolute;bottom:90px">
  797. <b>总计:{{ temp2.sumPrices }}元</b>
  798. </div>
  799. <div class="stuts" style="left:30px;position:absolute;bottom:70px">
  800. <b>单据状态:{{ temp2.statu }}</b>
  801. <b v-if="isStatu">关闭原因:{{ temp2.note }}</b>
  802. <div v-if="isExtensionDays">延期天数:{{ temp2.extensionDays }}</div>
  803. </div>
  804. <div
  805. slot="footer"
  806. class="dialog-footer"
  807. style="right:30px;position:absolute;bottom:10px"
  808. >
  809. <el-button @click="dialogFormVisibleSee2 = false;get_table_data2()">关闭</el-button>
  810. </div>
  811. </div>
  812. </el-dialog>
  813. <el-dialog :title="textMap[dialogStatusClose]" :visible.sync="dialogFormVisibleClose" :close-on-click-modal="false" style="width:70%;margin: 0 auto">
  814. <div class="app-contentClose">
  815. <el-form
  816. ref="temp2"
  817. :rules="rules"
  818. :model="temp2"
  819. label-position="right"
  820. label-width="80px"
  821. style="width: 300px;margin-bottom:30px"
  822. >
  823. <el-row>
  824. <el-col :span="24">
  825. <el-form-item label="采购单号:" prop="orderNo">
  826. <span>{{ temp2.buyeCode }}</span>
  827. </el-form-item>
  828. </el-col>
  829. </el-row>
  830. <el-row>
  831. <el-col :span="24">
  832. <el-form-item label="" prop="note">
  833. <el-input ref="note" v-model="temp2.note" type="textarea" placeholder="请输入关闭该采购单原因" />
  834. </el-form-item>
  835. </el-col>
  836. </el-row>
  837. </el-form>
  838. <div
  839. slot="footer"
  840. class="dialog-footer"
  841. style="right:30px;position:absolute;bottom:10px"
  842. >
  843. <el-button @click="dialogFormVisibleClose = false;get_table_data2();">取消</el-button>
  844. <el-button type="primary" :disabled="isokDisable" @click="closeData()">确认关闭</el-button>
  845. </div>
  846. </div>
  847. </el-dialog>
  848. </div>
  849. </el-tab-pane>
  850. <el-tab-pane label="采购明细" name="third">
  851. <div class="procurementDetails">
  852. <div class="filter-container">
  853. <el-select v-model="getdataListParm3.parammaps.pastureArr" style="width: 210px;" placeholder="牧场" class="filter-item" multiple
  854. collapse-tags collapse-tags-tooltip >
  855. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  856. </el-select>
  857. <el-input v-model="getdataListParm3.parammaps.partCode" placeholder="备件编号" style="width: 200px;" class="filter-item" />
  858. <el-input v-model="getdataListParm3.parammaps.partName" placeholder="备件名称" style="width: 140px;" class="filter-item" />
  859. <el-autocomplete v-model="getdataListParm3.parammaps.providerName" value-key="providerName" class="inline-input" :fetch-suggestions="providerSearch" placeholder="供应商" style="width:150px;top:-3px;" @select="handleSelectProvider" />
  860. <el-input v-model="getdataListParm3.parammaps.matchCode" placeholder="配单号" style="width: 140px;" class="filter-item" />
  861. <el-input v-model="getdataListParm3.parammaps.buyeCode" placeholder="采购单号" style="width: 140px;" class="filter-item" />
  862. <el-select v-model="getdataListParm3.parammaps.isStorage" clearable placeholder="到货情况" class="filter-item" style="width: 120px;">
  863. <el-option v-for="item in isStorages" :key="item.id" :label="item.name" :value="item.id" />
  864. </el-select>
  865. <el-select v-model="getdataListParm3.parammaps.purchase_type" clearable style="width: 140px;" placeholder="申购类型" class="filter-item">
  866. <el-option v-for="item in subscriptionStatusList" :key="item.id" :label="item.name" :value="item.id" />
  867. </el-select>
  868. <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="结束日期" />
  869. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search3">搜索</el-button>
  870. <el-button v-if="isPurchaseExport" class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-edit" @click="handleDownload3">导出</el-button>
  871. </div>
  872. <el-table
  873. :key="tableKey3"
  874. v-loading="listLoading3"
  875. element-loading-text="给我一点时间"
  876. :data="list3"
  877. border
  878. fit
  879. highlight-current-row
  880. style="width: 100%;"
  881. :row-style="rowStyle"
  882. :cell-style="cellStyle"
  883. class="elTable table-fixed"
  884. :max-height="myHeight"
  885. @sort-change="tableSort"
  886. >
  887. <el-table-column label="序号" align="center" type="index" width="50px">
  888. <template slot-scope="scope">
  889. <span>{{ scope.$index + (pageNum3-1) * pageSize3 + 1 }}</span>
  890. </template>
  891. </el-table-column>
  892. <el-table-column label="牧场" min-width="110px" align="center">
  893. <template slot-scope="scope">
  894. <span>{{ scope.row.pastureName }}</span>
  895. </template>
  896. </el-table-column>
  897. <el-table-column label="配单号" min-width="110px" align="center">
  898. <template slot-scope="scope">
  899. <span>{{ scope.row.matchCode }}</span>
  900. </template>
  901. </el-table-column>
  902. <el-table-column label="采购单号" min-width="110px" align="center">
  903. <template slot-scope="scope">
  904. <span>{{ scope.row.buyeCode }}</span>
  905. </template>
  906. </el-table-column>
  907. <el-table-column label="备件编号" min-width="110px" align="center">
  908. <template slot-scope="scope">
  909. <span>{{ scope.row.partCode }}</span>
  910. </template>
  911. </el-table-column>
  912. <el-table-column label="备件名称" min-width="130px" align="center">
  913. <template slot-scope="scope">
  914. <span>{{ scope.row.partName }}</span>
  915. </template>
  916. </el-table-column>
  917. <el-table-column label="备件规格" min-width="130px" align="center">
  918. <template slot-scope="scope">
  919. <span>{{ scope.row.specification }}</span>
  920. </template>
  921. </el-table-column>
  922. <el-table-column label="备件品牌" min-width="130px" align="center">
  923. <template slot-scope="scope">
  924. <span>{{ scope.row.brand }}</span>
  925. </template>
  926. </el-table-column>
  927. <el-table-column label="计量单位" min-width="130px" align="center">
  928. <template slot-scope="scope">
  929. <span>{{ scope.row.unit }}</span>
  930. </template>
  931. </el-table-column>
  932. <el-table-column label="供应商" min-width="110px" align="center">
  933. <template slot-scope="scope">
  934. <span>{{ scope.row.providerName }}</span>
  935. </template>
  936. </el-table-column>
  937. <el-table-column sortable prop="price" label="单价" min-width="110px" align="center">
  938. <template slot-scope="scope">
  939. <span>{{ scope.row.price }}</span>
  940. </template>
  941. </el-table-column>
  942. <el-table-column label="当前库存" prop="reportery" align="center" min-width="120px">
  943. <template slot-scope="scope">
  944. <span>{{ parseFloat(scope.row.reportery ) }}</span>
  945. </template>
  946. </el-table-column>
  947. <el-table-column sortable prop="sumAmount" label="申购数量" min-width="110px" align="center">
  948. <template slot-scope="scope">
  949. <span>{{ scope.row.sumAmount }}</span>
  950. </template>
  951. </el-table-column>
  952. <el-table-column sortable prop="amount" label="采购数量" min-width="110px" align="center">
  953. <template slot-scope="scope">
  954. <span>{{ scope.row.amount }}</span>
  955. </template>
  956. </el-table-column>
  957. <el-table-column sortable prop="receiveAmount" label="入库数" min-width="110px" align="center">
  958. <template slot-scope="scope">
  959. <span>{{ scope.row.receiveAmount }}</span>
  960. </template>
  961. </el-table-column>
  962. <el-table-column label="申购类型" min-width="80px" align="center">
  963. <template slot-scope="scope">
  964. <span v-if="scope.row.purchase_type == 1">暂估申购</span>
  965. <span v-else-if="scope.row.purchase_type == 3">赠品申购</span>
  966. <span v-else-if="scope.row.purchase_type == 4">奶厅申购</span>
  967. <span v-else>新增申购</span>
  968. </template>
  969. </el-table-column>
  970. <el-table-column label="申购部门" min-width="110px" align="center">
  971. <template slot-scope="scope">
  972. <span>{{ scope.row.departmentName }}</span>
  973. </template>
  974. </el-table-column>
  975. <el-table-column label="采购人" min-width="110px" align="center">
  976. <template slot-scope="scope">
  977. <span>{{ scope.row.empname }}</span>
  978. </template>
  979. </el-table-column>
  980. <el-table-column label="配单日期" sortable prop="buyerDate" min-width="110px" align="center" />
  981. <!-- <el-table-column label="备注" min-width="110px" align="center">
  982. <template slot-scope="scope">
  983. <span>{{ scope.row.note }}</span>
  984. </template>
  985. </el-table-column> -->
  986. </el-table>
  987. <pagination v-show="total3>=0" :total="total3" :page.sync="getdataListParm3.offset" :limit.sync="getdataListParm3.pagecount" @pagination="get_table_data3" />
  988. </div>
  989. </el-tab-pane>
  990. <el-tab-pane label="采购退货" name="fifth">
  991. <div class="procurementDetails">
  992. <div class="filter-container">
  993. <el-select v-model="getdataListParm5.parammaps.pastureArr" style="width: 220px;" placeholder="牧场" class="filter-item" multiple
  994. collapse-tags collapse-tags-tooltip >
  995. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  996. </el-select>
  997. <el-input v-model="getdataListParm5.parammaps.buyeCode" placeholder="采购单号" style="width: 140px;" class="filter-item" />
  998. <el-autocomplete v-model="getdataListParm5.parammaps.providerName" value-key="providerName" class="inline-input" :fetch-suggestions="providerSearch" placeholder="供应商" style="width:150px;top:-3px;" @select="handleSelectProvider" />
  999. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search5">搜索</el-button>
  1000. <el-button class="filter-item" type="primary" icon="el-icon-edit" @click="form_add5">新增</el-button>
  1001. </div>
  1002. <el-table
  1003. :key="tableKey5"
  1004. v-loading="listLoading5"
  1005. element-loading-text="给我一点时间"
  1006. :data="list5"
  1007. border
  1008. fit
  1009. highlight-current-row
  1010. style="width: 100%;"
  1011. :row-style="rowStyle"
  1012. :cell-style="cellStyle"
  1013. class="elTable table-fixed"
  1014. :max-height="myHeight"
  1015. @sort-change="tableSort"
  1016. >
  1017. <el-table-column label="序号" align="center" type="index" width="50px">
  1018. <template slot-scope="scope">
  1019. <span>{{ scope.$index + (pageNum3-1) * pageSize3 + 1 }}</span>
  1020. </template>
  1021. </el-table-column>
  1022. <el-table-column label="采购单号" min-width="110px" align="center">
  1023. <template slot-scope="scope">
  1024. <span>{{ scope.row.buyeCode }}</span>
  1025. </template>
  1026. </el-table-column>
  1027. <el-table-column label="供应商" min-width="110px" align="center">
  1028. <template slot-scope="scope">
  1029. <span>{{ scope.row.providerName }}</span>
  1030. </template>
  1031. </el-table-column>
  1032. <el-table-column label="牧场" min-width="110px" align="center">
  1033. <template slot-scope="scope">
  1034. <span>{{ scope.row.pastureName }}</span>
  1035. </template>
  1036. </el-table-column>
  1037. <el-table-column label="录入人" min-width="110px" align="center">
  1038. <template slot-scope="scope">
  1039. <span>{{ scope.row.empname }}</span>
  1040. </template>
  1041. </el-table-column>
  1042. <el-table-column label="采购员" min-width="110px" align="center">
  1043. <template slot-scope="scope">
  1044. <span>{{ scope.row.empname }}</span>
  1045. </template>
  1046. </el-table-column>
  1047. <el-table-column label="提交日期" sortable prop="buyerDate" min-width="110px" align="center" />
  1048. <el-table-column label="单据状态" min-width="80px" align="center" :formatter="statu" />
  1049. <el-table-column prop="sapNumber" label="sap编码" min-width="80px" align="center">
  1050. <template slot-scope="scope">
  1051. <span>{{ scope.row.sapNumber }}</span>
  1052. </template>
  1053. </el-table-column>
  1054. <el-table-column prop="sapstatus" label="sap上传状态" min-width="80px" align="center">
  1055. <template slot-scope="scope">
  1056. <span v-show="scope.row.sapstatus == 1">上传失败</span>
  1057. <span v-show="scope.row.sapstatus == -1">未上传</span>
  1058. <span v-show="scope.row.sapstatus == 0">上传成功</span>
  1059. </template>
  1060. </el-table-column>
  1061. <el-table-column prop="srmstatus" label="srm上传状态" min-width="80px" align="center">
  1062. <template slot-scope="scope">
  1063. <span v-show="scope.row.srmstatus == 1">上传失败</span>
  1064. <span v-show="scope.row.srmstatus == -1">未上传</span>
  1065. <span v-show="scope.row.srmstatus == 0">上传成功</span>
  1066. </template>
  1067. </el-table-column>
  1068. <el-table-column label="操作" align="center" width="250px" class-name="small-padding fixed-width" fixed="right">
  1069. <template slot-scope="{row}">
  1070. <el-button type="primary" size="mini" @click="form_see5(row)">查看</el-button>
  1071. <el-button v-if="row.statu === 0" type="danger" size="mini" @click="handleClose5(row)">关闭</el-button>
  1072. </template>
  1073. </el-table-column>
  1074. </el-table>
  1075. <pagination v-show="total5>=0" :total="total5" :page.sync="getdataListParm5.offset" :limit.sync="getdataListParm5.pagecount" @pagination="get_table_data5" />
  1076. </div>
  1077. </el-tab-pane>
  1078. </el-tabs>
  1079. <el-dialog title="查看详情" :visible.sync="dialogFormVisibleSee5" :close-on-click-modal="false">
  1080. <div class="app-contentSee">
  1081. <el-form
  1082. ref="temp5"
  1083. :model="temp5"
  1084. label-position="right"
  1085. label-width="80px"
  1086. style="width: 800px;margin-bottom:30px"
  1087. >
  1088. <el-row>
  1089. <el-col :span="8">
  1090. <el-form-item label="采购单号:" prop="buyeCode">
  1091. <span>{{ temp5.buyeCode }}</span>
  1092. </el-form-item>
  1093. </el-col>
  1094. <el-col :span="6">
  1095. <el-form-item label="供应商:" prop="providerName">
  1096. <span>{{ temp5.providerName }}</span>
  1097. </el-form-item>
  1098. </el-col>
  1099. <el-col :span="5">
  1100. <el-form-item label="采购员:" prop="empname">
  1101. <span>{{ temp5.empname }}</span>
  1102. </el-form-item>
  1103. </el-col>
  1104. <el-col :span="5">
  1105. <el-form-item label="提交日期:" prop="buyerDate">
  1106. <span>{{ temp5.buyerDate }}</span>
  1107. </el-form-item>
  1108. </el-col>
  1109. </el-row>
  1110. </el-form>
  1111. <el-table
  1112. element-loading-text="给我一点时间"
  1113. :data="listSee5"
  1114. border
  1115. fit
  1116. highlight-current-row
  1117. style="width: 100%;margin-bottom:100px"
  1118. :row-style="rowStyle"
  1119. :cell-style="cellStyle"
  1120. class="elTable table-fixed"
  1121. >
  1122. <el-table-column label="序号" align="center" type="index" width="50px" />
  1123. <el-table-column label="备件编号" min-width="110px" align="center">
  1124. <template slot-scope="scope">
  1125. <span>{{ scope.row.partCode }}</span>
  1126. </template>
  1127. </el-table-column>
  1128. <el-table-column label="备件名称" min-width="110px" align="center">
  1129. <template slot-scope="scope">
  1130. <span>{{ scope.row.partName }}</span>
  1131. </template>
  1132. </el-table-column>
  1133. <el-table-column label="备件规格" min-width="110px" align="center">
  1134. <template slot-scope="scope">
  1135. <span>{{ scope.row.specification }}</span>
  1136. </template>
  1137. </el-table-column>
  1138. <el-table-column label="备件图片" min-width="110px" align="center">
  1139. <template slot-scope="scope">
  1140. <el-popover placement="right" title="" trigger="hover">
  1141. <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
  1142. <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  1143. </el-popover>
  1144. </template>
  1145. </el-table-column>
  1146. <el-table-column label="备件品牌" min-width="110px" align="center">
  1147. <template slot-scope="scope">
  1148. <span>{{ scope.row.brand }}</span>
  1149. </template>
  1150. </el-table-column>
  1151. <el-table-column label="计量单位" min-width="130px" align="center">
  1152. <template slot-scope="scope">
  1153. <span>{{ scope.row.unit }}</span>
  1154. </template>
  1155. </el-table-column>
  1156. <el-table-column sortable prop="price" label="单价(元)" min-width="110px" align="center">
  1157. <template slot-scope="scope">
  1158. <span>{{ scope.row.price }}</span>
  1159. </template>
  1160. </el-table-column>
  1161. <el-table-column sortable prop="amount" label="采购数量" min-width="130px" align="center">
  1162. <template slot-scope="scope">
  1163. <span>{{ scope.row.amount }}</span>
  1164. </template>
  1165. </el-table-column>
  1166. <el-table-column sortable prop="sumPrice" label="总价(元)" min-width="110px" align="center">
  1167. <template slot-scope="scope">
  1168. <span>{{ scope.row.sumPrice }}</span>
  1169. </template>
  1170. </el-table-column>
  1171. <el-table-column prop="SGremark" label="备注" min-width="110px" align="center">
  1172. <template slot-scope="scope">
  1173. <span>{{ scope.row.SGremark }}</span>
  1174. </template>
  1175. </el-table-column>
  1176. </el-table>
  1177. <div class="sum" style="right:30px;position:absolute;bottom:90px">
  1178. <b>总计:{{ temp5.sumPrices }}元</b>
  1179. </div>
  1180. <div class="stuts" style="left:30px;position:absolute;bottom:70px">
  1181. <b>单据状态:{{ temp5.statu }}</b>
  1182. <b v-if="isStatu">关闭原因:{{ temp5.note }}</b>
  1183. <!-- <div v-if="isExtensionDays">延期天数:{{ temp5.extensionDays }}</div> -->
  1184. </div>
  1185. <div
  1186. slot="footer"
  1187. class="dialog-footer"
  1188. style="right:30px;position:absolute;bottom:10px"
  1189. >
  1190. <el-button @click="dialogFormVisibleSee5 = false;get_table_data5()">关闭</el-button>
  1191. </div>
  1192. </div>
  1193. </el-dialog>
  1194. <el-dialog title="关闭提示" :visible.sync="dialogFormVisibleClose5" :close-on-click-modal="false" style="width:70%;margin: 0 auto">
  1195. <div class="app-contentClose">
  1196. <el-form
  1197. ref="temp5"
  1198. :rules="rules55"
  1199. :model="temp5"
  1200. label-position="right"
  1201. label-width="80px"
  1202. style="width: 300px;margin-bottom:30px"
  1203. >
  1204. <el-row>
  1205. <el-col :span="24">
  1206. <el-form-item label="采购单号:" prop="orderNo">
  1207. <span>{{ temp5.buyeCode }}</span>
  1208. </el-form-item>
  1209. </el-col>
  1210. </el-row>
  1211. <el-row>
  1212. <el-col :span="24">
  1213. <el-form-item label="" prop="note">
  1214. <el-input ref="note" v-model="temp5.note" type="textarea" placeholder="请输入关闭该采购单原因" />
  1215. </el-form-item>
  1216. </el-col>
  1217. </el-row>
  1218. </el-form>
  1219. <div
  1220. slot="footer"
  1221. class="dialog-footer"
  1222. style="right:30px;position:absolute;bottom:10px"
  1223. >
  1224. <el-button @click="dialogFormVisibleClose5 = false;get_table_data5();">取消</el-button>
  1225. <el-button type="primary" :disabled="isokDisable" @click="closeData5()">确认关闭</el-button>
  1226. </div>
  1227. </div>
  1228. </el-dialog>
  1229. <!-- 弹出层新增 -->
  1230. <el-dialog title="采购退货" :visible.sync="dialogFormVisible5" :close-on-click-modal="false" width="90%">
  1231. <div class="app-container">
  1232. <el-form
  1233. ref="createTemp5"
  1234. :rules="rules5"
  1235. :model="createTemp5"
  1236. label-position="right"
  1237. label-width="100px"
  1238. style="width: 90%;margin:0 auto;"
  1239. >
  1240. <el-row>
  1241. <el-col :span="8">
  1242. <el-form-item label="采购单号:" prop="buyeCode">
  1243. <el-input v-model="createTemp5.buyeCode" disabled placeholder="采购单号" style="width:100%" />
  1244. </el-form-item>
  1245. </el-col>
  1246. <el-col :span="8">
  1247. <el-form-item label="供应商:" prop="providerId">
  1248. <el-select v-model="createTemp5.providerId" filterable placeholder="供应商" style="width: 220px;" @change="changeProvider5">
  1249. <el-option v-for="item in findAllProvider5" :key="item.id" clearable :label="item.name" :value="item.id" />
  1250. </el-select>
  1251. </el-form-item>
  1252. </el-col>
  1253. <el-col :span="8">
  1254. <el-form-item label="牧场:" prop="pastureId">
  1255. <el-select v-model="createTemp5.pastureId" placeholder="牧场" class="filter-item" style="width: 220px;">
  1256. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
  1257. </el-select>
  1258. </el-form-item>
  1259. </el-col>
  1260. </el-row>
  1261. <el-row>
  1262. <el-col :span="8">
  1263. <el-form-item label="录入人:" prop="employeId">
  1264. <el-select v-model="createTemp5.employeId" placeholder="录入人" class="filter-item" style="width: 220px;">
  1265. <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
  1266. </el-select>
  1267. </el-form-item>
  1268. </el-col>
  1269. </el-row>
  1270. <el-row>
  1271. <el-col :span="15">
  1272. <el-form-item label="备件:" prop="partCode">
  1273. <el-autocomplete
  1274. v-model="createTemp5.partCode"
  1275. value-key="name"
  1276. class="inline-input"
  1277. :fetch-suggestions="sparePartSearch5"
  1278. placeholder="请输入备件编号或备件名称或备件规格"
  1279. style="width:100%"
  1280. @select="handleSelectSparePart5"
  1281. >
  1282. <template slot-scope="{ item }">
  1283. <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>&nbsp;
  1284. | &nbsp;<b>备件名称:</b><span class="addr">{{ item.partName }}</span>&nbsp;
  1285. | &nbsp;<b>备件规格:</b><span class="addr">{{ item.specification }}</span>
  1286. </template>
  1287. </el-autocomplete>
  1288. </el-form-item>
  1289. </el-col>
  1290. </el-row>
  1291. </el-form>
  1292. <el-table
  1293. element-loading-text="给我一点时间"
  1294. :data="listAdd5"
  1295. border
  1296. fit
  1297. highlight-current-row
  1298. style="width: 100%;margin-bottom:30px"
  1299. :row-style="rowStyle"
  1300. :cell-style="cellStyle"
  1301. class="elTable table-fixed"
  1302. >
  1303. <el-table-column label="序号" align="center" type="index" width="50px" />
  1304. <el-table-column label="备件编号" prop="partCode" align="center" min-width="90">
  1305. <template slot-scope="scope">
  1306. <span>{{ scope.row.partCode }}</span>
  1307. </template>
  1308. </el-table-column>
  1309. <el-table-column label="备件名称" prop="partName" align="center" min-width="90">
  1310. <template slot-scope="scope">
  1311. <span>{{ scope.row.partName }}</span>
  1312. </template>
  1313. </el-table-column>
  1314. <el-table-column label="备件规格" prop="specification" min-width="80px" align="center">
  1315. <template slot-scope="scope">
  1316. <span>{{ scope.row.specification }}</span>
  1317. </template>
  1318. </el-table-column>
  1319. <el-table-column label="备件图片" prop="picpath" min-width="110px" align="center">
  1320. <template slot-scope="scope">
  1321. <el-popover placement="right" title="" trigger="hover">
  1322. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  1323. <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  1324. </el-popover>
  1325. </template>
  1326. </el-table-column>
  1327. <el-table-column label="备件品牌" prop="brand" align="center" min-width="60">
  1328. <template slot-scope="scope">
  1329. <span>{{ scope.row.brand }}</span>
  1330. </template>
  1331. </el-table-column>
  1332. <el-table-column label="计量单位" prop="unit" align="center" min-width="60">
  1333. <template slot-scope="scope">
  1334. <span>{{ scope.row.unit }}</span>
  1335. </template>
  1336. </el-table-column>
  1337. <el-table-column label="库存数" prop="reportery" align="center" min-width="60">
  1338. <template slot-scope="scope">
  1339. <span>{{ scope.row.reportery }}</span>
  1340. </template>
  1341. </el-table-column>
  1342. <el-table-column label="退货数量" min-width="120px" align="center" valign="middle">
  1343. <template slot-scope="scope">
  1344. <el-form :model="scope.row">
  1345. <el-form-item prop="amount">
  1346. <el-input v-model="scope.row.amount" style="margin-top:15px" />
  1347. </el-form-item>
  1348. </el-form>
  1349. </template>
  1350. </el-table-column>
  1351. <el-table-column label="单价" min-width="110px" align="center" valign="middle">
  1352. <template slot-scope="scope">
  1353. <span>{{ scope.row.price }}</span>
  1354. </template>
  1355. </el-table-column>
  1356. <!-- <el-table-column label="总价" min-width="110px" align="center" valign="middle">
  1357. <template slot-scope="scope">
  1358. <span>{{ scope.row.price * parseFloat(scope.row.amount) | keepTwoNum }}</span>
  1359. </template>
  1360. </el-table-column> -->
  1361. <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right">
  1362. <template slot-scope="{row}">
  1363. <a class="del" @click="partDelete5(row)">删除</a>
  1364. </template>
  1365. </el-table-column>
  1366. </el-table>
  1367. <div slot="footer" class="dialog-footer" style="bottom:10px">
  1368. <el-button type="primary" :disabled="isokDisable" @click="add_dialog_save5()">保存并关闭</el-button>
  1369. <el-button @click="dialogFormVisible5 = false;get_table_data5()">取消并关闭</el-button>
  1370. </div>
  1371. </div>
  1372. </el-dialog>
  1373. </div>
  1374. </template>
  1375. <script>
  1376. // 引入
  1377. import { GetDataByName, GetDataByNames, ExecDataByConfig, PostDataByName, failproccess, checkButtons, GetAccount, SapOrder, SrmOrder } from '@/api/common'
  1378. import waves from '@/directive/waves' // waves directive
  1379. import Pagination from '@/components/Pagination' // secondary package based on el-pagination
  1380. import Cookies from 'js-cookie'
  1381. import { MessageBox } from 'element-ui'
  1382. import { parseTime, sortChange, json2excel } from '@/utils/index.js'
  1383. export default {
  1384. name: 'Purchase',
  1385. components: { Pagination },
  1386. directives: { waves },
  1387. filters: {
  1388. keepTwoNum(value) {
  1389. value = Number(value)
  1390. return value.toFixed(3)
  1391. },
  1392. keepTwoNum2(value) {
  1393. value = Number(value)
  1394. return value.toFixed(2)
  1395. }
  1396. },
  1397. data() {
  1398. return {
  1399. myHeight: document.documentElement.clientHeight - 85 - 150,
  1400. isSap: 1,
  1401. isSrm: 1,
  1402. selectList: [],
  1403. isPurchaseSap: [], isPurchaseSrm: [],
  1404. isPurchaseSee: [], isPurchaseClose: [], isPurchaseExport: [], isDistributionSheet: [], isDistributionManagement: [], isExamineDM: [],
  1405. stripe: true,
  1406. activeName: 'first',
  1407. listLoading1: false,
  1408. tableKey1: 0,
  1409. list1: [],
  1410. confirmationSheetDisabled: false,
  1411. isokDisable: false,
  1412. pickerOptions: {
  1413. disabledDate(time) {
  1414. return time.getTime() > Date.now() // 当天之前的时间可选
  1415. }
  1416. },
  1417. temp: {},
  1418. total: 0,
  1419. total1: 0,
  1420. listParmConfirmation: [],
  1421. listConfirmationSheet: null,
  1422. getParmPurchaseOrderNumber: {
  1423. name: 'autoCreatCode',
  1424. page: 1,
  1425. offset: 1,
  1426. returntype: 'Map',
  1427. parammaps: {
  1428. pastureId: Cookies.get('pastureid'),
  1429. codeType: 'CG'
  1430. }
  1431. },
  1432. postDataPramas: {},
  1433. requestProvider: {
  1434. name: 'getProviderList',
  1435. page: 1,
  1436. offset: 1,
  1437. pagecount: 10,
  1438. returntype: 'Map',
  1439. parammaps: {}
  1440. },
  1441. listLoading2: false,
  1442. tableKey2: 0,
  1443. list2: [],
  1444. status2: [
  1445. { id: '0', name: '审核中' },
  1446. { id: '1', name: '审核通过' },
  1447. { id: '2', name: '审核驳回' }
  1448. ],
  1449. status: [
  1450. { id: '0', name: '未到货' },
  1451. { id: '1', name: '部分到货' },
  1452. { id: '2', name: '按时到货' },
  1453. { id: '3', name: '已延期' },
  1454. { id: '4', name: '已关闭' },
  1455. { id: '5', name: '部分到货-延期' },
  1456. { id: '6', name: '全部到货-延期' }
  1457. ],
  1458. isStorages: [
  1459. { id: '0', name: '未入库' },
  1460. { id: '1', name: '已入库' }
  1461. ],
  1462. isStatu: false,
  1463. listLoadingSee2: false,
  1464. tableKeySee2: 0,
  1465. total2: 0,
  1466. total3: 0,
  1467. listLoading3: false,
  1468. tableKey3: 0,
  1469. list3: [],
  1470. subscriptionStatusList: [
  1471. { id: 0, name: '新增申购' },
  1472. { id: 1, name: '暂估申购' },
  1473. { id: 3, name: '赠品申购' },
  1474. { id: 4, name: '奶厅申购' }], // 申购状态
  1475. findAllEmploye: [],
  1476. findAllPasture: [],
  1477. requestParams: [
  1478. { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
  1479. { name: 'getDepartmentNY', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
  1480. { name: 'findAllMainPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
  1481. { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] }
  1482. ],
  1483. getdataListParm1: {
  1484. name: 'getbuydetailParts',
  1485. page: 1,
  1486. // offset: 1,
  1487. // pagecount: 10,
  1488. returntype: 'Map',
  1489. parammaps: {
  1490. pastureId: Cookies.get('pastureid'),
  1491. departmentId: 0
  1492. }
  1493. },
  1494. getdataListPart: {
  1495. name: 'getpartpurchasebg',
  1496. page: 1,
  1497. // offset: 1,
  1498. // pagecount: 10,
  1499. returntype: 'Map',
  1500. parammaps: {
  1501. id: Cookies.get('pastureid'),
  1502. departmentId: 0
  1503. }
  1504. },
  1505. partData: [],
  1506. getParmCreateNumber: {
  1507. name: 'autoCreatCode',
  1508. page: 1,
  1509. offset: 1,
  1510. returntype: 'Map',
  1511. parammaps: {
  1512. pastureId: Cookies.get('pastureid'),
  1513. codeType: 'PD'
  1514. }
  1515. },
  1516. pageNum1: 0,
  1517. pageSize1: 0,
  1518. temp1: {
  1519. pastureId: Cookies.get('pastureid'),
  1520. buyerPerson: this.$store.state.user.employeid,
  1521. buyerDate: parseTime(new Date(), '{y}-{m}-{d}')
  1522. },
  1523. getdataListParm2: {
  1524. name: 'getBigbuydetailList',
  1525. page: 1,
  1526. offset: 1,
  1527. pagecount: 10,
  1528. returntype: 'Map',
  1529. parammaps: {
  1530. pastureArr:[],
  1531. providerName: '',
  1532. buyeCode: '',
  1533. inputDatetime: '',
  1534. // pastureId: Cookies.get('pastureid'),
  1535. pastureName: Cookies.get('pasturename'),
  1536. purchase_type: ''
  1537. }
  1538. },
  1539. dialogFormVisibleConfirmation: false,
  1540. dialogStatusConfirmation: '',
  1541. pageNum2: 0,
  1542. pageSize2: 0,
  1543. temp2: {
  1544. note: ''
  1545. },
  1546. getdataListParm3: {
  1547. name: 'getbuydetailList',
  1548. page: 1,
  1549. offset: 1,
  1550. pagecount: 10,
  1551. returntype: 'Map',
  1552. parammaps: {
  1553. pastureArr:[],
  1554. pastureName: Cookies.get('pasturename'),
  1555. providerName: '',
  1556. partCode: '',
  1557. partName: '',
  1558. matchCode: '',
  1559. buyeCode: '',
  1560. isStorage: '',
  1561. startTime: '',
  1562. stopTime: '',
  1563. inputDatetime: '',
  1564. purchase_type: '',
  1565. reportery: ''
  1566. }
  1567. },
  1568. isExtensionDays: false,
  1569. listSee2: [],
  1570. getdataListSee2: {
  1571. name: 'getbuydetailListbyBig',
  1572. returntype: 'Map',
  1573. parammaps: {}
  1574. },
  1575. requestParamStute: {
  1576. name: 'updateBigbuydetailStatu',
  1577. returntype: 'Map',
  1578. parammaps: {}
  1579. },
  1580. requestParamStute5: {
  1581. name: 'shutDownBigrefunddetail',
  1582. returntype: 'Map',
  1583. parammaps: {}
  1584. },
  1585. pageNum3: 0,
  1586. pageSize3: 0,
  1587. temp3: {},
  1588. dialogFormVisibleSee2: false,
  1589. dialogStatusSee2: '',
  1590. // 配单管理
  1591. listLoading4: false,
  1592. tableKey4: 0,
  1593. list4: [],
  1594. pageNum4: 0,
  1595. pageSize4: 0,
  1596. total4: 0,
  1597. getdataListParm4: {
  1598. name: 'getbigpartdeallist',
  1599. page: 1,
  1600. offset: 1,
  1601. pagecount: 10,
  1602. returntype: 'Map',
  1603. parammaps: {
  1604. pastureArr:[],
  1605. pastureName: Cookies.get('pasturename'),
  1606. matchCode: '',
  1607. statue: '',
  1608. inputDatetime: '',
  1609. startTime: '',
  1610. stopTime: ''
  1611. }
  1612. },
  1613. dialogFormVisibleSee4: false,
  1614. dialogStatusSee4: '',
  1615. temp4: {},
  1616. listSee4: [],
  1617. tableKeySee4: 0,
  1618. listLoadingSee4: false,
  1619. getdataListSee4: {
  1620. name: 'getbigpartdealdetiallist',
  1621. returntype: 'Map',
  1622. parammaps: {}
  1623. },
  1624. // 退货
  1625. listLoading5: false,
  1626. tableKey5: 0,
  1627. list5: [],
  1628. pageNum5: 0,
  1629. pageSize5: 0,
  1630. total5: 0,
  1631. getdataListParm5: {
  1632. name: 'getBigRefunddetailList',
  1633. page: 1,
  1634. offset: 1,
  1635. pagecount: 10,
  1636. returntype: 'Map',
  1637. parammaps: {
  1638. pastureArr:[],
  1639. pastureName: Cookies.get('pasturename'),
  1640. providerName: '',
  1641. partCode: '',
  1642. partName: '',
  1643. matchCode: '',
  1644. buyeCode: '',
  1645. isStorage: '',
  1646. startTime: '',
  1647. stopTime: '',
  1648. inputDatetime: ''
  1649. }
  1650. },
  1651. dialogFormVisible5: false,
  1652. createTemp5: {
  1653. providerId: '',
  1654. buyeCode: '',
  1655. note: '',
  1656. pastureId: this.$store.state.user.pastureid,
  1657. employeId: this.$store.state.user.employeid,
  1658. createTime: parseTime(new Date(), '{y}-{m}-{d}')
  1659. },
  1660. rules5: {
  1661. // useForm: [{ required: true, message: '必填', trigger: 'blur' }],
  1662. providerId: [{ required: true, message: '必填', trigger: 'blur' }]
  1663. },
  1664. rules55: {
  1665. note: [{ required: true, message: '必填', trigger: 'blur' }]
  1666. },
  1667. listSee5: [],
  1668. getdataListSee5: {
  1669. name: 'getrefunddetailListbyBig',
  1670. returntype: 'Map',
  1671. parammaps: {}
  1672. },
  1673. getParmCreateNumber5: {
  1674. name: 'autoCreatCode',
  1675. page: 0,
  1676. offset: 0,
  1677. pagecount: 0,
  1678. returntype: 'Map',
  1679. parammaps: {
  1680. pastureId: Cookies.get('pastureid'),
  1681. codeType: 'CG'
  1682. }
  1683. },
  1684. requestSparePart5: {
  1685. name: 'getPartsListThdd',
  1686. page: 1,
  1687. offset: 1,
  1688. pagecount: 20,
  1689. returntype: 'Map',
  1690. parammaps: {
  1691. pastureId: Cookies.get('pastureid')
  1692. }
  1693. },
  1694. getParmBatchOperation5: {
  1695. name: 'getStockPastureListBypv',
  1696. returntype: 'Map',
  1697. parammaps: {
  1698. pastureId: Cookies.get('pastureid'),
  1699. providerId: ''
  1700. }
  1701. },
  1702. listAdd5: [],
  1703. findAllProvider5: [],
  1704. temp5: {
  1705. note: ''
  1706. },
  1707. dialogFormVisibleSee5: false,
  1708. dialogStatusSee5: '',
  1709. activeList: [],
  1710. deptNameList: [],
  1711. active: 3,
  1712. currentRow: {},
  1713. dialogStatusUpdate4: '',
  1714. dialogFormVisibleUpdate4: false,
  1715. updateTemp4: {},
  1716. listUpdate4: [],
  1717. tableKeyUpdate4: 0,
  1718. listLoadingUpdate4: false,
  1719. dialogFormVisible_Examine: false,
  1720. dialogStatus_Examine: '',
  1721. examineTemp: {
  1722. SHstatue: 1,
  1723. workflowNote: ''
  1724. },
  1725. statueReason: false,
  1726. dialogFormVisibleClose: false,
  1727. dialogFormVisibleClose5: false,
  1728. dialogStatusClose: '',
  1729. textMap: {
  1730. confirmation: '确认配单',
  1731. see: '查看详情',
  1732. close: '关闭提示',
  1733. examine: '审核',
  1734. update: '编辑'
  1735. },
  1736. // 校验规则
  1737. rules: {
  1738. equipmentName: [{ required: true, message: '必填', trigger: 'blur' }],
  1739. note: [{ required: true, message: '必填', trigger: 'blur' }]
  1740. },
  1741. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  1742. cellStyle: { padding: 0 + 'px' },
  1743. buttons: [],
  1744. downloadListParm3: {},
  1745. downloadList3: [],
  1746. isPercentage: false,
  1747. percentage: 1
  1748. }
  1749. },
  1750. created() {
  1751. const that = this
  1752. GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
  1753. that.buttons = response.data.list
  1754. that.get_auto_buttons()
  1755. if (this.isDistributionSheet == true) {
  1756. this.activeName = 'first'
  1757. console.log(1, this.isDistributionSheet, this.isDistributionManagement)
  1758. } else if (this.isDistributionManagement == true) {
  1759. this.activeName = 'fouth'
  1760. console.log(2, this.isDistributionSheet, this.isDistributionManagement)
  1761. } else if (this.isDistributionSheet == false && this.isDistributionManagement == false) {
  1762. this.activeName = 'second'
  1763. console.log(3, this.isDistributionSheet, this.isDistributionManagement)
  1764. }
  1765. })
  1766. this.get_select_list()
  1767. this.get_table_data1()
  1768. this.get_table_data2()
  1769. this.get_table_data3()
  1770. this.get_table_data4()
  1771. this.get_table_data5()
  1772. if (this.$route.query.activeName !== undefined) {
  1773. this.activeName = this.$route.query.activeName
  1774. }
  1775. },
  1776. methods: {
  1777. form_add5() {
  1778. this.resetCreateTemp5()
  1779. this.createTemp5.buyeCode = ''
  1780. this.dialogFormVisible5 = true
  1781. this.getCreateNumber5()
  1782. },
  1783. resetCreateTemp5() {
  1784. this.createTemp5.pastureId = this.$store.state.user.pastureid
  1785. this.createTemp5.providerId = ''
  1786. this.createTemp5.note = ''
  1787. this.createTemp5.employeId = this.$store.state.user.employeid
  1788. this.createTemp5.createTime = parseTime(new Date(), '{y}-{m}-{d}')
  1789. this.createTemp5.buyeCode = ''
  1790. this.listAdd5 = []
  1791. this.TotalAmount5 = 0
  1792. },
  1793. getCreateNumber5() {
  1794. GetDataByName(this.getParmCreateNumber5).then(response => {
  1795. this.$nextTick(() => {
  1796. console.log('新增退货单号', response.data.list[0].orderCode)
  1797. this.createTemp5.buyeCode = response.data.list[0].orderCode
  1798. this.$forceUpdate()
  1799. })
  1800. })
  1801. },
  1802. sparePartSearch5(queryString, cb) {
  1803. console.log('备件模糊查询输入值', queryString)
  1804. if (this.createTemp5.providerId !== '') {
  1805. this.requestSparePart5.parammaps.providerId = this.createTemp5.providerId
  1806. this.requestSparePart5.parammaps['partCode'] = queryString
  1807. GetDataByName(this.requestSparePart5).then(response => {
  1808. console.log('备件模糊查询搜索data', response.data.list)
  1809. if (response.data.list == null) {
  1810. cb([])
  1811. } else {
  1812. cb(response.data.list)
  1813. }
  1814. })
  1815. } else {
  1816. this.$message({
  1817. title: '',
  1818. message: '请选择供应商',
  1819. type: 'warning',
  1820. duration: 2000
  1821. })
  1822. }
  1823. },
  1824. handleSelectSparePart5(item) {
  1825. console.log('备件模糊查询选中值', item)
  1826. console.log('备件模糊查询选中值', item.id)
  1827. if (this.listAdd5.length > 0) {
  1828. // eslint-disable-next-line no-redeclare
  1829. if (this.listAdd5.find(obj => obj.id === item.id)) {
  1830. this.$message({
  1831. type: 'warning',
  1832. message: '此备件已存在,请重新选择备件'
  1833. })
  1834. console.log(this.listAdd5)
  1835. console.log(this.listAdd5.length)
  1836. return false
  1837. } else {
  1838. this.listAdd5.unshift(item)
  1839. this.$set(item, 'amount', item.reportery)
  1840. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  1841. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  1842. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  1843. } else {
  1844. item.srcpath = ''
  1845. item.picpath = ''
  1846. }
  1847. }
  1848. } else {
  1849. this.listAdd5.unshift(item)
  1850. this.$set(item, 'amount', item.reportery)
  1851. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  1852. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  1853. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  1854. } else {
  1855. item.srcpath = ''
  1856. item.picpath = ''
  1857. }
  1858. }
  1859. this.$forceUpdate()
  1860. console.log(this.listAdd5)
  1861. },
  1862. changeProvider5(val) {
  1863. console.log(val, '供应商change')
  1864. this.listAdd5 = []
  1865. this.getParmBatchOperation5.parammaps.providerId = val
  1866. },
  1867. // 新增删除
  1868. partDelete5(row) {
  1869. console.log(this.listAdd5)
  1870. MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
  1871. confirmButtonText: '确认',
  1872. cancelButtonText: '取消',
  1873. type: 'warning'
  1874. }).then(() => {
  1875. for (var i = 0; i < this.listAdd5.length; i++) {
  1876. console.log(this.listAdd5[i])
  1877. if (this.listAdd5[i].id === row.id) {
  1878. var listAddIndex = this.listAdd5.indexOf(this.listAdd5[i])
  1879. }
  1880. if (listAddIndex > -1) {
  1881. this.listAdd5.splice(listAddIndex, 1)
  1882. return
  1883. }
  1884. }
  1885. })
  1886. },
  1887. add_dialog_save5() {
  1888. this.isokDisable = true
  1889. setTimeout(() => {
  1890. this.isokDisable = false
  1891. }, 1000)
  1892. this.$refs['createTemp5'].validate(valid => {
  1893. if (valid) {
  1894. console.log(this.listAdd5)
  1895. console.log(this.createTemp5.buyeCode)
  1896. if (this.createTemp5.buyeCode == '' || this.createTemp5.buyeCode == null || this.createTemp5.buyeCode == undefined) {
  1897. GetDataByName(this.getParmCreateNumber5).then(response => {
  1898. this.$nextTick(() => {
  1899. console.log('退库单号', response.data.list[0].orderCode)
  1900. this.createTemp5.buyeCode = response.data.list[0].orderCode
  1901. this.$forceUpdate()
  1902. this.add_dialog_saveSave5()
  1903. })
  1904. })
  1905. } else {
  1906. this.add_dialog_saveSave5()
  1907. }
  1908. }
  1909. })
  1910. },
  1911. add_dialog_saveSave5() {
  1912. if (this.listAdd5.length !== 0) {
  1913. for (var j = 0; j < this.listAdd5.length; j++) {
  1914. console.log(this.listAdd5[j].amount)
  1915. // eslint-disable-next-line use-isnan
  1916. if (this.listAdd5[j].amount == null || this.listAdd5[j].amount === '') {
  1917. this.$message({
  1918. type: 'warning',
  1919. message: '请检查数量是否未填写',
  1920. duration: 2000
  1921. })
  1922. return false
  1923. } else {
  1924. var rulesRefundNumber = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
  1925. if (!rulesRefundNumber.test(this.listAdd5[j].amount)) {
  1926. this.$message({
  1927. type: 'error',
  1928. message: '数量请输入正数,最多保留两位小数点',
  1929. duration: 2000
  1930. })
  1931. return false
  1932. } else if (parseFloat(this.listAdd5[j].amount) > parseFloat(this.listAdd5[j].reportery)) {
  1933. this.$message({
  1934. type: 'error',
  1935. message: '数量不可大于库存数',
  1936. duration: 2000
  1937. })
  1938. return false
  1939. }
  1940. }
  1941. }
  1942. // 保存发的参数!!!!
  1943. var send_data = {
  1944. 'common': {
  1945. 'returnmap': '0'
  1946. },
  1947. 'data': [
  1948. {
  1949. 'name': 'addBigrefunddetail',
  1950. 'type': 'e',
  1951. 'parammaps': {
  1952. 'pastureId': Cookies.get('pastureid'),
  1953. 'buyeCode': this.createTemp5.buyeCode,
  1954. 'providerId': this.createTemp5.providerId,
  1955. 'buyerDate': '',
  1956. 'buyerPerson': this.createTemp5.employeId,
  1957. 'note': ''
  1958. }
  1959. },
  1960. {
  1961. 'name': 'insertSpotList',
  1962. 'resultmaps': {
  1963. 'list': this.listAdd5
  1964. },
  1965. 'children': [
  1966. {
  1967. 'name': 'addRefunddetail',
  1968. 'type': 'e',
  1969. 'parammaps': {
  1970. 'brandId': '@insertSpotList.brandId',
  1971. 'contractId': '@insertSpotList.contractId',
  1972. 'contractCode': '@insertSpotList.contractCode',
  1973. 'bigId': '@insertSpotList.bigId',
  1974. 'partCode': '@insertSpotList.partCode',
  1975. 'partId': '@insertSpotList.partId',
  1976. 'pastureId': '@insertSpotList.pastureId',
  1977. 'price': '@insertSpotList.price',
  1978. 'statue': '@insertSpotList.statue',
  1979. 'remark': '@insertSpotList.remark',
  1980. 'amount': '@insertSpotList.amount',
  1981. 'providerId': '@insertSpotList.providerId',
  1982. 'departmentName': '@insertSpotList.departmentName',
  1983. 'bigId': '@addBigrefunddetail.LastInsertId'
  1984. }
  1985. }
  1986. ]
  1987. }
  1988. ]
  1989. }
  1990. ExecDataByConfig(send_data).then(response => {
  1991. console.log('新增保存发送参数', send_data)
  1992. if (response.msg === 'fail') {
  1993. this.$notify({
  1994. title: '保存失败',
  1995. message: response.data,
  1996. type: 'warning',
  1997. duration: 2000
  1998. })
  1999. } else {
  2000. this.dialogFormVisible5 = false
  2001. this.getdataListParm5.parammaps.inputDatetime = ''
  2002. setTimeout(() => {
  2003. this.get_table_data5()
  2004. }, 1000)
  2005. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  2006. }
  2007. })
  2008. return true
  2009. } else {
  2010. this.$message({
  2011. title: '',
  2012. message: '请选择备件',
  2013. type: 'warning',
  2014. duration: 2000
  2015. })
  2016. return false
  2017. }
  2018. },
  2019. change_dept(e) {
  2020. console.log(e)
  2021. this.getdataListParm1.parammaps.departmentId = e
  2022. this.getdataListPart.parammaps.departmentId = e
  2023. this.get_table_data1()
  2024. },
  2025. tableSort(column) {
  2026. if (this.activeName == 'first') {
  2027. sortChange(column, this.list1)
  2028. } else if (this.activeName == 'second') {
  2029. sortChange(column, this.list2)
  2030. } else if (this.activeName == 'third') {
  2031. sortChange(column, this.list3)
  2032. } else if (this.activeName == 'fouth') {
  2033. sortChange(column, this.list4)
  2034. }
  2035. },
  2036. tableSort2(column) {
  2037. sortChange(column, this.listSee2)
  2038. },
  2039. get_auto_buttons() {
  2040. const DistributionSheet = 'customs:purchase:distributionSheet'
  2041. const isDistributionSheet = checkButtons(this.$store.state.user.buttons, DistributionSheet)
  2042. this.isDistributionSheet = isDistributionSheet
  2043. const PurchaseSee = 'customs:purchase:see'
  2044. const isPurchaseSee = checkButtons(this.$store.state.user.buttons, PurchaseSee)
  2045. this.isPurchaseSee = isPurchaseSee
  2046. const PurchaseClose = 'customs:purchase:close'
  2047. const isPurchaseClose = checkButtons(this.$store.state.user.buttons, PurchaseClose)
  2048. this.isPurchaseClose = isPurchaseClose
  2049. const PurchaseSap = 'customs:purchase:sap'
  2050. const isPurchaseSap = checkButtons(this.$store.state.user.buttons, PurchaseSap)
  2051. this.isPurchaseSap = isPurchaseSap
  2052. const PurchaseSrm = 'customs:purchase:srm'
  2053. const isPurchaseSrm = checkButtons(this.$store.state.user.buttons, PurchaseSrm)
  2054. this.isPurchaseSrm = isPurchaseSrm
  2055. const PurchaseExport = 'customs:purchase:export'
  2056. const isPurchaseExport = checkButtons(this.$store.state.user.buttons, PurchaseExport)
  2057. this.isPurchaseExport = isPurchaseExport
  2058. const ExamineDM = 'customs:purchase:shenhe'
  2059. const isExamineDM = checkButtons(this.$store.state.user.buttons, ExamineDM)
  2060. this.isExamineDM = isExamineDM
  2061. const DistributionManagement = 'customs:purchase:peidanjiemian'
  2062. const isDistributionManagement = checkButtons(this.$store.state.user.buttons, DistributionManagement)
  2063. this.isDistributionManagement = isDistributionManagement
  2064. },
  2065. cellClick(row, column, cell, event) {
  2066. console.log(cell)
  2067. console.log('column', column)
  2068. console.log('行索引', row.id)
  2069. console.log('列索引', column.id)
  2070. return {
  2071. background: '#eceb3c'
  2072. }
  2073. // console.log('event',event)
  2074. },
  2075. tableRowStyle({ row, rowIndex }) {
  2076. console.log(row, row)
  2077. console.log(' row.isParity', row.isParity)
  2078. console.log(parseInt(row.isParity) % 2 == 0)
  2079. if (parseInt(row.isParity) % 2 == 0) {
  2080. return {
  2081. background: '#eee'
  2082. }
  2083. }
  2084. return {
  2085. background: ''
  2086. }
  2087. },
  2088. tableCellStyle({ row, column, rowIndex, columnIndex }) {
  2089. if (row.isNo == 'No' && columnIndex === 10) {
  2090. return {
  2091. background: 'red'
  2092. }
  2093. }
  2094. return {
  2095. background: ''
  2096. }
  2097. },
  2098. handleClick(tab, event) {
  2099. console.log(tab, event)
  2100. if (tab.name === 'first') {
  2101. this.get_table_data1()
  2102. } else if (tab.name === 'fouth') {
  2103. this.get_table_data4()
  2104. } else if (tab.name === 'second') {
  2105. this.get_table_data2()
  2106. } else if (tab.name === 'third') {
  2107. this.get_table_data3()
  2108. } else if (tab.name === 'fifth') {
  2109. this.get_table_data5()
  2110. }
  2111. },
  2112. get_select_list() {
  2113. GetDataByNames(this.requestParams).then(response => {
  2114. this.findAllEmploye = response.data.findAllEmploye.list
  2115. this.findAllPasture = response.data.findAllMainPasture.list
  2116. this.deptNameList = response.data.getDepartmentNY.list
  2117. this.findAllProvider5 = response.data.findAllProvider.list
  2118. this.findAllProvider = response.data.findAllProvider.list
  2119. this.getdataListParm2.parammaps.pastureArr = this.findAllPasture.map(item => {
  2120. return item.name
  2121. })
  2122. this.getdataListParm3.parammaps.pastureArr = this.findAllPasture.map(item => {
  2123. return item.name
  2124. })
  2125. this.getdataListParm4.parammaps.pastureArr = this.findAllPasture.map(item => {
  2126. return item.name
  2127. })
  2128. this.getdataListParm5.parammaps.pastureArr = this.findAllPasture.map(item => {
  2129. return item.name
  2130. })
  2131. console.log(this.deptNameList)
  2132. })
  2133. },
  2134. providerSearch(queryString, cb) {
  2135. console.log('供应商模糊查询输入值', queryString)
  2136. this.requestProvider.parammaps['providerName'] = queryString
  2137. GetDataByName(this.requestProvider).then(response => {
  2138. console.log('供应商模糊查询搜索data', response.data.list)
  2139. cb(response.data.list)
  2140. })
  2141. },
  2142. handleSelectProvider(item) {
  2143. console.log('供应商模糊查询选中值', item)
  2144. },
  2145. get_table_data1() {
  2146. this.listLoading1 = true
  2147. GetDataByName(this.getdataListPart).then(response => {
  2148. console.log(response)
  2149. this.partData = response.data.list
  2150. })
  2151. // 对于多选的牧场,根据数组的名称来转换 pastureArr =》 pastureId TODO:
  2152. if (this.getdataListParm1.parammaps.pastureArr && this.getdataListParm1.parammaps.pastureArr.length > 0) {
  2153. const arr = this.findAllPasture.filter((item) => {
  2154. if (this.getdataListParm1.parammaps.pastureArr.includes(item.name)) {
  2155. return item
  2156. }
  2157. })
  2158. const ids = arr.map((child) => { return child.id })
  2159. console.log(arr,ids,'999999')
  2160. this.getdataListParm1.parammaps.pastureId = ids.toString();
  2161. }
  2162. GetDataByName(this.getdataListParm1).then(response => {
  2163. console.log('this.list1', response.data.list)
  2164. if (response.data.list === null) {
  2165. this.list1 = []
  2166. this.confirmationSheetDisabled = true
  2167. } else {
  2168. // eslint-disable-next-line no-unused-vars
  2169. var list1
  2170. list1 = response.data.list
  2171. var result = []
  2172. list1.forEach((i, j) => {
  2173. // eslint-disable-next-line no-irregular-whitespace
  2174. Array.from(new Set(list1.map(function(item) { return item.partCode }))).forEach((x, y) => {
  2175. if (i.partCode === x) {
  2176. result.push({
  2177. 'amount': i.amount,
  2178. 'amountPre': i.amountPre,
  2179. 'bigId': i.bigId,
  2180. 'brand': i.brand,
  2181. 'brandId': i.brandId,
  2182. 'contractCode': i.contractCode,
  2183. 'count': i.count,
  2184. 'enable': i.enable,
  2185. 'id': i.id,
  2186. 'inventoryType': i.inventoryType,
  2187. 'isZeroStock': i.isZeroStock,
  2188. 'orderNumber': i.orderNumber,
  2189. 'partCode': i.partCode,
  2190. 'partId': i.partId,
  2191. 'partName': i.partName,
  2192. 'pastureId': i.pastureId,
  2193. 'pastureName': i.pastureName,
  2194. 'planAmount': i.planAmount,
  2195. 'price': i.price,
  2196. 'providerId': i.providerId,
  2197. 'providerName': i.providerName,
  2198. 'purpose': i.purpose,
  2199. 'remark': i.remark,
  2200. 'specification': i.specification,
  2201. 'sumAmount': i.sumAmount,
  2202. 'unit': i.unit,
  2203. 'isNo': i.isNo,
  2204. 'srcpath': i.srcpath,
  2205. 'picpath': i.picpath,
  2206. 'departmentName': i.departmentName,
  2207. 'isParity': y
  2208. })
  2209. }
  2210. })
  2211. })
  2212. console.log(result)
  2213. if (result !== null) {
  2214. for (let i = 0; i < result.length; i++) {
  2215. console.log(result[i].srcpath)
  2216. if (result[i].srcpath !== null && result[i].picpath !== null && result[i].srcpath !== undefined && result[i].picpath !== undefined) {
  2217. result[i].srcpath = process.env.VUE_APP_BASE_API + result[i].srcpath
  2218. result[i].picpath = process.env.VUE_APP_BASE_API + result[i].picpath
  2219. } else {
  2220. // this.$set(result[i], 'srcpath', '')
  2221. // this.$set(result[i], 'picpath', '')
  2222. result[i].srcpath = ''
  2223. result[i].picpath = ''
  2224. }
  2225. }
  2226. }
  2227. // console.log(result)
  2228. this.list1 = result
  2229. console.log('处理后table数', this.list1)
  2230. this.confirmationSheetDisabled = false
  2231. }
  2232. var tem = ''
  2233. for (var i = 0; i < this.list1.length; i++) {
  2234. if (tem !== this.list1[i].partCode) {
  2235. this.list1[i].amount = this.list1[i].sumAmount
  2236. tem = this.list1[i].partCode
  2237. } else {
  2238. this.list1[i].amount = 0
  2239. }
  2240. }
  2241. // var a = 0
  2242. // var b = 0
  2243. // for (var i = 0; i < this.list1.length; i++) {
  2244. // if (parseInt(this.list1[i].amountPre) !== 0) {
  2245. // console.log(parseInt(this.list1[i].amountPre))
  2246. // if (a <= 0) {
  2247. // a = this.list1[i].count - 1
  2248. // if (b === 0) {
  2249. // b = parseInt(this.list1[i].amountPre)
  2250. // }
  2251. // } else {
  2252. // a--
  2253. // }
  2254. // if (b > 0) {
  2255. // this.list1[i].amount = this.list1[i].amount + 1
  2256. // b--
  2257. // }
  2258. // }
  2259. // }
  2260. if (response.data.total) {
  2261. this.total1 = response.data.total
  2262. }
  2263. // Just to simulate the time of the request
  2264. setTimeout(() => {
  2265. this.listLoading1 = false
  2266. }, 300)
  2267. })
  2268. },
  2269. confirmationSheet() {
  2270. console.log('点击立确认配单')
  2271. this.temp1.matchCode = ''
  2272. console.log(this.list1) // table表格数据
  2273. // -------------------------------------------
  2274. function groupBy1(array, f) {
  2275. var groups1 = {}
  2276. array.forEach(function(o) {
  2277. var group2 = JSON.stringify(f(o))
  2278. console.log('group2', group2)
  2279. groups1[group2] = groups1[group2] || []
  2280. groups1[group2].push(o)
  2281. })
  2282. return Object.keys(groups1).map(function(group2) {
  2283. return groups1[group2]
  2284. })
  2285. }
  2286. var sorted1 = groupBy1(this.list1, function(item) {
  2287. return [item.partCode]
  2288. })
  2289. console.log('表格数据根据供应商分划', sorted1)
  2290. for (var i = 0; i < sorted1.length; i++) {
  2291. var b = 0
  2292. var c = 0
  2293. for (var j = 0; j < sorted1[i].length; j++) {
  2294. // eslint-disable-next-line no-self-compare
  2295. if (sorted1[i][j].partCode === sorted1[i][j].partCode) {
  2296. // console.log(sorted1[i][j])
  2297. var element = sorted1[i][j]
  2298. b += parseInt(element.amount)
  2299. c = parseInt(element.sumAmount)
  2300. // console.log("amount", element.amount);
  2301. }
  2302. }
  2303. if (b > c || b < c) {
  2304. console.log('No')
  2305. console.log(element.id)
  2306. for (var a = 0; a < this.list1.length; a++) {
  2307. if (element.id === this.list1[a].id) {
  2308. console.log(this.list1[a].partCode)
  2309. for (var b = 0; b < this.list1.length; b++) {
  2310. if (this.list1[b].partCode === this.list1[a].partCode) {
  2311. console.log(this.list1[b])
  2312. this.$set(this.list1[b], 'isNo', 'No')
  2313. } else {
  2314. this.$set(this.list1[b], 'isNo', 'Yes')
  2315. }
  2316. }
  2317. } else {
  2318. this.$set(this.list1[a], 'isNo', 'Yes')
  2319. }
  2320. }
  2321. console.log(b)
  2322. this.$message({
  2323. type: 'warning',
  2324. message: '同一备件多个供应商合计采购数量总和等于申购数量'
  2325. })
  2326. return
  2327. } else {
  2328. for (var a = 0; a < this.list1.length; a++) {
  2329. this.$set(this.list1[a], 'isNo', 'Yes')
  2330. var rulesAmount = /^[0-9]\d*$/
  2331. if (!rulesAmount.test(this.list1[a].amount)) {
  2332. this.$message({
  2333. type: 'error',
  2334. message: '采购数量请输入正整数',
  2335. duration: 2000
  2336. })
  2337. return false
  2338. }
  2339. }
  2340. // console.log('Yes')
  2341. }
  2342. }
  2343. this.getCreateNumber()
  2344. // -------------------------------------------
  2345. this.dialogStatusConfirmation = 'confirmation'
  2346. this.dialogFormVisibleConfirmation = true
  2347. console.log('确认配单data------', this.list1)
  2348. // this.list1 = this.list1.filter(i => parseFloat(i.amount) !== 0)
  2349. console.log(this.list1)
  2350. console.log('根据供应商分类', sorted1)
  2351. console.log('根据供应商分类表格listConfirmationSheet', this.listConfirmationSheet)
  2352. // 处理渲染数据
  2353. var providerNameMap = {}
  2354. var providerNameDest = []
  2355. // eslint-disable-next-line no-redeclare
  2356. for (var i = 0; i < this.list1.length; i++) {
  2357. console.log(this.list1[i])
  2358. var ai = this.list1[i]
  2359. var price = this.list1[i].price
  2360. var amount = this.list1[i].amount
  2361. // console.log(price, amount)
  2362. var sumPrice = 0
  2363. sumPrice = parseFloat(price) * parseFloat(amount)
  2364. if (!providerNameMap[ai.providerName]) {
  2365. providerNameDest.push({
  2366. price: [price],
  2367. amount: [amount],
  2368. sumPrice: [sumPrice],
  2369. providerId: ai.providerId,
  2370. providerName: ai.providerName,
  2371. purpose: ai.purpose,
  2372. list: [ai]
  2373. })
  2374. providerNameMap[ai.providerName] = ai
  2375. providerNameMap[ai.providerId] = ai
  2376. } else {
  2377. // eslint-disable-next-line no-redeclare
  2378. for (var j = 0; j < providerNameDest.length; j++) {
  2379. console.log(providerNameDest[j])
  2380. var dj = providerNameDest[j]
  2381. if (dj.providerName === ai.providerName) {
  2382. dj.sumPrice.push(sumPrice)
  2383. dj.price.push(price)
  2384. // eslint-disable-next-line no-mixed-spaces-and-tabs
  2385. dj.amount.push(amount)
  2386. dj.list.push(ai)
  2387. break
  2388. }
  2389. }
  2390. }
  2391. }
  2392. var providerNameArray = []
  2393. // eslint-disable-next-line no-redeclare
  2394. for (var i = 0; i < this.list1.length; i++) {
  2395. providerNameArray.push(this.list1[i].providerName)
  2396. }
  2397. // console.log('原供应商', providerNameArray)
  2398. function unique(providerNameArray) {
  2399. return Array.from(new Set(providerNameArray))
  2400. }
  2401. var uniqueProviderNameArray = unique(providerNameArray)
  2402. console.log('去重后供应商', uniqueProviderNameArray) // ["泰森机电", "浩祥晟机电", "国宇商贸", "赛娜牧业"]
  2403. // ------------------------------------------
  2404. var OrderNumberArray = []
  2405. this.postDataPramas.common = { 'returnmap': '0' }
  2406. this.postDataPramas.data = []
  2407. for (var i = 0; i < uniqueProviderNameArray.length; i++) {
  2408. this.postDataPramas.data[i] = { 'name': 'autoCreatCode', 'type': 'sm', 'parammaps': {
  2409. pastureId: Cookies.get('pastureid'),
  2410. codeType: 'CG'
  2411. }}
  2412. }
  2413. ExecDataByConfig(this.postDataPramas).then(response => {
  2414. console.log('采购单请求发送参数', this.postDataPramas)
  2415. for (var i = 0; i < response.data.length; i++) {
  2416. // console.log(response.data[i].resultmaps[0].orderCode)
  2417. OrderNumberArray.push(response.data[i].resultmaps[0].orderCode)
  2418. }
  2419. console.log(OrderNumberArray)
  2420. this.listConfirmationSheet.map((item, index) => {
  2421. item.orderNumber = OrderNumberArray[index]
  2422. return item
  2423. })
  2424. this.$forceUpdate()
  2425. })
  2426. console.log(OrderNumberArray)
  2427. this.listConfirmationSheet = providerNameDest
  2428. // console.log(JSON.stringify(this.listConfirmationSheet))
  2429. console.log('根据供应商分类表格listConfirmationSheet', this.listConfirmationSheet)
  2430. var SumArray = []
  2431. this.listConfirmationSheet.forEach((item, index) => {
  2432. console.log(item.sumPrice)
  2433. // console.log(item.sumPrice.reduce((count, v) => count + v, 0))
  2434. SumArray.push(item.sumPrice.reduce((count, v) => count + v, 0).toFixed(3))
  2435. })
  2436. this.listConfirmationSheet.map((item, index) => {
  2437. // console.log(item, index)
  2438. item.Sum = SumArray[index]
  2439. return item
  2440. })
  2441. console.log('根据供应商分类表格listConfirmationSheet', this.listConfirmationSheet)
  2442. // -------------------------------------------
  2443. },
  2444. getCreateNumber() {
  2445. GetDataByName(this.getParmCreateNumber).then(response => {
  2446. this.$nextTick(() => {
  2447. this.show = false
  2448. console.log('配单号', response.data.list[0].orderCode)
  2449. this.temp1.matchCode = response.data.list[0].orderCode
  2450. this.$forceUpdate()
  2451. })
  2452. })
  2453. },
  2454. confirmationSheetData() {
  2455. this.isokDisable = true
  2456. setTimeout(() => {
  2457. this.isokDisable = false
  2458. }, 1000)
  2459. console.log('点击了确认配单提交')
  2460. this.$refs['temp1'].validate(valid => {
  2461. if (valid) {
  2462. // orderNumber
  2463. if (this.temp1.matchCode == '' || this.temp1.matchCode == null || this.temp1.matchCode == undefined) {
  2464. this.getCreateNumber()
  2465. }
  2466. this.postDataPramas.common = { 'returnmap': '0' }
  2467. this.postDataPramas.data = []
  2468. console.log(this.listConfirmationSheet)
  2469. for (let i = 0; i < this.listConfirmationSheet.length; i++) {
  2470. if (this.listConfirmationSheet[i].orderNumber == null || this.listConfirmationSheet[i].orderNumber == undefined) {
  2471. this.$notify({
  2472. title: '保存失败',
  2473. message: '网络异常未生成采购单,请刷新后重新进行配单',
  2474. type: 'warning',
  2475. duration: 2000
  2476. })
  2477. return false
  2478. }
  2479. }
  2480. var a = this.listConfirmationSheet.length
  2481. this.listConfirmationSheet.forEach((item, index) => {
  2482. console.log(item)
  2483. this.postDataPramas.data[index] = { 'name': 'insertBigbuydetail', 'resultname': 'insertBigbuydetail' + index, 'type': 'e', 'parammaps': {
  2484. pastureId: Cookies.get('pastureid'),
  2485. buyeCode: item.orderNumber,
  2486. providerId: item.providerId,
  2487. buyerPerson: this.temp1.buyerPerson,
  2488. buyerDate: this.temp1.buyerDate,
  2489. matchCode: this.temp1.matchCode
  2490. }}
  2491. this.postDataPramas.data[a] = { 'name': 'insertSpotList', 'resultmaps': { 'list': item.list }}
  2492. this.postDataPramas.data[a].children = []
  2493. this.postDataPramas.data[a].children[0] = { 'name': 'insertbuydetail', 'type': 'e', 'parammaps': {
  2494. bigId: '@insertBigbuydetail' + index + '.LastInsertId',
  2495. pastureId: '@insertSpotList.pastureId',
  2496. contractCode: '@insertSpotList.contractCode',
  2497. amount: '@insertSpotList.amount',
  2498. sumAmount: '@insertSpotList.sumAmount',
  2499. contractId: '@insertSpotList.id',
  2500. departmentName: '@insertSpotList.departmentName',
  2501. remark: '@insertSpotList.purpose'
  2502. }}
  2503. a = a + 1
  2504. })
  2505. this.postDataPramas.data[a] = { 'name': 'insertSpotListbpp', 'resultmaps': { 'list': this.partData }}
  2506. this.postDataPramas.data[a].children = []
  2507. this.postDataPramas.data[a].children[0] = { 'name': 'updateBigpartpurchaseStatu', 'type': 'e', 'parammaps': {
  2508. id: '@insertSpotListbpp.id',
  2509. matchCode: this.temp1.matchCode
  2510. }}
  2511. this.postDataPramas.data.push({ 'name': 'insertbigpartdeal', 'type': 'e', 'parammaps': {
  2512. empId: this.temp1.buyerPerson,
  2513. pastureId: Cookies.get('pastureid'),
  2514. matchCode: this.temp1.matchCode
  2515. }}
  2516. )
  2517. ExecDataByConfig(this.postDataPramas).then(response => {
  2518. if (response.msg === 'fail') {
  2519. var buyeCode = new RegExp('buyeCode')
  2520. if (buyeCode.test(response.data)) {
  2521. this.$notify({
  2522. title: '',
  2523. message: '网络异常未生成采购单,请刷新后重新进行配单',
  2524. type: 'warning',
  2525. duration: 2000
  2526. })
  2527. } else {
  2528. this.$notify({
  2529. title: '保存失败',
  2530. message: response.data,
  2531. type: 'warning',
  2532. duration: 2000
  2533. })
  2534. }
  2535. } else {
  2536. this.dialogFormVisibleConfirmation = false
  2537. this.activeName = 'fouth'
  2538. this.get_table_data4()
  2539. this.$notify({
  2540. title: '',
  2541. message: '保存成功',
  2542. type: 'success',
  2543. duration: 2000
  2544. })
  2545. }
  2546. })
  2547. }
  2548. })
  2549. },
  2550. get_table_data2() {
  2551. this.listLoading2 = true
  2552. if (this.$refs['inputDatetime2'] !== undefined && this.$refs['inputDatetime2'].value !== null) {
  2553. this.getdataListParm2.parammaps.startTime = this.$refs['inputDatetime2'].value[0]
  2554. this.getdataListParm2.parammaps.stopTime = this.$refs['inputDatetime2'].value[1]
  2555. } else {
  2556. this.getdataListParm2.parammaps.startTime = ''
  2557. this.getdataListParm2.parammaps.stopTime = ''
  2558. }
  2559. // 对于多选的牧场,根据数组的名称来转换 pastureArr =》 pastureId TODO:
  2560. if (this.getdataListParm2.parammaps.pastureArr && this.getdataListParm2.parammaps.pastureArr.length > 0) {
  2561. const arr = this.findAllPasture.filter((item) => {
  2562. if (this.getdataListParm2.parammaps.pastureArr.includes(item.name)) {
  2563. return item
  2564. }
  2565. })
  2566. const ids = arr.map((child) => { return child.id })
  2567. console.log(arr,ids,'999999')
  2568. this.getdataListParm2.parammaps.pastureId = ids.toString();
  2569. }
  2570. GetDataByName(this.getdataListParm2).then(response => {
  2571. this.list2 = response.data.list
  2572. this.pageNum2 = response.data.pageNum
  2573. this.pageSize2 = response.data.pageSize
  2574. if (response.data.total) {
  2575. this.total2 = response.data.total
  2576. }
  2577. // Just to simulate the time of the request
  2578. setTimeout(() => {
  2579. this.listLoading2 = false
  2580. }, 300)
  2581. })
  2582. },
  2583. form_search2() {
  2584. this.listLoading = true
  2585. if (this.getdataListParm2.parammaps.inputDatetime === null) {
  2586. this.getdataListParm2.parammaps.inputDatetime = ''
  2587. }
  2588. this.getdataListParm2.offset = 1
  2589. this.get_table_data2()
  2590. },
  2591. statu: function(cellValue) {
  2592. if (cellValue.statu === 0) {
  2593. return '未到货'
  2594. } else if (cellValue.statu === 1) {
  2595. return '部分到货'
  2596. } else if (cellValue.statu === 2) {
  2597. return '按时到货'
  2598. } else if (cellValue.statu === 3) {
  2599. return '已延期'
  2600. } else if (cellValue.statu === 4) {
  2601. return '已关闭'
  2602. } else if (cellValue.statu === 5) {
  2603. return '部分到货-延期'
  2604. } else if (cellValue.statu === 6) {
  2605. return '全部到货-延期'
  2606. }
  2607. },
  2608. statue: function(cellValue) {
  2609. if (cellValue.statue === 0) {
  2610. return '审核中'
  2611. } else if (cellValue.statue === 1) {
  2612. return '审核通过'
  2613. } else if (cellValue.statue === 2) {
  2614. return '未通过'
  2615. }
  2616. },
  2617. form_see2(row) {
  2618. this.temp2 = Object.assign({}, row)
  2619. if (this.temp2.statu === 0) {
  2620. this.isStatu = false
  2621. this.temp2.statu = '未到货'
  2622. this.isExtensionDays = false
  2623. } else if (this.temp2.statu === 1) {
  2624. this.isStatu = false
  2625. this.temp2.statu = '部分到货'
  2626. this.isExtensionDays = false
  2627. } else if (this.temp2.statu === 2) {
  2628. this.isStatu = false
  2629. this.temp2.statu = '按时到货'
  2630. this.isExtensionDays = false
  2631. } else if (this.temp2.statu === 3) {
  2632. this.isStatu = false
  2633. this.temp2.statu = '已延期'
  2634. this.isExtensionDays = true
  2635. } else if (this.temp2.statu === 4) {
  2636. this.temp2.statu = '已关闭'
  2637. this.isStatu = true
  2638. this.isExtensionDays = false
  2639. } else if (this.temp2.statu === 5) {
  2640. this.isStatu = false
  2641. this.temp2.statu = '部分到货-延期'
  2642. this.isExtensionDays = true
  2643. } else if (this.temp2.statu === 6) {
  2644. this.isStatu = false
  2645. this.temp2.statu = '全部到货-延期'
  2646. this.isExtensionDays = true
  2647. }
  2648. this.dialogStatusSee2 = 'see'
  2649. this.dialogFormVisibleSee2 = true
  2650. this.getdataListSee2.parammaps.id = row.id
  2651. this.getSeeList2()
  2652. },
  2653. getSeeList2() {
  2654. GetDataByName(this.getdataListSee2).then(response => {
  2655. this.listSee2 = response.data.list
  2656. if (response.data.list !== null) {
  2657. for (let i = 0; i < response.data.list.length; i++) {
  2658. 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) {
  2659. this.listSee2[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  2660. this.listSee2[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  2661. } else {
  2662. this.listSee2[i].srcpath = ''
  2663. this.listSee2[i].picpath = ''
  2664. }
  2665. }
  2666. }
  2667. console.log('查看下方table数据', response.data.list)
  2668. // this.pageNum2 = response.data.pageNum
  2669. // this.pageSize2 = response.data.pageSize
  2670. var sumArray = []
  2671. for (var i = 0; i < this.listSee2.length; i++) {
  2672. console.log()
  2673. sumArray.push(
  2674. this.listSee2[i].sumPrice
  2675. )
  2676. }
  2677. console.log('总价', sumArray)
  2678. var arrvalue = 0
  2679. for (var i = 0; i < sumArray.length; i++) {
  2680. console.log('table内总价每一个值', sumArray[i])
  2681. arrvalue += parseFloat(sumArray[i])// 数组的索引是从0开始的
  2682. }
  2683. this.temp2.sumPrices = arrvalue.toFixed(3)
  2684. setTimeout(() => {
  2685. this.listLoadingSee = false
  2686. }, 100)
  2687. })
  2688. },
  2689. resetCloseTemp() {
  2690. this.temp2.note = ''
  2691. },
  2692. handleClose2(row) {
  2693. this.resetCloseTemp()
  2694. this.temp2 = Object.assign({}, row)
  2695. this.dialogStatusClose = 'close'
  2696. this.dialogFormVisibleClose = true
  2697. },
  2698. handleClose5(row) {
  2699. this.resetCloseTemp5()
  2700. this.temp5 = Object.assign({}, row)
  2701. this.dialogFormVisibleClose5 = true
  2702. },
  2703. resetCloseTemp5() {
  2704. this.temp2.note = ''
  2705. },
  2706. closeData5() {
  2707. this.isokDisable = true
  2708. setTimeout(() => {
  2709. this.isokDisable = false
  2710. }, 1000)
  2711. console.log('点击确认关闭', this.temp2)
  2712. this.$refs['temp5'].validate(valid => {
  2713. if (valid) {
  2714. this.requestParamStute5.parammaps.id = this.temp5.id
  2715. this.requestParamStute5.parammaps.note = this.temp5.note
  2716. PostDataByName(this.requestParamStute5).then(response => {
  2717. console.log('新增保存发送参数', this.requestParamStute5)
  2718. if (response.msg !== 'fail') {
  2719. this.get_table_data5()
  2720. this.dialogFormVisibleClose5 = false
  2721. this.$notify({
  2722. title: '成功',
  2723. message: '关闭成功',
  2724. type: 'success',
  2725. duration: 2000
  2726. })
  2727. } else {
  2728. failproccess(response, this.$notify)
  2729. }
  2730. })
  2731. }
  2732. })
  2733. },
  2734. form_see5(row) {
  2735. this.temp5 = Object.assign({}, row)
  2736. if (this.temp5.statu === 0) {
  2737. this.isStatu = false
  2738. this.temp5.statu = '未到货'
  2739. } else if (this.temp2.statu === 1) {
  2740. this.isStatu = false
  2741. this.temp5.statu = '部分到货'
  2742. } else if (this.temp2.statu === 2) {
  2743. this.isStatu = false
  2744. this.temp5.statu = '按时到货'
  2745. } else if (this.temp2.statu === 3) {
  2746. this.isStatu = false
  2747. this.temp5.statu = '已延期'
  2748. } else if (this.temp2.statu === 4) {
  2749. this.temp5.statu = '已关闭'
  2750. this.isStatu = true
  2751. } else if (this.temp2.statu === 5) {
  2752. this.isStatu = false
  2753. this.temp5.statu = '部分到货-延期'
  2754. } else if (this.temp2.statu === 6) {
  2755. this.isStatu = false
  2756. this.temp5.statu = '全部到货-延期'
  2757. }
  2758. this.dialogStatusSee5 = 'see'
  2759. this.dialogFormVisibleSee5 = true
  2760. this.getdataListSee5.parammaps.id = row.id
  2761. this.getSeeList5()
  2762. },
  2763. getSeeList5() {
  2764. GetDataByName(this.getdataListSee5).then(response => {
  2765. this.listSee5 = response.data.list
  2766. if (response.data.list !== null) {
  2767. for (let i = 0; i < response.data.list.length; i++) {
  2768. 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) {
  2769. this.listSee5[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  2770. this.listSee5[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  2771. } else {
  2772. this.listSee5[i].srcpath = ''
  2773. this.listSee5[i].picpath = ''
  2774. }
  2775. }
  2776. }
  2777. console.log('查看下方table数据', response.data.list)
  2778. // this.pageNum2 = response.data.pageNum
  2779. // this.pageSize2 = response.data.pageSize
  2780. var sumArray = []
  2781. for (var i = 0; i < this.listSee2.length; i++) {
  2782. console.log()
  2783. sumArray.push(
  2784. this.listSee5[i].sumPrice
  2785. )
  2786. }
  2787. console.log('总价', sumArray)
  2788. var arrvalue = 0
  2789. for (var i = 0; i < sumArray.length; i++) {
  2790. console.log('table内总价每一个值', sumArray[i])
  2791. arrvalue += parseFloat(sumArray[i])// 数组的索引是从0开始的
  2792. }
  2793. this.temp5.sumPrices = arrvalue.toFixed(3)
  2794. setTimeout(() => {
  2795. this.listLoadingSee = false
  2796. }, 100)
  2797. })
  2798. },
  2799. handleCurrentChange(val) {
  2800. this.currentRow = val
  2801. console.log('currentRow', this.currentRow)
  2802. },
  2803. sapUpload() {
  2804. const that = this
  2805. console.log('currentRow', this.currentRow.sapstatus)
  2806. var send_data = this.selectList
  2807. if (send_data.length == 0) {
  2808. that.$notify({ title: '失败', message: '请勾选数据!', type: 'error', duration: 2000 })
  2809. return false
  2810. }
  2811. console.log(that.isSap)
  2812. if (that.isSap == 1) {
  2813. that.isSap = 0
  2814. SapOrder(send_data).then(response => {
  2815. console.log('response', response)
  2816. if (response.msg !== 'fail') {
  2817. that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
  2818. that.selectList = []
  2819. that.get_table_data2()
  2820. } else {
  2821. that.$notify({ title: '失败', message: '上传失败', type: 'error', duration: 2000 })
  2822. }
  2823. })
  2824. } else {
  2825. that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击', type: 'error', duration: 2000 })
  2826. }
  2827. setTimeout(() => {
  2828. that.isSap = 1
  2829. }, 3000)
  2830. // if(this.currentRow.sapstatus){
  2831. // if(this.currentRow.sapstatus != 0){
  2832. // const sapArr = this.currentRow.sapbuyeCode.split(",")
  2833. // console.log("sapArr",sapArr)
  2834. // sapArr.forEach(function(item){
  2835. // console.log("sapArr item",item)
  2836. // var send_data = {
  2837. // "code":item,
  2838. // "pastureid":Cookies.get('pastureid')
  2839. // }
  2840. // SapOrder(send_data).then(response => {
  2841. // console.log('response', response)
  2842. // if (response.msg !== 'fail') {
  2843. // that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
  2844. // that.get_table_data()
  2845. // } else {
  2846. // that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
  2847. // }
  2848. // })
  2849. // })
  2850. // }
  2851. // }
  2852. },
  2853. checkboxInit(row, index) {
  2854. console.log(row)
  2855. var data1 = new Date(row.buyerDate)
  2856. var data2 = new Date('2022-10-25')
  2857. if (data1 > data2) {
  2858. if (row.srmstatus !== 0) {
  2859. return 1
  2860. } else {
  2861. return 0
  2862. }
  2863. } else {
  2864. return 0
  2865. }
  2866. },
  2867. // 监听 - 表格 - 勾选
  2868. change_table_selection(val) {
  2869. this.selectList = val
  2870. console.log('勾选数据selectList', this.selectList)
  2871. },
  2872. srmUpload() {
  2873. const that = this
  2874. console.log('currentRow', this.currentRow.srmstatus)
  2875. console.log('勾选数据selectList', this.selectList)
  2876. var send_data = this.selectList
  2877. if (send_data.length == 0) {
  2878. that.$notify({ title: '失败', message: '请勾选数据!', type: 'error', duration: 2000 })
  2879. return false
  2880. }
  2881. console.log(that.isSrm)
  2882. if (that.isSrm == 1) {
  2883. that.isSrm = 0
  2884. SrmOrder(send_data).then(response => {
  2885. console.log('response', response)
  2886. if (response.msg !== 'fail') {
  2887. that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
  2888. that.selectList = []
  2889. that.get_table_data2()
  2890. } else {
  2891. that.$notify({ title: '失败', message: '上传失败', type: 'error', duration: 2000 })
  2892. }
  2893. })
  2894. } else {
  2895. that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击', type: 'error', duration: 2000 })
  2896. }
  2897. setTimeout(() => {
  2898. that.isSrm = 1
  2899. }, 3000)
  2900. // if(this.currentRow.srmstatus){
  2901. // if(this.currentRow.srmstatus != 0){
  2902. // const srmArr = this.currentRow.srmbuyeCode.split(",")
  2903. // console.log("srmArr",srmArr)
  2904. // srmArr.forEach(function(item){
  2905. // console.log("srmArr item",item)
  2906. // var send_data = {
  2907. // "code":item,
  2908. // "pastureid":Cookies.get('pastureid')
  2909. // }
  2910. // SrmOrder(send_data).then(response => {
  2911. // console.log('response', response)
  2912. // if (response.msg !== 'fail') {
  2913. // that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
  2914. // that.get_table_data()
  2915. // } else {
  2916. // that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
  2917. // }
  2918. // })
  2919. // })
  2920. // }
  2921. // }
  2922. },
  2923. closeData() {
  2924. this.isokDisable = true
  2925. setTimeout(() => {
  2926. this.isokDisable = false
  2927. }, 1000)
  2928. console.log('点击确认关闭', this.temp2)
  2929. this.$refs['temp2'].validate(valid => {
  2930. if (valid) {
  2931. this.requestParamStute.parammaps.id = this.temp2.id
  2932. this.requestParamStute.parammaps.note = this.temp2.note
  2933. PostDataByName(this.requestParamStute).then(response => {
  2934. console.log('新增保存发送参数', this.requestParamStute)
  2935. if (response.msg !== 'fail') {
  2936. this.get_table_data2()
  2937. this.dialogFormVisibleClose = false
  2938. this.$notify({
  2939. title: '成功',
  2940. message: '关闭成功',
  2941. type: 'success',
  2942. duration: 2000
  2943. })
  2944. } else {
  2945. failproccess(response, this.$notify)
  2946. }
  2947. })
  2948. }
  2949. })
  2950. },
  2951. get_table_data3() {
  2952. this.listLoading3 = true
  2953. if (this.$refs['inputDatetime3'] !== undefined && this.$refs['inputDatetime3'].value !== null) {
  2954. this.getdataListParm3.parammaps.startTime = this.$refs['inputDatetime3'].value[0]
  2955. this.getdataListParm3.parammaps.stopTime = this.$refs['inputDatetime3'].value[1]
  2956. } else {
  2957. this.getdataListParm3.parammaps.startTime = ''
  2958. this.getdataListParm3.parammaps.stopTime = ''
  2959. }
  2960. // 对于多选的牧场,根据数组的名称来转换 pastureArr =》 pastureId TODO:
  2961. if (this.getdataListParm3.parammaps.pastureArr && this.getdataListParm3.parammaps.pastureArr.length > 0) {
  2962. const arr = this.findAllPasture.filter((item) => {
  2963. if (this.getdataListParm3.parammaps.pastureArr.includes(item.name)) {
  2964. return item
  2965. }
  2966. })
  2967. const ids = arr.map((child) => { return child.id })
  2968. console.log(arr,ids,'999999')
  2969. this.getdataListParm3.parammaps.pastureId = ids.toString();
  2970. }
  2971. GetDataByName(this.getdataListParm3).then(response => {
  2972. this.list3 = response.data.list
  2973. this.pageNum3 = response.data.pageNum
  2974. this.pageSize3 = response.data.pageSize
  2975. if (response.data.total) {
  2976. this.total3 = response.data.total
  2977. }
  2978. // Just to simulate the time of the request
  2979. setTimeout(() => {
  2980. this.listLoading3 = false
  2981. }, 300)
  2982. })
  2983. },
  2984. form_search3() {
  2985. this.listLoading = true
  2986. if (this.getdataListParm3.parammaps.inputDatetime === null) {
  2987. this.getdataListParm3.parammaps.inputDatetime = ''
  2988. }
  2989. this.getdataListParm3.offset = 1
  2990. this.get_table_data3()
  2991. },
  2992. handleDownload3() {
  2993. this.$alert('采购明细正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  2994. this.isPercentage = true
  2995. this.percentage = 1
  2996. var timer = setInterval(() => {
  2997. this.percentage += 5
  2998. if (this.percentage > 95) {
  2999. this.percentage = 99
  3000. clearInterval(timer)
  3001. }
  3002. this.percentage = this.percentage
  3003. }, 1000)
  3004. this.downloadListParm3.name = this.getdataListParm3.name
  3005. this.downloadListParm3.parammaps = this.getdataListParm3.parammaps
  3006. GetAccount(this.downloadListParm3).then(response => {
  3007. if (response.data.list !== '') {
  3008. this.percentage = 99
  3009. setTimeout(() => {
  3010. this.isPercentage = false
  3011. }, 2000)
  3012. }
  3013. const obj = {
  3014. 0: '新增申购',
  3015. 1: '暂估申购',
  3016. 3: '赠品申购',
  3017. 4: '奶厅申购'
  3018. }
  3019. response.data.list.length && response.data.list.forEach((item) => {
  3020. item.reportery = parseFloat(item.reportery)
  3021. item.purchase_type = obj[item.purchase_type]
  3022. })
  3023. this.downloadList3 = response.data.list
  3024. const elecExcelDatas = [
  3025. {
  3026. tHeader: ['配单号', '采购单号', '备件编号', '备件名称', '备件规格', '备件品牌', '计量单位', '供应商', '单价', '当前库存', '申购数量', '采购数量', '入库数', '申购类型', '申购部门', '采购人', '配单日期'],
  3027. filterVal: ['matchCode', 'buyeCode', 'partCode', 'partName', 'specification', 'brand', 'unit', 'providerName', 'price', 'reportery', 'sumAmount', 'amount', 'receiveAmount', 'purchase_type', 'departmentName', 'empname', 'buyerDate'],
  3028. tableDatas: this.downloadList3,
  3029. sheetName: '采购明细'
  3030. }
  3031. ]
  3032. json2excel(elecExcelDatas, '采购明细', true, 'xlsx')
  3033. })
  3034. },
  3035. get_table_data5() {
  3036. this.listLoading5 = true
  3037. // 对于多选的牧场,根据数组的名称来转换 pastureArr =》 pastureId TODO:
  3038. if (this.getdataListParm5.parammaps.pastureArr && this.getdataListParm5.parammaps.pastureArr.length > 0) {
  3039. const arr = this.findAllPasture.filter((item) => {
  3040. if (this.getdataListParm5.parammaps.pastureArr.includes(item.name)) {
  3041. return item
  3042. }
  3043. })
  3044. const ids = arr.map((child) => { return child.id })
  3045. console.log(arr,ids,'999999')
  3046. this.getdataListParm5.parammaps.pastureId = ids.toString();
  3047. }
  3048. GetDataByName(this.getdataListParm5).then(response => {
  3049. this.list5 = response.data.list
  3050. this.pageNum5 = response.data.pageNum
  3051. this.pageSize5 = response.data.pageSize
  3052. if (response.data.total) {
  3053. this.total5 = response.data.total
  3054. }
  3055. // Just to simulate the time of the request
  3056. setTimeout(() => {
  3057. this.listLoading5 = false
  3058. }, 300)
  3059. })
  3060. },
  3061. form_search5() {
  3062. this.listLoading = true
  3063. this.getdataListParm5.offset = 1
  3064. this.get_table_data5()
  3065. },
  3066. get_table_data4() {
  3067. this.listLoading4 = true
  3068. if (this.$refs['inputDatetime4'] !== undefined && this.$refs['inputDatetime4'].value !== null) {
  3069. this.getdataListParm4.parammaps.startTime = this.$refs['inputDatetime4'].value[0]
  3070. this.getdataListParm4.parammaps.stopTime = this.$refs['inputDatetime4'].value[1]
  3071. } else {
  3072. this.getdataListParm4.parammaps.startTime = ''
  3073. this.getdataListParm4.parammaps.stopTime = ''
  3074. }
  3075. // 对于多选的牧场,根据数组的名称来转换 pastureArr =》 pastureId TODO:
  3076. if (this.getdataListParm4.parammaps.pastureArr && this.getdataListParm4.parammaps.pastureArr.length > 0) {
  3077. const arr = this.findAllPasture.filter((item) => {
  3078. if (this.getdataListParm4.parammaps.pastureArr.includes(item.name)) {
  3079. return item
  3080. }
  3081. })
  3082. const ids = arr.map((child) => { return child.id })
  3083. console.log(arr,ids,'999999')
  3084. this.getdataListParm4.parammaps.pastureId = ids.toString();
  3085. }
  3086. GetDataByName(this.getdataListParm4).then(response => {
  3087. this.list4 = response.data.list
  3088. this.pageNum4 = response.data.pageNum
  3089. this.pageSize4 = response.data.pageSize
  3090. if (response.data.total) {
  3091. this.total4 = response.data.total
  3092. }
  3093. // Just to simulate the time of the request
  3094. setTimeout(() => {
  3095. this.listLoading4 = false
  3096. }, 300)
  3097. })
  3098. },
  3099. form_search4() {
  3100. this.listLoading = true
  3101. if (this.getdataListParm4.parammaps.inputDatetime === null) {
  3102. this.getdataListParm4.parammaps.inputDatetime = ''
  3103. }
  3104. this.getdataListParm4.offset = 1
  3105. this.get_table_data4()
  3106. },
  3107. form_see4(row) {
  3108. this.dialogStatusSee4 = 'see'
  3109. this.dialogFormVisibleSee4 = true
  3110. this.temp4 = Object.assign({}, row)
  3111. this.getdataListSee4.parammaps.matchCode = row.matchCode
  3112. this.getSeeList4()
  3113. var reason = '未通过原因:' + this.temp4.workflowNote
  3114. if (this.temp4.statue === 0) {
  3115. this.activeList = [{ title: '配单', date: this.temp4.dealTime, name: this.temp4.empname }, { title: '供应主管审核' }]
  3116. this.active = 1
  3117. } else if (this.temp4.statue === 1) {
  3118. this.activeList = [{ title: '配单', date: this.temp4.dealTime, name: this.temp4.empname }, { title: '供应主管审核', date: this.temp4.chargeDate, name: this.temp4.chargeName }]
  3119. this.active = 2
  3120. } else if (this.temp4.statue === 2) {
  3121. this.activeList = [{ title: '配单', date: this.temp4.dealTime, name: this.temp4.empname }, { title: '供应主管审核', date: this.temp4.chargeDate, name: this.temp4.chargeName, status: 'error', reason: reason }]
  3122. this.active = 2
  3123. }
  3124. },
  3125. getSeeList4() {
  3126. GetDataByName(this.getdataListSee4).then(response => {
  3127. this.listSee4 = response.data.list
  3128. this.listUpdate4 = response.data.list
  3129. if (response.data.list !== null) {
  3130. for (let i = 0; i < response.data.list.length; i++) {
  3131. console.log(response.data.list[i].srcpath)
  3132. console.log(response.data.list[i].picpath)
  3133. console.log(process.env.VUE_APP_BASE_API + response.data.list[i].srcpath)
  3134. 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) {
  3135. if (this.dialogStatusSee4 == 'see') {
  3136. this.listSee4[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  3137. this.listSee4[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  3138. } else {
  3139. this.listUpdate4[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  3140. this.listUpdate4[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  3141. }
  3142. } else {
  3143. this.listSee4[i].srcpath = ''
  3144. this.listSee4[i].picpath = ''
  3145. this.listUpdate4[i].srcpath = ''
  3146. this.listUpdate4[i].picpath = ''
  3147. }
  3148. }
  3149. }
  3150. console.log('查看下方table数据', response.data.list)
  3151. this.pageNum4 = response.data.pageNum
  3152. this.pageSize4 = response.data.pageSize
  3153. })
  3154. },
  3155. handleExamine(row) {
  3156. if (row == undefined) {
  3157. this.examineTemp = this.temp4
  3158. this.$set(this.temp4, 'SHstatue', 1)
  3159. this.$set(this.temp4, 'workflowNote', '')
  3160. } else {
  3161. this.examineTemp = Object.assign({}, row)
  3162. this.$set(this.examineTemp, 'SHstatue', 1)
  3163. this.$set(this.examineTemp, 'workflowNote', '')
  3164. }
  3165. this.dialogStatus_Examine = 'examine'
  3166. this.dialogFormVisible_Examine = true
  3167. this.statueReason = false
  3168. },
  3169. changeSHStatue(val) {
  3170. if (val == 2) {
  3171. this.statueReason = true
  3172. } else {
  3173. this.statueReason = false
  3174. }
  3175. },
  3176. createExamineData() {
  3177. console.log(this.examineTemp)
  3178. this.$refs['examineTemp'].validate(valid => {
  3179. if (valid) {
  3180. this.isokDisable = true
  3181. setTimeout(() => {
  3182. this.isokDisable = false
  3183. }, 5000)
  3184. if (this.examineTemp.SHstatue == 1) {
  3185. console.log('通过')
  3186. this.postDataPramas.common = { 'returnmap': '0' }
  3187. this.postDataPramas.data = []
  3188. this.postDataPramas.data[0] = { 'name': 'partdealCharge', 'type': 'e', 'parammaps': {
  3189. 'id': this.examineTemp.id,
  3190. 'statue': this.examineTemp.SHstatue,
  3191. 'empId': Cookies.get('employeid'),
  3192. 'workflowNote': this.examineTemp.workflowNote
  3193. }}
  3194. this.postDataPramas.data[1] = { 'name': 'updatebigbuydetailenable', 'type': 'e', 'parammaps': {
  3195. 'matchCode': this.examineTemp.matchCode
  3196. }}
  3197. this.postDataPramas.data[2] = { 'name': 'updatebigbuydetailZero', 'type': 'e', 'parammaps': {
  3198. 'matchCode': this.examineTemp.matchCode
  3199. }}
  3200. ExecDataByConfig(this.postDataPramas).then(response => {
  3201. this.isokDisable = false
  3202. console.log('审核保存发送参数', this.postDataPramas)
  3203. if (response.msg === 'fail') {
  3204. this.$notify({
  3205. title: '审核失败',
  3206. message: response.data,
  3207. type: 'warning',
  3208. duration: 2000
  3209. })
  3210. } else {
  3211. this.dialogFormVisible_Examine = false
  3212. this.get_table_data4()
  3213. this.$notify({
  3214. title: '',
  3215. message: '审核成功',
  3216. type: 'success',
  3217. duration: 2000
  3218. })
  3219. }
  3220. })
  3221. } else if (this.examineTemp.SHstatue == 2) {
  3222. console.log('不通过')
  3223. this.postDataPramas.common = { 'returnmap': '0' }
  3224. this.postDataPramas.data = []
  3225. this.postDataPramas.data[0] = { 'name': 'partdealCharge', 'type': 'e', 'parammaps': {
  3226. 'id': this.examineTemp.id,
  3227. 'statue': this.examineTemp.SHstatue,
  3228. 'empId': Cookies.get('employeid'),
  3229. 'workflowNote': this.examineTemp.workflowNote
  3230. }}
  3231. // this.postDataPramas.data[1] = { 'name': 'updatepartpurchase', 'type': 'e', 'parammaps': {
  3232. // 'matchCode': this.examineTemp.matchCode
  3233. // }}
  3234. ExecDataByConfig(this.postDataPramas).then(response => {
  3235. console.log('审核保存发送参数', this.postDataPramas)
  3236. if (response.msg === 'fail') {
  3237. this.$notify({
  3238. title: '审核失败',
  3239. message: response.data,
  3240. type: 'warning',
  3241. duration: 2000
  3242. })
  3243. } else {
  3244. this.dialogFormVisible_Examine = false
  3245. this.get_table_data4()
  3246. this.$notify({
  3247. title: '',
  3248. message: '审核成功',
  3249. type: 'success',
  3250. duration: 2000
  3251. })
  3252. }
  3253. })
  3254. }
  3255. }
  3256. })
  3257. },
  3258. form_edit(row) {
  3259. this.dialogStatusUpdate4 = 'update'
  3260. this.dialogFormVisibleUpdate4 = true
  3261. this.getdataListSee4.parammaps.matchCode = row.matchCode
  3262. this.updateTemp4 = Object.assign(row, {})
  3263. this.getSeeList4()
  3264. },
  3265. edit_dialog_save() {
  3266. this.$refs['updateTemp4'].validate(valid => {
  3267. if (valid) {
  3268. // for (let i = 0; i < this.listUpdate4.length; i++) {
  3269. // var rulesAmount = /^\d+$/
  3270. // if ((this.listUpdate4[i].amount == '' || this.listUpdate4[i].amount == undefined) && parseFloat(this.listUpdate4[i].amount) !== 0) {
  3271. // this.$message({
  3272. // type: 'error',
  3273. // message: '采购数量不可为空',
  3274. // duration: 2000
  3275. // })
  3276. // return false
  3277. // } else if (!rulesAmount.test(parseFloat(this.listUpdate4[i].amount))) {
  3278. // this.$message({
  3279. // type: 'error',
  3280. // message: '采购数量不可为空',
  3281. // duration: 2000
  3282. // })
  3283. // return false
  3284. // }
  3285. // }
  3286. for (let i = 0; i < this.listUpdate4.length; i++) {
  3287. console.log(this.listUpdate4[i].amount)
  3288. var rulesAmount = /^\d+$/
  3289. if ((this.listUpdate4[i].amount == '' || this.listUpdate4[i].amount == undefined) && parseFloat(this.listUpdate4[i].amount) !== 0) {
  3290. this.$message({
  3291. type: 'error',
  3292. message: '采购数量不可为空',
  3293. duration: 2000
  3294. })
  3295. return false
  3296. } else if (!rulesAmount.test(parseFloat(this.listUpdate4[i].amount))) {
  3297. this.$message({
  3298. type: 'error',
  3299. message: '采购数量请输入大于等于0的整数',
  3300. duration: 2000
  3301. })
  3302. return false
  3303. } else {
  3304. this.postDataPramas.common = { 'returnmap': '0' }
  3305. this.postDataPramas.data = []
  3306. this.postDataPramas.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listUpdate4 }}
  3307. this.postDataPramas.data[0].children = []
  3308. this.postDataPramas.data[0].children[0] = { 'name': 'updatePDbuydetail', 'type': 'e', 'parammaps': {
  3309. amount: '@insertSpotList.amount',
  3310. id: '@insertSpotList.id'
  3311. }}
  3312. this.postDataPramas.data[1] = { 'name': 'partdealCharge', 'type': 'e', 'parammaps': {
  3313. id: this.updateTemp4.id,
  3314. statue: '0',
  3315. empId: Cookies.get('employeid')
  3316. }}
  3317. }
  3318. }
  3319. ExecDataByConfig(this.postDataPramas).then(response => {
  3320. console.log('新增保存发送参数', this.postDataPramas)
  3321. if (response.msg === 'fail') {
  3322. this.$notify({
  3323. title: '保存失败',
  3324. message: response.data,
  3325. type: 'warning',
  3326. duration: 2000
  3327. })
  3328. } else {
  3329. this.dialogFormVisibleUpdate4 = false
  3330. this.getdataListParm4.parammaps.inputDatetime = ''
  3331. this.get_table_data4()
  3332. this.$notify({
  3333. title: '',
  3334. message: '保存成功',
  3335. type: 'success',
  3336. duration: 2000
  3337. })
  3338. }
  3339. })
  3340. return true
  3341. }
  3342. })
  3343. }
  3344. }
  3345. }
  3346. </script>
  3347. <style lang="scss" >
  3348. .el-table .warning-row {
  3349. background: red;
  3350. }
  3351. .el-table .color-row {
  3352. background: #eee;
  3353. }
  3354. </style>
  3355. <style lang="scss" scoped>
  3356. .app-contentClose .el-form-item__content {
  3357. margin-left: 0 !important;
  3358. }
  3359. </style>
  3360. <style lang="scss" scoped>
  3361. .app-contentConfirmationSheet {
  3362. margin-bottom: 50px;
  3363. }
  3364. .app-content {
  3365. background: #eee;
  3366. margin-bottom: 50px;
  3367. .title {
  3368. line-height: 40px;
  3369. div {
  3370. float: left;
  3371. margin-right: 50px;
  3372. b {
  3373. padding-left: 10px;
  3374. }
  3375. }
  3376. }
  3377. .total {
  3378. margin-left: 80%;
  3379. line-height: 30px;
  3380. }
  3381. }
  3382. </style>