tab2.vue 91 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337
  1. <template>
  2. <div class="app-container">
  3. <div class="filter-container">
  4. <el-select v-model="tableObj1.getdataListParm.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item" @change="change_pasture1">
  5. <el-option v-for="item in pastureNameList" :key="item.id" :label="item.name" :value="item.name" />
  6. </el-select>
  7. <el-select v-model="tableObj1.getdataListParm.parammaps.departmentId" clearable style="width: 140px;" placeholder="部门" class="filter-item">
  8. <el-option v-for="item in departNameList1" :key="item.id" :label="item.name" :value="item.id" />
  9. </el-select>
  10. <el-input v-model="tableObj1.getdataListParm.parammaps.acceptanceCode" placeholder="委外验收单号" style="width: 200px;" class="filter-item" />
  11. <el-select v-model="tableObj1.getdataListParm.parammaps.status" style="width: 140px;" clearable placeholder="审核状态" class="filter-item">
  12. <el-option v-for="item in statuesNameList" :key="item.id" :label="item.name" :value="item.id" />
  13. </el-select>
  14. <el-input v-model="tableObj1.getdataListParm.parammaps.outsourcingCode" placeholder="委外申请单号" style="width: 200px;" class="filter-item" />
  15. <el-select v-model="tableObj1.getdataListParm.parammaps.iscontract" style="width: 140px;" clearable placeholder="有无合同" class="filter-item">
  16. <el-option v-for="item in iscontractList" :key="item.id" :label="item.name" :value="item.id" />
  17. </el-select>
  18. <el-date-picker ref="inputDatetime" v-model="tableObj1.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="结束日期" />
  19. <el-button class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
  20. <!-- <el-button v-if="istab2Add" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button> -->
  21. </div>
  22. <div class="elTable">
  23. <el-table :max-height="myHeight" :key="tableObj1.tableKey" v-loading="tableObj1.listLoading" element-loading-text="给我一点时间" :data="tableObj1.list" border fit highlight-current-row style="width: 100%;" :row-style="rowStyle" :cell-style="cellStyle" class="elTable table-fixed" >
  24. <el-table-column label="序号" align="center" type="index" width="50px">
  25. <template slot-scope="scope">
  26. <span>{{ scope.$index + (tableObj1.pageNum-1) * tableObj1.pageSize + 1 }}</span>
  27. </template>
  28. </el-table-column>
  29. <el-table-column label="委外验收单号" min-width="120px" align="center" prop="acceptanceCode" />
  30. <el-table-column label="牧场" min-width="120px" align="center" prop="pastureName" />
  31. <el-table-column label="部门 " min-width="120px" align="center" prop="departmentName" />
  32. <el-table-column label="申请人" min-width="120px" align="center" prop="applicantName" />
  33. <el-table-column label="合同" min-width="120px" align="center" prop="contract">
  34. <template slot-scope="scope">
  35. <span v-if="scope.row.iscontract == 0 ">有</span>
  36. <span v-else>无</span>
  37. </template>
  38. </el-table-column>
  39. <el-table-column label="日期" min-width="120px" align="center" prop="date" />
  40. <el-table-column label="审核状态" min-width="150px" align="center">
  41. <template slot-scope="scope">
  42. <span v-if="scope.row.status == 0 ">未离厂</span>
  43. <span v-else-if="scope.row.status == 1 ">未回厂</span>
  44. <span v-else-if="scope.row.status == 2 ">已回厂</span>
  45. <span v-else>已验收</span>
  46. </template>
  47. </el-table-column>
  48. <el-table-column label="操作" align="center" width="320" class-name="small-padding fixed-width" fixed="right">
  49. <template slot-scope="{row}">
  50. <el-button type="primary" size="mini" @click="form_see(row)">查看</el-button>
  51. <el-button v-if="istab2Edit && row.isAcceptance == 0" type="success" size="mini" @click="form_edit(row)">编辑</el-button>
  52. <el-button v-if="istab2Del && row.isAcceptance == 0" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
  53. <el-button v-if="row.isAcceptance == 0" style="display:inline-block" type="success" size="mini" @click="form_submit(row)">提交</el-button>
  54. <el-button v-if="istab2Shenhe1 && row.isAcceptance == 1 && (row.flowCompeleted == 1) " style="display:inline-block" type="success" size="mini" @click="form_examine(row)">审核1</el-button>
  55. <el-button v-if="istab2Shenhe2 && row.isAcceptance == 1 && (row.flowCompeleted == 2) " style="display:inline-block" type="success" size="mini" @click="form_examine2(row)">审核2</el-button>
  56. <el-button v-if="istab2Shenhe3 && row.isAcceptance == 1 && (row.flowCompeleted == 4) " style="display:inline-block" type="success" size="mini" @click="form_examine3(row)">审核3</el-button>
  57. </template>
  58. </el-table-column>
  59. </el-table>
  60. <pagination v-show="tableObj1.total>0" :total="tableObj1.total" :page.sync="tableObj1.getdataListParm.offset" :limit.sync="tableObj1.getdataListParm.pagecount" @pagination="get_table_data1()" />
  61. </div>
  62. <!-- 弹出层新增or修改 -->
  63. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="90%">
  64. <div class="app-container">
  65. <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="100px" style="width: 100%;">
  66. <el-row :gutter="20">
  67. <el-col :span="8">
  68. <el-form-item label="委外验收单号:" prop="acceptanceCode">
  69. <el-input ref="acceptanceCode" v-model="createTemp.acceptanceCode" disabled />
  70. </el-form-item>
  71. </el-col>
  72. <el-col :span="8">
  73. <el-form-item label="牧场:" prop="pastureId" >
  74. <el-select v-model="createTemp.pastureId" placeholder="牧场" class="filter-item" style="width:100%" :disabled="dialogStatus==='update' || dialogStatus==='see'" @change="change_pasture2" >
  75. <el-option v-for="item in pastureNameList" :key="item.id" :label="item.name" :value="item.id" />
  76. </el-select>
  77. </el-form-item>
  78. </el-col>
  79. <el-col :span="8">
  80. <el-form-item label="责任部门:" prop="departmentId">
  81. <el-select v-model="createTemp.departmentId" placeholder="责任部门" class="filter-item" style="width:100%" :disabled="dialogStatus==='update' || dialogStatus==='see'" @change="change_depart2">
  82. <el-option v-for="item in departNameList2" :key="item.id" :label="item.name" :value="item.id" />
  83. </el-select>
  84. </el-form-item>
  85. </el-col>
  86. </el-row>
  87. <el-row :gutter="20">
  88. <el-col :span="8">
  89. <el-form-item label="委外申请单号:" prop="outsourcingCode">
  90. <el-autocomplete :disabled="dialogStatus==='update' || dialogStatus==='see'"
  91. v-model="createTemp.outsourcingCode"
  92. value-key="name"
  93. class="inline-input"
  94. :fetch-suggestions="getOutNumber"
  95. placeholder=""
  96. style="width:100%"
  97. @select="changeOutNumber"
  98. >
  99. <template slot-scope="{ item }">
  100. <div class="name" style="display: inline;">{{ item.outsourcingCode }}</div>
  101. <!-- <div class="name" style="display: inline;">{{ item.departmentName }}</div> -->
  102. </template>
  103. </el-autocomplete>
  104. </el-form-item>
  105. </el-col>
  106. <el-col :span="8">
  107. <el-form-item label="录入人:" prop="applicant">
  108. <el-select v-model="createTemp.applicant" placeholder="录入人" class="filter-item" style="width:100%" :disabled="dialogStatus==='update' || dialogStatus==='see'" >
  109. <el-option v-for="item in employeNameList" :key="item.id" :label="item.name" :value="item.id" />
  110. </el-select>
  111. </el-form-item>
  112. </el-col>
  113. <el-col :span="8">
  114. <el-form-item label="日期:" prop="date">
  115. <el-date-picker v-model="createTemp.date" :picker-options="pickerOptions" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
  116. </el-form-item>
  117. </el-col>
  118. </el-row>
  119. <el-row :gutter="20">
  120. <el-col :span="8">
  121. <el-form-item label="有无合同:" prop="iscontract">
  122. <span v-if="createTemp.iscontract == 0">有合同</span>
  123. <span v-else>无合同</span>
  124. </el-form-item>
  125. </el-col>
  126. <el-col :span="8">
  127. <el-form-item label="离厂日期:" prop="lcdate">
  128. <el-date-picker v-model="createTemp.lcdate" :picker-options="pickerOptions" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
  129. </el-form-item>
  130. </el-col>
  131. <el-col :span="8">
  132. <el-form-item label="回厂日期:" prop="hcdate">
  133. <el-date-picker v-model="createTemp.hcdate" :picker-options="pickerOptions" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width:100%" :disabled="dialogStatus==='see'" />
  134. </el-form-item>
  135. </el-col>
  136. </el-row>
  137. <el-divider></el-divider>
  138. <el-table
  139. key="tableKey"
  140. v-loading="listLoading"
  141. element-loading-text="给我一点时间"
  142. :data="listAddCont"
  143. border
  144. fit
  145. highlight-current-row
  146. style="width: 100%;margin-bottom:30px"
  147. :row-style="rowStyle"
  148. :cell-style="cellStyle"
  149. class="elTable"
  150. >
  151. <!-- table表格 -->
  152. <el-table-column label="序号" align="center" type="index" width="50px" />
  153. <el-table-column label="供应商" prop="providerName" align="center" min-width="80px">
  154. <template slot-scope="scope">
  155. <span>{{ scope.row.providerName }}</span>
  156. </template>
  157. </el-table-column>
  158. <!-- <el-table-column label="金额" prop="amount" align="center" min-width="80px">
  159. <template slot-scope="scope">
  160. <span>{{ scope.row.amount }}</span>
  161. </template>
  162. </el-table-column> -->
  163. <el-table-column label="金额" v-if="createTemp.iscontract !== 0" prop="amount" align="center" min-width="80px">
  164. <template slot-scope="scope">
  165. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  166. <el-input v-model="scope.row.amount" style="margin-top:10px" />
  167. </span>
  168. <span v-if="dialogStatus ==='see'">{{ scope.row.amount }}</span>
  169. </template>
  170. </el-table-column>
  171. <el-table-column label="设备名称" prop="eqName" min-width="80px" align="center">
  172. <template slot-scope="scope">
  173. <span>{{ scope.row.eqName }}</span>
  174. </template>
  175. </el-table-column>
  176. <el-table-column label="设备内部编号" prop="eqCode" align="center" min-width="80px">
  177. <template slot-scope="scope">
  178. <span>{{ scope.row.eqCode }}</span>
  179. </template>
  180. </el-table-column>
  181. <el-table-column label="费用类型" prop="typea" align="center" min-width="80px">
  182. <template slot-scope="scope">
  183. <span>{{ scope.row.typea }}</span>
  184. </template>
  185. </el-table-column>
  186. <el-table-column label="铅封号" prop="sealNumber" align="center" min-width="80px">
  187. <template slot-scope="scope">
  188. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  189. <el-input v-model="scope.row.sealNumber" style="margin-top:10px" />
  190. </span>
  191. <span v-if="dialogStatus ==='see'">{{ scope.row.sealNumber }}</span>
  192. </template>
  193. </el-table-column>
  194. <el-table-column label="质保日期" prop="warrantydate" align="center" min-width="80px">
  195. <template slot-scope="scope">
  196. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  197. <!-- <el-date-picker v-model="scope.row.warrantydate" :picker-options="pickerOptions" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="margin-top:10px" /> -->
  198. <el-date-picker v-model="scope.row.warrantydate" type="date" placeholder="日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="margin-top:10px" />
  199. </span>
  200. <span v-if="dialogStatus ==='see'">{{ scope.row.warrantydate }}</span>
  201. </template>
  202. </el-table-column>
  203. <!-- <el-table-column label="交付日期" prop="date" align="center" min-width="80px">
  204. <template slot-scope="scope">
  205. <span>{{ scope.row.date }}</span>
  206. </template>
  207. </el-table-column> -->
  208. <!-- <el-table-column label="合同编号" prop="contractCode" align="center" min-width="80px">
  209. <template slot-scope="scope">
  210. <span>{{ scope.row.contractCode }}</span>
  211. </template>
  212. </el-table-column> -->
  213. <el-table-column label="备注" prop="remark" align="center" min-width="80px">
  214. <template slot-scope="scope">
  215. <span >{{ scope.row.remark }}</span>
  216. </template>
  217. </el-table-column>
  218. </el-table>
  219. <el-divider></el-divider>
  220. <el-row :gutter="20">
  221. <el-col :span="8">
  222. <el-form-item label="备件类型:" prop="applyType">
  223. <el-radio-group v-model="createTemp.applyType" :disabled="dialogStatus==='see'" @change="change_applyType" >
  224. <el-radio :label="0" :checked="createTemp.applyType == 0">牧场</el-radio>
  225. <el-radio :label="1" :checked="createTemp.applyType == 1">供应商</el-radio>
  226. </el-radio-group>
  227. </el-form-item>
  228. </el-col>
  229. </el-row>
  230. <el-row :gutter="20" v-if = "createTemp.applyType == 0">
  231. <el-button v-if = "dialogStatus !=='see' " class="filter-item" type="primary" size="mini" style="margin-bottom:10px" @click="handleCollectionSparePartsCreate">添加领用单</el-button>
  232. <!-- <el-col :span="8">
  233. <el-form-item label="领用单号:" prop="applyCode">
  234. <el-input ref="applyCode" v-model="createTemp.applyCode" disabled />
  235. </el-form-item>
  236. </el-col>
  237. <el-col :span="16">
  238. <el-form-item label="备件:" prop="partCode">
  239. <el-autocomplete v-model="orderPart.partCode" value-key="name" class="inline-input" :fetch-suggestions="sparePartSearch" placeholder="请输入备件编号或备件名称或备件规格" style="width:100%" @select="handleSelectSparePart" :disabled="dialogStatus==='update' || dialogStatus==='see'" >
  240. <template slot-scope="{ item }">
  241. <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>&nbsp;
  242. | &nbsp;<b>备件名称:</b><span class="addr">{{ item.partName }}</span>&nbsp;
  243. | &nbsp;<b>备件规格:</b><span class="addr">{{ item.specification }}</span>
  244. | &nbsp;<b>品牌:</b><span class="addr">{{ item.brand }}</span>
  245. | &nbsp;<b>库存:</b><span class="addr">{{ item.reportery }}</span>
  246. </template>
  247. </el-autocomplete>
  248. </el-form-item>
  249. </el-col> -->
  250. </el-row>
  251. <el-table v-if = "createTemp.applyType == 0"
  252. :key="tableKey"
  253. v-loading="listLoading"
  254. element-loading-text="给我一点时间"
  255. :data="listCollectionSpareParts"
  256. border
  257. fit
  258. highlight-current-row
  259. style="width: 100%;"
  260. :row-style="rowStyle"
  261. :cell-style="cellStyle"
  262. class="elTable table-fixed"
  263. >
  264. <el-table-column label="序号" align="center" type="index" width="50px">
  265. <template slot-scope="scope">
  266. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  267. </template>
  268. </el-table-column>
  269. <el-table-column label="领用单号" align="center">
  270. <template slot-scope="scope">
  271. <span>{{ scope.row.applyCode }}</span>
  272. </template>
  273. </el-table-column>
  274. <el-table-column label="领用部门" width="140px" align="center">
  275. <template slot-scope="scope">
  276. <span>{{ scope.row.departmentName }}</span>
  277. </template>
  278. </el-table-column>
  279. <el-table-column label="领用日期" sortable prop="createDate" min-width="80px" align="center" />
  280. <el-table-column label="领用备件" prop="details" align="center">
  281. <template slot-scope="scope">
  282. <span>{{ scope.row.details }}</span>
  283. </template>
  284. </el-table-column>
  285. <el-table-column label="领用状态" min-width="100px" align="center" :formatter="statue" />
  286. <el-table-column label="操作" min-width="80px" align="center">
  287. <template slot-scope="{row}">
  288. <el-button type="primary" size="mini" @click="handleCollarUseSee(row)">查看</el-button>
  289. </template>
  290. </el-table-column>
  291. </el-table>
  292. <el-divider></el-divider>
  293. <el-button v-if = "createTemp.applyType == 1 && dialogStatus !=='see' " class="filter-item" type="primary" icon="el-icon-edit" @click="form_add_list2">新增</el-button>
  294. <el-table v-if = "createTemp.applyType == 1"
  295. key="2" v-loading="listLoading" element-loading-text="给我一点时间"
  296. :data="listAdd2" border fit highlight-current-row style="width: 100%;margin-bottom:30px"
  297. :row-style="rowStyle" :cell-style="cellStyle" class="elTable" >
  298. <!-- table表格 -->
  299. <el-table-column type="index" label="序号" align="center" width="50px" />
  300. <el-table-column label="备件编号" min-width="90px" prop="partCode" align="center">
  301. <template slot-scope="scope">
  302. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  303. <el-input v-model="scope.row.partCode" style="margin-top:10px" />
  304. </span>
  305. <span v-if="dialogStatus ==='see'">{{ scope.row.partCode }}</span>
  306. </template>
  307. </el-table-column>
  308. <el-table-column label="备件名称" min-width="60px" align="center">
  309. <template slot-scope="scope">
  310. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  311. <el-input v-model="scope.row.partName" style="margin-top:10px" />
  312. </span>
  313. <span v-if="dialogStatus ==='see'">{{ scope.row.partName }}</span>
  314. </template>
  315. </el-table-column>
  316. <el-table-column label="备件规格" prop="specification" align="center" min-width="90">
  317. <template slot-scope="scope">
  318. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  319. <el-input v-model="scope.row.specification" style="margin-top:10px" />
  320. </span>
  321. <span v-if="dialogStatus ==='see'">{{ scope.row.specification }}</span>
  322. </template>
  323. </el-table-column>
  324. <el-table-column label="备件品牌" prop="brand" align="center" min-width="60">
  325. <template slot-scope="scope">
  326. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  327. <el-input v-model="scope.row.brand" style="margin-top:10px" />
  328. </span>
  329. <span v-if="dialogStatus ==='see'">{{ scope.row.brand }}</span>
  330. </template>
  331. </el-table-column>
  332. <el-table-column label="供应商" prop="providerName" align="center" min-width="60">
  333. <template slot-scope="scope">
  334. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  335. <el-input v-model="scope.row.providerName" style="margin-top:10px" />
  336. </span>
  337. <span v-if="dialogStatus ==='see'">{{ scope.row.providerName }}</span>
  338. </template>
  339. </el-table-column>
  340. <el-table-column label="计量单位" prop="unit" align="center" min-width="60">
  341. <template slot-scope="scope">
  342. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  343. <el-input v-model="scope.row.unit" style="margin-top:10px" />
  344. </span>
  345. <span v-if="dialogStatus ==='see'">{{ scope.row.unit }}</span>
  346. </template>
  347. </el-table-column>
  348. <el-table-column label="数量" prop="amount" align="center" min-width="60">
  349. <template slot-scope="scope">
  350. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  351. <el-input v-model="scope.row.amount" style="margin-top:10px" />
  352. </span>
  353. <span v-if="dialogStatus ==='see'">{{ scope.row.amount }}</span>
  354. </template>
  355. </el-table-column>
  356. <el-table-column label="单价" prop="price" align="center" min-width="70">
  357. <template slot-scope="scope">
  358. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  359. <el-input v-model="scope.row.price" style="margin-top:10px" />
  360. </span>
  361. <span v-if="dialogStatus ==='see'">{{ scope.row.price }}</span>
  362. </template>
  363. </el-table-column>
  364. <el-table-column label="总价" prop="totalPrice" align="center" min-width="70">
  365. <template slot-scope="scope">
  366. <span>{{ scope.row.price * parseFloat(scope.row.amount) }}</span>
  367. </template>
  368. </el-table-column>
  369. <el-table-column label="备注" prop="remark" align="center" min-width="60">
  370. <template slot-scope="scope">
  371. <span v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  372. <el-input v-model="scope.row.remark" style="margin-top:10px" />
  373. </span>
  374. <span v-if="dialogStatus ==='see'">{{ scope.row.remark }}</span>
  375. </template>
  376. </el-table-column>
  377. <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right" v-if="dialogStatus ==='create'||dialogStatus ==='update'">
  378. <template slot-scope="{row}">
  379. <a class="del" @click="partDelete2(row)">删除</a>
  380. </template>
  381. </el-table-column>
  382. </el-table>
  383. </el-form>
  384. <el-row v-if="dialogStatus ==='see' ">
  385. <el-col>
  386. <h3 >流程进度</h3>
  387. <el-steps :active="active" align-center finish-status="success">
  388. <el-step
  389. v-for="(item,index) in activeList"
  390. :key="index"
  391. :title="item.title"
  392. :status="item.status"
  393. >
  394. <template slot="description">
  395. <div class="step-row">
  396. <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
  397. <div>{{ item.reason }}</div>
  398. </div>
  399. </template>
  400. </el-step>
  401. </el-steps>
  402. </el-col>
  403. </el-row>
  404. <div slot="footer" class="dialog-footer" style="bottom:10px">
  405. <el-button type="primary" v-if="dialogStatus !=='see'" @click="dialogStatus==='create'?add_dialog_save():edit_dialog_save()">保存并关闭</el-button>
  406. <!-- <el-button type="primary" v-show ="dialogStatus==='create'" :disabled="isokDisable" @click="add_dialog_save()">保存并关闭1</el-button>
  407. <el-button type="primary" v-show ="dialogStatus==='update'" :disabled="isokDisable" @click="edit_dialog_save()">保存并关闭2</el-button> -->
  408. <el-button @click="dialogFormVisible = false;get_table_data1()">取消并关闭</el-button>
  409. </div>
  410. </div>
  411. </el-dialog>
  412. <!-- 审核 -->
  413. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_Examine" :close-on-click-modal="false" width="30%">
  414. <div class="app-examine">
  415. <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请确认审核结果:</h3>
  416. <el-form ref="examineTemp" :model="examineTemp" label-position="right" style="width: 50%;margin:0 auto;">
  417. <el-row style="width:88%;height:150px;margin:0 auto;">
  418. <el-col :span="20">
  419. <el-form-item>
  420. <el-radio-group v-model="examineTemp.status" @change="change_statue">
  421. <el-radio :label="1" checked>通过</el-radio>
  422. <el-radio :label="2">不通过</el-radio>
  423. </el-radio-group>
  424. </el-form-item>
  425. </el-col>
  426. <el-col v-if="statueReason" :span="20">
  427. <el-input v-model="examineTemp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入不通过原因" />
  428. </el-col>
  429. </el-row>
  430. </el-form>
  431. </div>
  432. <div slot="footer" class="dialog-footer">
  433. <el-button v-if="istab2Shenhe1 && (examineTemp.flowCompeleted == 1) " type="primary" :disabled="isokDisable" @click="form_examine_save()">确认</el-button>
  434. <el-button v-if="istab2Shenhe2 && (examineTemp.flowCompeleted == 2) " type="primary" :disabled="isokDisable" @click="form_examine_save2()">确认</el-button>
  435. <el-button v-if="istab2Shenhe3 && (examineTemp.flowCompeleted == 4) " type="primary" :disabled="isokDisable" @click="form_examine_save3()">确认</el-button>
  436. <!-- <el-button v-if="dialogStatus==='examine22'" type="primary" :disabled="isokDisable" @click="form_examine_save22()">确认</el-button>
  437. <el-button v-if="dialogStatus==='examine2'" type="primary" :disabled="isokDisable" @click="form_examine_save2()">确认</el-button>
  438. <el-button v-if="dialogStatus==='examine33'" type="primary" :disabled="isokDisable" @click="form_examine_save33()">确认</el-button>
  439. <el-button v-if="dialogStatus==='examine3'" type="primary" :disabled="isokDisable" @click="form_examine_save3()">确认</el-button> -->
  440. <el-button @click="dialogFormVisible_Examine = false;">关闭</el-button>
  441. </div>
  442. </el-dialog>
  443. <el-dialog title="领用单" :visible.sync="dialogFormVisible_CollectionSparePartsSee" :close-on-click-modal="false" width="90%">
  444. <div class="collectionSparePartsSee">
  445. <el-form
  446. ref="collectionSparePartsSeeTemp"
  447. :rules="rules"
  448. :model="collectionSparePartsSeeTemp"
  449. label-position="right"
  450. label-width="120px"
  451. style="width: 90%;margin:0 auto;"
  452. >
  453. <el-row>
  454. <el-col :span="8">
  455. <el-form-item label="领用单号:" prop="applyCode">
  456. <el-input ref="applyCode" v-model="collectionSparePartsSeeTemp.applyCode" disabled />
  457. </el-form-item>
  458. </el-col>
  459. <el-col :span="8">
  460. <el-form-item label="领用部门:" prop="departmentName">
  461. <el-input ref="departmentName" v-model="collectionSparePartsSeeTemp.departmentName" disabled />
  462. </el-form-item>
  463. </el-col>
  464. <el-col :span="8">
  465. <el-form-item label="领用日期:" prop="applyDate">
  466. <el-input ref="applyDate" v-model="collectionSparePartsSeeTemp.applyDate" disabled />
  467. </el-form-item>
  468. </el-col>
  469. </el-row>
  470. <el-row v-if="isPartCode">
  471. <el-col :span="16">
  472. <el-form-item label="所需备件:" prop="partCode">
  473. <el-autocomplete
  474. v-model="collectionSparePartsSeeTemp.partCode"
  475. value-key="name"
  476. class="inline-input"
  477. :fetch-suggestions="sparePartSearch"
  478. placeholder="请输入备件编号或备件名称或备件规格"
  479. style="width:98%"
  480. @select="handleSelectSparePart"
  481. >
  482. <template slot-scope="{ item }">
  483. <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>&nbsp;
  484. | &nbsp;<b>备件名称:</b><span class="addr">{{ item.partName }}</span>&nbsp;
  485. | &nbsp;<b>备件规格:</b><span class="addr">{{ item.specification }}</span>
  486. | &nbsp;<b>库存:</b><span class="addr">{{ item.reportery }}</span>
  487. | &nbsp;<b>是否零库存:</b><span class="addr" v-if="item.isZeroStock==1">是</span>
  488. <span class="addr" v-else>否</span>
  489. </template>
  490. </el-autocomplete>
  491. </el-form-item>
  492. </el-col>
  493. </el-row>
  494. </el-form>
  495. <el-table
  496. :key="tableKey"
  497. v-loading="listLoading"
  498. element-loading-text="给我一点时间"
  499. :data="listCreateCollectionSpareParts"
  500. border
  501. fit
  502. highlight-current-row
  503. style="width: 100%;margin-bottom:30px"
  504. :row-style="rowStyle"
  505. :cell-style="cellStyle"
  506. class="elTable table-fixed"
  507. >
  508. <!-- table表格 -->
  509. <el-table-column type="index" label="序号" align="center" width="50px" />
  510. <el-table-column label="备件编号" min-width="90px" prop="partCode" align="center">
  511. <template slot-scope="scope">
  512. <span>{{ scope.row.partCode }}</span>
  513. </template>
  514. </el-table-column>
  515. <el-table-column label="备件名称" min-width="80px" align="center">
  516. <template slot-scope="scope">
  517. <span>{{ scope.row.partName }}</span><br>
  518. </template>
  519. </el-table-column>
  520. <el-table-column label="备件规格" prop="specification" align="center" min-width="100">
  521. <template slot-scope="scope">
  522. <span>{{ scope.row.specification }}</span>
  523. </template>
  524. </el-table-column>
  525. <el-table-column label="库存数" prop="reportery" align="center" min-width="100">
  526. <template slot-scope="scope">
  527. <span>{{ scope.row.reportery }}</span>
  528. </template>
  529. </el-table-column>
  530. <el-table-column label="领用数量" prop="amount" align="center" min-width="80">
  531. <template slot-scope="scope">
  532. <el-form :model="scope.row">
  533. <el-form-item prop="amount">
  534. <el-input ref="amount" v-model="scope.row.amount" :disabled="dialogStatus==='collectionSparePartsSee1'" style="margin-top:15px" />
  535. </el-form-item>
  536. </el-form>
  537. </template>
  538. </el-table-column>
  539. <!-- <el-table-column label="领用时间" prop="date" align="center" min-width="100">
  540. <template slot-scope="scope">
  541. <span>{{ scope.row.date }}</span>
  542. </template>
  543. </el-table-column> -->
  544. <el-table-column label="用途" prop="note" align="center" min-width="60">
  545. <template slot-scope="scope">
  546. <el-form :model="scope.row">
  547. <el-form-item prop="note">
  548. <el-input ref="note" v-model="scope.row.note" :disabled="dialogStatus==='collectionSparePartsSee1'" style="margin-top:15px" />
  549. </el-form-item>
  550. </el-form>
  551. </template>
  552. </el-table-column>
  553. <el-table-column label="设备名称" prop="eqName" align="center" min-width="250">
  554. <template slot-scope="scope">
  555. <el-autocomplete v-if="isCreatePartDelete"
  556. v-model="scope.row.eqName"
  557. class="inline-input"
  558. :fetch-suggestions="querySearchEqName"
  559. value-key="eqName"
  560. placeholder="设备名称"
  561. @select="(value)=>
  562. {handleSelectEqName(value, scope.row)}"
  563. @blur="(value)=>
  564. {blurSelectEqName(value, scope.row)}"
  565. >
  566. <template slot-scope="{ item }">
  567. <span class="addr">{{ item.eqName }}</span>
  568. |<span class="addr">{{ item.eqCode }}</span>
  569. </template>
  570. </el-autocomplete>
  571. <span v-else class="addr">{{ scope.row.eqName }}</span>
  572. </template>
  573. </el-table-column>
  574. <el-table-column label="设备内部编号" prop="eqCode" align="center" min-width="150">
  575. <template slot-scope="scope">
  576. <el-autocomplete v-if="isCreatePartDelete"
  577. v-model="scope.row.eqCode"
  578. class="inline-input"
  579. :fetch-suggestions="querySearchCode"
  580. value-key="eqCode"
  581. placeholder="设备内部编号"
  582. @select="(value)=>
  583. {handleSelectEqCode(value, scope.row)}"
  584. @blur="(value)=>
  585. {blurSelectEqCode(value, scope.row)}"
  586. />
  587. <span v-else class="addr">{{ scope.row.eqCode }}</span>
  588. </template>
  589. </el-table-column>
  590. <el-table-column v-if="isCreatePartDelete" label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right">
  591. <template slot-scope="{row}">
  592. <a class="del" @click="createPartDelete(row)">删除</a>
  593. </template>
  594. </el-table-column>
  595. </el-table>
  596. </div>
  597. <div slot="footer" class="dialog-footer" style="bottom:5px">
  598. <el-button v-if="isPartCode" type="primary" :disabled="isokDisable" @click="createCollectionSparePartsData()">确认</el-button>
  599. <el-button @click="dialogFormVisible_CollectionSparePartsSee = false;">关闭</el-button>
  600. </div>
  601. </el-dialog>
  602. </div>
  603. </template>
  604. <script>
  605. import echarts from 'echarts'
  606. require('echarts/theme/macarons')
  607. import { GetDataByNames, GetReportform, GetDataByName, PostDataByName, checkButtons, ExecDataByConfig} from '@/api/common'
  608. import Cookies from 'js-cookie'
  609. import { parseTime, json2excel } from '@/utils/index.js'
  610. import { MessageBox } from 'element-ui'
  611. import Pagination from '@/components/Pagination'
  612. export default {
  613. name: 'Tab2',
  614. components: { Pagination },
  615. inject: ['reload'],
  616. data() {
  617. return {
  618. myHeight:document.documentElement.clientHeight - 85- 200,
  619. //多个下拉框 - 请求内容
  620. send_select_list: [
  621. { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
  622. { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
  623. ],
  624. // 下拉框 - 牧场
  625. pastureNameList: [
  626. // {id: "犊牛1", name: "犊牛1"},
  627. // {id: "犊牛2", name: "犊牛2"},
  628. // {id: "犊牛3", name: "犊牛3"}
  629. ],
  630. getDepartParam1: {
  631. name: 'findAllDepart', offset: 0, pagecount: 0,
  632. parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
  633. },
  634. employeNameList: [],
  635. departNameList1: [],
  636. getDepartParam2: {
  637. name: 'findAllDepart', offset: 0, pagecount: 0,
  638. parammaps: { 'pastureId': Cookies.get('pastureid'), 'eId': Cookies.get('employeid') }
  639. },
  640. departNameList2: [],
  641. // statuesNameList: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }],
  642. statuesNameList: [{ id: '0', name: '未离厂' }, { id: '1', name: '未回厂' }, { id: '2', name: '已回厂' }, { id: '3', name: '已验收' }],
  643. iscontractList:[{id: '0', name: '有合同'},{id: '1', name: '无合同'}],
  644. isokDisable: false,
  645. tableObj1: {
  646. getdataListParm: {
  647. name: 'getBigacceptanceList',
  648. //请求的 page 无用参数 offset 第几页 pagecount 每页多少条
  649. page: 1, offset: 1,pagecount: 10,returntype: 'Map',
  650. parammaps: { pastureName:Cookies.get('pasturename'), acceptanceCode: '',departmentName: '',status: "",outsourcingCode: "", inputDatetime:"",startdate: "",enddate: "",iscontract:''}
  651. },
  652. tableKey: 0,listLoading: false,
  653. //返回的 pageNum 第几页 pageSize 每页多少条 total 总条数
  654. pageNum:'',pageSize:'',total: 0,
  655. list: [
  656. ]
  657. },
  658. pageNum:'',pageSize:'',total: 0,
  659. getAddContListParam: {
  660. name: "getOutsourcingList",
  661. page: 1,offset: 1,pagecount: 20,returntype: "Map",
  662. parammaps: {"bigId": ""}
  663. },
  664. pickerOptions: {
  665. disabledDate(time) {
  666. return time.getTime() > Date.now()// 当天之前的时间可选
  667. }
  668. },
  669. dialogFormVisible_CollectionSparePartsSee: false,
  670. listCreateCollectionSpareParts: [],
  671. isCreatePartDelete: false,
  672. isPartCode: true,
  673. getCollarUseSeeParm: {
  674. name: 'getpartapplyListBybig',
  675. parammaps: {}
  676. },
  677. orderPart: {},
  678. getOutCodetParm: {
  679. name: 'getBigoutsourcingCode',
  680. returntype: 'Map',
  681. parammaps: {
  682. pastureId: Cookies.get('pastureid'),
  683. outsourcingCode:"",
  684. }
  685. },
  686. useForms: [],
  687. getParmCreateAdd: {
  688. name: 'getPartApplyByBig',
  689. returntype: 'Map',
  690. parammaps: {}
  691. },
  692. rules: {
  693. equipmentName: [{ required: true, message: '必填', trigger: 'blur' }],
  694. lcdate: [{ required: true, message: '必填', trigger: 'blur' }],
  695. hcdate: [{ required: true, message: '必填', trigger: 'blur' }],
  696. },
  697. getPramPartApplyListBybig: {
  698. name:"getpartapplyListBybig",
  699. returntype:"Map",
  700. parammaps:{"id":""}
  701. },
  702. getPramAcceptanceList: {
  703. name:"getAcceptanceList",
  704. returntype:"Map",
  705. parammaps:{"bigId ":""}
  706. },
  707. getCollarUseListParm: {
  708. name: 'getPartsapplybyMt',
  709. page: 1,
  710. offset: 1,
  711. returntype: 'Map',
  712. parammaps: {
  713. "RUCode":"",
  714. }
  715. },
  716. collectionSparePartsSeeTemp: {
  717. applyCode:"",departmentName:"",applyDate:"",
  718. isStock: 0,
  719. applyDate:"",
  720. },
  721. listCollectionSpareParts: [],
  722. tableKey: 0,
  723. listLoading: true,
  724. total: 0,
  725. list: [],
  726. dialogStatus: '',
  727. dialogFormVisible: false,
  728. dialogFormVisibleSee: false,
  729. listLoadingSee: true,
  730. listSee: [],
  731. totalSee: 0,
  732. seeTemp: {},
  733. getdataListSee: {
  734. name: 'getpartpurchaseBybig',
  735. returntype: 'Map',
  736. parammaps: {}
  737. },
  738. createTemp: {
  739. pastureId: this.$store.state.user.pastureid,
  740. departmentId: this.$store.state.user.departmentid,
  741. employeId: this.$store.state.user.employeid,
  742. date: parseTime(new Date(), '{y}-{m}-{d}'),
  743. providerId: '',
  744. contract:1,
  745. acceptanceCode:"",
  746. outsourcingCode:"",
  747. applyType:0,
  748. applicant: '',
  749. departmentName: '',
  750. contract:1,
  751. },
  752. getParmCreateNumber: {
  753. name: 'autoCreatCode',
  754. page: 0, offset: 0, pagecount: 0, returntype: 'Map',
  755. parammaps: {
  756. pastureId: Cookies.get('pastureid'),
  757. codeType: 'WY'
  758. }
  759. },
  760. getParmCreateNumber2: {
  761. name: 'autoCreatCode',
  762. page: 0, offset: 0, pagecount: 0, returntype: 'Map',
  763. parammaps: {
  764. pastureId: Cookies.get('pastureid'),
  765. codeType: 'LY'
  766. }
  767. },
  768. requestSparePart: {
  769. name: 'getPartsListLY', page: 1, offset: 1, pagecount: 20, returntype: 'Map',
  770. parammaps: { pastureId: Cookies.get('pastureid') }
  771. },
  772. EqNameList: [],
  773. requestEqName: {
  774. name: 'geteqbyNameCode', page: 1, offset: 1, pagecount: 10, returntype: 'Map',
  775. parammaps: { pastureId: Cookies.get('pastureid') }
  776. },
  777. EqCodeList: [],
  778. listAdd:[],
  779. listAdd2:[],
  780. isData:false,
  781. listAddCont:[
  782. // {providerName:"",providerId: "0",eqId: "0",contractId: "0",}
  783. ],
  784. activeList: [],
  785. active: 1,
  786. dialogFormVisible_Examine: false,
  787. examineTemp: {
  788. "status": 1,
  789. "empid": "",
  790. "flowCompeleted":"",
  791. "workflowNote": "",
  792. "id": ""
  793. },
  794. statueReason: false,
  795. rowStyle: { maxHeight: 50 + 'px', height: 35 + 'px' },
  796. cellStyle: { padding: 0 + 'px' },
  797. textMap: {
  798. update: '编辑',
  799. create: '新增',
  800. see: '查看',
  801. examine: '审核1',
  802. examine22: '审核2',
  803. examine2: '审核3',
  804. examine33: '审核4',
  805. examine3: '审核5',
  806. collectionSparePartsSee: '查看领用',
  807. collectionSparePartsSee1:'查看领用',
  808. collectionSparePartsCreate: '添加领用',
  809. },
  810. istab2Add:[],
  811. istab2Edit:[],
  812. istab2Del:[],
  813. istab2Shenhe1:[],
  814. istab2Shenhe2:[],
  815. istab2Shenhe3:[],
  816. }
  817. },
  818. created() {
  819. this.get_select_list()
  820. this.get_table_data1()
  821. },
  822. methods: {
  823. //获取按钮权限
  824. get_auto_buttons() {
  825. const istab2Add = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:add')
  826. this.istab2Add = istab2Add
  827. const istab2Edit = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:edit')
  828. this.istab2Edit = istab2Edit
  829. const istab2Del = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:del')
  830. this.istab2Del = istab2Del
  831. const istab2Shenhe1 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:shenhe1')
  832. this.istab2Shenhe1 = istab2Shenhe1
  833. const istab2Shenhe2 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:shenhe2')
  834. this.istab2Shenhe2 = istab2Shenhe2
  835. const istab2Shenhe3 = checkButtons(this.$store.state.user.buttons, 'maintenance:subcontractingMainten2:shenhe3')
  836. this.istab2Shenhe3 = istab2Shenhe3
  837. },
  838. get_select_list() {
  839. GetDataByNames(this.send_select_list).then(response => {
  840. this.pastureNameList = response.data.findAllPasture.list
  841. console.log("牧场下拉框", this.pastureNameList)
  842. this.employeNameList = response.data.findAllEmploye.list
  843. console.log("申请人下拉框", this.employeNameList)
  844. this.get_depart_list1()
  845. })
  846. },
  847. change_pasture1(item) {
  848. this.getDepartParam1.parammaps.pastureId = this.pastureNameList.find(obj => obj.name == item).id
  849. this.tableObj1.getdataListParm.parammaps.departmentId = ''
  850. this.get_depart_list1()
  851. },
  852. //部门List
  853. get_depart_list1() {
  854. GetDataByName(this.getDepartParam1).then(response => {
  855. this.departNameList1 = response.data.list
  856. })
  857. },
  858. change_pasture2(item) {
  859. this.getDepartParam2.parammaps.pastureId = item
  860. this.get_depart_list2()
  861. },
  862. get_depart_list2() {
  863. GetDataByName(this.getDepartParam2).then(response => {
  864. this.departNameList2 = response.data.list
  865. })
  866. },
  867. change_depart2(item) {
  868. this.createTemp.departmentName = this.departNameList2.find(obj => obj.id == item).name
  869. },
  870. get_table_data1() {
  871. this.tableObj1.listLoading = false
  872. if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
  873. this.tableObj1.getdataListParm.parammaps.startdate = this.$refs['inputDatetime'].value[0]
  874. this.tableObj1.getdataListParm.parammaps.enddate = this.$refs['inputDatetime'].value[1]
  875. } else {
  876. this.tableObj1.getdataListParm.parammaps.inputDatetime = ''
  877. this.tableObj1.getdataListParm.parammaps.startdate = ''
  878. this.tableObj1.getdataListParm.parammaps.enddate = ''
  879. }
  880. GetDataByName(this.tableObj1.getdataListParm).then(response => {
  881. if (response.data.list !== null) {
  882. this.tableObj1.list = response.data.list
  883. this.tableObj1.pageNum = response.data.pageNum
  884. this.tableObj1.pageSize = response.data.pageSize
  885. this.tableObj1.total = response.data.total
  886. } else {
  887. this.tableObj1.list = [ ]
  888. }
  889. setTimeout(() => {
  890. this.tableObj1.listLoading = false
  891. }, 100)
  892. })
  893. },
  894. form_search() {
  895. console.log('查询')
  896. this.get_table_data1()
  897. },
  898. change_applyType(val) {
  899. console.log(val)
  900. if(val ==1){
  901. this.createTemp.applyType = 1
  902. } else {
  903. this.createTemp.applyType = 0
  904. }
  905. },
  906. form_add() {
  907. this.reset_create()
  908. this.getDepartParam2.parammaps.pastureId = this.createTemp.pastureId
  909. this.get_depart_list2()
  910. this.dialogStatus = 'create'
  911. this.dialogFormVisible = true
  912. this.listLoading = false
  913. this.$nextTick(() => {
  914. this.$refs['createTemp'].clearValidate()
  915. })
  916. //新增生成单号
  917. this.getCreateNumber()
  918. },
  919. statue: function(cellValue) {
  920. // console.log(cellValue.isZeroStock)
  921. if (cellValue.statue == 0) {
  922. return '未领用'
  923. } else if (cellValue.statue == 1) {
  924. return '已领用'
  925. }
  926. },
  927. reset_create() {
  928. this.createTemp.pastureId = parseInt(Cookies.get('pastureid'))
  929. this.createTemp.departmentId = parseInt(Cookies.get('departmentid'))
  930. this.createTemp.departmentName = Cookies.get('departmentname')
  931. this.createTemp.employeId = parseInt(Cookies.get('employeid'))
  932. this.createTemp.date = parseTime(new Date(), '{y}-{m}-{d}')
  933. this.createTemp.outsourcingCode = ''
  934. this.createTemp.applicant = parseInt(Cookies.get('employeid'))
  935. this.createTemp.providerId = ''
  936. this.createTemp.contract = 1
  937. this.createTemp.description = ''
  938. if(parseInt(Cookies.get('pastureid')) == 18){
  939. this.createTemp.departmentId = ""
  940. }
  941. this.createTemp.outsourcingCode = ''
  942. console.log( this.createTemp.departmentName )
  943. this.listAddCont = [
  944. // {providerName:"",providerId: "0",eqId: "0",contractId: "0",amount:"",contractCode:"",date:"",eqCode:"",eqName:"",remark:"",typea:"",}
  945. ]
  946. this.listAdd = []
  947. this.listAdd2 = []
  948. this.listCreateCollectionSpareParts = []
  949. this.listCollectionSpareParts = []
  950. },
  951. handleCollarUseSee(row, isStock) {
  952. console.log(row)
  953. this.collectionSparePartsSeeTemp = Object.assign({}, row)
  954. this.dialogStatus = 'collectionSparePartsSee1'
  955. this.collectionSparePartsSeeTemp.applyDate = row.createDate
  956. this.dialogFormVisible_CollectionSparePartsSee = true
  957. this.isCreatePartDelete = false
  958. this.isPartCode = false
  959. this.getCollarUseSeeList()
  960. },
  961. getCollarUseSeeList() {
  962. this.getCollarUseSeeParm.parammaps.id = this.collectionSparePartsSeeTemp.id
  963. GetDataByName(this.getCollarUseSeeParm).then(response => {
  964. this.listCreateCollectionSpareParts = response.data.list
  965. })
  966. },
  967. form_add_list2() {
  968. var idDel = "id" + Math.round(Math.random()*100) + Math.round(Math.random()*100)
  969. this.listAdd2.unshift({partCode:"",providerId: "0",eqId: "0",contractId: "0",idDel:idDel,partId: "",partCode: "",partName: "",brandId: "",brand: "",providerId: "",providerName: "",price: "",sumPrice: "",remark: "",amount: ""})
  970. },
  971. getCreateNumber() {
  972. GetDataByName(this.getParmCreateNumber).then(response => {
  973. this.$nextTick(() => {
  974. console.log('新增委外维修单单号', response.data.list[0].orderCode)
  975. this.createTemp.acceptanceCode = response.data.list[0].orderCode
  976. this.$forceUpdate()
  977. })
  978. })
  979. },
  980. getCreateLYNumber() {
  981. GetDataByName(this.getParmCreateNumber2).then(response => {
  982. this.$nextTick(() => {
  983. console.log('新增领用单号', response.data.list[0].orderCode)
  984. this.collectionSparePartsSeeTemp.applyCode = response.data.list[0].orderCode
  985. this.$forceUpdate()
  986. })
  987. })
  988. },
  989. add_dialog_save() {
  990. this.isokDisable = true
  991. setTimeout(() => {
  992. this.isokDisable = false
  993. }, 1000)
  994. this.$refs['createTemp'].validate(valid => {
  995. if (valid) {
  996. console.log(this.listAddCont)
  997. if (this.createTemp.acceptanceCode == '' || this.createTemp.acceptanceCode == null || this.createTemp.acceptanceCode == undefined) {
  998. GetDataByName(this.getParmCreateNumber).then(response => {
  999. this.$nextTick(() => {
  1000. console.log('新增单号', response.data.list[0].orderCode)
  1001. this.createTemp.acceptanceCode = response.data.list[0].orderCode
  1002. this.$forceUpdate()
  1003. this.add_dialog_saveSave()
  1004. })
  1005. })
  1006. } else {
  1007. this.add_dialog_saveSave()
  1008. }
  1009. }
  1010. })
  1011. },
  1012. add_dialog_saveSave() {
  1013. for (var j = 0; j < this.listAddCont.length; j++) {
  1014. console.log(this.listAddCont[j].amount)
  1015. if (this.listAddCont[j].amount == null || this.listAddCont[j].amount === '') {
  1016. this.$message({ type: 'warning', message: '请检查金额是否未填写', duration: 2000 })
  1017. return false
  1018. } else {
  1019. // var rulesAmount = /^[1-9]\d*$/
  1020. // if (!rulesAmount.test(this.listAddCont[j].amount)) {
  1021. // this.$message({ type: 'error', message: '申购数量请输入正整数', duration: 2000 })
  1022. // return false
  1023. // }
  1024. }
  1025. }
  1026. //牧场
  1027. if(this.createTemp.applyType == 0){
  1028. let mySumPrice = 0
  1029. for (let i = 0; i < this.listAdd.length; i++) {
  1030. mySumPrice += parseFloat(this.listAdd[i].price) * parseFloat(this.listAdd[i].amount)
  1031. }
  1032. if (mySumPrice > 500) {
  1033. this.createTemp.SHStatus = 2
  1034. } else {
  1035. this.createTemp.SHStatus = 9
  1036. }
  1037. var send_data = {
  1038. "common": { "returnmap": "0" },
  1039. "data": [
  1040. {
  1041. "name": "insertBigacceptance",
  1042. "type": "e",
  1043. "parammaps": this.createTemp
  1044. }
  1045. ]
  1046. }
  1047. }
  1048. //供应商
  1049. if(this.createTemp.applyType == 1){
  1050. if(this.listAdd2.length == 0){
  1051. this.$notify({
  1052. title: '失败', message: "备件必选!",
  1053. type: 'warning',
  1054. duration: 2000
  1055. })
  1056. return false
  1057. }
  1058. this.listAdd2.map((item, index) => {
  1059. return item.partId = "0"
  1060. })
  1061. this.listAdd2.map((item, index) => {
  1062. return item.brandId = "0"
  1063. })
  1064. this.listAdd2.map((item, index) => {
  1065. return item.providerId = "0"
  1066. })
  1067. var send_data = {
  1068. "common": {
  1069. "returnmap": "0"
  1070. },
  1071. "data": [
  1072. {
  1073. "name": "insertBigacceptance",
  1074. "type": "e",
  1075. "parammaps": this.createTemp
  1076. },
  1077. {
  1078. "name": "insertSpotList",
  1079. "resultmaps": {
  1080. "list": this.listAdd2
  1081. },
  1082. "children": [
  1083. {
  1084. "name": "insertAcceptance",
  1085. "type": "e",
  1086. "parammaps": {
  1087. "bigId":"@insertBigacceptance.LastInsertId",
  1088. "partId":"@insertSpotList.partId",
  1089. "partCode":"@insertSpotList.partCode",
  1090. "partName":"@insertSpotList.partName",
  1091. "brandId":"@insertSpotList.brandId",
  1092. "brand":"@insertSpotList.brand",
  1093. "providerId":"@insertSpotList.providerId",
  1094. "providerName":"@insertSpotList.providerName",
  1095. "unit":"@insertSpotList.unit",
  1096. "price":"@insertSpotList.price",
  1097. "remark":"@insertSpotList.remark",
  1098.    "specification": "@insertSpotList.specification",
  1099. "amount":"@insertSpotList.amount"
  1100. }
  1101. }
  1102. ]
  1103. }
  1104. ]
  1105. }
  1106. }
  1107. ExecDataByConfig(send_data).then(response => {
  1108. console.log('新增保存发送参数', send_data)
  1109. if (response.msg === 'fail') {
  1110. this.$notify({
  1111. title: '保存失败',
  1112. message: response.data,
  1113. type: 'warning',
  1114. duration: 2000
  1115. })
  1116. } else {
  1117. this.dialogFormVisible = false
  1118. this.get_table_data1()
  1119. this.$notify({
  1120. title: '',
  1121. message: '保存成功',
  1122. type: 'success',
  1123. duration: 2000
  1124. })
  1125. }
  1126. })
  1127. },
  1128. getOutNumber(queryString, cb) {
  1129. console.log('委外申请单号模糊查询输入值', queryString)
  1130. this.getOutCodetParm.parammaps['outsourcingCode'] = queryString
  1131. GetDataByName(this.getOutCodetParm).then(response => {
  1132. console.log('委外申请单号模糊查询搜索data', response.data.list)
  1133. // this.useForms = response.data.list
  1134. cb(response.data.list)
  1135. })
  1136. },
  1137. changeOutNumber(item) {
  1138. console.log('委外申请单号模糊查询选中值', item)
  1139. this.createTemp.outsourcingCode = item.outsourcingCode
  1140. this.$set(this.createTemp, "outsourcingCode", item.outsourcingCode)
  1141. this.getAddContListParam.parammaps.bigId = item.id
  1142. this.getAddContList()
  1143. // this.createTemp.bid = item.id
  1144. // this.createTemp.applicatId = item.empId
  1145. // this.orderPart.applyCode = item.applyCode
  1146. // this.TotalAmount = 0
  1147. // this.get_table_dataAdd()
  1148. },
  1149. querySearchEqName(queryString, cb) {
  1150. console.log('备件名称/设备内部编号模糊查询输入值', queryString)
  1151. this.requestEqName.parammaps['eqName'] = queryString
  1152. GetDataByName(this.requestEqName).then(response => {
  1153. console.log('备件名称模糊查询搜索data', response.data.list)
  1154. this.EqNameList = response.data.list
  1155. cb(this.EqNameList)
  1156. })
  1157. },
  1158. handleSelectEqName(item, row) {
  1159. console.log('备件名称/设备内部编号模糊查询选中值', item.eqName)
  1160. console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
  1161. this.$set(row, 'eqCode', item.eqCode)
  1162. this.$forceUpdate()
  1163. },
  1164. querySearchCode(queryString, cb) {
  1165. console.log('备件名称/设备内部编号模糊查询输入值', queryString)
  1166. this.requestEqName.parammaps['eqCode'] = queryString
  1167. GetDataByName(this.requestEqName).then(response => {
  1168. console.log('备件名称模糊查询搜索data', response.data.list)
  1169. this.EqNameList = response.data.list
  1170. cb(this.EqNameList)
  1171. })
  1172. },
  1173. handleSelectEqCode(item, row) {
  1174. console.log('备件名称/设备内部编号模糊查询选中值', item)
  1175. console.log('备件名称/设备内部编号模糊查询选中值所在行', row)
  1176. this.$set(row, 'eqName', item.eqName)
  1177. this.$forceUpdate()
  1178. },
  1179. blurSelectEqName(item, row) {
  1180. this.$set(row, 'eqName', '')
  1181. this.$set(row, 'eqCode', '')
  1182. },
  1183. blurSelectEqCode(item, row) {
  1184. this.$set(row, 'eqName', '')
  1185. this.$set(row, 'eqCode', '')
  1186. },
  1187. sparePartSearch(queryString, cb) {
  1188. console.log('备件模糊查询输入值', queryString)
  1189. this.requestSparePart.parammaps.pastureId = this.createTemp.pastureId
  1190. this.requestSparePart.parammaps['partCode'] = queryString
  1191. GetDataByName(this.requestSparePart).then(response => {
  1192. console.log('备件模糊查询搜索data', response.data.list)
  1193. if (response.data.list == null) {
  1194. cb([])
  1195. } else {
  1196. cb(response.data.list)
  1197. }
  1198. })
  1199. },
  1200. // handleSelectSparePart(item) {
  1201. // console.log('备件模糊查询选中值', item)
  1202. // if (this.listAdd.length > 0) {
  1203. // // eslint-disable-next-line no-redeclare
  1204. // if (this.listAdd.find(obj => obj.id === item.id)) {
  1205. // this.$message({
  1206. // type: 'warning',
  1207. // message: '此备件已存在,请重新选择备件'
  1208. // })
  1209. // } else {
  1210. // if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  1211. // this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  1212. // this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  1213. // } else {
  1214. // item.srcpath = ''
  1215. // item.picpath = ''
  1216. // }
  1217. // this.listAdd.push(item)
  1218. // }
  1219. // } else {
  1220. // if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  1221. // this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  1222. // this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  1223. // } else {
  1224. // item.srcpath = ''
  1225. // item.picpath = ''
  1226. // }
  1227. // this.listAdd.push(item)
  1228. // }
  1229. // // this.getEqNameList()
  1230. // },
  1231. handleSelectSparePart(item) {
  1232. console.log('备件模糊查询选中值', item)
  1233. if (this.listCreateCollectionSpareParts.length > 0) {
  1234. // eslint-disable-next-line no-redeclare
  1235. if (this.listCreateCollectionSpareParts.find(obj => obj.partId === item.partId)) {
  1236. this.$message({ type: 'warning', message: '此备件已存在,请重新选择备件' })
  1237. } else {
  1238. item.date = this.collectionSparePartsSeeTemp.applyDate
  1239. this.listCreateCollectionSpareParts.unshift(item)
  1240. }
  1241. } else {
  1242. item.date = this.collectionSparePartsSeeTemp.applyDate
  1243. this.listCreateCollectionSpareParts.unshift(item)
  1244. }
  1245. },
  1246. createPartDelete(row) {
  1247. console.log(this.listAdd)
  1248. MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
  1249. confirmButtonText: '确认',
  1250. cancelButtonText: '取消',
  1251. type: 'warning'
  1252. }).then(() => {
  1253. // console.log(this.list2)
  1254. for (var i = 0; i < this.listCreateCollectionSpareParts.length; i++) {
  1255. console.log(this.listCreateCollectionSpareParts[i])
  1256. if (this.listCreateCollectionSpareParts[i].id === row.id) {
  1257. var listCreateCollectionSparePartsIndex = this.listCreateCollectionSpareParts.indexOf(this.listCreateCollectionSpareParts[i])
  1258. }
  1259. if (listCreateCollectionSparePartsIndex > -1) {
  1260. this.listCreateCollectionSpareParts.splice(listCreateCollectionSparePartsIndex, 1)
  1261. return
  1262. }
  1263. }
  1264. })
  1265. },
  1266. // 添加领用保存
  1267. createCollectionSparePartsData() {
  1268. this.isokDisable = true
  1269. if (this.listCreateCollectionSpareParts.length !== 0) {
  1270. for (var i = 0; i < this.listCreateCollectionSpareParts.length; i++) {
  1271. console.log(this.listCreateCollectionSpareParts[i].amount)
  1272. if (this.listCreateCollectionSpareParts[i].amount !== undefined && this.listCreateCollectionSpareParts[i].amount !== '') {
  1273. var rulesAmount = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
  1274. if (!rulesAmount.test(this.listCreateCollectionSpareParts[i].amount)) {
  1275. this.$message({
  1276. type: 'error',
  1277. message: '领用数量请输入正数,最多保留两位小数',
  1278. duration: 2000
  1279. })
  1280. return false
  1281. } else {
  1282. var listCreateCollectionSpareParts1 = [] // >库存
  1283. var listCreateCollectionSpareParts2 = [] // <=库存
  1284. var amountList = []
  1285. var amount2List = []
  1286. let mySumPrice = 0
  1287. for (let i = 0; i < listCreateCollectionSpareParts2.length; i++) {
  1288. mySumPrice += parseFloat(listCreateCollectionSpareParts2[i].price) * parseFloat(listCreateCollectionSpareParts2[i].amount)
  1289. }
  1290. if (mySumPrice > 500) {
  1291. this.collectionSparePartsSeeTemp.SHStatus = 2
  1292. } else {
  1293. this.collectionSparePartsSeeTemp.SHStatus = 9
  1294. }
  1295. var send_data ={
  1296. "common": { "returnmap": "0" },
  1297. "data": [
  1298. {
  1299. "name": "insertBigpartapply",
  1300. "type": "e",
  1301. "parammaps": {
  1302. "pastureId": this.collectionSparePartsSeeTemp.pastureId,
  1303. "applyCode": this.collectionSparePartsSeeTemp.applyCode,
  1304. "applyType": 1,
  1305. "departmentId": this.collectionSparePartsSeeTemp.departmentId,
  1306. "empId": this.collectionSparePartsSeeTemp.empId,
  1307. "applyDate": this.collectionSparePartsSeeTemp.applyDate,
  1308. "RUCode": this.createTemp.acceptanceCode,
  1309. "SHStatus": 9
  1310. }
  1311. },
  1312. {
  1313. "name": "insertSpotList",
  1314. "resultmaps": {
  1315. "list":this.listCreateCollectionSpareParts
  1316. },
  1317. "children": [
  1318. {
  1319. "name": "insertpartapply",
  1320. "type": "e",
  1321. "parammaps": {
  1322. "bigId": "@insertBigpartapply.LastInsertId",
  1323. "pastureId": "@insertSpotList.pastureId",
  1324. "partId": "@insertSpotList.partId",
  1325. "partCode": "@insertSpotList.partCode",
  1326. "partName": "@insertSpotList.partName",
  1327. "specification": "@insertSpotList.specification",
  1328. "brandId": "@insertSpotList.brandId",
  1329. "price": "@insertSpotList.price",
  1330. "amount": "@insertSpotList.amount",
  1331. "eqName": "@insertSpotList.eqName",
  1332.                          "eqCode": "@insertSpotList.eqCode",
  1333. "providerId": "@insertSpotList.providerId",
  1334. "note": "@insertSpotList.note",
  1335. "reportery": "@insertSpotList.reportery",
  1336. "contractId": "@insertSpotList.contractId",
  1337. "locationId": "@insertSpotList.locationId"
  1338. }
  1339. }
  1340. ]
  1341. }
  1342. ]
  1343. }
  1344. ExecDataByConfig(send_data).then(response => {
  1345. console.log('添加领用保存发送参数',send_data)
  1346. if (response.msg === 'fail') {
  1347. this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
  1348. } else {
  1349. this.dialogFormVisible_CollectionSparePartsSee = false
  1350. this.getCollectionSpareParts()
  1351. this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
  1352. }
  1353. })
  1354. setTimeout(() => {
  1355.         this.isokDisable = false
  1356.       }, 2000)
  1357. return true
  1358. }
  1359. } else {
  1360. this.$message({ type: 'error', message: '请检查领用数量是否未填写', duration: 2000 })
  1361. return false
  1362. }
  1363. }
  1364. } else {
  1365. this.$notify({ title: '', type: 'warning', message: '请选择备件', duration: 2000 })
  1366. return false
  1367. }
  1368.  setTimeout(() => {
  1369.         this.isokDisable = false
  1370.       }, 2000)
  1371. },
  1372. //看领用单
  1373. getCollectionSpareParts() {
  1374. this.getCollarUseListParm.parammaps.RUCode = this.createTemp.acceptanceCode
  1375. GetDataByName(this.getCollarUseListParm).then(response => {
  1376. console.log('领用table数据', response.data.list)
  1377. this.listCollectionSpareParts = response.data.list
  1378. })
  1379. },
  1380. // 新增删除
  1381. partDelete(row) {
  1382. console.log(this.listAdd)
  1383. MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
  1384. confirmButtonText: '确认',
  1385. cancelButtonText: '取消',
  1386. type: 'warning'
  1387. }).then(() => {
  1388. for (var i = 0; i < this.listAdd.length; i++) {
  1389. console.log(this.listAdd[i])
  1390. if (this.listAdd[i].id === row.id) {
  1391. var listAddIndex = this.listAdd.indexOf(this.listAdd[i])
  1392. }
  1393. if (listAddIndex > -1) {
  1394. this.listAdd.splice(listAddIndex, 1)
  1395. return
  1396. }
  1397. }
  1398. })
  1399. },
  1400. partDelete2(row) {
  1401. console.log(this.listAdd2)
  1402. MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
  1403. confirmButtonText: '确认',
  1404. cancelButtonText: '取消',
  1405. type: 'warning'
  1406. }).then(() => {
  1407. for (var i = 0; i < this.listAdd2.length; i++) {
  1408. console.log(this.listAdd2[i])
  1409. if (this.listAdd2[i].idDel === row.idDel) {
  1410. var listAddIndex = this.listAdd2.indexOf(this.listAdd2[i])
  1411. }
  1412. if (listAddIndex > -1) {
  1413. this.listAdd2.splice(listAddIndex, 1)
  1414. return
  1415. }
  1416. }
  1417. })
  1418. },
  1419. handleCollectionSparePartsCreate() {
  1420. if(this.createTemp.departmentId == "" || this.createTemp.departmentId == undefined){
  1421. this.$message({ type: 'warning', message: '请选择责任部门', duration: 2000 })
  1422. return false
  1423. }
  1424. if(this.createTemp.applicant == "" || this.createTemp.applicant == undefined){
  1425. this.$message({ type: 'warning', message: '请选择录入人', duration: 2000 })
  1426. return false
  1427. }
  1428. console.log( "createTemp)============",this.createTemp)
  1429. this.collectionSparePartsSeeTemp = Object.assign({}, this.createTemp)
  1430. this.collectionSparePartsSeeTemp.empId = this.collectionSparePartsSeeTemp.applicant
  1431. this.collectionSparePartsSeeTemp.applyDate = parseTime(new Date(), '{y}-{m}-{d}')
  1432. this.dialogStatus = 'collectionSparePartsSee'
  1433. this.dialogFormVisible_CollectionSparePartsSee = true
  1434. this.isCreatePartDelete = true
  1435. this.listCreateCollectionSpareParts = []
  1436. this.isPartCode = true
  1437. this.getCreateLYNumber()
  1438. console.log( "console.log( this.collectionSparePartsSeeTemp)============",this.collectionSparePartsSeeTemp)
  1439. },
  1440. // getCreateNumber() {
  1441. // // GetDataByName(this.getParmCreateNumber).then(response => {
  1442. // // this.$nextTick(() => {
  1443. // // console.log('新增领用单号', response.data.list[0].orderCode)
  1444. // // this.collectionSparePartsSeeTemp.applyCode = response.data.list[0].orderCode
  1445. // // this.$forceUpdate()
  1446. // // })
  1447. // // })
  1448. // },
  1449. form_see(row){
  1450. console.log('查看======》',row)
  1451. this.reset_create()
  1452. this.getDepartParam2.parammaps.pastureId = row.pastureId
  1453. this.get_depart_list2()
  1454. if (row.providerId == undefined) {
  1455. row.providerId = ''
  1456. row.providerName = ''
  1457. }
  1458. this.createTemp = Object.assign({}, row) // copy obj
  1459. this.dialogStatus = 'see'
  1460. this.dialogFormVisible = true
  1461. this.$nextTick(() => {
  1462. this.$refs['createTemp'].clearValidate()
  1463. })
  1464. //委外申请单号获取合同
  1465. this.getAddContListParam.parammaps.bigId = row.outsourcingId
  1466. this.getAddContList()
  1467. //牧场
  1468. if(row.applyType == 0){
  1469. this.getPramPartApplyListBybig.parammaps.id = row.partapplyId
  1470. this.getCollectionSpareParts()
  1471. this.isCreatePartDelete = false
  1472. }
  1473. //供应商
  1474. if(row.applyType == 1){
  1475. this.getPramAcceptanceList.parammaps.bigId = row.id
  1476. this.getListAdd2()
  1477. }
  1478. if (row.flowCompeleted == 1) {
  1479. this.activeList = [{ title: '委外验收', date: row.createTime, name: row.empname }, { title: '供应处长' }, { title: '部门负责人' },{ title: '场长' }]
  1480. this.active = 1
  1481. } else if (row.flowCompeleted == 2) {
  1482. this.activeList = [{ title: '委外验收', date: row.createTime, name: row.applicantName }, { title: '供应处长', date: row.equipmentdate, name: row.equipmentName },{ title: '部门负责人' },{ title: '场长' }]
  1483. this.active = 2
  1484. } else if (row.flowCompeleted === 3) {
  1485. this.activeList = [{ title: '委外验收', date: row.createTime, name: row.applicantName }, { title: '供应处长', date: row.equipmentdate, name: row.equipmentName, status: 'error', reason: row.workflowNote },{ title: '部门负责人' },{ title: '场长' }]
  1486. this.active = 2
  1487. } else if (row.flowCompeleted === 4) {
  1488. this.activeList = [{ title: '委外验收', date: row.createTime, name: row.applicantName }, { title: '供应处长', date: row.equipmentdate, name: row.equipmentName },{ title: '部门负责人', date: row.departmentdate, name: row.departmentUser },{ title: '场长' }]
  1489. this.active = 3
  1490. } else if (row.flowCompeleted === 5) {
  1491. this.activeList = [{ title: '委外验收', date: row.createTime, name:row.applicantName }, { title: '供应处长', date: row.equipmentdate, name: row.equipmentName },{ title: '部门负责人', date: row.departmentdate, name: row.departmentUser, status: 'error', reason: row.workflowNote },{ title: '场长' }]
  1492. this.active = 3
  1493. } else if (row.flowCompeleted === 6) {
  1494. this.activeList = [{ title: '委外验收', date: row.createTime, name: row.applicantName }, { title: '供应处长', date:row.equipmentdate, name: row.equipmentName },{ title: '部门负责人', date: row.departmentdate, name: row.departmentUser },{ title: '场长', date:row.fielddate, name:row.fieldName }]
  1495. this.active = 4
  1496. } else if (row.flowCompeleted === 7) {
  1497. this.activeList = [{ title: '委外验收', date: row.createTime, name: row.applicantName }, { title: '供应处长', date: row.equipmentdate, name: row.equipmentName },{ title: '部门负责人', date: row.departmentdate, name: row.departmentUser },{ title: '场长', date: row.fielddate, name: row.fieldName, status: 'error', reason: row.workflowNote }]
  1498. this.active = 4
  1499. }
  1500. },
  1501. getAddContList() {
  1502. GetDataByName(this.getAddContListParam).then(response => {
  1503. this.listAddCont = response.data.list
  1504. this.listLoading = false
  1505. })
  1506. },
  1507. form_edit(row) {
  1508. this.reset_create()
  1509. console.log('编辑',row)
  1510. this.getDepartParam2.parammaps.pastureId = row.pastureId
  1511. this.get_depart_list2()
  1512. if (row.providerId == undefined) {
  1513. row.providerId = ''
  1514. row.providerName = ''
  1515. }
  1516. this.createTemp = Object.assign({}, row) // copy obj
  1517. this.dialogStatus = 'update'
  1518. this.dialogFormVisible = true
  1519. this.$nextTick(() => {
  1520. this.$refs['createTemp'].clearValidate()
  1521. })
  1522. //委外申请单号获取合同
  1523. this.getAddContListParam.parammaps.bigId = row.outsourcingId
  1524. this.getAddContList()
  1525. this.isData = false
  1526. //牧场
  1527. if(row.applyType == 0){
  1528. this.getCollectionSpareParts()
  1529. }
  1530. //供应商
  1531. if(row.applyType == 1){
  1532. this.getPramAcceptanceList.parammaps.bigId = row.id
  1533. this.getListAdd2()
  1534. }
  1535. },
  1536. getListAdd() {
  1537. GetDataByName(this.getPramPartApplyListBybig).then(response => {
  1538. this.listAdd = response.data.list
  1539. this.listLoading = false
  1540. })
  1541. },
  1542. getListAdd2() {
  1543. GetDataByName(this.getPramAcceptanceList).then(response => {
  1544. this.listAdd2 = response.data.list
  1545. if(this.listAdd2.length>0){
  1546. this.isData = true
  1547. }else{
  1548. this.isData = false
  1549. }
  1550. this.listLoading = false
  1551. })
  1552. },
  1553. edit_dialog_save() {
  1554. this.isokDisable = true
  1555. setTimeout(() => {
  1556. this.isokDisable = false
  1557. }, 1000)
  1558. this.$refs['createTemp'].validate(valid => {
  1559. if (valid) {
  1560. this.edit_dialog_saveSave()
  1561. }
  1562. })
  1563. },
  1564. edit_dialog_saveSave() {
  1565. //牧场
  1566. if(this.createTemp.applyType == 0){
  1567. for(let i=0;i<this.listAddCont.length;i++){
  1568. if(this.listAddCont[i].sealNumber == ''){
  1569. this.$message({ type: 'warning', message: '请检查铅封号是否未填写', duration: 2000 })
  1570. return false
  1571. }
  1572. if(this.listAddCont[i].warrantydate == ''){
  1573. this.$message({ type: 'warning', message: '请检查质保日期是否未填写', duration: 2000 })
  1574. return false
  1575. }
  1576. }
  1577. var send_data = {
  1578. "common": { "returnmap": "0" },
  1579. "data": [
  1580. {
  1581. "name": "editBigacceptanceDate",
  1582. "type": "e",
  1583. "parammaps": {
  1584. "id":this.createTemp.id,
  1585. "date":this.createTemp.date,
  1586. "applyType":this.createTemp.applyType
  1587. }
  1588. },
  1589. {
  1590. "name": "updateBigacceptanceFlowCompeleted", "type": "e",
  1591. "parammaps":{
  1592. id:this.createTemp.id
  1593. }
  1594. },
  1595. {
  1596. "name": "editBigacceptance", "type": "e",
  1597. "parammaps":{
  1598. id:this.createTemp.id,
  1599. lcdate:this.createTemp.lcdate,
  1600. hcdate:this.createTemp.hcdate
  1601. }
  1602. },
  1603. {
  1604. "name": "insertSpotList",
  1605. "resultmaps": { "list": this.listAddCont },
  1606. "children": [
  1607. {
  1608. "name": "editOutsourcingData", "type": "e",
  1609. "parammaps": {
  1610. "id": "@insertSpotList.id",
  1611. "amount": "@insertSpotList.amount",
  1612. "sealNumber": "@insertSpotList.sealNumber",
  1613. "warrantydate": "@insertSpotList.warrantydate"
  1614. }
  1615. }
  1616. ],
  1617. }
  1618. ]
  1619. }
  1620. }
  1621. //供应商
  1622. if(this.createTemp.applyType == 1){
  1623. if(this.listAdd2.length == 0){
  1624. this.$notify({
  1625. title: '失败', message: "备件必选!",
  1626. type: 'warning',
  1627. duration: 2000
  1628. })
  1629. return false
  1630. }
  1631. this.listAdd2.map((item, index) => {
  1632. return item.partId = "0"
  1633. })
  1634. this.listAdd2.map((item, index) => {
  1635. return item.brandId = "0"
  1636. })
  1637. this.listAdd2.map((item, index) => {
  1638. return item.providerId = "0"
  1639. })
  1640. var myname = ''
  1641. // var bigId = ''
  1642. if(this.isData == true){
  1643. myname = 'editAcceptance'
  1644. // bigId = "@insertBigacceptance.LastInsertId"
  1645. // bigId = "@insertSpotList.bigId"
  1646. }else{
  1647. myname = 'insertAcceptance'
  1648. for(let i=0;i<this.listAdd2.length;i++){
  1649. this.$set(this.listAdd2[i],'bigId',this.createTemp.id)
  1650. }
  1651. // bigId = "@insertSpotList.bigId"
  1652. }
  1653. var send_data = {
  1654. "common": { "returnmap": "0" },
  1655. "data": [
  1656. {
  1657. "name": "editBigacceptanceDate",
  1658. "type": "e",
  1659. "parammaps": {
  1660. "id":this.createTemp.id,"date":this.createTemp.date,"applyType":this.createTemp.applyType
  1661. }
  1662. },
  1663. {
  1664. "name": "insertSpotList",
  1665. "type": "e",
  1666. "resultmaps": {
  1667. "list": this.listAdd2
  1668. },
  1669. "children": [
  1670. {
  1671. "name": myname,
  1672. "type": "e",
  1673. "parammaps": {
  1674. "id":"@insertSpotList.id",
  1675. "bigId":"@insertSpotList.bigId",
  1676. "partId":"@insertSpotList.partId",
  1677. "partCode":"@insertSpotList.partCode",
  1678. "partName":"@insertSpotList.partName",
  1679. "brandId":"@insertSpotList.brandId",
  1680. "brand":"@insertSpotList.brand",
  1681. "providerId":"@insertSpotList.providerId",
  1682. "providerName":"@insertSpotList.providerName",
  1683. "unit":"@insertSpotList.unit",
  1684. "price":"@insertSpotList.price",
  1685. "remark":"@insertSpotList.remark",
  1686. "specification":"@insertSpotList.specification",
  1687. "amount":"@insertSpotList.amount"
  1688. }
  1689. }
  1690. ]
  1691. },
  1692. {
  1693. "name": "updateBigacceptanceFlowCompeleted", "type": "e",
  1694. "parammaps":{
  1695. id:this.createTemp.id
  1696. }
  1697. },
  1698. {
  1699. "name": "editBigacceptance", "type": "e",
  1700. "parammaps":{
  1701. id:this.createTemp.id,
  1702. lcdate:this.createTemp.lcdate,
  1703. hcdate:this.createTemp.hcdate
  1704. }
  1705. },
  1706. {
  1707. "name": "insertSpotList",
  1708. "resultmaps": { "list": this.listAddCont },
  1709. "children": [
  1710. {
  1711. "name": "editOutsourcingData", "type": "e",
  1712. "parammaps": {
  1713. "id": "@insertSpotList.id",
  1714. "amount": "@insertSpotList.amount",
  1715. "sealNumber": "@insertSpotList.sealNumber",
  1716. "warrantydate": "@insertSpotList.warrantydate"
  1717. }
  1718. }
  1719. ],
  1720. }
  1721. ]
  1722. }
  1723. }
  1724. ExecDataByConfig(send_data).then(response => {
  1725. console.log('编辑保存发送参数', send_data)
  1726. if (response.msg === 'fail') {
  1727. this.$notify({
  1728. title: '保存失败',
  1729. message: response.data,
  1730. type: 'warning',
  1731. duration: 2000
  1732. })
  1733. } else {
  1734. this.dialogFormVisible = false
  1735. this.get_table_data1()
  1736. this.$notify({
  1737. title: '',
  1738. message: '保存成功',
  1739. type: 'success',
  1740. duration: 2000
  1741. })
  1742. }
  1743. })
  1744. },
  1745. form_delete(row) {
  1746. console.log('点击了删除',row)
  1747. MessageBox.confirm('确认删除此条信息?', {
  1748. confirmButtonText: '确认',
  1749. cancelButtonText: '取消',
  1750. type: 'warning'
  1751. }).then(() => {
  1752. var send_data = {
  1753. "common": { "returnmap": "0" },
  1754. "data": [
  1755. {
  1756. "name": "deleteBigacceptance", "type": "e",
  1757. "parammaps": { "id":row.id }
  1758. }
  1759. ]
  1760. }
  1761. ExecDataByConfig(send_data).then(response => {
  1762. this.get_table_data1()
  1763. this.$notify({
  1764. title: '成功',
  1765. message: '删除成功',
  1766. type: 'success',
  1767. duration: 2000
  1768. })
  1769. })
  1770. }).catch(() => {
  1771. this.$message({
  1772. type: 'info',
  1773. message: '已取消删除'
  1774. })
  1775. })
  1776. },
  1777. change_statue(val) {
  1778. if (val == 2) {
  1779. this.statueReason = true
  1780. } else {
  1781. this.statueReason = false
  1782. }
  1783. },
  1784. form_examine(row) {
  1785. console.log('点击了供应处长审核',row)
  1786. if (row == undefined) {
  1787. this.examineTemp = this.createTemp
  1788. this.$set(this.createTemp, 'status', 1)
  1789. this.$set(this.createTemp, 'workflowNote', '')
  1790. } else {
  1791. this.examineTemp = Object.assign({}, row)
  1792. this.$set(this.examineTemp, 'status', 1)
  1793. this.$set(this.examineTemp, 'workflowNote', '')
  1794. }
  1795. this.dialogStatus = 'examine'
  1796. this.dialogFormVisible_Examine = true
  1797. this.statueReason = false
  1798. },
  1799. form_examine_save() {
  1800. console.log('点击了供应处长审核', )
  1801. this.isokDisable = true
  1802. setTimeout(() => {
  1803. this.isokDisable = false
  1804. }, 1000)
  1805. this.$refs['examineTemp'].validate(valid => {
  1806. if (valid) {
  1807. //不通过
  1808. if(this.statueReason){
  1809. this.examineTemp.status = 2
  1810. //审核角色
  1811. this.examineTemp.flowCompeleted = "3"
  1812. } else {
  1813. this.examineTemp.status = 0
  1814. this.examineTemp.flowCompeleted = "2"
  1815. }
  1816. this.examineTemp.empid = Cookies.get('employeid')
  1817. var send_data = {
  1818. "common": { "returnmap": "0" },
  1819. "data": [
  1820. {
  1821. "name": "EditBigacceptanceEquipment", "type": "e",
  1822. "parammaps": this.examineTemp
  1823. }
  1824. ]
  1825. }
  1826. ExecDataByConfig(send_data).then(response => {
  1827. console.log('审核确认发送参数', send_data)
  1828. if (response.msg !== 'fail') {
  1829. this.get_table_data1()
  1830. this.dialogFormVisible_Examine = false
  1831. this.statueReason = false
  1832. this.$notify({
  1833. title: '成功',
  1834. message: '审核成功',
  1835. type: 'success',
  1836. duration: 2000
  1837. })
  1838. } else {
  1839. failproccess(response, this.$notify)
  1840. }
  1841. })
  1842. }
  1843. })
  1844. },
  1845. form_examine2(row) {
  1846. console.log('点击了部门负责人审核',row)
  1847. if (row == undefined) {
  1848. this.examineTemp = this.createTemp
  1849. this.$set(this.createTemp, 'status', 1)
  1850. this.$set(this.createTemp, 'workflowNote', '')
  1851. } else {
  1852. this.examineTemp = Object.assign({}, row)
  1853. this.$set(this.examineTemp, 'status', 1)
  1854. this.$set(this.examineTemp, 'workflowNote', '')
  1855. }
  1856. this.dialogStatus = 'examine'
  1857. this.dialogFormVisible_Examine = true
  1858. this.statueReason = false
  1859. },
  1860. form_examine_save2() {
  1861. console.log('点击了部门负责人审核', )
  1862. this.isokDisable = true
  1863. setTimeout(() => {
  1864. this.isokDisable = false
  1865. }, 1000)
  1866. this.$refs['examineTemp'].validate(valid => {
  1867. if (valid) {
  1868. //不通过
  1869. if(this.statueReason){
  1870. this.examineTemp.status = 2
  1871. //审核角色
  1872. this.examineTemp.flowCompeleted = "5"
  1873. } else {
  1874. this.examineTemp.status = 0
  1875. this.examineTemp.flowCompeleted = "4"
  1876. }
  1877. this.examineTemp.empid = Cookies.get('employeid')
  1878. var send_data = {
  1879. "common": { "returnmap": "0" },
  1880. "data": [
  1881. {
  1882. "name": "EditBigacceptanceDepartment", "type": "e",
  1883. "parammaps": this.examineTemp
  1884. }
  1885. ]
  1886. }
  1887. ExecDataByConfig(send_data).then(response => {
  1888. console.log('审核确认发送参数', send_data)
  1889. if (response.msg !== 'fail') {
  1890. this.get_table_data1()
  1891. this.dialogFormVisible_Examine = false
  1892. this.statueReason = false
  1893. this.$notify({
  1894. title: '成功',
  1895. message: '审核成功',
  1896. type: 'success',
  1897. duration: 2000
  1898. })
  1899. } else {
  1900. failproccess(response, this.$notify)
  1901. }
  1902. })
  1903. }
  1904. })
  1905. },
  1906. form_examine3(row) {
  1907. console.log('点击了场长 审核',row)
  1908. if (row == undefined) {
  1909. this.examineTemp = this.createTemp
  1910. this.$set(this.createTemp, 'status', 1)
  1911. this.$set(this.createTemp, 'workflowNote', '')
  1912. } else {
  1913. this.examineTemp = Object.assign({}, row)
  1914. this.$set(this.examineTemp, 'status', 1)
  1915. this.$set(this.examineTemp, 'workflowNote', '')
  1916. }
  1917. this.dialogStatus = 'examine'
  1918. this.dialogFormVisible_Examine = true
  1919. this.statueReason = false
  1920. },
  1921. form_examine_save3() {
  1922. console.log('点击了场长审核', )
  1923. this.isokDisable = true
  1924. setTimeout(() => {
  1925. this.isokDisable = false
  1926. }, 1000)
  1927. this.$refs['examineTemp'].validate(valid => {
  1928. if (valid) {
  1929. //不通过
  1930. if(this.statueReason){
  1931. this.examineTemp.status = 2
  1932. //审核角色
  1933. this.examineTemp.flowCompeleted = "7"
  1934. } else {
  1935. this.examineTemp.status = 1
  1936. this.examineTemp.flowCompeleted = "6"
  1937. }
  1938. this.examineTemp.empid = Cookies.get('employeid')
  1939. var send_data = {
  1940. "common": { "returnmap": "0" },
  1941. "data": [
  1942. {
  1943. "name": "EditBigacceptanceField", "type": "e",
  1944. "parammaps": this.examineTemp
  1945. }
  1946. ]
  1947. }
  1948. ExecDataByConfig(send_data).then(response => {
  1949. console.log('审核确认发送参数', send_data)
  1950. if (response.msg !== 'fail') {
  1951. this.get_table_data1()
  1952. this.dialogFormVisible_Examine = false
  1953. this.statueReason = false
  1954. this.$notify({
  1955. title: '成功',
  1956. message: '审核成功',
  1957. type: 'success',
  1958. duration: 2000
  1959. })
  1960. } else {
  1961. failproccess(response, this.$notify)
  1962. }
  1963. })
  1964. }
  1965. })
  1966. },
  1967. form_submit(row){
  1968. MessageBox.confirm('确认提交此条信息?', {
  1969. confirmButtonText: '确认',
  1970. cancelButtonText: '取消',
  1971. type: 'warning'
  1972. }).then(() => {
  1973. if(row.isPartapply == 1){
  1974. var send_data1 = {
  1975. "name": "checkOutsourcingAmount",
  1976. "parammaps": { "outsourcingCode":row.outsourcingCode }
  1977. }
  1978. var send_data2 = {
  1979. "common": { "returnmap": "0" },
  1980. "data": [
  1981. {
  1982. "name": "editBigacceptanceIsAcceptance", "type": "e",
  1983. "parammaps": { "id":row.id }
  1984. }
  1985. ]
  1986. }
  1987. GetDataByName(send_data1).then(response => {
  1988. if(parseFloat(response.data.list[0].amount) !== 0){
  1989. this.save_submit(send_data2)
  1990. }else{
  1991. this.$message({
  1992. type: 'error',
  1993. message: '数据未填写,请完善相关信息'
  1994. })
  1995. }
  1996. })
  1997. }else{
  1998. this.$message({ type: 'warning', message: '备件未领用,暂时不能提交。', duration: 2000 })
  1999. }
  2000. }).catch(() => {
  2001. this.$message({
  2002. type: 'info',
  2003. message: '已取消提交'
  2004. })
  2005. })
  2006. },
  2007. save_submit(send_data){
  2008. ExecDataByConfig(send_data).then(response => {
  2009. if (response.msg !== 'fail') {
  2010. this.$notify({ title: '成功', message: '提交成功', type: 'success', duration: 2000 })
  2011. this.get_table_data1()
  2012. }
  2013. })
  2014. }
  2015. }
  2016. }
  2017. </script>
  2018. <style lang="scss" scoped>
  2019. .content{
  2020. padding: 20px 20px;
  2021. .title{
  2022. text-align: center;
  2023. font-weight: 700;
  2024. }
  2025. .title2{
  2026. float: left;
  2027. font-weight: 700;
  2028. padding: 10px 0;
  2029. }
  2030. }
  2031. </style>