tab2.vue 102 KB

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