resource.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  1. <template>
  2. <div class="resource_info">
  3. <div class="container">
  4. <div class="crumbs">
  5. <div class="container">
  6. <div class="menu-com row">
  7. <div class="menu-title col-md-12">
  8. <a href="/">首页 ></a>
  9. <a href="/supplier">供应商资源 ></a>
  10. <span>供应商物料</span>
  11. </div>
  12. </div>
  13. </div>
  14. </div>
  15. <div class="user_info">
  16. <div class="user_title">
  17. <div class="user_name">
  18. <span>深圳优软科技有限公司 &nbsp;<i class="fa fa-angle-down"></i></span>
  19. <a href="/">进入店铺</a>
  20. </div>
  21. <div class="user_mes">
  22. <div class="mes-list">
  23. <p>
  24. <span><i class="supplier_icon1"></i>企业执照号:155</span>
  25. <span><i class="supplier_icon2"></i> 地址:145</span>
  26. </p>
  27. <p>
  28. <span><i class="supplier_icon3"></i> 邮箱:1</span>
  29. <span><i class="supplier_icon4"></i> 电话:14553</span>
  30. <span><i class="supplier_icon5"></i> 行业:14444</span>
  31. </p>
  32. </div>
  33. </div>
  34. </div>
  35. <div class="search">
  36. <div class="input-group">
  37. <input type="search" class="form-control" placeholder="请输入要查找的内容"
  38. v-model="searchCode" @search="goodsSearch(searchCode)"/>
  39. <span class="input-group-btn">
  40. <button type="button" class="btn" id="search_btn" @click="goodsSearch(searchCode)">
  41. 搜索 <i class="fa fa-search"></i>
  42. </button>
  43. </span>
  44. </div>
  45. </div>
  46. </div>
  47. <div class="info_list">
  48. <table>
  49. <thead>
  50. <tr>
  51. <th width="66">序号</th>
  52. <th width="1008">
  53. <span>原厂型号 / 品牌</span>
  54. <span>类目(名称) / 单位</span>
  55. <span>规格</span>
  56. </th>
  57. <th width="116">操作</th>
  58. </tr>
  59. </thead>
  60. <tbody>
  61. <tr v-for="(item, index) in list.content" @click="jumpDetail(item.id)">
  62. <td v-text="index + 1">12</td>
  63. <td>
  64. <ul class="list-inline">
  65. <li class="item">
  66. <span class="fl">原厂型号</span>
  67. <p v-text="item.cmpCode ? spliceString(item.cmpCode, 95) : '暂无信息'">2</p>
  68. </li>
  69. <li class="item">
  70. <span class="fl">类目(名称)</span>
  71. <p v-text="item.prodName ? spliceString(item.prodName, 95) : '暂无信息'">1</p>
  72. </li>
  73. <li class="item">
  74. <span class="fl">规格</span>
  75. <p v-text="item.spec ? spliceString(item.spec, 95) : '暂无信息'">1</p>
  76. </li>
  77. <li class="item">
  78. <span class="fl">品牌</span>
  79. <p v-text="item.brand ? spliceString(item.brand, 95) : '暂无信息'">2</p>
  80. </li>
  81. <li class="item">
  82. <span class="fl">单位</span>
  83. <p v-text="item.unit ? item.unit : '暂无信息'">1</p>
  84. </li>
  85. </ul>
  86. </td>
  87. <td>
  88. <a @click="hasDialog = true" @mouseleave="hasClick = false" @mouseenter="hasClick = true">立即询价</a>
  89. </td>
  90. </tr>
  91. </tbody>
  92. </table>
  93. <div style="float: right;background: #ecf1f1;">
  94. <page :total="list.totalElements" :page-size="pageParams.count"
  95. :current="pageParams.page" v-on:childEvent="handleCurrentChange">
  96. </page>
  97. </div>
  98. </div>
  99. <el-dialog
  100. title="我要询价"
  101. :visible.sync="hasDialog ">
  102. <div class="form_dialog">
  103. <ul class="list-inline">
  104. <li class="form-item">
  105. <span>型号:</span>
  106. <p>32432</p>
  107. </li>
  108. <li class="form-item">
  109. <span>类目:</span>
  110. <p>3244333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333332</p>
  111. </li>
  112. <li class="form-item">
  113. <span>品牌:</span>
  114. <p>32432</p>
  115. </li>
  116. <li class="form-item">
  117. <span>规格:</span>
  118. <p>32432</p>
  119. </li>
  120. <li class="form-item">
  121. <span><i>*</i>截止日期:</span>
  122. <el-date-picker
  123. v-model="form.name"
  124. type="date"
  125. :picker-options="pickerOptions"
  126. @change="setDeadLineValid"
  127. :editable="false"
  128. :clearable="true"
  129. size="mini">
  130. </el-date-picker>
  131. </li>
  132. <li class="form-item">
  133. <span>封装:</span>
  134. <input type="text" class="form-control" v-model="form.date1"/>
  135. </li>
  136. <li class="form-item">
  137. <span>单价预算:</span>
  138. <select v-model="form.date1" class="form-control" style="width:40px;">
  139. <option value="RMB">¥</option>
  140. <option value="USD">$</option>
  141. </select>
  142. <input type="number" class="form-control"/>
  143. </li>
  144. <li class="form-item">
  145. <span>生产日期:</span>
  146. <el-date-picker
  147. v-model="form.date2"
  148. type="date"
  149. :picker-options="pickerOptions"
  150. @change="setDeadProduction"
  151. :editable="false"
  152. :clearable="true"
  153. size="mini">
  154. </el-date-picker>
  155. </li>
  156. <li class="form-item">
  157. <span>采购数量:</span>
  158. <input type="number" class="form-control"/>
  159. </li>
  160. </ul>
  161. </div>
  162. <span slot="footer" class="dialog-footer">
  163. <a type="button" @click="hasDialog=false">询价提交</a>
  164. </span>
  165. </el-dialog>
  166. </div>
  167. </div>
  168. </template>
  169. <script>
  170. import {spliceStr, formatDate} from '~utils/baseUtils.js'
  171. import Page from '~/components/common/page/pageComponent.vue'
  172. export default {
  173. name: 'ResourceView',
  174. data () {
  175. return {
  176. pickerOptions: {
  177. disabledDate (time) {
  178. // 大于等于今天 小于三个月后
  179. return time.getTime() < Date.now() - 1000 * 60 * 60 * 24 || time.getTime() > Date.now() + 1000 * 60 * 60 * 24 * 30 * 3
  180. }
  181. },
  182. hasDialog: false,
  183. hasClick: false,
  184. form: {
  185. name: '',
  186. region: '',
  187. date1: '',
  188. date2: '',
  189. delivery: false,
  190. type: [],
  191. resource: '',
  192. desc: ''
  193. },
  194. dialogVisible: false,
  195. searchCode: '',
  196. pageParams: {
  197. count: 10,
  198. page: 1
  199. }
  200. }
  201. },
  202. components: {
  203. Page
  204. },
  205. computed: {
  206. list () {
  207. return this.$store.state.supplier.material.material.data
  208. }
  209. },
  210. methods: {
  211. setDeadProduction () {
  212. this.form.name = formatDate(this.form.name, 'yyyy-MM-dd hh:mm:ss')
  213. },
  214. setDeadLineValid: function () {
  215. this.form.date2 = formatDate(this.form.date2, 'yyyy-MM-dd hh:mm:ss')
  216. // this.validObj.deadline = true
  217. },
  218. onSubmit () {
  219. console.log('submit!')
  220. },
  221. spliceString (str, length) {
  222. return spliceStr(str, length)
  223. },
  224. jumpDetail (id) {
  225. if (!this.hasClick) {
  226. this.$router.push(this.$route.path + '/' + id)
  227. }
  228. },
  229. handleCurrentChange (type) {
  230. this.pageParams.page = type
  231. this.$store.dispatch('supplier/loadMaterialList', {page: type, size: 20, vendUU: this.$route.params.uuid})
  232. },
  233. goodsSearch (type) {
  234. if (type) {
  235. this.$store.dispatch('supplier/loadMaterialList', {
  236. page: 1,
  237. size: 20,
  238. vendUU: this.$route.params.uuid,
  239. keyword: type
  240. })
  241. }
  242. }
  243. }
  244. }
  245. </script>
  246. <style type="text/scss" lang="scss">
  247. .resource_info{
  248. background: #ecf1f1;
  249. .el-dialog{
  250. width: 680px!important;
  251. .el-dialog__header{
  252. background: #4290f7;
  253. line-height: 40px;
  254. padding: 0 20px 0;
  255. .el-dialog__title{
  256. color:#fff;
  257. }
  258. .el-dialog__headerbtn:hover .el-dialog__close, .el-dialog__headerbtn:focus .el-dialog__close{
  259. color:#fff;
  260. }
  261. }
  262. .el-dialog__body{
  263. padding: 10px 20px;
  264. }
  265. .el-dialog__footer{
  266. text-align: center;
  267. a{
  268. display:inline-block;
  269. background: #3c7cf5;
  270. color:#fff;
  271. font-size: 14px;
  272. line-height: 30px;
  273. height:30px;
  274. padding:0 10px;
  275. border-radius:5px;
  276. }
  277. }
  278. }
  279. .form_dialog{
  280. ul{
  281. li{
  282. width:50%;
  283. font-size: 14px;
  284. color:#666;
  285. vertical-align: top;
  286. margin-bottom:15px;
  287. &.form-item {
  288. position: relative;
  289. p{
  290. margin:0;
  291. margin-left:80px;
  292. word-break: break-all;
  293. word-wrap: break-word;
  294. }
  295. span {
  296. float:left;
  297. width: 80px;
  298. text-align: right;
  299. display: inline-block;
  300. color:#3c7cf5;
  301. i {
  302. position: relative;
  303. top: 2px;
  304. right: 5px;
  305. color: #e41515;
  306. }
  307. }
  308. ul {
  309. line-height: normal;
  310. position: absolute;
  311. top: 19px;
  312. left: 79px;
  313. background: #fff;
  314. border: 1px solid #b5b5b5;
  315. z-index: 1;
  316. max-height: 120px;
  317. overflow-y: auto;
  318. overflow-x: hidden;
  319. border-radius: 3px;
  320. width: 114px;
  321. font-size: 12px;
  322. li {
  323. height: 24px;
  324. line-height: 24px;
  325. cursor: pointer;
  326. overflow: hidden;
  327. text-overflow: ellipsis;
  328. white-space: nowrap;
  329. padding: 0 5px;
  330. &:hover {
  331. background: #ddd;
  332. }
  333. }
  334. }
  335. select {
  336. width: 40px;
  337. position: absolute;
  338. height: 20px;
  339. background: url('/images/applyPurchase/select.png')no-repeat right;
  340. background-position-x: 23px;
  341. padding: 0 0 0 7px;
  342. border-radius: 0;
  343. & + input {
  344. padding-left: 45px;
  345. }
  346. }
  347. .el-input {
  348. width: 230px;
  349. }
  350. input {
  351. font-size: 14px;
  352. width: 230px;
  353. height: 20px;
  354. line-height: 20px;
  355. border-radius: 2px;
  356. padding: 0 3px;
  357. box-shadow: none;
  358. -webkit-box-shadow: none;
  359. -moz-box-shadow: none;
  360. &.error {
  361. border-color: #f4645f!important;
  362. }
  363. }
  364. }
  365. }
  366. }
  367. }
  368. .crumbs{
  369. background: #ecf1f1;
  370. .menu-com{
  371. margin: 0;
  372. .menu-title{
  373. line-height: 40px;
  374. font-size: 14px;
  375. padding-left: 0;
  376. margin:0;
  377. a{
  378. color: #5078cb;
  379. font-size: 14px;
  380. }
  381. }
  382. }
  383. }
  384. .user_info{
  385. .user_title{
  386. display:inline-block;
  387. position:relative;
  388. padding-bottom:13px;
  389. margin-right:330px;
  390. &:hover{
  391. .user_mes{
  392. display:block;
  393. }
  394. }
  395. .user_name{
  396. span{
  397. font-size: 20px;
  398. color:#666;
  399. font-weight: bold;
  400. margin-right:10px;
  401. }
  402. a{
  403. display:inline-block;
  404. padding:0 10px;
  405. border-radius:3px;
  406. font-size: 12px;
  407. height:24px;
  408. line-height: 24px;
  409. color:#fff;
  410. background: #ffa200;
  411. }
  412. }
  413. .user_mes{
  414. display:none;
  415. position:absolute;
  416. top:100%;
  417. left:0;
  418. z-index: 200;
  419. height:10px;
  420. &:before{
  421. content: '';
  422. display:block;
  423. position:absolute;
  424. bottom:5px;
  425. left:20px;
  426. z-index: 100;
  427. border: 5px solid rgba(0,0,0,.7);
  428. -webkit-transform: rotate(45deg);
  429. -moz-transform: rotate(45deg);
  430. -o-transform:rotate(45deg);
  431. -ms-transform: rotate(45deg);
  432. transform:rotate(45deg);
  433. }
  434. .mes-list{
  435. padding:10px 10px;
  436. background: rgba(0,0,0,.7);
  437. color:#fff;
  438. p{
  439. max-width:1183px;
  440. min-width:118px;
  441. margin:0;
  442. line-height: 20px;
  443. font-size: 12px;
  444. color:#fff;
  445. overflow: hidden;
  446. white-space: nowrap;
  447. span{
  448. margin: 0 5px;
  449. .supplier_icon1{
  450. display:inline-block;
  451. position: relative;
  452. top: 5px;
  453. width:20px;
  454. height:18px;
  455. background: url(/images/supplier/icon/supplier_icon.png)no-repeat 0 0;
  456. }
  457. .supplier_icon2{
  458. display:inline-block;
  459. position: relative;
  460. top: 5px;
  461. width:20px;
  462. height:18px;
  463. background: url(/images/supplier/icon/supplier_icon.png)no-repeat -20px 0;
  464. }
  465. .supplier_icon3{
  466. display:inline-block;
  467. position: relative;
  468. top: 5px;
  469. width:20px;
  470. height:18px;
  471. background: url(/images/supplier/icon/supplier_icon.png)no-repeat -40px 0;
  472. }
  473. .supplier_icon4{
  474. display:inline-block;
  475. position: relative;
  476. top: 5px;
  477. height:18px;
  478. width:22px;
  479. background: url(/images/supplier/icon/supplier_icon.png)no-repeat -60px 0;
  480. }
  481. .supplier_icon5{
  482. display:inline-block;
  483. position: relative;
  484. top: 5px;
  485. width:20px;
  486. height:18px;
  487. background: url(/images/supplier/icon/supplier_icon.png)no-repeat -85px 0;
  488. }
  489. }
  490. }
  491. }
  492. }
  493. }
  494. .search{
  495. width:310px;
  496. margin:0;
  497. float:right;
  498. .btn{
  499. background: #3c7cf5;
  500. color:#fff;
  501. }
  502. }
  503. }
  504. .info_list{
  505. padding-bottom:200px;
  506. table {
  507. table-layout: fixed;
  508. thead{
  509. tr{
  510. line-height: 32px;
  511. vertical-align: middle;
  512. th{
  513. font-size: 14px;
  514. color:#fff;
  515. text-align: center;
  516. background: #3975f4;
  517. span{
  518. display:inline-block;
  519. width:33%;
  520. }
  521. }
  522. }
  523. }
  524. tbody{
  525. tr{
  526. border:1px solid #dadada;
  527. &:nth-child(odd){
  528. background: #fff;
  529. }
  530. &:nth-child(even){
  531. background: #f8f8f8;
  532. }
  533. &:hover{
  534. cursor:pointer;
  535. background: #f8fafe;
  536. td{
  537. &:first-child{
  538. border-left:1px solid #3975f4;
  539. }
  540. &:last-child{
  541. border-right:1px solid #3975f4;
  542. }
  543. border-top:1px solid #3975f4;
  544. border-bottom:1px solid #3975f4;
  545. }
  546. }
  547. td{
  548. vertical-align: middle;
  549. margin:0 auto;
  550. padding:10px 0;
  551. &:first-child, &:last-child{
  552. color:#ed791c;
  553. text-align: center;
  554. }
  555. a{
  556. display:inline-block;
  557. padding:0 10px;
  558. margin:0 auto;
  559. line-height: 24px;
  560. border-radius:3px;
  561. height:24px;
  562. font-size: 12px;
  563. color:#fff;
  564. background: #3c7cf5;
  565. text-align: center;
  566. }
  567. ul{
  568. margin-left:5px;
  569. }
  570. .item{
  571. font-size: 12px;
  572. line-height: 18px;
  573. padding: 10px 0;
  574. vertical-align: top;
  575. width:33%;
  576. span{
  577. display:inline-block;
  578. width:85px;
  579. text-align: right;
  580. color:#3c7cf5;
  581. }
  582. p{
  583. display:block;
  584. width:210px;
  585. margin-left:100px;
  586. margin-bottom:0;
  587. color:#333;
  588. word-break: break-all;
  589. word-wrap:break-word;
  590. }
  591. }
  592. }
  593. }
  594. }
  595. }
  596. }
  597. }
  598. </style>