index.vue 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202
  1. <template>
  2. <div>
  3. <el-card class="box-card" style="height: calc(100vh - 92px);">
  4. <div slot="header" style="height: 20px;">
  5. <span style="float: left;">
  6. <i class="icon icon-table2"></i>
  7. </span>
  8. <el-breadcrumb class="heading" style="float: left; margin-left: 5px">
  9. <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
  10. <el-breadcrumb-item>待复存样本</el-breadcrumb-item>
  11. </el-breadcrumb>
  12. <span style="float: right;">
  13. <el-dropdown split-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @command="handleExportsamplesCommand">
  14. 导出
  15. <el-dropdown-menu slot="dropdown">
  16. <el-dropdown-item style="color:black;" command="exportchosen">导出所选样本</el-dropdown-item>
  17. <el-dropdown-item style="color:black;" command="exportpage">导出当前页样本</el-dropdown-item>
  18. <el-dropdown-item style="color:black;" command="exportall">导出所有样本</el-dropdown-item>
  19. </el-dropdown-menu>
  20. </el-dropdown>
  21. <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="batchprint">打印</el-button>
  22. <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="batchsave">复存</el-button>
  23. <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="columndialogVisible = true">显示列</el-button>
  24. </span>
  25. <el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
  26. <el-form-item label="样本条码">
  27. <el-input size="mini" style="width: 165px;" v-model="BarCode" placeholder="请输入样本条码"></el-input>
  28. </el-form-item>
  29. <el-form-item>
  30. <el-dropdown split-button type="primary" size="mini" @click="seachdata" @command="handleSearchCommand">
  31. 查询
  32. <el-dropdown-menu slot="dropdown">
  33. <el-dropdown-item command="search">高级查询</el-dropdown-item>
  34. <el-dropdown-item command="clear">查询重置</el-dropdown-item>
  35. <el-dropdown-item style="color:black;" v-for="item in searchTemplates" :key="item.Name" :command="item.Name">{{item.Name}}</el-dropdown-item>
  36. <el-dropdown-item divided style="color:black;" command="编辑">自定义</el-dropdown-item>
  37. </el-dropdown-menu>
  38. </el-dropdown>
  39. </el-form-item>
  40. </el-form>
  41. </div>
  42. <el-table ref="multipleTable" :data="list" bordertooltip-effect="dark" border height="calc(100vh - 230px)" style="width: 100%;"
  43. @selection-change="handleSelectionChange" @header-dragend="header_dragend">
  44. <el-table-column type="selection" width="55"></el-table-column>
  45. <el-table-column label="操作" width="80" align="center" fixed>
  46. <template slot-scope="scope">
  47. <router-link :to="'/samples/waitingstore/'+scope.row.EquipmentId+'_'+scope.row.Id+'_'+scope.row.Capacity+'_'+scope.row.SampleCode+'_'+scope.row.BarCode+'_'+scope.row.SampleType+'_'+scope.row.Unit+'/unsave?pname=samples-waitingstore&size='+size+'&currentPage='+currentPage"
  48. v-if="scope.row.IState === 6">
  49. <el-button size="small" type="text" title="复存">
  50. <i class="icon icon-loop"></i>
  51. </el-button>
  52. </router-link>
  53. <router-link :to="'/samples/waitingstore/'+scope.row.EquipmentId+'_'+scope.row.Id+'_'+scope.row.Capacity+'_'+scope.row.SampleCode+'_'+scope.row.BarCode+'_'+scope.row.SampleType+'_'+scope.row.Unit+'_'+scope.row.ShelfId+'_'+scope.row.BoxId+'_'+scope.row.Position + '/unsave?pname=samples-waitingstore&size='+size+'&currentPage='+currentPage"
  54. v-else>
  55. <el-button size="small" type="text" title="复存">
  56. <i class="icon icon-loop"></i>
  57. </el-button>
  58. </router-link>
  59. <router-link :to="'/samples/waitingstore/'+scope.row.Id + '/detailed?pname=samples-waitingstore&size='+size+'&currentPage='+currentPage">
  60. <el-button type="text" size="small" title="详情" style="margin-left:3px;">
  61. <i class="icon icon-eye"></i>
  62. </el-button>
  63. </router-link>
  64. </template>
  65. </el-table-column>
  66. <el-table-column :label="item.name" :key="item.name" v-if="item.show" v-for="item in showcolumn" :width="item.columnwidth"
  67. align="center" show-overflow-tooltip>
  68. <template slot-scope="scope">
  69. <template v-if="item.filed === 'SourceName'">
  70. <router-link :to="'/biobank/source/'+ scope.row.SourceId + '/sourcedetail?pname=samples-prerecorded&size='+size+'&currentPage='+currentPage"
  71. :style="{color: scope.row.FamilyState === 0 ? 'blue' : 'red'}">
  72. {{scope.row.SourceName}}
  73. </router-link>
  74. </template>
  75. <template v-else-if="item.filed === 'ValidityDate' || item.filed === 'ReceiveDate'">
  76. {{jstimehandle(scope.row[item.filed])}}
  77. </template>
  78. <template v-else-if="item.filed === 'SurveyDate'">
  79. {{Jstimehandle(scope.row[item.filed])}}
  80. </template>
  81. <!-- <template v-else-if="item.filed === 'Location'">
  82. <router-link :to="'/equipment/'+scope.row.EquipmentId +'/manage_new' + getstationurl(scope.row)">
  83. {{scope.row.ECode}}-{{numtoupchar(scope.row.ShelfY)}}{{scope.row.ShelfX}}-{{numtoupchar(scope.row.BoxY)}}{{scope.row.BoxX}}-{{postiontoupchar(scope.row.Position)}}
  84. </router-link>
  85. </template> -->
  86. <template v-else>
  87. {{scope.row[item.filed]}}
  88. </template>
  89. </template>
  90. </el-table-column>
  91. </el-table>
  92. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
  93. :page-sizes="[10, 100, 200, 500]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
  94. </el-pagination>
  95. </el-card>
  96. <el-dialog title="高级查询" :visible.sync="dialogVisible" width="1000px">
  97. <el-form ref="advancedSearchForm" label-width="90px">
  98. <el-row>
  99. <el-col :span="8">
  100. <el-form-item label="样本条码">
  101. <el-input v-model="BarCode" placeholder="请输入样本条码" size="mini" style="width:100%"></el-input>
  102. </el-form-item>
  103. <el-form-item label="样本内码" v-if="acc !='srNA2'">
  104. <el-input v-model="InnerCode" placeholder="请输入样本内码" size="mini" style="width:100%"></el-input>
  105. </el-form-item>
  106. <el-form-item label="样本类型">
  107. <el-select v-model="SampleType" clearable placeholder="请选择" @change="selsampletypeChange" size="mini"
  108. style="width:100%">
  109. <el-option v-for="item in sampletypes" :label="item.Name" :value="item.Id" :key="item.Id"></el-option>
  110. </el-select>
  111. </el-form-item>
  112. <el-form-item label="录入日期">
  113. <el-date-picker v-model="CreateOn" type="daterange" range-separator="至" start-placeholder="开始日期"
  114. end-placeholder="结束日期" size="mini" style="width:100%"></el-date-picker>
  115. </el-form-item>
  116. </el-col>
  117. <el-col :span="8">
  118. <el-form-item label="样本编码">
  119. <el-input v-model="SampleCode" placeholder="请输入样本编码" size="mini" style="width:100%"></el-input>
  120. </el-form-item>
  121. <el-form-item label="名称">
  122. <el-input v-model="Name" placeholder="请输入名称" size="mini" style="width:100%"></el-input>
  123. </el-form-item>
  124. <el-form-item label="特有扩展">
  125. <el-select v-model="STNoteField" placeholder="请选择" size="mini" style="width:100%">
  126. <el-option v-for="item in typetykzlist" :label="item.Name" :value="item.FieldName" :key="item.FieldName"></el-option>
  127. </el-select>
  128. </el-form-item>
  129. </el-col>
  130. <el-col :span="8">
  131. <el-form-item label="样本源名称">
  132. <el-input v-model="SourceName" placeholder="请输入样本源名称" size="mini" style="width:100%"></el-input>
  133. </el-form-item>
  134. <el-form-item label="录入人">
  135. <el-input v-model="CreateBy" placeholder="请输入录入人" size="mini" style="width:100%"></el-input>
  136. </el-form-item>
  137. <el-form-item label="特有检索">
  138. <el-input v-model="Stnotevalue" placeholder="输入检索内容" size="mini" style="width:100%"></el-input>
  139. </el-form-item>
  140. <el-form-item label="所属分组">
  141. <el-input v-model="GroupName" placeholder="输入所属分组" size="mini" style="width:100%"></el-input>
  142. </el-form-item>
  143. </el-col>
  144. </el-row>
  145. </el-form>
  146. <span slot="footer" class="dialog-footer">
  147. <el-button size="mini" @click="dialogVisible = false">取 消</el-button>
  148. <el-button size="mini" type="primary" @click="seachdata">查 询</el-button>
  149. </span>
  150. </el-dialog>
  151. <el-dialog title="选中显示列(拖拽可以实现排序)" :visible.sync="columndialogVisible" top="5vh">
  152. <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange" style="margin-left:15px;">全选</el-checkbox>
  153. <div style="margin: 10px 0;"></div>
  154. <draggable v-model="showcolumn">
  155. <transition-group class="sampshowfiledsort_ul sampshowfiledsort_ul_tags" tag="ul">
  156. <li v-for="item in showcolumn" :key="item.filed">
  157. <el-checkbox v-model="item.show" :label="item.filed" @change="checkedshowall()">{{item.name}}</el-checkbox>
  158. </li>
  159. </transition-group>
  160. </draggable>
  161. <div slot="footer" class="dialog-footer">
  162. <el-button @click="columndialogVisible = false">取 消</el-button>
  163. <el-button type="primary" @click="saveshowfiled()">确 定</el-button>
  164. </div>
  165. </el-dialog>
  166. <!-- <el-dialog title="自定义搜索" :visible.sync="searchDialogVisible" width="1000px" top="5vh">
  167. <el-form ref="form" inline label-width="120px">
  168. <el-row :gutter="0">
  169. <el-col :span="10">
  170. <el-form-item label="自定义搜索名称">
  171. <el-input v-model="searchTemplateName" placeholder="请输入自定义名称" style="width:80%">
  172. </el-input>
  173. </el-form-item>
  174. </el-col>
  175. <el-col :span="2">
  176. <el-button @click="addSearchTab(searchTemplateName)">添加</el-button>
  177. </el-col>
  178. </el-row>
  179. </el-form>
  180. <el-row :gutter="0">
  181. <el-col :span="5">
  182. <div class="searchDialogLeftStyle">
  183. <el-tag v-for="tag in searchTemplates" :id="tag.Name" :key="tag.Name" closable class="reporttag reportselect"
  184. :onclick="'clickmodeltypetag(' + tag.Name + ')'" style="display:block;text-align:center;color:white;"
  185. @close="removeSearchTab(tag.Name)">
  186. <i class="el-icon-caret-right" v-if="tag.Name == currentSearchTemplateName"></i>
  187. {{tag.Name}}
  188. </el-tag>
  189. </div>
  190. </el-col>
  191. <el-col :span="19">
  192. <div class="searchDialogRightStyle">
  193. <el-form ref="form" inline label-width="0px">
  194. <el-row style="margin-top:10px;">
  195. <el-col :span="24" style="margin-left:10px;">{{">> "+currentSearchTemplateName}}</el-col>
  196. </el-row>
  197. <el-row style="margin-top:10px;margin-bottom:10px;">
  198. <el-col class="line" :span="24" style="background-color:lightgrey; line-height: 2px;">&nbsp;</el-col>
  199. </el-row>
  200. <el-row :gutter="1">
  201. <el-col :span="5">
  202. <el-select v-model="searchField" @change="changeSearchField()" placeholder="请选择" style="margin-left:5px;margin-right:5px;">
  203. <el-option v-for="item in searchcolumn" :key="item.field" :label="item.name" :value="item.filed"></el-option>
  204. </el-select>
  205. </el-col>
  206. <el-col :span="8">
  207. <el-input v-if="searchField == 'BarCode'" v-model="searchValue.BarCode" placeholder="请输入样本条码" style="margin-left:5px;display:inline-block;"></el-input>
  208. <el-input v-else-if="searchField == 'SampleCode'" v-model="searchValue.SampleCode" placeholder="请输入样本编码"></el-input>
  209. <el-input v-else-if="searchField == 'SourceName'" v-model="searchValue.SourceName" placeholder="请输入身份证号或姓名"></el-input>
  210. <el-input v-else-if="searchField == 'InnerCode'" v-model="searchValue.InnerCode" placeholder="请输入样本内码"></el-input>
  211. <el-input v-else-if="searchField == 'Name'" v-model="searchValue.Name" placeholder="请输入名称"></el-input>
  212. <el-input v-else-if="searchField == 'CreateBy'" v-model="searchValue.CreateBy" placeholder="请输入录入人"></el-input>
  213. <el-input v-else-if="searchField == 'GroupName'" v-model="searchValue.GroupName" placeholder="请输入所属分组"></el-input>
  214. <el-date-picker v-else-if="searchField == 'ReceiveDate'" v-model="searchValue.CreateOn" type="daterange"
  215. range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width:100%"></el-date-picker>
  216. <el-select v-else-if="searchField == 'SampleTypeName'" v-model="searchValue.SampleType" clearable
  217. placeholder="请选择" @change="selsampletypeChange" style="width:100%">
  218. <el-option v-for="item in sampletypes" :key="item.Id" :label="item.Name" :value="item.Name"></el-option>
  219. </el-select>
  220. <el-date-picker v-else-if="searchField == 'ValidityDate'" v-model="searchValue.Validity" type="daterange"
  221. range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width:100%">
  222. </el-date-picker>
  223. <el-input v-else-if="searchField == 'Capacity'" v-model="searchValue.Capacity" placeholder="请输入容量"></el-input>
  224. <el-input v-else-if="searchField == 'Location'" v-model="searchValue.Location" placeholder=" 请输入存储位置"></el-input>
  225. <el-input v-else v-model="searchValue.Extension" placeholder="" style="margin-left:5px;display:inline-block;"></el-input>
  226. </el-col>
  227. <el-col :span="3">
  228. <el-select v-model="orAnd" placeholder="请选择" style="margin-left:15px;">
  229. <el-option v-for="item in orAndData" :key="item.value" :label="item.name" :value="item.value"></el-option>
  230. </el-select>
  231. </el-col>
  232. <el-col :span="3">
  233. <el-button type="primary" size="middle" style="margin-left:5px;display:inline-block;" @click="addSearchField">添加</el-button>
  234. </el-col>
  235. <el-col :span="5">
  236. <el-button type="primary" size="middle" style="display:inline-block;" @click="saveAndSearchWithTemplate">查询</el-button>
  237. <el-button type="primary" size="middle" style="display:inline-block;" @click="saveSearchTemplate">保存</el-button>
  238. </el-col>
  239. </el-row>
  240. <el-row style="margin-top:10px;">
  241. <el-col class="line" :span="24" style="background-color:lightgrey; line-height: 2px;">&nbsp;</el-col>
  242. </el-row>
  243. <el-row>
  244. <el-table :data="searchTableData" border style="width: 100%">
  245. <el-table-column prop="Name" label="检索名称" show-overflow-tooltip>
  246. </el-table-column>
  247. <el-table-column prop="Value" label="数值范围" width="300px" show-overflow-tooltip>
  248. </el-table-column>
  249. <el-table-column prop="Guanxi" label="查询关系" show-overflow-tooltip>
  250. </el-table-column>
  251. <el-table-column prop="Operate" label="操作" show-overflow-tooltip>
  252. <template slot-scope="scope">
  253. <el-button @click="deleteSearchField(scope.row)" type="text" size="small">删除</el-button>
  254. </template>
  255. </el-table-column>
  256. </el-table>
  257. </el-row>
  258. </el-form>
  259. </div>
  260. </el-col>
  261. </el-row>
  262. </el-dialog>-->
  263. <!-- 自定义查询 -->
  264. <samplesearchdialog @close="closeDialog"
  265. ref="samplesearchdialog"></samplesearchdialog>
  266. </div>
  267. </template>
  268. <script>
  269. import store from 'store'
  270. import {
  271. mapGetters
  272. } from 'vuex'
  273. import draggable from 'vuedraggable'
  274. import samplesearchdialog from '../../../components/samples/samplesearchdialog'
  275. export default {
  276. name: 'samplesunsave',
  277. computed: mapGetters({
  278. authUser: 'authUser'
  279. }),
  280. components: {
  281. draggable,
  282. samplesearchdialog
  283. },
  284. data () {
  285. return {
  286. dialogVisible: false,
  287. currentItemCount: 0, // 当前页显示数量
  288. currentPage: 1, // 当前页
  289. size: 200, // 每页显示数量
  290. list: [], // table显示数据集
  291. BarCode: '', // 样本条码
  292. SampleCode: '', // 样本编码
  293. SampleType: '', // 样本类型
  294. Stnotevalue: '', // 特有扩展检索值
  295. STNoteField: [], // 特有扩展名称
  296. CreateBy: '', // 录入人
  297. CreateOn: [], // 录入时期
  298. GroupName: '', // 所属分组
  299. Name: '', // 名称
  300. SourceName: '', // 样本来源
  301. InnerCode: '', // 样本内码
  302. dialogFormVisible: false, // 添加弹框是否显示
  303. showquerydiv: false,
  304. sampletypes: [], // 样本类型
  305. // 新增
  306. typetykzlist: [], // 特有扩展
  307. multipleSelection: [], // 多选框
  308. showcolumn: [], // 显示列
  309. cachecols: [],
  310. columndialogVisible: false, // 自定义显示列弹框
  311. isIndeterminate: false,
  312. checkAll: true,
  313. searchDialogVisible: false, // 自定义搜索弹框
  314. searchTemplateName: '自定义搜索1',
  315. searchTemplates: [],
  316. currentSearchTemplateName: '',
  317. searchField: 'BarCode',
  318. searchValue: {
  319. BarCode: '',
  320. SampleCode: '',
  321. SourceName: '',
  322. InnerCode: '',
  323. Name: '',
  324. CreateBy: '',
  325. SampleType: '',
  326. Validity: [],
  327. Capacity: '',
  328. Location: '',
  329. Extension: '',
  330. GroupName: '' // 所属分组
  331. },
  332. orAnd: 'and',
  333. orAndData: [{
  334. name: '并且',
  335. value: 'and'
  336. },
  337. {
  338. name: '或者',
  339. value: 'or'
  340. }
  341. ],
  342. searchTableData: [],
  343. searchcolumn: [], // 搜索列
  344. currentSearchTemplate: '',
  345. acc: ''
  346. }
  347. },
  348. created () {
  349. this.acc = this.authUser.Profile.AccCode
  350. if (this.$route.query.size && this.$route.query.currentPage) {
  351. this.size = parseInt(this.$route.query.size)
  352. this.currentPage = parseInt(this.$route.query.currentPage)
  353. let searchmodel = store.get('samplewaitstoreseach')
  354. if (typeof (searchmodel) !== 'undefined') {
  355. if (searchmodel.BarCode && searchmodel.BarCode !== '') { // 样本条码
  356. this.BarCode = searchmodel.BarCode
  357. }
  358. if (searchmodel.SampleCode && searchmodel.SampleCode !== '') { // 样本编码
  359. this.SampleCode = searchmodel.SampleCode
  360. }
  361. if (searchmodel.SourceName && searchmodel.SourceName !== '') { // 样本来源
  362. this.SourceName = searchmodel.SourceName
  363. }
  364. if (searchmodel.InnerCode && searchmodel.InnerCode !== '') { // 样本内码
  365. this.InnerCode = searchmodel.InnerCode
  366. }
  367. if (searchmodel.Name && searchmodel.Name !== '') { // 名称
  368. this.Name = searchmodel.Name
  369. }
  370. if (searchmodel.CreateBy && searchmodel.CreateBy !== '') { // 录入人
  371. this.CreateBy = searchmodel.CreateBy
  372. }
  373. if (searchmodel.CreateOn && searchmodel.CreateOn.length === 2) { // 录入日期
  374. this.CreateOn = [new Date(searchmodel.CreateOn[0]), new Date(searchmodel.CreateOn[1])]
  375. }
  376. if (searchmodel.SampleType && searchmodel.SampleType !== '') { // 样本类型
  377. this.SampleType = searchmodel.SampleType
  378. this.searchsampletypeChange()
  379. }
  380. if (searchmodel.STNoteField && searchmodel.STNoteField.length > 0) { // 特有扩展
  381. this.STNoteField = searchmodel.STNoteField
  382. }
  383. if (searchmodel.Stnotevalue && searchmodel.Stnotevalue !== '') { // 特有检索内容
  384. this.Stnotevalue = searchmodel.Stnotevalue
  385. }
  386. if (searchmodel.Validity && searchmodel.Validity.length === 2) { // 有效日期
  387. this.Validity = [new Date(searchmodel.Validity[0]), new Date(searchmodel.Validity[1])]
  388. }
  389. if (searchmodel.GroupName && searchmodel.GroupName !== '') { // 所属分组
  390. this.GroupName = searchmodel.GroupName
  391. }
  392. }
  393. } else {
  394. store.set('samplewaitstoreseach', '')
  395. }
  396. this.cachecols = store.get('samplewaitstoreshowcolumn')
  397. // 当前显示列无数据,使用已录入样本显示列数据
  398. if (!(this.cachecols && this.cachecols !== '')) {
  399. this.cachecols = store.get('sapminputshowcolumn')
  400. }
  401. if (this.cachecols && this.cachecols !== '') {
  402. this.showcolumn = this.cachecols
  403. } else {
  404. this.showcolumn = [{
  405. filed: 'BarCode',
  406. name: '样本条码',
  407. show: true,
  408. kuoz: false
  409. }, {
  410. filed: 'SampleCode',
  411. name: '样本编码',
  412. show: true,
  413. kuoz: false
  414. }, {
  415. filed: 'SourceName',
  416. name: '样本来源',
  417. show: true,
  418. kuoz: false
  419. }, {
  420. filed: 'Genus',
  421. name: '蜂种名称',
  422. show: true,
  423. kuoz: false
  424. }, {
  425. filed: 'AddressName',
  426. name: '取样地区',
  427. show: true,
  428. kuoz: false
  429. }, {
  430. filed: 'SurveyDate',
  431. name: '采样日期',
  432. show: true,
  433. kuoz: false
  434. }, {
  435. filed: 'Name',
  436. name: '名称',
  437. show: true,
  438. kuoz: false
  439. }, {
  440. filed: 'SampleTypeName',
  441. name: '样本类型',
  442. show: true,
  443. kuoz: false
  444. }, {
  445. filed: 'Capacity',
  446. name: '可用容量',
  447. show: true,
  448. kuoz: false
  449. }, {
  450. filed: 'InnerCode',
  451. name: '样本内码',
  452. show: true,
  453. kuoz: false
  454. }, {
  455. filed: 'ValidityDate',
  456. name: '有效日期',
  457. show: true,
  458. kuoz: false
  459. }, {
  460. filed: 'ReceiveDate',
  461. name: '接收日期',
  462. show: true,
  463. kuoz: false
  464. }, {
  465. filed: 'CreateBy',
  466. name: '录入人',
  467. show: true,
  468. kuoz: false
  469. }, {
  470. filed: 'GroupName',
  471. name: '所属分组',
  472. show: true,
  473. kuoz: false
  474. }]
  475. }
  476. this.getextends()
  477. this.checkedshowall()
  478. this.getAllSearchTab()
  479. },
  480. mounted () {
  481. let _this = this
  482. window.clickmodeltypetag = function (val, e) {
  483. _this.clickmodeltypetag(val)
  484. }
  485. },
  486. methods: {
  487. initData () {
  488. this.currentSearchTemplate = ''
  489. let _this = this
  490. let params = {
  491. _currentPage: this.currentPage,
  492. _size: this.size,
  493. BarCode: this.BarCode,
  494. SampleCode: this.SampleCode,
  495. SampleType: this.SampleType,
  496. Stnotevalue: this.Stnotevalue,
  497. STNoteField: this.STNoteField,
  498. Noteitemvalue: this.Noteitemvalue,
  499. Noteitem: this.Noteitem,
  500. CreateBy: this.CreateBy,
  501. SourceName: this.SourceName,
  502. Name: this.Name,
  503. Validity: this.Validity,
  504. CreateOn: this.CreateOn,
  505. InnerCode: this.InnerCode,
  506. GroupName: _this.GroupName
  507. }
  508. if (this.CreateOn && this.CreateOn.length === 2) {
  509. let params2 = {
  510. CreateOnstart: this.CreateOn[0] / 1000,
  511. CreateOnend: this.CreateOn[1] / 1000
  512. }
  513. params = Object.assign(params, params2)
  514. }
  515. // 返回时保存查找内容
  516. store.set('samplewaitstoreseach', params)
  517. this.$axios.get('/samplesunsave/animallist', {
  518. params
  519. })
  520. .then(res => {
  521. _this.list = res.data.items
  522. _this.currentItemCount = res.data.currentItemCount
  523. })
  524. .catch(err => {
  525. console.error(err)
  526. })
  527. },
  528. // 根据子code获取所有父code
  529. getparentcodebytopcode (v) {
  530. let _this = this
  531. _this.$axios.get('/sampleorgan/getparentcodebytopcode/' + v, {})
  532. .then(res => {
  533. _this.selectedzuzhi = []
  534. let pidarr = res.data.split(',')
  535. for (var i = pidarr.length - 1; i >= 0; i--) {
  536. if (pidarr[i] !== '0') {
  537. _this.selectedzuzhi.push(pidarr[i])
  538. }
  539. }
  540. _this.searchzuzhitreehandleChange()
  541. })
  542. },
  543. getextends () {
  544. let _this = this
  545. this.$axios.get('/sampleinput/getsampletype', {
  546. _currentPage: -1
  547. })
  548. .then(res => {
  549. _this.sampletypes = res.data.items
  550. if (store.get('samplewaitstoreseach').searchWithTemplate && store.get('samplewaitstoreseach').searchWithTemplate !==
  551. '') { // 自定义查询
  552. this.handleSearchCommand(store.get('samplewaitstoreseach').searchWithTemplate)
  553. } else {
  554. this.initData()
  555. }
  556. }).catch(() => {})
  557. },
  558. seachdata () {
  559. this.currentPage = 1
  560. this.initData()
  561. },
  562. selsampletypeChange () {
  563. // 获取特有扩展
  564. let _this = this
  565. if (_this.SampleType !== '') {
  566. _this.$axios.get('/sampletype/gettykzzd?SampleType=' + _this.SampleType, {})
  567. .then(res => {
  568. _this.STNoteField = []
  569. _this.typetykzlist = res.data
  570. })
  571. }
  572. },
  573. // 返回查询条件执行
  574. searchsampletypeChange () {
  575. // 获取特有扩展
  576. let _this = this
  577. if (_this.SampleType !== '') {
  578. _this.$axios.get('/sampletype/gettykzzd?SampleType=' + _this.SampleType, {})
  579. .then(res => {
  580. _this.typetykzlist = res.data
  581. })
  582. }
  583. },
  584. // ---------------------------------------------------
  585. // 自定义显示列
  586. checkedshowall () {
  587. let tc = 0
  588. for (var i = 0; i < this.showcolumn.length; i++) {
  589. if (this.showcolumn[i].show) {
  590. tc++
  591. }
  592. }
  593. if (tc > 0 && tc < this.showcolumn.length) {
  594. this.isIndeterminate = true
  595. this.checkAll = false
  596. } else {
  597. this.isIndeterminate = false
  598. if (tc === 0) {
  599. this.checkAll = false
  600. } else {
  601. this.checkAll = true
  602. }
  603. }
  604. },
  605. handleCheckAllChange (val) {
  606. for (var i = 0; i < this.showcolumn.length; i++) {
  607. this.showcolumn[i].show = val
  608. }
  609. },
  610. // 自定义显示列保存操作
  611. saveshowfiled () {
  612. store.set('samplewaitstoreshowcolumn', this.showcolumn)
  613. this.columndialogVisible = false
  614. this.$message({
  615. type: 'success',
  616. message: '自定义显示列设置成功'
  617. })
  618. this.initData()
  619. },
  620. header_dragend (newWidth, oldWidth, column, event) {
  621. for (var i = 0; i < this.showcolumn.length; i++) {
  622. if (this.showcolumn[i].name === column.label) {
  623. this.showcolumn[i].columnwidth = newWidth
  624. store.set('samplewaitstoreshowcolumn', this.showcolumn)
  625. return
  626. }
  627. }
  628. },
  629. // ----------------------------------------------------------------
  630. // 自定义查询
  631. handleSearchCommand (command) {
  632. if (command == 'search') {
  633. this.dialogVisible = true
  634. } else if (command == 'clear') {
  635. this.clearSearch()
  636. } else if (command == '编辑') {
  637. /* this.searchDialogVisible = true
  638. this.searchcolumn = this.showcolumn.filter(function (e) {
  639. return e.filed != "Location"
  640. }) */
  641. this.$refs.samplesearchdialog.creatpage()
  642. this.$refs.samplesearchdialog.samplesearchdialogVisable = true
  643. } else {
  644. this.currentSearchTemplate = command
  645. let searchmodel = {
  646. searchWithTemplate: command
  647. }
  648. store.set('samplewaitstoreseach', searchmodel)
  649. this.searchWithTemplate(command)
  650. }
  651. },
  652. // 添加自定义搜索
  653. addSearchTab (name) {
  654. for (let i = 0; i < this.searchTemplates.length; i++) {
  655. if (this.searchTemplates[i].Name == name) {
  656. this.$message('名称已经存在')
  657. return
  658. }
  659. }
  660. this.searchTemplates.push({
  661. Name: name,
  662. Fields: []
  663. }),
  664. this.currentSearchTemplateName = name
  665. for (let i = 0; i < this.searchTemplates.length; i++) {
  666. if (this.searchTemplates[i].Name == this.currentSearchTemplateName) {
  667. this.searchTableData = this.getSearchTableData(this.searchTemplates[i].Fields)
  668. }
  669. }
  670. },
  671. removeSearchTab (targetName) {
  672. let _this = this
  673. this.$axios.delete('/sampleinput/searchTemplate?name=' + targetName, {})
  674. .then(res => {
  675. if (res.data.code == 0) {
  676. let tabs = _this.searchTemplates
  677. let activeName = _this.currentSearchTemplateName
  678. if (activeName === targetName) {
  679. tabs.forEach((tab, index) => {
  680. if (tab.Name === targetName) {
  681. let nextTab = tabs[index + 1] || tabs[index - 1]
  682. if (nextTab) {
  683. activeName = nextTab.Name
  684. _this.searchTableData = this.getSearchTableData(nextTab.Fields)
  685. }
  686. }
  687. })
  688. }
  689. _this.currentSearchTemplateName = activeName
  690. _this.searchTemplates = tabs.filter(tab => tab.Name !== targetName)
  691. } else {
  692. _this.$message({
  693. type: 'warning',
  694. message: res.data.message
  695. })
  696. }
  697. })
  698. .catch(err => {
  699. console.error(err)
  700. })
  701. },
  702. // 添加自定义搜索详情
  703. addSearchField () {
  704. let searchValue
  705. for (let k in this.searchValue) {
  706. if (typeof this.searchValue[k] === 'number') {
  707. searchValue = this.searchValue[k]
  708. break
  709. } else if (this.searchValue[k] && this.searchValue[k].length > 0) {
  710. searchValue = this.searchValue[k]
  711. break
  712. }
  713. }
  714. if (!searchValue) {
  715. this.$message('请输入检索数值或范围')
  716. return
  717. }
  718. let s = ''
  719. if (searchValue instanceof Array && searchValue.length > 0) {
  720. if (searchValue[0] instanceof Date) {
  721. let arr = []
  722. for (let j = 0; j < searchValue.length; j++) {
  723. arr.push(this.formatDateTime(searchValue[j]))
  724. }
  725. s = arr.join('--')
  726. } else {
  727. s = searchValue[searchValue.length - 1]
  728. }
  729. } else {
  730. s = searchValue
  731. }
  732. for (let i = 0; i < this.searchTemplates.length; i++) {
  733. if (this.searchTemplates[i].Name == this.currentSearchTemplateName) {
  734. for (let index in this.searchTemplates[i].Fields) {
  735. let field = this.searchTemplates[i].Fields[index]
  736. if (field.Field == this.searchField && field.Value == this.searchValue && field.OrAnd == this.orAnd) {
  737. this.$message('此查询条件已经存在')
  738. return
  739. }
  740. }
  741. this.searchTemplates[i].Fields.push({
  742. Field: this.searchField,
  743. Value: s + '',
  744. OrAnd: this.orAnd,
  745. Name: this.getFieldName(this.searchField)
  746. })
  747. this.searchTableData = this.getSearchTableData(this.searchTemplates[i].Fields)
  748. break
  749. }
  750. }
  751. },
  752. // 查询自定义搜索详情
  753. saveAndSearchWithTemplate () {
  754. let _this = this
  755. this.saveSearchTemplate(function () {
  756. _this.currentSearchTemplate = _this.currentSearchTemplateName
  757. _this.searchWithTemplate(_this.currentSearchTemplateName)
  758. })
  759. },
  760. // 保存自定义搜索详情
  761. saveSearchTemplate (cb) {
  762. let _this = this
  763. let template = JSON.stringify(this.searchTableData)
  764. this.$axios.put('/sampleinput/searchTemplate?name=' + this.currentSearchTemplateName, template)
  765. .then(res => {
  766. if (res.data.code == 0) {
  767. _this.$message({
  768. type: 'success',
  769. message: res.data.message
  770. })
  771. if (cb) {
  772. cb()
  773. }
  774. } else {
  775. _this.$message({
  776. type: 'warning',
  777. message: res.data.message
  778. })
  779. }
  780. })
  781. .catch(err => {
  782. console.error(err)
  783. })
  784. },
  785. deleteSearchField (v) {
  786. if (v.Name) {
  787. for (let i = 0; i < this.searchTemplates.length; i++) {
  788. if (this.searchTemplates[i].Name == this.currentSearchTemplateName) {
  789. this.searchTemplates[i].Fields = this.searchTemplates[i].Fields.filter(function (ele) {
  790. return !(ele.Value == v.Value && ele.Field == v.Field && ele.OrAnd == v.OrAnd)
  791. })
  792. this.searchTableData = this.getSearchTableData(this.searchTemplates[i].Fields)
  793. break
  794. }
  795. }
  796. }
  797. },
  798. // 关闭自定义查询
  799. closeDialog () {
  800. this.getAllSearchTab()
  801. },
  802. searchWithTemplate (name) {
  803. console.log(name)
  804. this.searchDialogVisible = false
  805. let params = {
  806. _currentPage: this.currentPage,
  807. _size: this.size
  808. }
  809. let _this = this
  810. this.$axios.get('/samplesunsave/search?name=' + name, {
  811. params
  812. })
  813. .then(res => {
  814. console.log(res.data.items)
  815. if (res.data.items) {
  816. _this.list = res.data.items
  817. _this.currentItemCount = res.data.currentItemCount
  818. }
  819. })
  820. .catch(err => {
  821. console.error(err)
  822. })
  823. },
  824. getSearchTableData (searchFields) {
  825. let data = searchFields.map(function (ele) {
  826. if (ele['OrAnd'] == 'or') {
  827. ele['Guanxi'] = '或者'
  828. } else {
  829. ele['Guanxi'] = '并且'
  830. }
  831. return ele
  832. })
  833. return data || []
  834. },
  835. clickmodeltypetag (val) {
  836. this.currentSearchTemplateName = val.getAttribute('id')
  837. for (let i = 0; i < this.searchTemplates.length; i++) {
  838. if (this.searchTemplates[i].Name == this.currentSearchTemplateName) {
  839. this.searchTableData = this.getSearchTableData(this.searchTemplates[i].Fields)
  840. }
  841. }
  842. },
  843. getAllSearchTab () {
  844. let _this = this
  845. this.$axios.get('/sampleinput/searchTemplate', {})
  846. .then(res => {
  847. if (res.data && res.data.items && res.data.items.length > 0) {
  848. _this.searchTemplates = res.data.items.map(function (e) {
  849. e.Fields = JSON.parse(e.Template)
  850. return e
  851. })
  852. _this.currentSearchTemplateName = _this.searchTemplates[0].Name
  853. _this.searchTableData = this.getSearchTableData(this.searchTemplates[0].Fields)
  854. } else {
  855. // _this.$message({
  856. // type: 'warning',
  857. // message: res.data.message,
  858. // })
  859. }
  860. })
  861. .catch(err => {
  862. console.error(err)
  863. })
  864. },
  865. changeSearchField (val) {
  866. this.searchValue = {
  867. BarCode: '',
  868. SampleCode: '',
  869. SourceName: '',
  870. InnerCode: '',
  871. Name: '',
  872. CreateBy: '',
  873. CreateOn: [],
  874. selectedzuzhi: [],
  875. SamplingSite: '',
  876. SampleType: '',
  877. Validity: [],
  878. Capacity: '',
  879. Location: '',
  880. Extension: '',
  881. GroupName: ''
  882. }
  883. },
  884. getFieldName (field) {
  885. for (let i = 0; i < this.showcolumn.length; i++) {
  886. if (this.showcolumn[i].filed == field) {
  887. return this.showcolumn[i].name
  888. }
  889. }
  890. return ''
  891. },
  892. // ----------------------------------------------------------------
  893. // 批量复存
  894. batchsave () {
  895. let _this = this
  896. if (_this.multipleSelection.length < 1) {
  897. _this.$message({
  898. type: 'warning',
  899. message: '请选择要批量复存的样本'
  900. })
  901. return
  902. } else {
  903. let flage = 0
  904. let message = ''
  905. for (let index = 0; index < _this.multipleSelection.length; index++) {
  906. if (_this.multipleSelection[index].IState !== 5) {
  907. message += _this.multipleSelection[index].BarCode + ' '
  908. flage = 1
  909. }
  910. }
  911. if (flage == 1) {
  912. _this.$message({
  913. type: 'warning',
  914. message: '所选样本中包含无位置信息的样本:' + message
  915. })
  916. return
  917. }
  918. }
  919. this.$axios.put('/samplesunsave/batchresample', _this.multipleSelection)
  920. .then(res => {
  921. if (res.data.code == 0) {
  922. _this.$message({
  923. type: 'success',
  924. message: res.data.message
  925. })
  926. } else {
  927. _this.$message({
  928. type: 'warning',
  929. message: res.data.message
  930. })
  931. }
  932. _this.initData()
  933. })
  934. .catch(err => {
  935. console.error(err)
  936. })
  937. },
  938. // 清空查询数据
  939. clearSearch () {
  940. this.BarCode = ''
  941. this.SampleCode = ''
  942. this.SourceName = ''
  943. this.InnerCode = ''
  944. this.Name = ''
  945. this.CreateBy = ''
  946. this.CreateOn = []
  947. this.SampleType = ''
  948. this.STNoteField = ''
  949. this.Stnotevalue = ''
  950. this.Validity = []
  951. this.Noteitem = []
  952. this.Noteitemvalue = ''
  953. this.currentPage = 1
  954. this.GroupName = ''
  955. this.initData()
  956. },
  957. // 导出样本
  958. handleExportsamplesCommand (command) {
  959. let _this = this
  960. if (command == 'exportchosen') { // 导出所选数据
  961. if (_this.multipleSelection.length < 1) {
  962. _this.$message({
  963. type: 'warning',
  964. message: '请选择要导出的样本'
  965. })
  966. return
  967. }
  968. _this.exportsamples('exportchosen')
  969. } else if (command == 'exportpage') { // 导出当前页数据
  970. if (_this.list.length < 1) {
  971. _this.$message({
  972. type: 'warning',
  973. message: '当前页无样本'
  974. })
  975. return
  976. }
  977. _this.exportsamples('exportpage')
  978. } else if (command == 'exportall') { // 导出所有数据
  979. _this.$confirm('此操作将导出所有满足条件的数据!是否继续导出?', '提示', {
  980. confirmButtonText: '确定',
  981. cancelButtonText: '取消',
  982. type: 'info'
  983. }).then(() => {
  984. _this.exportsamples()
  985. }).catch(() => {})
  986. }
  987. },
  988. exportsamples (val) {
  989. let _this = this
  990. // 显示列
  991. let showcolumnarr = []
  992. let showcolumnnamearr = []
  993. let id = ''
  994. for (var i = 0; i < _this.showcolumn.length; i++) {
  995. if (_this.showcolumn[i].show) {
  996. showcolumnarr.push(_this.showcolumn[i].filed)
  997. showcolumnnamearr.push(_this.showcolumn[i].name.replace(/,/g, ','))
  998. }
  999. }
  1000. let params = {
  1001. _currentPage: this.currentPage,
  1002. _size: this.size,
  1003. BarCode: this.BarCode,
  1004. SampleCode: this.SampleCode,
  1005. SampleType: this.SampleType,
  1006. Stnotevalue: this.Stnotevalue,
  1007. STNoteField: this.STNoteField,
  1008. Noteitemvalue: this.Noteitemvalue,
  1009. Noteitem: this.Noteitem,
  1010. CreateBy: this.CreateBy,
  1011. SourceName: this.SourceName,
  1012. Name: this.Name,
  1013. Validity: this.Validity,
  1014. InnerCode: this.InnerCode,
  1015. GroupName: this.GroupName,
  1016. showcolumnarr: showcolumnarr + '',
  1017. showcolumnnamearr: showcolumnnamearr + '',
  1018. ExportFlag: 'waitingstore'
  1019. }
  1020. if (this.CreateOn && this.CreateOn.length === 2) {
  1021. let params2 = {
  1022. CreateOnstart: this.CreateOn[0] / 1000,
  1023. CreateOnend: this.CreateOn[1] / 1000
  1024. }
  1025. params = Object.assign(params, params2)
  1026. }
  1027. if (_this.Validity && _this.Validity.length === 2) {
  1028. let params3 = {
  1029. Validitystart: _this.Validity[0] / 1000,
  1030. Validityend: _this.Validity[1] / 1000
  1031. }
  1032. params = Object.assign(params, params3)
  1033. }
  1034. // 导出所选样本
  1035. if (val == 'exportchosen') {
  1036. for (var i = 0; i < _this.multipleSelection.length; i++) {
  1037. if (i == _this.multipleSelection.length - 1) {
  1038. id += _this.multipleSelection[i].Id
  1039. } else {
  1040. id += _this.multipleSelection[i].Id + ','
  1041. }
  1042. }
  1043. let paramsid = {
  1044. Id: id
  1045. }
  1046. params = Object.assign(params, paramsid)
  1047. }
  1048. // 导出当前页样本
  1049. if (val == 'exportpage') {
  1050. for (var i = 0; i < _this.list.length; i++) {
  1051. if (i == _this.list.length - 1) {
  1052. id += _this.list[i].Id
  1053. } else {
  1054. id += _this.list[i].Id + ','
  1055. }
  1056. }
  1057. let paramsid = {
  1058. Id: id
  1059. }
  1060. params = Object.assign(params, paramsid)
  1061. }
  1062. _this.$axios.get('/sampleinput/exportexcel', {
  1063. params
  1064. })
  1065. .then(res => {
  1066. window.location = 'http://' + res.data
  1067. })
  1068. .catch(err => {
  1069. console.error(err)
  1070. })
  1071. },
  1072. // 样本条码批量打印
  1073. batchprint () {
  1074. let _this = this
  1075. if (_this.multipleSelection.length < 1) {
  1076. _this.$message({
  1077. type: 'warning',
  1078. message: '请选择要批量打印的样本'
  1079. })
  1080. return
  1081. }
  1082. this.$axios.get('/printscheme/getdefaultprintscheme', {})
  1083. .then(res => {
  1084. if (res.data && res.data !== '') {
  1085. let idstring = ''
  1086. for (var i = 0; i < _this.multipleSelection.length; i++) {
  1087. idstring += _this.multipleSelection[i].Id + ';'
  1088. }
  1089. idstring = idstring.substring(0, idstring.length - 1)
  1090. // 执行打印操作
  1091. window.PrintReport(res.data, `animalsamplesbatch,${this.authUser.Profile.AccCode},${idstring}`)
  1092. } else {
  1093. _this.$message({
  1094. type: 'warning',
  1095. message: '未设置默认打印方案,可在"系统设置"-"打印方案"中进行设置!'
  1096. })
  1097. }
  1098. })
  1099. .catch(err => {
  1100. // handle error
  1101. console.error(err)
  1102. })
  1103. },
  1104. handleSizeChange (value) {
  1105. this.size = value
  1106. this.currentPage = 1
  1107. if (this.currentSearchTemplate) {
  1108. this.searchWithTemplate(this.currentSearchTemplate)
  1109. } else {
  1110. this.initData()
  1111. }
  1112. },
  1113. handleCurrentChange (value) {
  1114. this.currentPage = value
  1115. if (this.currentSearchTemplate) {
  1116. this.searchWithTemplate(this.currentSearchTemplate)
  1117. } else {
  1118. this.initData()
  1119. }
  1120. },
  1121. handleSelectionChange (val) {
  1122. this.multipleSelection = val
  1123. },
  1124. handleChange (value) {
  1125. console.log(value)
  1126. },
  1127. jstimehandle (val) {
  1128. if (val === '') {
  1129. return '----'
  1130. } else if (val === '0001-01-01T08:00:00+08:00') {
  1131. return '----'
  1132. } else if (val === '5000-01-01T23:59:59+08:00') {
  1133. return '永久'
  1134. } else {
  1135. val = val.replace('T', ' ')
  1136. return val.substring(0, 19)
  1137. }
  1138. },
  1139. Jstimehandle (val) {
  1140. if (val === '') {
  1141. return '----'
  1142. } else if (val === '0001-01-01T08:00:00+08:00') {
  1143. return '----'
  1144. } else if (val === '5000-01-01T23:59:59+08:00') {
  1145. return '永久'
  1146. } else {
  1147. val = val.replace('T', ' ')
  1148. return val.substring(0, 10)
  1149. }
  1150. }
  1151. }
  1152. }
  1153. </script>
  1154. <style lang="scss">
  1155. .el-pagination {
  1156. margin: 1rem 0 2rem;
  1157. text-align: right;
  1158. }
  1159. .sampshowfiledsort_ul_tags {
  1160. padding-left: 12px;
  1161. margin-top: -5px;
  1162. }
  1163. .sampshowfiledsort_ul_tags:after {
  1164. clear: both;
  1165. content: '';
  1166. display: block;
  1167. }
  1168. .sampshowfiledsort_ul_tags li {
  1169. color: #fff;
  1170. float: left;
  1171. margin: 2px 2px 3px 0;
  1172. padding: 3px 3px;
  1173. min-width: 15px;
  1174. font-size: 16px;
  1175. text-align: center;
  1176. cursor: move;
  1177. transition: all 1s;
  1178. list-style-type: none;
  1179. }
  1180. </style>