index1.vue 71 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617
  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-input v-model="getdataListParm.parammaps.empName" placeholder="申购人" style="width: 200px;" class="filter-item" />
  19. <!-- <el-select v-model="getdataListParm.parammaps.empName " style="width: 140px;" placeholder="申购人" class="filter-item">
  20. <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
  21. </el-select> -->
  22. <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="结束日期" />
  23. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
  24. <div>
  25. <el-button v-if="isSubscribeAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
  26. <el-button v-if="isSubscribeExport" v-waves class="filter-item" type="success" icon="el-icon-upload2" @click="handleDownload">导出</el-button>
  27. <el-radio-group v-model="radioAll" style="margin-top:-9px" @change="changeAll()">
  28. <el-radio-button label="全部" />
  29. <el-badge :value="pending.total" class="item">
  30. <el-radio-button label="待处理" />
  31. </el-badge>
  32. <el-radio-button label="已处理" />
  33. </el-radio-group>
  34. </div>
  35. </div>
  36. <div class="filter-button" />
  37. <el-table
  38. :key="tableKey"
  39. v-loading="listLoading"
  40. element-loading-text="给我一点时间"
  41. :data="list"
  42. border
  43. fit
  44. highlight-current-row
  45. style="width: 100%;"
  46. :row-style="rowStyle"
  47. :cell-style="cellStyle"
  48. class="elTable"
  49. :max-height="myHeight"
  50. >
  51. <el-table-column label="序号" align="center" type="index" width="50px">
  52. <template slot-scope="scope">
  53. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="申购单号" min-width="150px" align="center">
  57. <template slot-scope="scope">
  58. <span>{{ scope.row.orderNumber }}</span>
  59. </template>
  60. </el-table-column>
  61. <el-table-column label="牧场" min-width="90px" align="center">
  62. <template slot-scope="scope">
  63. <span>{{ scope.row.pastureName }}</span>
  64. </template>
  65. </el-table-column>
  66. <el-table-column label="申购部门" min-width="80px" align="center">
  67. <template slot-scope="scope">
  68. <span>{{ scope.row.departmentName }}</span>
  69. </template>
  70. </el-table-column>
  71. <el-table-column label="申购人" min-width="80px" align="center">
  72. <template slot-scope="scope">
  73. <span>{{ scope.row.empname }}</span>
  74. </template>
  75. </el-table-column>
  76. <el-table-column label="申购日期" sortable prop="inputTime" min-width="80px" align="center" />
  77. <el-table-column label="审核状态" min-width="80px" align="center" :formatter="statue" />
  78. <el-table-column label="操作" align="center" width="250" class-name="small-padding fixed-width" fixed="right">
  79. <template slot-scope="{row}">
  80. <el-button v-if="isSubscribeSee" type="primary" size="mini" @click="form_see(row)">查看</el-button>
  81. <el-button v-if="row.statue == 4||row.statue == 6||row.statue == 8" style="display:inline-block" type="success" size="mini" @click="form_edit(row)">编辑</el-button>
  82. <el-button v-else style="display:none" type="success" size="mini" @click="form_edit(row)">编辑</el-button>
  83. <!-- 库管 -->
  84. <el-button v-if="isSubscribeExamineKG && row.statue == 2" style="display:inline-block" type="success" size="mini" @click="handleExamine(row)">审核1</el-button>
  85. <el-button v-else style="display:none" type="success" size="mini" @click="handleExamine(row)">审核1</el-button>
  86. <!-- 主管 -->
  87. <el-button v-if="isSubscribeExamineZG && row.statue == 3" style="display:inline-block" type="success" size="mini" @click="handleExamine2(row)">审核2</el-button>
  88. <el-button v-else style="display:none" type="success" size="mini" @click="handleExamine2(row)">审核2</el-button>
  89. <!-- 采购 -->
  90. <el-button v-if="isSubscribeExamineCG && row.statue == 5" style="display:inline-block" type="success" size="mini" @click="handleExamine3(row)">审核3</el-button>
  91. <el-button v-else style="display:none" type="success" size="mini" @click="handleExamine3(row)">审核3</el-button>
  92. <el-button v-if="isSubscribeDelete && (row.statue == 4||row.statue == 6||row.statue == 8)" style="display:inline-block" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
  93. <el-button v-else style="display:none" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
  94. </template>
  95. </el-table-column>
  96. </el-table>
  97. <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="get_table_data" />
  98. <!-- 弹出层新增or修改 -->
  99. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="90%">
  100. <div class="app-container">
  101. <el-form
  102. ref="createTemp"
  103. :rules="rules"
  104. :model="createTemp"
  105. label-position="right"
  106. label-width="100px"
  107. style="width: 90%;margin:0 auto;"
  108. >
  109. <el-row>
  110. <el-col :span="8">
  111. <el-form-item label="申购单号:" prop="orderNumber">
  112. <el-input ref="orderNumber" v-model="createTemp.orderNumber" disabled />
  113. </el-form-item>
  114. </el-col>
  115. <el-col :span="8">
  116. <el-form-item label="牧场:" prop="pastureId">
  117. <el-select v-model="createTemp.pastureId" placeholder="牧场" class="filter-item" style="width:100%" :disabled="dialogStatus==='update'" @change="changePasture">
  118. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
  119. </el-select>
  120. </el-form-item>
  121. </el-col>
  122. <el-col :span="8">
  123. <el-form-item label="申购部门:" prop="departmentId">
  124. <el-select v-model="createTemp.departmentId" placeholder="申购部门" class="filter-item" style="width:100%" :disabled="dialogStatus==='update'" @change="changeDepart">
  125. <el-option v-for="item in createDepartList" :key="item.id" :label="item.name" :value="item.id" />
  126. </el-select>
  127. </el-form-item>
  128. </el-col>
  129. </el-row>
  130. <el-row>
  131. <el-col :span="8">
  132. <el-form-item label="申购人:" prop="employeId">
  133. <el-select v-model="createTemp.employeId" placeholder="申购人" class="filter-item" style="width:100%" :disabled="dialogStatus==='update'">
  134. <el-option v-for="item in findAllEmploye" :key="item.id" :label="item.name" :value="item.id" />
  135. </el-select>
  136. </el-form-item>
  137. </el-col>
  138. <el-col :span="8">
  139. <el-form-item label="申购日期:" prop="createTime">
  140. <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'" />
  141. </el-form-item>
  142. </el-col>
  143. <el-col v-if="dialogStatus==='create'" :span="8">
  144. <el-form-item label="线上采购:" prop="providerId">
  145. <el-select v-model="createTemp.providerId" placeholder="线上采购" clearable class="filter-item" style="width:100%" @change="changeProvider">
  146. <el-option v-for="item in onlineSubscriptionList" :key="item.id" :label="item.providerName" :value="item.id" />
  147. </el-select>
  148. </el-form-item>
  149. </el-col>
  150. <el-col v-if="dialogStatus==='update'" :span="8">
  151. <el-form-item label="线上采购:" prop="providerName">
  152. <el-input ref="providerName" v-model="createTemp.providerName" disabled />
  153. </el-form-item>
  154. </el-col>
  155. </el-row>
  156. <el-row>
  157. <el-col :span="16">
  158. <el-form-item label="备件:" prop="partCode">
  159. <el-autocomplete
  160. v-model="createTemp.partCode"
  161. value-key="name"
  162. class="inline-input"
  163. :fetch-suggestions="sparePartSearch"
  164. placeholder="请输入备件编号或备件名称或备件规格"
  165. style="width:100%"
  166. @select="handleSelectSparePart"
  167. >
  168. <template slot-scope="{ item }">
  169. <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>&nbsp;
  170. | &nbsp;<b>备件名称:</b><span class="addr">{{ item.partName }}</span>&nbsp;
  171. | &nbsp;<b>备件规格:</b><span class="addr">{{ item.specification }}</span>
  172. </template>
  173. </el-autocomplete>
  174. </el-form-item>
  175. </el-col>
  176. </el-row>
  177. </el-form>
  178. <el-table
  179. :key="tableKey"
  180. v-loading="listLoading"
  181. element-loading-text="给我一点时间"
  182. :data="listAdd"
  183. border
  184. fit
  185. highlight-current-row
  186. style="width: 100%;margin-bottom:30px"
  187. :row-style="rowStyle"
  188. :cell-style="cellStyle"
  189. class="elTable"
  190. >
  191. <!-- table表格 -->
  192. <el-table-column label="序号" align="center" type="index" width="50px" />
  193. <el-table-column label="备件编号" prop="partCode" align="center" min-width="90">
  194. <template slot-scope="scope">
  195. <span>{{ scope.row.partCode }}</span>
  196. </template>
  197. </el-table-column>
  198. <el-table-column label="备件名称" prop="partName" align="center" min-width="90">
  199. <template slot-scope="scope">
  200. <span>{{ scope.row.partName }}</span>
  201. </template>
  202. </el-table-column>
  203. <el-table-column label="备件规格" prop="specification" min-width="80px" align="center">
  204. <template slot-scope="scope">
  205. <span>{{ scope.row.specification }}</span>
  206. </template>
  207. </el-table-column>
  208. <el-table-column label="备件图片" prop="picpath" min-width="110px" align="center">
  209. <template slot-scope="scope">
  210. <el-popover placement="right" title="" trigger="hover">
  211. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  212. <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  213. </el-popover>
  214. </template>
  215. </el-table-column>
  216. <el-table-column label="备件品牌" prop="brand" align="center" min-width="60">
  217. <template slot-scope="scope">
  218. <span v-if="dialogStatus==='create'">{{ scope.row.brandName }}</span>
  219. <span v-if="dialogStatus==='update'">{{ scope.row.brandName }}</span>
  220. </template>
  221. </el-table-column>
  222. <el-table-column label="计量单位" prop="unit" align="center" min-width="60">
  223. <template slot-scope="scope">
  224. <span>{{ scope.row.unit }}</span>
  225. </template>
  226. </el-table-column>
  227. <el-table-column label="现有库存" prop="reportery" align="center" min-width="60">
  228. <template slot-scope="scope">
  229. <span>{{ scope.row.reportery }}</span>
  230. </template>
  231. </el-table-column>
  232. <el-table-column label="价格" prop="price" align="center" min-width="60">
  233. <template slot-scope="scope">
  234. <span v-if="createTemp.providerId == ''">{{ scope.row.price }}</span>
  235. <el-form v-else :model="scope.row" :rules="rules">
  236. <el-form-item prop="price">
  237. <el-input v-model="scope.row.price" style="margin-top:15px" />
  238. </el-form-item>
  239. </el-form>
  240. </template>
  241. </el-table-column>
  242. <el-table-column label="申购数量" min-width="120px" align="center" valign="middle">
  243. <template slot-scope="scope">
  244. <el-form :model="scope.row" :rules="rules">
  245. <el-form-item prop="amount">
  246. <el-input v-model="scope.row.amount" style="margin-top:15px" />
  247. </el-form-item>
  248. </el-form>
  249. </template>
  250. </el-table-column>
  251. <el-table-column label="备注" min-width="110px" align="center" valign="middle">
  252. <template slot-scope="scope">
  253. <el-input v-model="scope.row.purpose" />
  254. </template>
  255. </el-table-column>
  256. <el-table-column
  257. label="操作"
  258. align="center"
  259. width="100"
  260. class-name="small-padding fixed-width"
  261. fixed="right"
  262. >
  263. <template slot-scope="{row}">
  264. <a class="del" @click="partDelete(row)">删除</a>
  265. </template>
  266. </el-table-column>
  267. </el-table>
  268. <div slot="footer" class="dialog-footer" style="bottom:10px">
  269. <el-button type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
  270. <el-button @click="dialogFormVisible = false;get_table_data()">取消并关闭</el-button>
  271. </div>
  272. </div>
  273. </el-dialog>
  274. <!-- 查看 -->
  275. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisibleSee" :close-on-click-modal="false" width="90%">
  276. <div class="app-containerSee">
  277. <el-form
  278. ref="seeTemp"
  279. :rules="rules"
  280. :model="seeTemp"
  281. label-position="right"
  282. label-width="100px"
  283. style="width: 90%;margin:0 auto;"
  284. >
  285. <el-row>
  286. <el-col :span="8">
  287. <el-form-item label="申购单号:" prop="orderNumber">
  288. <el-input ref="orderNumber" v-model="seeTemp.orderNumber" disabled />
  289. </el-form-item>
  290. </el-col>
  291. <el-col :span="8">
  292. <el-form-item label="牧场:" prop="pastureId">
  293. <el-select v-model="seeTemp.pastureId" placeholder="牧场" class="filter-item" disabled style="width:100%">
  294. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.id" />
  295. </el-select>
  296. </el-form-item>
  297. </el-col>
  298. <el-col :span="8">
  299. <el-form-item label="申购部门:" prop="departmentName">
  300. <el-input ref="departmentName" v-model="seeTemp.departmentName" disabled />
  301. </el-form-item>
  302. </el-col>
  303. </el-row>
  304. <el-row>
  305. <el-col :span="8">
  306. <el-form-item label="申购人:" prop="empname">
  307. <el-input ref="empname" v-model="seeTemp.empname" disabled />
  308. </el-form-item>
  309. </el-col>
  310. <el-col :span="8">
  311. <el-form-item label="申购日期:" prop="createTime">
  312. <el-date-picker v-model="seeTemp.createTime" :picker-options="pickerOptions" type="date" placeholder="申购日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" disabled />
  313. </el-form-item>
  314. </el-col>
  315. <el-col :span="8">
  316. <el-form-item label="线上采购:" prop="providerName">
  317. <el-input ref="providerName" v-model="seeTemp.providerName" disabled />
  318. </el-form-item>
  319. </el-col>
  320. </el-row>
  321. </el-form>
  322. <el-table
  323. :key="tableKey"
  324. v-loading="listLoadingSee"
  325. element-loading-text="给我一点时间"
  326. :data="listSee"
  327. border
  328. fit
  329. highlight-current-row
  330. style="width: 100%;margin-bottom:30px"
  331. :row-style="rowStyle"
  332. :cell-style="cellStyle"
  333. class="elTable"
  334. @sort-change="tableSort"
  335. >
  336. <el-table-column type="index" label="序号" align="center" width="50px" />
  337. <el-table-column label="备件编号" prop="partCode" align="center" min-width="90">
  338. <template slot-scope="scope">
  339. <span>{{ scope.row.partCode }}</span>
  340. </template>
  341. </el-table-column>
  342. <el-table-column label="备件名称" prop="partName" align="center" min-width="90">
  343. <template slot-scope="scope">
  344. <span>{{ scope.row.partName }}</span>
  345. </template>
  346. </el-table-column>
  347. <el-table-column label="备件规格" prop="specification" min-width="90px" align="center">
  348. <template slot-scope="scope">
  349. <span>{{ scope.row.specification }}</span>
  350. </template>
  351. </el-table-column>
  352. <el-table-column label="备件图片" prop="picpath" min-width="110px" align="center">
  353. <template slot-scope="scope">
  354. <el-popover placement="right" title="" trigger="hover">
  355. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  356. <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  357. </el-popover>
  358. </template>
  359. </el-table-column>
  360. <el-table-column label="备件品牌" prop="brandName" align="center" min-width="60">
  361. <template slot-scope="scope">
  362. <span>{{ scope.row.brandName }}</span>
  363. </template>
  364. </el-table-column>
  365. <el-table-column label="计量单位" prop="unit" align="center" min-width="60">
  366. <template slot-scope="scope">
  367. <span>{{ scope.row.unit }}</span>
  368. </template>
  369. </el-table-column>
  370. <el-table-column label="现有库存" sortable prop="storageAmount" align="center" min-width="60" />
  371. <el-table-column label="价格" sortable prop="price" align="center" min-width="60" />
  372. <el-table-column label="申购数量" sortable prop="amount" align="center" min-width="60" />
  373. <el-table-column label="备注" min-width="110px" align="center">
  374. <template slot-scope="scope">
  375. <span>{{ scope.row.purpose }}</span>
  376. </template>
  377. </el-table-column>
  378. </el-table>
  379. <el-form
  380. ref="seeTemp"
  381. :rules="rules"
  382. :model="seeTemp"
  383. label-position="right"
  384. label-width="100px"
  385. style="width: 90%;margin:0 auto;"
  386. >
  387. <el-row>
  388. <el-col>
  389. <el-form-item label="流程进度" />
  390. <el-steps :active="active" align-center finish-status="success">
  391. <el-step
  392. v-for="(item,index) in activeList"
  393. :key="index"
  394. :title="item.title"
  395. :status="item.status"
  396. >
  397. <template slot="description">
  398. <div class="step-row">
  399. <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
  400. <div>{{ item.reason }}</div>
  401. </div>
  402. </template>
  403. </el-step>
  404. </el-steps>
  405. </el-col>
  406. </el-row>
  407. <el-row>
  408. <el-col>
  409. <el-form-item label="操作:">
  410. <!-- 库管 -->
  411. <el-button v-if="isSubscribeExamineKG && seeTemp.statue == 2" type="success" style="display:inline-block" @click="handleExamine(row)">审核1</el-button>
  412. <el-button v-else type="success" style="display:none" @click="handleExamine(row)">审核1</el-button>
  413. <!-- 主管 -->
  414. <el-button v-if="isSubscribeExamineZG && seeTemp.statue == 3" type="success" style="display:inline-block" @click="handleExamine2(row)">审核2</el-button>
  415. <el-button v-else type="success" style="display:none" @click="handleExamine2(row)">审核2</el-button>
  416. <!-- 采购 -->
  417. <el-button v-if="isSubscribeExamineCG && seeTemp.statue == 5" type="success" style="display:inline-block" @click="handleExamine3(row)">审核3</el-button>
  418. <el-button v-else type="success" style="display:none" @click="handleExamine3(row)">审核3</el-button>
  419. </el-form-item>
  420. </el-col>
  421. </el-row>
  422. </el-form>
  423. <div slot="footer" class="dialog-footer" style="bottom:5px;">
  424. <el-button @click="dialogFormVisibleSee = false">关闭</el-button>
  425. </div>
  426. </div>
  427. </el-dialog>
  428. <!-- 审核 -->
  429. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_Examine" :close-on-click-modal="false" width="30%">
  430. <div class="app-examine">
  431. <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请确认审核结果:</h3>
  432. <el-form ref="examineTemp" :rules="rules" :model="examineTemp" label-position="right" style="width: 50%;margin:0 auto;">
  433. <el-row style="width:88%;height:150px;margin:0 auto;">
  434. <el-col :span="20">
  435. <el-form-item>
  436. <el-radio-group v-model="examineTemp.statue" @change="changeStatue">
  437. <el-radio :label="1" checked>通过</el-radio>
  438. <el-radio :label="2">不通过</el-radio>
  439. </el-radio-group>
  440. </el-form-item>
  441. </el-col>
  442. <el-col v-if="statueReason" :span="20">
  443. <el-input v-model="examineTemp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入不通过原因" />
  444. </el-col>
  445. </el-row>
  446. </el-form>
  447. </div>
  448. <div slot="footer" class="dialog-footer">
  449. <el-button v-if="dialogStatus==='examine'" type="primary" :disabled="isokDisable" @click="createExamineData()">确认</el-button>
  450. <el-button v-if="dialogStatus==='examine2'" type="primary" :disabled="isokDisable" @click="createExamineData2()">确认</el-button>
  451. <el-button v-if="dialogStatus==='examine3'" type="primary" :disabled="isokDisable" @click="createExamineData3()">确认</el-button>
  452. <el-button @click="dialogFormVisible_Examine = false;">关闭</el-button>
  453. </div>
  454. </el-dialog>
  455. </div>
  456. </template>
  457. <script>
  458. // / 引入
  459. import { GetDataByName, GetDataByNames, PostDataByName, ExecDataByConfig, checkButtons, failproccess, GetAccount } from '@/api/common'
  460. import waves from '@/directive/waves' // waves directive
  461. import { parseTime, sortChange, json2excel } from '@/utils/index.js'
  462. // eslint-disable-next-line no-unused-vars
  463. import { validateEMail } from '@/utils/validate.js'
  464. import Pagination from '@/components/Pagination' // secondary package based on el-pagination
  465. import { MessageBox } from 'element-ui'
  466. import Cookies from 'js-cookie'
  467. import { getToken } from '@/utils/auth'
  468. export default {
  469. name: 'Subscribe',
  470. components: { Pagination },
  471. directives: { waves },
  472. data() {
  473. return {
  474. myHeight:document.documentElement.clientHeight - 85- 150,
  475. isSubscribeAdd: [], isSubscribeTemplate: [], isSubscribeImport: [], isSubscribeExport: [], isSubscribeSee: [], isSubscribeDelete: [], isSubscribeExamineKG: [], isSubscribeExamineCG: [], isSubscribeExamineZG: [],
  476. isokDisable: false,
  477. findAllProvider: [],
  478. findAllPasture: [],
  479. findAllDepart: [],
  480. findAllEmploye: [],
  481. onlineSubscriptionList: [], createDepartList: [], edit: 0,
  482. requestParams: [
  483. { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] },
  484. { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
  485. { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
  486. { name: 'getflexProviderList', offset: 0, pagecount: 0, parammaps: {}}
  487. ],
  488. getDepartParam: {
  489. name: 'findAllDepart', offset: 0, pagecount: 0,
  490. parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
  491. },
  492. pickerOptions: {
  493. disabledDate(time) {
  494. return time.getTime() > Date.now()// 当天之前的时间可选
  495. }
  496. },
  497. textMap: {
  498. update: '编辑',
  499. create: '新增',
  500. see: '查看',
  501. examine: '审核1',
  502. examine2: '审核2',
  503. examine3: '审核3'
  504. },
  505. rules: {
  506. equipmentName: [{ required: true, message: '必填', trigger: 'blur' }]
  507. },
  508. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  509. cellStyle: { padding: 0 + 'px' },
  510. statues: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }],
  511. radioAll: '全部',
  512. getdataListParm: {
  513. name: 'getpartpurchaseList',
  514. page: 1,
  515. offset: 1,
  516. pagecount: 10,
  517. returntype: 'Map',
  518. parammaps: {
  519. pastureName: Cookies.get('pasturename'),
  520. empId: Cookies.get('employeid'),
  521. orderNumber: '',
  522. stuteSH: '',
  523. departmentId: '',
  524. inputDatetime: '',
  525. startTime: '',
  526. stopTime: '',
  527. loginId: Cookies.get('employeid'),
  528. menu: 'Subscribe',
  529. logindeptId: Cookies.get('departmentid'),
  530. loginpastureId: Cookies.get('pastureid')
  531. }
  532. },
  533. tableKey: 0,
  534. listLoading: true,
  535. total: 0,
  536. list: [],
  537. dialogStatus: '',
  538. dialogFormVisible: false,
  539. dialogFormVisibleSee: false,
  540. listLoadingSee: true,
  541. listSee: [],
  542. totalSee: 0,
  543. seeTemp: {},
  544. getdataListSee: {
  545. name: 'getpartpurchaseBybig',
  546. returntype: 'Map',
  547. parammaps: {}
  548. },
  549. createTemp: {
  550. pastureId: this.$store.state.user.pastureid,
  551. departmentId: this.$store.state.user.departmentid,
  552. employeId: this.$store.state.user.employeid,
  553. createTime: parseTime(new Date(), '{y}-{m}-{d}'),
  554. providerId: ''
  555. },
  556. requestSparePart: {
  557. name: 'getPartsListSG',
  558. page: 1,
  559. offset: 1,
  560. pagecount: 20,
  561. returntype: 'Map',
  562. parammaps: {
  563. pastureId: Cookies.get('pastureid')
  564. }
  565. },
  566. getParmCreateNumber: {
  567. name: 'autoCreatCode',
  568. page: 0,
  569. offset: 0,
  570. pagecount: 0,
  571. returntype: 'Map',
  572. parammaps: {
  573. pastureId: Cookies.get('pastureid'),
  574. codeType: 'SG'
  575. }
  576. },
  577. getParmCreateAmount: {
  578. name: 'getPartsListSGv2',
  579. page: 0,
  580. offset: 0,
  581. pagecount: 0,
  582. returntype: 'Map',
  583. parammaps: {
  584. pastureId: Cookies.get('pastureid')
  585. }
  586. },
  587. listAdd: [],
  588. postDataPramas: {},
  589. requestParam: {},
  590. dialogFormVisible_Examine: false,
  591. examineTemp: {
  592. statue: 1
  593. },
  594. statueReason: false,
  595. activeList: [],
  596. active: 3,
  597. buttons: [],
  598. downloadParam: {},
  599. isPercentage: false,
  600. percentage: 1,
  601. pending: {
  602. total: 0,
  603. getdataListParm: {
  604. name: 'getpartpurchaseWebListNO', page: 1, offset: 1, getTotal: 'total3', pagecount: 10, returntype: 'Map',
  605. parammaps: {
  606. loginId: Cookies.get('employeid'),
  607. menu: 'Subscribe', logindeptId: Cookies.get('departmentid'), loginpastureId: Cookies.get('pastureid'),
  608. empId: Cookies.get('employeid'), pastureId: Cookies.get('pastureid'), deptId: Cookies.get('departmentid')
  609. }
  610. }
  611. }
  612. }
  613. },
  614. created() {
  615. const that = this
  616. GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
  617. that.buttons = response.data.list
  618. that.get_auto_buttons()
  619. })
  620. this.get_select_list()
  621. this.get_table_data()
  622. this.getPendingList()
  623. },
  624. methods: {
  625. tableSort(column) {
  626. sortChange(column, this.listSee)
  627. },
  628. get_auto_buttons() {
  629. // 新增
  630. const SubscribeAdd = 'customs:subscribe:add'
  631. const isSubscribeAdd = checkButtons(this.$store.state.user.buttons, SubscribeAdd)
  632. this.isSubscribeAdd = isSubscribeAdd
  633. // 模板
  634. // eslint-disable-next-line no-redeclare
  635. const SubscribeTemplate = 'customs:subscribe:template'
  636. const isSubscribeTemplate = checkButtons(this.$store.state.user.buttons, SubscribeTemplate)
  637. this.isSubscribeTemplate = isSubscribeTemplate
  638. // 导入
  639. // eslint-disable-next-line no-redeclare
  640. const SubscribeImport = 'customs:subscribe:import'
  641. const isSubscribeImport = checkButtons(this.$store.state.user.buttons, SubscribeImport)
  642. this.isSubscribeImport = isSubscribeImport
  643. // 导出
  644. // eslint-disable-next-line no-redeclare
  645. const SubscribeExport = 'customs:subscribe:export'
  646. const isSubscribeExport = checkButtons(this.$store.state.user.buttons, SubscribeExport)
  647. this.isSubscribeExport = isSubscribeExport
  648. // 查看
  649. // eslint-disable-next-line no-redeclare
  650. const SubscribeSee = 'customs:subscribe:see'
  651. const isSubscribeSee = checkButtons(this.$store.state.user.buttons, SubscribeSee)
  652. this.isSubscribeSee = isSubscribeSee
  653. // 删除
  654. // eslint-disable-next-line no-redeclare
  655. const SubscribeDelete = 'customs:subscribe:delete'
  656. const isSubscribeDelete = checkButtons(this.$store.state.user.buttons, SubscribeDelete)
  657. this.isSubscribeDelete = isSubscribeDelete
  658. // 库管审核
  659. // eslint-disable-next-line no-redeclare
  660. const SubscribeExamineKG = 'customs:subscribe:examineKG'
  661. const isSubscribeExamineKG = checkButtons(this.$store.state.user.buttons, SubscribeExamineKG)
  662. this.isSubscribeExamineKG = isSubscribeExamineKG
  663. // 主管审核
  664. // eslint-disable-next-line no-redeclare
  665. const SubscribeExamineZG = 'customs:subscribe:examineZG'
  666. const isSubscribeExamineZG = checkButtons(this.$store.state.user.buttons, SubscribeExamineZG)
  667. this.isSubscribeExamineZG = isSubscribeExamineZG
  668. // 采购审核
  669. // eslint-disable-next-line no-redeclare
  670. const SubscribeExamineCG = 'customs:subscribe:examineCG'
  671. const isSubscribeExamineCG = checkButtons(this.$store.state.user.buttons, SubscribeExamineCG)
  672. this.isSubscribeExamineCG = isSubscribeExamineCG
  673. },
  674. getPendingList() {
  675. this.pending.getdataListParm.parammaps.pastureName = this.getdataListParm.parammaps.pastureName
  676. this.pending.getdataListParm.parammaps.orderNumber = this.getdataListParm.parammaps.orderNumber
  677. this.pending.getdataListParm.parammaps.stuteSH = this.getdataListParm.parammaps.stuteSH
  678. this.pending.getdataListParm.parammaps.departmentId = this.getdataListParm.parammaps.departmentId
  679. this.pending.getdataListParm.parammaps.inputDatetime = this.getdataListParm.parammaps.inputDatetime
  680. this.pending.getdataListParm.parammaps.loginId = this.getdataListParm.parammaps.loginId
  681. this.pending.getdataListParm.parammaps.menu = this.getdataListParm.parammaps.menu
  682. this.pending.getdataListParm.parammaps.logindeptId = this.getdataListParm.parammaps.logindeptId
  683. this.pending.getdataListParm.parammaps.loginpastureId = this.getdataListParm.parammaps.loginpastureId
  684. this.pending.getdataListParm.parammaps.empId = this.getdataListParm.parammaps.empId
  685. this.pending.getdataListParm.parammaps.pastureId = Cookies.get('pastureid')
  686. this.pending.getdataListParm.parammaps.deptId = Cookies.get('departmentid')
  687. GetDataByName(this.pending.getdataListParm).then(response => {
  688. this.pending.total = response.data.total3
  689. })
  690. },
  691. get_table_data() {
  692. this.listLoading = true
  693. if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
  694. this.getdataListParm.parammaps.startTime = this.$refs['inputDatetime'].value[0]
  695. this.getdataListParm.parammaps.stopTime = this.$refs['inputDatetime'].value[1]
  696. } else {
  697. this.getdataListParm.parammaps.startTime = ''
  698. this.getdataListParm.parammaps.stopTime = ''
  699. }
  700. GetDataByName(this.getdataListParm).then(response => {
  701. if (response.data.list !== null) {
  702. console.log('table数据', response.data.list)
  703. this.list = response.data.list
  704. this.pageNum = response.data.pageNum
  705. this.pageSize = response.data.pageSize
  706. } else {
  707. this.list = []
  708. }
  709. this.total = response.data.total
  710. setTimeout(() => {
  711. this.listLoading = false
  712. }, 100)
  713. })
  714. },
  715. changeAll() {
  716. console.log(this.radioAll)
  717. if (this.radioAll === '全部') {
  718. this.getdataListParm.name = 'getpartpurchaseList'
  719. this.getdataListParm.offset = 1
  720. this.getdataListParm.parammaps = {
  721. pastureName: Cookies.get('pasturename'),
  722. orderNumber: '',
  723. departmentId: '',
  724. inputDatetime: '',
  725. startTime: '',
  726. stopTime: '',
  727. loginId: Cookies.get('employeid'),
  728. menu: 'Subscribe',
  729. logindeptId: Cookies.get('departmentid'),
  730. loginpastureId: Cookies.get('pastureid')
  731. }
  732. this.get_table_data()
  733. } else if (this.radioAll === '待处理') {
  734. this.getdataListParm.name = 'getpartpurchaseWebListNO'
  735. this.getdataListParm.offset = 1
  736. this.getdataListParm.parammaps = {
  737. pastureName: this.getdataListParm.parammaps.pastureName,
  738. orderNumber: this.getdataListParm.parammaps.orderNumber,
  739. stuteSH: this.getdataListParm.parammaps.stuteSH,
  740. departmentId: this.getdataListParm.parammaps.departmentId,
  741. inputDatetime: this.getdataListParm.parammaps.inputDatetime,
  742. startTime: this.getdataListParm.parammaps.startTime,
  743. stopTime: this.getdataListParm.parammaps.stopTime,
  744. loginId: Cookies.get('employeid'),
  745. menu: 'Subscribe',
  746. logindeptId: Cookies.get('departmentid'),
  747. loginpastureId: Cookies.get('pastureid'),
  748. empId: Cookies.get('employeid'),
  749. pastureId: Cookies.get('pastureid'),
  750. deptId: Cookies.get('departmentid')
  751. }
  752. this.get_table_data()
  753. } else if (this.radioAll === '已处理') {
  754. this.getdataListParm.name = 'getpartpurchaseWebList'
  755. this.getdataListParm.offset = 1
  756. this.getdataListParm.parammaps = {
  757. pastureName: this.getdataListParm.parammaps.pastureName,
  758. orderNumber: this.getdataListParm.parammaps.orderNumber,
  759. stuteSH: this.getdataListParm.parammaps.stuteSH,
  760. departmentId: this.getdataListParm.parammaps.departmentId,
  761. inputDatetime: this.getdataListParm.parammaps.inputDatetime,
  762. startTime: this.getdataListParm.parammaps.startTime,
  763. stopTime: this.getdataListParm.parammaps.stopTime,
  764. loginId: Cookies.get('employeid'),
  765. menu: 'Subscribe',
  766. logindeptId: Cookies.get('departmentid'),
  767. loginpastureId: Cookies.get('pastureid'),
  768. empId: Cookies.get('employeid'),
  769. pastureId: Cookies.get('pastureid'),
  770. deptId: Cookies.get('departmentid')
  771. }
  772. this.get_table_data()
  773. }
  774. },
  775. statue: function(cellValue) {
  776. // console.log(cellValue.isZeroStock)
  777. if (cellValue.statue == 2) {
  778. return '审核中'
  779. } else if (cellValue.statue == 3) {
  780. return '审核中'
  781. } else if (cellValue.statue == 4) {
  782. return '未通过'
  783. } else if (cellValue.statue == 5) {
  784. return '审核中'
  785. } else if (cellValue.statue == 6) {
  786. return '未通过'
  787. } else if (cellValue.statue == 7) {
  788. return '已通过'
  789. } else if (cellValue.statue == 8) {
  790. return '未通过'
  791. }
  792. },
  793. form_search() {
  794. console.log('点击了table搜索')
  795. if (this.getdataListParm.parammaps.inputDatetime === null) {
  796. this.getdataListParm.parammaps.inputDatetime = ''
  797. }
  798. this.getdataListParm.offset = 1
  799. this.listLoading = true
  800. this.get_table_data()
  801. this.getPendingList()
  802. },
  803. resetCreateTemp() {
  804. this.createTemp.pastureId = parseInt(Cookies.get('pastureid'))
  805. this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
  806. this.createTemp.employeId = parseInt(Cookies.get('employeid'))
  807. this.createTemp.createTime = parseTime(new Date(), '{y}-{m}-{d}')
  808. this.createTemp.orderNumber = ''
  809. this.createTemp.providerId = ''
  810. this.listAdd = []
  811. },
  812. form_add() {
  813. this.resetCreateTemp()
  814. this.edit = 1
  815. this.getDepartParam.parammaps.pastureId = this.createTemp.pastureId
  816. this.getCreateDepartDownList()
  817. this.dialogStatus = 'create'
  818. this.dialogFormVisible = true
  819. this.$nextTick(() => {
  820. this.$refs['createTemp'].clearValidate()
  821. })
  822. this.getCreateNumber()
  823. },
  824. getCreateNumber() {
  825. GetDataByName(this.getParmCreateNumber).then(response => {
  826. this.$nextTick(() => {
  827. console.log('新增申购单号', response.data.list[0].orderCode)
  828. this.createTemp.orderNumber = response.data.list[0].orderCode
  829. this.$forceUpdate()
  830. })
  831. })
  832. },
  833. // getPartsListSG
  834. changeProvider(item) {
  835. if (item !== '') {
  836. this.createTemp.providerName = this.onlineSubscriptionList.find(obj => obj.id == item).providerName
  837. }
  838. this.listAdd = []
  839. },
  840. sparePartSearch(queryString, cb) {
  841. console.log('备件模糊查询输入值', queryString)
  842. if (this.createTemp.providerId == '') {
  843. this.requestSparePart.name = 'getPartsListSG'
  844. } else {
  845. this.requestSparePart.name = 'getPartsListSGFlex'
  846. this.requestSparePart.parammaps.providerId = this.createTemp.providerId
  847. this.requestSparePart.parammaps.providerName = this.createTemp.providerName
  848. }
  849. this.requestSparePart.parammaps['partCode'] = queryString
  850. GetDataByName(this.requestSparePart).then(response => {
  851. console.log('备件模糊查询搜索data', response.data.list)
  852. if (response.data.list == null) {
  853. cb([])
  854. } else {
  855. cb(response.data.list)
  856. }
  857. })
  858. },
  859. handleSelectSparePart(item) {
  860. console.log('备件模糊查询选中值', item)
  861. console.log('备件模糊查询选中值', item.partId)
  862. console.log(this.listAdd)
  863. if (this.createTemp.providerId == '') {
  864. if (this.listAdd.length > 0) {
  865. // eslint-disable-next-line no-redeclare
  866. if (this.listAdd.find(obj => obj.partId == item.partId)) {
  867. this.$message({ type: 'warning', message: '此备件已存在,请重新选择备件' })
  868. } else {
  869. // this.getParmCreateAmount.parammaps.partCode = item.partCode
  870. // GetDataByName(this.getParmCreateAmount).then(response => {
  871. // this.$nextTick(() => {
  872. // console.log('新增根据编号获取备件库存数量', response.data.list[0].reporteryNum)
  873. // item.reportery = response.data.list[0].reporteryNum
  874. // if (item.srcpath !== null && item.picpath) {
  875. // this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  876. // this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  877. // } else {
  878. // item.srcpath = ''
  879. // item.picpath = ''
  880. // }
  881. // this.listAdd.unshift(item)
  882. // this.$forceUpdate()
  883. // })
  884. // })
  885. this.getParmCreateAmount.parammaps.partCode = item.partCode
  886. GetDataByName(this.getParmCreateAmount).then(response => {
  887. this.$nextTick(() => {
  888. console.log('新增根据编号获取备件库存数量', response.data.list[0])
  889. item = response.data.list[0]
  890. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  891. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  892. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  893. } else {
  894. item.srcpath = ''
  895. item.picpath = ''
  896. }
  897. this.$set(item, 'amount', '')
  898. this.$set(item, 'purpose', '')
  899. this.listAdd.unshift(item)
  900. this.$forceUpdate()
  901. })
  902. })
  903. }
  904. } else {
  905. // this.getParmCreateAmount.parammaps.partCode = item.partCode
  906. // GetDataByName(this.getParmCreateAmount).then(response => {
  907. // this.$nextTick(() => {
  908. // console.log('新增根据编号获取备件库存数量', response.data.list[0].reporteryNum)
  909. // item.reportery = response.data.list[0].reporteryNum
  910. // if (item.srcpath !== null && item.picpath) {
  911. // this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  912. // this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  913. // } else {
  914. // item.srcpath = ''
  915. // item.picpath = ''
  916. // }
  917. // this.listAdd.unshift(item)
  918. // this.$forceUpdate()
  919. // })
  920. // })
  921. this.getParmCreateAmount.parammaps.partCode = item.partCode
  922. GetDataByName(this.getParmCreateAmount).then(response => {
  923. this.$nextTick(() => {
  924. console.log('新增根据编号获取备件库存数量', response.data.list[0])
  925. item = response.data.list[0]
  926. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  927. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  928. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  929. } else {
  930. item.srcpath = ''
  931. item.picpath = ''
  932. }
  933. this.$set(item, 'amount', '')
  934. this.$set(item, 'purpose', '')
  935. this.listAdd.unshift(item)
  936. this.$forceUpdate()
  937. })
  938. })
  939. }
  940. this.$forceUpdate()
  941. } else {
  942. if (this.listAdd.length > 0) {
  943. if (this.listAdd.find(obj => obj.partId == item.partId)) {
  944. this.$message({ type: 'warning', message: '此备件已存在,请重新选择备件' })
  945. } else {
  946. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  947. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  948. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  949. } else {
  950. item.srcpath = ''
  951. item.picpath = ''
  952. }
  953. this.$set(item, 'amount', '')
  954. this.$set(item, 'purpose', '')
  955. this.listAdd.unshift(item)
  956. }
  957. } else {
  958. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  959. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  960. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  961. } else {
  962. item.srcpath = ''
  963. item.picpath = ''
  964. }
  965. this.$set(item, 'amount', '')
  966. this.$set(item, 'purpose', '')
  967. this.listAdd.unshift(item)
  968. this.$forceUpdate()
  969. }
  970. this.$forceUpdate()
  971. }
  972. },
  973. add_dialog_save() {
  974. this.isokDisable = true
  975. setTimeout(() => {
  976. this.isokDisable = false
  977. }, 1000)
  978. this.$refs['createTemp'].validate(valid => {
  979. if (valid) {
  980. console.log(this.listAdd)
  981. if (this.createTemp.orderNumber == '' || this.createTemp.orderNumber == null || this.createTemp.orderNumber == undefined) {
  982. GetDataByName(this.getParmCreateNumber).then(response => {
  983. this.$nextTick(() => {
  984. console.log('新增申购单号', response.data.list[0].orderCode)
  985. this.createTemp.orderNumber = response.data.list[0].orderCode
  986. this.$forceUpdate()
  987. this.add_dialog_saveSave()
  988. })
  989. })
  990. } else {
  991. this.add_dialog_saveSave()
  992. }
  993. }
  994. })
  995. },
  996. add_dialog_saveSave() {
  997. if (this.listAdd.length !== 0) {
  998. for (var j = 0; j < this.listAdd.length; j++) {
  999. console.log(this.listAdd[j].amount)
  1000. if (this.listAdd[j].amount == null || this.listAdd[j].amount === '') {
  1001. this.$message({ type: 'warning', message: '请检查申购数量是否未填写', duration: 2000 })
  1002. return false
  1003. } else {
  1004. var rulesAmount = /^[1-9]\d*$/
  1005. if (!rulesAmount.test(this.listAdd[j].amount)) {
  1006. this.$message({ type: 'error', message: '申购数量请输入正整数', duration: 2000 })
  1007. return false
  1008. }
  1009. }
  1010. if (this.createTemp.providerId !== '') {
  1011. if (this.listAdd[j].price == '') {
  1012. this.$message({ type: 'warning', message: '请检查单价是否为空', duration: 2000 })
  1013. return false
  1014. } else {
  1015. if (parseFloat(this.listAdd[j].price) == 0) {
  1016. this.$message({ type: 'warning', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
  1017. return false
  1018. } else {
  1019. var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,5})?$/
  1020. if (rulesPrice.test(this.listAdd[j].price) == false) {
  1021. this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
  1022. return false
  1023. }
  1024. }
  1025. }
  1026. }
  1027. }
  1028. this.postDataPramas.common = { 'returnmap': '0' }
  1029. this.postDataPramas.data = []
  1030. this.postDataPramas.data[0] = { 'name': 'insertBigPartpurchase', 'type': 'e', 'parammaps': {
  1031. pastureId: this.createTemp.pastureId,
  1032. departmentId: this.createTemp.departmentId,
  1033. orderNumber: this.createTemp.orderNumber,
  1034. useType: this.createTemp.useType,
  1035. createTime: this.createTemp.createTime,
  1036. employeId: this.createTemp.employeId,
  1037. providerId: this.createTemp.providerId
  1038. }}
  1039. // eslint-disable-next-line no-irregular-whitespace
  1040. this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  1041. this.postDataPramas.data[1].children = []
  1042. this.postDataPramas.data[1].children[0] = { 'name': 'insertPartpurchase', 'type': 'e', 'parammaps': {
  1043. bigId: '@insertBigPartpurchase.LastInsertId',
  1044. pastureId: '@insertSpotList.pastureId',
  1045. partId: '@insertSpotList.partId',
  1046. partCode: '@insertSpotList.partCode',
  1047. partName: '@insertSpotList.partName',
  1048. specification: '@insertSpotList.specification',
  1049. unit: '@insertSpotList.unit',
  1050. brandId: '@insertSpotList.brandId',
  1051. storageAmount: '@insertSpotList.reportery',
  1052. purpose: '@insertSpotList.purpose',
  1053. amount: '@insertSpotList.amount',
  1054. price: '@insertSpotList.price',
  1055. contractId: '@insertSpotList.contractId'
  1056. }}
  1057. ExecDataByConfig(this.postDataPramas).then(response => {
  1058. console.log('新增保存发送参数', this.postDataPramas)
  1059. if (response.msg === 'fail') {
  1060. this.$notify({
  1061. title: '保存失败',
  1062. message: response.data,
  1063. type: 'warning',
  1064. duration: 2000
  1065. })
  1066. } else {
  1067. this.dialogFormVisible = false
  1068. this.getdataListParm.parammaps.inputDatetime = ''
  1069. this.get_table_data()
  1070. this.getPendingList()
  1071. this.$notify({
  1072. title: '',
  1073. message: '保存成功',
  1074. type: 'success',
  1075. duration: 2000
  1076. })
  1077. }
  1078. })
  1079. return true
  1080. } else {
  1081. this.$message({
  1082. title: '',
  1083. message: '请选择备件',
  1084. type: 'warning',
  1085. duration: 2000
  1086. })
  1087. return false
  1088. }
  1089. },
  1090. partDelete(row) {
  1091. console.log(this.listAdd)
  1092. MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
  1093. confirmButtonText: '确认',
  1094. cancelButtonText: '取消',
  1095. type: 'warning'
  1096. }).then(() => {
  1097. // console.log(this.list2)
  1098. for (var i = 0; i < this.listAdd.length; i++) {
  1099. console.log(this.listAdd[i])
  1100. if (this.listAdd[i].id === row.id) {
  1101. var listAddIndex = this.listAdd.indexOf(this.listAdd[i])
  1102. }
  1103. if (listAddIndex > -1) {
  1104. this.listAdd.splice(listAddIndex, 1)
  1105. return
  1106. }
  1107. }
  1108. })
  1109. },
  1110. // 查看
  1111. form_see(row) {
  1112. this.dialogStatus = 'see'
  1113. this.dialogFormVisibleSee = true
  1114. this.seeTemp = Object.assign({}, row)
  1115. console.log('查看上方数据(从table读取)', this.seeTemp)
  1116. this.listSee = []
  1117. this.getdataListSee.parammaps.id = this.seeTemp.id
  1118. this.getSeeList()
  1119. // 流程图
  1120. var reason = '未通过原因:' + this.seeTemp.workflowNote
  1121. if (this.seeTemp.statue === 2) {
  1122. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核' }, { title: '供应主管审核' }, { title: '采购审核' }]
  1123. this.active = 1
  1124. } else if (this.seeTemp.statue === 3) {
  1125. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '供应主管审核' }, { title: '采购审核' }]
  1126. this.active = 2
  1127. } else if (this.seeTemp.statue === 4) {
  1128. 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: '采购审核' }]
  1129. this.active = 2
  1130. } else if (this.seeTemp.statue === 5) {
  1131. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '采购审核' }]
  1132. this.active = 3
  1133. } else if (this.seeTemp.statue === 6) {
  1134. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson, status: 'error', reason: reason }, { title: '采购审核' }]
  1135. this.active = 3
  1136. } else if (this.seeTemp.statue === 7) {
  1137. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '采购审核', date: this.seeTemp.CGChargedate, name: this.seeTemp.CGChargePerson }]
  1138. this.active = 4
  1139. } else if (this.seeTemp.statue === 8) {
  1140. this.activeList = [{ title: '备件申购', date: this.seeTemp.inputTime, name: this.seeTemp.empname }, { title: '库管审核', date: this.seeTemp.KGChargedate, name: this.seeTemp.KGChargePerson }, { title: '供应主管审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '采购审核', date: this.seeTemp.CGChargedate, name: this.seeTemp.CGChargePerson, status: 'error', reason: reason }]
  1141. this.active = 4
  1142. }
  1143. },
  1144. getSeeList() {
  1145. GetDataByName(this.getdataListSee).then(response => {
  1146. if (response.data.list !== null) {
  1147. console.log('查看下方table数据', response.data.list)
  1148. this.listSee = response.data.list
  1149. this.listAdd = response.data.list
  1150. for (let i = 0; i < response.data.list.length; i++) {
  1151. 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) {
  1152. console.log(process.env.VUE_APP_BASE_API + response.data.list[i].srcpath, '=======1')
  1153. this.listSee[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  1154. this.listSee[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  1155. this.listAdd[i].srcpath = this.listSee[i].srcpath
  1156. this.listAdd[i].picpath = this.listSee[i].picpath
  1157. // this.seeTemp.providerName = response.data.list.providerName
  1158. this.pageNumSee = response.data.pageNum
  1159. this.pageSizeSee = response.data.pageSize
  1160. } else {
  1161. this.listSee[i].srcpath = ''
  1162. this.listSee[i].picpath = ''
  1163. this.listAdd[i].srcpath = ''
  1164. this.listAdd[i].picpath = ''
  1165. }
  1166. console.log(process.env.VUE_APP_BASE_API)
  1167. console.log(this.listSee, '============')
  1168. }
  1169. }
  1170. if (response.data.total) {
  1171. this.totalSee = response.data.total
  1172. }
  1173. setTimeout(() => {
  1174. this.listLoadingSee = false
  1175. }, 100)
  1176. })
  1177. },
  1178. form_edit(row) {
  1179. this.edit = 0
  1180. this.getDepartParam.parammaps.pastureId = row.pastureId
  1181. this.getCreateDepartDownList()
  1182. if (row.providerId == undefined) {
  1183. row.providerId = ''
  1184. row.providerName = ''
  1185. }
  1186. this.createTemp = Object.assign({}, row) // copy obj
  1187. this.dialogStatus = 'update'
  1188. this.dialogFormVisible = true
  1189. this.$nextTick(() => {
  1190. this.$refs['createTemp'].clearValidate()
  1191. })
  1192. this.getdataListSee.parammaps.id = this.createTemp.id
  1193. this.getSeeList()
  1194. },
  1195. edit_dialog_save() {
  1196. this.isokDisable = true
  1197. setTimeout(() => {
  1198. this.isokDisable = false
  1199. }, 1000)
  1200. this.$refs['createTemp'].validate(valid => {
  1201. if (valid) {
  1202. this.edit_dialog_saveSave()
  1203. }
  1204. })
  1205. },
  1206. edit_dialog_saveSave() {
  1207. if (this.listAdd.length !== 0) {
  1208. for (var j = 0; j < this.listAdd.length; j++) {
  1209. console.log(this.listAdd[j].amount)
  1210. // eslint-disable-next-line use-isnan
  1211. if (this.listAdd[j].amount == null || this.listAdd[j].amount === '') {
  1212. this.$message({ type: 'warning', message: '请检查申购数量是否未填写', duration: 2000 })
  1213. return false
  1214. } else {
  1215. var rulesAmount = /^[1-9]\d*$/
  1216. if (!rulesAmount.test(this.listAdd[j].amount)) {
  1217. this.$message({ type: 'error', message: '申购数量请输入正整数', duration: 2000 })
  1218. return false
  1219. }
  1220. }
  1221. if (this.createTemp.providerId !== '') {
  1222. if (this.listAdd[j].price == '') {
  1223. this.$message({ type: 'warning', message: '请检查单价是否为空', duration: 2000 })
  1224. return false
  1225. } else {
  1226. if (parseFloat(this.listAdd[j].price) == 0) {
  1227. this.$message({ type: 'warning', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
  1228. return false
  1229. } else {
  1230. var rulesPrice = /^(([1-9]{1}\d*)|(0{1}))(\.\d{1,5})?$/
  1231. if (rulesPrice.test(this.listAdd[j].price) == false) {
  1232. this.$message({ type: 'error', message: '价格请输入正数,最多保留小数点后五位', duration: 2000 })
  1233. return false
  1234. }
  1235. }
  1236. }
  1237. }
  1238. }
  1239. this.postDataPramas.common = { 'returnmap': '0' }
  1240. this.postDataPramas.data = []
  1241. this.postDataPramas.data[0] = { 'name': 'updatepartpurchaseCharge', 'type': 'e', 'parammaps': {
  1242. id: this.createTemp.id
  1243. }}
  1244. this.postDataPramas.data[1] = { 'name': 'deletePartpurchase', 'type': 'e', 'parammaps': {
  1245. bigId: this.createTemp.id
  1246. }}
  1247. // eslint-disable-next-line no-irregular-whitespace
  1248. this.postDataPramas.data[2] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  1249. this.postDataPramas.data[2].children = []
  1250. this.postDataPramas.data[2].children[0] = { 'name': 'insertPartpurchase', 'type': 'e', 'parammaps': {
  1251. bigId: this.createTemp.id,
  1252. pastureId: '@insertSpotList.pastureId',
  1253. partId: '@insertSpotList.partId',
  1254. partCode: '@insertSpotList.partCode',
  1255. partName: '@insertSpotList.partName',
  1256. specification: '@insertSpotList.specification',
  1257. unit: '@insertSpotList.unit',
  1258. brandId: '@insertSpotList.brandId',
  1259. storageAmount: '@insertSpotList.reportery',
  1260. purpose: '@insertSpotList.purpose',
  1261. amount: '@insertSpotList.amount',
  1262. price: '@insertSpotList.price',
  1263. contractId: '@insertSpotList.contractId'
  1264. }}
  1265. ExecDataByConfig(this.postDataPramas).then(response => {
  1266. console.log('新增保存发送参数', this.postDataPramas)
  1267. if (response.msg === 'fail') {
  1268. this.$notify({
  1269. title: '保存失败',
  1270. message: response.data,
  1271. type: 'warning',
  1272. duration: 2000
  1273. })
  1274. } else {
  1275. this.dialogFormVisible = false
  1276. this.getdataListParm.parammaps.inputDatetime = ''
  1277. this.get_table_data()
  1278. this.$notify({
  1279. title: '',
  1280. message: '保存成功',
  1281. type: 'success',
  1282. duration: 2000
  1283. })
  1284. }
  1285. })
  1286. return true
  1287. } else {
  1288. this.$message({
  1289. title: '',
  1290. message: '请选择备件',
  1291. type: 'warning',
  1292. duration: 2000
  1293. })
  1294. return false
  1295. }
  1296. },
  1297. get_select_list() {
  1298. GetDataByNames(this.requestParams).then(response => {
  1299. this.findAllProvider = response.data.findAllProvider.list
  1300. this.findAllPasture = response.data.findAllPasture.list
  1301. this.findAllEmploye = response.data.findAllEmploye.list
  1302. this.onlineSubscriptionList = response.data.getflexProviderList.list
  1303. this.getDepartDownList()
  1304. })
  1305. },
  1306. getDepartDownList() {
  1307. GetDataByName(this.getDepartParam).then(response => {
  1308. this.findAllDepart = response.data.list
  1309. })
  1310. },
  1311. changePastureName(item) {
  1312. this.getDepartParam.parammaps.pastureId = this.findAllPasture.find(obj => obj.name == item).id
  1313. this.getdataListParm.parammaps.departmentId = ''
  1314. this.getDepartDownList()
  1315. },
  1316. getCreateDepartDownList() {
  1317. GetDataByName(this.getDepartParam).then(response => {
  1318. this.createDepartList = response.data.list
  1319. if (this.edit == 1) {
  1320. if (this.createDepartList.find(obj => obj.id == Cookies.get('departmentid'))) {
  1321. this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
  1322. this.createTemp.departmentName = this.createDepartList.find(obj => obj.id == Cookies.get('departmentid')).name
  1323. } else {
  1324. this.createTemp.departmentId = response.data.list[0].id
  1325. this.createTemp.departmentName = response.data.list[0].name
  1326. }
  1327. }
  1328. })
  1329. },
  1330. changePasture(item) {
  1331. this.getDepartParam.parammaps.pastureId = item
  1332. this.edit = 1
  1333. this.getCreateDepartDownList()
  1334. },
  1335. changeDepart(item) {
  1336. this.createTemp.departmentName = this.createDepartList.find(obj => obj.id == item).name
  1337. },
  1338. handleDownload() {
  1339. console.log('点击了下载')
  1340. this.$alert('备件申购正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  1341. this.isPercentage = true
  1342. this.percentage = 1
  1343. var timer = setInterval(() => {
  1344. this.percentage += 5
  1345. if (this.percentage > 95) {
  1346. this.percentage = 99
  1347. clearInterval(timer)
  1348. }
  1349. this.percentage = this.percentage
  1350. }, 1000)
  1351. this.downloadParam.name = 'downloadPartpurchaseList'
  1352. this.downloadParam.parammaps = this.getdataListParm.parammaps
  1353. GetAccount(this.downloadParam).then(response => {
  1354. if (response.data.list !== '') {
  1355. this.percentage = 99
  1356. setTimeout(() => {
  1357. this.isPercentage = false
  1358. }, 2000)
  1359. }
  1360. this.$nextTick(() => {
  1361. const ExcelDatas = [
  1362. {
  1363. tHeader: ['牧场', '申购单号', '申购时间', '备件编号', '备件名称', '规格型号', '品牌', '单位', '申购数量', '申购部门', '申购人', '备注'],
  1364. filterVal: ['pastureName', 'orderNumber', 'inputTime', 'partCode', 'partName', 'specification', 'brandName', 'unit', 'amount', 'departmentName', 'empname', 'purpose'],
  1365. tableDatas: response.data.list,
  1366. sheetName: '备件申购'
  1367. }
  1368. ]
  1369. json2excel(ExcelDatas, '备件申购', true, 'xlsx')
  1370. })
  1371. })
  1372. },
  1373. form_delete(row) {
  1374. console.log('点击了删除')
  1375. MessageBox.confirm('确认删除此条信息?', {
  1376. confirmButtonText: '确认',
  1377. cancelButtonText: '取消',
  1378. type: 'warning'
  1379. }).then(() => {
  1380. this.postDataPramas.common = { 'returnmap': '0' }
  1381. this.postDataPramas.data = []
  1382. this.postDataPramas.data[0] = { 'name': 'deleteBigPartpurchase', 'type': 'e', 'parammaps': {
  1383. id: row.id
  1384. }}
  1385. this.postDataPramas.data[1] = { 'name': 'deletePartpurchase', 'type': 'e', 'parammaps': {
  1386. bigId: row.id
  1387. }}
  1388. ExecDataByConfig(this.postDataPramas).then(response => {
  1389. this.get_table_data()
  1390. this.$notify({
  1391. title: '成功',
  1392. message: '删除成功',
  1393. type: 'success',
  1394. duration: 2000
  1395. })
  1396. })
  1397. }).catch(() => {
  1398. this.$message({
  1399. type: 'info',
  1400. message: '已取消删除'
  1401. })
  1402. })
  1403. },
  1404. handleExamine(row) {
  1405. console.log('点击了库管审核')
  1406. if (row == undefined) {
  1407. this.examineTemp = this.seeTemp
  1408. this.$set(this.seeTemp, 'statue', 1)
  1409. this.$set(this.seeTemp, 'workflowNote', '')
  1410. } else {
  1411. this.examineTemp = Object.assign({}, row)
  1412. this.$set(this.examineTemp, 'statue', 1)
  1413. this.$set(this.examineTemp, 'workflowNote', '')
  1414. }
  1415. this.dialogStatus = 'examine'
  1416. this.dialogFormVisible_Examine = true
  1417. this.statueReason = false
  1418. },
  1419. changeStatue(val) {
  1420. if (val == 2) {
  1421. this.statueReason = true
  1422. } else {
  1423. this.statueReason = false
  1424. }
  1425. },
  1426. createExamineData() {
  1427. console.log('点击了库管审核')
  1428. this.isokDisable = true
  1429. setTimeout(() => {
  1430. this.isokDisable = false
  1431. }, 1000)
  1432. this.$refs['examineTemp'].validate(valid => {
  1433. if (valid) {
  1434. this.requestParam = {}
  1435. this.requestParam.name = 'partpurchaseCharge'
  1436. this.requestParam.parammaps = {}
  1437. this.requestParam.parammaps.id = this.examineTemp.id
  1438. if (this.examineTemp.statue == 1) {
  1439. this.requestParam.parammaps.statue = 3
  1440. } else if (this.examineTemp.statue == 2) {
  1441. this.requestParam.parammaps.statue = 4
  1442. }
  1443. this.requestParam.parammaps.empId = Cookies.get('employeid')
  1444. this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
  1445. PostDataByName(this.requestParam).then(response => {
  1446. console.log('审核确认发送参数', this.requestParam)
  1447. if (response.msg !== 'fail') {
  1448. this.get_table_data()
  1449. this.dialogFormVisible_Examine = false
  1450. this.dialogFormVisible_See = false
  1451. this.statueReason = false
  1452. this.$notify({
  1453. title: '成功',
  1454. message: '审核成功',
  1455. type: 'success',
  1456. duration: 2000
  1457. })
  1458. } else {
  1459. failproccess(response, this.$notify)
  1460. }
  1461. })
  1462. }
  1463. })
  1464. },
  1465. handleExamine2(row) {
  1466. console.log('点击了供应主管审核')
  1467. if (row == undefined) {
  1468. this.examineTemp = this.seeTemp
  1469. this.$set(this.seeTemp, 'statue', 1)
  1470. this.$set(this.seeTemp, 'workflowNote', '')
  1471. } else {
  1472. this.examineTemp = Object.assign({}, row)
  1473. this.$set(this.examineTemp, 'statue', 1)
  1474. this.$set(this.examineTemp, 'workflowNote', '')
  1475. }
  1476. this.dialogStatus = 'examine2'
  1477. this.dialogFormVisible_Examine = true
  1478. this.statueReason = false
  1479. },
  1480. createExamineData2() {
  1481. console.log('点击了供应主管审核')
  1482. this.isokDisable = true
  1483. setTimeout(() => {
  1484. this.isokDisable = false
  1485. }, 1000)
  1486. this.$refs['examineTemp'].validate(valid => {
  1487. if (valid) {
  1488. this.requestParam = {}
  1489. this.requestParam.name = 'partpurchaseCharge3'
  1490. this.requestParam.parammaps = {}
  1491. this.requestParam.parammaps.id = this.examineTemp.id
  1492. if (this.examineTemp.statue == 1) {
  1493. this.requestParam.parammaps.statue = 5
  1494. } else if (this.examineTemp.statue == 2) {
  1495. this.requestParam.parammaps.statue = 6
  1496. }
  1497. this.requestParam.parammaps.empId = Cookies.get('employeid')
  1498. this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
  1499. PostDataByName(this.requestParam).then(response => {
  1500. console.log('审核确认发送参数', this.requestParam)
  1501. if (response.msg !== 'fail') {
  1502. this.get_table_data()
  1503. this.dialogFormVisible_Examine = false
  1504. this.dialogFormVisible_See = false
  1505. this.statueReason = false
  1506. this.$notify({
  1507. title: '成功',
  1508. message: '审核成功',
  1509. type: 'success',
  1510. duration: 2000
  1511. })
  1512. } else {
  1513. failproccess(response, this.$notify)
  1514. }
  1515. })
  1516. }
  1517. })
  1518. },
  1519. handleExamine3(row) {
  1520. console.log('点击了采购审核')
  1521. if (row == undefined) {
  1522. this.examineTemp = this.seeTemp
  1523. this.$set(this.seeTemp, 'statue', 1)
  1524. this.$set(this.seeTemp, 'workflowNote', '')
  1525. } else {
  1526. this.examineTemp = Object.assign({}, row)
  1527. this.$set(this.examineTemp, 'workflowNote', '')
  1528. this.$set(this.examineTemp, 'statue', 1)
  1529. }
  1530. this.dialogStatus = 'examine3'
  1531. this.dialogFormVisible_Examine = true
  1532. this.statueReason = false
  1533. },
  1534. createExamineData3() {
  1535. console.log('点击了采购审核')
  1536. this.isokDisable = true
  1537. setTimeout(() => {
  1538. this.isokDisable = false
  1539. }, 1000)
  1540. this.$refs['examineTemp'].validate(valid => {
  1541. if (valid) {
  1542. this.requestParam = {}
  1543. this.requestParam.parammaps = {}
  1544. this.requestParam.common = { 'returnmap': '0' }
  1545. this.requestParam.data = []
  1546. if (this.examineTemp.statue == 1) {
  1547. this.requestParam.data[0] = { 'name': 'partpurchaseCharge1', 'type': 'e', 'parammaps': {
  1548. id: this.examineTemp.id,
  1549. statue: 7,
  1550. empId: Cookies.get('employeid'),
  1551. workflowNote: this.examineTemp.workflowNote
  1552. }}
  1553. this.requestParam.data[1] = { 'name': 'createBuydetailBySG', 'type': 'e', 'parammaps': {
  1554. id: this.examineTemp.id,
  1555. pastureId: this.examineTemp.pastureId
  1556. }}
  1557. } else if (this.examineTemp.statue == 2) {
  1558. this.requestParam.data[0] = { 'name': 'partpurchaseCharge1', 'type': 'e', 'parammaps': {
  1559. id: this.examineTemp.id,
  1560. statue: 8,
  1561. empId: Cookies.get('employeid'),
  1562. workflowNote: this.examineTemp.workflowNote
  1563. }}
  1564. }
  1565. ExecDataByConfig(this.requestParam).then(response => {
  1566. if (response.msg !== 'fail') {
  1567. this.get_table_data()
  1568. this.dialogFormVisible_Examine = false
  1569. this.dialogFormVisible_See = false
  1570. this.statueReason = false
  1571. this.$notify({ title: '成功', message: '审核成功', type: 'success', duration: 2000 })
  1572. } else {
  1573. failproccess(response, this.$notify)
  1574. }
  1575. })
  1576. }
  1577. })
  1578. }
  1579. }
  1580. }
  1581. </script>
  1582. <style lang="scss" scoped>
  1583. .pagination-container{
  1584. display: block !important;
  1585. }
  1586. /deep/ .el-badge__content.is-fixed{
  1587. z-index: 1;
  1588. }
  1589. </style>
  1590. <style lang="scss">
  1591. .el-step__head.is-success {
  1592. color: #409EFF;
  1593. border-color: #409EFF;
  1594. }
  1595. .el-step__title.is-success{
  1596. color: #409EFF;
  1597. }
  1598. .el-step__head.is-process{
  1599. color: #409EFF;
  1600. border-color: #409EFF;
  1601. .el-step__icon.is-text{
  1602. background: #409EFF;
  1603. color: #fff;
  1604. }
  1605. }
  1606. .step-row{
  1607. color: #000;
  1608. }
  1609. </style>