index.vue 123 KB

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