spotCheck.vue 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752
  1. <template>
  2. <div class="examination">
  3. <div class="common-head-search">
  4. <el-form :inline="true">
  5. <el-form-item label='委托单位'>
  6. <el-select v-model="search.planCompanyNo" clearable filterable collapse-tags size="small"
  7. style="width:200px;margin-right: 10px;" placeholder="请选择查询内容">
  8. <el-option v-for="item in entrOrgNameType" :key="item.baseName" :label="item.orgName" :value="item.orgCode">
  9. </el-option>
  10. </el-select>
  11. </el-form-item>
  12. <el-form-item label='物料名称'>
  13. <el-input v-model="search.matName" size="small" @keyup.enter.native="searchData()" placeholder="请输入查询内容"
  14. style="width: 200px;margin-right: 10px;"></el-input>
  15. </el-form-item>
  16. <el-form-item label="任务日期">
  17. <el-date-picker v-model="search.times[0]" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date"
  18. placeholder="开始日期" size="mini" style="width: 140px">
  19. </el-date-picker>
  20. <span>至</span>
  21. <el-date-picker v-model="search.times[1]" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date"
  22. placeholder="结束日期" size="mini" style="width: 140px">
  23. </el-date-picker>
  24. <!-- <el-date-picker
  25. v-model="search.times"
  26. type="daterange"
  27. range-separator="至"
  28. start-placeholder="开始日期"
  29. end-placeholder="结束日期"
  30. size="small"
  31. style="width:300px"
  32. format="yyyy-MM-dd"
  33. value-format="yyyy-MM-dd">
  34. </el-date-picker> -->
  35. </el-form-item>
  36. <el-form-item>
  37. <el-button icon="el-icon-search" type="goon" size="mini" @click="searchData">查询</el-button>
  38. <el-button icon="el-icon-refresh" type="info" plain size="mini" @click="reset">重置</el-button>
  39. </el-form-item>
  40. </el-form>
  41. </div>
  42. <!-- <el-tabs type="border-card" v-model="activeName">
  43. <el-tab-pane label="检验委托" name="first">
  44. <span slot="label">检验委托<el-badge :max="10" :hidden='page.totalPage == 0' style="margin-top:-18px" :value="page.totalPage"></el-badge></span>
  45. </el-tab-pane>
  46. <el-tab-pane label="检验原料" name="second">
  47. </el-tab-pane>
  48. </el-tabs> -->
  49. <div class="common-title-div">
  50. <div class="common-title-name">
  51. <img style="width: 25px; height: 25px" src='../../../../assets/img/imgScreen/logo.png' />
  52. 检验原料信息
  53. </div>
  54. <div>
  55. <el-button icon="el-icon-check" type="goon" size="mini" v-privilege="activeMenu + 'sampling'"
  56. @click="ylCheckData">抽检</el-button>
  57. <el-button icon="el-icon-check" type="goon" size="mini" v-privilege="activeMenu + 'recheck'"
  58. @click="ylUncheckData">复检</el-button>
  59. </div>
  60. </div>
  61. <div class="common-table-div" style="margin-bottom:0;margin-top:0">
  62. <el-table id="excelTable" v-loading="dataLoading" ref="dataTable" border :height="height_top"
  63. highlight-current-row @selection-change="ylHandleSelectionChange" :data="table.ylList"
  64. :icore-filter-flag="icoreFilterFlag" :header-cell-style="tableHeaderCellStyle"
  65. :cell-class-name="tableRowClassName" :summary-method="getSummaries" show-summary>
  66. <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
  67. <el-table-column type="selection" width="55" fixed="left" align="center"></el-table-column>
  68. <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="stateFlag1" label="状态"
  69. align="center"></el-table-column>
  70. <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="entrId" label="委托编号"
  71. align="center"></el-table-column>
  72. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="contractNo" label="合同号"
  73. align="center"></el-table-column>
  74. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="suppName" label="供应商"
  75. align="center"></el-table-column>
  76. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="matName" label="物料"
  77. align="center"></el-table-column>
  78. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="carNo" label="委托样号"
  79. align="center"></el-table-column>
  80. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="matOrigin" label="产地"
  81. align="center"></el-table-column>
  82. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="transportTypeName" label="运输类型"
  83. align="center"></el-table-column>
  84. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="acceptName" label="收货单位"
  85. align="center"></el-table-column>
  86. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="sendPlace" label="发站"
  87. align="center"></el-table-column>
  88. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="packTypeName" label="包装方式"
  89. align="center"></el-table-column>
  90. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="isCiq1" label="是否商检"
  91. align="center"></el-table-column>
  92. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="isBatch1" label="是否配批"
  93. align="center"></el-table-column>
  94. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="smpDeliName" label="取样频次"
  95. align="center"></el-table-column>
  96. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="unloadPlace" label="卸货地点"
  97. align="center"></el-table-column>
  98. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="lotsNo" label="送货批次"
  99. align="center"></el-table-column>
  100. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="planCompanyName" label="计划单位"
  101. align="center"></el-table-column>
  102. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="companyName" label="检验单位"
  103. align="center"></el-table-column>
  104. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="deptName" label="检验车间"
  105. align="center"></el-table-column>
  106. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="sectionName" label="检验班组"
  107. align="center"></el-table-column>
  108. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="entrTime1" label="委托日期"
  109. align="center"></el-table-column>
  110. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="pointName" label="取样地点"
  111. align="center"></el-table-column>
  112. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="smpCompanyName" label="采样单位"
  113. align="center"></el-table-column>
  114. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="smpDeptName" label="采样车间"
  115. align="center"></el-table-column>
  116. <el-table-column :show-overflow-tooltip="true" sortable min-width="140px" prop="smpSectionName" label="采样班组"
  117. align="center"></el-table-column>
  118. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="sampleTypeName" label="样品类型"
  119. align="center"></el-table-column>
  120. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="entrTypeName" label="委托类型"
  121. align="center"></el-table-column>
  122. <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="testTypeName" label="检验类型"
  123. align="center"></el-table-column>
  124. <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="matClassName" label="物料分类"
  125. align="center"></el-table-column>
  126. <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="matShapeName" label="试样形状"
  127. align="center"></el-table-column>
  128. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="spec" label="规格"
  129. align="center"></el-table-column>
  130. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="netWgt" label="重量(t)"
  131. align="center"></el-table-column>
  132. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="sampleNum" label="样品数量"
  133. align="center"></el-table-column>
  134. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="sampleWgt" label="样品重量"
  135. align="center"></el-table-column>
  136. <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="planNo" label="计量预报号"
  137. align="center"></el-table-column>
  138. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="entTime" label="进厂时间"
  139. align="center"></el-table-column>
  140. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="testCost" label="检测费用"
  141. align="center"></el-table-column>
  142. <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="isSmp1" label="是否取样"
  143. align="center"></el-table-column>
  144. <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="isPrep1" label="是否组合"
  145. align="center"></el-table-column>
  146. <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="isCheck1" label="是否外检"
  147. align="center"></el-table-column>
  148. <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="isMater1" label="是否计量"
  149. align="center"></el-table-column>
  150. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="memo" label="备注"
  151. align="center"></el-table-column>
  152. <el-table-column sortable :show-overflow-tooltip="true" min-width="95px" prop="createMan" label="创建人"
  153. align="center"></el-table-column>
  154. <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="createTime" label="创建时间"
  155. align="center"></el-table-column>
  156. <el-table-column sortable :show-overflow-tooltip="true" min-width="95px" prop="updateMan" label="修改人"
  157. align="center"></el-table-column>
  158. <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="updateTime" label="修改时间"
  159. align="center"></el-table-column>
  160. </el-table>
  161. </div>
  162. <div class="common-foot-style">
  163. <el-pagination @size-change="ylPageSizeChange" @current-change="ylPageCurrentChange" :current-page="page3.pageNum"
  164. :page-sizes="[100, 200, 500, 800, 1000]" :page-size="page3.pageSize"
  165. layout="total, sizes, prev, pager, next, jumper" :total="page3.totalPage" background>
  166. </el-pagination>
  167. </div>
  168. <div class="common-title-div">
  169. <div class="common-title-name">
  170. <img style="width: 25px; height: 25px" src='../../../../assets/img/imgScreen/logo.png' />
  171. 检验委托信息
  172. </div>
  173. <div>
  174. <!-- <el-button icon="el-icon-check" type="goon" size="mini" v-privilege="activeMenu + 'sampling'" @click="checkData">抽检</el-button>
  175. <el-button icon="el-icon-check" type="goon" size="mini" v-privilege="activeMenu + 'recheck'" @click="uncheckData">复检</el-button> -->
  176. <el-button icon="el-icon-remove-outline" type="danger" size="mini" v-privilege="activeMenu + 'delete'"
  177. @click="deleteData2">停用</el-button>
  178. <el-button icon="el-icon-check" type="goon" size="mini" v-privilege="activeMenu + 'submit'"
  179. @click="submitData2">提交</el-button>
  180. </div>
  181. </div>
  182. <div class="common-table-div" style="margin-bottom:0;margin-top:0">
  183. <el-table id="excelTable" v-loading="dataLoading" ref="dataTable" border :height="height_top"
  184. highlight-current-row @selection-change="handleSelectionChange" :data="table.list"
  185. :icore-filter-flag="icoreFilterFlag" :header-cell-style="tableHeaderCellStyle" @cell-click='searchFollow'
  186. :cell-class-name="tableRowClassName" :summary-method="getSummaries" show-summary>
  187. <el-table-column type="index" label="NO" fixed="left" align="center"></el-table-column>
  188. <el-table-column type="selection" width="55" fixed="left" align="center"></el-table-column>
  189. <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="stateFlag1" label="状态"
  190. align="center"></el-table-column>
  191. <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="entrId" label="委托编号"
  192. align="center"></el-table-column>
  193. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="contractNo" label="合同号"
  194. align="center"></el-table-column>
  195. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="suppName" label="供应商"
  196. align="center"></el-table-column>
  197. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="matName" label="物料"
  198. align="center"></el-table-column>
  199. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="carNo" label="委托样号"
  200. align="center"></el-table-column>
  201. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="matOrigin" label="产地"
  202. align="center"></el-table-column>
  203. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="transportTypeName" label="运输类型"
  204. align="center"></el-table-column>
  205. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="acceptName" label="收货单位"
  206. align="center"></el-table-column>
  207. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="sendPlace" label="发站"
  208. align="center"></el-table-column>
  209. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="packTypeName" label="包装方式"
  210. align="center"></el-table-column>
  211. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="isCiq1" label="是否商检"
  212. align="center"></el-table-column>
  213. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="isBatch1" label="是否配批"
  214. align="center"></el-table-column>
  215. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="smpDeliName" label="取样频次"
  216. align="center"></el-table-column>
  217. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="unloadPlace" label="卸货地点"
  218. align="center"></el-table-column>
  219. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="lotsNo" label="送货批次"
  220. align="center"></el-table-column>
  221. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="planCompanyName" label="计划单位"
  222. align="center"></el-table-column>
  223. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="companyName" label="检验单位"
  224. align="center"></el-table-column>
  225. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="deptName" label="检验车间"
  226. align="center"></el-table-column>
  227. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="sectionName" label="检验班组"
  228. align="center"></el-table-column>
  229. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="entrTime1" label="委托日期"
  230. align="center"></el-table-column>
  231. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="pointName" label="取样地点"
  232. align="center"></el-table-column>
  233. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="smpCompanyName" label="采样单位"
  234. align="center"></el-table-column>
  235. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="smpDeptName" label="采样车间"
  236. align="center"></el-table-column>
  237. <el-table-column :show-overflow-tooltip="true" sortable min-width="140px" prop="smpSectionName" label="采样班组"
  238. align="center"></el-table-column>
  239. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="sampleTypeName" label="样品类型"
  240. align="center"></el-table-column>
  241. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="entrTypeName" label="委托类型"
  242. align="center"></el-table-column>
  243. <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="testTypeName" label="检验类型"
  244. align="center"></el-table-column>
  245. <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="matClassName" label="物料分类"
  246. align="center"></el-table-column>
  247. <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="matShapeName" label="试样形状"
  248. align="center"></el-table-column>
  249. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="spec" label="规格"
  250. align="center"></el-table-column>
  251. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="netWgt" label="重量(t)"
  252. align="center"></el-table-column>
  253. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="sampleNum" label="样品数量"
  254. align="center"></el-table-column>
  255. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="sampleWgt" label="样品重量"
  256. align="center"></el-table-column>
  257. <el-table-column :show-overflow-tooltip="true" sortable min-width="100px" prop="planNo" label="计量预报号"
  258. align="center"></el-table-column>
  259. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="entTime" label="进厂时间"
  260. align="center"></el-table-column>
  261. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="testCost" label="检测费用"
  262. align="center"></el-table-column>
  263. <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="isSmp1" label="是否取样"
  264. align="center"></el-table-column>
  265. <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="isPrep1" label="是否组合"
  266. align="center"></el-table-column>
  267. <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="isCheck1" label="是否外检"
  268. align="center"></el-table-column>
  269. <el-table-column sortable :show-overflow-tooltip="true" min-width="80px" prop="isMater1" label="是否计量"
  270. align="center"></el-table-column>
  271. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="memo" label="备注"
  272. align="center"></el-table-column>
  273. <el-table-column sortable :show-overflow-tooltip="true" min-width="95px" prop="createMan" label="创建人"
  274. align="center"></el-table-column>
  275. <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="createTime" label="创建时间"
  276. align="center"></el-table-column>
  277. <el-table-column sortable :show-overflow-tooltip="true" min-width="95px" prop="updateMan" label="修改人"
  278. align="center"></el-table-column>
  279. <el-table-column sortable :show-overflow-tooltip="true" min-width="160px" prop="updateTime" label="修改时间"
  280. align="center"></el-table-column>
  281. </el-table>
  282. </div>
  283. <div class="common-foot-style">
  284. <el-pagination @size-change="pageSizeChange" @current-change="pageCurrentChange" :current-page="page.pageNum"
  285. :page-sizes="[100, 200, 500, 800, 1000]" :page-size="page.pageSize"
  286. layout="total, sizes, prev, pager, next, jumper" :total="page.totalPage" background>
  287. </el-pagination>
  288. </div>
  289. <!-- <div class="common-title-div">
  290. <div class="common-title-name">
  291. <img style="width: 25px; height: 25px" src='../../../../assets/img/imgScreen/logo.png' />
  292. 抽检复检日期
  293. </div>
  294. <div>
  295. <el-button icon="el-icon-remove-outline" type="danger" size="mini" v-privilege="activeMenu + 'delete'" @click="deleteData2">删除</el-button>
  296. <el-button icon="el-icon-check" type="goon" size="mini" v-privilege="activeMenu + 'submit'" @click="submitData2">提交</el-button>
  297. </div>
  298. </div>
  299. <div class="common-table-div" style="margin-bottom:0;margin-top:0">
  300. <el-table v-loading="dataLoading2" ref="dataTable2" border :height="height_bot" highlight-current-row @selection-change="handleSelectionChange2" :data="table.list2" :icore-filter-flag="icoreFilterFlag"
  301. :header-cell-style="tableHeaderCellStyle" :cell-class-name="tableRowClassName2" :summary-method="getSummaries" show-summary>
  302. <el-table-column type="index" label="NO" fixed="left" align="center">
  303. </el-table-column>
  304. <el-table-column type="selection" width="55" align="center"></el-table-column>
  305. <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="entrTime1" label="抽复检日期" align="center"></el-table-column>
  306. <el-table-column sortable :show-overflow-tooltip="true" min-width="200px" prop="testTypeName" label="检验类型" align="center"></el-table-column>
  307. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="sampleTypeName" label="样品类型" align="center"></el-table-column>
  308. <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="matName" label="物料名称" align="center"></el-table-column>
  309. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="entrTypeName" label="委托类型" align="center"></el-table-column>
  310. <el-table-column sortable :show-overflow-tooltip="true" min-width="120px" prop="planCompanyName" label="委托单位" align="center"></el-table-column>
  311. <el-table-column sortable :show-overflow-tooltip="true" min-width="100px" prop="stateFlag1" label="状态" align="center"></el-table-column>
  312. <el-table-column sortable :show-overflow-tooltip="true" min-width="140px" prop="validFlag1" label="数据状态" align="center"></el-table-column>
  313. </el-table>
  314. </div> -->
  315. </div>
  316. </template>
  317. <script>
  318. import {
  319. getCookie,
  320. formatDate
  321. } from '@/utils/util.js';
  322. import {
  323. cookieUserId,
  324. cookieUserName
  325. } from '@/config/config.js'
  326. let userName = getCookie(cookieUserName);
  327. let userId = getCookie(cookieUserId);
  328. export default {
  329. data() {
  330. return {
  331. table: {
  332. list: [],
  333. list2: [],
  334. ylList: []
  335. },
  336. activeName: 'first',
  337. dataLoading: false,
  338. dataLoading2: false,
  339. icoreFilterFlag: true,
  340. page: {
  341. pageSize: 200,
  342. pageNum: 1,
  343. totalPage: 0
  344. },
  345. page2: {
  346. pageSize: 200,
  347. pageNum: 1,
  348. totalPage: 0
  349. },
  350. page3: {
  351. pageSize: 200,
  352. pageNum: 1,
  353. totalPage: 0
  354. },
  355. list: [],
  356. planId: '',
  357. showFlag: false,
  358. Params: {},
  359. showFlag2: false,
  360. Params2: {},
  361. entrOrgNameType: [],
  362. entrOrgNameType1: [],
  363. sampleTypeNameType: [],
  364. ylMultipleSelection3: [],
  365. multipleSelection3: [],
  366. multipleSelection4: [],
  367. search: {
  368. entrTime: '',
  369. times: [],
  370. planCompanyName: '',
  371. matName: ''
  372. },
  373. height_top: 0,
  374. height_bot: 0,
  375. activeMenu: ''
  376. }
  377. },
  378. created() {
  379. this.height_top = window.innerHeight / 2 - 130 < 249 ? 249 : window.innerHeight / 2 - 120;
  380. this.height_bot = window.innerHeight / 2 - 130 < 249 ? 249 : window.innerHeight / 2 - 120;
  381. this.search.times = [this.getYNM(new Date()), this.getYNM(new Date())]
  382. this.activeMenu = window.top.localStorage.getItem('activeMenu')
  383. },
  384. mounted() {
  385. this.axios.post("pass/baseManagement/v1/sysorgs/querySysOrgCompanyAll", {}, { individualType: 'json' }).then(response => {
  386. this.entrOrgNameType = response.data
  387. });
  388. // this.getentrOrgNameTypeList();
  389. this.searchData();
  390. // this.getDataList2();
  391. this.addScreen();
  392. this.addScreen2()
  393. },
  394. methods: {
  395. getYNM(date) {
  396. let year = date.getFullYear().toString();
  397. let month = date.getMonth() + 1;
  398. let day = date.getDate();
  399. month = month < 10 ? "0" + month : month;
  400. day = day < 10 ? "0" + day : day;
  401. return `${year}-${month}-${day}`;
  402. },
  403. getSummaries(param) {
  404. const { columns, data } = param;
  405. const sums = [];
  406. columns.forEach((column, index) => {
  407. if (index === 0) {
  408. sums[index] = "合计";
  409. }
  410. if (index === 1) {
  411. sums[index] = data.length;
  412. }
  413. });
  414. return sums;
  415. },
  416. refresh() {
  417. this.mainData();
  418. },
  419. refresh2() {
  420. this.depData(this.planId);
  421. },
  422. checkData() {
  423. let _this = this;
  424. if (_this.multipleSelection3.length < 1) {
  425. this.$message.warning('请勾选您要抽检的数据!')
  426. return
  427. }
  428. _this.axios.post('pass/testManagement/v1/limstestentrusts/check', _this.multipleSelection3, { individualType: 'json' }).then(res => {
  429. if (res.succeed) {
  430. this.$message.success('抽检成功');
  431. _this.refresh()
  432. } else {
  433. this.$message.error(res.message)
  434. }
  435. }).catch(e => {
  436. this.$message.error(e.message)
  437. })
  438. },
  439. uncheckData() {
  440. let _this = this;
  441. if (_this.multipleSelection3.length < 1) {
  442. this.$message.warning('请勾选您要复检的数据!')
  443. return
  444. }
  445. _this.axios.post('pass/testManagement/v1/limstestentrusts/uncheck', _this.multipleSelection3, { individualType: 'json' }).then(res => {
  446. if (res.succeed) {
  447. this.$message.success('复检成功');
  448. _this.refresh()
  449. } else {
  450. this.$message.error(res.message)
  451. }
  452. }).catch(e => {
  453. this.$message.error(e.message)
  454. })
  455. },
  456. ylCheckData() {
  457. let _this = this;
  458. if (_this.ylMultipleSelection3.length < 1) {
  459. this.$message.warning('请勾选您要抽检的数据!')
  460. return
  461. }
  462. _this.axios.post('pass/testManagement/v1/limstestentrusts/check', _this.ylMultipleSelection3, { individualType: 'json' }).then(res => {
  463. if (res.succeed) {
  464. this.$message.success('抽检成功');
  465. _this.searchData()
  466. } else {
  467. this.$message.error(res.message)
  468. }
  469. }).catch(e => {
  470. this.$message.error(e.message)
  471. })
  472. },
  473. ylUncheckData() {
  474. let _this = this;
  475. if (_this.ylMultipleSelection3.length < 1) {
  476. this.$message.warning('请勾选您要复检的数据!')
  477. return
  478. }
  479. _this.axios.post('pass/testManagement/v1/limstestentrusts/uncheck', _this.ylMultipleSelection3, { individualType: 'json' }).then(res => {
  480. if (res.succeed) {
  481. this.$message.success('复检成功');
  482. _this.searchData()
  483. } else {
  484. this.$message.error(res.message)
  485. }
  486. }).catch(e => {
  487. this.$message.error(e.message)
  488. })
  489. },
  490. deleteData2() {
  491. let _this = this;
  492. if (_this.multipleSelection3.length < 1) {
  493. this.$message.warning('请勾选您要停用的数据!')
  494. } else {
  495. for (var j = 0; j < _this.multipleSelection3.length; j++) {
  496. if (_this.multipleSelection3[j].validFlag === '0') {
  497. this.$message.warning('请勾选状态为已启用的数据!')
  498. return
  499. }
  500. }
  501. _this.dialogTableVisible = false;
  502. for (var i = 0; i < _this.multipleSelection3.length; i++) {
  503. _this.multipleSelection3[i].updateMan = userName;
  504. _this.multipleSelection3[i].updateNo = userId
  505. }
  506. _this.axios.post('pass/testManagement/v1/limstestentrusts/abolish', _this.multipleSelection3, { individualType: 'json' }).then(res => {
  507. if (res.succeed) {
  508. this.$message.success('停用操作成功');
  509. _this.mainData()
  510. } else {
  511. this.$message.error(res.message)
  512. }
  513. }).catch(e => {
  514. this.$message.error(e.message)
  515. })
  516. }
  517. },
  518. submitData2() {
  519. let _this = this;
  520. if (_this.multipleSelection3.length < 1) {
  521. this.$message.warning('请勾选您要提交的数据!')
  522. } else {
  523. for (var j = 0; j < _this.multipleSelection3.length; j++) {
  524. if (_this.multipleSelection3[j].stateFlag === '1') {
  525. this.$message.warning('请勾选状态为编辑的数据!')
  526. return
  527. }
  528. }
  529. let ids = this.multipleSelection3.map(item => item.id)
  530. _this.dialogTableVisible2 = false;
  531. // for (var i = 0; i < _this.multipleSelection4.length; i++) {
  532. // _this.multipleSelection4[i].updateMan = userName;
  533. // _this.multipleSelection4[i].updateNo = userId
  534. // }
  535. _this.axios.post('pass/testManagement/v1/limstestentrusts/submit', ids, { individualType: 'json' }).then(res => {
  536. if (res.succeed) {
  537. this.$message.success('提交成功');
  538. _this.mainData()
  539. } else {
  540. this.$message.error(res.message)
  541. }
  542. }).catch(e => {
  543. this.$message.error(e.message)
  544. })
  545. }
  546. },
  547. searchData() {
  548. this.page.pageNum = 1
  549. this.page.pageSize = 200
  550. this.page3.pageNum = 1
  551. this.page3.pageSize = 200
  552. this.ylMainData()
  553. this.mainData()
  554. },
  555. mainData() {
  556. let startTime = ''
  557. let endTime = ''
  558. if (!this.search.times) {
  559. startTime = ''
  560. endTime = ''
  561. } else {
  562. startTime = formatDate(this.search.times[0], "yyyy-MM-dd") + ' 00:00:00'
  563. endTime = formatDate(this.search.times[1], "yyyy-MM-dd") + ' 23:59:59'
  564. }
  565. let tempobj = {
  566. 'object': {
  567. "sampleTypeCode": "",
  568. 'isBatch': '',
  569. 'planCompanyNo': this.search.planCompanyNo,
  570. 'matName': this.search.matName,
  571. validFlag: 1
  572. },
  573. 'list': [480302, 480305],
  574. 'pageIndex': this.page.pageNum,
  575. 'pageSize': this.page.pageSize,
  576. 'startTime': startTime,
  577. 'endTime': endTime
  578. }
  579. this.axios.post('pass/testManagement/v1/limstestentrusts/queryLimsTestEntrustPage/', tempobj, { individualType: 'json' }).then(res => {
  580. this.dataLoading = false;
  581. this.table.list = res.data.list;
  582. this.table.list.forEach(item => {
  583. item.stateFlag1 = item.stateFlag === '0' ? '编辑' : item.stateFlag === '1' ? '提交' : ''
  584. item.isCiq1 = item.isCiq === '0' ? '否' : item.isCiq === '1' ? '是' : ''
  585. item.isBatch1 = item.isBatch === '0' ? '否' : item.isBatch === '1' ? '是' : ''
  586. item.isSmp1 = item.isSmp === '0' ? '否' : item.isSmp === '1' ? '是' : ''
  587. item.isPrep1 = item.isPrep === '0' ? '否' : item.isPrep === '1' ? '是' : ''
  588. item.isCheck1 = item.isCheck === '0' ? '否' : item.isCheck === '1' ? '是' : ''
  589. item.isMater1 = item.isMater === '0' ? '否' : item.isMater === '1' ? '是' : ''
  590. item.entrTime1 = formatDate(item.entrTime, 'yyyy-MM-dd')
  591. })
  592. // if (this.table.list.length > 0) {
  593. // this.$refs.dataTable.setCurrentRow(this.table.list[0])
  594. // this.searchFollow(this.table.list[0])
  595. // }
  596. this.page.totalPage = res.data.total;
  597. }).catch(e => {
  598. this.dataLoading = false;
  599. });
  600. },
  601. ylMainData() {
  602. this.saveRow = {}
  603. this.dataLoading = true;
  604. if (!this.search.times) {
  605. this.startTime = ''
  606. this.endTime = ''
  607. } else {
  608. this.startTime = this.getYNM(new Date) + ' 00:00:00'
  609. this.endTime = this.getYNM(new Date) + ' 23:59:59'
  610. }
  611. let obj = {
  612. object: {
  613. entrOrgNo: this.search.planCompanyNo, // 委托单位
  614. sampleTypeCode: 480101,
  615. matName: this.search.matName,
  616. stateFlag: 1
  617. },
  618. list: [480301],
  619. 'startTime': this.startTime,
  620. 'endTime': this.endTime,
  621. pageIndex: this.page3.pageNum,
  622. pageSize: this.page3.pageSize
  623. }
  624. this.axios.post('pass/testManagement/v1/limstestentrusts/queryLimsTestEntrustPage', obj, { individualType: 'json' }).then(res => {
  625. this.dataLoading = false;
  626. this.table.ylList = res.data.list;
  627. this.table.ylList.forEach(item => {
  628. item.stateFlag1 = item.stateFlag === '0' ? '编辑' : item.stateFlag === '1' ? '提交' : ''
  629. item.isCiq1 = item.isCiq === '0' ? '否' : item.isCiq === '1' ? '是' : ''
  630. item.isBatch1 = item.isBatch === '0' ? '否' : item.isBatch === '1' ? '是' : ''
  631. item.isSmp1 = item.isSmp === '0' ? '否' : item.isSmp === '1' ? '是' : ''
  632. item.isPrep1 = item.isPrep === '0' ? '否' : item.isPrep === '1' ? '是' : ''
  633. item.isCheck1 = item.isCheck === '0' ? '否' : item.isCheck === '1' ? '是' : ''
  634. item.isMater1 = item.isMater === '0' ? '否' : item.isMater === '1' ? '是' : ''
  635. item.entrTime1 = formatDate(item.entrTime, 'yyyy-MM-dd')
  636. })
  637. this.page3.totalPage = res.data.total;
  638. }).catch(e => {
  639. this.dataLoading = false;
  640. });
  641. },
  642. searchFollow(row) {
  643. this.planId = row.entrId ? row.entrId : ''
  644. this.page2.pageNum = 1
  645. this.page2.pageSize = 50
  646. this.depData(this.planId)
  647. },
  648. depData(planId) {
  649. this.dataLoading2 = true;
  650. this.axios.post('pass/testManagement/v1/limstestentrustds/queryLimsTestEntrustDPage', { object: { entrId: planId }, pageIndex: this.page2.pageNum, pageSize: this.page2.pageSize }, { individualType: 'json' }).then(res => {
  651. this.dataLoading2 = false;
  652. this.table.list2 = res.data.list;
  653. this.table.list2.forEach(item => {
  654. item.validFlag1 = item.validFlag === '0' ? '无效' : item.validFlag === '1' ? '有效' : ''
  655. })
  656. this.page2.totalPage = res.data.total;
  657. }).catch(e => {
  658. this.dataLoading2 = false;
  659. });
  660. },
  661. reset() {
  662. let _this = this;
  663. _this.search.times = [this.getYNM(new Date()), this.getYNM(new Date())]
  664. _this.search.planCompanyNo = '';
  665. _this.search.matName = '';
  666. _this.searchData();
  667. },
  668. handleSelectionChange(val) {
  669. this.multipleSelection3 = val;
  670. },
  671. ylHandleSelectionChange(val) {
  672. this.ylMultipleSelection3 = val;
  673. },
  674. pageSizeChange(size) {
  675. this.page.pageSize = size;
  676. this.mainData();
  677. },
  678. pageCurrentChange(index) {
  679. this.page.pageNum = index;
  680. this.mainData();
  681. },
  682. ylPageSizeChange(size) {
  683. this.page3.pageSize = size;
  684. this.ylMainData();
  685. },
  686. ylPageCurrentChange(index) {
  687. this.page3.pageNum = index;
  688. this.ylMainData();
  689. },
  690. handleSelectionChange2(val) {
  691. this.multipleSelection4 = val;
  692. },
  693. pageSizeChange2(size) {
  694. this.page2.pageSize = size;
  695. this.depData(this.planId);
  696. },
  697. pageCurrentChange2(index) {
  698. this.page2.pageNum = index;
  699. this.depData(this.planId);
  700. },
  701. addScreen() {
  702. this.$nextTick(() => {
  703. let ss = document.createElement('div');
  704. ss.innerHTML = '筛选';
  705. ss.style = 'text-align: center;'
  706. this.$refs.dataTable.$el.getElementsByClassName('el-table__fixed')[0].getElementsByTagName('td')[0].appendChild(ss);
  707. });
  708. },
  709. addScreen2() {
  710. this.$nextTick(() => {
  711. let ss = document.createElement('div');
  712. ss.innerHTML = '筛选';
  713. ss.style = 'text-align: center;'
  714. this.$refs.dataTable2.$el.getElementsByClassName('el-table__fixed')[0].getElementsByTagName('td')[0].appendChild(ss);
  715. });
  716. },
  717. tableRowClassName({
  718. row, column, rowIndex, columnIndex
  719. }) {
  720. if (columnIndex === 13) {
  721. if (row.validFlag !== '1') {
  722. return 'error-row';
  723. }
  724. }
  725. if (columnIndex === 2) {
  726. if (row.stateFlag === '1') {
  727. return 'error-green';
  728. }
  729. return '';
  730. }
  731. },
  732. tableRowClassName2({
  733. row, column, rowIndex, columnIndex
  734. }) {
  735. if (columnIndex === 5) {
  736. if (row.validFlag !== '1') {
  737. return 'error-row';
  738. }
  739. return '';
  740. }
  741. },
  742. tableHeaderCellStyle() {
  743. return 'color: rgb(255,255,255);border-bottom: 1px solid #DCDFE7;'
  744. }
  745. }
  746. }
  747. </script>
  748. <style scoped></style>