index.vue 117 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799
  1. <template>
  2. <div class="app-container">
  3. <div v-if="isPercentage" class="percentage" style="width: 210px;height: 90px;background: #fff;position: fixed;bottom: 0;left: 0;z-index: 9999999999999;">
  4. <h4 style="padding-left: 10px;line-height: 0;">导出进度:</h4>
  5. <el-progress style="padding-left: 10px;" :text-inside="true" :stroke-width="26" :percentage="percentage" />
  6. </div>
  7. <el-tabs v-model="activeName" @tab-click="handleClick">
  8. <el-tab-pane label="合同管理" name="first">
  9. <div class="filter-container">
  10. <el-select v-model="getdataListParm.parammaps.pastureName" placeholder="牧场" style="width:120px" class="filter-item">
  11. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  12. </el-select>
  13. <el-input v-model="getdataListParm.parammaps.contractCode" placeholder="合同编号" style="width: 140px;" class="filter-item" />
  14. <el-select v-model="getdataListParm.parammaps.statue" clearable placeholder="合同状态" class="filter-item" style="width: 120px;">
  15. <el-option v-for="item in statues" :key="item.id" :label="item.name" :value="item.name" />
  16. </el-select>
  17. <el-select v-model="getdataListParm.parammaps.providerName" filterable clearable style="width: 140px;" placeholder="供应商" class="filter-item">
  18. <el-option v-for="item in findAllProvider" :key="item.id" :label="item.name" :value="item.name" />
  19. </el-select>
  20. <el-select v-model="getdataListParm.parammaps.stuteSH" clearable placeholder="审核状态" class="filter-item" style="width: 120px;">
  21. <el-option v-for="item in shStatues" :key="item.id" :label="item.name" :value="item.id" />
  22. </el-select>
  23. <el-date-picker ref="inputDatetime" v-model="getdataListParm.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 250px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
  24. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
  25. <div>
  26. <el-button v-if="isContractAdd" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button>
  27. <el-button v-if="isContractTemplate" v-waves class="filter-item" type="info" icon="el-icon-tickets" @click="handleDownloadTemp">模板</el-button>
  28. <el-upload style="display: inline-block;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImportExcel" :on-success="handleImportExcelSuccess">
  29. <el-button v-if="isContractImport" v-waves class="filter-item" type="warning" icon="el-icon-download">导入</el-button>
  30. </el-upload>
  31. <el-button v-if="isContractExport" v-waves class="filter-item" type="success" icon="el-icon-upload2" @click="handleDownload">导出</el-button>
  32. <el-radio-group v-model="radioAll" style="margin-top:-9px" @change="changeAll()">
  33. <el-radio-button label="全部" />
  34. <el-radio-button label="待处理" />
  35. <el-radio-button label="已处理" />
  36. </el-radio-group>
  37. </div>
  38. </div>
  39. <el-table
  40. :key="tableKey"
  41. v-loading="listLoading"
  42. element-loading-text="给我一点时间"
  43. :data="list"
  44. border
  45. fit
  46. highlight-current-row
  47. style="width: 100%;"
  48. :row-style="rowStyle"
  49. :cell-style="cellStyle"
  50. class="elTable"
  51. :cell-class-name="tableCellClassName"
  52. >
  53. <el-table-column label="序号" align="center" type="index" width="50px">
  54. <template slot-scope="scope">
  55. <span>{{ scope.$index + (pageNum-1) * pageSize + 1 }}</span>
  56. </template>
  57. </el-table-column>
  58. <el-table-column label="牧场" min-width="110px" align="center">
  59. <template slot-scope="scope">
  60. <span>{{ scope.row.pastureName }}</span>
  61. </template>
  62. </el-table-column>
  63. <el-table-column label="合同编号" min-width="130px" align="center">
  64. <template slot-scope="scope">
  65. <span>{{ scope.row.contractCode }}</span>
  66. </template>
  67. </el-table-column>
  68. <el-table-column label="合同状态" min-width="100px" align="center">
  69. <template slot-scope="scope">
  70. <span>{{ scope.row.statue }}</span>
  71. </template>
  72. </el-table-column>
  73. <el-table-column label="供应商" min-width="120px" align="center">
  74. <template slot-scope="scope">
  75. <span>{{ scope.row.providerName }}</span>
  76. </template>
  77. </el-table-column>
  78. <el-table-column label="合同开始日期" sortable prop="startTime" min-width="110px" align="center" />
  79. <el-table-column label="合同截止日期" sortable prop="stopTime" min-width="110px" align="center" />
  80. <el-table-column label="录入人" prop="creatorMan" min-width="100px" align="center" />
  81. <el-table-column label="录入时间" sortable prop="creatorTime" min-width="110px" align="center" />
  82. <el-table-column label="审核状态" min-width="110px" align="center" :formatter="SHStatus" />
  83. <el-table-column label="操作" align="center" width="300px" class-name="small-padding fixed-width" fixed="right">
  84. <template slot-scope="{row}">
  85. <el-button v-if="isContractSee" type="primary" size="mini" @click="form_see(row)">查看</el-button>
  86. <el-button v-if="isContractChange && row.statue=='正常' && row.SHStatus == 7" type="warning" size="mini" @click="handleChange(row)">变更</el-button>
  87. <!-- <el-button type="success" size="mini" @click="form_edit(row)">编辑</el-button> -->
  88. <!-- 设备主管审核 -->
  89. <el-button v-if="isContractExamineZG && row.SHStatus == 2" type="success" style="display:inline-block" size="mini" @click="handleExamine(row)">审核1</el-button>
  90. <el-button v-else type="success" style="display:none" size="mini" @click="handleExamine(row)">审核1</el-button>
  91. <!-- 设备助理审核 -->
  92. <!-- <el-button v-if="isContractExamineZL && row.SHStatus == 3" type="success" style="display:inline-block" size="mini" @click="handleExamine2(row)">审核2</el-button>
  93. <el-button v-else type="success" style="display:none" size="mini" @click="handleExamine2(row)">审核2</el-button> -->
  94. <!-- 设备中心审核 -->
  95. <el-button v-if="isContractExamineZX && row.SHStatus == 5" type="success" style="display:inline-block" size="mini" @click="handleExamine3(row)">审核2</el-button>
  96. <el-button v-else type="success" style="display:none" size="mini" @click="handleExamine3(row)">审核2</el-button>
  97. <el-button v-if="isContractDelete && (row.SHStatus == 4 || row.SHStatus == 6 || row.SHStatus == 8) " type="danger" size="mini" @click="form_delete(row)">删除</el-button>
  98. <el-button v-if="isContractDelete2" type="danger" size="mini" @click="form_delete(row)">删除</el-button>
  99. </template>
  100. </el-table-column>
  101. </el-table>
  102. <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="getList" />
  103. </el-tab-pane>
  104. <el-tab-pane label="合同明细" name="second">
  105. <div class="filter-container">
  106. <el-select v-model="getdataListParm2.parammaps.pastureName" placeholder="牧场" style="width:120px" class="filter-item">
  107. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  108. </el-select>
  109. <el-input v-model="getdataListParm2.parammaps.contractCode" placeholder="合同编号" style="width: 140px;" class="filter-item" />
  110. <el-select v-model="getdataListParm2.parammaps.statue" clearable placeholder="合同状态" class="filter-item" style="width: 120px;">
  111. <el-option v-for="item in statues" :key="item.id" :label="item.name" :value="item.name" />
  112. </el-select>
  113. <el-input v-model="getdataListParm2.parammaps.partCode" placeholder="备件编号" style="width: 140px;" class="filter-item" />
  114. <el-input v-model="getdataListParm2.parammaps.partName" placeholder="备件名称" style="width: 140px;" class="filter-item" />
  115. <el-select v-model="getdataListParm2.parammaps.providerName" filterable clearable style="width: 140px;" placeholder="供应商" class="filter-item">
  116. <el-option v-for="item in findAllProvider" :key="item.id" :label="item.name" :value="item.name" />
  117. </el-select>
  118. <el-date-picker ref="inputDatetime2" v-model="getdataListParm2.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="结束日期" />
  119. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search2">搜索</el-button>
  120. </div>
  121. <el-table
  122. :key="tableKey2"
  123. v-loading="listLoading2"
  124. element-loading-text="给我一点时间"
  125. :data="list2"
  126. border
  127. fit
  128. highlight-current-row
  129. style="width: 100%;"
  130. :row-style="rowStyle"
  131. :cell-style="cellStyle"
  132. class="elTable"
  133. :cell-class-name="tableCellClassName"
  134. >
  135. <el-table-column label="序号" align="center" type="index" width="50px">
  136. <template slot-scope="scope">
  137. <span>{{ scope.$index + (pageNum2-1) * pageSize2 + 1 }}</span>
  138. </template>
  139. </el-table-column>
  140. <el-table-column label="牧场" min-width="110px" align="center">
  141. <template slot-scope="scope">
  142. <span>{{ scope.row.pastureName }}</span>
  143. </template>
  144. </el-table-column>
  145. <el-table-column label="合同编号" min-width="130px" align="center">
  146. <template slot-scope="scope">
  147. <span>{{ scope.row.contractCode }}</span>
  148. </template>
  149. </el-table-column>
  150. <el-table-column label="合同状态" min-width="100px" align="center">
  151. <template slot-scope="scope">
  152. <span>{{ scope.row.statue }}</span>
  153. </template>
  154. </el-table-column>
  155. <el-table-column label="供应商" min-width="120px" align="center">
  156. <template slot-scope="scope">
  157. <span>{{ scope.row.providerName }}</span>
  158. </template>
  159. </el-table-column>
  160. <el-table-column label="合同开始日期" min-width="110px" align="center">
  161. <template slot-scope="scope">
  162. <span>{{ scope.row.startTime }}</span>
  163. </template>
  164. </el-table-column>
  165. <el-table-column label="合同截止日期" min-width="110px" align="center">
  166. <template slot-scope="scope">
  167. <span>{{ scope.row.stopTime }}</span>
  168. </template>
  169. </el-table-column>
  170. <el-table-column label="零库存" min-width="100px" align="center" :formatter="isZeroStock" />
  171. <el-table-column label="备件编号" min-width="110px" align="center">
  172. <template slot-scope="scope">
  173. <span>{{ scope.row.partCode }}</span>
  174. </template>
  175. </el-table-column>
  176. <el-table-column label="备件名称" min-width="110px" align="center">
  177. <template slot-scope="scope">
  178. <span>{{ scope.row.partName }}</span>
  179. </template>
  180. </el-table-column>
  181. <el-table-column label="备件规格" min-width="110px" align="center">
  182. <template slot-scope="scope">
  183. <span>{{ scope.row.specification }}</span>
  184. </template>
  185. </el-table-column>
  186. <el-table-column label="备件品牌" min-width="110px" align="center">
  187. <template slot-scope="scope">
  188. <span>{{ scope.row.brand }}</span>
  189. </template>
  190. </el-table-column>
  191. <el-table-column label="计量单位" min-width="110px" align="center">
  192. <template slot-scope="scope">
  193. <span>{{ scope.row.unit }}</span>
  194. </template>
  195. </el-table-column>
  196. <el-table-column label="计划量" min-width="110px" align="center">
  197. <template slot-scope="scope">
  198. <span>{{ scope.row.planAmount }}</span>
  199. </template>
  200. </el-table-column>
  201. <el-table-column label="单价" min-width="110px" align="center">
  202. <template slot-scope="scope">
  203. <span>{{ scope.row.price }}</span>
  204. </template>
  205. </el-table-column>
  206. <el-table-column label="备注" min-width="110px" align="center">
  207. <template slot-scope="scope">
  208. <span>{{ scope.row.remark }}</span>
  209. </template>
  210. </el-table-column>
  211. <el-table-column label="录入人" min-width="110px" align="center">
  212. <template slot-scope="scope">
  213. <span>{{ scope.row.creatorMan }}</span>
  214. </template>
  215. </el-table-column>
  216. <el-table-column label="录入日期" min-width="110px" align="center">
  217. <template slot-scope="scope">
  218. <span>{{ scope.row.creatorTime }}</span>
  219. </template>
  220. </el-table-column>
  221. <!-- <el-table-column label="审核状态" min-width="110px" align="center" :formatter="SHStatus" /> -->
  222. </el-table>
  223. <pagination v-show="total2>0" :total="total2" :page.sync="getdataListParm2.offset" :limit.sync="getdataListParm2.pagecount" @pagination="getList2" />
  224. </el-tab-pane>
  225. </el-tabs>
  226. <!-- 弹出层新增or 修改 -->
  227. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="90%">
  228. <div class="app-add">
  229. <el-form
  230. ref="createTemp"
  231. :rules="rules"
  232. :model="createTemp"
  233. label-position="right"
  234. label-width="120px"
  235. style="width: 90%;margin:0 auto;"
  236. >
  237. <el-row>
  238. <el-col :span="8">
  239. <el-form-item label="合同编号:" prop="contractCode">
  240. <el-input ref="contractCode" v-model="createTemp.contractCode" disabled />
  241. </el-form-item>
  242. </el-col>
  243. <el-col :span="8">
  244. <el-form-item label="牧场:" prop="pastureId">
  245. <el-select v-model="createTemp.pastureId" placeholder="牧场" class="filter-item" style="width:100%;" :disabled="isDisabled">
  246. <el-option
  247. v-for="item in findAllPasture"
  248. :key="item.id"
  249. :label="item.name"
  250. :value="item.id"
  251. />
  252. </el-select>
  253. </el-form-item>
  254. </el-col>
  255. <el-col :span="8">
  256. <el-form-item label="供应商:" prop="providerName">
  257. <el-autocomplete
  258. v-model="createTemp.providerName"
  259. :disabled="dialogStatus==='change'"
  260. value-key="name"
  261. class="inline-input"
  262. :fetch-suggestions="providerSearch"
  263. placeholder="请输入供应商名称或供应商编号"
  264. style="width:100%;"
  265. @focus="handleFocusProvider"
  266. @blur="handleBlurProvider"
  267. @select="handleSelectProvider"
  268. />
  269. </el-form-item>
  270. </el-col>
  271. </el-row>
  272. <el-row>
  273. <el-col :span="8">
  274. <el-form-item label="开始日期:" prop="startTime">
  275. <el-date-picker
  276. v-model="createTemp.startTime"
  277. :disabled="isDisabled"
  278. type="date"
  279. placeholder="开始日期"
  280. style="width:100%;"
  281. :picker-options="pickerOptions1"
  282. format="yyyy-MM-dd"
  283. value-format="yyyy-MM-dd"
  284. @change="changeTime"
  285. />
  286. </el-form-item>
  287. </el-col>
  288. <el-col :span="8">
  289. <el-form-item label="截止日期:" prop="stopTime">
  290. <el-date-picker
  291. v-model="createTemp.stopTime"
  292. style="width:100%;"
  293. :disabled="isDisabled"
  294. type="date"
  295. placeholder="结束日期"
  296. :picker-options="pickerOptions2"
  297. format="yyyy-MM-dd"
  298. value-format="yyyy-MM-dd"
  299. @change="changeTime"
  300. />
  301. </el-form-item>
  302. </el-col>
  303. <el-col v-if="dialogStatus=='create'" :span="8">
  304. <el-form-item label="合同状态:" prop="statue">
  305. <el-select v-model="createTemp.statue" clearable placeholder="合同状态" class="filter-item" style="width: 100%;" disabled>
  306. <el-option
  307. v-for="item in statues"
  308. :key="item.id"
  309. :label="item.name"
  310. :value="item.name"
  311. />
  312. </el-select>
  313. </el-form-item>
  314. </el-col>
  315. <el-col v-if="dialogStatus=='change'" :span="8">
  316. <el-form-item label="合同状态:" prop="statue">
  317. <el-select v-model="createTemp.statue" clearable placeholder="合同状态" class="filter-item" style="width: 100%;"@change="changeStatues">
  318. <el-option
  319. v-for="item in statues2"
  320. :key="item.id"
  321. :label="item.name"
  322. :value="item.name"
  323. />
  324. </el-select>
  325. </el-form-item>
  326. </el-col>
  327. </el-row>
  328. <el-row>
  329. <el-col :span="8">
  330. <el-form-item label="零库存:" prop="isZeroStock">
  331. <el-radio-group v-model="createTemp.isZeroStock" :disabled="isDisabled" @change="changeIsZero">
  332. <el-radio v-model="createTemp.isZeroStock" :label="1">是</el-radio>
  333. <el-radio v-model="createTemp.isZeroStock" :label="0">否</el-radio>
  334. </el-radio-group>
  335. </el-form-item>
  336. </el-col>
  337. <el-col :span="8">
  338. <el-form-item label="录入人:" prop="creatorId">
  339. <el-select ref="creatorId" v-model="createTemp.creatorId" :disabled="isDisabled" placeholder="录入人" class="filter-item" style="width:100%;">
  340. <el-option
  341. v-for="item in findAllEmploye"
  342. :key="item.id"
  343. :label="item.name"
  344. :value="item.id"
  345. />
  346. </el-select>
  347. </el-form-item>
  348. </el-col>
  349. <el-col :span="8">
  350. <el-form-item label="录入日期:" prop="creatorTime">
  351. <el-date-picker
  352. v-model="createTemp.creatorTime"
  353. :disabled="isDisabled"
  354. type="date"
  355. :picker-options="pickerOptions3"
  356. placeholder="录入日期"
  357. style="width:100%;"
  358. format="yyyy-MM-dd"
  359. value-format="yyyy-MM-dd"
  360. />
  361. </el-form-item>
  362. </el-col>
  363. </el-row>
  364. <el-row>
  365. <el-col :span="8">
  366. <el-form-item label="备注:" prop="remark">
  367. <el-input
  368. v-model="createTemp.remark"
  369. :disabled="isDisabled"
  370. />
  371. </el-form-item>
  372. </el-col>
  373. </el-row>
  374. <el-row>
  375. <el-col :span="16">
  376. <el-form-item label="备件:" prop="partCode">
  377. <el-autocomplete
  378. v-model="orderPart.partCode"
  379. :disabled="isDisabled"
  380. value-key="name"
  381. class="inline-input"
  382. :fetch-suggestions="sparePartSearch"
  383. placeholder="请输入备件编号或备件名称或备件规格"
  384. style="width:100%"
  385. @select="handleSelectSparePart"
  386. >
  387. <template slot-scope="{ item }">
  388. <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>&nbsp;
  389. | &nbsp;<b>备件名称:</b><span class="addr">{{ item.partName }}</span>&nbsp;
  390. | &nbsp;<b>备件规格:</b><span class="addr">{{ item.specification }}</span>
  391. </template>
  392. </el-autocomplete>
  393. </el-form-item>
  394. </el-col>
  395. </el-row>
  396. </el-form>
  397. <el-table
  398. :key="tableKey"
  399. v-loading="listLoadingAdd"
  400. element-loading-text="给我一点时间"
  401. :data="listAdd"
  402. border
  403. fit
  404. highlight-current-row
  405. style="width: 100%;margin-bottom:50px"
  406. :row-style="rowStyle"
  407. :cell-style="cellStyle"
  408. class="elTable"
  409. >
  410. <el-table-column label="序号" align="center" type="index" width="50" />
  411. <!-- <el-table-column label="序号" align="center" type="index" width="50px">
  412. <template slot-scope="scope">
  413. <span>{{ scope.$index }}</span>
  414. </template>
  415. </el-table-column> -->
  416. <el-table-column label="备件编号" min-width="90px" align="center">
  417. <template slot-scope="scope">
  418. <span>{{ scope.row.partCode }}</span>
  419. </template>
  420. </el-table-column>
  421. <el-table-column label="备件名称" min-width="80px" align="center">
  422. <template slot-scope="scope">
  423. <span>{{ scope.row.partName }}</span>
  424. </template>
  425. </el-table-column>
  426. <el-table-column label="备件规格" min-width="80px" align="center">
  427. <template slot-scope="scope">
  428. <span>{{ scope.row.specification }}</span>
  429. </template>
  430. </el-table-column>
  431. <el-table-column label="备件图片" prop="specifications" align="center" min-width="110px">
  432. <template slot-scope="scope">
  433. <el-popover placement="right" title="" trigger="hover">
  434. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  435. <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  436. </el-popover>
  437. </template>
  438. </el-table-column>
  439. <el-table-column label="备件品牌" min-width="120px" align="center">
  440. <template slot-scope="scope">
  441. <el-autocomplete
  442. v-model="scope.row.brand"
  443. :disabled="isDisabled"
  444. value-key="brandName"
  445. class="inline-input"
  446. :fetch-suggestions="brandSearch"
  447. placeholder="请输入品牌"
  448. style="width:100%;"
  449. @focus="handleFocusBrand( scope.row)"
  450. @blur="handleBlurBrand(scope.row)"
  451. @select="(value)=>
  452. {handleSelectBrand(value, scope.row)}"
  453. />
  454. </template>
  455. </el-table-column>
  456. <el-table-column label="计量单位" min-width="60px" align="center">
  457. <template slot-scope="scope">
  458. <span>{{ scope.row.unit }}</span>
  459. </template>
  460. </el-table-column>
  461. <el-table-column label="计划量" min-width="70px" align="center" valign="middle">
  462. <template slot-scope="scope">
  463. <el-form :model="scope.row" :rules="rules">
  464. <el-form-item prop="planAmount">
  465. <el-input ref="planAmount" v-model="scope.row.planAmount" style="margin-top:15px" :disabled="isDisabled" />
  466. </el-form-item>
  467. </el-form>
  468. </template>
  469. </el-table-column>
  470. <el-table-column label="单价" min-width="80px" align="center" valign="middle">
  471. <template slot-scope="scope">
  472. <el-input v-model="scope.row.price" :disabled="isDisabled" />
  473. </template>
  474. </el-table-column>
  475. <el-table-column label="备注" min-width="110px" align="center">
  476. <template slot-scope="scope">
  477. <el-input v-model="scope.row.remark" type="textarea" placeholder="备注" :disabled="isDisabled" autosize maxlength="100" show-word-limit />
  478. </template>
  479. </el-table-column>
  480. <el-table-column v-if="isDisabled2" label="操作" align="center" width="100px" class-name="small-padding fixed-width" fixed="right">
  481. <template slot-scope="{row}">
  482. <a class="del" @click="partDelete(row)">删除</a>
  483. </template>
  484. </el-table-column>
  485. </el-table>
  486. <div slot="footer" class="dialog-footer" style="bottom:5px">
  487. <el-button type="primary" :disabled="isokDisable" @click="dialogStatus==='create'?add_dialog_save():add_dialog_save()">保存并关闭</el-button>
  488. <el-button @click="dialogFormVisible = false;getList();createTemp.providerName=''">取消并关闭</el-button>
  489. </div>
  490. </div>
  491. </el-dialog>
  492. <!-- 变更 -->
  493. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_change" :close-on-click-modal="false" width="90%">
  494. <div class="app-add">
  495. <el-form
  496. ref="createTemp"
  497. :rules="rules"
  498. :model="createTemp"
  499. label-position="right"
  500. label-width="120px"
  501. style="width: 90%;margin:0 auto;"
  502. >
  503. <el-row>
  504. <el-col :span="8">
  505. <el-form-item label="合同编号:" prop="contractCode">
  506. <el-input ref="contractCode" v-model="createTemp.contractCode" disabled />
  507. </el-form-item>
  508. </el-col>
  509. <el-col :span="8">
  510. <el-form-item label="牧场:" prop="pastureId">
  511. <el-select v-model="createTemp.pastureId" placeholder="牧场" class="filter-item" style="width:100%;" :disabled="isDisabled">
  512. <el-option
  513. v-for="item in findAllPasture"
  514. :key="item.id"
  515. :label="item.name"
  516. :value="item.id"
  517. />
  518. </el-select>
  519. </el-form-item>
  520. </el-col>
  521. <el-col :span="8">
  522. <el-form-item label="供应商:" prop="providerName">
  523. <el-autocomplete
  524. v-model="createTemp.providerName"
  525. :disabled="dialogStatus==='change'"
  526. value-key="name"
  527. class="inline-input"
  528. :fetch-suggestions="providerSearch"
  529. placeholder="请输入供应商名称或供应商编号"
  530. style="width:100%;"
  531. @focus="handleFocusProvider"
  532. @blur="handleBlurProvider"
  533. @select="handleSelectProvider"
  534. />
  535. </el-form-item>
  536. </el-col>
  537. </el-row>
  538. <el-row>
  539. <el-col :span="8">
  540. <el-form-item label="开始日期:" prop="startTime">
  541. <el-date-picker
  542. v-model="createTemp.startTime"
  543. :disabled="isDisabled"
  544. type="date"
  545. placeholder="开始日期"
  546. :picker-options="pickerOptions1"
  547. format="yyyy-MM-dd"
  548. value-format="yyyy-MM-dd"
  549. style="width:100%"
  550. @change="changeTime"
  551. />
  552. </el-form-item>
  553. </el-col>
  554. <el-col :span="8">
  555. <el-form-item label="截止日期:" prop="stopTime">
  556. <el-date-picker
  557. v-model="createTemp.stopTime"
  558. :disabled="isDisabled"
  559. type="date"
  560. placeholder="结束日期"
  561. :picker-options="pickerOptions2"
  562. format="yyyy-MM-dd"
  563. value-format="yyyy-MM-dd"
  564. style="width:100%"
  565. @change="changeTime"
  566. />
  567. </el-form-item>
  568. </el-col>
  569. <el-col v-if="dialogStatus=='create'" :span="8">
  570. <el-form-item label="合同状态:" prop="statue">
  571. <el-select v-model="createTemp.statue" clearable placeholder="合同状态" class="filter-item" style="width: 100%;" disabled>
  572. <el-option
  573. v-for="item in statues"
  574. :key="item.id"
  575. :label="item.name"
  576. :value="item.name"
  577. />
  578. </el-select>
  579. </el-form-item>
  580. </el-col>
  581. <el-col v-if="dialogStatus=='change'" :span="8">
  582. <el-form-item label="合同状态:" prop="statue">
  583. <el-select v-model="createTemp.statue" clearable placeholder="合同状态" class="filter-item" style="width: 100%;"@change="changeStatues">
  584. <el-option
  585. v-for="item in statues2"
  586. :key="item.id"
  587. :label="item.name"
  588. :value="item.name"
  589. />
  590. </el-select>
  591. </el-form-item>
  592. </el-col>
  593. </el-row>
  594. <el-row>
  595. <el-col :span="8">
  596. <el-form-item label="零库存:" prop="isZeroStock">
  597. <el-radio-group v-model="createTemp.isZeroStock" :disabled="isDisabled" @change="changeIsZero">
  598. <el-radio v-model="createTemp.isZeroStock" :label="1">是</el-radio>
  599. <el-radio v-model="createTemp.isZeroStock" :label="0">否</el-radio>
  600. </el-radio-group>
  601. </el-form-item>
  602. </el-col>
  603. <el-col :span="8">
  604. <el-form-item label="录入人:" prop="creatorId">
  605. <el-select ref="creatorId" v-model="createTemp.creatorId" :disabled="isDisabled" placeholder="录入人" class="filter-item" style="width:100%;">
  606. <el-option
  607. v-for="item in findAllEmploye"
  608. :key="item.id"
  609. :label="item.name"
  610. :value="item.id"
  611. />
  612. </el-select>
  613. </el-form-item>
  614. </el-col>
  615. <el-col :span="8">
  616. <el-form-item label="录入日期:" prop="creatorTime">
  617. <el-date-picker
  618. v-model="createTemp.creatorTime"
  619. :disabled="isDisabled"
  620. type="date"
  621. :picker-options="pickerOptions3"
  622. placeholder="录入日期"
  623. style="width:100%;"
  624. format="yyyy-MM-dd"
  625. value-format="yyyy-MM-dd"
  626. />
  627. </el-form-item>
  628. </el-col>
  629. </el-row>
  630. <el-row>
  631. <el-col :span="8">
  632. <el-form-item label="备注:" prop="remark">
  633. <el-input
  634. v-model="createTemp.remark"
  635. :disabled="isDisabled"
  636. />
  637. </el-form-item>
  638. </el-col>
  639. </el-row>
  640. <el-row>
  641. <el-col :span="10">
  642. <el-form-item label="备件:" prop="partCode">
  643. <el-autocomplete
  644. v-model="orderPart.partCode"
  645. :disabled="isDisabled"
  646. value-key="name"
  647. class="inline-input"
  648. :fetch-suggestions="sparePartSearch"
  649. placeholder="请输入备件编号或备件名称或备件规格"
  650. style="width:550px"
  651. @select="handleSelectSparePart"
  652. >
  653. <template slot-scope="{ item }">
  654. <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>&nbsp;
  655. | &nbsp;<b>备件名称:</b><span class="addr">{{ item.partName }}</span>&nbsp;
  656. | &nbsp;<b>备件规格:</b><span class="addr">{{ item.specification }}</span>
  657. </template>
  658. </el-autocomplete>
  659. </el-form-item>
  660. </el-col>
  661. </el-row>
  662. </el-form>
  663. <el-table
  664. :key="tableKey"
  665. v-loading="listLoadingAdd"
  666. element-loading-text="给我一点时间"
  667. :data="listAdd"
  668. border
  669. fit
  670. highlight-current-row
  671. style="width: 100%;"
  672. :row-style="rowStyle"
  673. :cell-style="cellStyle"
  674. class="elTable"
  675. >
  676. <el-table-column label="序号" align="center" type="index" width="50px">
  677. <template slot-scope="scope">
  678. <span>{{ scope.$index + (pageNumChange-1) * pageSizeChange + 1 }}</span>
  679. </template>
  680. </el-table-column>
  681. <el-table-column label="备件编号" min-width="90px" align="center">
  682. <template slot-scope="scope">
  683. <span>{{ scope.row.partCode }}</span>
  684. </template>
  685. </el-table-column>
  686. <el-table-column label="备件名称" min-width="80px" align="center">
  687. <template slot-scope="scope">
  688. <span>{{ scope.row.partName }}</span>
  689. </template>
  690. </el-table-column>
  691. <el-table-column label="备件规格" min-width="80px" align="center">
  692. <template slot-scope="scope">
  693. <span>{{ scope.row.specification }}</span>
  694. </template>
  695. </el-table-column>
  696. <el-table-column label="备件图片" prop="specifications" align="center" min-width="110px">
  697. <template slot-scope="scope">
  698. <el-popover placement="right" title="" trigger="hover">
  699. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  700. <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  701. </el-popover>
  702. </template>
  703. </el-table-column>
  704. <el-table-column label="备件品牌" min-width="120px" align="center">
  705. <template slot-scope="scope">
  706. <el-autocomplete
  707. v-model="scope.row.brand"
  708. :disabled="isDisabled"
  709. value-key="brandName"
  710. class="inline-input"
  711. :fetch-suggestions="brandSearch"
  712. placeholder="请输入品牌"
  713. style="width:100%;"
  714. @focus="handleFocusBrand( scope.row)"
  715. @blur="handleBlurBrand(scope.row)"
  716. @select="(value)=>
  717. {handleSelectBrand(value, scope.row)}"
  718. />
  719. </template>
  720. </el-table-column>
  721. <el-table-column label="计量单位" min-width="60px" align="center">
  722. <template slot-scope="scope">
  723. <span>{{ scope.row.unit }}</span>
  724. </template>
  725. </el-table-column>
  726. <el-table-column label="计划量" min-width="70px" align="center" valign="middle">
  727. <template slot-scope="scope">
  728. <el-form :model="scope.row" :rules="rules">
  729. <el-form-item prop="planAmount">
  730. <el-input ref="planAmount" v-model="scope.row.planAmount" style="margin-top:15px" :disabled="isDisabled" />
  731. </el-form-item>
  732. </el-form>
  733. </template>
  734. </el-table-column>
  735. <el-table-column label="单价" min-width="80px" align="center" valign="middle">
  736. <template slot-scope="scope">
  737. <el-input v-model="scope.row.price" :disabled="isDisabled" />
  738. </template>
  739. </el-table-column>
  740. <el-table-column label="备注" min-width="110px" align="center">
  741. <template slot-scope="scope">
  742. <el-input v-model="scope.row.remark" type="textarea" placeholder="备注" :disabled="isDisabled" autosize maxlength="100" show-word-limit />
  743. </template>
  744. </el-table-column>
  745. <el-table-column v-if="isDisabled2" label="操作" align="center" width="100px" class-name="small-padding fixed-width" fixed="right">
  746. <template slot-scope="{row}">
  747. <a class="primary" :disabled="isokDisable" @click="partSmallSave(row)">保存</a>
  748. <a class="del" :disabled="isokDisable" @click="partSmallDelete(row)">删除</a>
  749. </template>
  750. </el-table-column>
  751. </el-table>
  752. <pagination v-show="totalChange>0" :total="totalChange" :page.sync="getdataListParmChange.offset" :limit.sync="getdataListParmChange.pagecount" @pagination="getListChange" />
  753. <div slot="footer" class="dialog-footer" style="bottom:5px">
  754. <el-button type="primary" :disabled="isokDisable" @click="dialogStatus==='change'?changeData():changeData()">保存并关闭</el-button>
  755. <el-button @click="dialogFormVisible_change = false;getList();createTemp.providerName=''">取消并关闭</el-button>
  756. </div>
  757. </div>
  758. </el-dialog>
  759. <!-- 查看 -->
  760. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_See" :close-on-click-modal="false" width="90%">
  761. <div class="app-contentcard">
  762. <el-form ref="seeTemp" :rules="rules" :model="seeTemp" label-position="right" label-width="120px" style="width: 90%;margin:0 auto;">
  763. <el-row>
  764. <el-col :span="8">
  765. <el-form-item label="牧场:" prop="pastureName">
  766. <span> {{ seeTemp.pastureName }} </span>
  767. </el-form-item>
  768. </el-col>
  769. <el-col :span="8">
  770. <el-form-item label="合同编号:" prop="contractCode">
  771. <span> {{ seeTemp.contractCode }} </span>
  772. <!-- <el-input ref="contractNO" v-model="seeTemp.contractNO" /> -->
  773. </el-form-item>
  774. </el-col>
  775. <el-col :span="8">
  776. <el-form-item label="供应商:" prop="providerName">
  777. <span> {{ seeTemp.providerName }} </span>
  778. </el-form-item>
  779. </el-col>
  780. </el-row>
  781. <el-row>
  782. <el-col :span="8">
  783. <el-form-item label="开始日期:" prop="startTime">
  784. <span> {{ seeTemp.startTime }} </span>
  785. </el-form-item>
  786. </el-col>
  787. <el-col :span="8">
  788. <el-form-item label="截止日期:" prop="stopTime">
  789. <span> {{ seeTemp.stopTime }} </span>
  790. </el-form-item>
  791. </el-col>
  792. <el-col :span="8">
  793. <el-form-item label="合同状态:" prop="statue">
  794. <span> {{ seeTemp.statue }} </span>
  795. </el-form-item>
  796. </el-col>
  797. </el-row>
  798. <el-row>
  799. <el-col :span="8">
  800. <el-form-item label="零库存:" prop="isZeroStock">
  801. <el-radio-group v-model="seeTemp.isZeroStock" disabled @change="changeIsZero">
  802. <el-radio v-model="seeTemp.isZeroStock" :label="1">是</el-radio>
  803. <el-radio v-model="seeTemp.isZeroStock" :label="0">否</el-radio>
  804. </el-radio-group>
  805. </el-form-item>
  806. </el-col>
  807. <el-col :span="8">
  808. <el-form-item label="录入人:" prop="creatorMan">
  809. <span> {{ seeTemp.creatorMan }} </span>
  810. </el-form-item>
  811. </el-col>
  812. <el-col :span="8">
  813. <el-form-item label="录入日期:" prop="creatorTime">
  814. <span> {{ seeTemp.creatorTime }} </span>
  815. </el-form-item>
  816. </el-col>
  817. </el-row>
  818. <el-row>
  819. <el-col :span="8">
  820. <el-form-item label="备注:" prop="remark">
  821. <span> {{ seeTemp.remark }} </span>
  822. </el-form-item>
  823. </el-col>
  824. </el-row>
  825. </el-form>
  826. <el-table
  827. :key="tableKey"
  828. element-loading-text="给我一点时间"
  829. :data="listSee"
  830. border
  831. fit
  832. highlight-current-row
  833. style="width: 100%;"
  834. :row-style="rowStyle"
  835. :cell-style="cellStyle"
  836. class="elTable"
  837. >
  838. <el-table-column label="序号" align="center" type="index" width="50px">
  839. <template slot-scope="scope">
  840. <span>{{ scope.$index + (pageNumSee-1) * pageSizeSee + 1 }}</span>
  841. </template>
  842. </el-table-column>
  843. <el-table-column label="备件编号" min-width="110px" align="center">
  844. <template slot-scope="scope">
  845. <span>{{ scope.row.partCode }}</span>
  846. </template>
  847. </el-table-column>
  848. <el-table-column label="备件名称" min-width="130px" align="center">
  849. <template slot-scope="scope">
  850. <span>{{ scope.row.partName }}</span>
  851. </template>
  852. </el-table-column>
  853. <el-table-column label="备件规格" min-width="80px" align="center">
  854. <template slot-scope="scope">
  855. <span>{{ scope.row.specification }}</span>
  856. </template>
  857. </el-table-column>
  858. <el-table-column label="备件图片" prop="specifications" align="center" min-width="110px">
  859. <template slot-scope="scope">
  860. <el-popover placement="right" title="" trigger="hover">
  861. <img v-if="scope.row.picpath !== ''" :src="scope.row.picpath">
  862. <img v-if="scope.row.picpath !== ''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  863. </el-popover>
  864. </template>
  865. </el-table-column>
  866. <el-table-column label="备件品牌" min-width="80px" align="center">
  867. <template slot-scope="scope">
  868. <span>{{ scope.row.brand }}</span>
  869. </template>
  870. </el-table-column>
  871. <el-table-column label="计量单位" min-width="80px" align="center">
  872. <template slot-scope="scope">
  873. <span>{{ scope.row.unit }}</span>
  874. </template>
  875. </el-table-column>
  876. <el-table-column label="计划量" min-width="80px" align="center">
  877. <template slot-scope="scope">
  878. <span>{{ scope.row.planAmount }}</span>
  879. </template>
  880. </el-table-column>
  881. <el-table-column label="单价" min-width="80px" align="center">
  882. <template slot-scope="scope">
  883. <span>{{ scope.row.price }}</span>
  884. </template>
  885. </el-table-column>
  886. <el-table-column label="备注" min-width="80px" align="center">
  887. <template slot-scope="scope">
  888. <span>{{ scope.row.remark }}</span>
  889. </template>
  890. </el-table-column>
  891. </el-table>
  892. <pagination v-show="totalSee>0" :total="totalSee" :page.sync="getdataListParmSee.offset" :limit.sync="getdataListParmSee.pagecount" @pagination="getListSee" />
  893. <el-form
  894. ref="seeTemp"
  895. :rules="rules"
  896. :model="seeTemp"
  897. label-position="right"
  898. label-width="120px"
  899. style="width: 90%;margin:0 auto;"
  900. >
  901. <el-row>
  902. <el-col>
  903. <el-form-item label="流程进度" />
  904. <el-steps :active="active" align-center finish-status="success">
  905. <el-step
  906. v-for="(item,index) in activeList"
  907. :key="index"
  908. :title="item.title"
  909. :status="item.status"
  910. >
  911. <template slot="description">
  912. <div class="step-row">
  913. <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
  914. <div>{{ item.reason }}</div>
  915. </div>
  916. </template>
  917. </el-step>
  918. </el-steps>
  919. </el-col>
  920. </el-row>
  921. <el-row>
  922. <el-col>
  923. <el-form-item label="操作:">
  924. <!-- 设备主管审核 -->
  925. <el-button v-if="isContractExamineZG && seeTemp.SHStatus == 2" type="success" style="display:inline-block" @click="handleExamine()">审核1</el-button>
  926. <el-button v-else type="success" style="display:none" @click="handleExamine()">审核1</el-button>
  927. <!-- 设备助理审核 -->
  928. <!-- <el-button v-if="isContractExamineZL && seeTemp.SHStatus == 3" type="success" style="display:inline-block" @click="handleExamine2()">审核2</el-button>
  929. <el-button v-else type="success" style="display:none" @click="handleExamine2()">审核2</el-button> -->
  930. <!-- 设备中心审核 -->
  931. <el-button v-if="isContractExamineZX && seeTemp.SHStatus == 5" type="success" style="display:inline-block" @click="handleExamine3()">审核2</el-button>
  932. <el-button v-else type="success" style="display:none" @click="handleExamine3()">审核2</el-button>
  933. </el-form-item>
  934. </el-col>
  935. </el-row>
  936. </el-form>
  937. </div>
  938. <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
  939. <el-button @click="dialogFormVisible_See = false">关闭</el-button>
  940. </div>
  941. </el-dialog>
  942. <!-- 审核 -->
  943. <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_Examine" :close-on-click-modal="false" width="30%">
  944. <div class="app-examine">
  945. <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请确认审核结果:</h3>
  946. <el-form ref="examineTemp" :rules="rules" :model="examineTemp" label-position="right" style="width: 50%;margin:0 auto;">
  947. <el-row style="width:88%;height:150px;margin:0 auto;">
  948. <el-col :span="20">
  949. <el-form-item>
  950. <el-radio-group v-model="examineTemp.statueSH" @change="changeStatue">
  951. <el-radio :label="1" checked>通过</el-radio>
  952. <el-radio :label="2">不通过</el-radio>
  953. </el-radio-group>
  954. </el-form-item>
  955. </el-col>
  956. <el-col v-if="isStatueReason" :span="20">
  957. <el-input v-model="examineTemp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入不通过原因" />
  958. </el-col>
  959. </el-row>
  960. </el-form>
  961. </div>
  962. <div slot="footer" class="dialog-footer">
  963. <el-button v-if="dialogStatus==='examine'" type="primary" :disabled="isokDisable" @click="createExamineData()">确认</el-button>
  964. <el-button v-if="dialogStatus==='examine2'" type="primary" :disabled="isokDisable" @click="createExamineData2()">确认</el-button>
  965. <el-button v-if="dialogStatus==='examine3'" type="primary" :disabled="isokDisable" @click="createExamineData3()">确认</el-button>
  966. <el-button @click="dialogFormVisible_Examine = false;">关闭</el-button>
  967. </div>
  968. </el-dialog>
  969. </div>
  970. </template>
  971. <script>
  972. // 引入
  973. import { GetDataByName, GetDataByNames, checkButtons, PostDataByName, ExecDataByConfig, failproccess, GetAccount } from '@/api/common'
  974. import waves from '@/directive/waves' // waves directive
  975. import { parseTime } from '@/utils/index.js'
  976. // eslint-disable-next-line no-unused-vars
  977. import { validateEMail } from '@/utils/validate.js'
  978. import Pagination from '@/components/Pagination' // secondary package based on el-pagination
  979. import { MessageBox } from 'element-ui'
  980. // import TreeSelect from '@/components/TreeSelect'
  981. import Cookies from 'js-cookie'
  982. import { getToken } from '@/utils/auth'
  983. import { json2excel } from '@/utils/index.js'
  984. export default {
  985. name: 'Contract',
  986. components: { Pagination },
  987. directives: { waves },
  988. data() {
  989. return {
  990. listLoadingAdd: false,
  991. listLoadingSee: true,
  992. total: 0,
  993. listLoading: true,
  994. requestParam: {},
  995. // 1-2:table&搜索传参
  996. // 合同明细/编辑表格
  997. stockAAA: {
  998. stockA: '',
  999. stockNumber: '',
  1000. stockName: '',
  1001. specification: '',
  1002. amount: '',
  1003. note: ''
  1004. },
  1005. postDataPramas: {},
  1006. requestFilterParams: {
  1007. returntype: 'Map',
  1008. parammaps: {}
  1009. },
  1010. temp: {},
  1011. searchBtnVisible: true,
  1012. dialogPvVisible: false,
  1013. // 校验规则
  1014. parentClass: [],
  1015. defaultProps: {
  1016. children: 'children',
  1017. label: 'name'
  1018. },
  1019. nodeKey: 'id',
  1020. defaultCheckedKeys: [],
  1021. selectionIndex: [],
  1022. // ---------------------------------
  1023. isContractAdd: [], isContractTemplate: [], isContractImport: [], isContractExport: [], isContractSee: [], isContractChange: [], isContractDelete: [], isContractDelete2: [],
  1024. isContractExamineZG: [],
  1025. // isContractExamineZL: [],
  1026. isContractExamineZX: [],
  1027. statues: [{ id: '0', name: '正常' }, { id: '1', name: '已过期' }, { id: '2', name: '终止' }],
  1028. statues2: [{ id: '0', name: '正常' }, { id: '2', name: '终止' }],
  1029. shStatues: [{ id: '0', name: '审核中' }, { id: '1', name: '已通过' }, { id: '2', name: '未通过' }],
  1030. findAllProvider: [],
  1031. findAllAssetType: [],
  1032. findAllPasture: [],
  1033. findAllDepart: [],
  1034. findAllEmploye: [],
  1035. findAllCategory: [],
  1036. // 2-1.请求下拉框接口
  1037. requestParams: [
  1038. { name: 'findAllProvider', offset: 0, pagecount: 0, params: [] },
  1039. { name: 'findAllAssetType', offset: 0, pagecount: 0, params: [] },
  1040. { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
  1041. { name: 'findAllDepart', offset: 0, pagecount: 0, params: [] },
  1042. { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
  1043. { name: 'findAllCategory', offset: 0, pagecount: 0, params: [] }
  1044. ],
  1045. isokDisable: false,
  1046. disabled: true,
  1047. tableKey: 0,
  1048. rules: {
  1049. providerName: [{ required: true, message: '必填', trigger: 'blur' }],
  1050. providerId: [{ required: true, message: '必填', trigger: 'blur' }],
  1051. startTime: [{ required: true, message: '必填', trigger: 'blur' }],
  1052. stopTime: [{ required: true, message: '必填', trigger: 'blur' }],
  1053. statue: [{ required: true, message: '必填', trigger: 'blur' }]
  1054. },
  1055. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  1056. cellStyle: { padding: 0 + 'px' },
  1057. dialogFormVisible: false,
  1058. dialogStatus: '',
  1059. dialogFormVisible_change: false,
  1060. dialogFormVisible_See: false,
  1061. textMap: {
  1062. card: '合同明细打印',
  1063. create: '新增合同',
  1064. update: '编辑',
  1065. change: '变更',
  1066. examine: '审核',
  1067. examine2: '审核2',
  1068. examine3: '审核3'
  1069. },
  1070. radioAll: '全部',
  1071. getdataListParm: {
  1072. name: 'providerPactList',
  1073. page: 1,
  1074. offset: 1,
  1075. pagecount: 10,
  1076. returntype: 'Map',
  1077. parammaps: {
  1078. pastureName: Cookies.get('pasturename'),
  1079. contractCode: '',
  1080. statue: '',
  1081. stuteSH: '',
  1082. providerName: '',
  1083. inputDatetime: ''
  1084. }
  1085. },
  1086. list: [],
  1087. activeName: 'first',
  1088. tableKey2: 0,
  1089. listLoading2: true,
  1090. total2: 0,
  1091. list2: [],
  1092. getdataListParm2: {
  1093. name: 'contractDetail',
  1094. page: 1,
  1095. offset: 1,
  1096. pagecount: 10,
  1097. returntype: 'Map',
  1098. parammaps: {
  1099. inputDatetime: '',
  1100. providerName: '',
  1101. contractCode: '',
  1102. stopTime: '',
  1103. startTime: '',
  1104. statue: '',
  1105. partCode: '',
  1106. partName: '',
  1107. pastureName: Cookies.get('pasturename')
  1108. }
  1109. },
  1110. getdataListParmBeforeUploading: {
  1111. name: 'clearPastureStock',
  1112. page: 0,
  1113. offset: 0,
  1114. pagecount: 10,
  1115. returntype: 'Map',
  1116. parammaps: {}
  1117. },
  1118. getdataListParmSee: {
  1119. name: 'getcontratListBybig',
  1120. returntype: 'Map',
  1121. page: 0,
  1122. offset: 0,
  1123. pagecount: 10,
  1124. parammaps: {}
  1125. },
  1126. totalSee: 0,
  1127. getdataListParmChange: {
  1128. name: 'getcontratListBybigtemp',
  1129. returntype: 'Map',
  1130. page: 0,
  1131. offset: 0,
  1132. pagecount: 10,
  1133. parammaps: {}
  1134. },
  1135. listLoadingChange: true,
  1136. totalChange: 0,
  1137. activeList: [],
  1138. active: 3,
  1139. seeTemp: {},
  1140. listSee: [],
  1141. totalSee: 0,
  1142. listAdd: [],
  1143. requestBrand: {
  1144. name: 'getBrandByPartCode',
  1145. page: 0,
  1146. offset: 0,
  1147. pagecount: 10,
  1148. returntype: 'Map',
  1149. parammaps: {}
  1150. },
  1151. BrandList: [],
  1152. createTemp: {
  1153. pastureId: this.$store.state.user.pastureid,
  1154. providerName: '',
  1155. startTime: '',
  1156. stopTime: '',
  1157. statue: '',
  1158. isZeroStock: 0,
  1159. creatorId: this.$store.state.user.employeid,
  1160. creatorTime: parseTime(new Date(), '{y}-{m}-{d}')
  1161. },
  1162. pickerOptions3: {
  1163. disabledDate(time) {
  1164. return time.getTime() > Date.now()// 当天之前的时间可选
  1165. }
  1166. },
  1167. pickerOptions1: {
  1168. disabledDate: (time) => {
  1169. if (this.createTemp.stopTime !== '') {
  1170. return parseTime(time.getTime(), '{y}-{m}-{d}') > parseTime(Date.now(), '{y}-{m}-{d}') || parseTime(time.getTime(), '{y}-{m}-{d}') >= this.createTemp.stopTime
  1171. } else {
  1172. return time.getTime() > Date.now()
  1173. }
  1174. }
  1175. },
  1176. pickerOptions2: {
  1177. disabledDate: (time) => {
  1178. // return time.getTime() < this.createTemp.startTime || time.getTime() > Date.now()
  1179. return parseTime(time.getTime(), '{y}-{m}-{d}') <= this.createTemp.startTime
  1180. }
  1181. },
  1182. getParmCreateNumber: {
  1183. name: 'autoCreatCode',
  1184. page: 0,
  1185. offset: 0,
  1186. pagecount: 0,
  1187. returntype: 'Map',
  1188. parammaps: {
  1189. pastureId: Cookies.get('pastureid'),
  1190. codeType: 'HT'
  1191. }
  1192. },
  1193. requestSparePart: {
  1194. name: 'getPartsListHT',
  1195. page: 1,
  1196. offset: 1,
  1197. pagecount: 20,
  1198. returntype: 'Map',
  1199. parammaps: {
  1200. pastureId: Cookies.get('pastureid')
  1201. }
  1202. },
  1203. orderPart: {},
  1204. examineTemp: {},
  1205. dialogFormVisible_Examine: false,
  1206. isStatueReason: false,
  1207. isDisabled: false,
  1208. isDisabled2: false,
  1209. buttons: [],
  1210. isPercentage: false,
  1211. percentage: 1,
  1212. downloadParam: {},
  1213. getParmChargeContractSHStatus: {
  1214. name: 'chargeContractSHStatus',
  1215. parammaps: {}
  1216. },
  1217. getdataListParmCopybigcontract: {
  1218. name: 'Copybigcontract',
  1219. parammaps: {}
  1220. }
  1221. }
  1222. },
  1223. computed: {
  1224. // 设置请求头
  1225. headers() {
  1226. return {
  1227. // 设置token
  1228. // eslint-disable-next-line no-undef
  1229. token: getToken()
  1230. }
  1231. },
  1232. uploadData() {
  1233. return {
  1234. name: 'updatePastureStock',
  1235. importParams: '合同编号,牧场,合同开始日期,合同截止日期,供应商,物料编码,品名,规格型号,计量单位,品牌,计划量,单价,备注,一级分类,二级分类,三级分类,填写人,填写时间,分管副场审核,分管副场审核时间,场长审核,场长审核时间,运营办审核,运营办审核时间,过期处理人,过期处理时间',
  1236. sheetname: 'SheetJS'
  1237. }
  1238. },
  1239. // 设置上传地址
  1240. uploadExcelUrl() {
  1241. // process.env.VUE_APP_BASE_API是服务器的路径,也是axios的基本路径
  1242. return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
  1243. }
  1244. },
  1245. created() {
  1246. const that = this
  1247. GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
  1248. that.buttons = response.data.list
  1249. that.getButtons()
  1250. })
  1251. this.getDownList()
  1252. this.getList()
  1253. },
  1254. methods: {
  1255. getButtons() {
  1256. // 新增
  1257. const ContractAdd = 'customs:contract:add'
  1258. const isContractAdd = checkButtons(this.$store.state.user.buttons, ContractAdd)
  1259. this.isContractAdd = isContractAdd
  1260. // 模板
  1261. const ContractTemplate = 'customs:contract:template'
  1262. const isContractTemplate = checkButtons(this.$store.state.user.buttons, ContractTemplate)
  1263. this.isContractTemplate = isContractTemplate
  1264. // 导入
  1265. const ContractImport = 'customs:contract:import'
  1266. const isContractImport = checkButtons(this.$store.state.user.buttons, ContractImport)
  1267. this.isContractImport = isContractImport
  1268. // 导出
  1269. const ContractExport = 'customs:contract:export'
  1270. const isContractExport = checkButtons(this.$store.state.user.buttons, ContractExport)
  1271. this.isContractExport = isContractExport
  1272. // 查看
  1273. const ContractSee = 'customs:contract:see'
  1274. const isContractSee = checkButtons(this.$store.state.user.buttons, ContractSee)
  1275. this.isContractSee = isContractSee
  1276. // 变更
  1277. const ContractChange = 'customs:contract:change'
  1278. const isContractChange = checkButtons(this.$store.state.user.buttons, ContractChange)
  1279. this.isContractChange = isContractChange
  1280. // 删除
  1281. const ContractDelete = 'customs:contract:delete'
  1282. const isContractDelete = checkButtons(this.$store.state.user.buttons, ContractDelete)
  1283. this.isContractDelete = isContractDelete
  1284. // 高级删除
  1285. const ContractDelete2 = 'customs:contract:delete2'
  1286. const isContractDelete2 = checkButtons(this.$store.state.user.buttons, ContractDelete2)
  1287. this.isContractDelete2 = isContractDelete2
  1288. // isContractExamineZG: [], isContractExamineZL: [], isContractExamineZX: [],
  1289. // 设备主管审核
  1290. const ContractExamineZG = 'customs:contract:examineZG'
  1291. const isContractExamineZG = checkButtons(this.$store.state.user.buttons, ContractExamineZG)
  1292. this.isContractExamineZG = isContractExamineZG
  1293. // 设备助理审核
  1294. // const ContractExamineZL = 'customs:contract:examineZL'
  1295. // const isContractExamineZL = checkButtons(this.$store.state.user.buttons, ContractExamineZL)
  1296. // this.isContractExamineZL = isContractExamineZL
  1297. // 设备中心审核
  1298. const ContractExamineZX = 'customs:contract:examineZX'
  1299. const isContractExamineZX = checkButtons(this.$store.state.user.buttons, ContractExamineZX)
  1300. this.isContractExamineZX = isContractExamineZX
  1301. },
  1302. getDownList() {
  1303. GetDataByNames(this.requestParams).then(response => {
  1304. this.findAllProvider = response.data.findAllProvider.list
  1305. this.findAllAssetType = response.data.findAllAssetType.list
  1306. this.findAllPasture = response.data.findAllPasture.list
  1307. this.findAllDepart = response.data.findAllDepart.list
  1308. this.findAllEmploye = response.data.findAllEmploye.list
  1309. this.findAllCategory = response.data.findAllCategory.list
  1310. })
  1311. },
  1312. getList() {
  1313. this.listLoading = true
  1314. console.log(this.$refs['inputDatetime'])
  1315. if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
  1316. this.getdataListParm.parammaps.startTime = this.$refs['inputDatetime'].value[0]
  1317. this.getdataListParm.parammaps.stopTime = this.$refs['inputDatetime'].value[1]
  1318. } else {
  1319. this.getdataListParm.parammaps.startTime = ''
  1320. this.getdataListParm.parammaps.stopTime = ''
  1321. }
  1322. console.log('table发送数据', this.getdataListParm.parammaps)
  1323. GetDataByName(this.getdataListParm).then(response => {
  1324. this.list = response.data.list
  1325. this.pageNum = response.data.pageNum
  1326. this.pageSize = response.data.pageSize
  1327. if (response.data.total) {
  1328. this.total = response.data.total
  1329. }
  1330. // // Just to simulate the time of the request
  1331. setTimeout(() => {
  1332. this.listLoading = false
  1333. }, 300)
  1334. })
  1335. },
  1336. form_search() {
  1337. this.listLoading = true
  1338. if (this.getdataListParm.parammaps.inputDatetime === null) {
  1339. this.getdataListParm.parammaps.inputDatetime = ''
  1340. }
  1341. // this.getdataListParm.parammaps.providerName = this.createTemp.providerName
  1342. this.getdataListParm.offset = 1
  1343. this.getList()
  1344. },
  1345. handleClick(tab, event) {
  1346. console.log(tab, event)
  1347. if (tab.name === 'second') {
  1348. this.getList2()
  1349. } else {
  1350. this.getList()
  1351. }
  1352. },
  1353. getList2() {
  1354. this.listLoading2 = true
  1355. if (this.$refs['inputDatetime2'] !== undefined && this.$refs['inputDatetime2'].value !== null) {
  1356. this.getdataListParm2.parammaps.startTime = this.$refs['inputDatetime2'].value[0]
  1357. this.getdataListParm2.parammaps.stopTime = this.$refs['inputDatetime2'].value[1]
  1358. } else {
  1359. this.getdataListParm2.parammaps.startTime = ''
  1360. this.getdataListParm2.parammaps.stopTime = ''
  1361. }
  1362. GetDataByName(this.getdataListParm2).then(response => {
  1363. this.list2 = response.data.list
  1364. this.pageNum2 = response.data.pageNum
  1365. this.pageSize2 = response.data.pageSize
  1366. if (response.data.total) {
  1367. this.total2 = response.data.total
  1368. }
  1369. setTimeout(() => {
  1370. this.listLoading2 = false
  1371. }, 300)
  1372. })
  1373. },
  1374. form_search2() {
  1375. this.listLoading2 = true
  1376. if (this.getdataListParm2.parammaps.inputDatetime === null) {
  1377. this.getdataListParm2.parammaps.inputDatetime = ''
  1378. }
  1379. this.getdataListParm2.offset = 1
  1380. this.getList2()
  1381. },
  1382. changeAll() {
  1383. console.log(this.radioAll)
  1384. if (this.radioAll === '全部') {
  1385. this.getdataListParm.name = 'providerPactList'
  1386. this.getdataListParm.offset = 1
  1387. this.getdataListParm.parammaps = {
  1388. pastureName: Cookies.get('pasturename'),
  1389. contractCode: '',
  1390. statue: '',
  1391. stuteSH: '',
  1392. providerName: '',
  1393. inputDatetime: ''
  1394. }
  1395. this.getList()
  1396. } else if (this.radioAll === '待处理') {
  1397. this.getdataListParm.name = 'providerPactWebListNO'
  1398. this.getdataListParm.offset = 1
  1399. this.getdataListParm.parammaps = {
  1400. pastureName: this.getdataListParm.parammaps.pastureName,
  1401. contractCode: this.getdataListParm.parammaps.contractCode,
  1402. statue: this.getdataListParm.parammaps.statue,
  1403. stuteSH: this.getdataListParm.parammaps.stuteSH,
  1404. providerName: this.getdataListParm.parammaps.providerName,
  1405. inputDatetime: this.getdataListParm.parammaps.inputDatetime,
  1406. empId: Cookies.get('employeid'),
  1407. pastureId: Cookies.get('pastureid'),
  1408. deptId: Cookies.get('departmentid')
  1409. }
  1410. this.getList()
  1411. } else if (this.radioAll === '已处理') {
  1412. this.getdataListParm.name = 'providerPactWebList'
  1413. this.getdataListParm.offset = 1
  1414. this.getdataListParm.parammaps = {
  1415. pastureName: this.getdataListParm.parammaps.pastureName,
  1416. contractCode: this.getdataListParm.parammaps.contractCode,
  1417. statue: this.getdataListParm.parammaps.statue,
  1418. stuteSH: this.getdataListParm.parammaps.stuteSH,
  1419. providerName: this.getdataListParm.parammaps.providerName,
  1420. inputDatetime: this.getdataListParm.parammaps.inputDatetime,
  1421. empId: Cookies.get('employeid'),
  1422. pastureId: Cookies.get('pastureid'),
  1423. deptId: Cookies.get('departmentid')
  1424. }
  1425. this.getList()
  1426. }
  1427. },
  1428. SHStatus: function(cellValue) {
  1429. // console.log(cellValue.isZeroStock)
  1430. if (cellValue.SHStatus == 2) {
  1431. return '审核中'
  1432. } else if (cellValue.SHStatus == 3) {
  1433. return '审核中'
  1434. } else if (cellValue.SHStatus == 4) {
  1435. return '未通过'
  1436. } else if (cellValue.SHStatus == 5) {
  1437. return '审核中'
  1438. } else if (cellValue.SHStatus == 6) {
  1439. return '未通过'
  1440. } else if (cellValue.SHStatus == 7) {
  1441. return '通过'
  1442. } else if (cellValue.SHStatus == 8) {
  1443. return '未通过'
  1444. }
  1445. },
  1446. isZeroStock: function(cellValue) {
  1447. if (cellValue.isZeroStock == 0) {
  1448. return '否'
  1449. } else if (cellValue.isZeroStock == 1) {
  1450. return '是'
  1451. }
  1452. },
  1453. form_see(row) {
  1454. this.seeTemp = Object.assign({}, row) // copy obj
  1455. this.dialogStatus = 'card'
  1456. this.dialogFormVisible_See = true
  1457. // this.seeTemp.isZeroStock = 1
  1458. // this.$nextTick(() => {
  1459. // this.seeTemp.isZeroStock = JSON.stringify(this.seeTemp.isZeroStock)
  1460. // })
  1461. console.log('查看上方数据(从table读取)', this.seeTemp.isZeroStock)
  1462. // 基础信息
  1463. this.getdataListParmSee.parammaps.id = row.id
  1464. this.getListSee()
  1465. // 流程图
  1466. var reason = '未通过原因:' + this.seeTemp.workflowNote
  1467. if (this.seeTemp.SHStatus == 2) {
  1468. this.activeList = [{ title: '合同录入', date: this.seeTemp.creatorTime, name: this.seeTemp.creatorMan }, { title: '办公室主任审核' }, { title: '设备中心审核' }]
  1469. this.active = 1
  1470. } else if (this.seeTemp.SHStatus == 3) {
  1471. this.activeList = [{ title: '合同录入', date: this.seeTemp.creatorTime, name: this.seeTemp.creatorMan }, { title: '办公室主任审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '设备中心审核' }]
  1472. this.active = 2
  1473. } else if (this.seeTemp.SHStatus == 4) {
  1474. this.activeList = [{ title: '合同录入', date: this.seeTemp.creatorTime, name: this.seeTemp.creatorMan }, { title: '办公室主任审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson, status: 'error', reason: reason }, { title: '设备中心审核' }]
  1475. this.active = 2
  1476. } else if (this.seeTemp.SHStatus == 5) {
  1477. this.activeList = [{ title: '合同录入', date: this.seeTemp.creatorTime, name: this.seeTemp.creatorMan }, { title: '办公室主任审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '设备中心审核' }]
  1478. this.active = 2
  1479. } else if (this.seeTemp.SHStatus == 6) {
  1480. this.activeList = [{ title: '合同录入', date: this.seeTemp.creatorTime, name: this.seeTemp.creatorMan }, { title: '办公室主任审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '设备中心审核' }]
  1481. this.active = 3
  1482. } else if (this.seeTemp.SHStatus == 7) {
  1483. this.activeList = [{ title: '合同录入', date: this.seeTemp.creatorTime, name: this.seeTemp.creatorMan }, { title: '办公室主任审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '设备中心审核', date: this.seeTemp.CGChargedate, name: this.seeTemp.CGChargePerson }]
  1484. this.active = 4
  1485. } else if (this.seeTemp.SHStatus == 8) {
  1486. this.activeList = [{ title: '合同录入', date: this.seeTemp.creatorTime, name: this.seeTemp.creatorMan }, { title: '办公室主任审核', date: this.seeTemp.chargeDate, name: this.seeTemp.chargePerson }, { title: '设备中心审核', date: this.seeTemp.CGChargedate, name: this.seeTemp.CGChargePerson, status: 'error', reason: reason }]
  1487. this.active = 4
  1488. }
  1489. },
  1490. getListSee() {
  1491. GetDataByName(this.getdataListParmSee).then(response => {
  1492. this.listSee = response.data.list
  1493. this.pageNumSee = response.data.pageNum
  1494. this.pageSizeSee = response.data.pageSize
  1495. if (response.data.total) {
  1496. this.totalSee = response.data.total
  1497. }
  1498. if (response.data.list !== null) {
  1499. for (let i = 0; i < response.data.list.length; i++) {
  1500. if (response.data.list[i].srcpath !== null && response.data.list[i].picpath !== null && response.data.list[i].srcpath !== undefined && response.data.list[i].picpath !== undefined) {
  1501. const srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  1502. const picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  1503. this.listSee[i].srcpath = srcpath
  1504. this.listSee[i].picpath = picpath
  1505. } else {
  1506. this.listSee[i].srcpath = ''
  1507. this.listSee[i].picpath = ''
  1508. }
  1509. }
  1510. }
  1511. console.log('查看下方table数据', this.listSee)
  1512. // Just to simulate the time of the request
  1513. setTimeout(() => {
  1514. this.listLoadingSee = false
  1515. }, 300)
  1516. })
  1517. },
  1518. resetCreateTemp() {
  1519. // 格式化日期
  1520. parseTime(new Date(), '{y}-{m}-{d}')
  1521. this.temp.defaultCheckedKeys = []
  1522. this.list2 = null
  1523. this.listAdd = []
  1524. // ---
  1525. this.createTemp.pastureId = this.$store.state.user.pastureid
  1526. this.createTemp.providerName = ''
  1527. this.createTemp.startTime = ''
  1528. this.createTemp.stopTime = ''
  1529. this.createTemp.statue = ''
  1530. this.createTemp.isZeroStock = 0
  1531. this.createTemp.creatorId = this.$store.state.user.employeid
  1532. this.createTemp.creatorTime = parseTime(new Date(), '{y}-{m}-{d}')
  1533. this.createTemp.contractCode = ''
  1534. },
  1535. form_add() {
  1536. this.resetCreateTemp()
  1537. this.dialogStatus = 'create'
  1538. this.dialogFormVisible = true
  1539. this.createTemp.pastureId = this.$store.state.user.pastureid
  1540. this.createTemp.record = '#409EFF'
  1541. this.isDisabled2 = true
  1542. this.$nextTick(() => {
  1543. this.$refs['createTemp'].clearValidate()
  1544. })
  1545. this.getCreateNumber()
  1546. },
  1547. getCreateNumber() {
  1548. GetDataByName(this.getParmCreateNumber).then(response => {
  1549. this.$nextTick(() => {
  1550. console.log('合同编号', response.data.list[0].orderCode)
  1551. this.createTemp.contractCode = response.data.list[0].orderCode
  1552. this.$forceUpdate()
  1553. })
  1554. })
  1555. },
  1556. changeTime(val) {
  1557. if (parseTime(new Date(), '{y}-{m}-{d}') <= this.createTemp.stopTime) {
  1558. this.createTemp.statue = '正常'
  1559. this.createTemp.statueId = 0
  1560. } else {
  1561. this.createTemp.statue = '已过期'
  1562. this.createTemp.statueId = 1
  1563. }
  1564. },
  1565. sparePartSearch(queryString, cb) {
  1566. console.log('备件模糊查询输入值', queryString)
  1567. this.requestSparePart.parammaps['partCode'] = queryString
  1568. GetDataByName(this.requestSparePart).then(response => {
  1569. console.log('备件模糊查询搜索data', response.data.list)
  1570. if (response.data.list == null) {
  1571. cb([])
  1572. } else {
  1573. cb(response.data.list)
  1574. }
  1575. })
  1576. },
  1577. handleSelectSparePart(item) {
  1578. console.log('备件模糊查询选中值', item)
  1579. // this.listAdd.push(item)
  1580. if (this.listAdd.length > 0) {
  1581. // eslint-disable-next-line no-redeclare
  1582. if (this.listAdd.find(obj => obj.partId === item.partId)) {
  1583. this.$message({
  1584. type: 'warning',
  1585. message: '此备件已存在,请重新选择备件'
  1586. })
  1587. } else {
  1588. if (item.srcpath !== null && item.picpath !== null && item.srcpath !== undefined && item.picpath !== undefined) {
  1589. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  1590. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  1591. } else {
  1592. item.srcpath = ''
  1593. item.picpath = ''
  1594. }
  1595. this.$set(item, 'myid', new Date().getTime())
  1596. this.listAdd.unshift(item)
  1597. }
  1598. } else {
  1599. if (item.srcpath !== null && item.picpath !== null) {
  1600. this.$set(item, 'srcpath', process.env.VUE_APP_BASE_API + item.srcpath)
  1601. this.$set(item, 'picpath', process.env.VUE_APP_BASE_API + item.picpath)
  1602. } else {
  1603. item.srcpath = ''
  1604. item.picpath = ''
  1605. }
  1606. this.$set(item, 'myid', new Date().getTime())
  1607. this.listAdd.unshift(item)
  1608. }
  1609. },
  1610. brandSearch(queryString, cb) {
  1611. console.log('品牌模糊查询输入值', queryString)
  1612. this.requestBrand.parammaps['brandName'] = queryString
  1613. GetDataByName(this.requestBrand).then(response => {
  1614. console.log('品牌模糊查询搜索data', response.data.list)
  1615. this.BrandList = response.data.list
  1616. cb(this.BrandList)
  1617. })
  1618. },
  1619. handleSelectBrand(item, row) {
  1620. console.log('品牌模糊查询选中值', item)
  1621. console.log('品牌模糊查询选中值所在行', row)
  1622. this.$set(row, 'brandName', item.brandName)
  1623. this.$set(row, 'brandId', item.brandId)
  1624. this.$forceUpdate()
  1625. },
  1626. handleFocusBrand(row) {
  1627. this.$set(row, 'brandName', '')
  1628. this.$set(row, 'brandId', '')
  1629. },
  1630. handleBlurBrand(row) {
  1631. if (row.brandId == '') {
  1632. this.$set(row, 'brand', '')
  1633. this.$set(row, 'brandName', '')
  1634. this.$set(row, 'brandId', '')
  1635. }
  1636. },
  1637. partDelete(row) {
  1638. console.log(this.listAdd)
  1639. MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
  1640. confirmButtonText: '确认',
  1641. cancelButtonText: '取消',
  1642. type: 'warning'
  1643. }).then(() => {
  1644. // console.log(this.list2)
  1645. for (var i = 0; i < this.listAdd.length; i++) {
  1646. console.log(this.listAdd[i])
  1647. if (this.listAdd[i].myid === row.myid) {
  1648. var listAddIndex = this.listAdd.indexOf(this.listAdd[i])
  1649. }
  1650. if (listAddIndex > -1) {
  1651. this.listAdd.splice(listAddIndex, 1)
  1652. return
  1653. }
  1654. }
  1655. })
  1656. },
  1657. add_dialog_save() {
  1658. this.isokDisable = true
  1659. setTimeout(() => {
  1660. this.isokDisable = false
  1661. }, 1000)
  1662. this.$refs['createTemp'].validate(valid => {
  1663. if (valid) {
  1664. if (this.createTemp.contractCode == '' || this.createTemp.contractCode == null || this.createTemp.contractCode == undefined) {
  1665. GetDataByName(this.getParmCreateNumber).then(response => {
  1666. this.$nextTick(() => {
  1667. console.log('合同编号', response.data.list[0].orderCode)
  1668. this.createTemp.contractCode = response.data.list[0].orderCode
  1669. this.$forceUpdate()
  1670. this.add_dialog_saveSave()
  1671. })
  1672. })
  1673. } else {
  1674. this.add_dialog_saveSave()
  1675. }
  1676. }
  1677. })
  1678. },
  1679. add_dialog_saveSave() {
  1680. if (this.listAdd.length !== 0) {
  1681. for (var j = 0; j < this.listAdd.length; j++) {
  1682. if (this.listAdd[j].planAmount == null || this.listAdd[j].brand == null || this.listAdd[j].price == null || this.listAdd[j].planAmount == '' || this.listAdd[j].brand === '' || this.listAdd[j].brandId === '' || this.listAdd[j].price == '' || this.listAdd[j].brand == undefined || this.listAdd[j].brandId == undefined) {
  1683. this.$message({
  1684. type: 'warning',
  1685. message: '请检查备件品牌或计划量或单价是否为空',
  1686. duration: 2000
  1687. })
  1688. return false
  1689. } else {
  1690. var rulesPlanAmount = /^[1-9]\d*$/
  1691. if (!rulesPlanAmount.test(parseFloat(this.listAdd[j].planAmount))) {
  1692. this.$message({
  1693. type: 'error',
  1694. message: '计划量请输入正整数',
  1695. duration: 2000
  1696. })
  1697. return false
  1698. } else {
  1699. var rulesPrice = /(^[1-9](\d+)?(\.\d{1,5})?$)|(^\d\.\d{1,5}$)/
  1700. if (!rulesPrice.test(parseFloat(this.listAdd[j].price))) {
  1701. this.$message({
  1702. type: 'error',
  1703. message: '价格请输入正数,最多保留小数点后五位',
  1704. duration: 2000
  1705. })
  1706. return false
  1707. }
  1708. }
  1709. }
  1710. }
  1711. this.postDataPramas.common = { 'returnmap': '0' }
  1712. this.postDataPramas.data = []
  1713. this.postDataPramas.data[0] = { 'name': 'insertBigContract', 'type': 'e', 'parammaps': {
  1714. pastureId: this.createTemp.pastureId,
  1715. providerId: this.createTemp.providerId,
  1716. providerName: this.createTemp.providerName,
  1717. startTime: this.createTemp.startTime,
  1718. stopTime: this.createTemp.stopTime,
  1719. contractCode: this.createTemp.contractCode,
  1720. creatorId: this.createTemp.creatorId,
  1721. creatorMan: this.createTemp.creatorMan,
  1722. creatorTime: this.createTemp.creatorTime,
  1723. isZeroStock: this.createTemp.isZeroStock,
  1724. statue: 1
  1725. }}
  1726. this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  1727. this.postDataPramas.data[1].children = []
  1728. this.postDataPramas.data[1].children[0] = { 'name': 'insertContract', 'type': 'e', 'parammaps': {
  1729. bigId: '@insertBigContract.LastInsertId',
  1730. pastureId: this.createTemp.pastureId,
  1731. pastureName: '@insertSpotList.pastureName',
  1732. partId: '@insertSpotList.partId',
  1733. partName: '@insertSpotList.partName',
  1734. partCode: '@insertSpotList.partCode',
  1735. specification: '@insertSpotList.specification',
  1736. price: '@insertSpotList.price',
  1737. brandId: '@insertSpotList.brandId',
  1738. brand: '@insertSpotList.brand',
  1739. planAmount: '@insertSpotList.planAmount',
  1740. remark: '@insertSpotList.remark',
  1741. unit: '@insertSpotList.unit'
  1742. }}
  1743. ExecDataByConfig(this.postDataPramas).then(response => {
  1744. console.log('新增保存发送参数', this.postDataPramas)
  1745. if (response.msg === 'fail') {
  1746. this.$notify({
  1747. title: '保存失败',
  1748. message: response.data,
  1749. type: 'warning',
  1750. duration: 2000
  1751. })
  1752. } else {
  1753. this.getdataListParm.parammaps.inputDatetime = ''
  1754. this.getList()
  1755. this.dialogFormVisible = false
  1756. this.createTemp.providerName = ''
  1757. this.$notify({
  1758. title: '',
  1759. message: '保存成功',
  1760. type: 'success',
  1761. duration: 2000
  1762. })
  1763. }
  1764. })
  1765. return true
  1766. } else {
  1767. this.$notify({
  1768. title: '',
  1769. message: '请选择备件',
  1770. type: 'warning',
  1771. duration: 2000
  1772. })
  1773. return false
  1774. }
  1775. },
  1776. beforeUploading() {
  1777. PostDataByName(this.getdataListParmBeforeUploading).then(response => {
  1778. // Just to simulate the time of the request
  1779. setTimeout(() => {
  1780. this.listLoading = false
  1781. }, 300)
  1782. })
  1783. },
  1784. handleExamine(row) {
  1785. console.log('点击了设备主管审核')
  1786. if (row == undefined) {
  1787. this.examineTemp = this.seeTemp
  1788. this.$set(this.seeTemp, 'statueSH', 1)
  1789. this.$set(this.seeTemp, 'workflowNote', '')
  1790. } else {
  1791. this.examineTemp = Object.assign({}, row)
  1792. this.$set(this.examineTemp, 'statueSH', 1)
  1793. this.$set(this.examineTemp, 'workflowNote', '')
  1794. }
  1795. this.dialogStatus = 'examine'
  1796. this.dialogFormVisible_Examine = true
  1797. this.statueReason = false
  1798. },
  1799. changeStatue(val) {
  1800. console.log(val)
  1801. if (val == 2) {
  1802. this.isStatueReason = true
  1803. } else {
  1804. this.isStatueReason = false
  1805. }
  1806. },
  1807. createExamineData() {
  1808. console.log('点击了设备主管审核确认')
  1809. this.isokDisable = true
  1810. setTimeout(() => {
  1811. this.isokDisable = false
  1812. }, 1000)
  1813. this.$refs['examineTemp'].validate(valid => {
  1814. if (valid) {
  1815. this.requestParam.name = 'contractCharge'
  1816. this.requestParam.parammaps = {}
  1817. this.requestParam.parammaps.id = this.examineTemp.id
  1818. if (this.examineTemp.statueSH === 1) {
  1819. this.requestParam.parammaps.statue = 5
  1820. } else {
  1821. this.requestParam.parammaps.statue = 4
  1822. }
  1823. this.requestParam.parammaps.empId = Cookies.get('employeid')
  1824. this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
  1825. PostDataByName(this.requestParam).then(response => {
  1826. console.log('设备主管审核确认发送参数', this.requestParam)
  1827. if (response.msg !== 'fail') {
  1828. if (this.getdataListParm.parammaps.inputDatetime === null) {
  1829. this.getdataListParm.parammaps.inputDatetime = ''
  1830. }
  1831. this.getList()
  1832. this.dialogFormVisible_Examine = false
  1833. this.dialogFormVisible_See = false
  1834. this.isStatueReason = false
  1835. this.$notify({
  1836. title: '成功',
  1837. message: '审核成功',
  1838. type: 'success',
  1839. duration: 2000
  1840. })
  1841. } else {
  1842. failproccess(response, this.$notify)
  1843. }
  1844. })
  1845. }
  1846. })
  1847. },
  1848. handleExamine2(row) {
  1849. console.log('点击了设备助理审核')
  1850. if (row == undefined) {
  1851. this.examineTemp = this.seeTemp
  1852. this.$set(this.seeTemp, 'statueSH', 1)
  1853. this.$set(this.seeTemp, 'workflowNote', '')
  1854. } else {
  1855. this.examineTemp = Object.assign({}, row)
  1856. this.$set(this.examineTemp, 'statueSH', 1)
  1857. this.$set(this.examineTemp, 'workflowNote', '')
  1858. }
  1859. this.dialogStatus = 'examine2'
  1860. this.dialogFormVisible_Examine = true
  1861. this.statueReason = false
  1862. },
  1863. createExamineData2() {
  1864. console.log('点击了设备助理审核确认')
  1865. this.isokDisable = true
  1866. setTimeout(() => {
  1867. this.isokDisable = false
  1868. }, 1000)
  1869. this.$refs['examineTemp'].validate(valid => {
  1870. if (valid) {
  1871. this.requestParam.name = 'contractCharge3'
  1872. this.requestParam.parammaps = {}
  1873. this.requestParam.parammaps.id = this.examineTemp.id
  1874. if (this.examineTemp.statueSH === 1) {
  1875. this.requestParam.parammaps.statue = 5
  1876. } else {
  1877. this.requestParam.parammaps.statue = 6
  1878. }
  1879. this.requestParam.parammaps.empId = Cookies.get('employeid')
  1880. this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
  1881. PostDataByName(this.requestParam).then(response => {
  1882. console.log('设备助理审核确认发送参数', this.requestParam)
  1883. if (response.msg !== 'fail') {
  1884. if (this.getdataListParm.parammaps.inputDatetime === null) {
  1885. this.getdataListParm.parammaps.inputDatetime = ''
  1886. }
  1887. this.getList()
  1888. this.dialogFormVisible_Examine = false
  1889. this.dialogFormVisible_See = false
  1890. this.isStatueReason = false
  1891. this.$notify({
  1892. title: '成功',
  1893. message: '审核成功',
  1894. type: 'success',
  1895. duration: 2000
  1896. })
  1897. } else {
  1898. failproccess(response, this.$notify)
  1899. }
  1900. })
  1901. }
  1902. })
  1903. },
  1904. handleExamine3(row) {
  1905. console.log('点击了设备中心审核')
  1906. if (row == undefined) {
  1907. this.examineTemp = this.seeTemp
  1908. this.$set(this.seeTemp, 'statueSH', 1)
  1909. this.$set(this.seeTemp, 'workflowNote', '')
  1910. } else {
  1911. this.examineTemp = Object.assign({}, row)
  1912. this.$set(this.examineTemp, 'statueSH', 1)
  1913. this.$set(this.examineTemp, 'workflowNote', '')
  1914. }
  1915. this.dialogStatus = 'examine3'
  1916. this.dialogFormVisible_Examine = true
  1917. this.statueReason = false
  1918. },
  1919. createExamineData3() {
  1920. console.log('点击了设备中心审核确认')
  1921. this.isokDisable = true
  1922. setTimeout(() => {
  1923. this.isokDisable = false
  1924. }, 1000)
  1925. this.$refs['examineTemp'].validate(valid => {
  1926. if (valid) {
  1927. if (this.examineTemp.statueSH === 1) {
  1928. this.requestParam.common = { 'returnmap': '0' }
  1929. this.requestParam.data = []
  1930. this.requestParam.data[0] = { 'name': 'contractCharge1', 'type': 'e', 'parammaps': {
  1931. statue: 7,
  1932. empId: Cookies.get('employeid'),
  1933. workflowNote: this.examineTemp.workflowNote,
  1934. id: this.examineTemp.id
  1935. }}
  1936. this.requestParam.data[1] = { 'name': 'updateBigcontractbyCode', 'type': 'e', 'parammaps': {
  1937. precontractCode: this.examineTemp.precontractCode
  1938. }}
  1939. ExecDataByConfig(this.requestParam).then(response => {
  1940. console.log('新增保存发送参数', this.requestParam)
  1941. if (response.msg === 'fail') {
  1942. this.$notify({
  1943. title: '保存失败',
  1944. message: response.data,
  1945. type: 'warning',
  1946. duration: 2000
  1947. })
  1948. } else {
  1949. this.getList()
  1950. this.dialogFormVisible_Examine = false
  1951. this.dialogFormVisible_See = false
  1952. this.isStatueReason = false
  1953. this.$notify({
  1954. title: '',
  1955. message: '保存成功',
  1956. type: 'success',
  1957. duration: 2000
  1958. })
  1959. }
  1960. })
  1961. } else {
  1962. this.requestParam.name = 'contractCharge1'
  1963. this.requestParam.parammaps = {}
  1964. this.requestParam.parammaps.id = this.examineTemp.id
  1965. this.requestParam.parammaps.statue = 8
  1966. this.requestParam.parammaps.empId = Cookies.get('employeid')
  1967. this.requestParam.parammaps.workflowNote = this.examineTemp.workflowNote
  1968. PostDataByName(this.requestParam).then(response => {
  1969. console.log('设备中心审核确认发送参数', this.requestParam)
  1970. if (response.msg !== 'fail') {
  1971. if (this.getdataListParm.parammaps.inputDatetime === null) {
  1972. this.getdataListParm.parammaps.inputDatetime = ''
  1973. }
  1974. this.getList()
  1975. this.dialogFormVisible_Examine = false
  1976. this.dialogFormVisible_See = false
  1977. this.isStatueReason = false
  1978. this.$notify({
  1979. title: '成功',
  1980. message: '审核成功',
  1981. type: 'success',
  1982. duration: 2000
  1983. })
  1984. } else {
  1985. failproccess(response, this.$notify)
  1986. }
  1987. })
  1988. }
  1989. }
  1990. })
  1991. },
  1992. getListChange() {
  1993. GetDataByName(this.getdataListParmChange).then(response => {
  1994. this.$nextTick(() => {
  1995. this.listAdd = response.data.list
  1996. })
  1997. this.pageNumChange = response.data.pageNum
  1998. this.pageSizeChange = response.data.pageSize
  1999. if (response.data.total) {
  2000. this.totalChange = response.data.total
  2001. }
  2002. if (response.data.list !== null) {
  2003. for (let i = 0; i < response.data.list.length; i++) {
  2004. if (response.data.list[i].srcpath !== null && response.data.list[i].picpath !== null && response.data.list[i].srcpath !== undefined && response.data.list[i].picpath !== undefined) {
  2005. const srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  2006. const picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  2007. this.listAdd[i].srcpath = srcpath
  2008. this.listAdd[i].picpath = picpath
  2009. } else {
  2010. this.listAdd[i].srcpath = ''
  2011. this.listAdd[i].picpath = ''
  2012. }
  2013. }
  2014. }
  2015. console.log('变更下方table数据', this.listSee)
  2016. // Just to simulate the time of the request
  2017. setTimeout(() => {
  2018. this.listLoadingChange = false
  2019. }, 300)
  2020. })
  2021. },
  2022. handleChange(row) {
  2023. this.getParmChargeContractSHStatus.parammaps.contractCode = row.contractCode
  2024. GetDataByName(this.getParmChargeContractSHStatus).then(response => {
  2025. this.$nextTick(() => {
  2026. if (response.data.list[0].flag == 0) {
  2027. this.getdataListParmCopybigcontract.parammaps.id = row.id
  2028. this.getdataListParmCopybigcontract.parammaps.pastureId = row.pastureId
  2029. GetDataByName(this.getdataListParmCopybigcontract).then(response => {
  2030. this.dialogStatus = 'change'
  2031. this.dialogFormVisible_change = true
  2032. this.createTemp = Object.assign({}, row)
  2033. this.createTemp.precontractCode = row.contractCode
  2034. this.isDisabled = false
  2035. this.isDisabled2 = true
  2036. this.getCreateNumber()
  2037. this.getdataListParmChange.parammaps.id = response.data.list[0].msg
  2038. this.getListChange()
  2039. })
  2040. } else {
  2041. this.$message({
  2042. message: '此合同变更审核中,不可重复变更',
  2043. type: 'warning'
  2044. })
  2045. }
  2046. })
  2047. })
  2048. },
  2049. changeStatues(val) {
  2050. if (val == '终止') {
  2051. this.isDisabled = true
  2052. this.isDisabled2 = false
  2053. } else {
  2054. this.isDisabled = false
  2055. this.isDisabled2 = true
  2056. }
  2057. },
  2058. partSmallSave(row) {
  2059. console.log(row)
  2060. this.isokDisable = true
  2061. setTimeout(() => {
  2062. this.isokDisable = false
  2063. }, 1000)
  2064. if (row.id == null || row.id == undefined) {
  2065. if (row.brand == '' || row.brandId == '' || row.planAmount == '' || row.price == '') {
  2066. this.$message({
  2067. message: '请检查备件品牌或计划量或单价是否为空',
  2068. type: 'warning'
  2069. })
  2070. return false
  2071. } else {
  2072. this.postDataPramas.name = 'updatecontrattempNoId'
  2073. this.postDataPramas.parammaps = {}
  2074. this.postDataPramas.parammaps.bigId = this.getdataListParmChange.parammaps.id
  2075. this.postDataPramas.parammaps.pastureId = this.createTemp.pastureId
  2076. this.postDataPramas.parammaps.pastureName = this.createTemp.pastureName
  2077. this.postDataPramas.parammaps.partId = row.partId
  2078. this.postDataPramas.parammaps.partName = row.partName
  2079. this.postDataPramas.parammaps.partCode = row.partCode
  2080. this.postDataPramas.parammaps.specification = row.specification
  2081. this.postDataPramas.parammaps.price = row.price
  2082. this.postDataPramas.parammaps.brandId = row.brandId
  2083. this.postDataPramas.parammaps.brand = row.brand
  2084. this.postDataPramas.parammaps.planAmount = row.planAmount
  2085. this.postDataPramas.parammaps.remark = row.remark
  2086. this.postDataPramas.parammaps.unit = row.unit
  2087. PostDataByName(this.postDataPramas).then(response => {
  2088. console.log('保存发送参数', this.requestParam)
  2089. if (response.msg !== 'fail') {
  2090. this.getListChange()
  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. } else {
  2103. if (row.brand == '' || row.brandId == '' || row.planAmount == '' || row.price == '') {
  2104. this.$message({
  2105. message: '请检查备件品牌或计划量或单价是否为空',
  2106. type: 'warning'
  2107. })
  2108. return false
  2109. } else {
  2110. this.postDataPramas.name = 'updatecontrattemp'
  2111. this.postDataPramas.parammaps = {}
  2112. this.postDataPramas.parammaps.brandId = row.brandId
  2113. this.postDataPramas.parammaps.brand = row.brand
  2114. this.postDataPramas.parammaps.planAmount = row.planAmount
  2115. this.postDataPramas.parammaps.price = row.price
  2116. this.postDataPramas.parammaps.remark = row.remark
  2117. this.postDataPramas.parammaps.id = row.id
  2118. PostDataByName(this.postDataPramas).then(response => {
  2119. console.log('保存发送参数', this.requestParam)
  2120. if (response.msg !== 'fail') {
  2121. this.getListChange()
  2122. this.$notify({
  2123. title: '成功',
  2124. message: '保存成功',
  2125. type: 'success',
  2126. duration: 2000
  2127. })
  2128. } else {
  2129. failproccess(response, this.$notify)
  2130. }
  2131. })
  2132. }
  2133. }
  2134. },
  2135. partSmallDelete(row) {
  2136. if (row.id == null || row.id == undefined) {
  2137. MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
  2138. confirmButtonText: '确认',
  2139. cancelButtonText: '取消',
  2140. type: 'warning'
  2141. }).then(() => {
  2142. for (var i = 0; i < this.listAdd.length; i++) {
  2143. console.log(this.listAdd[i])
  2144. if (this.listAdd[i].myid === row.myid) {
  2145. var listAddIndex = this.listAdd.indexOf(this.listAdd[i])
  2146. }
  2147. if (listAddIndex > -1) {
  2148. this.listAdd.splice(listAddIndex, 1)
  2149. return
  2150. }
  2151. }
  2152. })
  2153. } else {
  2154. MessageBox.confirm('确认删除此信息?', {
  2155. confirmButtonText: '确认',
  2156. cancelButtonText: '取消',
  2157. type: 'warning'
  2158. }).then(() => {
  2159. this.postDataPramas.name = 'deletecontrattemp'
  2160. this.postDataPramas.parammaps = {}
  2161. this.postDataPramas.parammaps['id'] = row.id
  2162. PostDataByName(this.postDataPramas).then(() => {
  2163. this.getListChange()
  2164. this.$notify({
  2165. title: '成功',
  2166. message: '删除成功',
  2167. type: 'success',
  2168. duration: 2000
  2169. })
  2170. })
  2171. }).catch(() => {
  2172. this.$message({
  2173. type: 'info',
  2174. message: '已取消删除'
  2175. })
  2176. })
  2177. }
  2178. },
  2179. changeData() {
  2180. if (this.createTemp.statue == '终止') {
  2181. this.isokDisable = true
  2182. setTimeout(() => {
  2183. this.isokDisable = false
  2184. }, 1000)
  2185. this.$refs['createTemp'].validate(valid => {
  2186. if (valid) {
  2187. this.postDataPramas = {}
  2188. this.postDataPramas.name = 'updatecontractstatu'
  2189. this.postDataPramas.parammaps = {}
  2190. this.postDataPramas.parammaps.id = this.createTemp.id
  2191. PostDataByName(this.postDataPramas).then(response => {
  2192. console.log('变更保存发送参数', this.requestParam)
  2193. if (response.msg !== 'fail') {
  2194. this.dialogFormVisible_change = false
  2195. this.getList()
  2196. this.$notify({
  2197. title: '成功',
  2198. message: '变更成功',
  2199. type: 'success',
  2200. duration: 2000
  2201. })
  2202. } else {
  2203. failproccess(response, this.$notify)
  2204. }
  2205. })
  2206. }
  2207. })
  2208. // this.$refs['createTemp'].validate(valid => {
  2209. // if (valid) {
  2210. // if (valid) {
  2211. // if (this.listAdd.length !== 0) {
  2212. // for (var j = 0; j < this.listAdd.length; j++) {
  2213. // if (this.listAdd[j].planAmount == null || this.listAdd[j].brand == null || this.listAdd[j].price == null || this.listAdd[j].planAmount == '' || this.listAdd[j].brand === '' || this.listAdd[j].brandId === '' || this.listAdd[j].price == '' || this.listAdd[j].brand == undefined || this.listAdd[j].brandId == undefined) {
  2214. // this.$message({
  2215. // type: 'warning',
  2216. // message: '请检查备件品牌或计划量或单价是否为空',
  2217. // duration: 2000
  2218. // })
  2219. // return false
  2220. // } else {
  2221. // var rulesPlanAmount = /^[1-9]\d*$/
  2222. // if (!rulesPlanAmount.test(parseFloat(this.listAdd[j].planAmount))) {
  2223. // this.$message({
  2224. // type: 'error',
  2225. // message: '计划量请输入正整数',
  2226. // duration: 2000
  2227. // })
  2228. // return false
  2229. // } else {
  2230. // var rulesPrice = /(^[1-9](\d+)?(\.\d{1,3})?$)|(^\d\.\d{1,3}$)/
  2231. // if (!rulesPrice.test(parseFloat(this.listAdd[j].price))) {
  2232. // this.$message({
  2233. // type: 'error',
  2234. // message: '价格请输入正数,最多保留小数点后三位',
  2235. // duration: 2000
  2236. // })
  2237. // return false
  2238. // }
  2239. // }
  2240. // }
  2241. // }
  2242. // this.postDataPramas.common = { 'returnmap': '0' }
  2243. // this.postDataPramas.data = []
  2244. // this.postDataPramas.data[0] = { 'name': 'insertBigContract', 'type': 'e', 'parammaps': {
  2245. // pastureId: this.createTemp.pastureId,
  2246. // providerId: this.createTemp.providerId,
  2247. // providerName: this.createTemp.providerName,
  2248. // startTime: this.createTemp.startTime,
  2249. // stopTime: this.createTemp.stopTime,
  2250. // contractCode: this.createTemp.precontractCode + '(终止)' + parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}'),
  2251. // creatorId: this.createTemp.creatorId,
  2252. // creatorMan: this.createTemp.creatorMan,
  2253. // creatorTime: this.createTemp.creatorTime,
  2254. // isZeroStock: this.createTemp.isZeroStock,
  2255. // statue: 0,
  2256. // remark: this.createTemp.remark,
  2257. // precontractCode: this.createTemp.precontractCode
  2258. // }}
  2259. // this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  2260. // this.postDataPramas.data[1].children = []
  2261. // this.postDataPramas.data[1].children[0] = { 'name': 'insertContract', 'type': 'e', 'parammaps': {
  2262. // bigId: '@insertBigContract.LastInsertId',
  2263. // pastureId: this.createTemp.pastureId,
  2264. // pastureName: this.createTemp.pastureName,
  2265. // partId: '@insertSpotList.partId',
  2266. // partName: '@insertSpotList.partName',
  2267. // partCode: '@insertSpotList.partCode',
  2268. // specification: '@insertSpotList.specification',
  2269. // price: '@insertSpotList.price',
  2270. // brandId: '@insertSpotList.brandId',
  2271. // brand: '@insertSpotList.brand',
  2272. // planAmount: '@insertSpotList.planAmount',
  2273. // remark: '@insertSpotList.remark',
  2274. // unit: '@insertSpotList.unit'
  2275. // }}
  2276. // // this.postDataPramas.data[2] = { 'name': 'updateBigcontract', 'type': 'e', 'parammaps': {
  2277. // // id: this.createTemp.id
  2278. // // }}
  2279. // ExecDataByConfig(this.postDataPramas).then(response => {
  2280. // console.log('合同终止-保存发送参数', this.postDataPramas)
  2281. // if (response.msg === 'fail') {
  2282. // this.$notify({
  2283. // title: '保存失败',
  2284. // message: response.data,
  2285. // type: 'warning',
  2286. // duration: 2000
  2287. // })
  2288. // } else {
  2289. // this.getdataListParm.parammaps.inputDatetime = ''
  2290. // this.getList()
  2291. // this.dialogFormVisible_change = false
  2292. // this.createTemp.providerName = ''
  2293. // this.$notify({
  2294. // title: '',
  2295. // message: '保存成功',
  2296. // type: 'success',
  2297. // duration: 2000
  2298. // })
  2299. // }
  2300. // })
  2301. // return true
  2302. // } else {
  2303. // this.$notify({
  2304. // title: '',
  2305. // message: '请选择备件',
  2306. // type: 'warning',
  2307. // duration: 2000
  2308. // })
  2309. // return false
  2310. // }
  2311. // }
  2312. // }
  2313. // })
  2314. } else {
  2315. this.isokDisable = true
  2316. setTimeout(() => {
  2317. this.isokDisable = false
  2318. }, 1000)
  2319. this.$refs['createTemp'].validate(valid => {
  2320. if (valid) {
  2321. this.postDataPramas.name = 'Copybigcontracttemp'
  2322. this.postDataPramas.parammaps = {}
  2323. this.postDataPramas.parammaps.id = this.getdataListParmChange.parammaps.id
  2324. PostDataByName(this.postDataPramas).then(response => {
  2325. console.log('变更保存发送参数', this.requestParam)
  2326. if (response.msg !== 'fail') {
  2327. this.dialogFormVisible_change = false
  2328. this.getList()
  2329. this.$notify({
  2330. title: '成功',
  2331. message: '变更成功',
  2332. type: 'success',
  2333. duration: 2000
  2334. })
  2335. } else {
  2336. failproccess(response, this.$notify)
  2337. }
  2338. })
  2339. }
  2340. })
  2341. // this.$refs['createTemp'].validate(valid => {
  2342. // if (valid) {
  2343. // if (valid) {
  2344. // if (this.listAdd.length !== 0) {
  2345. // for (var j = 0; j < this.listAdd.length; j++) {
  2346. // if (this.listAdd[j].planAmount == null || this.listAdd[j].brand == null || this.listAdd[j].price == null || this.listAdd[j].planAmount == '' || this.listAdd[j].brand === '' || this.listAdd[j].brandId === '' || this.listAdd[j].price == '' || this.listAdd[j].brand == undefined || this.listAdd[j].brandId == undefined) {
  2347. // this.$message({
  2348. // type: 'warning',
  2349. // message: '请检查备件品牌或计划量或单价是否为空',
  2350. // duration: 2000
  2351. // })
  2352. // return false
  2353. // } else {
  2354. // var rulesPlanAmount = /^[1-9]\d*$/
  2355. // if (!rulesPlanAmount.test(parseFloat(this.listAdd[j].planAmount))) {
  2356. // this.$message({
  2357. // type: 'error',
  2358. // message: '计划量请输入正整数',
  2359. // duration: 2000
  2360. // })
  2361. // return false
  2362. // } else {
  2363. // var rulesPrice = /(^[1-9](\d+)?(\.\d{1,3})?$)|(^\d\.\d{1,3}$)/
  2364. // if (!rulesPrice.test(parseFloat(this.listAdd[j].price))) {
  2365. // this.$message({
  2366. // type: 'error',
  2367. // message: '价格请输入正数,最多保留小数点后三位',
  2368. // duration: 2000
  2369. // })
  2370. // return false
  2371. // }
  2372. // }
  2373. // }
  2374. // }
  2375. // this.postDataPramas.common = { 'returnmap': '0' }
  2376. // this.postDataPramas.data = []
  2377. // this.postDataPramas.data[0] = { 'name': 'insertBigContract', 'type': 'e', 'parammaps': {
  2378. // pastureId: this.createTemp.pastureId,
  2379. // providerId: this.createTemp.providerId,
  2380. // providerName: this.createTemp.providerName,
  2381. // startTime: this.createTemp.startTime,
  2382. // stopTime: this.createTemp.stopTime,
  2383. // contractCode: this.createTemp.contractCode,
  2384. // creatorId: this.createTemp.creatorId,
  2385. // creatorMan: this.createTemp.creatorMan,
  2386. // creatorTime: this.createTemp.creatorTime,
  2387. // isZeroStock: this.createTemp.isZeroStock,
  2388. // statue: 1,
  2389. // remark: this.createTemp.remark,
  2390. // precontractCode: this.createTemp.precontractCode
  2391. // }}
  2392. // this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
  2393. // this.postDataPramas.data[1].children = []
  2394. // this.postDataPramas.data[1].children[0] = { 'name': 'insertContract', 'type': 'e', 'parammaps': {
  2395. // bigId: '@insertBigContract.LastInsertId',
  2396. // pastureId: this.createTemp.pastureId,
  2397. // pastureName: this.createTemp.pastureName,
  2398. // partId: '@insertSpotList.partId',
  2399. // partName: '@insertSpotList.partName',
  2400. // partCode: '@insertSpotList.partCode',
  2401. // specification: '@insertSpotList.specification',
  2402. // price: '@insertSpotList.price',
  2403. // brandId: '@insertSpotList.brandId',
  2404. // brand: '@insertSpotList.brand',
  2405. // planAmount: '@insertSpotList.planAmount',
  2406. // remark: '@insertSpotList.remark',
  2407. // unit: '@insertSpotList.unit'
  2408. // }}
  2409. // // this.postDataPramas.data[2] = { 'name': 'updateBigcontract', 'type': 'e', 'parammaps': {
  2410. // // id: this.createTemp.id
  2411. // // }}
  2412. // console.log(this.listAdd[0].brandId)
  2413. // console.log(this.listAdd[0].brand)
  2414. // ExecDataByConfig(this.postDataPramas).then(response => {
  2415. // console.log('新增保存发送参数', this.postDataPramas)
  2416. // if (response.msg === 'fail') {
  2417. // this.$notify({
  2418. // title: '保存失败',
  2419. // message: response.data,
  2420. // type: 'warning',
  2421. // duration: 2000
  2422. // })
  2423. // } else {
  2424. // this.getdataListParm.parammaps.inputDatetime = ''
  2425. // this.getList()
  2426. // this.dialogFormVisible_change = false
  2427. // this.createTemp.providerName = ''
  2428. // this.$notify({
  2429. // title: '',
  2430. // message: '保存成功',
  2431. // type: 'success',
  2432. // duration: 2000
  2433. // })
  2434. // }
  2435. // })
  2436. // return true
  2437. // } else {
  2438. // this.$notify({
  2439. // title: '',
  2440. // message: '请选择备件',
  2441. // type: 'warning',
  2442. // duration: 2000
  2443. // })
  2444. // return false
  2445. // }
  2446. // }
  2447. // }
  2448. // })
  2449. }
  2450. },
  2451. // --------------------------------------------
  2452. // 导出
  2453. handleDownload() {
  2454. this.$alert('合同管理正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  2455. this.isPercentage = true
  2456. this.percentage = 1
  2457. var timer = setInterval(() => {
  2458. this.percentage += 5
  2459. if (this.percentage > 95) {
  2460. this.percentage = 99
  2461. clearInterval(timer)
  2462. }
  2463. this.percentage = this.percentage
  2464. }, 1000)
  2465. this.downloadParam.name = 'contractDownload'
  2466. this.downloadParam.parammaps = this.getdataListParm.parammaps
  2467. GetAccount(this.downloadParam).then(response => {
  2468. if (response.data.list !== '') {
  2469. this.percentage = 99
  2470. setTimeout(() => {
  2471. this.isPercentage = false
  2472. }, 2000)
  2473. }
  2474. this.$nextTick(() => {
  2475. const ExcelDatas = [
  2476. {
  2477. tHeader: ['合同编号', '牧场', '合同开始日期', '合同截止日期', '供应商', '物料编码', '品名', '规格型号', '计量单位', '品牌', '计划量', '单价', '备注', '一级分类', '二级分类', '三级分类', '填写人', '填写时间', '合同状态', '是否零库存(0否,1是)'],
  2478. filterVal: ['contractCode', 'pastureName', 'startTime', 'stopTime', 'providerName', 'partCode', 'partName', 'specification', 'unit', 'brand', 'planAmount', 'price', 'remark', '', '', '', 'creatorMan', 'creatorTime', 'statue', 'isZeroStock'],
  2479. tableDatas: response.data.list,
  2480. sheetName: '合同管理'
  2481. }
  2482. ]
  2483. json2excel(ExcelDatas, '合同管理', true, 'xlsx')
  2484. })
  2485. })
  2486. },
  2487. // 导出模板
  2488. handleDownloadTemp() {
  2489. this.requestParam.name = 'pStockDownTemp'
  2490. GetDataByName(this.requestParam).then(response => {
  2491. this.$nextTick(() => {
  2492. import('@/vendor/Export2Excel').then(excel => {
  2493. const list1 = response.data.list
  2494. const tHeader = [
  2495. '合同编号', '牧场', '合同开始日期', '合同截止日期', '供应商', '物料编码', '品名', '规格型号', '计量单位', '品牌', '计划量', '单价', '备注', '一级分类', '二级分类', '三级分类', '填写人', '填写时间'
  2496. ]
  2497. const filterVal = [
  2498. '合同编号', '牧场', '合同开始日期', '合同截止日期', '供应商', '物料编码', '品名', '规格型号', '计量单位', '品牌', '计划量', '单价', '备注', '一级分类', '二级分类', '三级分类', '填写人', '填写时间'
  2499. ]
  2500. const data1 = this.formatJsonTemp(filterVal, list1)
  2501. excel.export_json_to_excel({
  2502. header: tHeader,
  2503. data: data1,
  2504. filename: '合同信息模板',
  2505. autoWidth: true,
  2506. bookType: 'xlsx'
  2507. })
  2508. })
  2509. })
  2510. })
  2511. },
  2512. formatJsonTemp(filterVal, jsonData) {
  2513. return jsonData.map(v =>
  2514. filterVal.map(j => {
  2515. if (j === 'timestamp') {
  2516. return parseTime(v[j])
  2517. } else {
  2518. return v[j]
  2519. }
  2520. })
  2521. )
  2522. },
  2523. beforeImportExcel(file) {
  2524. const isLt2M = file.size / 1024 / 1024 < 6
  2525. if (!isLt2M) {
  2526. this.$message.error('上传文件大小不能超过 6MB!')
  2527. }
  2528. return isLt2M
  2529. },
  2530. handleImportExcelSuccess(res, file) {
  2531. this.getList()
  2532. if (res.msg === 'ok') {
  2533. this.$message({
  2534. title: '成功',
  2535. message: '导入成功:' + res.data.success + '条!',
  2536. type: 'success',
  2537. duration: 2000
  2538. })
  2539. if (res.data.err_count > 0) {
  2540. this.$notify({
  2541. title: '失败',
  2542. message: '导入失败:' + res.data.err_count + '条!',
  2543. type: 'danger',
  2544. duration: 2000
  2545. })
  2546. import('@/vendor/Export2Excel').then(excel => {
  2547. const list1 = res.data.result
  2548. const tHeader = [
  2549. '合同编号', '牧场', '合同开始日期', '合同截止日期', '供应商', '物料编码', '品名', '规格型号', '计量单位', '品牌', '计划量', '单价', '备注', '一级分类', '二级分类', '三级分类', '填写人', '填写时间', '分管副场审核', '分管副场审核时间', '场长审核', '场长审核时间', '运营办审核', '运营办审核时间', '过期处理人', '过期处理时间', '报错信息'
  2550. ]
  2551. const filterVal = [
  2552. '合同编号', '牧场', '合同开始日期', '合同截止日期', '供应商', '物料编码', '品名', '规格型号', '计量单位', '品牌', '计划量', '单价', '备注', '一级分类', '二级分类', '三级分类', '填写人', '填写时间', '分管副场审核', '分管副场审核时间', '场长审核', '场长审核时间', '运营办审核', '运营办审核时间', '过期处理人', '过期处理时间', 'error_msg'
  2553. ]
  2554. const data1 = this.formatJson(filterVal, list1)
  2555. excel.export_json_to_excel({
  2556. header: tHeader,
  2557. data: data1,
  2558. filename: '合同报错信息',
  2559. autoWidth: true,
  2560. bookType: 'xlsx'
  2561. })
  2562. })
  2563. }
  2564. } else {
  2565. this.$notify({
  2566. title: '失败',
  2567. message: '上传失败,文件格式错误',
  2568. type: 'danger',
  2569. duration: 2000
  2570. })
  2571. }
  2572. },
  2573. formatJson(filterVal, jsonData) {
  2574. return jsonData.map(v =>
  2575. filterVal.map(j => {
  2576. if (j === 'timestamp') {
  2577. return parseTime(v[j])
  2578. } else {
  2579. return v[j]
  2580. }
  2581. })
  2582. )
  2583. },
  2584. // 供应商模糊查询
  2585. providerSearch(queryString, cb) {
  2586. var returnList = this.findAllProvider
  2587. var results = queryString ? returnList.filter(this.createFilter(queryString)) : returnList
  2588. // 调用 callback 返回建议列表的数据
  2589. cb(results)
  2590. },
  2591. createFilter(queryString) {
  2592. return returnValue => {
  2593. return (
  2594. returnValue.name.toLowerCase().indexOf(queryString.toLowerCase()) >= 0
  2595. )
  2596. }
  2597. },
  2598. handleSelectProvider(item) {
  2599. console.log(item)
  2600. this.$set(this.createTemp, 'providerId', item.id)
  2601. this.$set(this.createTemp, 'providerName', item.name)
  2602. // this.createTemp.providerId = item.id
  2603. // this.createTemp.providerName = item.name
  2604. },
  2605. handleFocusProvider() {
  2606. this.createTemp.providerId = ''
  2607. this.createTemp.providerName = ''
  2608. },
  2609. handleBlurProvider() {
  2610. if (this.createTemp.providerId == '') {
  2611. this.createTemp.providerId = ''
  2612. this.createTemp.providerName = ''
  2613. }
  2614. },
  2615. // 1-1: table&搜索
  2616. tableCellClassName({ row, column, rowIndex, columnIndex }) {
  2617. row.index = rowIndex
  2618. column.index = columnIndex
  2619. },
  2620. selected(select) {
  2621. // this.batchCancelId = []
  2622. this.selectionIndex = []
  2623. this.selectionIndex.push(3, 4, 5)
  2624. // console.log(this.selectionIndex)
  2625. },
  2626. // 2-2:下拉框
  2627. popoverHide(checkedIds, checkedData) {
  2628. this.temp.categoryId = checkedIds
  2629. this.temp.stockNumber = checkedData.checkNumber
  2630. // console.log(checkedIds, checkedData.checkNumber)
  2631. },
  2632. handleModifyStatus(row, status) {
  2633. this.$message({
  2634. message: '操作成功',
  2635. type: 'success'
  2636. })
  2637. row.status = status
  2638. },
  2639. // 合同明细打印
  2640. edit_dialog_save() {
  2641. this.$refs['temp'].validate(valid => {
  2642. if (valid) {
  2643. this.requestParam.name = 'updateStock'
  2644. this.requestParam.parammaps = this.temp
  2645. PostDataByName(this.requestParam).then(response => {
  2646. console.log(response)
  2647. if (response.msg === 'fail') {
  2648. this.$notify({
  2649. title: '失败',
  2650. message: '保存失败-' + response.data,
  2651. type: 'warning',
  2652. duration: 2000
  2653. })
  2654. } else {
  2655. this.getList()
  2656. this.dialogFormVisible = false
  2657. this.$notify({
  2658. title: '成功',
  2659. message: '修改成功',
  2660. type: 'success',
  2661. duration: 2000
  2662. })
  2663. }
  2664. })
  2665. }
  2666. })
  2667. },
  2668. // 修改
  2669. form_edit(row) {
  2670. this.temp = Object.assign({}, row) // copy obj
  2671. // 基础信息
  2672. this.defaultCheckedKeys = [this.temp.categoryId]
  2673. this.dialogStatus = 'update'
  2674. this.dialogFormVisible = true
  2675. this.getdataListParmSee.parammaps.pastureId = row.pastureId
  2676. this.getdataListParmSee.parammaps.contractNO = row.contractNO
  2677. this.getListCard()
  2678. },
  2679. getListCard() {
  2680. GetDataByName(this.getdataListParmSee).then(response => {
  2681. // this.list2 = response.data.list
  2682. console.log(this.list2)
  2683. // this.pageNum = response.data.pageNum
  2684. // this.pageSize = response.data.pageSize
  2685. // if (response.data.total) {
  2686. // this.total = response.data.total
  2687. // }
  2688. // Just to simulate the time of the request
  2689. setTimeout(() => {
  2690. this.listLoadingAdd = false
  2691. }, 300)
  2692. })
  2693. },
  2694. // 删除
  2695. form_delete(row) {
  2696. console.log('点击了删除')
  2697. MessageBox.confirm('确认删除此条信息?', {
  2698. confirmButtonText: '确认',
  2699. cancelButtonText: '取消',
  2700. type: 'warning'
  2701. }).then(() => {
  2702. this.postDataPramas.common = { 'returnmap': '0' }
  2703. this.postDataPramas.data = []
  2704. this.postDataPramas.data[0] = { 'name': 'deleteBigContract', 'type': 'e', 'parammaps': {
  2705. id: row.id
  2706. }}
  2707. this.postDataPramas.data[1] = { 'name': 'deleteContract', 'type': 'e', 'parammaps': {
  2708. bigId: row.id
  2709. }}
  2710. ExecDataByConfig(this.postDataPramas).then(response => {
  2711. this.getList()
  2712. this.$notify({
  2713. title: '成功',
  2714. message: '删除成功',
  2715. type: 'success',
  2716. duration: 2000
  2717. })
  2718. })
  2719. })
  2720. .catch(() => {
  2721. this.$message({
  2722. type: 'info',
  2723. message: '已取消删除'
  2724. })
  2725. })
  2726. },
  2727. // 编号/名称
  2728. stockSearch(queryString, cb) {
  2729. this.requestFilterParams.parammaps = {}
  2730. this.requestFilterParams.name = 'findByDimStock'
  2731. this.requestFilterParams.parammaps['stockA'] = queryString
  2732. GetDataByName(this.requestFilterParams).then(response => {
  2733. // console.log(response.data.list)
  2734. cb(response.data.list)
  2735. })
  2736. },
  2737. handleStockSelect(item) {
  2738. var ss = 0
  2739. GetDataByName(this.requestFilterParams).then(response => {
  2740. this.$nextTick(() => {
  2741. if (response.data.list.length > 0) {
  2742. this.stockAAA = {}
  2743. if (item.repertory <= 0) {
  2744. this.$notify({
  2745. title: '添加失败',
  2746. message: '此备件无库存了,请联系库管尽快补货哦...',
  2747. type: 'warning',
  2748. duration: 2000
  2749. })
  2750. } else {
  2751. if (this.list2 === null) {
  2752. this.list2 = []
  2753. }
  2754. this.list2.some((item1, i) => {
  2755. if (item1.stockNumber === item.stockNumber) {
  2756. ss = 1
  2757. }
  2758. })
  2759. if (ss === 0) { this.list2.push(item) }
  2760. }
  2761. }
  2762. })
  2763. })
  2764. },
  2765. changeIsZero(val) {
  2766. console.log(val)
  2767. }
  2768. }
  2769. }
  2770. </script>