index2.vue 104 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538
  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 v-if="isDistributionSheet" label="采购配单" name="first">
  9. <div class="purchaseDistributionSheet">
  10. <div class="filter-container">
  11. <el-select v-model="getdataListParm1.parammaps.departmentId" style="width: 140px;" placeholder="部门" class="filter-item" @change = "change_dept">
  12. <el-option v-for="item in deptNameList" :key="item.id" :label="item.name" :value="item.id" />
  13. </el-select>
  14. </div>
  15. <el-table
  16. :key="tableKey1"
  17. v-loading="listLoading1"
  18. element-loading-text="给我一点时间"
  19. :data="list1"
  20. border
  21. fit
  22. :row-style="tableRowStyle"
  23. :cell-style="tableCellStyle"
  24. highlight-current-row
  25. style="width: 100%;"
  26. class="elTable table-fixed"
  27. @cell-click="cellClick"
  28. @sort-change="tableSort"
  29. :max-height="myHeight"
  30. >
  31. <el-table-column label="序号" align="center" type="index" width="50px">
  32. <template slot-scope="scope">
  33. <span>{{ scope.$index + (pageNum1-1) * pageSize1 + 1 }}</span>
  34. </template>
  35. </el-table-column>
  36. <el-table-column label="备件编号" align="center" min-width="150px">
  37. <template slot-scope="scope">
  38. <span>{{ scope.row.partCode }}</span>
  39. </template>
  40. </el-table-column>
  41. <el-table-column label="备件名称" align="center" min-width="120px">
  42. <template slot-scope="scope">
  43. <span>{{ scope.row.partName }}</span>
  44. </template>
  45. </el-table-column>
  46. <el-table-column label="备件规格" align="center" min-width="120px">
  47. <template slot-scope="scope">
  48. <span>{{ scope.row.specification }}</span>
  49. </template>
  50. </el-table-column>
  51. <el-table-column label="备件品牌" min-width="100px" align="center">
  52. <template slot-scope="scope">
  53. <span>{{ scope.row.brand }}</span>
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="计量单位" min-width="80px" align="center">
  57. <template slot-scope="scope">
  58. <span>{{ scope.row.unit }}</span>
  59. </template>
  60. </el-table-column>
  61. <el-table-column label="图片" min-width="110px" align="center">
  62. <template slot-scope="scope">
  63. <el-popover placement="right" title="" trigger="hover">
  64. <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
  65. <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  66. </el-popover>
  67. </template>
  68. </el-table-column>
  69. <el-table-column label="供应商" min-width="110px" align="center">
  70. <template slot-scope="scope">
  71. <span>{{ scope.row.providerName }}</span>
  72. </template>
  73. </el-table-column>
  74. <el-table-column sortable prop="price" label="单价" min-width="70px" align="center">
  75. <template slot-scope="scope">
  76. <span>{{ scope.row.price }}</span>
  77. </template>
  78. </el-table-column>
  79. <el-table-column sortable prop="sumAmount" label="申购数量" min-width="90px" align="center">
  80. <template slot-scope="scope">
  81. <span>{{ scope.row.sumAmount }}</span>
  82. </template>
  83. </el-table-column>
  84. <el-table-column label="采购数量" min-width="110px" align="center">
  85. <template slot-scope="scope">
  86. <el-form :model="scope.row" :rules="rules">
  87. <el-form-item prop="amount">
  88. <el-input
  89. v-model="scope.row.amount"
  90. style="width:80px;margin-top:25px;height:10px"
  91. />
  92. </el-form-item>
  93. </el-form>
  94. </template>
  95. </el-table-column>
  96. </el-table>
  97. <el-button :disabled="confirmationSheetDisabled" type="primary" style="float: right;margin-top: 10px;" @click="confirmationSheet()">确认配单</el-button>
  98. <el-dialog :title="textMap[dialogStatusConfirmation]" :visible.sync="dialogFormVisibleConfirmation" :close-on-click-modal="false" style="width:100%;margin: 0 auto;overflow:auto">
  99. <div class="app-contentConfirmationSheet">
  100. <el-form ref="temp1" :rules="rules" :model="temp1" label-position="right" label-width="90px" style="width:100%;margin-bottom:50px">
  101. <el-row>
  102. <el-col :span="8">
  103. <el-form-item label="配单号:" prop="matchCode">
  104. <el-input ref="matchCode" v-model="temp1.matchCode" disabled />
  105. </el-form-item>
  106. </el-col>
  107. <el-col :span="8">
  108. <el-form-item label="提交日期:" prop="buyerDate">
  109. <el-date-picker
  110. v-model="temp1.buyerDate"
  111. :picker-options="pickerOptions"
  112. type="date"
  113. placeholder="提交日期"
  114. format="yyyy-MM-dd"
  115. value-format="yyyy-MM-dd"
  116. style="width:170px;"
  117. />
  118. </el-form-item>
  119. </el-col>
  120. <el-col :span="8">
  121. <el-form-item label="采购员:" prop="buyerPerson">
  122. <el-select v-model="temp1.buyerPerson" placeholder="采购员" class="filter-item">
  123. <el-option
  124. v-for="item in findAllEmploye"
  125. :key="item.id"
  126. :label="item.name"
  127. :value="item.id"
  128. />
  129. </el-select>
  130. </el-form-item>
  131. </el-col>
  132. </el-row>
  133. </el-form>
  134. <div v-for="(item,index) in listConfirmationSheet" :key="index" class="app-content">
  135. <div class="title">
  136. <div>
  137. <b>采购单号:</b>
  138. <span>{{ item.orderNumber }}</span>
  139. </div>
  140. <div>
  141. <b>供应商:</b>
  142. <span>{{ item.providerName }}</span>
  143. </div>
  144. </div>
  145. <el-table
  146. :key="tableKey1"
  147. v-loading="listLoading1"
  148. element-loading-text="给我一点时间"
  149. :data="item.list"
  150. border
  151. fit
  152. highlight-current-row
  153. style="width: 97%;margin:0 auto"
  154. :row-style="rowStyle"
  155. :cell-style="cellStyle"
  156. class="elTable table-fixed"
  157. >
  158. <!-- table表格 -->
  159. <el-table-column label="序号" align="center" type="index" width="50px">
  160. <template slot-scope="scope">
  161. <span>{{ scope.$index + (pageNum1-1) * pageSize1 + 1 }}</span>
  162. </template>
  163. </el-table-column>
  164. <el-table-column label="备件编号" align="center" min-width="150px">
  165. <template slot-scope="scope">
  166. <span>{{ scope.row.partCode }}</span>
  167. </template>
  168. </el-table-column>
  169. <el-table-column label="备件名称" align="center" min-width="120px">
  170. <template slot-scope="scope">
  171. <span>{{ scope.row.partName }}</span>
  172. </template>
  173. </el-table-column>
  174. <el-table-column label="备件规格" align="center" min-width="120px">
  175. <template slot-scope="scope">
  176. <span>{{ scope.row.specification }}</span>
  177. </template>
  178. </el-table-column>
  179. <el-table-column label="图片" min-width="110px" align="center">
  180. <template slot-scope="scope">
  181. <el-popover placement="right" title="" trigger="hover">
  182. <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
  183. <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  184. </el-popover>
  185. </template>
  186. </el-table-column>
  187. <el-table-column label="备件品牌" min-width="100px" align="center">
  188. <template slot-scope="scope">
  189. <span>{{ scope.row.brand }}</span>
  190. </template>
  191. </el-table-column>
  192. <el-table-column label="计量单位" min-width="80px" align="center">
  193. <template slot-scope="scope">
  194. <span>{{ scope.row.unit }}</span>
  195. </template>
  196. </el-table-column>
  197. <el-table-column label="单价" min-width="70px" align="center">
  198. <template slot-scope="scope">
  199. <span>{{ scope.row. price }}</span>
  200. </template>
  201. </el-table-column>
  202. <el-table-column label="申购数量" min-width="90px" align="center">
  203. <template slot-scope="scope">
  204. <span>{{ scope.row.sumAmount }}</span>
  205. </template>
  206. </el-table-column>
  207. <el-table-column label="合计采购数量" min-width="90px" align="center">
  208. <template slot-scope="scope">
  209. <span>{{ scope.row.amount }}</span>
  210. </template>
  211. </el-table-column>
  212. <el-table-column label="总价" min-width="90px" align="center">
  213. <template slot-scope="scope">
  214. <span>{{ (scope.row.sumPrice = scope.row.price * parseFloat(scope.row.amount))| keepTwoNum }}</span>
  215. </template>
  216. </el-table-column>
  217. </el-table>
  218. <div ref="total" class="total">
  219. 合计:
  220. <span>{{ item.Sum }}</span>
  221. </div>
  222. </div>
  223. <div slot="footer" class="dialog-footer" style="bottom:10px">
  224. <el-button type="primary" :disabled="isokDisable" @click="confirmationSheetData()">确认</el-button>
  225. <el-button @click="dialogFormVisibleConfirmation= false;get_table_data1();">取消</el-button>
  226. </div>
  227. </div>
  228. </el-dialog>
  229. </div>
  230. </el-tab-pane>
  231. <el-tab-pane v-if="isDistributionManagement" label="配单管理" name="fouth">
  232. <div class="DistributionManagement">
  233. <div class="filter-container">
  234. <el-select v-model="getdataListParm4.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item">
  235. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  236. </el-select>
  237. <el-input v-model="getdataListParm4.parammaps.matchCode" placeholder="配单号" clearable style="width: 200px;" class="filter-item" />
  238. <el-select v-model="getdataListParm4.parammaps.statue" clearable placeholder="审核状态" class="filter-item" style="width: 120px;">
  239. <el-option v-for="item in status2" :key="item.id" :label="item.name" :value="item.id" />
  240. </el-select>
  241. <el-date-picker ref="inputDatetime4" v-model="getdataListParm4.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 270px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始提交日期" end-placeholder="结束提交日期" />
  242. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search4">搜索</el-button>
  243. </div>
  244. <el-table
  245. :key="tableKey4"
  246. v-loading="listLoading4"
  247. element-loading-text="给我一点时间"
  248. :data="list4"
  249. border
  250. fit
  251. highlight-current-row
  252. style="width: 100%;"
  253. :row-style="rowStyle"
  254. :cell-style="cellStyle"
  255. class="elTable table-fixed"
  256. @sort-change="tableSort"
  257. @current-change="handleCurrentChange"
  258. :max-height="myHeight"
  259. >
  260. <el-table-column label="序号" align="center" type="index" width="50px">
  261. <template slot-scope="scope">
  262. <span>{{ scope.$index + (pageNum2-1) * pageSize2 + 1 }}</span>
  263. </template>
  264. </el-table-column>
  265. <el-table-column label="牧场" min-width="110px" align="center">
  266. <template slot-scope="scope">
  267. <span>{{ scope.row.pastureName }}</span>
  268. </template>
  269. </el-table-column>
  270. <el-table-column label="配单号" min-width="110px" align="center">
  271. <template slot-scope="scope">
  272. <span>{{ scope.row.matchCode }}</span>
  273. </template>
  274. </el-table-column>
  275. <el-table-column label="采购员" min-width="130px" align="center">
  276. <template slot-scope="scope">
  277. <span>{{ scope.row.empname }}</span>
  278. </template>
  279. </el-table-column>
  280. <el-table-column label="提交日期" sortable prop="dealTime" min-width="110px" align="center" />
  281. <el-table-column sortable prop="cou" label="采购单数" min-width="110px" align="center">
  282. <template slot-scope="scope">
  283. <span>{{ scope.row.cou }}</span>
  284. </template>
  285. </el-table-column>
  286. <el-table-column label="审核状态" min-width="80px" align="center" :formatter="statue" />
  287. <el-table-column label="操作" align="center" width="250px" class-name="small-padding fixed-width" fixed="right">
  288. <template slot-scope="{row}">
  289. <el-button v-if="isPurchaseSee" type="primary" size="mini" @click="form_see4(row)">查看</el-button>
  290. <el-button v-if="parseFloat(row.statue) === 0 && isExamineDM" style="display:inline-block" type="success" size="mini" @click="handleExamine(row)">审核</el-button>
  291. <el-button v-else style="display:none;" type="success" size="mini" @click="handleExamine(row)">审核</el-button>
  292. <el-button v-if="parseFloat(row.statue) === 2" type="success" style="display:inline-block" size="mini" @click="form_edit(row)">编辑</el-button>
  293. <el-button v-else style="display:none;" type="success" size="mini" @click="form_edit(row)">编辑</el-button>
  294. </template>
  295. </el-table-column>
  296. </el-table>
  297. <pagination v-show="total4>0" :total="total4" :page.sync="getdataListParm4.offset" :limit.sync="getdataListParm4.pagecount" @pagination="get_table_data4" />
  298. <el-dialog :title="textMap[dialogStatusSee4]" :visible.sync="dialogFormVisibleSee4" :close-on-click-modal="false">
  299. <div class="app-contentSee">
  300. <el-form ref="temp4" :rules="rules" :model="temp4" label-position="right" label-width="80px" style="width: 800px;margin-bottom:30px">
  301. <el-row>
  302. <el-col :span="8">
  303. <el-form-item label="配单号:" prop="matchCode">
  304. <span>{{ temp4.matchCode }}</span>
  305. </el-form-item>
  306. </el-col>
  307. <el-col :span="8">
  308. <el-form-item label="采购员:" prop="empname">
  309. <span>{{ temp4.empname }}</span>
  310. </el-form-item>
  311. </el-col>
  312. <el-col :span="8">
  313. <el-form-item label="配单日期:" prop="dealTime">
  314. <span>{{ temp4.dealTime }}</span>
  315. </el-form-item>
  316. </el-col>
  317. </el-row>
  318. </el-form>
  319. <el-table
  320. :key="tableKeySee4"
  321. v-loading="listLoadingSee4"
  322. element-loading-text="给我一点时间"
  323. :data="listSee4"
  324. border
  325. fit
  326. highlight-current-row
  327. style="width: 100%;margin-bottom:100px"
  328. :row-style="rowStyle"
  329. :cell-style="cellStyle"
  330. class="elTable table-fixed"
  331. :max-height="myHeight"
  332. >
  333. <el-table-column label="序号" align="center" type="index" width="50px" />
  334. <el-table-column label="采购单号" min-width="110px" align="center">
  335. <template slot-scope="scope">
  336. <span>{{ scope.row.buyeCode }}</span>
  337. </template>
  338. </el-table-column>
  339. <el-table-column label="备件编号" min-width="110px" align="center">
  340. <template slot-scope="scope">
  341. <span>{{ scope.row.partCode }}</span>
  342. </template>
  343. </el-table-column>
  344. <el-table-column label="备件名称" min-width="110px" align="center">
  345. <template slot-scope="scope">
  346. <span>{{ scope.row.partName }}</span>
  347. </template>
  348. </el-table-column>
  349. <el-table-column label="备件规格" min-width="110px" align="center">
  350. <template slot-scope="scope">
  351. <span>{{ scope.row.specification }}</span>
  352. </template>
  353. </el-table-column>
  354. <el-table-column label="备件品牌" min-width="110px" align="center">
  355. <template slot-scope="scope">
  356. <span>{{ scope.row.brand }}</span>
  357. </template>
  358. </el-table-column>
  359. <el-table-column label="计量单位" min-width="60px" align="center">
  360. <template slot-scope="scope">
  361. <span>{{ scope.row.unit }}</span>
  362. </template>
  363. </el-table-column>
  364. <el-table-column label="供应商" min-width="110px" align="center">
  365. <template slot-scope="scope">
  366. <span>{{ scope.row.providerName }}</span>
  367. </template>
  368. </el-table-column>
  369. <el-table-column sortable prop="price" label="单价" min-width="60px" align="center">
  370. <template slot-scope="scope">
  371. <span>{{ scope.row.price }}</span>
  372. </template>
  373. </el-table-column>
  374. <el-table-column sortable prop="sumAmount" label="申购数量" min-width="60px" align="center">
  375. <template slot-scope="scope">
  376. <span>{{ scope.row.sumAmount }}</span>
  377. </template>
  378. </el-table-column>
  379. <el-table-column sortable prop="amount" label="采购数量" min-width="60px" align="center">
  380. <template slot-scope="scope">
  381. <span>{{ scope.row.amount }}</span>
  382. </template>
  383. </el-table-column>
  384. <el-table-column sortable prop="sumPrice" label="总价" min-width="60px" align="center">
  385. <template slot-scope="scope">
  386. <span>{{ scope.row.sumPrice }}</span>
  387. </template>
  388. </el-table-column>
  389. <el-table-column label="备件图片" min-width="110px" align="center">
  390. <template slot-scope="scope">
  391. <el-popover placement="right" title="" trigger="hover">
  392. <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
  393. <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  394. </el-popover>
  395. </template>
  396. </el-table-column>
  397. <el-table-column prop="SGremark" label="备注" min-width="60px" align="center" />
  398. </el-table>
  399. <el-form ref="temp4" :rules="rules" :model="temp4" label-position="right" label-width="120px" style="width: 90%;margin:0 auto;">
  400. <el-row>
  401. <el-col>
  402. <el-form-item label="流程进度" />
  403. <el-steps :active="active" align-center finish-status="success">
  404. <el-step
  405. v-for="(item,index) in activeList"
  406. :key="index"
  407. :title="item.title"
  408. :status="item.status"
  409. >
  410. <template slot="description">
  411. <div class="step-row">
  412. <div>{{ item.name }}&nbsp;&nbsp;{{ item.date }}</div>
  413. <div>{{ item.reason }}</div>
  414. </div>
  415. </template>
  416. </el-step>
  417. </el-steps>
  418. </el-col>
  419. </el-row>
  420. <el-row>
  421. <el-col>
  422. <el-form-item label="操作:">
  423. <!-- 审核 -->
  424. <el-button v-if="isExamineDM && temp4.statue == 0" type="success" style="display:inline-block" @click="handleExamine()">审核</el-button>
  425. <el-button v-else type="success" style="display:none" @click="handleExamine()">审核</el-button>
  426. </el-form-item>
  427. </el-col>
  428. </el-row>
  429. </el-form>
  430. <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
  431. <el-button @click="dialogFormVisibleSee4 = false;">关闭</el-button>
  432. </div>
  433. </div>
  434. </el-dialog>
  435. <el-dialog :title="textMap[dialogStatusUpdate4]" width="90%" :visible.sync="dialogFormVisibleUpdate4" :close-on-click-modal="false">
  436. <div class="app-contentUpdate">
  437. <el-form
  438. ref="updateTemp4"
  439. :rules="rules"
  440. :model="updateTemp4"
  441. label-position="right"
  442. label-width="80px"
  443. style="width:80%;margin-bottom:30px"
  444. >
  445. <el-row>
  446. <el-col :span="8">
  447. <el-form-item label="配单号:" prop="matchCode">
  448. <span>{{ updateTemp4.matchCode }}</span>
  449. </el-form-item>
  450. </el-col>
  451. <el-col :span="8">
  452. <el-form-item label="采购员:" prop="empname">
  453. <span>{{ updateTemp4.empname }}</span>
  454. </el-form-item>
  455. </el-col>
  456. <el-col :span="8">
  457. <el-form-item label="配单日期:" prop="dealTime">
  458. <span>{{ updateTemp4.dealTime }}</span>
  459. </el-form-item>
  460. </el-col>
  461. </el-row>
  462. </el-form>
  463. <el-table
  464. :key="tableKeyUpdate4"
  465. v-loading="listLoadingUpdate4"
  466. element-loading-text="给我一点时间"
  467. :data="listUpdate4"
  468. border
  469. fit
  470. highlight-current-row
  471. style="width: 100%;margin-bottom:100px"
  472. :row-style="rowStyle"
  473. :cell-style="cellStyle"
  474. class="elTable table-fixed"
  475. >
  476. <!-- table表格 -->
  477. <el-table-column label="序号" align="center" type="index" width="50px" />
  478. <el-table-column label="采购单号" min-width="110px" align="center">
  479. <template slot-scope="scope">
  480. <span>{{ scope.row.buyeCode }}</span>
  481. </template>
  482. </el-table-column>
  483. <el-table-column label="备件编号" min-width="110px" align="center">
  484. <template slot-scope="scope">
  485. <span>{{ scope.row.partCode }}</span>
  486. </template>
  487. </el-table-column>
  488. <el-table-column label="备件名称" min-width="110px" align="center">
  489. <template slot-scope="scope">
  490. <span>{{ scope.row.partName }}</span>
  491. </template>
  492. </el-table-column>
  493. <el-table-column label="备件规格" min-width="110px" align="center">
  494. <template slot-scope="scope">
  495. <span>{{ scope.row.specification }}</span>
  496. </template>
  497. </el-table-column>
  498. <el-table-column label="备件品牌" min-width="110px" align="center">
  499. <template slot-scope="scope">
  500. <span>{{ scope.row.brand }}</span>
  501. </template>
  502. </el-table-column>
  503. <el-table-column label="计量单位" min-width="60px" align="center">
  504. <template slot-scope="scope">
  505. <span>{{ scope.row.unit }}</span>
  506. </template>
  507. </el-table-column>
  508. <el-table-column label="供应商" min-width="110px" align="center">
  509. <template slot-scope="scope">
  510. <span>{{ scope.row.providerName }}</span>
  511. </template>
  512. </el-table-column>
  513. <el-table-column label="单价" min-width="60px" align="center">
  514. <template slot-scope="scope">
  515. <span>{{ scope.row.price }}</span>
  516. </template>
  517. </el-table-column>
  518. <el-table-column label="申购数量" min-width="60px" align="center">
  519. <template slot-scope="scope">
  520. <span>{{ scope.row.sumAmount }}</span>
  521. </template>
  522. </el-table-column>
  523. <el-table-column label="采购数量" min-width="100px" align="center">
  524. <template slot-scope="scope">
  525. <el-form :model="scope.row" :rules="rules">
  526. <el-form-item prop="amount">
  527. <el-input
  528. v-model="scope.row.amount"
  529. style="width:80px;margin-top:25px;height:10px"
  530. />
  531. </el-form-item>
  532. </el-form>
  533. </template>
  534. </el-table-column>
  535. <el-table-column label="总价" min-width="60px" align="center">
  536. <template slot-scope="scope">
  537. <span>{{ (parseFloat(scope.row.price) * parseFloat(scope.row.amount)) | keepTwoNum2 }}</span>
  538. </template>
  539. </el-table-column>
  540. <el-table-column label="备件图片" min-width="110px" align="center">
  541. <template slot-scope="scope">
  542. <el-popover placement="right" title="" trigger="hover">
  543. <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
  544. <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  545. </el-popover>
  546. </template>
  547. </el-table-column>
  548. </el-table>
  549. <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:10px">
  550. <el-button type="primary" :disabled="isokDisable" @click="edit_dialog_save()">确认</el-button>
  551. <el-button @click="dialogFormVisibleUpdate4 = false;">关闭</el-button>
  552. </div>
  553. </div>
  554. </el-dialog>
  555. <el-dialog :title="textMap[dialogStatus_Examine]" :visible.sync="dialogFormVisible_Examine" :close-on-click-modal="false" width="30%">
  556. <div class="app-examine">
  557. <h3 style="width: 100%;margin:0 0 0 5%;line-height:50px;">请确认审核结果:</h3>
  558. <el-form ref="examineTemp" :rules="rules" :model="examineTemp" label-position="right" style="width: 50%;margin:0 auto;">
  559. <el-row style="width:88%;height:150px;margin:0 auto;">
  560. <el-col :span="20">
  561. <el-form-item>
  562. <el-radio-group v-model="examineTemp.SHstatue" @change="changeSHStatue">
  563. <el-radio :label="1" checked>通过</el-radio>
  564. <el-radio :label="2">不通过</el-radio>
  565. </el-radio-group>
  566. </el-form-item>
  567. </el-col>
  568. <el-col v-if="statueReason" :span="20">
  569. <el-input v-model="examineTemp.workflowNote" type="textarea" :autosize="{ minRows: 2, maxRows: 4}" placeholder="请输入不通过原因" />
  570. </el-col>
  571. </el-row>
  572. </el-form>
  573. </div>
  574. <div slot="footer" class="dialog-footer">
  575. <el-button type="primary" :disabled="isokDisable" @click="dialogStatus_Examine==='examine'?createExamineData():createExamineData()">确认</el-button>
  576. <el-button @click="dialogFormVisible_Examine = false;">关闭</el-button>
  577. </div>
  578. </el-dialog>
  579. </div>
  580. </el-tab-pane>
  581. <el-tab-pane label="采购单管理" name="second">
  582. <div class="purchaseOrderManagement">
  583. <div class="filter-container">
  584. <el-select v-model="getdataListParm2.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item">
  585. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  586. </el-select>
  587. <el-input v-model="getdataListParm2.parammaps.buyeCode" placeholder="采购单号" clearable style="width: 200px;" class="filter-item" />
  588. <el-select v-model="getdataListParm2.parammaps.statu" clearable placeholder="单据状态" class="filter-item" style="width: 120px;">
  589. <el-option v-for="item in status" :key="item.id" :label="item.name" :value="item.id" />
  590. </el-select>
  591. <el-autocomplete v-model="getdataListParm2.parammaps.providerName" value-key="providerName" class="inline-input" :fetch-suggestions="providerSearch" placeholder="供应商" style="width:150px;top:-3px;" @select="handleSelectProvider" />
  592. <el-date-picker ref="inputDatetime2" v-model="getdataListParm2.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 270px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始提交日期" end-placeholder="结束提交日期" />
  593. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search2">搜索</el-button>
  594. <el-button v-waves v-if="isPurchaseSap" class="filter-item" type="primary" @click="sapUpload">SAP上传</el-button>
  595. <el-button v-waves v-if="isPurchaseSrm" class="filter-item" type="primary" @click="srmUpload">SRM上传</el-button>
  596. </div>
  597. <el-table
  598. :key="tableKey2"
  599. v-loading="listLoading2"
  600. element-loading-text="给我一点时间"
  601. :data="list2"
  602. border
  603. fit
  604. highlight-current-row
  605. style="width: 100%;"
  606. :row-style="rowStyle"
  607. :cell-style="cellStyle"
  608. class="elTable table-fixed"
  609. @sort-change="tableSort"
  610. @selection-change="change_table_selection"
  611. :max-height="myHeight"
  612. >
  613. <el-table-column type="selection" :selectable="checkboxInit" align="center" width="50" />
  614. <el-table-column label="序号" align="center" type="index" width="50px">
  615. <template slot-scope="scope">
  616. <span>{{ scope.$index + (pageNum2-1) * pageSize2 + 1 }}</span>
  617. </template>
  618. </el-table-column>
  619. <el-table-column label="牧场" min-width="110px" align="center">
  620. <template slot-scope="scope">
  621. <span>{{ scope.row.pastureName }}</span>
  622. </template>
  623. </el-table-column>
  624. <el-table-column label="采购单号" min-width="110px" align="center">
  625. <template slot-scope="scope">
  626. <span>{{ scope.row.buyeCode }}</span>
  627. </template>
  628. </el-table-column>
  629. <el-table-column label="供应商" min-width="130px" align="center">
  630. <template slot-scope="scope">
  631. <span>{{ scope.row.providerName }}</span>
  632. </template>
  633. </el-table-column>
  634. <el-table-column label="采购员" min-width="110px" align="center">
  635. <template slot-scope="scope">
  636. <span>{{ scope.row.empname }}</span>
  637. </template>
  638. </el-table-column>
  639. <el-table-column label="提交日期" sortable prop="buyerDate" min-width="110px" align="center" />
  640. <el-table-column label="最近到货日期" sortable prop="DoneDate" min-width="110px" align="center" />
  641. <el-table-column label="单据状态" min-width="80px" align="center" :formatter="statu" />
  642. <el-table-column prop="sapNumber" label="sap编码" min-width="80px" align="center">
  643. <template slot-scope="scope">
  644. <span>{{scope.row.sapNumber}}</span>
  645. </template>
  646. </el-table-column>
  647. <el-table-column prop
  648. <el-table-column prop="sapstatus" label="sap上传状态" min-width="80px" align="center">
  649. <template slot-scope="scope">
  650. <span v-show="scope.row.sapstatus == 1">上传失败</span>
  651. <span v-show="scope.row.sapstatus == -1">未上传</span>
  652. <span v-show="scope.row.sapstatus == 0">上传成功</span>
  653. </template>
  654. </el-table-column>
  655. <el-table-column prop="srmstatus" label="srm上传状态" min-width="80px" align="center">
  656. <template slot-scope="scope">
  657. <span v-show="scope.row.srmstatus == 1">上传失败</span>
  658. <span v-show="scope.row.srmstatus == -1">未上传</span>
  659. <span v-show="scope.row.srmstatus == 0">上传成功</span>
  660. </template>
  661. </el-table-column>
  662. <el-table-column label="操作" align="center" width="250px" class-name="small-padding fixed-width" fixed="right">
  663. <template slot-scope="{row}">
  664. <el-button v-if="isPurchaseSee" type="primary" size="mini" @click="form_see2(row)">查看</el-button>
  665. <el-button v-if="(row.statu === 2 || row.statu === 4) && isPurchaseClose" style="display:none" type="danger" size="mini" @click="handleClose2(row)">关闭</el-button>
  666. <el-button v-else-if="isPurchaseClose" style="display:inline-block" type="danger" size="mini" @click="handleClose2(row)">关闭</el-button>
  667. </template>
  668. </el-table-column>
  669. </el-table>
  670. <pagination v-show="total2>0" :total="total2" :page.sync="getdataListParm2.offset" :limit.sync="getdataListParm2.pagecount" @pagination="get_table_data2" />
  671. <el-dialog :title="textMap[dialogStatusSee2]" :visible.sync="dialogFormVisibleSee2" :close-on-click-modal="false">
  672. <div class="app-contentSee">
  673. <el-form
  674. ref="temp2"
  675. :rules="rules"
  676. :model="temp2"
  677. label-position="right"
  678. label-width="80px"
  679. style="width: 800px;margin-bottom:30px"
  680. >
  681. <el-row>
  682. <el-col :span="8">
  683. <el-form-item label="采购单号:" prop="buyeCode">
  684. <span>{{ temp2.buyeCode }}</span>
  685. </el-form-item>
  686. </el-col>
  687. <el-col :span="6">
  688. <el-form-item label="供应商:" prop="providerName">
  689. <span>{{ temp2.providerName }}</span>
  690. </el-form-item>
  691. </el-col>
  692. <el-col :span="5">
  693. <el-form-item label="采购员:" prop="empname">
  694. <span>{{ temp2.empname }}</span>
  695. </el-form-item>
  696. </el-col>
  697. <el-col :span="5">
  698. <el-form-item label="提交日期:" prop="buyerDate">
  699. <span>{{ temp2.buyerDate }}</span>
  700. </el-form-item>
  701. </el-col>
  702. </el-row>
  703. </el-form>
  704. <el-table
  705. :key="tableKeySee2"
  706. v-loading="listLoadingSee2"
  707. element-loading-text="给我一点时间"
  708. :data="listSee2"
  709. border
  710. fit
  711. highlight-current-row
  712. style="width: 100%;margin-bottom:100px"
  713. :row-style="rowStyle"
  714. :cell-style="cellStyle"
  715. class="elTable table-fixed"
  716. @sort-change="tableSort2"
  717. >
  718. <el-table-column label="序号" align="center" type="index" width="50px" />
  719. <el-table-column label="备件编号" min-width="110px" align="center">
  720. <template slot-scope="scope">
  721. <span>{{ scope.row.partCode }}</span>
  722. </template>
  723. </el-table-column>
  724. <el-table-column label="备件名称" min-width="110px" align="center">
  725. <template slot-scope="scope">
  726. <span>{{ scope.row.partName }}</span>
  727. </template>
  728. </el-table-column>
  729. <el-table-column label="备件规格" min-width="110px" align="center">
  730. <template slot-scope="scope">
  731. <span>{{ scope.row.specification }}</span>
  732. </template>
  733. </el-table-column>
  734. <el-table-column label="备件图片" min-width="110px" align="center">
  735. <template slot-scope="scope">
  736. <el-popover placement="right" title="" trigger="hover">
  737. <img v-if="scope.row.picpath !==''" :src="scope.row.picpath">
  738. <img v-if="scope.row.picpath !==''" slot="reference" :src="scope.row.picpath" :alt="scope.row.srcpath" style="height: 100px;width:100px;">
  739. </el-popover>
  740. </template>
  741. </el-table-column>
  742. <el-table-column label="备件品牌" min-width="110px" align="center">
  743. <template slot-scope="scope">
  744. <span>{{ scope.row.brand }}</span>
  745. </template>
  746. </el-table-column>
  747. <el-table-column label="计量单位" min-width="130px" align="center">
  748. <template slot-scope="scope">
  749. <span>{{ scope.row.unit }}</span>
  750. </template>
  751. </el-table-column>
  752. <el-table-column sortable prop="price" label="单价(元)" min-width="110px" align="center">
  753. <template slot-scope="scope">
  754. <span>{{ scope.row.price }}</span>
  755. </template>
  756. </el-table-column>
  757. <el-table-column sortable prop="sumAmount" label="申购数量" min-width="110px" align="center">
  758. <template slot-scope="scope">
  759. <span>{{ scope.row.sumAmount }}</span>
  760. </template>
  761. </el-table-column>
  762. <el-table-column sortable prop="amount" label="采购数量" min-width="130px" align="center">
  763. <template slot-scope="scope">
  764. <span>{{ scope.row.amount }}</span>
  765. </template>
  766. </el-table-column>
  767. <el-table-column sortable prop="sumPrice" label="总价(元)" min-width="110px" align="center">
  768. <template slot-scope="scope">
  769. <span>{{ scope.row.sumPrice }}</span>
  770. </template>
  771. </el-table-column>
  772. <el-table-column sortable prop="receiveAmount" label="入库数" min-width="110px" align="center">
  773. <template slot-scope="scope">
  774. <span>{{ scope.row.receiveAmount }}</span>
  775. </template>
  776. </el-table-column>
  777. <el-table-column prop="SGremark" label="备注" min-width="110px" align="center">
  778. <template slot-scope="scope">
  779. <span>{{ scope.row.SGremark }}</span>
  780. </template>
  781. </el-table-column>
  782. </el-table>
  783. <div class="sum" style="right:30px;position:absolute;bottom:90px">
  784. <b>总计:{{ temp2.sumPrices }}元</b>
  785. </div>
  786. <div class="stuts" style="left:30px;position:absolute;bottom:70px">
  787. <b>单据状态:{{ temp2.statu }}</b>
  788. <b v-if="isStatu">关闭原因:{{ temp2.note }}</b>
  789. <div v-if="isExtensionDays">延期天数:{{ temp2.extensionDays }}</div>
  790. </div>
  791. <div
  792. slot="footer"
  793. class="dialog-footer"
  794. style="right:30px;position:absolute;bottom:10px"
  795. >
  796. <el-button @click="dialogFormVisibleSee2 = false;get_table_data2()">关闭</el-button>
  797. </div>
  798. </div>
  799. </el-dialog>
  800. <el-dialog :title="textMap[dialogStatusClose]" :visible.sync="dialogFormVisibleClose" :close-on-click-modal="false" style="width:70%;margin: 0 auto">
  801. <div class="app-contentClose">
  802. <el-form
  803. ref="temp2"
  804. :rules="rules"
  805. :model="temp2"
  806. label-position="right"
  807. label-width="80px"
  808. style="width: 300px;margin-bottom:30px"
  809. >
  810. <el-row>
  811. <el-col :span="24">
  812. <el-form-item label="采购单号:" prop="orderNo">
  813. <span>{{ temp2.buyeCode }}</span>
  814. </el-form-item>
  815. </el-col>
  816. </el-row>
  817. <el-row>
  818. <el-col :span="24">
  819. <el-form-item label="" prop="note">
  820. <el-input ref="note" v-model="temp2.note" type="textarea" placeholder="请输入关闭该采购单原因" />
  821. </el-form-item>
  822. </el-col>
  823. </el-row>
  824. </el-form>
  825. <div
  826. slot="footer"
  827. class="dialog-footer"
  828. style="right:30px;position:absolute;bottom:10px"
  829. >
  830. <el-button @click="dialogFormVisibleClose = false;get_table_data2();">取消</el-button>
  831. <el-button type="primary" :disabled="isokDisable" @click="closeData()">确认关闭</el-button>
  832. </div>
  833. </div>
  834. </el-dialog>
  835. </div>
  836. </el-tab-pane>
  837. <el-tab-pane label="采购明细" name="third">
  838. <div class="procurementDetails">
  839. <div class="filter-container">
  840. <el-select v-model="getdataListParm3.parammaps.pastureName" style="width: 140px;" placeholder="牧场" class="filter-item">
  841. <el-option v-for="item in findAllPasture" :key="item.id" :label="item.name" :value="item.name" />
  842. </el-select>
  843. <el-input v-model="getdataListParm3.parammaps.partCode" placeholder="备件编号" style="width: 200px;" class="filter-item" />
  844. <el-input v-model="getdataListParm3.parammaps.partName" placeholder="备件名称" style="width: 140px;" class="filter-item" />
  845. <el-autocomplete v-model="getdataListParm3.parammaps.providerName" value-key="providerName" class="inline-input" :fetch-suggestions="providerSearch" placeholder="供应商" style="width:150px;top:-3px;" @select="handleSelectProvider" />
  846. <el-input v-model="getdataListParm3.parammaps.matchCode" placeholder="配单号" style="width: 140px;" class="filter-item" />
  847. <el-input v-model="getdataListParm3.parammaps.buyeCode" placeholder="采购单号" style="width: 140px;" class="filter-item" />
  848. <el-select v-model="getdataListParm3.parammaps.isStorage" clearable placeholder="到货情况" class="filter-item" style="width: 120px;">
  849. <el-option v-for="item in isStorages" :key="item.id" :label="item.name" :value="item.id" />
  850. </el-select>
  851. <el-date-picker ref="inputDatetime3" v-model="getdataListParm3.parammaps.inputDatetime" class="inputDatetime" type="datetimerange" style="width: 270px;top:-3px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />
  852. <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="form_search3">搜索</el-button>
  853. <el-button v-if="isPurchaseExport" class="filter-item" style="margin-left: 10px;" type="success" icon="el-icon-edit" @click="handleDownload3">导出</el-button>
  854. </div>
  855. <el-table
  856. :key="tableKey3"
  857. v-loading="listLoading3"
  858. element-loading-text="给我一点时间"
  859. :data="list3"
  860. border
  861. fit
  862. highlight-current-row
  863. style="width: 100%;"
  864. :row-style="rowStyle"
  865. :cell-style="cellStyle"
  866. class="elTable table-fixed"
  867. @sort-change="tableSort"
  868. :max-height="myHeight"
  869. >
  870. <el-table-column label="序号" align="center" type="index" width="50px">
  871. <template slot-scope="scope">
  872. <span>{{ scope.$index + (pageNum3-1) * pageSize3 + 1 }}</span>
  873. </template>
  874. </el-table-column>
  875. <el-table-column label="牧场" min-width="110px" align="center">
  876. <template slot-scope="scope">
  877. <span>{{ scope.row.pastureName }}</span>
  878. </template>
  879. </el-table-column>
  880. <el-table-column label="配单号" min-width="110px" align="center">
  881. <template slot-scope="scope">
  882. <span>{{ scope.row.matchCode }}</span>
  883. </template>
  884. </el-table-column>
  885. <el-table-column label="采购单号" min-width="110px" align="center">
  886. <template slot-scope="scope">
  887. <span>{{ scope.row.buyeCode }}</span>
  888. </template>
  889. </el-table-column>
  890. <el-table-column label="备件编号" min-width="110px" align="center">
  891. <template slot-scope="scope">
  892. <span>{{ scope.row.partCode }}</span>
  893. </template>
  894. </el-table-column>
  895. <el-table-column label="备件名称" min-width="130px" align="center">
  896. <template slot-scope="scope">
  897. <span>{{ scope.row.partName }}</span>
  898. </template>
  899. </el-table-column>
  900. <el-table-column label="备件规格" min-width="130px" align="center">
  901. <template slot-scope="scope">
  902. <span>{{ scope.row.specification }}</span>
  903. </template>
  904. </el-table-column>
  905. <el-table-column label="备件品牌" min-width="130px" align="center">
  906. <template slot-scope="scope">
  907. <span>{{ scope.row.brand }}</span>
  908. </template>
  909. </el-table-column>
  910. <el-table-column label="计量单位" min-width="130px" align="center">
  911. <template slot-scope="scope">
  912. <span>{{ scope.row.unit }}</span>
  913. </template>
  914. </el-table-column>
  915. <el-table-column label="供应商" min-width="110px" align="center">
  916. <template slot-scope="scope">
  917. <span>{{ scope.row.providerName }}</span>
  918. </template>
  919. </el-table-column>
  920. <el-table-column sortable prop="price" label="单价" min-width="110px" align="center">
  921. <template slot-scope="scope">
  922. <span>{{ scope.row.price }}</span>
  923. </template>
  924. </el-table-column>
  925. <el-table-column sortable prop="sumAmount" label="申购数量" min-width="110px" align="center">
  926. <template slot-scope="scope">
  927. <span>{{ scope.row.sumAmount }}</span>
  928. </template>
  929. </el-table-column>
  930. <el-table-column sortable prop="amount" label="采购数量" min-width="110px" align="center">
  931. <template slot-scope="scope">
  932. <span>{{ scope.row.amount }}</span>
  933. </template>
  934. </el-table-column>
  935. <el-table-column sortable prop="receiveAmount" label="入库数" min-width="110px" align="center">
  936. <template slot-scope="scope">
  937. <span>{{ scope.row.receiveAmount }}</span>
  938. </template>
  939. </el-table-column>
  940. <el-table-column label="申购部门" min-width="110px" align="center">
  941. <template slot-scope="scope">
  942. <span>{{ scope.row.departmentName }}</span>
  943. </template>
  944. </el-table-column>
  945. <el-table-column label="采购人" min-width="110px" align="center">
  946. <template slot-scope="scope">
  947. <span>{{ scope.row.empname }}</span>
  948. </template>
  949. </el-table-column>
  950. <el-table-column label="配单日期" sortable prop="buyerDate" min-width="110px" align="center" />
  951. <!-- <el-table-column label="备注" min-width="110px" align="center">
  952. <template slot-scope="scope">
  953. <span>{{ scope.row.note }}</span>
  954. </template>
  955. </el-table-column> -->
  956. </el-table>
  957. <pagination v-show="total3>=0" :total="total3" :page.sync="getdataListParm3.offset" :limit.sync="getdataListParm3.pagecount" @pagination="get_table_data3" />
  958. </div>
  959. </el-tab-pane>
  960. </el-tabs>
  961. </div>
  962. </template>
  963. <script>
  964. // 引入
  965. import { GetDataByName, GetDataByNames, ExecDataByConfig, PostDataByName, failproccess, checkButtons, GetAccount,SapOrder,SrmOrder } from '@/api/common'
  966. import waves from '@/directive/waves' // waves directive
  967. import Pagination from '@/components/Pagination' // secondary package based on el-pagination
  968. import Cookies from 'js-cookie'
  969. import { parseTime, sortChange, json2excel } from '@/utils/index.js'
  970. export default {
  971. name: 'Purchase',
  972. components: { Pagination },
  973. directives: { waves },
  974. filters: {
  975. keepTwoNum(value) {
  976. value = Number(value)
  977. return value.toFixed(3)
  978. },
  979. keepTwoNum2(value) {
  980. value = Number(value)
  981. return value.toFixed(2)
  982. }
  983. },
  984. data() {
  985. return {
  986. myHeight:document.documentElement.clientHeight - 85- 150,
  987. isSap:1,
  988. isSrm:1,
  989. selectList: [],
  990. isPurchaseSap: [],isPurchaseSrm: [],
  991. isPurchaseSee: [], isPurchaseClose: [], isPurchaseExport: [], isDistributionSheet: [], isDistributionManagement: [], isExamineDM: [],
  992. stripe: true,
  993. activeName: 'first',
  994. listLoading1: false,
  995. tableKey1: 0,
  996. list1: [],
  997. confirmationSheetDisabled: false,
  998. isokDisable: false,
  999. pickerOptions: {
  1000. disabledDate(time) {
  1001. return time.getTime() > Date.now() // 当天之前的时间可选
  1002. }
  1003. },
  1004. temp: {},
  1005. total: 0,
  1006. total1: 0,
  1007. listParmConfirmation: [],
  1008. listConfirmationSheet: null,
  1009. getParmPurchaseOrderNumber: {
  1010. name: 'autoCreatCode',
  1011. page: 1,
  1012. offset: 1,
  1013. returntype: 'Map',
  1014. parammaps: {
  1015. pastureId: Cookies.get('pastureid'),
  1016. codeType: 'CG'
  1017. }
  1018. },
  1019. postDataPramas: {},
  1020. requestProvider: {
  1021. name: 'getProviderList',
  1022. page: 1,
  1023. offset: 1,
  1024. pagecount: 10,
  1025. returntype: 'Map',
  1026. parammaps: {}
  1027. },
  1028. listLoading2: false,
  1029. tableKey2: 0,
  1030. list2: [],
  1031. status2: [
  1032. { id: '0', name: '审核中' },
  1033. { id: '1', name: '审核通过' },
  1034. { id: '2', name: '审核驳回' }
  1035. ],
  1036. status: [
  1037. { id: '0', name: '未到货' },
  1038. { id: '1', name: '部分到货' },
  1039. { id: '2', name: '按时到货' },
  1040. { id: '3', name: '已延期' },
  1041. { id: '4', name: '已关闭' },
  1042. { id: '5', name: '部分到货-延期' },
  1043. { id: '6', name: '全部到货-延期' }
  1044. ],
  1045. isStorages: [
  1046. { id: '0', name: '未入库' },
  1047. { id: '1', name: '已入库' }
  1048. ],
  1049. isStatu: false,
  1050. listLoadingSee2: false,
  1051. tableKeySee2: 0,
  1052. total2: 0,
  1053. total3: 0,
  1054. listLoading3: false,
  1055. tableKey3: 0,
  1056. list3: [],
  1057. findAllEmploye: [],
  1058. findAllPasture: [],
  1059. requestParams: [
  1060. { name: 'findAllEmploye', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
  1061. { name: 'getDepartmentNY', offset: 0, pagecount: 0, parammaps: { 'pastureId': Cookies.get('pastureid') }},
  1062. { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }}
  1063. ],
  1064. getdataListParm1: {
  1065. name: 'getbuydetailParts',
  1066. page: 1,
  1067. // offset: 1,
  1068. // pagecount: 10,
  1069. returntype: 'Map',
  1070. parammaps: {
  1071. pastureId: Cookies.get('pastureid'),
  1072. departmentId:0,
  1073. }
  1074. },
  1075. getdataListPart: {
  1076. name: 'getpartpurchasebg',
  1077. page: 1,
  1078. // offset: 1,
  1079. // pagecount: 10,
  1080. returntype: 'Map',
  1081. parammaps: {
  1082. id: Cookies.get('pastureid'),
  1083. departmentId:0,
  1084. }
  1085. },
  1086. partData: [],
  1087. getParmCreateNumber: {
  1088. name: 'autoCreatCode',
  1089. page: 1,
  1090. offset: 1,
  1091. returntype: 'Map',
  1092. parammaps: {
  1093. pastureId: Cookies.get('pastureid'),
  1094. codeType: 'PD'
  1095. }
  1096. },
  1097. pageNum1: 0,
  1098. pageSize1: 0,
  1099. temp1: {
  1100. pastureId: Cookies.get('pastureid'),
  1101. buyerPerson: this.$store.state.user.employeid,
  1102. buyerDate: parseTime(new Date(), '{y}-{m}-{d}')
  1103. },
  1104. getdataListParm2: {
  1105. name: 'getBigbuydetailList',
  1106. page: 1,
  1107. offset: 1,
  1108. pagecount: 10,
  1109. returntype: 'Map',
  1110. parammaps: {
  1111. providerName: '',
  1112. buyeCode: '',
  1113. inputDatetime: '',
  1114. // pastureId: Cookies.get('pastureid'),
  1115. pastureName: Cookies.get('pasturename')
  1116. }
  1117. },
  1118. dialogFormVisibleConfirmation: false,
  1119. dialogStatusConfirmation: '',
  1120. pageNum2: 0,
  1121. pageSize2: 0,
  1122. temp2: {
  1123. note: ''
  1124. },
  1125. getdataListParm3: {
  1126. name: 'getbuydetailList',
  1127. page: 1,
  1128. offset: 1,
  1129. pagecount: 10,
  1130. returntype: 'Map',
  1131. parammaps: {
  1132. pastureName: Cookies.get('pasturename'),
  1133. providerName: '',
  1134. partCode: '',
  1135. partName: '',
  1136. matchCode: '',
  1137. buyeCode: '',
  1138. isStorage: '',
  1139. startTime: '',
  1140. stopTime: '',
  1141. inputDatetime: ''
  1142. }
  1143. },
  1144. isExtensionDays: false,
  1145. listSee2: [],
  1146. getdataListSee2: {
  1147. name: 'getbuydetailListbyBig',
  1148. returntype: 'Map',
  1149. parammaps: {}
  1150. },
  1151. requestParamStute: {
  1152. name: 'updateBigbuydetailStatu',
  1153. returntype: 'Map',
  1154. parammaps: {}
  1155. },
  1156. pageNum3: 0,
  1157. pageSize3: 0,
  1158. temp3: {},
  1159. dialogFormVisibleSee2: false,
  1160. dialogStatusSee2: '',
  1161. // 配单管理
  1162. listLoading4: false,
  1163. tableKey4: 0,
  1164. list4: [],
  1165. pageNum4: 0,
  1166. pageSize4: 0,
  1167. total4: 0,
  1168. getdataListParm4: {
  1169. name: 'getbigpartdeallist',
  1170. page: 1,
  1171. offset: 1,
  1172. pagecount: 10,
  1173. returntype: 'Map',
  1174. parammaps: {
  1175. pastureName: Cookies.get('pasturename'),
  1176. matchCode: '',
  1177. statue: '',
  1178. inputDatetime: '',
  1179. startTime: '',
  1180. stopTime: ''
  1181. }
  1182. },
  1183. dialogFormVisibleSee4: false,
  1184. dialogStatusSee4: '',
  1185. temp4: {},
  1186. listSee4: [],
  1187. tableKeySee4: 0,
  1188. listLoadingSee4: false,
  1189. getdataListSee4: {
  1190. name: 'getbigpartdealdetiallist',
  1191. returntype: 'Map',
  1192. parammaps: {}
  1193. },
  1194. activeList: [],
  1195. deptNameList: [],
  1196. active: 3,
  1197. currentRow:{},
  1198. dialogStatusUpdate4: '',
  1199. dialogFormVisibleUpdate4: false,
  1200. updateTemp4: {},
  1201. listUpdate4: [],
  1202. tableKeyUpdate4: 0,
  1203. listLoadingUpdate4: false,
  1204. dialogFormVisible_Examine: false,
  1205. dialogStatus_Examine: '',
  1206. examineTemp: {
  1207. SHstatue: 1,
  1208. workflowNote: ''
  1209. },
  1210. statueReason: false,
  1211. dialogFormVisibleClose: false,
  1212. dialogStatusClose: '',
  1213. textMap: {
  1214. confirmation: '确认配单',
  1215. see: '查看详情',
  1216. close: '关闭提示',
  1217. examine: '审核',
  1218. update: '编辑'
  1219. },
  1220. // 校验规则
  1221. rules: {
  1222. equipmentName: [{ required: true, message: '必填', trigger: 'blur' }],
  1223. note: [{ required: true, message: '必填', trigger: 'blur' }]
  1224. },
  1225. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  1226. cellStyle: { padding: 0 + 'px' },
  1227. buttons: [],
  1228. downloadListParm3: {},
  1229. downloadList3: [],
  1230. isPercentage: false,
  1231. percentage: 1
  1232. }
  1233. },
  1234. created() {
  1235. const that = this
  1236. GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
  1237. that.buttons = response.data.list
  1238. that.get_auto_buttons()
  1239. if (this.isDistributionSheet == true) {
  1240. this.activeName = 'first'
  1241. console.log(1, this.isDistributionSheet, this.isDistributionManagement)
  1242. } else if (this.isDistributionManagement == true) {
  1243. this.activeName = 'fouth'
  1244. console.log(2, this.isDistributionSheet, this.isDistributionManagement)
  1245. } else if (this.isDistributionSheet == false && this.isDistributionManagement == false) {
  1246. this.activeName = 'second'
  1247. console.log(3, this.isDistributionSheet, this.isDistributionManagement)
  1248. }
  1249. })
  1250. this.get_select_list()
  1251. this.get_table_data1()
  1252. this.get_table_data2()
  1253. this.get_table_data3()
  1254. this.get_table_data4()
  1255. if (this.$route.query.activeName !== undefined) {
  1256. this.activeName = this.$route.query.activeName
  1257. }
  1258. },
  1259. methods: {
  1260. change_dept(e){
  1261. console.log(e)
  1262. this.getdataListParm1.parammaps.departmentId = e
  1263. this.getdataListPart.parammaps.departmentId = e
  1264. this.get_table_data1()
  1265. },
  1266. tableSort(column) {
  1267. if (this.activeName == 'first') {
  1268. sortChange(column, this.list1)
  1269. } else if (this.activeName == 'second') {
  1270. sortChange(column, this.list2)
  1271. } else if (this.activeName == 'third') {
  1272. sortChange(column, this.list3)
  1273. } else if (this.activeName == 'fouth') {
  1274. sortChange(column, this.list4)
  1275. }
  1276. },
  1277. tableSort2(column) {
  1278. sortChange(column, this.listSee2)
  1279. },
  1280. get_auto_buttons() {
  1281. const DistributionSheet = 'customs:purchase:distributionSheet'
  1282. const isDistributionSheet = checkButtons(this.$store.state.user.buttons, DistributionSheet)
  1283. this.isDistributionSheet = isDistributionSheet
  1284. const PurchaseSee = 'customs:purchase:see'
  1285. const isPurchaseSee = checkButtons(this.$store.state.user.buttons, PurchaseSee)
  1286. this.isPurchaseSee = isPurchaseSee
  1287. const PurchaseClose = 'customs:purchase:close'
  1288. const isPurchaseClose = checkButtons(this.$store.state.user.buttons, PurchaseClose)
  1289. this.isPurchaseClose = isPurchaseClose
  1290. const PurchaseSap = 'customs:purchase:sap'
  1291. const isPurchaseSap = checkButtons(this.$store.state.user.buttons, PurchaseSap)
  1292. this.isPurchaseSap = isPurchaseSap
  1293. const PurchaseSrm = 'customs:purchase:srm'
  1294. const isPurchaseSrm = checkButtons(this.$store.state.user.buttons, PurchaseSrm)
  1295. this.isPurchaseSrm = isPurchaseSrm
  1296. const PurchaseExport = 'customs:purchase:export'
  1297. const isPurchaseExport = checkButtons(this.$store.state.user.buttons, PurchaseExport)
  1298. this.isPurchaseExport = isPurchaseExport
  1299. const ExamineDM = 'customs:purchase:shenhe'
  1300. const isExamineDM = checkButtons(this.$store.state.user.buttons, ExamineDM)
  1301. this.isExamineDM = isExamineDM
  1302. const DistributionManagement = 'customs:purchase:peidanjiemian'
  1303. const isDistributionManagement = checkButtons(this.$store.state.user.buttons, DistributionManagement)
  1304. this.isDistributionManagement = isDistributionManagement
  1305. },
  1306. cellClick(row, column, cell, event) {
  1307. console.log(cell)
  1308. console.log('column', column)
  1309. console.log('行索引', row.id)
  1310. console.log('列索引', column.id)
  1311. return {
  1312. background: '#eceb3c'
  1313. }
  1314. // console.log('event',event)
  1315. },
  1316. tableRowStyle({ row, rowIndex }) {
  1317. console.log(row, row)
  1318. console.log(' row.isParity', row.isParity)
  1319. console.log(parseInt(row.isParity) % 2 == 0)
  1320. if (parseInt(row.isParity) % 2 == 0) {
  1321. return {
  1322. background: '#eee'
  1323. }
  1324. }
  1325. return {
  1326. background: ''
  1327. }
  1328. },
  1329. tableCellStyle({ row, column, rowIndex, columnIndex }) {
  1330. if (row.isNo == 'No' && columnIndex === 10) {
  1331. return {
  1332. background: 'red'
  1333. }
  1334. }
  1335. return {
  1336. background: ''
  1337. }
  1338. },
  1339. handleClick(tab, event) {
  1340. console.log(tab, event)
  1341. if (tab.name === 'first') {
  1342. this.get_table_data1()
  1343. } else if (tab.name === 'fouth') {
  1344. this.get_table_data4()
  1345. } else if (tab.name === 'second') {
  1346. this.get_table_data2()
  1347. } else if (tab.name === 'third') {
  1348. this.get_table_data3()
  1349. }
  1350. },
  1351. get_select_list() {
  1352. GetDataByNames(this.requestParams).then(response => {
  1353. this.findAllEmploye = response.data.findAllEmploye.list
  1354. this.findAllPasture = response.data.findAllPasture.list
  1355. this.deptNameList = response.data.getDepartmentNY.list
  1356. console.log(this.deptNameList)
  1357. })
  1358. },
  1359. providerSearch(queryString, cb) {
  1360. console.log('供应商模糊查询输入值', queryString)
  1361. this.requestProvider.parammaps['providerName'] = queryString
  1362. GetDataByName(this.requestProvider).then(response => {
  1363. console.log('供应商模糊查询搜索data', response.data.list)
  1364. cb(response.data.list)
  1365. })
  1366. },
  1367. handleSelectProvider(item) {
  1368. console.log('供应商模糊查询选中值', item)
  1369. },
  1370. get_table_data1() {
  1371. this.listLoading1 = true
  1372. GetDataByName(this.getdataListPart).then(response => {
  1373. console.log(response)
  1374. this.partData = response.data.list
  1375. })
  1376. GetDataByName(this.getdataListParm1).then(response => {
  1377. console.log('this.list1', response.data.list)
  1378. if (response.data.list === null) {
  1379. this.list1 = []
  1380. this.confirmationSheetDisabled = true
  1381. } else {
  1382. // eslint-disable-next-line no-unused-vars
  1383. var list1
  1384. list1 = response.data.list
  1385. var result = []
  1386. list1.forEach((i, j) => {
  1387. // eslint-disable-next-line no-irregular-whitespace
  1388. Array.from(new Set(list1.map(function(item) { return item.partCode }))).forEach((x, y) => {
  1389. if (i.partCode === x) {
  1390. result.push({
  1391. 'amount': i.amount,
  1392. 'amountPre': i.amountPre,
  1393. 'bigId': i.bigId,
  1394. 'brand': i.brand,
  1395. 'brandId': i.brandId,
  1396. 'contractCode': i.contractCode,
  1397. 'count': i.count,
  1398. 'enable': i.enable,
  1399. 'id': i.id,
  1400. 'inventoryType': i.inventoryType,
  1401. 'isZeroStock': i.isZeroStock,
  1402. 'orderNumber': i.orderNumber,
  1403. 'partCode': i.partCode,
  1404. 'partId': i.partId,
  1405. 'partName': i.partName,
  1406. 'pastureId': i.pastureId,
  1407. 'pastureName': i.pastureName,
  1408. 'planAmount': i.planAmount,
  1409. 'price': i.price,
  1410. 'providerId': i.providerId,
  1411. 'providerName': i.providerName,
  1412. 'purpose': i.purpose,
  1413. 'remark': i.remark,
  1414. 'specification': i.specification,
  1415. 'sumAmount': i.sumAmount,
  1416. 'unit': i.unit,
  1417. 'isNo': i.isNo,
  1418. 'srcpath': i.srcpath,
  1419. 'picpath': i.picpath,
  1420. 'departmentName': i.departmentName,
  1421. 'isParity': y
  1422. })
  1423. }
  1424. })
  1425. })
  1426. console.log(result)
  1427. if (result !== null) {
  1428. for (let i = 0; i < result.length; i++) {
  1429. console.log(result[i].srcpath)
  1430. if (result[i].srcpath !== null && result[i].picpath !== null && result[i].srcpath !== undefined && result[i].picpath !== undefined) {
  1431. result[i].srcpath = process.env.VUE_APP_BASE_API + result[i].srcpath
  1432. result[i].picpath = process.env.VUE_APP_BASE_API + result[i].picpath
  1433. } else {
  1434. // this.$set(result[i], 'srcpath', '')
  1435. // this.$set(result[i], 'picpath', '')
  1436. result[i].srcpath = ''
  1437. result[i].picpath = ''
  1438. }
  1439. }
  1440. }
  1441. // console.log(result)
  1442. this.list1 = result
  1443. console.log('处理后table数', this.list1)
  1444. this.confirmationSheetDisabled = false
  1445. }
  1446. var tem = ''
  1447. for (var i = 0; i < this.list1.length; i++) {
  1448. if (tem !== this.list1[i].partCode) {
  1449. this.list1[i].amount = this.list1[i].sumAmount
  1450. tem = this.list1[i].partCode
  1451. } else {
  1452. this.list1[i].amount = 0
  1453. }
  1454. }
  1455. // var a = 0
  1456. // var b = 0
  1457. // for (var i = 0; i < this.list1.length; i++) {
  1458. // if (parseInt(this.list1[i].amountPre) !== 0) {
  1459. // console.log(parseInt(this.list1[i].amountPre))
  1460. // if (a <= 0) {
  1461. // a = this.list1[i].count - 1
  1462. // if (b === 0) {
  1463. // b = parseInt(this.list1[i].amountPre)
  1464. // }
  1465. // } else {
  1466. // a--
  1467. // }
  1468. // if (b > 0) {
  1469. // this.list1[i].amount = this.list1[i].amount + 1
  1470. // b--
  1471. // }
  1472. // }
  1473. // }
  1474. if (response.data.total) {
  1475. this.total1 = response.data.total
  1476. }
  1477. // Just to simulate the time of the request
  1478. setTimeout(() => {
  1479. this.listLoading1 = false
  1480. }, 300)
  1481. })
  1482. },
  1483. confirmationSheet() {
  1484. console.log('点击立确认配单')
  1485. this.temp1.matchCode = ''
  1486. console.log(this.list1) // table表格数据
  1487. // -------------------------------------------
  1488. function groupBy1(array, f) {
  1489. var groups1 = {}
  1490. array.forEach(function(o) {
  1491. var group2 = JSON.stringify(f(o))
  1492. console.log("group2",group2)
  1493. groups1[group2] = groups1[group2] || []
  1494. groups1[group2].push(o)
  1495. })
  1496. return Object.keys(groups1).map(function(group2) {
  1497. return groups1[group2]
  1498. })
  1499. }
  1500. var sorted1 = groupBy1(this.list1, function(item) {
  1501. return [item.partCode]
  1502. })
  1503. console.log('表格数据根据供应商分划', sorted1)
  1504. for (var i = 0; i < sorted1.length; i++) {
  1505. var b = 0
  1506. var c = 0
  1507. for (var j = 0; j < sorted1[i].length; j++) {
  1508. // eslint-disable-next-line no-self-compare
  1509. if (sorted1[i][j].partCode === sorted1[i][j].partCode) {
  1510. // console.log(sorted1[i][j])
  1511. var element = sorted1[i][j]
  1512. b += parseInt(element.amount)
  1513. c = parseInt(element.sumAmount)
  1514. // console.log("amount", element.amount);
  1515. }
  1516. }
  1517. if (b > c || b < c) {
  1518. console.log('No')
  1519. console.log(element.id)
  1520. for (var a = 0; a < this.list1.length; a++) {
  1521. if (element.id === this.list1[a].id) {
  1522. console.log(this.list1[a].partCode)
  1523. for (var b = 0; b < this.list1.length; b++) {
  1524. if (this.list1[b].partCode === this.list1[a].partCode) {
  1525. console.log(this.list1[b])
  1526. this.$set(this.list1[b], 'isNo', 'No')
  1527. } else {
  1528. this.$set(this.list1[b], 'isNo', 'Yes')
  1529. }
  1530. }
  1531. } else {
  1532. this.$set(this.list1[a], 'isNo', 'Yes')
  1533. }
  1534. }
  1535. console.log(b)
  1536. this.$message({
  1537. type: 'warning',
  1538. message: '同一备件多个供应商合计采购数量总和等于申购数量'
  1539. })
  1540. return
  1541. } else {
  1542. for (var a = 0; a < this.list1.length; a++) {
  1543. this.$set(this.list1[a], 'isNo', 'Yes')
  1544. var rulesAmount = /^[0-9]\d*$/
  1545. if (!rulesAmount.test(this.list1[a].amount)) {
  1546. this.$message({
  1547. type: 'error',
  1548. message: '采购数量请输入正整数',
  1549. duration: 2000
  1550. })
  1551. return false
  1552. }
  1553. }
  1554. // console.log('Yes')
  1555. }
  1556. }
  1557. this.getCreateNumber()
  1558. // -------------------------------------------
  1559. this.dialogStatusConfirmation = 'confirmation'
  1560. this.dialogFormVisibleConfirmation = true
  1561. console.log('确认配单data------', this.list1)
  1562. // this.list1 = this.list1.filter(i => parseFloat(i.amount) !== 0)
  1563. console.log(this.list1)
  1564. console.log('根据供应商分类', sorted1)
  1565. console.log('根据供应商分类表格listConfirmationSheet', this.listConfirmationSheet)
  1566. // 处理渲染数据
  1567. var providerNameMap = {}
  1568. var providerNameDest = []
  1569. // eslint-disable-next-line no-redeclare
  1570. for (var i = 0; i < this.list1.length; i++) {
  1571. console.log(this.list1[i])
  1572. var ai = this.list1[i]
  1573. var price = this.list1[i].price
  1574. var amount = this.list1[i].amount
  1575. // console.log(price, amount)
  1576. var sumPrice = 0
  1577. sumPrice = parseFloat(price) * parseFloat(amount)
  1578. if (!providerNameMap[ai.providerName]) {
  1579. providerNameDest.push({
  1580. price: [price],
  1581. amount: [amount],
  1582. sumPrice: [sumPrice],
  1583. providerId: ai.providerId,
  1584. providerName: ai.providerName,
  1585. purpose: ai.purpose,
  1586. list: [ai]
  1587. })
  1588. providerNameMap[ai.providerName] = ai
  1589. providerNameMap[ai.providerId] = ai
  1590. } else {
  1591. // eslint-disable-next-line no-redeclare
  1592. for (var j = 0; j < providerNameDest.length; j++) {
  1593. console.log(providerNameDest[j])
  1594. var dj = providerNameDest[j]
  1595. if (dj.providerName === ai.providerName) {
  1596. dj.sumPrice.push(sumPrice)
  1597. dj.price.push(price)
  1598. // eslint-disable-next-line no-mixed-spaces-and-tabs
  1599. dj.amount.push(amount)
  1600. dj.list.push(ai)
  1601. break
  1602. }
  1603. }
  1604. }
  1605. }
  1606. var providerNameArray = []
  1607. // eslint-disable-next-line no-redeclare
  1608. for (var i = 0; i < this.list1.length; i++) {
  1609. providerNameArray.push(this.list1[i].providerName)
  1610. }
  1611. // console.log('原供应商', providerNameArray)
  1612. function unique(providerNameArray) {
  1613. return Array.from(new Set(providerNameArray))
  1614. }
  1615. var uniqueProviderNameArray = unique(providerNameArray)
  1616. console.log('去重后供应商', uniqueProviderNameArray) // ["泰森机电", "浩祥晟机电", "国宇商贸", "赛娜牧业"]
  1617. // ------------------------------------------
  1618. var OrderNumberArray = []
  1619. this.postDataPramas.common = { 'returnmap': '0' }
  1620. this.postDataPramas.data = []
  1621. for (var i = 0; i < uniqueProviderNameArray.length; i++) {
  1622. this.postDataPramas.data[i] = { 'name': 'autoCreatCode', 'type': 'sm', 'parammaps': {
  1623. pastureId: Cookies.get('pastureid'),
  1624. codeType: 'CG'
  1625. }}
  1626. }
  1627. ExecDataByConfig(this.postDataPramas).then(response => {
  1628. console.log('采购单请求发送参数', this.postDataPramas)
  1629. for (var i = 0; i < response.data.length; i++) {
  1630. // console.log(response.data[i].resultmaps[0].orderCode)
  1631. OrderNumberArray.push(response.data[i].resultmaps[0].orderCode)
  1632. }
  1633. console.log(OrderNumberArray)
  1634. this.listConfirmationSheet.map((item, index) => {
  1635. item.orderNumber = OrderNumberArray[index]
  1636. return item
  1637. })
  1638. this.$forceUpdate()
  1639. })
  1640. console.log(OrderNumberArray)
  1641. this.listConfirmationSheet = providerNameDest
  1642. // console.log(JSON.stringify(this.listConfirmationSheet))
  1643. console.log('根据供应商分类表格listConfirmationSheet', this.listConfirmationSheet)
  1644. var SumArray = []
  1645. this.listConfirmationSheet.forEach((item, index) => {
  1646. console.log(item.sumPrice)
  1647. // console.log(item.sumPrice.reduce((count, v) => count + v, 0))
  1648. SumArray.push(item.sumPrice.reduce((count, v) => count + v, 0).toFixed(3))
  1649. })
  1650. this.listConfirmationSheet.map((item, index) => {
  1651. // console.log(item, index)
  1652. item.Sum = SumArray[index]
  1653. return item
  1654. })
  1655. console.log('根据供应商分类表格listConfirmationSheet', this.listConfirmationSheet)
  1656. // -------------------------------------------
  1657. },
  1658. getCreateNumber() {
  1659. GetDataByName(this.getParmCreateNumber).then(response => {
  1660. this.$nextTick(() => {
  1661. this.show = false
  1662. console.log('配单号', response.data.list[0].orderCode)
  1663. this.temp1.matchCode = response.data.list[0].orderCode
  1664. this.$forceUpdate()
  1665. })
  1666. })
  1667. },
  1668. confirmationSheetData() {
  1669. this.isokDisable = true
  1670. setTimeout(() => {
  1671. this.isokDisable = false
  1672. }, 1000)
  1673. console.log('点击了确认配单提交')
  1674. this.$refs['temp1'].validate(valid => {
  1675. if (valid) {
  1676. // orderNumber
  1677. if (this.temp1.matchCode == '' || this.temp1.matchCode == null || this.temp1.matchCode == undefined) {
  1678. this.getCreateNumber()
  1679. }
  1680. this.postDataPramas.common = { 'returnmap': '0' }
  1681. this.postDataPramas.data = []
  1682. console.log(this.listConfirmationSheet)
  1683. for (let i = 0; i < this.listConfirmationSheet.length; i++) {
  1684. if (this.listConfirmationSheet[i].orderNumber == null || this.listConfirmationSheet[i].orderNumber == undefined) {
  1685. this.$notify({
  1686. title: '保存失败',
  1687. message: '网络异常未生成采购单,请刷新后重新进行配单',
  1688. type: 'warning',
  1689. duration: 2000
  1690. })
  1691. return false
  1692. }
  1693. }
  1694. var a = this.listConfirmationSheet.length
  1695. this.listConfirmationSheet.forEach((item, index) => {
  1696. console.log(item)
  1697. this.postDataPramas.data[index] = { 'name': 'insertBigbuydetail', 'resultname': 'insertBigbuydetail' + index, 'type': 'e', 'parammaps': {
  1698. pastureId: Cookies.get('pastureid'),
  1699. buyeCode: item.orderNumber,
  1700. providerId: item.providerId,
  1701. buyerPerson: this.temp1.buyerPerson,
  1702. buyerDate: this.temp1.buyerDate,
  1703. matchCode: this.temp1.matchCode
  1704. }}
  1705. this.postDataPramas.data[a] = { 'name': 'insertSpotList', 'resultmaps': { 'list': item.list }}
  1706. this.postDataPramas.data[a].children = []
  1707. this.postDataPramas.data[a].children[0] = { 'name': 'insertbuydetail', 'type': 'e', 'parammaps': {
  1708. bigId: '@insertBigbuydetail' + index + '.LastInsertId',
  1709. pastureId: '@insertSpotList.pastureId',
  1710. contractCode: '@insertSpotList.contractCode',
  1711. amount: '@insertSpotList.amount',
  1712. sumAmount: '@insertSpotList.sumAmount',
  1713. contractId: '@insertSpotList.id',
  1714. departmentName: '@insertSpotList.departmentName',
  1715. remark: '@insertSpotList.purpose'
  1716. }}
  1717. a = a + 1
  1718. })
  1719. this.postDataPramas.data[a] = { 'name': 'insertSpotListbpp', 'resultmaps': { 'list': this.partData }}
  1720. this.postDataPramas.data[a].children = []
  1721. this.postDataPramas.data[a].children[0] = { 'name': 'updateBigpartpurchaseStatu', 'type': 'e', 'parammaps': {
  1722. id: '@insertSpotListbpp.id',
  1723. matchCode: this.temp1.matchCode
  1724. }}
  1725. this.postDataPramas.data.push({ 'name': 'insertbigpartdeal', 'type': 'e', 'parammaps': {
  1726. empId: this.temp1.buyerPerson,
  1727. pastureId: Cookies.get('pastureid'),
  1728. matchCode: this.temp1.matchCode
  1729. }}
  1730. )
  1731. ExecDataByConfig(this.postDataPramas).then(response => {
  1732. if (response.msg === 'fail') {
  1733. var buyeCode = new RegExp('buyeCode')
  1734. if (buyeCode.test(response.data)) {
  1735. this.$notify({
  1736. title: '',
  1737. message: '网络异常未生成采购单,请刷新后重新进行配单',
  1738. type: 'warning',
  1739. duration: 2000
  1740. })
  1741. } else {
  1742. this.$notify({
  1743. title: '保存失败',
  1744. message: response.data,
  1745. type: 'warning',
  1746. duration: 2000
  1747. })
  1748. }
  1749. } else {
  1750. this.dialogFormVisibleConfirmation = false
  1751. this.activeName = 'fouth'
  1752. this.get_table_data4()
  1753. this.$notify({
  1754. title: '',
  1755. message: '保存成功',
  1756. type: 'success',
  1757. duration: 2000
  1758. })
  1759. }
  1760. })
  1761. }
  1762. })
  1763. },
  1764. get_table_data2() {
  1765. this.listLoading2 = true
  1766. if (this.$refs['inputDatetime2'] !== undefined && this.$refs['inputDatetime2'].value !== null) {
  1767. this.getdataListParm2.parammaps.startTime = this.$refs['inputDatetime2'].value[0]
  1768. this.getdataListParm2.parammaps.stopTime = this.$refs['inputDatetime2'].value[1]
  1769. } else {
  1770. this.getdataListParm2.parammaps.startTime = ''
  1771. this.getdataListParm2.parammaps.stopTime = ''
  1772. }
  1773. GetDataByName(this.getdataListParm2).then(response => {
  1774. this.list2 = response.data.list
  1775. this.pageNum2 = response.data.pageNum
  1776. this.pageSize2 = response.data.pageSize
  1777. if (response.data.total) {
  1778. this.total2 = response.data.total
  1779. }
  1780. // Just to simulate the time of the request
  1781. setTimeout(() => {
  1782. this.listLoading2 = false
  1783. }, 300)
  1784. })
  1785. },
  1786. form_search2() {
  1787. this.listLoading = true
  1788. if (this.getdataListParm2.parammaps.inputDatetime === null) {
  1789. this.getdataListParm2.parammaps.inputDatetime = ''
  1790. }
  1791. this.getdataListParm2.offset = 1
  1792. this.get_table_data2()
  1793. },
  1794. statu: function(cellValue) {
  1795. if (cellValue.statu === 0) {
  1796. return '未到货'
  1797. } else if (cellValue.statu === 1) {
  1798. return '部分到货'
  1799. } else if (cellValue.statu === 2) {
  1800. return '按时到货'
  1801. } else if (cellValue.statu === 3) {
  1802. return '已延期'
  1803. } else if (cellValue.statu === 4) {
  1804. return '已关闭'
  1805. } else if (cellValue.statu === 5) {
  1806. return '部分到货-延期'
  1807. } else if (cellValue.statu === 6) {
  1808. return '全部到货-延期'
  1809. }
  1810. },
  1811. statue: function(cellValue) {
  1812. if (cellValue.statue === 0) {
  1813. return '审核中'
  1814. } else if (cellValue.statue === 1) {
  1815. return '审核通过'
  1816. } else if (cellValue.statue === 2) {
  1817. return '未通过'
  1818. }
  1819. },
  1820. form_see2(row) {
  1821. this.temp2 = Object.assign({}, row)
  1822. if (this.temp2.statu === 0) {
  1823. this.isStatu = false
  1824. this.temp2.statu = '未到货'
  1825. this.isExtensionDays = false
  1826. } else if (this.temp2.statu === 1) {
  1827. this.isStatu = false
  1828. this.temp2.statu = '部分到货'
  1829. this.isExtensionDays = false
  1830. } else if (this.temp2.statu === 2) {
  1831. this.isStatu = false
  1832. this.temp2.statu = '按时到货'
  1833. this.isExtensionDays = false
  1834. } else if (this.temp2.statu === 3) {
  1835. this.isStatu = false
  1836. this.temp2.statu = '已延期'
  1837. this.isExtensionDays = true
  1838. } else if (this.temp2.statu === 4) {
  1839. this.temp2.statu = '已关闭'
  1840. this.isStatu = true
  1841. this.isExtensionDays = false
  1842. } else if (this.temp2.statu === 5) {
  1843. this.isStatu = false
  1844. this.temp2.statu = '部分到货-延期'
  1845. this.isExtensionDays = true
  1846. } else if (this.temp2.statu === 6) {
  1847. this.isStatu = false
  1848. this.temp2.statu = '全部到货-延期'
  1849. this.isExtensionDays = true
  1850. }
  1851. this.dialogStatusSee2 = 'see'
  1852. this.dialogFormVisibleSee2 = true
  1853. this.getdataListSee2.parammaps.id = row.id
  1854. this.getSeeList2()
  1855. },
  1856. getSeeList2() {
  1857. GetDataByName(this.getdataListSee2).then(response => {
  1858. this.listSee2 = response.data.list
  1859. if (response.data.list !== null) {
  1860. for (let i = 0; i < response.data.list.length; i++) {
  1861. 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) {
  1862. this.listSee2[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  1863. this.listSee2[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  1864. } else {
  1865. this.listSee2[i].srcpath = ''
  1866. this.listSee2[i].picpath = ''
  1867. }
  1868. }
  1869. }
  1870. console.log('查看下方table数据', response.data.list)
  1871. // this.pageNum2 = response.data.pageNum
  1872. // this.pageSize2 = response.data.pageSize
  1873. var sumArray = []
  1874. for (var i = 0; i < this.listSee2.length; i++) {
  1875. console.log()
  1876. sumArray.push(
  1877. this.listSee2[i].sumPrice
  1878. )
  1879. }
  1880. console.log('总价', sumArray)
  1881. var arrvalue = 0
  1882. for (var i = 0; i < sumArray.length; i++) {
  1883. console.log('table内总价每一个值', sumArray[i])
  1884. arrvalue += parseFloat(sumArray[i])// 数组的索引是从0开始的
  1885. }
  1886. this.temp2.sumPrices = arrvalue.toFixed(3)
  1887. setTimeout(() => {
  1888. this.listLoadingSee = false
  1889. }, 100)
  1890. })
  1891. },
  1892. resetCloseTemp() {
  1893. this.temp2.note = ''
  1894. },
  1895. handleClose2(row) {
  1896. this.resetCloseTemp()
  1897. this.temp2 = Object.assign({}, row)
  1898. this.dialogStatusClose = 'close'
  1899. this.dialogFormVisibleClose = true
  1900. },
  1901. handleCurrentChange(val) {
  1902. this.currentRow = val;
  1903. console.log("currentRow",this.currentRow)
  1904. },
  1905. sapUpload(){
  1906. const that = this
  1907. console.log("currentRow",this.currentRow.sapstatus)
  1908. var send_data = this.selectList
  1909. if(send_data.length == 0){
  1910. that.$notify({ title: '失败', message: '请勾选数据!' , type: 'error', duration: 2000 })
  1911. return false
  1912. }
  1913. console.log(that.isSap)
  1914. if(that.isSap == 1){
  1915. that.isSap = 0
  1916. SapOrder(send_data).then(response => {
  1917. console.log('response', response)
  1918. if (response.msg !== 'fail') {
  1919. that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
  1920. that.selectList = []
  1921. that.get_table_data2()
  1922. } else {
  1923. that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
  1924. }
  1925. })
  1926. } else {
  1927. that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击' , type: 'error', duration: 2000 })
  1928. }
  1929. setTimeout(() => {
  1930. that.isSap = 1
  1931. }, 3000)
  1932. // if(this.currentRow.sapstatus){
  1933. // if(this.currentRow.sapstatus != 0){
  1934. // const sapArr = this.currentRow.sapbuyeCode.split(",")
  1935. // console.log("sapArr",sapArr)
  1936. // sapArr.forEach(function(item){
  1937. // console.log("sapArr item",item)
  1938. // var send_data = {
  1939. // "code":item,
  1940. // "pastureid":Cookies.get('pastureid')
  1941. // }
  1942. // SapOrder(send_data).then(response => {
  1943. // console.log('response', response)
  1944. // if (response.msg !== 'fail') {
  1945. // that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
  1946. // that.get_table_data()
  1947. // } else {
  1948. // that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
  1949. // }
  1950. // })
  1951. // })
  1952. // }
  1953. // }
  1954. },
  1955. checkboxInit(row,index){
  1956. console.log(row)
  1957. var data1 = new Date(row.buyerDate)
  1958. var data2 = new Date('2022-10-25')
  1959. if(data1 > data2){ return 1 } else {return 0}
  1960. },
  1961. //监听 - 表格 - 勾选
  1962. change_table_selection(val) {
  1963. this.selectList = val
  1964. console.log('勾选数据selectList', this.selectList)
  1965. },
  1966. srmUpload(){
  1967. const that = this
  1968. console.log("currentRow",this.currentRow.srmstatus)
  1969. console.log('勾选数据selectList', this.selectList)
  1970. var send_data = this.selectList
  1971. if(send_data.length == 0){
  1972. that.$notify({ title: '失败', message: '请勾选数据!' , type: 'error', duration: 2000 })
  1973. return false
  1974. }
  1975. console.log(that.isSrm)
  1976. if(that.isSrm == 1){
  1977. that.isSrm = 0
  1978. SrmOrder(send_data).then(response => {
  1979. console.log('response', response)
  1980. if (response.msg !== 'fail') {
  1981. that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
  1982. that.selectList = []
  1983. that.get_table_data2()
  1984. } else {
  1985. that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
  1986. }
  1987. })
  1988. } else {
  1989. that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟后再点击' , type: 'error', duration: 2000 })
  1990. }
  1991. setTimeout(() => {
  1992. that.isSrm = 1
  1993. }, 3000)
  1994. // if(this.currentRow.srmstatus){
  1995. // if(this.currentRow.srmstatus != 0){
  1996. // const srmArr = this.currentRow.srmbuyeCode.split(",")
  1997. // console.log("srmArr",srmArr)
  1998. // srmArr.forEach(function(item){
  1999. // console.log("srmArr item",item)
  2000. // var send_data = {
  2001. // "code":item,
  2002. // "pastureid":Cookies.get('pastureid')
  2003. // }
  2004. // SrmOrder(send_data).then(response => {
  2005. // console.log('response', response)
  2006. // if (response.msg !== 'fail') {
  2007. // that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
  2008. // that.get_table_data()
  2009. // } else {
  2010. // that.$notify({ title: '失败', message: '上传失败' , type: 'error', duration: 2000 })
  2011. // }
  2012. // })
  2013. // })
  2014. // }
  2015. // }
  2016. },
  2017. closeData() {
  2018. this.isokDisable = true
  2019. setTimeout(() => {
  2020. this.isokDisable = false
  2021. }, 1000)
  2022. console.log('点击确认关闭', this.temp2)
  2023. this.$refs['temp2'].validate(valid => {
  2024. if (valid) {
  2025. this.requestParamStute.parammaps.id = this.temp2.id
  2026. this.requestParamStute.parammaps.note = this.temp2.note
  2027. PostDataByName(this.requestParamStute).then(response => {
  2028. console.log('新增保存发送参数', this.requestParamStute)
  2029. if (response.msg !== 'fail') {
  2030. this.get_table_data2()
  2031. this.dialogFormVisibleClose = false
  2032. this.$notify({
  2033. title: '成功',
  2034. message: '关闭成功',
  2035. type: 'success',
  2036. duration: 2000
  2037. })
  2038. } else {
  2039. failproccess(response, this.$notify)
  2040. }
  2041. })
  2042. }
  2043. })
  2044. },
  2045. get_table_data3() {
  2046. this.listLoading3 = true
  2047. if (this.$refs['inputDatetime3'] !== undefined && this.$refs['inputDatetime3'].value !== null) {
  2048. this.getdataListParm3.parammaps.startTime = this.$refs['inputDatetime3'].value[0]
  2049. this.getdataListParm3.parammaps.stopTime = this.$refs['inputDatetime3'].value[1]
  2050. } else {
  2051. this.getdataListParm3.parammaps.startTime = ''
  2052. this.getdataListParm3.parammaps.stopTime = ''
  2053. }
  2054. GetDataByName(this.getdataListParm3).then(response => {
  2055. this.list3 = response.data.list
  2056. this.pageNum3 = response.data.pageNum
  2057. this.pageSize3 = response.data.pageSize
  2058. if (response.data.total) {
  2059. this.total3 = response.data.total
  2060. }
  2061. // Just to simulate the time of the request
  2062. setTimeout(() => {
  2063. this.listLoading3 = false
  2064. }, 300)
  2065. })
  2066. },
  2067. form_search3() {
  2068. this.listLoading = true
  2069. if (this.getdataListParm3.parammaps.inputDatetime === null) {
  2070. this.getdataListParm3.parammaps.inputDatetime = ''
  2071. }
  2072. this.getdataListParm3.offset = 1
  2073. this.get_table_data3()
  2074. },
  2075. handleDownload3() {
  2076. console.log('点击了采购明细导出')
  2077. this.$alert('采购明细正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
  2078. this.isPercentage = true
  2079. this.percentage = 1
  2080. var timer = setInterval(() => {
  2081. this.percentage += 5
  2082. if (this.percentage > 95) {
  2083. this.percentage = 99
  2084. clearInterval(timer)
  2085. }
  2086. this.percentage = this.percentage
  2087. }, 1000)
  2088. this.downloadListParm3.name = this.getdataListParm3.name
  2089. this.downloadListParm3.parammaps = this.getdataListParm3.parammaps
  2090. GetAccount(this.downloadListParm3).then(response => {
  2091. if (response.data.list !== '') {
  2092. this.percentage = 99
  2093. setTimeout(() => {
  2094. this.isPercentage = false
  2095. }, 2000)
  2096. }
  2097. this.downloadList3 = response.data.list
  2098. const elecExcelDatas = [
  2099. {
  2100. tHeader: ['配单号', '采购单号', '备件编号', '备件名称', '备件规格', '备件品牌', '计量单位', '供应商', '单价', '申购数量', '采购数量', '入库数', '申购部门', '采购人', '配单日期'],
  2101. filterVal: ['matchCode', 'buyeCode', 'partCode', 'partName', 'specification', 'brand', 'unit', 'providerName', 'price', 'sumAmount', 'amount', 'receiveAmount', 'departmentName', 'empname', 'buyerDate'],
  2102. tableDatas: this.downloadList3,
  2103. sheetName: '采购明细'
  2104. }
  2105. ]
  2106. json2excel(elecExcelDatas, '采购明细', true, 'xlsx')
  2107. })
  2108. },
  2109. get_table_data4() {
  2110. this.listLoading4 = true
  2111. if (this.$refs['inputDatetime4'] !== undefined && this.$refs['inputDatetime4'].value !== null) {
  2112. this.getdataListParm4.parammaps.startTime = this.$refs['inputDatetime4'].value[0]
  2113. this.getdataListParm4.parammaps.stopTime = this.$refs['inputDatetime4'].value[1]
  2114. } else {
  2115. this.getdataListParm4.parammaps.startTime = ''
  2116. this.getdataListParm4.parammaps.stopTime = ''
  2117. }
  2118. GetDataByName(this.getdataListParm4).then(response => {
  2119. this.list4 = response.data.list
  2120. this.pageNum4 = response.data.pageNum
  2121. this.pageSize4 = response.data.pageSize
  2122. if (response.data.total) {
  2123. this.total4 = response.data.total
  2124. }
  2125. // Just to simulate the time of the request
  2126. setTimeout(() => {
  2127. this.listLoading4 = false
  2128. }, 300)
  2129. })
  2130. },
  2131. form_search4() {
  2132. this.listLoading = true
  2133. if (this.getdataListParm4.parammaps.inputDatetime === null) {
  2134. this.getdataListParm4.parammaps.inputDatetime = ''
  2135. }
  2136. this.getdataListParm4.offset = 1
  2137. this.get_table_data4()
  2138. },
  2139. form_see4(row) {
  2140. this.dialogStatusSee4 = 'see'
  2141. this.dialogFormVisibleSee4 = true
  2142. this.temp4 = Object.assign({}, row)
  2143. this.getdataListSee4.parammaps.matchCode = row.matchCode
  2144. this.getSeeList4()
  2145. var reason = '未通过原因:' + this.temp4.workflowNote
  2146. if (this.temp4.statue === 0) {
  2147. this.activeList = [{ title: '配单', date: this.temp4.dealTime, name: this.temp4.empname }, { title: '办公室主任审核' }]
  2148. this.active = 1
  2149. } else if (this.temp4.statue === 1) {
  2150. this.activeList = [{ title: '配单', date: this.temp4.dealTime, name: this.temp4.empname }, { title: '办公室主任审核', date: this.temp4.chargeDate, name: this.temp4.chargeName }]
  2151. this.active = 2
  2152. } else if (this.temp4.statue === 2) {
  2153. this.activeList = [{ title: '配单', date: this.temp4.dealTime, name: this.temp4.empname }, { title: '办公室主任审核', date: this.temp4.chargeDate, name: this.temp4.chargeName, status: 'error', reason: reason }]
  2154. this.active = 2
  2155. }
  2156. },
  2157. getSeeList4() {
  2158. GetDataByName(this.getdataListSee4).then(response => {
  2159. this.listSee4 = response.data.list
  2160. this.listUpdate4 = response.data.list
  2161. if (response.data.list !== null) {
  2162. for (let i = 0; i < response.data.list.length; i++) {
  2163. console.log(response.data.list[i].srcpath)
  2164. console.log(response.data.list[i].picpath)
  2165. console.log(process.env.VUE_APP_BASE_API + response.data.list[i].srcpath)
  2166. 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) {
  2167. if (this.dialogStatusSee4 == 'see') {
  2168. this.listSee4[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  2169. this.listSee4[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  2170. } else {
  2171. this.listUpdate4[i].srcpath = process.env.VUE_APP_BASE_API + response.data.list[i].srcpath
  2172. this.listUpdate4[i].picpath = process.env.VUE_APP_BASE_API + response.data.list[i].picpath
  2173. }
  2174. } else {
  2175. this.listSee4[i].srcpath = ''
  2176. this.listSee4[i].picpath = ''
  2177. this.listUpdate4[i].srcpath = ''
  2178. this.listUpdate4[i].picpath = ''
  2179. }
  2180. }
  2181. }
  2182. console.log('查看下方table数据', response.data.list)
  2183. this.pageNum4 = response.data.pageNum
  2184. this.pageSize4 = response.data.pageSize
  2185. })
  2186. },
  2187. handleExamine(row) {
  2188. if (row == undefined) {
  2189. this.examineTemp = this.temp4
  2190. this.$set(this.temp4, 'SHstatue', 1)
  2191. this.$set(this.temp4, 'workflowNote', '')
  2192. } else {
  2193. this.examineTemp = Object.assign({}, row)
  2194. this.$set(this.examineTemp, 'SHstatue', 1)
  2195. this.$set(this.examineTemp, 'workflowNote', '')
  2196. }
  2197. this.dialogStatus_Examine = 'examine'
  2198. this.dialogFormVisible_Examine = true
  2199. this.statueReason = false
  2200. },
  2201. changeSHStatue(val) {
  2202. if (val == 2) {
  2203. this.statueReason = true
  2204. } else {
  2205. this.statueReason = false
  2206. }
  2207. },
  2208. createExamineData() {
  2209. console.log(this.examineTemp)
  2210. this.$refs['examineTemp'].validate(valid => {
  2211. if (valid) {
  2212. if (this.examineTemp.SHstatue == 1) {
  2213. console.log('通过')
  2214. this.postDataPramas.common = { 'returnmap': '0' }
  2215. this.postDataPramas.data = []
  2216. this.postDataPramas.data[0] = { 'name': 'partdealCharge', 'type': 'e', 'parammaps': {
  2217. 'id': this.examineTemp.id,
  2218. 'statue': this.examineTemp.SHstatue,
  2219. 'empId': Cookies.get('employeid'),
  2220. 'workflowNote': this.examineTemp.workflowNote
  2221. }}
  2222. this.postDataPramas.data[1] = { 'name': 'updatebigbuydetailenable', 'type': 'e', 'parammaps': {
  2223. 'matchCode': this.examineTemp.matchCode
  2224. }}
  2225. this.postDataPramas.data[2] = { 'name': 'updatebigbuydetailZero', 'type': 'e', 'parammaps': {
  2226. 'matchCode': this.examineTemp.matchCode
  2227. }}
  2228. ExecDataByConfig(this.postDataPramas).then(response => {
  2229. console.log('审核保存发送参数', this.postDataPramas)
  2230. if (response.msg === 'fail') {
  2231. this.$notify({
  2232. title: '审核失败',
  2233. message: response.data,
  2234. type: 'warning',
  2235. duration: 2000
  2236. })
  2237. } else {
  2238. this.dialogFormVisible_Examine = false
  2239. this.get_table_data4()
  2240. this.$notify({
  2241. title: '',
  2242. message: '审核成功',
  2243. type: 'success',
  2244. duration: 2000
  2245. })
  2246. }
  2247. })
  2248. } else if (this.examineTemp.SHstatue == 2) {
  2249. console.log('不通过')
  2250. this.postDataPramas.common = { 'returnmap': '0' }
  2251. this.postDataPramas.data = []
  2252. this.postDataPramas.data[0] = { 'name': 'partdealCharge', 'type': 'e', 'parammaps': {
  2253. 'id': this.examineTemp.id,
  2254. 'statue': this.examineTemp.SHstatue,
  2255. 'empId': Cookies.get('employeid'),
  2256. 'workflowNote': this.examineTemp.workflowNote
  2257. }}
  2258. // this.postDataPramas.data[1] = { 'name': 'updatepartpurchase', 'type': 'e', 'parammaps': {
  2259. // 'matchCode': this.examineTemp.matchCode
  2260. // }}
  2261. ExecDataByConfig(this.postDataPramas).then(response => {
  2262. console.log('审核保存发送参数', this.postDataPramas)
  2263. if (response.msg === 'fail') {
  2264. this.$notify({
  2265. title: '审核失败',
  2266. message: response.data,
  2267. type: 'warning',
  2268. duration: 2000
  2269. })
  2270. } else {
  2271. this.dialogFormVisible_Examine = false
  2272. this.get_table_data4()
  2273. this.$notify({
  2274. title: '',
  2275. message: '审核成功',
  2276. type: 'success',
  2277. duration: 2000
  2278. })
  2279. }
  2280. })
  2281. }
  2282. }
  2283. })
  2284. },
  2285. form_edit(row) {
  2286. this.dialogStatusUpdate4 = 'update'
  2287. this.dialogFormVisibleUpdate4 = true
  2288. this.getdataListSee4.parammaps.matchCode = row.matchCode
  2289. this.updateTemp4 = Object.assign(row, {})
  2290. this.getSeeList4()
  2291. },
  2292. edit_dialog_save() {
  2293. this.$refs['updateTemp4'].validate(valid => {
  2294. if (valid) {
  2295. // for (let i = 0; i < this.listUpdate4.length; i++) {
  2296. // var rulesAmount = /^\d+$/
  2297. // if ((this.listUpdate4[i].amount == '' || this.listUpdate4[i].amount == undefined) && parseFloat(this.listUpdate4[i].amount) !== 0) {
  2298. // this.$message({
  2299. // type: 'error',
  2300. // message: '采购数量不可为空',
  2301. // duration: 2000
  2302. // })
  2303. // return false
  2304. // } else if (!rulesAmount.test(parseFloat(this.listUpdate4[i].amount))) {
  2305. // this.$message({
  2306. // type: 'error',
  2307. // message: '采购数量不可为空',
  2308. // duration: 2000
  2309. // })
  2310. // return false
  2311. // }
  2312. // }
  2313. for (let i = 0; i < this.listUpdate4.length; i++) {
  2314. console.log(this.listUpdate4[i].amount)
  2315. var rulesAmount = /^\d+$/
  2316. if ((this.listUpdate4[i].amount == '' || this.listUpdate4[i].amount == undefined) && parseFloat(this.listUpdate4[i].amount) !== 0) {
  2317. this.$message({
  2318. type: 'error',
  2319. message: '采购数量不可为空',
  2320. duration: 2000
  2321. })
  2322. return false
  2323. } else if (!rulesAmount.test(parseFloat(this.listUpdate4[i].amount))) {
  2324. this.$message({
  2325. type: 'error',
  2326. message: '采购数量请输入大于等于0的整数',
  2327. duration: 2000
  2328. })
  2329. return false
  2330. } else {
  2331. this.postDataPramas.common = { 'returnmap': '0' }
  2332. this.postDataPramas.data = []
  2333. this.postDataPramas.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listUpdate4 }}
  2334. this.postDataPramas.data[0].children = []
  2335. this.postDataPramas.data[0].children[0] = { 'name': 'updatePDbuydetail', 'type': 'e', 'parammaps': {
  2336. amount: '@insertSpotList.amount',
  2337. id: '@insertSpotList.id'
  2338. }}
  2339. this.postDataPramas.data[1] = { 'name': 'partdealCharge', 'type': 'e', 'parammaps': {
  2340. id: this.updateTemp4.id,
  2341. statue: '0',
  2342. empId: Cookies.get('employeid')
  2343. }}
  2344. }
  2345. }
  2346. ExecDataByConfig(this.postDataPramas).then(response => {
  2347. console.log('新增保存发送参数', this.postDataPramas)
  2348. if (response.msg === 'fail') {
  2349. this.$notify({
  2350. title: '保存失败',
  2351. message: response.data,
  2352. type: 'warning',
  2353. duration: 2000
  2354. })
  2355. } else {
  2356. this.dialogFormVisibleUpdate4 = false
  2357. this.getdataListParm4.parammaps.inputDatetime = ''
  2358. this.get_table_data4()
  2359. this.$notify({
  2360. title: '',
  2361. message: '保存成功',
  2362. type: 'success',
  2363. duration: 2000
  2364. })
  2365. }
  2366. })
  2367. return true
  2368. }
  2369. })
  2370. }
  2371. }
  2372. }
  2373. </script>
  2374. <style lang="scss" >
  2375. .el-table .warning-row {
  2376. background: red;
  2377. }
  2378. .el-table .color-row {
  2379. background: #eee;
  2380. }
  2381. </style>
  2382. <style lang="scss" scoped>
  2383. .app-contentClose .el-form-item__content {
  2384. margin-left: 0 !important;
  2385. }
  2386. </style>
  2387. <style lang="scss" scoped>
  2388. .app-contentConfirmationSheet {
  2389. margin-bottom: 50px;
  2390. }
  2391. .app-content {
  2392. background: #eee;
  2393. margin-bottom: 50px;
  2394. .title {
  2395. line-height: 40px;
  2396. div {
  2397. float: left;
  2398. margin-right: 50px;
  2399. b {
  2400. padding-left: 10px;
  2401. }
  2402. }
  2403. }
  2404. .total {
  2405. margin-left: 80%;
  2406. line-height: 30px;
  2407. }
  2408. }
  2409. </style>