index.vue 139 KB

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