index.vue 154 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136
  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. <div class="filter-container">
  8. <el-select v-model="getdataListParm.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item" @change="changePastureName">
  9. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  10. </el-select>
  11. <el-input v-model="getdataListParm.parammaps.orderNumber" placeholder="申购单号" style="width: 200px;" class="filter-item" />
  12. <el-select v-model="getdataListParm.parammaps.stuteSH" style="width: 140px;" clearable placeholder="审核状态" class="filter-item">
  13. <el-option v-for="item in statues" :key="item.id" :label="item.name" :value="item.id" />
  14. </el-select>
  15. <el-select v-model="getdataListParm.parammaps.departmentId" clearable style="width: 140px;" placeholder="申购部门" class="filter-item">
  16. <el-option v-for="item in findAllDepart" :key="item.id" :label="item.name" :value="item.id" />
  17. </el-select>
  18. <el-select v-model="getdataListParm.parammaps.purchase_type" clearable style="width: 140px;" placeholder="申购状态" class="filter-item">
  19. <el-option v-for="item in subscriptionStatusList" :key="item.id" :label="item.name" :value="item.id" />
  20. </el-select>
  21. <el-input v-model="getdataListParm.parammaps.empName" placeholder="申购人" style="width: 200px;" class="filter-item" />
  22. <!-- <el-select v-model="getdataListParm.parammaps.empName " style="width: 140px;" placeholder="申购人" class="filter-item">
  23. <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
  24. </el-select> -->
  25. <el-date-picker ref="inputDatetime" v-model="getdataListParm.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
  26. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
  27. <div>
  28. <el-button v-if="isSubscribeAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="apply_subscribe">新增</el-button>
  29. <el-button v-if="isSubscribeSpecial" class="filter-item" type="primary" icon="el-icon-edit" @click="handle_specialSubscription">特殊申购</el-button>
  30. <el-button v-if="isSubscribeMilk" class="filter-item" type="primary" icon="el-icon-edit" @click="handle_milkSubscription">奶厅申购</el-button>
  31. <el-button v-if="isSubscribeExport" v-waves class="filter-item" type="success" icon="el-icon-upload2" @click="handleDownload">导出</el-button>
  32. <el-radio-group v-model="radioAll" style="margin-top:-9px" @change="changeAll()">
  33. <el-radio-button label="全部" />
  34. <el-badge :value="pending.total" class="item">
  35. <el-radio-button label="待处理" />
  36. </el-badge>
  37. <el-radio-button label="已处理" />
  38. </el-radio-group>
  39. </div>
  40. </div>
  41. <div class="filter-button" />
  42. <el-table
  43. :key="tableKey"
  44. v-loading="listLoading"
  45. element-loading-text="给我一点时间"
  46. :data="list"
  47. border
  48. fit
  49. highlight-current-row
  50. style="width: 100%;"
  51. :row-style="rowStyle"
  52. :cell-style="cellStyle"
  53. class="elTable"
  54. :max-height="myHeight"
  55. >
  56. <el-table-column label="序号" align="center" type="index" width="50px">
  57. <template slot-scope="scope">
  58. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  59. </template>
  60. </el-table-column>
  61. <el-table-column label="申购单号" min-width="150px" align="center">
  62. <template slot-scope="scope">
  63. <span>{{ scope.row.orderNumber }}</span>
  64. </template>
  65. </el-table-column>
  66. <el-table-column label="牧场" min-width="90px" align="center">
  67. <template slot-scope="scope">
  68. <span>{{ scope.row.pastureName }}</span>
  69. </template>
  70. </el-table-column>
  71. <el-table-column label="申购部门" min-width="80px" align="center">
  72. <template slot-scope="scope">
  73. <span>{{ scope.row.departmentName }}</span>
  74. </template>
  75. </el-table-column>
  76. <el-table-column label="申购人" min-width="80px" align="center">
  77. <template slot-scope="scope">
  78. <span>{{ scope.row.empname }}</span>
  79. </template>
  80. </el-table-column>
  81. <el-table-column label="申购日期" sortable prop="inputTime" min-width="80px" align="center" />
  82. <el-table-column label="申购状态" min-width="80px" align="center">
  83. <template slot-scope="scope">
  84. <!-- <span v-if="scope.row.purchase_type == 1">暂估</span> -->
  85. <span v-if="scope.row.purchase_type == 3">赠品</span>
  86. <span v-else>正常</span>
  87. </template>
  88. </el-table-column>
  89. <el-table-column label="审核状态" min-width="80px" align="center" :formatter="statue" />
  90. <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width" fixed="right">
  91. <template slot-scope="{row}">
  92. <el-button v-if="isSubscribeSee" type="primary" size="mini" @click="form_see(row)">查看</el-button>
  93. <el-button style="display:inline-block" type="success" size="mini" @click="form_edit1(row)">合单</el-button>
  94. <el-button v-if="row.statue == 4||row.statue == 6||row.statue == 8||row.statue == 10||row.statue == 12 ||row.statue == 14" style="display:inline-block" type="success" size="mini" @click="form_edit(row)">编辑</el-button>
  95. <el-button v-else style="display:none" type="success" size="mini" @click="form_edit(row)">编辑</el-button>
  96. <!-- 库管 -->
  97. <el-button v-if="isSubscribeExamineKG && row.statue == 2" style="display:inline-block" type="success" size="mini" @click="handleExamine1(row)">审核1</el-button>
  98. <!-- 设备 -->
  99. <el-button v-if="isSubscribeExamineSBZG && row.statue == 3" style="display:inline-block" type="success" size="mini" @click="handleExamine2(row)">审核2</el-button>
  100. <!-- 供应商主管 -->
  101. <el-button v-if="isSubscribeExamineZG && row.statue == 9" style="display:inline-block" type="success" size="mini" @click="handleExamine3(row)">审核3</el-button>
  102. <!-- 场长 -->
  103. <el-button v-if="sdchangzhangshenhe && (row.purchase_type < 0 || row.purchase_type == 0) && row.statue == 5" style="display:inline-block" type="success" size="mini" @click="handleExamine4(row)">审核4</el-button>
  104. <el-button v-if="sdchangzhangshenhe && row.purchase_type > 0 && row.statue == 13" style="display:inline-block" type="success" size="mini" @click="handleExamine4(row)">审核4</el-button>
  105. <!-- 采购 -->
  106. <el-button v-if="isSubscribeExamineCG && row.statue == 11 " style="display:inline-block" type="success" size="mini" @click="handleExamine5(row)">审核5</el-button>
  107. <!-- 财务 -->
  108. <el-button v-if="isSubscribeExamineCW && row.purchase_type > 0 && row.statue == 5 " style="display:inline-block" type="success" size="mini" @click="handleExamine6(row)">审核6</el-button>
  109. <el-button v-if="isSubscribeDelete && (row.statue == 4||row.statue == 6||row.statue == 8||row.statue == 12)" style="display:inline-block" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
  110. <el-button v-else style="display:none" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
  111. </template>
  112. </el-table-column>
  113. </el-table>
  114. <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
  115. <!-- 弹出层新增or修改 -->
  116. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="90%">
  117. <div class="app-container">
  118. <el-form
  119. ref="createTemp"
  120. :rules="rules"
  121. :model="createTemp"
  122. label-position="right"
  123. label-width="100px"
  124. style="width: 90%;margin:0 auto;"
  125. >
  126. <el-row>
  127. <el-col :span="8">
  128. <el-form-item label="申购单号:" prop="orderNumber">
  129. <el-input ref="orderNumber" v-model="createTemp.orderNumber" disabled />
  130. </el-form-item>
  131. </el-col>
  132. <el-col :span="8">
  133. <el-form-item label="牧场:" prop="pastureId">
  134. <el-select v-model="createTemp.pastureId" placeholder="牧场" class="filter-item" style="width:100%" :disabled="dialogStatus==='update'" @change="changePasture">
  135. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
  136. </el-select>
  137. </el-form-item>
  138. </el-col>
  139. <el-col :span="8">
  140. <el-form-item label="申购部门:" prop="departmentId">
  141. <el-select v-model="createTemp.departmentId" placeholder="申购部门" class="filter-item" style="width:100%" :disabled="dialogStatus==='update' || isMilk" @change="changeDepart">
  142. <el-option v-for="item in createDepartList" :key="item.id" :label="item.name" :value="item.id" :disabled="item.name== '挤奶处'" />
  143. </el-select>
  144. </el-form-item>
  145. </el-col>
  146. </el-row>
  147. <el-row>
  148. <el-col :span="8">
  149. <el-form-item label="申购人:" prop="employeId">
  150. <el-select v-model="createTemp.employeId" placeholder="申购人" class="filter-item" style="width:100%" :disabled="dialogStatus==='update'">
  151. <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
  152. </el-select>
  153. </el-form-item>
  154. </el-col>
  155. <el-col :span="8">
  156. <el-form-item label="申购日期:" prop="createTime">
  157. <el-date-picker v-model="createTemp.createTime" :picker-options="pickerOptions" type="date" placeholder="申购日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='update'" />
  158. </el-form-item>
  159. </el-col>
  160. <el-col v-if="dialogStatus==='create'" :span="8">
  161. <el-form-item label="线上采购:" prop="providerId">
  162. <el-select v-model="createTemp.providerId" placeholder="线上采购" clearable class="filter-item" style="width:100%" @change="changeProvider">
  163. <el-option v-for="item in onlineSubscriptionList" :key="item.id" :label="item.providerName" :value="item.id" />
  164. </el-select>
  165. </el-form-item>
  166. </el-col>
  167. <el-col v-if="dialogStatus==='update'" :span="8">
  168. <el-form-item label="线上采购:" prop="providerName">
  169. <el-input ref="providerName" v-model="createTemp.providerName" disabled />
  170. </el-form-item>
  171. </el-col>
  172. </el-row>
  173. <el-row>
  174. <el-col :span="16">
  175. <el-form-item label="备件:" prop="partCode">
  176. <el-autocomplete
  177. v-model="createTemp.partCode"
  178. value-key="name"
  179. class="inline-input"
  180. :fetch-suggestions="sparePartSearch"
  181. placeholder="请输入备件编号或备件名称或备件规格"
  182. style="width:100%"
  183. ref="autocomplete"
  184. @select="handleSelectSparePart"
  185. >
  186. <template slot-scope="{ item }">
  187. <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>&nbsp;
  188. | &nbsp;<b>备件名称:</b><span class="addr">{{ item.partName }}</span>&nbsp;
  189. | &nbsp;<b>备件规格:</b><span class="addr">{{ item.specification }}</span>
  190. </template>
  191. </el-autocomplete>
  192. </el-form-item>
  193. </el-col>
  194. </el-row>
  195. </el-form>
  196. <el-table
  197. :key="tableKey"
  198. v-loading="listLoading"
  199. element-loading-text="给我一点时间"
  200. :data="listAdd"
  201. border
  202. fit
  203. highlight-current-row
  204. style="width: 100%;margin-bottom:30px"
  205. :row-style="rowStyle"
  206. :cell-style="cellStyle"
  207. class="elTable"
  208. >
  209. <!-- table表格 -->
  210. <el-table-column label="序号" align="center" type="index" width="50px" />
  211. <el-table-column label="备件编号" prop="partCode" align="center" min-width="90">
  212. <template slot-scope="scope">
  213. <span>{{ scope.row.partCode }}</span>
  214. </template>
  215. </el-table-column>
  216. <el-table-column label="备件名称" prop="partName" align="center" min-width="90">
  217. <template slot-scope="scope">
  218. <span>{{ scope.row.partName }}</span>
  219. </template>
  220. </el-table-column>
  221. <el-table-column label="备件规格" prop="specification" min-width="80px" align="center">
  222. <template slot-scope="scope">
  223. <span>{{ scope.row.specification }}</span>
  224. </template>
  225. </el-table-column>
  226. <el-table-column label="备件图片" prop="picpath" min-width="110px" align="center">
  227. <template slot-scope="scope">
  228. <el-popover placement="right" title="" trigger="hover">
  229. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  230. <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  231. </el-popover>
  232. </template>
  233. </el-table-column>
  234. <el-table-column label="备件品牌" prop="brand" align="center" min-width="60">
  235. <template slot-scope="scope">
  236. <span v-if="dialogStatus==='create'">{{ scope.row.brandName }}</span>
  237. <span v-if="dialogStatus==='update'">{{ scope.row.brandName }}</span>
  238. </template>
  239. </el-table-column>
  240. <el-table-column label="计量单位" prop="unit" align="center" min-width="60">
  241. <template slot-scope="scope">
  242. <span>{{ scope.row.unit }}</span>
  243. </template>
  244. </el-table-column>
  245. <el-table-column label="现有库存" prop="reportery" align="center" min-width="60">
  246. <template slot-scope="scope">
  247. <span v-if="createTemp.providerId == '' || parseFloat(createTemp.purchaseType) > 0">{{ scope.row.reportery }}</span>
  248. </template>
  249. </el-table-column>
  250. <el-table-column v-if="createTemp.providerId == ''" label="价格" prop="price" align="center" min-width="150">
  251. <template slot-scope="scope">
  252. <div v-for="item in scope.row.pricearr">
  253. <el-tooltip class="item" effect="dark" placement="top-start">
  254. <div slot="content">{{item}}</div>
  255. <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{item}}</div>
  256. </el-tooltip>
  257. </div>
  258. </template>
  259. </el-table-column>
  260. <el-table-column v-else label="价格" prop="price" align="center" min-width="150">
  261. <template slot-scope="scope">
  262. <el-form :model="scope.row" :rules="rules">
  263. <el-form-item prop="price">
  264. <el-input v-model="scope.row.price" style="margin-top:15px" />
  265. </el-form-item>
  266. </el-form>
  267. </template>
  268. </el-table-column>
  269. <el-table-column v-if="createTemp.providerId == ''" label="使用周期" min-width="120px" align="center">
  270. <template slot-scope="scope">
  271. <div v-for="item in scope.row.lifeCyclearr">
  272. <el-tooltip class="item" effect="dark" placement="top-start">
  273. <div slot="content">{{item}}</div>
  274. <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{item}}</div>
  275. </el-tooltip>
  276. </div>
  277. </template>
  278. </el-table-column>
  279. <el-table-column v-if="createTemp.providerId == ''" label="合同差异项" min-width="120px" align="center">
  280. <template slot-scope="scope">
  281. <div v-for="item in scope.row.contractVarianceItemarr">
  282. <el-tooltip class="item" effect="dark" placement="top-start">
  283. <div slot="content">{{item}}</div>
  284. <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{item}}</div>
  285. </el-tooltip>
  286. </div>
  287. </template>
  288. </el-table-column>
  289. <el-table-column label="申购数量" min-width="100px" align="center" valign="middle">
  290. <template slot-scope="scope">
  291. <el-form :model="scope.row" :rules="rules">
  292. <el-form-item prop="amount">
  293. <el-input v-model="scope.row.amount" style="margin-top:15px" />
  294. </el-form-item>
  295. </el-form>
  296. </template>
  297. </el-table-column>
  298. <!-- <el-table-column label="部门" min-width="110px" align="center" prop="purpose" valign="middle" /> -->
  299. <el-table-column label="驳回说明" min-width="110px" align="center" prop="explain1" valign="middle" />
  300. <el-table-column label="备注" min-width="110px" align="center" valign="middle">
  301. <template slot-scope="scope">
  302. <el-input v-model="scope.row.purpose" />
  303. </template>
  304. </el-table-column>
  305. <el-table-column
  306. label="操作"
  307. align="center"
  308. width="100"
  309. class-name="small-padding fixed-width"
  310. fixed="right"
  311. >
  312. <template slot-scope="{row}">
  313. <a class="del" @click="partDelete(row)">删除</a>
  314. </template>
  315. </el-table-column>
  316. </el-table>
  317. <div slot="footer" class="dialog-footer" style="bottom:10px">
  318. <el-button type="primary" :disabled="isokDisable" v-if="dialogStatus==='create'" @click="add_dialog_save()">保存并关闭</el-button>
  319. <el-button type="primary" :disabled="isokDisable" v-else-if="dialogStatus==='update'" @click="edit_dialog_save()">保存并关闭</el-button>
  320. <el-button @click="dialogFormVisible = false;get_table_data()">取消并关闭</el-button>
  321. </div>
  322. </div>
  323. </el-dialog>
  324. <!-- 特殊申购 -->
  325. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible2" :close-on-click-modal="false" width="90%">
  326. <div class="app-container">
  327. <el-form
  328. ref="createTemp"
  329. :rules="rules"
  330. :model="createTemp"
  331. label-position="right"
  332. label-width="100px"
  333. style="width: 90%;margin:0 auto;"
  334. >
  335. <el-row>
  336. <el-col :span="8">
  337. <el-form-item label="申购单号:" prop="orderNumber">
  338. <el-input ref="orderNumber" v-model="createTemp.orderNumber" disabled />
  339. </el-form-item>
  340. </el-col>
  341. <el-col :span="8">
  342. <el-form-item label="牧场:" prop="pastureId">
  343. <el-select v-model="createTemp.pastureId" placeholder="牧场" class="filter-item" style="width:100%" :disabled="dialogStatus==='update'" @change="changePasture">
  344. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
  345. </el-select>
  346. </el-form-item>
  347. </el-col>
  348. <el-col :span="8">
  349. <el-form-item label="申购部门:" prop="departmentId">
  350. <el-select v-model="createTemp.departmentId" placeholder="申购部门" class="filter-item" style="width:100%" :disabled="dialogStatus==='update'" @change="changeDepart">
  351. <el-option v-for="item in createDepartList" :key="item.id" :label="item.name" :value="item.id" />
  352. </el-select>
  353. </el-form-item>
  354. </el-col>
  355. </el-row>
  356. <el-row>
  357. <el-col :span="8">
  358. <el-form-item label="申购人:" prop="employeId">
  359. <el-select v-model="createTemp.employeId" placeholder="申购人" class="filter-item" style="width:100%" :disabled="dialogStatus==='update'">
  360. <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
  361. </el-select>
  362. </el-form-item>
  363. </el-col>
  364. <el-col :span="8">
  365. <el-form-item label="申购日期:" prop="createTime">
  366. <el-date-picker v-model="createTemp.createTime" :picker-options="pickerOptions" type="date" placeholder="申购日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='update'" />
  367. </el-form-item>
  368. </el-col>
  369. <el-col v-if="dialogStatus==='special' && createTemp.purchaseType == '1' || createTemp.purchaseType == '3'" :span="8">
  370. <el-form-item label="供应商:" prop="providerId">
  371. <el-select v-model="createTemp.providerId" filterable placeholder="供应商" class="filter-item" style="width:100%" :disabled="dialogStatus==='update'">
  372. <el-option v-for="item in providerList" :key="item.id" :label="item.providerName" :value="item.id" />
  373. </el-select>
  374. </el-form-item>
  375. </el-col>
  376. <el-col v-if="dialogStatus==='special' && createTemp.purchaseType == '2'" :span="8">
  377. <el-form-item label="供应商:" prop="providerId">
  378. <el-input ref="providerName" v-model="createTemp.providerName" />
  379. <!-- <el-select v-model="createTemp.providerId" placeholder="供应商" class="filter-item" style="width:100%" :disabled="dialogStatus==='update'">
  380. <el-option v-for="item in providerList" :key="item.id" :label="item.providerName" :value="item.id" />
  381. </el-select> -->
  382. </el-form-item>
  383. </el-col>
  384. <el-col :span="8" v-if="dialogStatus==='special' && createTemp.purchaseType == '2'">
  385. <el-form-item label="垫付人:" prop="funderId">
  386. <el-select v-model="createTemp.funderId" filterable placeholder="垫付人" class="filter-item" style="width:100%" :disabled="dialogStatus==='update'">
  387. <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
  388. </el-select>
  389. </el-form-item>
  390. </el-col>
  391. </el-row>
  392. <el-row v-if="dialogStatus==='special'">
  393. <el-col :span="24">
  394. <el-form-item label="申购类型:" prop="purchaseType">
  395. <el-radio v-model="createTemp.purchaseType" label="1" @change="changeType()">暂估</el-radio>
  396. <!-- <el-radio v-model="createTemp.purchaseType" label="2" @change="changeType()">垫付</el-radio> -->
  397. <el-radio v-model="createTemp.purchaseType" label="3" @change="changeType()">赠品</el-radio>
  398. </el-form-item>
  399. </el-col>
  400. </el-row>
  401. <el-row>
  402. <el-col :span="16">
  403. <el-form-item label="备件:" prop="partCode">
  404. <el-autocomplete
  405. v-model="createTemp.partCode"
  406. value-key="name"
  407. class="inline-input"
  408. :fetch-suggestions="sparePartSearch"
  409. placeholder="请输入备件编号或备件名称或备件规格"
  410. style="width:100%"
  411. ref="autocomplete"
  412. @select="handleSelectSparePart"
  413. >
  414. <template slot-scope="{ item }">
  415. <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>&nbsp;
  416. | &nbsp;<b>备件名称:</b><span class="addr">{{ item.partName }}</span>&nbsp;
  417. | &nbsp;<b>备件规格:</b><span class="addr">{{ item.specification }}</span>
  418. </template>
  419. </el-autocomplete>
  420. </el-form-item>
  421. </el-col>
  422. </el-row>
  423. </el-form>
  424. <el-table
  425. :key="tableKey"
  426. v-loading="listLoading"
  427. element-loading-text="给我一点时间"
  428. :data="listAdd"
  429. border
  430. fit
  431. highlight-current-row
  432. style="width: 100%;margin-bottom:30px"
  433. :row-style="rowStyle"
  434. :cell-style="cellStyle"
  435. class="elTable"
  436. >
  437. <!-- table表格 -->
  438. <el-table-column label="序号" align="center" type="index" width="50px" />
  439. <el-table-column label="备件编号" prop="partCode" align="center" min-width="90">
  440. <template slot-scope="scope">
  441. <span>{{ scope.row.partCode }}</span>
  442. </template>
  443. </el-table-column>
  444. <el-table-column label="备件名称" prop="partName" align="center" min-width="90">
  445. <template slot-scope="scope">
  446. <span>{{ scope.row.partName }}</span>
  447. </template>
  448. </el-table-column>
  449. <el-table-column label="备件规格" prop="specification" min-width="80px" align="center">
  450. <template slot-scope="scope">
  451. <span>{{ scope.row.specification }}</span>
  452. </template>
  453. </el-table-column>
  454. <el-table-column label="备件图片" prop="picpath" min-width="110px" align="center">
  455. <template slot-scope="scope">
  456. <el-popover placement="right" title="" trigger="hover">
  457. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  458. <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  459. </el-popover>
  460. </template>
  461. </el-table-column>
  462. <el-table-column label="备件品牌" prop="brand" align="center" min-width="60">
  463. <template slot-scope="scope">
  464. <span v-if="dialogStatus==='special'">{{ scope.row.brandName }}</span>
  465. </template>
  466. </el-table-column>
  467. <el-table-column label="计量单位" prop="unit" align="center" min-width="60">
  468. <template slot-scope="scope">
  469. <span>{{ scope.row.unit }}</span>
  470. </template>
  471. </el-table-column>
  472. <el-table-column label="现有库存" prop="reportery" align="center" min-width="60">
  473. <template slot-scope="scope">
  474. <span v-if="createTemp.providerId == '' || parseFloat(createTemp.purchaseType) > 0">{{ scope.row.reportery }}</span>
  475. </template>
  476. </el-table-column>
  477. <el-table-column v-if="createTemp.purchaseType == '1'" label="价格" prop="price" align="center" min-width="150">
  478. <template slot-scope="scope">
  479. <div v-if="createTemp.purchaseType == '1'" v-for="item in scope.row.pricearr" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
  480. <el-tooltip class="item" effect="dark" placement="top-start">
  481. <div slot="content">{{item}}</div>
  482. <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{item}}</div>
  483. </el-tooltip>
  484. </div>
  485. </template>
  486. </el-table-column>
  487. <el-table-column v-if="createTemp.purchaseType == '3'" label="价格" prop="price" align="center" min-width="150">
  488. <template slot-scope="scope">
  489. <el-form :model="scope.row" :rules="rules">
  490. <el-form-item prop="price">
  491. <el-input v-model="scope.row.price" style="margin-top:15px" />
  492. </el-form-item>
  493. </el-form>
  494. </template>
  495. </el-table-column>
  496. <el-table-column label="申购数量" min-width="100px" align="center" valign="middle">
  497. <template slot-scope="scope">
  498. <el-form :model="scope.row" :rules="rules">
  499. <el-form-item prop="amount">
  500. <el-input v-model="scope.row.amount" style="margin-top:15px" />
  501. </el-form-item>
  502. </el-form>
  503. </template>
  504. </el-table-column>
  505. <el-table-column label="备注" min-width="110px" align="center" valign="middle">
  506. <template slot-scope="scope">
  507. <el-input v-model="scope.row.purpose" />
  508. </template>
  509. </el-table-column>
  510. <el-table-column
  511. label="操作"
  512. align="center"
  513. width="100"
  514. class-name="small-padding fixed-width"
  515. fixed="right"
  516. >
  517. <template slot-scope="{row}">
  518. <a class="del" @click="partDelete(row)">删除</a>
  519. </template>
  520. </el-table-column>
  521. </el-table>
  522. <div slot="footer" class="dialog-footer" style="bottom:10px">
  523. <el-button type="primary" :disabled="isokDisable" v-if="dialogStatus==='special'" @click="special_dialog_save()">保存并关闭</el-button>
  524. <el-button @click="dialogFormVisible2 = false;get_table_data()">取消并关闭</el-button>
  525. </div>
  526. </div>
  527. </el-dialog>
  528. <!-- 查看 -->
  529. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisibleSee" :close-on-click-modal="false" width="90%">
  530. <div class="app-containerSee">
  531. <el-form
  532. ref="seeTemp"
  533. :rules="rules"
  534. :model="seeTemp"
  535. label-position="right"
  536. label-width="100px"
  537. style="width: 90%;margin:0 auto;"
  538. >
  539. <el-row>
  540. <el-col :span="8">
  541. <el-form-item label="申购单号:" prop="orderNumber">
  542. <el-input ref="orderNumber" v-model="seeTemp.orderNumber" disabled />
  543. </el-form-item>
  544. </el-col>
  545. <el-col :span="8">
  546. <el-form-item label="牧场:" prop="pastureId">
  547. <el-select v-model="seeTemp.pastureId" placeholder="牧场" class="filter-item" disabled style="width:100%">
  548. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
  549. </el-select>
  550. </el-form-item>
  551. </el-col>
  552. <el-col :span="8">
  553. <el-form-item label="申购部门:" prop="departmentName">
  554. <el-input ref="departmentName" v-model="seeTemp.departmentName" disabled />
  555. </el-form-item>
  556. </el-col>
  557. </el-row>
  558. <el-row>
  559. <el-col :span="8">
  560. <el-form-item label="申购人:" prop="empname">
  561. <el-input ref="empname" v-model="seeTemp.empname" disabled />
  562. </el-form-item>
  563. </el-col>
  564. <el-col :span="8">
  565. <el-form-item label="申购日期:" prop="inputTime">
  566. <el-date-picker v-model="seeTemp.inputTime" :picker-options="pickerOptions" type="date" placeholder="申购日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" disabled />
  567. </el-form-item>
  568. </el-col>
  569. <el-col :span="8" v-if="seeTemp.purchaseType == '2'">
  570. <el-form-item label="供应商:" prop="funderProviderName ">
  571. <el-input ref="funderProviderName " v-model="seeTemp.funderProviderName " disabled />
  572. </el-form-item>
  573. </el-col>
  574. <el-col :span="8" v-if="seeTemp.purchase_type > 0 && seeTemp.purchaseType !== '2'">
  575. <el-form-item label="供应商:" prop="providerName">
  576. <el-input ref="providerName" v-model="seeTemp.providerName" disabled />
  577. </el-form-item>
  578. </el-col>
  579. <el-col :span="8" v-if="seeTemp.purchaseType == '2'">
  580. <el-form-item label="垫付人:" prop="funder_name">
  581. <el-input ref="funder_name" v-model="seeTemp.funder_name" disabled />
  582. </el-form-item>
  583. </el-col>
  584. <el-col :span="8" v-if="seeTemp.purchase_type < 1">
  585. <el-form-item label="线上采购:" prop="providerName">
  586. <el-input ref="providerName" v-model="seeTemp.providerName" disabled />
  587. </el-form-item>
  588. </el-col>
  589. </el-row>
  590. <el-row v-if="seeTemp.purchase_type > 0">
  591. <el-col :span="24">
  592. <el-form-item label="申购类型:" prop="purchaseType">
  593. <!-- <el-radio v-model="seeTemp.purchaseType" disabled label="1">暂估</el-radio> -->
  594. <!-- <el-radio v-model="seeTemp.purchaseType" disabled label="2">垫付</el-radio> -->
  595. <el-radio v-model="seeTemp.purchaseType" disabled label="3">赠品</el-radio>
  596. </el-form-item>
  597. </el-col>
  598. </el-row>
  599. </el-form>
  600. <el-table
  601. :key="tableKey"
  602. v-loading="listLoadingSee"
  603. element-loading-text="给我一点时间"
  604. :data="listSee"
  605. border
  606. fit
  607. highlight-current-row
  608. style="width: 100%;margin-bottom:30px"
  609. :row-style="rowStyle"
  610. :cell-style="cellStyle"
  611. class="elTable"
  612. @sort-change="tableSort"
  613. >
  614. <el-table-column type="index" label="序号" align="center" width="50px" />
  615. <el-table-column label="备件编号" prop="partCode" align="center" min-width="90">
  616. <template slot-scope="scope">
  617. <span>{{ scope.row.partCode }}</span>
  618. </template>
  619. </el-table-column>
  620. <el-table-column label="备件名称" prop="partName" align="center" min-width="90">
  621. <template slot-scope="scope">
  622. <span>{{ scope.row.partName }}</span>
  623. </template>
  624. </el-table-column>
  625. <el-table-column label="备件规格" prop="specification" min-width="90px" align="center">
  626. <template slot-scope="scope">
  627. <span>{{ scope.row.specification }}</span>
  628. </template>
  629. </el-table-column>
  630. <el-table-column label="备件图片" prop="picpath" min-width="110px" align="center">
  631. <template slot-scope="scope">
  632. <el-popover placement="right" title="" trigger="hover">
  633. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  634. <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  635. </el-popover>
  636. </template>
  637. </el-table-column>
  638. <el-table-column label="备件品牌" prop="brandName" align="center" min-width="60">
  639. <template slot-scope="scope">
  640. <span>{{ scope.row.brandName }}</span>
  641. </template>
  642. </el-table-column>
  643. <el-table-column label="计量单位" prop="unit" align="center" min-width="60">
  644. <template slot-scope="scope">
  645. <span>{{ scope.row.unit }}</span>
  646. </template>
  647. </el-table-column>
  648. <el-table-column label="现有库存" sortable prop="storageAmount" align="center" min-width="60" />
  649. <!-- <el-table-column label="价格" sortable prop="price" align="center" min-width="60" /> -->
  650. <el-table-column label="价格" min-width="150px" align="center">
  651. <template slot-scope="scope">
  652. <div v-for="item in scope.row.pricearr" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
  653. <el-tooltip class="item" effect="dark" placement="top-start">
  654. <div slot="content">{{item}}</div>
  655. <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{item}}</div>
  656. </el-tooltip>
  657. </div>
  658. </template>
  659. </el-table-column>
  660. <el-table-column label="使用周期" min-width="120px" align="center">
  661. <template slot-scope="scope">
  662. <div v-for="item in scope.row.lifeCyclearr" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
  663. <el-tooltip class="item" effect="dark" placement="top-start">
  664. <div slot="content">{{item}}</div>
  665. <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{item}}</div>
  666. </el-tooltip>
  667. </div>
  668. </template>
  669. </el-table-column>
  670. <el-table-column label="合同差异项" min-width="120px" align="center">
  671. <template slot-scope="scope">
  672. <div v-for="item in scope.row.contractVarianceItemarr" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
  673. <el-tooltip class="item" effect="dark" placement="top-start">
  674. <div slot="content">{{item}}</div>
  675. <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{item}}</div>
  676. </el-tooltip>
  677. </div>
  678. </template>
  679. </el-table-column>
  680. <el-table-column label="申购数量" sortable prop="amount" align="center" min-width="60" />
  681. <el-table-column label="驳回说明" min-width="110px" align="center" prop="explain1" valign="middle" />
  682. <el-table-column label="备注" min-width="110px" align="center" prop="purpose" />
  683. </el-table>
  684. <el-form
  685. ref="seeTemp"
  686. :rules="rules"
  687. :model="seeTemp"
  688. label-position="right"
  689. label-width="100px"
  690. style="width: 90%;margin:0 auto;"
  691. >
  692. <el-row>
  693. <el-col>
  694. <el-form-item label="流程进度" />
  695. <el-steps :active="active" align-center finish-status="success">
  696. <el-step
  697. v-for="(item,index) in activeList"
  698. :key="index"
  699. :title="item.title"
  700. :status="item.status"
  701. >
  702. <template slot="description">
  703. <div class="step-row">
  704. <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
  705. <div>{{ item.reason }}</div>
  706. </div>
  707. </template>
  708. </el-step>
  709. </el-steps>
  710. </el-col>
  711. </el-row>
  712. <el-row>
  713. <el-col>
  714. <el-form-item label="操作:">
  715. <!-- 库管 -->
  716. <el-button v-if="isSubscribeExamineKG && seeTemp.statue == 2" type="success" style="display:inline-block" @click="handleExamine1(row)">审核1</el-button>
  717. <!-- 设备 -->
  718. <el-button v-if="isSubscribeExamineSBZG && seeTemp.statue == 3" type="success" style="display:inline-block" @click="handleExamine2(row)">审核2</el-button>
  719. <!-- 供应商主管 -->
  720. <el-button v-if="isSubscribeExamineZG && seeTemp.statue == 9" type="success" style="display:inline-block" @click="handleExamine3(row)">审核3</el-button>
  721. <!-- 场长 -->
  722. <el-button v-if=" sdchangzhangshenhe && (seeTemp.purchase_type < 0 || seeTemp.purchase_type == 0) && seeTemp.statue == 5" type="success" style="display:inline-block" @click="handleExamine4(row)">审核4</el-button>
  723. <el-button v-if=" sdchangzhangshenhe && seeTemp.statue == 13" type="success" style="display:inline-block" @click="handleExamine4(row)">审核4</el-button>
  724. <!-- 采购 -->
  725. <el-button v-if="isSubscribeExamineCG && seeTemp.statue == 11 " type="success" style="display:inline-block" @click="handleExamine5(row)">审核5</el-button>
  726. <el-button v-if="isSubscribeExamineCW && seeTemp.purchase_type > 0 && seeTemp.statue == 5 " style="display:inline-block" type="success" size="mini" @click="handleExamine6(row)">审核6</el-button>
  727. </el-form-item>
  728. </el-col>
  729. </el-row>
  730. </el-form>
  731. <div slot="footer" class="dialog-footer" style="bottom:5px;">
  732. <el-button @click="dialogFormVisibleSee = false">关闭</el-button>
  733. </div>
  734. </div>
  735. </el-dialog>
  736. <!-- 审核 -->
  737. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_Examine" :close-on-click-modal="false" width="30%">
  738. <div class="app-examine">
  739. <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请确认审核结果:</h3>
  740. <el-form ref="examineTemp" :rules="rules" :model="examineTemp" label-position="right" style="width: 50%;margin:0 auto;">
  741. <el-row style="width:88%;height:150px;margin:0 auto;">
  742. <el-col :span="20">
  743. <el-form-item>
  744. <el-radio-group v-model="examineTemp.statue" @change="changeStatue">
  745. <el-radio :label="1" checked>通过</el-radio>
  746. <el-radio :label="2">不通过</el-radio>
  747. </el-radio-group>
  748. </el-form-item>
  749. </el-col>
  750. <el-col v-if="statueReason" :span="20">
  751. <el-input v-model="examineTemp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入不通过原因" />
  752. </el-col>
  753. </el-row>
  754. </el-form>
  755. </div>
  756. <div slot="footer" class="dialog-footer">
  757. <el-button v-if="dialogStatus==='examine1'" type="primary" :disabled="isokDisable" @click="createExamineData1()">确认</el-button>
  758. <el-button v-if="dialogStatus==='examine2'" type="primary" :disabled="isokDisable" @click="createExamineData2()">确认</el-button>
  759. <el-button v-if="dialogStatus==='examine3'" type="primary" :disabled="isokDisable" @click="createExamineData3()">确认</el-button>
  760. <el-button v-if="dialogStatus==='examine4'" type="primary" :disabled="isokDisable" @click="createExamineData4()">确认</el-button>
  761. <el-button v-if="dialogStatus==='examine5'" type="primary" :disabled="isokDisable" @click="createExamineData5()">确认</el-button>
  762. <el-button v-if="dialogStatus==='examine6'" type="primary" :disabled="isokDisable" @click="createExamineData6()">确认</el-button>
  763. <el-button @click="dialogFormVisible_Examine = false;">关闭</el-button>
  764. </div>
  765. </el-dialog>
  766. <!-- 查看备件 -->
  767. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_seepart" :close-on-click-modal="false" width="90%">
  768. <div>
  769. <el-input v-model="seepart.getdataListParm.parammaps.partName" placeholder="备件" style="width: 200px;" class="filter-item" />
  770. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="seepart_search">搜索</el-button>
  771. <h3 v-if="seepartList.length == 0" style="text-align: center;height: 300px;line-height:300px;">呆滞库存查询(如可调拨使用,请优先消耗)</h3>
  772. <div v-else>
  773. <el-table
  774. :key="seepart.tableKey"
  775. v-loading="seepart.listLoading"
  776. element-loading-text="给我一点时间"
  777. :data="seepartList"
  778. border
  779. fit
  780. highlight-current-row
  781. style="width: 100%;margin-bottom:30px;margin-top:20px;"
  782. :row-style="rowStyle"
  783. :cell-style="cellStyle"
  784. class="elTable"
  785. height="300"
  786. >
  787. <el-table-column label="序号" align="center" type="index" width="50px" />
  788. <el-table-column label="牧场名称" prop="pastureName" align="center" min-width="90" />
  789. <el-table-column label="备件编号" prop="partCode" align="center" min-width="90" />
  790. <el-table-column label="备件名称" prop="partName" align="center" min-width="90" />
  791. <el-table-column label="备件规格" prop="specification" align="center" min-width="90" />
  792. <el-table-column label="备件图片" prop="picpath" align="center" min-width="90">
  793. <template slot-scope="scope">
  794. <el-popover placement="right" title="" trigger="hover">
  795. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  796. <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  797. </el-popover>
  798. </template>
  799. </el-table-column>
  800. <el-table-column label="备件品牌" prop="brand" align="center" min-width="90" />
  801. <el-table-column label="计量单位" prop="unit" align="center" min-width="90" />
  802. <el-table-column label="现有库存" sortable prop="reportery" align="center" min-width="60" />
  803. <el-table-column label="价格" sortable prop="price" align="center" min-width="60" />
  804. <el-table-column label="在库天数" sortable prop="daysInStorage" align="center" min-width="60" />
  805. <el-table-column label="负责人" prop="dutyPersonal" align="center" min-width="90" />
  806. <el-table-column label="联系方式" prop="telphone" align="center" min-width="90" />
  807. </el-table>
  808. <pagination v-show="seepart.total>0" :total="seepart.total" :page.sync="seepart.getdataListParm.offset" :limit.sync="seepart.getdataListParm.pagecount" @pagination="get_seepart_data" />
  809. </div>
  810. </div>
  811. <div slot="footer" class="dialog-footer">
  812. <el-button type="primary" :disabled="isokDisable" @click="form_add()">继续申购</el-button>
  813. <el-button @click="dialogFormVisible_seepart = false;seepart.getdataListParm.parammaps.partName = ''">取消</el-button>
  814. </div>
  815. </el-dialog>
  816. <!-- 合单 -->
  817. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_modify" :close-on-click-modal="false" width="90%">
  818. <div>
  819. <el-form ref="modifyTemp" :rules="rules" :model="modifyTemp" label-position="right" label-width="100px" style="width: 90%;margin:0 auto;" >
  820. <el-row>
  821. <el-col :span="8">
  822. <el-form-item label="申购单号:" prop="orderNumber">
  823. <el-input ref="orderNumber" v-model="modifyTemp.orderNumber" disabled />
  824. </el-form-item>
  825. </el-col>
  826. <el-col :span="8">
  827. <el-form-item label="牧场:" prop="pastureId">
  828. <el-select v-model="modifyTemp.pastureId" placeholder="牧场" class="filter-item" style="width:100%" :disabled="dialogStatus==='update'" @change="changePasture">
  829. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
  830. </el-select>
  831. </el-form-item>
  832. </el-col>
  833. </el-row>
  834. </el-form>
  835. <el-table
  836. :key="tableKey"
  837. v-loading="listLoading"
  838. element-loading-text="给我一点时间"
  839. :data="modifylist"
  840. border
  841. fit
  842. highlight-current-row
  843. style="width: 100%;margin-bottom:30px"
  844. :row-style="rowStyle"
  845. :cell-style="cellStyle"
  846. class="elTable"
  847. >
  848. <!-- table表格 -->
  849. <el-table-column label="序号" align="center" type="index" width="50px" />
  850. <el-table-column label="备件编号" prop="partCode" align="center" min-width="90" />
  851. <el-table-column label="备件名称" prop="partName" align="center" min-width="90" />
  852. <el-table-column label="备件规格" prop="specification" min-width="80px" align="center" />
  853. <el-table-column label="计量单位" prop="unit" align="center" min-width="60" />
  854. <el-table-column label="现有库存" prop="reportery" align="center" min-width="60" />
  855. <el-table-column label="价格" prop="price" align="center" min-width="150">
  856. <template slot-scope="scope">
  857. <div v-for="item in scope.row.pricearr">
  858. <el-tooltip class="item" effect="dark" placement="top-start">
  859. <div slot="content">{{item}}</div>
  860. <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{item}}</div>
  861. </el-tooltip>
  862. </div>
  863. </template>
  864. </el-table-column>
  865. <el-table-column label="使用周期" min-width="120px" align="center">
  866. <template slot-scope="scope">
  867. <div v-for="item in scope.row.lifeCyclearr">
  868. <el-tooltip class="item" effect="dark" placement="top-start">
  869. <div slot="content">{{item}}</div>
  870. <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{item}}</div>
  871. </el-tooltip>
  872. </div>
  873. </template>
  874. </el-table-column>
  875. <el-table-column label="合同差异项" min-width="120px" align="center">
  876. <template slot-scope="scope">
  877. <div v-for="item in scope.row.contractVarianceItemarr">
  878. <el-tooltip class="item" effect="dark" placement="top-start">
  879. <div slot="content">{{item}}</div>
  880. <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{item}}</div>
  881. </el-tooltip>
  882. </div>
  883. </template>
  884. </el-table-column>
  885. <el-table-column label="部门" prop="departmentName" align="center" min-width="60" />
  886. <el-table-column label="申购人" prop="empname" align="center" min-width="60" />
  887. <el-table-column label="申购日期" prop="date" align="center" min-width="60" />
  888. <el-table-column label="备注" min-width="110px" align="center" valign="middle" prop="purpose" />
  889. <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right" >
  890. <template slot-scope="{row}">
  891. <a class="del" @click="partReject(row)">驳回</a>
  892. </template>
  893. </el-table-column>
  894. </el-table>
  895. </div>
  896. <div slot="footer" class="dialog-footer">
  897. <el-button type="primary" :disabled="isokDisable" @click="form_modify()">提交</el-button>
  898. <el-button @click="dialogFormVisible_modify = false;">取消</el-button>
  899. </div>
  900. </el-dialog>
  901. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisibleSee1" :close-on-click-modal="false" width="90%">
  902. <div class="app-containerSee">
  903. <el-form
  904. ref="seeTemp"
  905. :rules="rules"
  906. :model="seeTemp"
  907. label-position="right"
  908. label-width="100px"
  909. style="width: 90%;margin:0 auto;"
  910. >
  911. <el-row>
  912. <el-col :span="8">
  913. <el-form-item label="申购单号:" prop="orderNumber">
  914. <el-input ref="orderNumber" v-model="seeTemp.orderNumber" disabled />
  915. </el-form-item>
  916. </el-col>
  917. <el-col :span="8">
  918. <el-form-item label="牧场:" prop="pastureId">
  919. <el-select v-model="seeTemp.pastureId" placeholder="牧场" class="filter-item" disabled style="width:100%">
  920. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
  921. </el-select>
  922. </el-form-item>
  923. </el-col>
  924. </el-row>
  925. </el-form>
  926. <el-table
  927. :key="tableKey"
  928. v-loading="listLoadingSee"
  929. element-loading-text="给我一点时间"
  930. :data="listSee"
  931. border
  932. fit
  933. highlight-current-row
  934. style="width: 100%;margin-bottom:30px"
  935. :row-style="rowStyle"
  936. :cell-style="cellStyle"
  937. class="elTable"
  938. @sort-change="tableSort"
  939. >
  940. <el-table-column type="index" label="序号" align="center" width="50px" />
  941. <el-table-column label="备件编号" prop="partCode" align="center" min-width="90" />
  942. <el-table-column label="备件名称" prop="partName" align="center" min-width="90" />
  943. <el-table-column label="备件规格" prop="specification" min-width="90px" align="center" />
  944. <el-table-column label="备件品牌" prop="brandName" align="center" min-width="60" />
  945. <el-table-column label="计量单位" prop="unit" align="center" min-width="60" />
  946. <el-table-column label="现有库存" sortable prop="storageAmount" align="center" min-width="60" />
  947. <el-table-column label="申购数量" sortable prop="amount" align="center" min-width="60" />
  948. <el-table-column label="价格" min-width="150px" align="center">
  949. <template slot-scope="scope">
  950. <div v-for="item in scope.row.pricearr" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
  951. <el-tooltip class="item" effect="dark" placement="top-start">
  952. <div slot="content">{{item}}</div>
  953. <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{item}}</div>
  954. </el-tooltip>
  955. </div>
  956. </template>
  957. </el-table-column>
  958. <el-table-column label="使用周期" min-width="120px" align="center">
  959. <template slot-scope="scope">
  960. <div v-for="item in scope.row.lifeCyclearr" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
  961. <el-tooltip class="item" effect="dark" placement="top-start">
  962. <div slot="content">{{item}}</div>
  963. <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{item}}</div>
  964. </el-tooltip>
  965. </div>
  966. </template>
  967. </el-table-column>
  968. <el-table-column label="合同差异项" min-width="120px" align="center">
  969. <template slot-scope="scope">
  970. <div v-for="item in scope.row.contractVarianceItemarr" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
  971. <el-tooltip class="item" effect="dark" placement="top-start">
  972. <div slot="content">{{item}}</div>
  973. <div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{item}}</div>
  974. </el-tooltip>
  975. </div>
  976. </template>
  977. </el-table-column>
  978. <el-table-column label="部门" sortable prop="amount" align="center" min-width="60" />
  979. <el-table-column label="申购人" sortable prop="amount" align="center" min-width="60" />
  980. <el-table-column label="申购日期" sortable prop="amount" align="center" min-width="60" />
  981. <el-table-column label="备注" min-width="110px" align="center" prop="purpose" />
  982. </el-table>
  983. <el-form ref="seeTemp" :rules="rules" :model="seeTemp" label-position="right" label-width="100px" style="width: 90%;margin:0 auto;" >
  984. <el-row>
  985. <el-col>
  986. <el-form-item label="流程进度" />
  987. <el-steps :active="active" align-center finish-status="success">
  988. <el-step
  989. v-for="(item,index) in activeList"
  990. :key="index"
  991. :title="item.title"
  992. :status="item.status"
  993. >
  994. <template slot="description">
  995. <div class="step-row">
  996. <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
  997. <div>{{ item.reason }}</div>
  998. </div>
  999. </template>
  1000. </el-step>
  1001. </el-steps>
  1002. </el-col>
  1003. </el-row>
  1004. <el-row>
  1005. <el-col>
  1006. <el-form-item label="操作:">
  1007. <!-- 库管 -->
  1008. <el-button v-if="isSubscribeExamineKG && seeTemp.statue == 2" type="success" style="display:inline-block" @click="handleExamine1(row)">审核1</el-button>
  1009. <!-- 设备 -->
  1010. <el-button v-if="isSubscribeExamineSBZG && seeTemp.statue == 3" type="success" style="display:inline-block" @click="handleExamine2(row)">审核2</el-button>
  1011. <!-- 供应商主管 -->
  1012. <el-button v-if="isSubscribeExamineZG && seeTemp.statue == 9" type="success" style="display:inline-block" @click="handleExamine3(row)">审核3</el-button>
  1013. <!-- 场长 -->
  1014. <el-button v-if=" sdchangzhangshenhe && (seeTemp.purchase_type < 0 || seeTemp.purchase_type == 0) && seeTemp.statue == 5" type="success" style="display:inline-block" @click="handleExamine4(row)">审核4</el-button>
  1015. <el-button v-if=" sdchangzhangshenhe && seeTemp.statue == 13" type="success" style="display:inline-block" @click="handleExamine4(row)">审核4</el-button>
  1016. <!-- 采购 -->
  1017. <el-button v-if="isSubscribeExamineCG && seeTemp.statue == 11 " type="success" style="display:inline-block" @click="handleExamine5(row)">审核5</el-button>
  1018. <el-button v-if="isSubscribeExamineCW && seeTemp.purchase_type > 0 && seeTemp.statue == 5 " style="display:inline-block" type="success" size="mini" @click="handleExamine6(row)">审核6</el-button>
  1019. </el-form-item>
  1020. </el-col>
  1021. </el-row>
  1022. </el-form>
  1023. <div slot="footer" class="dialog-footer" style="bottom:5px;">
  1024. <el-button @click="dialogFormVisibleSee1 = false">关闭</el-button>
  1025. </div>
  1026. </div>
  1027. </el-dialog>
  1028. </div>
  1029. </template>
  1030. <script>
  1031. // / 引入
  1032. import { GetDataByName,postJson, GetDataByNames, partslistSGv2, PostDataByName, ExecDataByConfig, checkButtons, failproccess, GetAccount } from '@/api/common'
  1033. import waves from '@/directive/waves' // waves directive
  1034. import { parseTime, sortChange, json2excel } from '@/utils/index.js'
  1035. // eslint-disable-next-line no-unused-vars
  1036. import { validateEMail } from '@/utils/validate.js'
  1037. import Pagination from '@/components/Pagination' // secondary package based on el-pagination
  1038. import { MessageBox } from 'element-ui'
  1039. import Cookies from 'js-cookie'
  1040. import { getToken } from '@/utils/auth'
  1041. export default {
  1042. name: 'Subscribe',
  1043. components: { Pagination },
  1044. directives: { waves },
  1045. data() {
  1046. return {
  1047. isSubscribeAdd: [],isSubscribeSpecial:[], isSubscribeExamineSBZG:[],isSubscribeTemplate: [], isSubscribeImport: [], isSubscribeExport: [], isSubscribeSee: [], isSubscribeDelete: [], isSubscribeExamineKG: [], isSubscribeExamineCG: [],isSubscribeExamineCW:[], isSubscribeExamineZG: [],sdchangzhangshenhe: [],
  1048. isSubscribeMilk:[],
  1049. isokDisable: false,
  1050. findAllProvider: [],
  1051. findAllPasture: [],
  1052. findAllDepart: [],
  1053. findAllEmploye: [],
  1054. subscriptionStatusList:[
  1055. {id:0,name:'正常'},
  1056. // {id:1,name:'暂估'},
  1057. {id:3,name:'赠品'}],//申购状态
  1058. onlineSubscriptionList: [], createDepartList: [], edit: 0,
  1059. requestParams: [
  1060. { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] },
  1061. { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
  1062. { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
  1063. { name: 'getflexProviderList', offset: 0, pagecount: 0, parammaps: {}}
  1064. ],
  1065. getDepartParam: {
  1066. name: 'findAllDepart', offset: 0, pagecount: 0,
  1067. parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
  1068. },
  1069. pickerOptions: {
  1070. disabledDate(time) {
  1071. return time.getTime() > Date.now()// 当天之前的时间可选
  1072. }
  1073. },
  1074. textMap: {
  1075. update: '编辑',
  1076. create: '新增',
  1077. see: '查看',
  1078. examine1: '审核1',
  1079. examine2: '审核2',
  1080. examine3: '审核3',
  1081. examine4: '审核4',
  1082. examine5: '审核5',
  1083. special: '特殊申购',
  1084. seepart:'备件申购'
  1085. },
  1086. rules: {
  1087. equipmentName: [{ required: true, message: '必填', trigger: 'blur' }]
  1088. },
  1089. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  1090. cellStyle: { padding: 0 + 'px' },
  1091. statues: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }],
  1092. radioAll: '全部',
  1093. getdataListParm: {
  1094. name: 'getpartpurchaseList',
  1095. page: 1,
  1096. offset: 1,
  1097. pagecount: 10,
  1098. returntype: 'Map',
  1099. parammaps: {
  1100. pastureName: Cookies.get('pasturename'),
  1101. empId: Cookies.get('employeid'),
  1102. orderNumber: '',
  1103. stuteSH: '',
  1104. departmentId: '',
  1105. inputDatetime: '',
  1106. startTime: '',
  1107. stopTime: '',
  1108. loginId: Cookies.get('employeid'),
  1109. menu: 'Subscribe',
  1110. logindeptId: Cookies.get('departmentid'),
  1111. loginpastureId: Cookies.get('pastureid'),
  1112. purchase_type:''
  1113. }
  1114. },
  1115. tableKey: 0,
  1116. listLoading: true,
  1117. total: 0,
  1118. list: [],
  1119. dialogStatus: '',
  1120. dialogFormVisible: false,
  1121. dialogFormVisible_milk:false,
  1122. dialogFormVisible2: false,
  1123. dialogFormVisibleSee: false,
  1124. dialogFormVisibleSee1: false,
  1125. listLoadingSee: true,
  1126. listSee: [],
  1127. totalSee: 0,
  1128. seeTemp: {},
  1129. getdataListSee: {
  1130. name: 'getpartpurchaseBybig',
  1131. returntype: 'Map',
  1132. parammaps: {}
  1133. },
  1134. createTemp: {
  1135. pastureId: this.$store.state.user.pastureid,
  1136. departmentId: this.$store.state.user.departmentid,
  1137. employeId: this.$store.state.user.employeid,
  1138. createTime: parseTime(new Date(), '{y}-{m}-{d}'),
  1139. providerId: '',
  1140. purchaseType:'1',
  1141. funderId:''
  1142. },
  1143. requestSparePart: {
  1144. name: 'getPartsListSG',
  1145. page: 1,
  1146. offset: 1,
  1147. pagecount: 20,
  1148. returntype: 'Map',
  1149. parammaps: {
  1150. pastureId: Cookies.get('pastureid')
  1151. }
  1152. },
  1153. getParmCreateNumber: {
  1154. name: 'autoCreatCode',
  1155. page: 0,
  1156. offset: 0,
  1157. pagecount: 0,
  1158. returntype: 'Map',
  1159. parammaps: {
  1160. pastureId: Cookies.get('pastureid'),
  1161. codeType: 'SG'
  1162. }
  1163. },
  1164. getParmCreateAmount: {
  1165. name: 'getPartsListSGv2',
  1166. page: 0,
  1167. offset: 0,
  1168. pagecount: 0,
  1169. returntype: 'Map',
  1170. parammaps: {
  1171. pastureId: Cookies.get('pastureid'),
  1172. pastureName: Cookies.get('pasturename')
  1173. }
  1174. },
  1175. listAdd: [],
  1176. postDataPramas: {},
  1177. requestParam: {},
  1178. dialogFormVisible_Examine: false,
  1179. examineTemp: {
  1180. statue: 1
  1181. },
  1182. statueReason: false,
  1183. activeList: [],
  1184. active: 3,
  1185. buttons: [],
  1186. downloadParam: {},
  1187. isPercentage: false,
  1188. percentage: 1,
  1189. pending: {
  1190. total: 0,
  1191. getdataListParm: {
  1192. name: 'getpartpurchaseWebListNO', page: 1, offset: 1, getTotal: 'total3', pagecount: 10, returntype: 'Map',
  1193. parammaps: {
  1194. loginId: Cookies.get('employeid'),
  1195. menu: 'Subscribe', logindeptId: Cookies.get('departmentid'), loginpastureId: Cookies.get('pastureid'),
  1196. empId: Cookies.get('employeid'), pastureId: Cookies.get('pastureid'), deptId: Cookies.get('departmentid')
  1197. }
  1198. }
  1199. },
  1200. providerList:[],
  1201. dialogFormVisible_seepart:false,
  1202. seepartList:[],
  1203. seepart:{
  1204. tableKey: 0,
  1205. listLoading: true,
  1206. total: 0,
  1207. getdataListParm: {
  1208. page: 1, offset: 1, pagecount: 10,
  1209. name:'getIdleSpareParts',
  1210. parammaps:{
  1211. partName:''
  1212. }
  1213. }
  1214. },
  1215. apply_subscribeData:{},
  1216. isApplyEx4:true,
  1217. isMilk:false, //标记是不是奶厅申购
  1218. myHeight:document.documentElement.clientHeight - 85- 150,
  1219. dialogFormVisible_modify:false,
  1220. modifyTemp:{
  1221. orderNumber:''
  1222. },
  1223. modifylist:[{}]
  1224. }
  1225. },
  1226. created() {
  1227. const that = this
  1228. GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
  1229. that.buttons = response.data.list
  1230. that.get_auto_buttons()
  1231. })
  1232. this.get_select_list()
  1233. this.get_table_data()
  1234. this.getPendingList()
  1235. this.getProviderList()
  1236. },
  1237. methods: {
  1238. tableSort(column) {
  1239. sortChange(column, this.listSee)
  1240. },
  1241. get_auto_buttons() {
  1242. // 新增
  1243. const SubscribeAdd = 'customs:subscribe:add'
  1244. const isSubscribeAdd = checkButtons(this.$store.state.user.buttons, SubscribeAdd)
  1245. this.isSubscribeAdd = isSubscribeAdd
  1246. // isSubscribeSpecial
  1247. // 特殊申购
  1248. const SubscribeSpecial = 'customs:subscribe:special'
  1249. const isSubscribeSpecial = checkButtons(this.$store.state.user.buttons, SubscribeSpecial)
  1250. this.isSubscribeSpecial = isSubscribeSpecial
  1251. // 奶厅申购
  1252. const SubscribeMilk = 'customs:subscribe:milk'
  1253. const isSubscribeMilk = checkButtons(this.$store.state.user.buttons, SubscribeMilk)
  1254. this.isSubscribeMilk = isSubscribeMilk
  1255. // 模板
  1256. // eslint-disable-next-line no-redeclare
  1257. const SubscribeTemplate = 'customs:subscribe:template'
  1258. const isSubscribeTemplate = checkButtons(this.$store.state.user.buttons, SubscribeTemplate)
  1259. this.isSubscribeTemplate = isSubscribeTemplate
  1260. // 导入
  1261. // eslint-disable-next-line no-redeclare
  1262. const SubscribeImport = 'customs:subscribe:import'
  1263. const isSubscribeImport = checkButtons(this.$store.state.user.buttons, SubscribeImport)
  1264. this.isSubscribeImport = isSubscribeImport
  1265. // 导出
  1266. // eslint-disable-next-line no-redeclare
  1267. const SubscribeExport = 'customs:subscribe:export'
  1268. const isSubscribeExport = checkButtons(this.$store.state.user.buttons, SubscribeExport)
  1269. this.isSubscribeExport = isSubscribeExport
  1270. // 查看
  1271. // eslint-disable-next-line no-redeclare
  1272. const SubscribeSee = 'customs:subscribe:see'
  1273. const isSubscribeSee = checkButtons(this.$store.state.user.buttons, SubscribeSee)
  1274. this.isSubscribeSee = isSubscribeSee
  1275. // 删除
  1276. // eslint-disable-next-line no-redeclare
  1277. const SubscribeDelete = 'customs:subscribe:delete'
  1278. const isSubscribeDelete = checkButtons(this.$store.state.user.buttons, SubscribeDelete)
  1279. this.isSubscribeDelete = isSubscribeDelete
  1280. // 库管审核
  1281. // eslint-disable-next-line no-redeclare
  1282. const SubscribeExamineKG = 'customs:subscribe:examineKG'
  1283. const isSubscribeExamineKG = checkButtons(this.$store.state.user.buttons, SubscribeExamineKG)
  1284. this.isSubscribeExamineKG = isSubscribeExamineKG
  1285. // 设备主管审核
  1286. const SubscribeExamineSBZG = 'customs:subscribe:examineSBZG'
  1287. const isSubscribeExamineSBZG = checkButtons(this.$store.state.user.buttons, SubscribeExamineSBZG)
  1288. this.isSubscribeExamineSBZG = isSubscribeExamineSBZG
  1289. // 主管审核
  1290. // eslint-disable-next-line no-redeclare
  1291. const SubscribeExamineZG = 'customs:subscribe:examineZG'
  1292. const isSubscribeExamineZG = checkButtons(this.$store.state.user.buttons, SubscribeExamineZG)
  1293. this.isSubscribeExamineZG = isSubscribeExamineZG
  1294. const changzhangshenhe = 'changzhangshenhe'
  1295. const sdchangzhangshenhe = checkButtons(this.$store.state.user.buttons, changzhangshenhe)
  1296. this.sdchangzhangshenhe = sdchangzhangshenhe
  1297. // 采购审核
  1298. // eslint-disable-next-line no-redeclare
  1299. const SubscribeExamineCG = 'customs:subscribe:examineCG'
  1300. const isSubscribeExamineCG = checkButtons(this.$store.state.user.buttons, SubscribeExamineCG)
  1301. this.isSubscribeExamineCG = isSubscribeExamineCG
  1302. // 财务审核
  1303. const SubscribeExamineCW = 'customs:subscribe:examineCW'
  1304. const isSubscribeExamineCW = checkButtons(this.$store.state.user.buttons, SubscribeExamineCW)
  1305. this.isSubscribeExamineCW = isSubscribeExamineCW
  1306. },
  1307. getPendingList() {
  1308. this.pending.getdataListParm.parammaps.pastureName = this.getdataListParm.parammaps.pastureName
  1309. this.pending.getdataListParm.parammaps.orderNumber = this.getdataListParm.parammaps.orderNumber
  1310. this.pending.getdataListParm.parammaps.stuteSH = this.getdataListParm.parammaps.stuteSH
  1311. this.pending.getdataListParm.parammaps.departmentId = this.getdataListParm.parammaps.departmentId
  1312. this.pending.getdataListParm.parammaps.inputDatetime = this.getdataListParm.parammaps.inputDatetime
  1313. this.pending.getdataListParm.parammaps.loginId = this.getdataListParm.parammaps.loginId
  1314. this.pending.getdataListParm.parammaps.menu = this.getdataListParm.parammaps.menu
  1315. this.pending.getdataListParm.parammaps.logindeptId = this.getdataListParm.parammaps.logindeptId
  1316. this.pending.getdataListParm.parammaps.loginpastureId = this.getdataListParm.parammaps.loginpastureId
  1317. this.pending.getdataListParm.parammaps.empId = this.getdataListParm.parammaps.empId
  1318. this.pending.getdataListParm.parammaps.pastureId = Cookies.get('pastureid')
  1319. this.pending.getdataListParm.parammaps.deptId = Cookies.get('departmentid')
  1320. GetDataByName(this.pending.getdataListParm).then(response => {
  1321. this.pending.total = response.data.total3
  1322. })
  1323. },
  1324. get_table_data() {
  1325. this.listLoading = true
  1326. if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
  1327. this.getdataListParm.parammaps.startTime = this.$refs['inputDatetime'].value[0]
  1328. this.getdataListParm.parammaps.stopTime = this.$refs['inputDatetime'].value[1]
  1329. } else {
  1330. this.getdataListParm.parammaps.startTime = ''
  1331. this.getdataListParm.parammaps.stopTime = ''
  1332. }
  1333. GetDataByName(this.getdataListParm).then(response => {
  1334. if (response.data.list !== null) {
  1335. console.log('table数据', response.data.list)
  1336. this.list = response.data.list
  1337. this.pageNum = response.data.pageNum
  1338. this.pageSize = response.data.pageSize
  1339. } else {
  1340. this.list = []
  1341. }
  1342. this.total = response.data.total
  1343. setTimeout(() => {
  1344. this.listLoading = false
  1345. }, 100)
  1346. })
  1347. },
  1348. changeAll() {
  1349. console.log(this.radioAll)
  1350. if (this.radioAll === '全部') {
  1351. this.getdataListParm.name = 'getpartpurchaseList'
  1352. this.getdataListParm.offset = 1
  1353. this.getdataListParm.parammaps = {
  1354. pastureName: Cookies.get('pasturename'),
  1355. orderNumber: '',
  1356. departmentId: '',
  1357. inputDatetime: '',
  1358. startTime: '',
  1359. stopTime: '',
  1360. loginId: Cookies.get('employeid'),
  1361. menu: 'Subscribe',
  1362. logindeptId: Cookies.get('departmentid'),
  1363. loginpastureId: Cookies.get('pastureid')
  1364. }
  1365. this.get_table_data()
  1366. } else if (this.radioAll === '待处理') {
  1367. this.getdataListParm.name = 'getpartpurchaseWebListNO'
  1368. this.getdataListParm.offset = 1
  1369. this.getdataListParm.parammaps = {
  1370. pastureName: this.getdataListParm.parammaps.pastureName,
  1371. orderNumber: this.getdataListParm.parammaps.orderNumber,
  1372. stuteSH: this.getdataListParm.parammaps.stuteSH,
  1373. departmentId: this.getdataListParm.parammaps.departmentId,
  1374. inputDatetime: this.getdataListParm.parammaps.inputDatetime,
  1375. startTime: this.getdataListParm.parammaps.startTime,
  1376. stopTime: this.getdataListParm.parammaps.stopTime,
  1377. loginId: Cookies.get('employeid'),
  1378. menu: 'Subscribe',
  1379. logindeptId: Cookies.get('departmentid'),
  1380. loginpastureId: Cookies.get('pastureid'),
  1381. empId: Cookies.get('employeid'),
  1382. pastureId: Cookies.get('pastureid'),
  1383. deptId: Cookies.get('departmentid')
  1384. }
  1385. this.get_table_data()
  1386. } else if (this.radioAll === '已处理') {
  1387. this.getdataListParm.name = 'getpartpurchaseWebList'
  1388. this.getdataListParm.offset = 1
  1389. this.getdataListParm.parammaps = {
  1390. pastureName: this.getdataListParm.parammaps.pastureName,
  1391. orderNumber: this.getdataListParm.parammaps.orderNumber,
  1392. stuteSH: this.getdataListParm.parammaps.stuteSH,
  1393. departmentId: this.getdataListParm.parammaps.departmentId,
  1394. inputDatetime: this.getdataListParm.parammaps.inputDatetime,
  1395. startTime: this.getdataListParm.parammaps.startTime,
  1396. stopTime: this.getdataListParm.parammaps.stopTime,
  1397. loginId: Cookies.get('employeid'),
  1398. menu: 'Subscribe',
  1399. logindeptId: Cookies.get('departmentid'),
  1400. loginpastureId: Cookies.get('pastureid'),
  1401. empId: Cookies.get('employeid'),
  1402. pastureId: Cookies.get('pastureid'),
  1403. deptId: Cookies.get('departmentid')
  1404. }
  1405. this.get_table_data()
  1406. }
  1407. },
  1408. statue: function(cellValue) {
  1409. // console.log(cellValue.isZeroStock)
  1410. if (cellValue.statue == 2) {
  1411. return '审核中'
  1412. } else if (cellValue.statue == 3) {
  1413. return '审核中'
  1414. } else if (cellValue.statue == 4) {
  1415. return '未通过'
  1416. } else if (cellValue.statue == 5) {
  1417. return '审核中'
  1418. } else if (cellValue.statue == 6) {
  1419. return '未通过'
  1420. } else if (cellValue.statue == 7) {
  1421. return '已通过'
  1422. } else if (cellValue.statue == 8) {
  1423. return '未通过'
  1424. } else if (cellValue.statue == 9) {
  1425. return '审核中'
  1426. } else if (cellValue.statue == 10) {
  1427. return '未通过'
  1428. } else if (cellValue.statue == 11) {
  1429. return '审核中'
  1430. } else if (cellValue.statue == 12) {
  1431. return '未通过'
  1432. } else if (cellValue.statue == 13) {
  1433. return '审核中'
  1434. } else if (cellValue.statue == 14) {
  1435. return '未通过'
  1436. }
  1437. },
  1438. form_search() {
  1439. console.log('点击了table搜索')
  1440. if (this.getdataListParm.parammaps.inputDatetime === null) {
  1441. this.getdataListParm.parammaps.inputDatetime = ''
  1442. }
  1443. this.getdataListParm.offset = 1
  1444. this.listLoading = true
  1445. this.get_table_data()
  1446. this.getPendingList()
  1447. },
  1448. resetCreateTemp() {
  1449. this.createTemp.pastureId = parseInt(Cookies.get('pastureid'))
  1450. this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
  1451. this.createTemp.departmentName = Cookies.get('departmentname')
  1452. this.createTemp.employeId = parseInt(Cookies.get('employeid'))
  1453. this.createTemp.createTime = parseTime(new Date(), '{y}-{m}-{d}')
  1454. this.createTemp.orderNumber = ''
  1455. this.createTemp.providerId = ''
  1456. this.createTemp.funderId = ''
  1457. this.createTemp.purchaseType = '1'
  1458. this.listAdd = []
  1459. },
  1460. form_add() {
  1461. this.isMilk = false
  1462. this.seepart.getdataListParm.parammaps.partName = ''
  1463. this.resetCreateTemp()
  1464. this.edit = 1
  1465. this.getDepartParam.parammaps.pastureId = this.createTemp.pastureId
  1466. this.getCreateDepartDownList()
  1467. this.dialogStatus = 'create'
  1468. this.dialogFormVisible = true
  1469. this.dialogFormVisible_seepart = false
  1470. this.$nextTick(() => {
  1471. this.$refs['createTemp'].clearValidate()
  1472. })
  1473. this.getBigPartpurchase(0)
  1474. },
  1475. getBigPartpurchase(type){
  1476. let data = {
  1477. name:'getBigPartpurchase',
  1478. parammaps:{
  1479. purchaseType:type,
  1480. pastureId:parseInt(Cookies.get('pastureid'))
  1481. }
  1482. }
  1483. GetDataByName(data).then(response => {
  1484. console.log(response,'response=====')
  1485. if(response.data.list && response.data.list.length > 0){
  1486. this.createTemp.markBackend = true
  1487. this.createTemp.pastureId = response.data.list[0].pastureId
  1488. this.createTemp.orderNumber = response.data.list[0].orderNumber
  1489. this.createTemp.createTime = response.data.list[0].inputTime
  1490. this.createTemp.bigId = response.data.list[0].id
  1491. this.getdataListSee.parammaps.id = response.data.list[0].id
  1492. this.getSeeList()
  1493. }else{
  1494. this.createTemp.markBackend = false
  1495. this.getCreateNumber()
  1496. }
  1497. })
  1498. },
  1499. getCreateNumber() {
  1500. GetDataByName(this.getParmCreateNumber).then(response => {
  1501. this.$nextTick(() => {
  1502. console.log('新增申购单号', response.data.list[0].orderCode)
  1503. this.createTemp.orderNumber = response.data.list[0].orderCode
  1504. this.modifyTemp.orderNumber = response.data.list[0].orderCode
  1505. this.$forceUpdate()
  1506. })
  1507. })
  1508. },
  1509. // getPartsListSG
  1510. changeProvider(item) {
  1511. if (item !== '') {
  1512. this.createTemp.providerName = this.onlineSubscriptionList.find(obj => obj.id == item).providerName
  1513. }
  1514. this.listAdd = []
  1515. },
  1516. sparePartSearch(queryString, cb) {
  1517. console.log('备件模糊查询输入值', queryString)
  1518. if(this.dialogStatus==='special'){
  1519. if(this.createTemp.purchaseType == 1 || this.createTemp.purchaseType == '3'){
  1520. if(this.createTemp.providerId == ''){
  1521. this.$message({ type: 'warning', message: '请选择供应商' })
  1522. return false;
  1523. }else{
  1524. if(this.createTemp.purchaseType == '3'){
  1525. this.requestSparePart.name = 'getStockListByGiveaway'
  1526. this.requestSparePart.parammaps['providerName'] = this.providerList.find(obj => obj.id == this.createTemp.providerId).providerName
  1527. this.requestSparePart.parammaps['providerId'] = this.createTemp.providerId
  1528. this.requestSparePart.parammaps['pastureId'] = this.createTemp.pastureId
  1529. }else{
  1530. this.requestSparePart.name = 'getPartsListSG'
  1531. this.requestSparePart.parammaps['providerId'] = this.createTemp.providerId
  1532. }
  1533. }
  1534. }
  1535. }else{
  1536. if (this.createTemp.providerId == '') {
  1537. this.requestSparePart.name = 'getPartsListSG'
  1538. } else {
  1539. this.requestSparePart.name = 'getPartsListSGFlex'
  1540. this.requestSparePart.parammaps.providerId = this.createTemp.providerId
  1541. this.requestSparePart.parammaps.providerName = this.createTemp.providerName
  1542. }
  1543. }
  1544. this.requestSparePart.parammaps['partCode'] = queryString
  1545. GetDataByName(this.requestSparePart).then(response => {
  1546. console.log('备件模糊查询搜索data', response.data.list)
  1547. if (response.data.list == null) {
  1548. cb([])
  1549. } else {
  1550. cb(response.data.list)
  1551. }
  1552. })
  1553. },
  1554. handleSelectSparePart(item) {
  1555. console.log('备件模糊查询选中值', item)
  1556. console.log('备件模糊查询选中值', item.partId)
  1557. console.log(this.listAdd)
  1558. if(this.dialogStatus==='special' && this.createTemp.purchaseType == '1' && this.createTemp.providerId == ''){
  1559. this.createTemp.providerId = item.providerId
  1560. }
  1561. this.public_select(item)
  1562. },
  1563. apply_subscribe(){
  1564. this.dialogStatus = 'seepart'
  1565. this.seepartList = []
  1566. console.log(this.seepartList.length,'===')
  1567. this.dialogFormVisible_seepart = true
  1568. // this.apply_subscribeData = item
  1569. },
  1570. seepart_search(){
  1571. this.get_seepart_data()
  1572. },
  1573. get_seepart_data() {
  1574. this.seepart.listLoading = true
  1575. GetDataByName(this.seepart.getdataListParm).then(response => {
  1576. if (response.data.list !== null) {
  1577. console.log('table数据', response.data.list)
  1578. this.seepartList = response.data.list
  1579. this.seepart.pageNum = response.data.pageNum
  1580. this.seepart.pageSize = response.data.pageSize
  1581. } else {
  1582. this.seepartList = []
  1583. }
  1584. this.seepart.total = response.data.total
  1585. setTimeout(() => {
  1586. this.seepart.listLoading = false
  1587. }, 100)
  1588. })
  1589. },
  1590. public_select(item){
  1591. if (this.createTemp.providerId == '') {
  1592. if (this.listAdd.length > 0) {
  1593. if (this.listAdd.find(obj => obj.partId == item.partId)) {
  1594. this.$message({ type: 'warning', message: '此备件已存在,请重新选择备件' })
  1595. } else {
  1596. this.getParmCreateAmount.parammaps.partCode = item.partCode
  1597. partslistSGv2(this.getParmCreateAmount).then(response => {
  1598. this.$nextTick(() => {
  1599. console.log('新增根据编号获取备件库存数量', response.data.list[0])
  1600. item = response.data.list[0]
  1601. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  1602. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  1603. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  1604. } else {
  1605. item.srcpath = ''
  1606. item.picpath = ''
  1607. }
  1608. this.$set(item, 'amount', '')
  1609. this.$set(item, 'purpose', '')
  1610. if(this.dialogStatus==='special' && this.createTemp.purchaseType == '2'){
  1611. this.$set(item,'price','')
  1612. }else if(this.dialogStatus==='special' && this.createTemp.purchaseType == '3'){
  1613. this.$set(item,'price','0')
  1614. this.$set(item,'amount','0')
  1615. }
  1616. if(this.dialogStatus !=='special'){
  1617. var pricearr = item.price.split(",")
  1618. this.$set(item,'pricearr',pricearr)
  1619. var lifeCyclearr = item.lifeCycle.split(",")
  1620. this.$set(item,'lifeCyclearr',lifeCyclearr)
  1621. var contractVarianceItemarr = item.contractVarianceItem.split(",")
  1622. this.$set(item,'contractVarianceItemarr',contractVarianceItemarr)
  1623. }
  1624. this.listAdd.unshift(item)
  1625. this.$forceUpdate()
  1626. })
  1627. })
  1628. }
  1629. } else {
  1630. this.getParmCreateAmount.parammaps.partCode = item.partCode
  1631. partslistSGv2(this.getParmCreateAmount).then(response => {
  1632. this.$nextTick(() => {
  1633. console.log('新增根据编号获取备件库存数量', response.data.list[0])
  1634. item = response.data.list[0]
  1635. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  1636. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  1637. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  1638. } else {
  1639. item.srcpath = ''
  1640. item.picpath = ''
  1641. }
  1642. this.$set(item, 'amount', '')
  1643. this.$set(item, 'purpose', '')
  1644. if(this.dialogStatus==='special' && this.createTemp.purchaseType == '2'){
  1645. this.$set(item,'price','')
  1646. }else if(this.dialogStatus==='special' && this.createTemp.purchaseType == '3'){
  1647. this.$set(item,'price','0')
  1648. this.$set(item,'amount','0')
  1649. }
  1650. if(this.dialogStatus !=='special'){
  1651. var pricearr = item.price.split(",")
  1652. this.$set(item,'pricearr',pricearr)
  1653. var lifeCyclearr = item.lifeCycle.split(",")
  1654. this.$set(item,'lifeCyclearr',lifeCyclearr)
  1655. var contractVarianceItemarr = item.contractVarianceItem.split(",")
  1656. this.$set(item,'contractVarianceItemarr',contractVarianceItemarr)
  1657. }
  1658. this.listAdd.unshift(item)
  1659. this.$forceUpdate()
  1660. })
  1661. })
  1662. }
  1663. this.$forceUpdate()
  1664. } else {
  1665. if (this.listAdd.length > 0) {
  1666. if (this.listAdd.find(obj => obj.partId == item.partId)) {
  1667. this.$message({ type: 'warning', message: '此备件已存在,请重新选择备件' })
  1668. } else {
  1669. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  1670. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  1671. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  1672. } else {
  1673. item.srcpath = ''
  1674. item.picpath = ''
  1675. }
  1676. this.$set(item, 'amount', '')
  1677. this.$set(item, 'purpose', '')
  1678. if(this.dialogStatus==='special' && this.createTemp.purchaseType == '3'){
  1679. this.$set(item,'price','0')
  1680. this.$set(item,'amount','0')
  1681. }
  1682. if(this.dialogStatus !=='special'){
  1683. var pricearr = item.price.split(",")
  1684. this.$set(item,'pricearr',pricearr)
  1685. var lifeCyclearr = item.lifeCycle.split(",")
  1686. this.$set(item,'lifeCyclearr',lifeCyclearr)
  1687. var contractVarianceItemarr = item.contractVarianceItem.split(",")
  1688. this.$set(item,'contractVarianceItemarr',contractVarianceItemarr)
  1689. }
  1690. this.listAdd.unshift(item)
  1691. }
  1692. } else {
  1693. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  1694. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  1695. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  1696. } else {
  1697. item.srcpath = ''
  1698. item.picpath = ''
  1699. }
  1700. this.$set(item, 'amount', '')
  1701. this.$set(item, 'purpose', '')
  1702. if(this.dialogStatus==='special' && this.createTemp.purchaseType == '3'){
  1703. this.$set(item,'price','0')
  1704. this.$set(item,'amount','0')
  1705. }
  1706. if(this.dialogStatus !=='special' && this.createTemp.providerId == ''){
  1707. var pricearr = item.price.split(",")
  1708. this.$set(item,'pricearr',pricearr)
  1709. var lifeCyclearr = item.lifeCycle.split(",")
  1710. this.$set(item,'lifeCyclearr',lifeCyclearr)
  1711. var contractVarianceItemarr = item.contractVarianceItem.split(",")
  1712. this.$set(item,'contractVarianceItemarr',contractVarianceItemarr)
  1713. }
  1714. this.listAdd.unshift(item)
  1715. this.$forceUpdate()
  1716. }
  1717. this.$forceUpdate()
  1718. }
  1719. },
  1720. add_dialog_save() {
  1721. this.isokDisable = true
  1722. setTimeout(() => {
  1723. this.isokDisable = false
  1724. }, 1000)
  1725. this.$refs['createTemp'].validate(valid => {
  1726. if (valid) {
  1727. console.log(this.listAdd)
  1728. if (this.createTemp.orderNumber == '' || this.createTemp.orderNumber == null || this.createTemp.orderNumber == undefined) {
  1729. GetDataByName(this.getParmCreateNumber).then(response => {
  1730. this.$nextTick(() => {
  1731. console.log('新增申购单号', response.data.list[0].orderCode)
  1732. this.createTemp.orderNumber = response.data.list[0].orderCode
  1733. this.$forceUpdate()
  1734. this.add_dialog_saveSave()
  1735. })
  1736. })
  1737. } else {
  1738. this.add_dialog_saveSave()
  1739. }
  1740. }
  1741. })
  1742. },
  1743. add_dialog_saveSave() {
  1744. if (this.listAdd.length !== 0) {
  1745. for (var j = 0; j < this.listAdd.length; j++) {
  1746. console.log(this.listAdd[j].amount)
  1747. if (this.listAdd[j].amount == null || this.listAdd[j].amount === '') {
  1748. this.$message({ type: 'warning', message: '请检查申购数量是否未填写', duration: 2000 })
  1749. return false
  1750. } else {
  1751. var rulesAmount = /^[1-9]\d*$/
  1752. if (!rulesAmount.test(this.listAdd[j].amount)) {
  1753. this.$message({ type: 'error', message: '申购数量请输入正整数', duration: 2000 })
  1754. return false
  1755. }
  1756. }
  1757. if (this.createTemp.providerId !== '') {
  1758. if (this.listAdd[j].price == '') {
  1759. this.$message({ type: 'warning', message: '请检查单价是否为空', duration: 2000 })
  1760. return false
  1761. } else {
  1762. if (parseFloat(this.listAdd[j].price) == 0) {
  1763. this.$message({ type: 'warning', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
  1764. return false
  1765. } else {
  1766. // var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/
  1767. var rulesPrice = /(^[1-9](\d+)?(\.\d{1,5})?$)|(^\d\.\d{1,5}$)/
  1768. if (rulesPrice.test(this.listAdd[j].price) == false) {
  1769. this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
  1770. return false
  1771. }
  1772. }
  1773. }
  1774. }
  1775. }
  1776. if(this.createTemp.markBackend){
  1777. console.log('有数据-走新保存')
  1778. let url = 'authdata/partpurchase/edit'
  1779. let dataArr = []
  1780. for(let i =0 ;i<this.listAdd.length;i++){
  1781. let obj = {
  1782. "id": parseFloat(this.listAdd[i].id),
  1783. "bigId": parseFloat(this.createTemp.bigId),
  1784. "pastureId": parseFloat(this.listAdd[i].pastureId),
  1785. "partId": parseFloat(this.listAdd[i].partId),
  1786. "partCode": this.listAdd[i].partCode.toString(),
  1787. "partName": this.listAdd[i].partName.toString(),
  1788. "specification": this.listAdd[i].specification,
  1789. "amount": parseFloat(this.listAdd[i].amount),
  1790. "unit": this.listAdd[i].unit.toString(),
  1791. "brandId": parseFloat(this.listAdd[i].brandId),
  1792. "purpose": this.listAdd[i].purpose.toString(),
  1793. "price": this.listAdd[i].price.toString(),
  1794. "contractId": this.listAdd[i].contractId.toString(),
  1795. "lifeCycle": this.listAdd[i].lifeCycle.toString(),
  1796. "contractVarianceItem": this.listAdd[i].contractVarianceItem.toString(),
  1797. "departmentId": this.createTemp.departmentId.toString(),
  1798. "date": this.createTemp.createTime.toString(),
  1799. "employeId": parseFloat(this.createTemp.employeId)
  1800. }
  1801. if(this.listAdd[i].storageAmount){
  1802. obj.storageAmount = parseFloat(this.listAdd[i].storageAmount)
  1803. }else{
  1804. obj.storageAmount = 0
  1805. }
  1806. if(this.listAdd[i].reject){
  1807. obj.reject = this.listAdd[i].reject.toString()
  1808. }else{
  1809. obj.reject = ''
  1810. }
  1811. if(this.listAdd[i].explain){
  1812. obj.explain = this.listAdd[i].explain.toString()
  1813. }else{
  1814. obj.explain = ''
  1815. }
  1816. dataArr.push(obj)
  1817. }
  1818. let data = dataArr
  1819. postJson(url, data).then(response => {
  1820. if (response.msg !== 'fail') {
  1821. this.get_table_data()
  1822. this.dialogFormVisible = false
  1823. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  1824. } else {
  1825. failproccess(response, this.$notify)
  1826. }
  1827. })
  1828. }else{
  1829. console.log('无数据-走原有保存')
  1830. for(let i=0;i<this.listAdd.length;i++){
  1831. this.$set(this.listAdd[i],'date',this.createTemp.createTime)
  1832. this.$set(this.listAdd[i],'employeId',this.createTemp.employeId)
  1833. }
  1834. this.postDataPramas.common = { 'returnmap': '0' }
  1835. this.postDataPramas.data = []
  1836. this.postDataPramas.data[0] = { 'name': 'insertBigPartpurchase', 'type': 'e', 'parammaps': {
  1837. pastureId: this.createTemp.pastureId,
  1838. departmentId: this.createTemp.departmentId,
  1839. orderNumber: this.createTemp.orderNumber,
  1840. useType: this.createTemp.useType,
  1841. createTime: this.createTemp.createTime,
  1842. employeId: this.createTemp.employeId,
  1843. providerId: this.createTemp.providerId
  1844. }}
  1845. // eslint-disable-next-line no-irregular-whitespace
  1846. this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  1847. this.postDataPramas.data[1].children = []
  1848. this.postDataPramas.data[1].children[0] = { 'name': 'insertPartpurchase', 'type': 'e', 'parammaps': {
  1849. bigId: '@insertBigPartpurchase.LastInsertId',
  1850. pastureId: '@insertSpotList.pastureId',
  1851. partId: '@insertSpotList.partId',
  1852. partCode: '@insertSpotList.partCode',
  1853. partName: '@insertSpotList.partName',
  1854. specification: '@insertSpotList.specification',
  1855. unit: '@insertSpotList.unit',
  1856. brandId: '@insertSpotList.brandId',
  1857. storageAmount: '@insertSpotList.reportery',
  1858. purpose: '@insertSpotList.purpose',
  1859. amount: '@insertSpotList.amount',
  1860. price: '@insertSpotList.price',
  1861. contractId: '@insertSpotList.contractId',
  1862. lifeCycle: '@insertSpotList.lifeCycle',
  1863. date: '@insertSpotList.date',
  1864. employeId: '@insertSpotList.employeId',
  1865. contractVarianceItem: '@insertSpotList.contractVarianceItem'
  1866. }}
  1867. ExecDataByConfig(this.postDataPramas).then(response => {
  1868. console.log('新增保存发送参数', this.postDataPramas)
  1869. if (response.msg === 'fail') {
  1870. this.$notify({
  1871. title: '保存失败',
  1872. message: response.data,
  1873. type: 'warning',
  1874. duration: 2000
  1875. })
  1876. } else {
  1877. this.dialogFormVisible = false
  1878. this.getdataListParm.parammaps.inputDatetime = ''
  1879. this.get_table_data()
  1880. this.getPendingList()
  1881. this.$notify({
  1882. title: '',
  1883. message: '保存成功',
  1884. type: 'success',
  1885. duration: 2000
  1886. })
  1887. }
  1888. })
  1889. return true
  1890. }
  1891. } else {
  1892. this.$message({
  1893. title: '',
  1894. message: '请选择备件',
  1895. type: 'warning',
  1896. duration: 2000
  1897. })
  1898. return false
  1899. }
  1900. },
  1901. partDelete(row) {
  1902. console.log(this.listAdd)
  1903. MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
  1904. confirmButtonText: '确认',
  1905. cancelButtonText: '取消',
  1906. type: 'warning'
  1907. }).then(() => {
  1908. // console.log(this.list2)
  1909. for (var i = 0; i < this.listAdd.length; i++) {
  1910. console.log(this.listAdd[i])
  1911. if (this.listAdd[i].id === row.id) {
  1912. var listAddIndex = this.listAdd.indexOf(this.listAdd[i])
  1913. }
  1914. if (listAddIndex > -1) {
  1915. this.listAdd.splice(listAddIndex, 1)
  1916. return
  1917. }
  1918. }
  1919. })
  1920. },
  1921. // 查看
  1922. form_see(row) {
  1923. // 查看/特殊申购
  1924. if(row.purchase_type == 1 || row.purchase_type == 3){
  1925. this.textMap.see = '特殊申购'
  1926. }else{
  1927. this.textMap.see = '查看'
  1928. }
  1929. this.dialogStatus = 'see'
  1930. this.dialogFormVisibleSee = true
  1931. this.dialogFormVisibleSee1 = true
  1932. this.seeTemp = Object.assign({}, row)
  1933. this.seeTemp.purchaseType = String(row.purchase_type)
  1934. console.log('查看上方数据(从table读取)', this.seeTemp)
  1935. this.listSee = []
  1936. this.getdataListSee.parammaps.id = this.seeTemp.id
  1937. this.isApplyEx4 = false
  1938. this.getSeeList()
  1939. },
  1940. getFlowPath(){
  1941. // 流程图
  1942. var reason = '未通过原因:' + this.seeTemp.workflowNote
  1943. if (this.seeTemp.purchase_type < 0 || this.seeTemp.purchase_type == 0 ) {
  1944. if(this.isApplyEx4 == true){
  1945. if (this.seeTemp.statue === 2) {
  1946. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核' },{ title: '设备主管审核' }, { title: '供应主管审核' }, { title: '场长审核' },{ title: '采购审核' }]
  1947. this.active = 1
  1948. } else if (this.seeTemp.statue === 3) {
  1949. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson },{ title: '设备主管审核' }, { title: '供应主管审核' }, { title: '场长审核' }, { title: '采购审核' }]
  1950. this.active = 2
  1951. } else if (this.seeTemp.statue === 4) {
  1952. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson, status: 'error', reason: reason },{ title: '设备主管审核' }, { title: '供应主管审核' }, { title: '场长审核' },{ title: '采购审核' }]
  1953. this.active = 2
  1954. } else if (this.seeTemp.statue === 9) {
  1955. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson },{ title: '供应主管审核' }, { title: '场长审核' },{ title: '采购审核' }]
  1956. this.active = 3
  1957. } else if (this.seeTemp.statue === 10) {
  1958. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson, status: 'error', reason: reason }, { title: '供应主管审核' }, { title: '场长审核' },{ title: '采购审核' }]
  1959. this.active = 3
  1960. } else if (this.seeTemp.statue === 5) {
  1961. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '场长审核' }, { title: '采购审核' }]
  1962. this.active = 4
  1963. } else if (this.seeTemp.statue === 6) {
  1964. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson, status: 'error', reason: reason }, { title: '场长审核' }, { title: '采购审核' }]
  1965. this.active = 4
  1966. } else if (this.seeTemp.statue === 11) {
  1967. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '场长审核', date: this.seeTemp.fielddate, name: this.seeTemp.fieldPerson }, { title: '采购审核' }]
  1968. this.active = 5
  1969. } else if (this.seeTemp.statue === 12) {
  1970. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '场长审核' , date: this.seeTemp.fielddate, name: this.seeTemp.fieldPerson, status: 'error', reason: reason }, { title: '采购审核' }]
  1971. this.active = 5
  1972. } else if (this.seeTemp.statue === 7) {
  1973. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '场长审核', date: this.seeTemp.fielddate, name: this.seeTemp.fieldPerson }, { title: '采购审核', date: this.seeTemp.CGChargedate, name: this.seeTemp.CGChargePerson }]
  1974. this.active = 6
  1975. } else if (this.seeTemp.statue === 8) {
  1976. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '场长审核', date: this.seeTemp.fielddate, name: this.seeTemp.fieldPerson },{ title: '采购审核', date: this.seeTemp.CGChargedate, name: this.seeTemp.CGChargePerson, status: 'error', reason: reason }]
  1977. this.active = 6
  1978. }
  1979. }else{
  1980. if (this.seeTemp.statue === 2) {
  1981. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核' },{ title: '设备主管审核' }, { title: '供应主管审核' },{ title: '采购审核' }]
  1982. this.active = 1
  1983. } else if (this.seeTemp.statue === 3) {
  1984. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson },{ title: '设备主管审核' }, { title: '供应主管审核' }, { title: '采购审核' }]
  1985. this.active = 2
  1986. } else if (this.seeTemp.statue === 4) {
  1987. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson, status: 'error', reason: reason },{ title: '设备主管审核' }, { title: '供应主管审核' }, { title: '采购审核' }]
  1988. this.active = 2
  1989. } else if (this.seeTemp.statue === 9) {
  1990. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson },{ title: '供应主管审核' }, { title: '采购审核' }]
  1991. this.active = 3
  1992. } else if (this.seeTemp.statue === 10) {
  1993. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson, status: 'error', reason: reason }, { title: '供应主管审核' }, { title: '采购审核' }]
  1994. this.active = 3
  1995. } else if (this.seeTemp.statue === 5) {
  1996. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '采购审核' }]
  1997. this.active = 4
  1998. } else if (this.seeTemp.statue === 6) {
  1999. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson, status: 'error', reason: reason }, { title: '采购审核' }]
  2000. this.active = 4
  2001. } else if (this.seeTemp.statue === 11) {
  2002. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '采购审核' }]
  2003. this.active = 4
  2004. } else if (this.seeTemp.statue === 12) {
  2005. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '采购审核' }]
  2006. this.active = 4
  2007. } else if (this.seeTemp.statue === 7) {
  2008. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '采购审核', date: this.seeTemp.CGChargedate, name: this.seeTemp.CGChargePerson }]
  2009. this.active = 6
  2010. } else if (this.seeTemp.statue === 8) {
  2011. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '采购审核', date: this.seeTemp.CGChargedate, name: this.seeTemp.CGChargePerson, status: 'error', reason: reason }]
  2012. this.active = 6
  2013. }
  2014. }
  2015. } else if(this.seeTemp.purchase_type == 3){
  2016. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }]
  2017. this.active = 1
  2018. }else {
  2019. if (this.seeTemp.statue === 2) {
  2020. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核' },{ title: '设备主管审核' }, { title: '供应主管审核' }, { title: '财务审核' },{ title: '场长审核' },{ title: '采购审核' }]
  2021. this.active = 1
  2022. } else if (this.seeTemp.statue === 3) {
  2023. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson },{ title: '设备主管审核' }, { title: '供应主管审核' }, { title: '财务审核' }, { title: '场长审核' }, { title: '采购审核' }]
  2024. this.active = 2
  2025. } else if (this.seeTemp.statue === 4) {
  2026. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson, status: 'error', reason: reason },{ title: '设备主管审核' }, { title: '供应主管审核' }, { title: '财务审核' }, { title: '场长审核' },{ title: '采购审核' }]
  2027. this.active = 2
  2028. } else if (this.seeTemp.statue === 9) {
  2029. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson },{ title: '供应主管审核' }, { title: '财务审核' },{ title: '场长审核' },{ title: '采购审核' }]
  2030. this.active = 3
  2031. } else if (this.seeTemp.statue === 10) {
  2032. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson, status: 'error', reason: reason }, { title: '供应主管审核' }, { title: '财务审核' }, { title: '场长审核' },{ title: '采购审核' }]
  2033. this.active = 3
  2034. } else if (this.seeTemp.statue === 5) {
  2035. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '财务审核' },{ title: '场长审核' }, { title: '采购审核' }]
  2036. this.active = 4
  2037. } else if (this.seeTemp.statue === 6) {
  2038. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson, status: 'error', reason: reason }, { title: '财务审核' },{ title: '场长审核' }, { title: '采购审核' }]
  2039. this.active = 4
  2040. } else if (this.seeTemp.statue === 13) {
  2041. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '财务审核', date: this.seeTemp.financedate, name: this.seeTemp.financeName },{ title: '场长审核',}, { title: '采购审核' }]
  2042. this.active = 5
  2043. } else if (this.seeTemp.statue === 14) {
  2044. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '财务审核',date: this.seeTemp.financedate, name: this.seeTemp.financeName, status: 'error', reason: reason },{ title: '场长审核' }, { title: '采购审核' }]
  2045. this.active = 5
  2046. } else if (this.seeTemp.statue === 11) {
  2047. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '财务审核', date: this.seeTemp.financedate, name: this.seeTemp.financeName },{ title: '场长审核', date: this.seeTemp.fielddate, name: this.seeTemp.fieldPerson }, { title: '采购审核' }]
  2048. this.active = 6
  2049. } else if (this.seeTemp.statue === 12) {
  2050. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '财务审核', date: this.seeTemp.financedate, name: this.seeTemp.financeName },{ title: '场长审核' , date: this.seeTemp.fielddate, name: this.seeTemp.fieldPerson, status: 'error', reason: reason }, { title: '采购审核' }]
  2051. this.active = 6
  2052. } else if (this.seeTemp.statue === 7) {
  2053. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '财务审核', date: this.seeTemp.financedate, name: this.seeTemp.financeName }, { title: '场长审核', date: this.seeTemp.fielddate, name: this.seeTemp.fieldPerson }, { title: '采购审核', date: this.seeTemp.CGChargedate, name: this.seeTemp.CGChargePerson }]
  2054. this.active = 7
  2055. } else if (this.seeTemp.statue === 8) {
  2056. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '设备主管审核', date: this.seeTemp.equipmentdate, name: this.seeTemp.equipmentPerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '财务审核', date: this.seeTemp.financedate, name: this.seeTemp.financeName },{ title: '场长审核', date: this.seeTemp.fielddate, name: this.seeTemp.fieldPerson },{ title: '采购审核', date: this.seeTemp.CGChargedate, name: this.seeTemp.CGChargePerson, status: 'error', reason: reason }]
  2057. this.active = 7
  2058. }
  2059. }
  2060. },
  2061. getSeeList() {
  2062. this.listLoadingSee = true
  2063. console.log(this.dialogStatus,'======')
  2064. if(this.dialogStatus == 'create'){
  2065. console.log(this.dialogStatus,'======')
  2066. this.getdataListSee.parammaps.reject = ''
  2067. }else{
  2068. this.getdataListSee.parammaps.reject = 0
  2069. }
  2070. GetDataByName(this.getdataListSee).then(response => {
  2071. if (response.data.list !== null) {
  2072. console.log('查看下方table数据', response.data.list)
  2073. response.data.list.forEach((item)=>{
  2074. console.log(item,'item')
  2075. var pricearr = item.price.split(",")
  2076. this.$set(item,'pricearr',pricearr)
  2077. var lifeCyclearr = item.lifeCycle.split(",")
  2078. this.$set(item,'lifeCyclearr',lifeCyclearr)
  2079. var contractVarianceItemarr = item.contractVarianceItem.split(",")
  2080. this.$set(item,'contractVarianceItemarr',contractVarianceItemarr)
  2081. })
  2082. this.listSee = response.data.list
  2083. this.listAdd = response.data.list
  2084. this.modifylist = response.data.list
  2085. var sumPrices = 0
  2086. response.data.list.forEach(function(i,j){
  2087. sumPrices = sumPrices + (parseFloat(i.price1) *parseFloat(i.amount) )
  2088. })
  2089. console.log("总价sumPrices",sumPrices)
  2090. var priceObj = false
  2091. var priceArr = []
  2092. response.data.list.forEach(function(i,j){
  2093. if(parseFloat(i.price1) >= 500){
  2094. priceArr.push(true)
  2095. }else{
  2096. priceArr.push(false)
  2097. }
  2098. })
  2099. if (priceArr.includes(true)) {
  2100. priceObj = true
  2101. } else {
  2102. priceObj = false
  2103. }
  2104. console.log("priceObj",priceObj)
  2105. //总价大于2000 或单价>500
  2106. if(sumPrices >= 2000 || priceObj){
  2107. this.isApplyEx4 = true
  2108. this.getFlowPath()
  2109. } else {
  2110. this.isApplyEx4 = false
  2111. this.getFlowPath()
  2112. }
  2113. for (let i = 0; i < response.data.list.length; i++) {
  2114. 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) {
  2115. console.log(process.env.VUE_APP_BASE_API + response.data.list[i].srcpath, '=======1')
  2116. this.listSee[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  2117. this.listSee[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  2118. this.listAdd[i].srcpath = this.listSee[i].srcpath
  2119. this.listAdd[i].picpath = this.listSee[i].picpath
  2120. // this.seeTemp.providerName = response.data.list.providerName
  2121. this.pageNumSee = response.data.pageNum
  2122. this.pageSizeSee = response.data.pageSize
  2123. } else {
  2124. this.listSee[i].srcpath = ''
  2125. this.listSee[i].picpath = ''
  2126. this.listAdd[i].srcpath = ''
  2127. this.listAdd[i].picpath = ''
  2128. }
  2129. }
  2130. }
  2131. if (response.data.total) {
  2132. this.totalSee = response.data.total
  2133. }
  2134. setTimeout(() => {
  2135. this.listLoadingSee = false
  2136. }, 100)
  2137. })
  2138. },
  2139. form_edit(row) {
  2140. this.isMilk = false
  2141. this.edit = 0
  2142. this.getDepartParam.parammaps.pastureId = row.pastureId
  2143. this.getCreateDepartDownList()
  2144. if (row.providerId == undefined) {
  2145. row.providerId = ''
  2146. row.providerName = ''
  2147. }
  2148. this.createTemp = Object.assign({}, row) // copy obj
  2149. this.dialogStatus = 'update'
  2150. this.dialogFormVisible = true
  2151. this.$nextTick(() => {
  2152. this.$refs['createTemp'].clearValidate()
  2153. })
  2154. this.getdataListSee.parammaps.id = this.createTemp.id
  2155. this.getSeeList()
  2156. },
  2157. edit_dialog_save() {
  2158. this.isokDisable = true
  2159. setTimeout(() => {
  2160. this.isokDisable = false
  2161. }, 1000)
  2162. this.$refs['createTemp'].validate(valid => {
  2163. if (valid) {
  2164. this.edit_dialog_saveSave()
  2165. }
  2166. })
  2167. },
  2168. edit_dialog_saveSave() {
  2169. if (this.listAdd.length !== 0) {
  2170. for (var j = 0; j < this.listAdd.length; j++) {
  2171. console.log(this.listAdd[j].amount)
  2172. // eslint-disable-next-line use-isnan
  2173. if (this.listAdd[j].amount == null || this.listAdd[j].amount === '') {
  2174. this.$message({ type: 'warning', message: '请检查申购数量是否未填写', duration: 2000 })
  2175. return false
  2176. } else {
  2177. var rulesAmount = /^[1-9]\d*$/
  2178. if (!rulesAmount.test(this.listAdd[j].amount)) {
  2179. this.$message({ type: 'error', message: '申购数量请输入正整数', duration: 2000 })
  2180. return false
  2181. }
  2182. }
  2183. if (this.createTemp.providerId !== '') {
  2184. if (this.listAdd[j].price == '') {
  2185. this.$message({ type: 'warning', message: '请检查单价是否为空', duration: 2000 })
  2186. return false
  2187. } else {
  2188. if (parseFloat(this.listAdd[j].price) == 0) {
  2189. this.$message({ type: 'warning', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
  2190. return false
  2191. } else {
  2192. // var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/
  2193. var rulesPrice = /(^[1-9](\d+)?(\.\d{1,5})?$)|(^\d\.\d{1,5}$)/
  2194. if (rulesPrice.test(this.listAdd[j].price) == false) {
  2195. this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
  2196. return false
  2197. }
  2198. }
  2199. }
  2200. }
  2201. }
  2202. this.postDataPramas.common = { 'returnmap': '0' }
  2203. this.postDataPramas.data = []
  2204. this.postDataPramas.data[0] = { 'name': 'updatepartpurchaseCharge', 'type': 'e', 'parammaps': {
  2205. id: this.createTemp.id
  2206. }}
  2207. this.postDataPramas.data[1] = { 'name': 'deletePartpurchase', 'type': 'e', 'parammaps': {
  2208. bigId: this.createTemp.id
  2209. }}
  2210. // eslint-disable-next-line no-irregular-whitespace
  2211. this.postDataPramas.data[2] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  2212. this.postDataPramas.data[2].children = []
  2213. this.postDataPramas.data[2].children[0] = { 'name': 'insertPartpurchase', 'type': 'e', 'parammaps': {
  2214. bigId: this.createTemp.id,
  2215. pastureId: '@insertSpotList.pastureId',
  2216. partId: '@insertSpotList.partId',
  2217. partCode: '@insertSpotList.partCode',
  2218. partName: '@insertSpotList.partName',
  2219. specification: '@insertSpotList.specification',
  2220. unit: '@insertSpotList.unit',
  2221. brandId: '@insertSpotList.brandId',
  2222. storageAmount: '@insertSpotList.reportery',
  2223. purpose: '@insertSpotList.purpose',
  2224. amount: '@insertSpotList.amount',
  2225. price: '@insertSpotList.price',
  2226. contractId: '@insertSpotList.contractId',
  2227. lifeCycle: '@insertSpotList.lifeCycle',
  2228. contractVarianceItem: '@insertSpotList.contractVarianceItem',
  2229. }}
  2230. ExecDataByConfig(this.postDataPramas).then(response => {
  2231. console.log('新增保存发送参数', this.postDataPramas)
  2232. if (response.msg === 'fail') {
  2233. this.$notify({
  2234. title: '保存失败',
  2235. message: response.data,
  2236. type: 'warning',
  2237. duration: 2000
  2238. })
  2239. } else {
  2240. this.dialogFormVisible = false
  2241. this.getdataListParm.parammaps.inputDatetime = ''
  2242. this.get_table_data()
  2243. this.$notify({
  2244. title: '',
  2245. message: '保存成功',
  2246. type: 'success',
  2247. duration: 2000
  2248. })
  2249. }
  2250. })
  2251. return true
  2252. } else {
  2253. this.$message({
  2254. title: '',
  2255. message: '请选择备件',
  2256. type: 'warning',
  2257. duration: 2000
  2258. })
  2259. return false
  2260. }
  2261. },
  2262. get_select_list() {
  2263. GetDataByNames(this.requestParams).then(response => {
  2264. this.findAllProvider = response.data.findAllProvider.list
  2265. this.findAllPasture = response.data.findAllPasture.list
  2266. this.findAllEmploye = response.data.findAllEmploye.list
  2267. this.onlineSubscriptionList = response.data.getflexProviderList.list
  2268. this.getDepartDownList()
  2269. })
  2270. },
  2271. getDepartDownList() {
  2272. GetDataByName(this.getDepartParam).then(response => {
  2273. this.findAllDepart = response.data.list
  2274. })
  2275. },
  2276. changePastureName(item) {
  2277. this.getDepartParam.parammaps.pastureId = this.findAllPasture.find(obj => obj.name == item).id
  2278. this.getdataListParm.parammaps.departmentId = ''
  2279. this.getDepartDownList()
  2280. },
  2281. getCreateDepartDownList() {
  2282. GetDataByName(this.getDepartParam).then(response => {
  2283. this.createDepartList = response.data.list
  2284. if (this.edit == 1) {
  2285. if (this.createDepartList.find(obj => obj.id == Cookies.get('departmentid'))) {
  2286. this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
  2287. this.createTemp.departmentName = this.createDepartList.find(obj => obj.id == Cookies.get('departmentid')).name
  2288. } else {
  2289. this.createTemp.departmentId = response.data.list[0].id
  2290. this.createTemp.departmentName = response.data.list[0].name
  2291. }
  2292. if(this.isMilk){
  2293. console.log('milk')
  2294. this.createTemp.departmentName = '挤奶处'
  2295. this.createTemp.departmentId = this.createDepartList.find(obj => obj.name == this.createTemp.departmentName).id
  2296. }
  2297. }
  2298. })
  2299. },
  2300. changePasture(item) {
  2301. this.getDepartParam.parammaps.pastureId = item
  2302. this.edit = 1
  2303. this.getCreateDepartDownList()
  2304. },
  2305. changeDepart(item) {
  2306. this.createTemp.departmentName = this.createDepartList.find(obj => obj.id == item).name
  2307. },
  2308. handleDownload() {
  2309. console.log('点击了下载')
  2310. this.$alert('备件申购正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  2311. this.isPercentage = true
  2312. this.percentage = 1
  2313. var timer = setInterval(() => {
  2314. this.percentage += 5
  2315. if (this.percentage > 95) {
  2316. this.percentage = 99
  2317. clearInterval(timer)
  2318. }
  2319. this.percentage = this.percentage
  2320. }, 1000)
  2321. this.downloadParam.name = 'downloadPartpurchaseList'
  2322. this.downloadParam.parammaps = this.getdataListParm.parammaps
  2323. GetAccount(this.downloadParam).then(response => {
  2324. if (response.data.list !== '') {
  2325. this.percentage = 99
  2326. setTimeout(() => {
  2327. this.isPercentage = false
  2328. }, 2000)
  2329. }
  2330. this.$nextTick(() => {
  2331. const ExcelDatas = [
  2332. {
  2333. tHeader: ['牧场', '申购单号', '申购时间', '备件编号', '备件名称', '规格型号', '品牌', '单位', '申购数量', '申购部门', '申购人', '备注'],
  2334. filterVal: ['pastureName', 'orderNumber', 'inputTime', 'partCode', 'partName', 'specification', 'brandName', 'unit', 'amount', 'departmentName', 'empname', 'purpose'],
  2335. tableDatas: response.data.list,
  2336. sheetName: '备件申购'
  2337. }
  2338. ]
  2339. json2excel(ExcelDatas, '备件申购', true, 'xlsx')
  2340. })
  2341. })
  2342. },
  2343. form_delete(row) {
  2344. console.log('点击了删除')
  2345. MessageBox.confirm('确认删除此条信息?', {
  2346. confirmButtonText: '确认',
  2347. cancelButtonText: '取消',
  2348. type: 'warning'
  2349. }).then(() => {
  2350. this.postDataPramas.common = { 'returnmap': '0' }
  2351. this.postDataPramas.data = []
  2352. this.postDataPramas.data[0] = { 'name': 'deleteBigPartpurchase', 'type': 'e', 'parammaps': {
  2353. id: row.id
  2354. }}
  2355. this.postDataPramas.data[1] = { 'name': 'deletePartpurchase', 'type': 'e', 'parammaps': {
  2356. bigId: row.id
  2357. }}
  2358. ExecDataByConfig(this.postDataPramas).then(response => {
  2359. this.get_table_data()
  2360. this.$notify({
  2361. title: '成功',
  2362. message: '删除成功',
  2363. type: 'success',
  2364. duration: 2000
  2365. })
  2366. })
  2367. }).catch(() => {
  2368. this.$message({
  2369. type: 'info',
  2370. message: '已取消删除'
  2371. })
  2372. })
  2373. },
  2374. handleExamine1(row) {
  2375. console.log('点击了库管审核')
  2376. if (row == undefined) {
  2377. this.examineTemp = this.seeTemp
  2378. this.$set(this.seeTemp, 'statue', 1)
  2379. this.$set(this.seeTemp, 'workflowNote', '')
  2380. } else {
  2381. this.examineTemp = Object.assign({}, row)
  2382. this.$set(this.examineTemp, 'statue', 1)
  2383. this.$set(this.examineTemp, 'workflowNote', '')
  2384. }
  2385. this.dialogStatus = 'examine1'
  2386. this.dialogFormVisible_Examine = true
  2387. this.statueReason = false
  2388. },
  2389. changeStatue(val) {
  2390. if (val == 2) {
  2391. this.statueReason = true
  2392. } else {
  2393. this.statueReason = false
  2394. }
  2395. },
  2396. createExamineData1() {
  2397. console.log('点击了库管审核')
  2398. this.isokDisable = true
  2399. setTimeout(() => {
  2400. this.isokDisable = false
  2401. }, 1000)
  2402. this.$refs['examineTemp'].validate(valid => {
  2403. if (valid) {
  2404. this.requestParam = {}
  2405. this.requestParam.name = 'partpurchaseCharge'
  2406. this.requestParam.parammaps = {}
  2407. this.requestParam.parammaps.id = this.examineTemp.id
  2408. if (this.examineTemp.statue == 1) {
  2409. this.requestParam.parammaps.statue = 3
  2410. } else if (this.examineTemp.statue == 2) {
  2411. this.requestParam.parammaps.statue = 4
  2412. }
  2413. this.requestParam.parammaps.empId = Cookies.get('employeid')
  2414. this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
  2415. PostDataByName(this.requestParam).then(response => {
  2416. console.log('审核确认发送参数', this.requestParam)
  2417. this.isokDisable = false
  2418. if (response.msg !== 'fail') {
  2419. this.get_table_data()
  2420. this.dialogFormVisible_Examine = false
  2421. this.dialogFormVisible_See = false
  2422. this.statueReason = false
  2423. this.$notify({
  2424. title: '成功',
  2425. message: '审核成功',
  2426. type: 'success',
  2427. duration: 2000
  2428. })
  2429. } else {
  2430. failproccess(response, this.$notify)
  2431. }
  2432. })
  2433. }
  2434. })
  2435. },
  2436. handleExamine2(row) {
  2437. console.log('点击了设备主管审核')
  2438. if (row == undefined) {
  2439. this.examineTemp = this.seeTemp
  2440. this.$set(this.seeTemp, 'statue', 1)
  2441. this.$set(this.seeTemp, 'workflowNote', '')
  2442. } else {
  2443. this.examineTemp = Object.assign({}, row)
  2444. this.$set(this.examineTemp, 'statue', 1)
  2445. this.$set(this.examineTemp, 'workflowNote', '')
  2446. }
  2447. this.dialogStatus = 'examine2'
  2448. this.dialogFormVisible_Examine = true
  2449. this.statueReason = false
  2450. },
  2451. createExamineData2() {
  2452. console.log('点击了设备主管审核')
  2453. this.isokDisable = true
  2454. setTimeout(() => {
  2455. this.isokDisable = false
  2456. }, 1000)
  2457. this.$refs['examineTemp'].validate(valid => {
  2458. if (valid) {
  2459. this.requestParam = {}
  2460. this.requestParam.name = 'partpurchaseEquipment'
  2461. this.requestParam.parammaps = {}
  2462. this.requestParam.parammaps.id = this.examineTemp.id
  2463. if (this.examineTemp.statue == 1) {
  2464. this.requestParam.parammaps.statue = 9
  2465. } else if (this.examineTemp.statue == 2) {
  2466. this.requestParam.parammaps.statue = 10
  2467. }
  2468. this.requestParam.parammaps.empId = Cookies.get('employeid')
  2469. this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
  2470. PostDataByName(this.requestParam).then(response => {
  2471. this.isokDisable = false
  2472. console.log('审核确认发送参数', this.requestParam)
  2473. if (response.msg !== 'fail') {
  2474. this.get_table_data()
  2475. this.dialogFormVisible_Examine = false
  2476. this.dialogFormVisible_See = false
  2477. this.statueReason = false
  2478. this.$notify({
  2479. title: '成功',
  2480. message: '审核成功',
  2481. type: 'success',
  2482. duration: 2000
  2483. })
  2484. } else {
  2485. failproccess(response, this.$notify)
  2486. }
  2487. })
  2488. }
  2489. })
  2490. },
  2491. handleExamine3(row) {
  2492. console.log('点击了供应主管审核')
  2493. if (row == undefined) {
  2494. this.examineTemp = this.seeTemp
  2495. this.$set(this.seeTemp, 'statue', 1)
  2496. this.$set(this.seeTemp, 'workflowNote', '')
  2497. this.getdataListSee.parammaps.id = this.seeTemp.id
  2498. } else {
  2499. this.examineTemp = Object.assign({}, row)
  2500. this.getdataListSee.parammaps.id = this.examineTemp.id
  2501. this.$set(this.examineTemp, 'statue', 1)
  2502. this.$set(this.examineTemp, 'workflowNote', '')
  2503. }
  2504. this.getSeeList()
  2505. this.dialogStatus = 'examine3'
  2506. this.dialogFormVisible_Examine = true
  2507. this.statueReason = false
  2508. },
  2509. createExamineData3() {
  2510. console.log('点击了供应主管审核')
  2511. console.log(this.isApplyEx4,'=====')
  2512. this.isokDisable = true
  2513. setTimeout(() => {
  2514. this.isokDisable = false
  2515. }, 1000)
  2516. this.$refs['examineTemp'].validate(valid => {
  2517. if (valid) {
  2518. this.requestParam = {}
  2519. this.requestParam.name = 'partpurchaseCharge3'
  2520. this.requestParam.parammaps = {}
  2521. this.requestParam.parammaps.id = this.examineTemp.id
  2522. if (this.examineTemp.statue == 1) {
  2523. if(this.examineTemp.purchase_type !== 1 && this.examineTemp.purchase_type !== 3){
  2524. console.log(this.isApplyEx4,'=====')
  2525. if(this.isApplyEx4 == true){
  2526. this.requestParam.parammaps.statue = 5
  2527. }else{
  2528. this.requestParam.parammaps.statue = 11
  2529. }
  2530. }else{
  2531. this.requestParam.parammaps.statue = 5
  2532. }
  2533. } else if (this.examineTemp.statue == 2) {
  2534. if(this.examineTemp.purchase_type !== 1 && this.examineTemp.purchase_type !== 3){
  2535. if(this.isApplyEx4 == true){
  2536. this.requestParam.parammaps.statue = 6
  2537. }else{
  2538. this.requestParam.parammaps.statue = 12
  2539. }
  2540. }else{
  2541. this.requestParam.parammaps.statue = 6
  2542. }
  2543. }
  2544. this.requestParam.parammaps.empId = Cookies.get('employeid')
  2545. this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
  2546. // return false
  2547. PostDataByName(this.requestParam).then(response => {
  2548. console.log('审核确认发送参数', this.requestParam)
  2549. this.isokDisable = false
  2550. if (response.msg !== 'fail') {
  2551. this.get_table_data()
  2552. this.dialogFormVisible_Examine = false
  2553. this.dialogFormVisible_See = false
  2554. this.statueReason = false
  2555. this.$notify({
  2556. title: '成功',
  2557. message: '审核成功',
  2558. type: 'success',
  2559. duration: 2000
  2560. })
  2561. } else {
  2562. failproccess(response, this.$notify)
  2563. }
  2564. })
  2565. }
  2566. })
  2567. },
  2568. handleExamine4(row) {
  2569. console.log('点击了场长审核')
  2570. if (row == undefined) {
  2571. this.examineTemp = this.seeTemp
  2572. this.$set(this.seeTemp, 'statue', 1)
  2573. this.$set(this.seeTemp, 'workflowNote', '')
  2574. } else {
  2575. this.examineTemp = Object.assign({}, row)
  2576. this.$set(this.examineTemp, 'workflowNote', '')
  2577. this.$set(this.examineTemp, 'statue', 1)
  2578. }
  2579. this.dialogStatus = 'examine4'
  2580. this.dialogFormVisible_Examine = true
  2581. this.statueReason = false
  2582. },
  2583. createExamineData4() {
  2584. console.log('点击了场长审核')
  2585. this.isokDisable = true
  2586. setTimeout(() => {
  2587. this.isokDisable = false
  2588. }, 1000)
  2589. this.$refs['examineTemp'].validate(valid => {
  2590. if (valid) {
  2591. this.requestParam = {}
  2592. this.requestParam.parammaps = {}
  2593. this.requestParam.common = { 'returnmap': '0' }
  2594. this.requestParam.data = []
  2595. // 通过
  2596. if (this.examineTemp.statue == 1) {
  2597. this.requestParam.data[0] = { 'name': 'partpurchaseField', 'type': 'e', 'parammaps': {
  2598. id: this.examineTemp.id,
  2599. statue: 11,
  2600. field: Cookies.get('employeid'),
  2601. workflowNote: this.examineTemp.workflowNote
  2602. }}
  2603. this.requestParam.data[1] = { 'name': 'createBuydetailBySG', 'type': 'e', 'parammaps': {
  2604. id: this.examineTemp.id,
  2605. pastureId: this.examineTemp.pastureId
  2606. }}
  2607. //不通过
  2608. } else if (this.examineTemp.statue == 2) {
  2609. this.requestParam.data[0] = { 'name': 'partpurchaseField', 'type': 'e', 'parammaps': {
  2610. id: this.examineTemp.id,
  2611. statue: 12,
  2612. field: Cookies.get('employeid'),
  2613. workflowNote: this.examineTemp.workflowNote
  2614. }}
  2615. }
  2616. ExecDataByConfig(this.requestParam).then(response => {
  2617. this.isokDisable = false
  2618. if (response.msg !== 'fail') {
  2619. this.get_table_data()
  2620. this.dialogFormVisible_Examine = false
  2621. this.dialogFormVisible_See = false
  2622. this.statueReason = false
  2623. this.$notify({ title: '成功', message: '审核成功', type: 'success', duration: 2000 })
  2624. } else {
  2625. failproccess(response, this.$notify)
  2626. }
  2627. })
  2628. }
  2629. })
  2630. },
  2631. handleExamine5(row) {
  2632. console.log('点击了采购审核')
  2633. if (row == undefined) {
  2634. this.examineTemp = this.seeTemp
  2635. this.$set(this.seeTemp, 'statue', 1)
  2636. this.$set(this.seeTemp, 'workflowNote', '')
  2637. } else {
  2638. this.examineTemp = Object.assign({}, row)
  2639. this.$set(this.examineTemp, 'workflowNote', '')
  2640. this.$set(this.examineTemp, 'statue', 1)
  2641. }
  2642. this.dialogStatus = 'examine5'
  2643. this.dialogFormVisible_Examine = true
  2644. this.statueReason = false
  2645. },
  2646. createExamineData5() {
  2647. console.log('点击了采购审核')
  2648. this.isokDisable = true
  2649. setTimeout(() => {
  2650. this.isokDisable = false
  2651. }, 10000)
  2652. this.$refs['examineTemp'].validate(valid => {
  2653. if (valid) {
  2654. this.requestParam = {}
  2655. this.requestParam.parammaps = {}
  2656. this.requestParam.common = { 'returnmap': '0' }
  2657. this.requestParam.data = []
  2658. if (this.examineTemp.statue == 1) {
  2659. this.requestParam.data[0] = { 'name': 'partpurchaseCharge1', 'type': 'e', 'parammaps': {
  2660. id: this.examineTemp.id,
  2661. statue: 7,
  2662. empId: Cookies.get('employeid'),
  2663. workflowNote: this.examineTemp.workflowNote
  2664. }}
  2665. this.requestParam.data[1] = { 'name': 'createBuydetailBySG', 'type': 'e', 'parammaps': {
  2666. id: this.examineTemp.id,
  2667. pastureId: this.examineTemp.pastureId
  2668. }}
  2669. } else if (this.examineTemp.statue == 2) {
  2670. this.requestParam.data[0] = { 'name': 'partpurchaseCharge1', 'type': 'e', 'parammaps': {
  2671. id: this.examineTemp.id,
  2672. statue: 8,
  2673. empId: Cookies.get('employeid'),
  2674. workflowNote: this.examineTemp.workflowNote
  2675. }}
  2676. }
  2677. ExecDataByConfig(this.requestParam).then(response => {
  2678. this.isokDisable = false
  2679. if (response.msg !== 'fail') {
  2680. this.get_table_data()
  2681. this.dialogFormVisible_Examine = false
  2682. this.dialogFormVisible_See = false
  2683. this.statueReason = false
  2684. this.$notify({ title: '成功', message: '审核成功', type: 'success', duration: 2000 })
  2685. } else {
  2686. failproccess(response, this.$notify)
  2687. }
  2688. })
  2689. }
  2690. })
  2691. },
  2692. handleExamine6(row) {
  2693. console.log('点击了财务审核')
  2694. if (row == undefined) {
  2695. this.examineTemp = this.seeTemp
  2696. this.$set(this.seeTemp, 'statue', 1)
  2697. this.$set(this.seeTemp, 'workflowNote', '')
  2698. } else {
  2699. this.examineTemp = Object.assign({}, row)
  2700. this.$set(this.examineTemp, 'workflowNote', '')
  2701. this.$set(this.examineTemp, 'statue', 1)
  2702. }
  2703. this.dialogStatus = 'examine6'
  2704. this.dialogFormVisible_Examine = true
  2705. this.statueReason = false
  2706. },
  2707. createExamineData6() {
  2708. console.log('点击了财务审核')
  2709. this.isokDisable = true
  2710. setTimeout(() => {
  2711. this.isokDisable = false
  2712. }, 10000)
  2713. this.$refs['examineTemp'].validate(valid => {
  2714. if (valid) {
  2715. this.requestParam = {}
  2716. this.requestParam.name = 'partpurchaseFinanceId'
  2717. this.requestParam.parammaps = {}
  2718. this.requestParam.parammaps.id = this.examineTemp.id
  2719. if (this.examineTemp.statue == 1) {
  2720. this.requestParam.parammaps.statue = 13
  2721. } else if (this.examineTemp.statue == 2) {
  2722. this.requestParam.parammaps.statue = 14
  2723. }
  2724. this.requestParam.parammaps.financeId = Cookies.get('employeid')
  2725. this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
  2726. PostDataByName(this.requestParam).then(response => {
  2727. console.log('审核确认发送参数', this.requestParam)
  2728. this.isokDisable = false
  2729. if (response.msg !== 'fail') {
  2730. this.get_table_data()
  2731. this.dialogFormVisible_Examine = false
  2732. this.dialogFormVisible_See = false
  2733. this.statueReason = false
  2734. this.$notify({
  2735. title: '成功',
  2736. message: '审核成功',
  2737. type: 'success',
  2738. duration: 2000
  2739. })
  2740. } else {
  2741. failproccess(response, this.$notify)
  2742. }
  2743. })
  2744. }
  2745. })
  2746. },
  2747. handle_specialSubscription(){
  2748. this.createTemp.purchaseType = '1'
  2749. this.edit = 1
  2750. this.getDepartParam.parammaps.pastureId = this.createTemp.pastureId
  2751. this.getCreateDepartDownList()
  2752. this.dialogStatus = 'special'
  2753. this.dialogFormVisible2 = true
  2754. this.$nextTick(() => {
  2755. this.$refs['createTemp'].clearValidate()
  2756. })
  2757. if(this.createTemp.purchaseType == 1){
  2758. this.getBigPartpurchase(parseInt(this.createTemp.purchaseType))
  2759. }else{
  2760. this.getCreateNumber()
  2761. }
  2762. },
  2763. getProviderList(){
  2764. let data = {
  2765. "name":"getProviderList",
  2766. "page":1,"offset":1,"pagecount":0,
  2767. "returntype":"Map","parammaps":{"providerName":""}
  2768. }
  2769. GetDataByName(data).then(response => {
  2770. if (response.data.list !== null) {
  2771. this.providerList = response.data.list
  2772. }else{
  2773. this.providerList = []
  2774. }
  2775. })
  2776. },
  2777. changeType(){
  2778. if(this.createTemp.purchaseType == 1){
  2779. this.getBigPartpurchase(parseInt(this.createTemp.purchaseType))
  2780. }else{
  2781. this.createTemp.orderNumber = ''
  2782. this.getCreateNumber()
  2783. }
  2784. this.listAdd = []
  2785. this.$set(this.createTemp,'providerId','')
  2786. this.$set(this.createTemp,'providerName','')
  2787. },
  2788. special_dialog_save(){
  2789. console.log('特殊申购保存')
  2790. this.isokDisable = true
  2791. setTimeout(() => {
  2792. this.isokDisable = false
  2793. }, 1000)
  2794. this.$refs['createTemp'].validate(valid => {
  2795. if (valid) {
  2796. console.log(this.listAdd)
  2797. if (this.createTemp.orderNumber == '' || this.createTemp.orderNumber == null || this.createTemp.orderNumber == undefined) {
  2798. GetDataByName(this.getParmCreateNumber).then(response => {
  2799. this.$nextTick(() => {
  2800. console.log('新增申购单号', response.data.list[0].orderCode)
  2801. this.createTemp.orderNumber = response.data.list[0].orderCode
  2802. this.$forceUpdate()
  2803. this.special_dialog_saveSave()
  2804. })
  2805. })
  2806. } else {
  2807. this.special_dialog_saveSave()
  2808. }
  2809. }
  2810. })
  2811. },
  2812. special_dialog_saveSave(){
  2813. if (this.listAdd.length !== 0) {
  2814. for (var j = 0; j < this.listAdd.length; j++) {
  2815. console.log(this.listAdd[j].amount)
  2816. if (this.listAdd[j].amount == null || this.listAdd[j].amount === '') {
  2817. this.$message({ type: 'warning', message: '请检查申购数量是否未填写', duration: 2000 })
  2818. return false
  2819. } else {
  2820. var rulesAmount = /^[1-9]\d*$/
  2821. if (!rulesAmount.test(this.listAdd[j].amount)) {
  2822. this.$message({ type: 'error', message: '申购数量请输入正整数', duration: 2000 })
  2823. return false
  2824. }
  2825. }
  2826. if(this.createTemp.purchaseType == '2'){
  2827. if (this.createTemp.providerId !== '') {
  2828. if (this.listAdd[j].price == '') {
  2829. this.$message({ type: 'warning', message: '请检查单价是否为空', duration: 2000 })
  2830. return false
  2831. } else {
  2832. if (parseFloat(this.listAdd[j].price) == 0) {
  2833. this.$message({ type: 'warning', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
  2834. return false
  2835. } else {
  2836. // var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,2})?$/
  2837. var rulesPrice = /(^[1-9](\d+)?(\.\d{1,5})?$)|(^\d\.\d{1,5}$)/
  2838. if (rulesPrice.test(this.listAdd[j].price) == false) {
  2839. this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
  2840. return false
  2841. }
  2842. }
  2843. }
  2844. }
  2845. }
  2846. }
  2847. if(this.createTemp.purchaseType == '1' || this.createTemp.purchaseType == '3' ){
  2848. if(this.createTemp.providerId == ''){
  2849. this.$message({ type: 'error', message: '请选择供应商', duration: 2000 })
  2850. return false
  2851. }
  2852. }else{
  2853. // if(this.createTemp.providerId == ''){
  2854. // this.$message({ type: 'error', message: '请选择供应商', duration: 2000 })
  2855. // return false
  2856. // }
  2857. if(this.createTemp.funderId == ''){
  2858. this.$message({ type: 'error', message: '请选择垫付人', duration: 2000 })
  2859. return false
  2860. }
  2861. }
  2862. if(this.createTemp.purchaseType == 1){
  2863. if(this.createTemp.markBackend){
  2864. console.log('有数据-走新保存')
  2865. let url = 'authdata/partpurchase/edit'
  2866. let dataArr = []
  2867. for(let i =0 ;i<this.listAdd.length;i++){
  2868. let obj = {
  2869. "id": parseFloat(this.listAdd[i].id),
  2870. "bigId": parseFloat(this.createTemp.bigId),
  2871. "pastureId": parseFloat(this.listAdd[i].pastureId),
  2872. "partId": parseFloat(this.listAdd[i].partId),
  2873. "partCode": this.listAdd[i].partCode.toString(),
  2874. "partName": this.listAdd[i].partName.toString(),
  2875. "specification": this.listAdd[i].specification,
  2876. "amount": parseFloat(this.listAdd[i].amount),
  2877. "unit": this.listAdd[i].unit.toString(),
  2878. "brandId": parseFloat(this.listAdd[i].brandId),
  2879. "purpose": this.listAdd[i].purpose.toString(),
  2880. "price": this.listAdd[i].price.toString(),
  2881. "contractId": this.listAdd[i].contractId.toString(),
  2882. "lifeCycle": this.listAdd[i].lifeCycle.toString(),
  2883. "contractVarianceItem": this.listAdd[i].contractVarianceItem.toString(),
  2884. "departmentId": this.createTemp.departmentId.toString(),
  2885. "date": this.createTemp.createTime.toString(),
  2886. "employeId": parseFloat(this.createTemp.employeId)
  2887. }
  2888. if(this.listAdd[i].storageAmount){
  2889. obj.storageAmount = parseFloat(this.listAdd[i].storageAmount)
  2890. }else{
  2891. obj.storageAmount = 0
  2892. }
  2893. if(this.listAdd[i].reject){
  2894. obj.reject = this.listAdd[i].reject.toString()
  2895. }else{
  2896. obj.reject = ''
  2897. }
  2898. if(this.listAdd[i].explain){
  2899. obj.explain = this.listAdd[i].explain.toString()
  2900. }else{
  2901. obj.explain = ''
  2902. }
  2903. dataArr.push(obj)
  2904. }
  2905. let data = dataArr
  2906. postJson(url, data).then(response => {
  2907. if (response.msg !== 'fail') {
  2908. this.get_table_data()
  2909. this.dialogFormVisible = false
  2910. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  2911. } else {
  2912. failproccess(response, this.$notify)
  2913. }
  2914. })
  2915. }else{
  2916. console.log('无数据-走原有保存')
  2917. this.special_saveSave()
  2918. }
  2919. }else{
  2920. console.log('赠品-走原有保存')
  2921. this.special_saveSave()
  2922. }
  2923. } else {
  2924. this.$message({
  2925. title: '',
  2926. message: '请选择备件',
  2927. type: 'warning',
  2928. duration: 2000
  2929. })
  2930. return false
  2931. }
  2932. },
  2933. special_saveSave(){
  2934. let url = 'authdata/spare/parts/requisitions'
  2935. for(let i=0;i<this.listAdd.length;i++){
  2936. this.$set(this.listAdd[i],'contractId',String(this.listAdd[i].contractId))
  2937. this.$set(this.listAdd[i],'departmentId',this.createTemp.departmentId)
  2938. this.$set(this.listAdd[i],'date',this.createTemp.createTime)
  2939. this.$set(this.listAdd[i],'employeId',this.createTemp.employeId)
  2940. }
  2941. let data = {
  2942. "pastureId": parseInt(this.createTemp.pastureId),
  2943. "departmentId": parseInt(this.createTemp.departmentId),
  2944. 'departmentName':this.createTemp.departmentName,
  2945. "orderNumber": this.createTemp.orderNumber,
  2946. "createTime": this.createTemp.createTime,
  2947. "employeId": this.createTemp.employeId,
  2948. "providerName": this.createTemp.providerName,
  2949. "purchaseType": parseInt(this.createTemp.purchaseType),
  2950. "spot_list":this.listAdd
  2951. }
  2952. if(this.createTemp.purchaseType == '1' || this.createTemp.purchaseType == '3'){
  2953. data.providerId = this.createTemp.providerId
  2954. data.providerName = this.providerList.find(obj => obj.id == this.createTemp.providerId).providerName
  2955. }
  2956. if(this.createTemp.funderId){
  2957. data.funderId = this.createTemp.funderId
  2958. }
  2959. postJson(url, data).then(response => {
  2960. if (response.msg !== 'fail') {
  2961. this.get_table_data()
  2962. this.dialogFormVisible = false
  2963. this.$notify({ title: '成功', message: '保存成功', type: 'success', duration: 2000 })
  2964. } else {
  2965. failproccess(response, this.$notify)
  2966. }
  2967. })
  2968. return true
  2969. },
  2970. // 合单
  2971. form_edit1(row){
  2972. this.modifyTemp = Object.assign({}, row) // copy obj
  2973. this.dialogStatus = 'update'
  2974. this.dialogFormVisible_modify = true
  2975. this.modifylist = []
  2976. this.getdataListSee.parammaps.id = row.id
  2977. this.getSeeList()
  2978. },
  2979. partReject(row){
  2980. // 驳回
  2981. this.$prompt('请输入驳回原因:', '驳回', {
  2982. confirmButtonText: '确定',
  2983. cancelButtonText: '取消',
  2984. inputValidator:value =>{
  2985. if(value === 'null' || value === null || value === 'undefined' || value === undefined || value === ''){
  2986. return false
  2987. }
  2988. },
  2989. // inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/,
  2990. inputErrorMessage: '请输入驳回原因'
  2991. }).then(({ value }) => {
  2992. let data = {
  2993. name:'editPartpurchaseReject',
  2994. parammaps:{
  2995. reject:1,
  2996. explain:value,
  2997. id:row.id
  2998. }
  2999. }
  3000. PostDataByName(data).then(response => {
  3001. console.log('审核确认发送参数', this.requestParam)
  3002. this.isokDisable = false
  3003. if (response.msg !== 'fail') {
  3004. this.get_table_data()
  3005. this.dialogFormVisible_Examine = false
  3006. this.dialogFormVisible_See = false
  3007. this.statueReason = false
  3008. this.$notify({
  3009. title: '成功',
  3010. message: '驳回成功',
  3011. type: 'success',
  3012. duration: 2000
  3013. })
  3014. this.getdataListSee.parammaps.id = this.modifyTemp.id
  3015. this.getSeeList()
  3016. } else {
  3017. failproccess(response, this.$notify)
  3018. }
  3019. })
  3020. }).catch(() => {
  3021. this.$message({
  3022. type: 'info',
  3023. message: '取消输入'
  3024. });
  3025. });
  3026. },
  3027. form_modify(){
  3028. // 提交
  3029. },
  3030. handle_milkSubscription(){
  3031. // 奶厅申购
  3032. this.textMap.create = '奶厅申购'
  3033. this.dialogStatus = 'create'
  3034. this.isMilk = true
  3035. this.seepart.getdataListParm.parammaps.partName = ''
  3036. this.resetCreateTemp()
  3037. this.edit = 1
  3038. this.getDepartParam.parammaps.pastureId = this.createTemp.pastureId
  3039. this.getCreateDepartDownList()
  3040. this.dialogStatus = 'create'
  3041. this.dialogFormVisible = true
  3042. this.dialogFormVisible_seepart = false
  3043. this.$nextTick(() => {
  3044. this.$refs['createTemp'].clearValidate()
  3045. })
  3046. }
  3047. }
  3048. }
  3049. </script>
  3050. <style lang="scss" scoped>
  3051. .pagination-container{
  3052. display: block !important;
  3053. }
  3054. /deep/ .el-badge__content.is-fixed{
  3055. z-index: 1;
  3056. }
  3057. </style>
  3058. <style lang="scss">
  3059. .el-step__head.is-success {
  3060. color: #409EFF;
  3061. border-color: #409EFF;
  3062. }
  3063. .el-step__title.is-success{
  3064. color: #409EFF;
  3065. }
  3066. .el-step__head.is-process{
  3067. color: #409EFF;
  3068. border-color: #409EFF;
  3069. .el-step__icon.is-text{
  3070. background: #409EFF;
  3071. color: #fff;
  3072. }
  3073. }
  3074. .step-row{
  3075. color: #000;
  3076. }
  3077. </style>