Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.12 KB | None | 0 0
  1. <template>
  2. <div>
  3. <div id="mainjob">
  4. <div>
  5. <div class="secondarycolor">
  6. <h5 id="jobheader"> Job Center </h5>
  7. </div>
  8. <div>
  9. <p class="secondarycolor">Filter By:</p>
  10. </div>
  11. <div class="row justify-center">
  12. <q-tabs color="secondary" align="justify" inverted v-model="selectedtab">
  13. <q-tab default name="searchbyid" label="Search by ID" slot="title" @select="findrepair()"/>
  14. <q-tab name="customfilter" label="Custom Filters" slot="title" @select="findrepair()"/>
  15. <q-tab name="notpickedup" label="Machines Not Picked Up" slot="title" @select="findrepair()"/>
  16. <q-tab-pane name="searchbyid">
  17. <div class="row justify-center" id="repairidbox">
  18. <q-input type="text" placeholder="Repair ID" @input="findrepair()" class="inputspace" v-model="repairid" color="secondary"/>
  19. </div>
  20. </q-tab-pane>
  21. <q-tab-pane name="customfilter">
  22. <div id="filterbox">
  23. <div id="selectbox">
  24. <div id="selectboxsub">
  25. <div class="row">
  26. <div>
  27. <q-select
  28. class="inputspace"
  29. multiple
  30. color="secondary"
  31. filter
  32. placeholder="Select Filters"
  33. v-model="filtersselected"
  34. :options="filteroptions"
  35. @input="filterchanged()"
  36. :display-value="`${filtersselected.length} filters selected`"
  37. />
  38. </div>
  39. <div class="row">
  40. <q-btn icon="clear" color="secondary" @click="clearfilters()" class="inputspace">
  41. <q-tooltip anchor="bottom middle" self="top middle" :offset="[10, 10]" color="secondary" @click="showing = false">
  42. Clear Filters
  43. </q-tooltip>
  44. </q-btn>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. <div class="row justify-center" id="filterinput" v-if="filtersselected.length>0">
  50. <div>
  51. <q-input @input="findrepair()" type="text" placeholder="Customer First Name" color="secondary" v-model="fname" class="inputspace" id="fname" v-if="containsvar('cusfname')"/>
  52. <q-input @input="findrepair()" type="text" placeholder="Customer Last Name" color="secondary" v-model="lname" class="inputspace" id="lname" v-if="containsvar('cuslname')"/>
  53. </div>
  54. <div>
  55. <q-select
  56. class="inputspace"
  57. id="brand"
  58. color="secondary"
  59. filter
  60. placeholder="Machine Brand"
  61. v-model="brand"
  62. :options="Brands"
  63. @input="brandchanged(), findrepair()"
  64. v-if="containsvar('brand')"
  65. />
  66. <q-select
  67. class="inputspace"
  68. id="color"
  69. color="secondary"
  70. filter
  71. placeholder="Machine Color"
  72. v-model="color"
  73. :options="Colors"
  74. @input="colorchanged(), findrepair()"
  75. v-if="containsvar('color')"
  76. />
  77. <q-select
  78. class="inputspace"
  79. id="type"
  80. color="secondary"
  81. filter
  82. placeholder="Machine Type"
  83. v-model="type"
  84. :options="Types"
  85. @input="typechanged(), findrepair()"
  86. v-if="containsvar('type')"
  87. />
  88. <q-input @input="findrepair()" type="text" placeholder="Model" color="secondary" v-model="model" class="inputspace" id="model" v-if="containsvar('model')"/>
  89. </div>
  90. <div class="column">
  91. <q-checkbox @input="findrepair()" label="Warranty" color="secondary" v-model="warranty" class="inputspace" id="warranty" v-if="containsvar('warranty')"/>
  92. <q-checkbox @input="findrepair()" label="Purchased Here" color="secondary" v-model="purchased" class="inputspace" id="purchased" v-if="containsvar('purchased')"/>
  93. <q-checkbox @input="findrepair()" label="Rush Service" color="secondary" v-model="rushservice" class="inputspace" id="rushservice" v-if="containsvar('rushservice')"/>
  94. <q-checkbox @input="findrepair()" label="Completed" color="secondary" v-model="completed" class="inputspace" id="completed" v-if="containsvar('completed')"/>
  95. </div>
  96. </div>
  97. </div>
  98. </q-tab-pane>
  99. <q-tab-pane name="notpickedup">
  100. </q-tab-pane>
  101. </q-tabs>
  102. </div>
  103. <div>
  104. <center v-if="jobarray.length==0">
  105. <h6 class="secondarycolor">No Results</h6>
  106. </center>
  107. <div class="row justify-center">
  108. <div class="row justify-center">
  109. <q-card color="secondary" dark class="q-ma-sm" v-for="(repair,index) in jobarray" :key="index">
  110. <q-card-title>
  111. <i><span class="title"># </span></i>
  112. <span class="title">{{ repair.RepairID }}</span>
  113. </q-card-title>
  114. <q-card-main>
  115. <div class="row">
  116. <div class="titles">
  117. <span ><b>Name:</b></span><br>
  118. <span><b>Phone Number:</b></span> <br>
  119. <span><b>Brand:</b></span> <br>
  120. <span><b>Type:</b></span> <br>
  121. <span><b>Color:</b></span> <br>
  122. <span><b>Model:</b></span> <br>
  123. <span><b>Problem:</b></span> <br>
  124. <span><b>Phone Number:</b></span> <br>
  125. <span><b>Warranty:</b></span> <br>
  126. <span><b>Purchased Here: </b></span> <br>
  127. <span><b>Rush Service: </b></span> <br>
  128. <span><b>Date Received: </b></span> <br>
  129. <span><b>Received By: </b></span> <br>
  130. <span><b>Status: </b></span> <br>
  131. <span v-if="repair.Hours!=null"><b>Hours: </b></span> <br>
  132. <span v-if="repair.Hours!=null"><b>Pick Up Date: </b></span> <br>
  133. </div>
  134. <div class="description">
  135. <span>{{ repair.FirstName + " " + repair.LastName }}</span> <br>
  136. <span>{{ repair.PhoneNumber }}</span> <br>
  137. <span>{{ repair.Brand }}</span> <br>
  138. <span>{{ repair.Type }}</span> <br>
  139. <span>{{ repair.Color }}</span> <br>
  140. <span>{{ repair.Model }}</span> <br>
  141. <span>{{ repair.Problem }}</span> <br>
  142. <span>{{ repair.PhoneNumber }}</span> <br>
  143. <q-icon name="check_box" v-if="repair.Warranty==1" />
  144. <q-icon name="check_box_outline_blank" v-if="repair.Warranty==0" /> <br>
  145. <q-icon name="check_box" v-if="repair.Purchased==1" />
  146. <q-icon name="check_box_outline_blank" v-if="repair.Purchased==0" /> <br>
  147. <q-icon name="check_box" v-if="repair.RushService==1" />
  148. <q-icon name="check_box_outline_blank" v-if="repair.RushService==0" /> <br>
  149. <span> {{getdatestring(repair.DateReceived) }} </span> <br>
  150. <span> {{ repair.Name }} </span> <br>
  151. <span v-if="repair.Hours!=null"> Completed </span>
  152. <span v-if="repair.Hours==null"> In Progress </span> <br>
  153. <span v-if="repair.Hours!=null"> {{repair.Hours}} </span> <br>
  154. <span v-if="repair.Hours!=null&&repair.DatePickedUp!=null"> {{getdatestring(repair.DatePickedUp)}} </span>
  155. <span v-if="repair.Hours!=null&&repair.DatePickedUp==null"> Pickup Pending </span> <br>
  156. </div>
  157. </div>
  158. </q-card-main>
  159. <q-card-separator />
  160. <q-card-actions>
  161. <q-btn icon="playlist_add" class="inputspace" v-if="repair.Hours==null" @click="addpart(repair.RepairID)">
  162. <q-tooltip anchor="bottom middle" self="top middle" :offset="[10, 10]" color="secondary" @click="showing = false">
  163. Add Part
  164. </q-tooltip>
  165. </q-btn>
  166. <q-btn icon="list_alt" color="secondary" class="inputspace" @click="getpartslist(repair.RepairID)">
  167. <q-tooltip anchor="bottom middle" self="top middle" :offset="[10, 10]" color="secondary" @click="showing = false">
  168. View All Parts
  169. </q-tooltip>
  170. </q-btn>
  171. <q-btn icon="done" color="secondary" class="inputspace" v-if="repair.Hours==null" @click="completejob(repair.RepairID)">
  172. <q-tooltip anchor="bottom middle" self="top middle" :offset="[10, 10]" color="secondary" @click="showing = false">
  173. Complete Job
  174. </q-tooltip>
  175. </q-btn>
  176. <q-btn icon="local_shipping" color="secondary" class="inputspace" v-if="repair.Hours!=null&&repair.DatePickedUp==null" @click="pickupmachinery(repair.RepairID)">
  177. <q-tooltip anchor="bottom middle" self="top middle" :offset="[10, 10]" color="secondary" @click="showing = false">
  178. Pick Up Machine
  179. </q-tooltip>
  180. </q-btn>
  181. </q-card-actions>
  182. </q-card>
  183. </div>
  184. </div>
  185. </div>
  186. </div>
  187. <q-dialog
  188. v-model="addpartdialog"
  189. prevent-close
  190. >
  191. <span slot="title">
  192. <span class="secondarycolor row justify-center"> Add Parts </span>
  193. </span>
  194. <template slot="message">
  195. <div class="row justify-center addpartborder">
  196. <div class="column addpartsideborder">
  197. <center><p class="secondarycolor">Part Number: </p></center>
  198. <q-input type="text" placeholder="Part Number" v-model="partnumber" color="secondary" class="inputspace"/>
  199. </div>
  200. <div class="column addpartsideborder">
  201. <center><p class="secondarycolor"> Quantity: </p></center>
  202. <q-input type="number" placeholder="Quantity" v-model="numquantity" color="secondary" class="inputspace"/>
  203. </div>
  204. <div class="column">
  205. <center><p class="secondarycolor"> Description: </p></center>
  206. <q-input type="text" placeholder="Part Description" v-model="partdescription" color="secondary" class="inputspace"/>
  207. </div>
  208. </div><center>
  209. <div>
  210. <q-btn label="Add Part" color="secondary" @click="addparts()" :disable="disableaddparts"/>
  211. </div></center>
  212. </template>
  213. <span slot="buttons" slot-scope="props">
  214. <span>
  215. <q-btn label="Done" color="secondary" @click="done()" class="row justify-center"/>
  216. </span>
  217. </span>
  218. </q-dialog>
  219. <q-dialog
  220. v-model="terminatejob"
  221. color="secondary"
  222. prevent-close
  223. >
  224. <span slot="title">
  225. <span class="secondarycolor row justify-center"> Complete Job </span>
  226. </span>
  227. <span slot="message">
  228. <div class="row justify-center">
  229. <div class="column">
  230. <span class="secondarycolor justify-center row"> Hours Worked: </span>
  231. <q-input type="text" placeholder="Hours" color="secondary" v-model="hours" class="inputspace"/>
  232. <span v-if="isNaN(hours)" class="error"> Cannot contain letters </span>
  233. </div>
  234. </div>
  235. </span>
  236. <span slot="buttons" slot-scope="props">
  237. <q-btn label="Submit" color="secondary" class="inputspace" @click="finishjob()" :disable="disablefinishbtn"/>
  238. <q-btn label="Cancel" color="secondary" class="inputspace" @click="hoursgoback()"/>
  239. </span>
  240. </q-dialog>
  241. <q-dialog
  242. v-model="pickup"
  243. color="secondary"
  244. prevent-close
  245. >
  246. <span slot="title">
  247. <span class="secondarycolor row justify-center"> Pick Up Machine </span>
  248. </span>
  249. <span slot="message">
  250. <div class="row justify-center">
  251. <div class="column">
  252. <span class="secondarycolor justify-center row"> Date Picked Up: </span>
  253. <q-datetime type="date" placeholder="Pick Up Date" color="secondary" v-model="pickupdate" class="inputspace"/>
  254. </div>
  255. </div>
  256. </span>
  257. <span slot="buttons" slot-scope="props">
  258. <q-btn label="Submit" color="secondary" class="inputspace" @click="pickupmachine()" :disable="disablepickupbtn"/>
  259. <q-btn label="Cancel" color="secondary" class="inputspace" @click="pickupgoback()"/>
  260. </span>
  261. </q-dialog>
  262. </div>
  263. </div>
  264. </template>
  265.  
  266. <script>
  267. import {mapState} from 'vuex'
  268. var async = require('async')
  269. export default {
  270. // name: 'ComponentName',
  271. created() {
  272. this.$Socket.emit('getinfo', (data) => {
  273. this.servercolors=data.colors
  274. this.serverbrands=data.brands
  275. this.servertypes=data.types
  276. })
  277. this.$Socket.on('updatecolor', ({colors}) => {
  278. this.servercolors=colors
  279. })
  280. this.$Socket.on('updatebrand', ({brands}) => {
  281. this.serverbrands=brands
  282. })
  283. this.$Socket.on('updatetype', ({types}) => {
  284. this.servertypes=types
  285. })
  286. this.$Socket.on('repairsupdated', () => {
  287. this.findrepair()
  288. })
  289. },
  290. mounted() {
  291. this.$nextTick (() => {
  292. })
  293. },
  294. data () {
  295. return {
  296. selectedtab: 'searchbyid',
  297. repairid: null,
  298. filtersselected: [],
  299. model: "",
  300. fname: "",
  301. lname: "",
  302. brand: null,
  303. color: null,
  304. type: null,
  305. warranty: false,
  306. purchased: false,
  307. rushservice: false,
  308. completed: false,
  309. servercolors: [],
  310. serverbrands: [],
  311. servertypes: [],
  312. filteroptions: [
  313. {
  314. label: "Select All",
  315. value: "selectall"
  316. },
  317. {
  318. label:"Customer First Name",
  319. value:"cusfname"
  320. },
  321. {
  322. label:"Customer Last Name",
  323. value:"cuslname"
  324. },
  325. {
  326. label:"Brand of Machine",
  327. value:"brand"
  328. },
  329. {
  330. label:"Type of Machine",
  331. value:"type"
  332. },
  333. {
  334. label:"Model of Machine",
  335. value:"model"
  336. },
  337. {
  338. label:"Color",
  339. value:"color"
  340. },
  341. {
  342. label:"Warranty",
  343. value:"warranty"
  344. },
  345. {
  346. label:"Purchased Here",
  347. value:"purchased"
  348. },
  349. {
  350. label:"Rush Service",
  351. value:"rushservice"
  352. },
  353. {
  354. label: "Completed Jobs",
  355. value: "completed"
  356. }
  357. ],
  358. partnumber: "",
  359. numquantity: 0,
  360. partdescription: "",
  361. addpartdialog: false,
  362. addpartrepairidchosen: null,
  363. addpartsuccess: false,
  364. partslistdialog: false,
  365. partslistrepairidchosen: null,
  366. partslist: [],
  367. terminatejob: false,
  368. hours: '0',
  369. finishjobrepairid: null,
  370. finishjobsuccess: false,
  371. pickupdate: null,
  372. pickup: false,
  373. pickuprepairid: null,
  374. pickupsuccess: false,
  375. jobarray: []
  376. }
  377. },
  378. methods: {
  379. pickupmachinery: function (id) {
  380. this.pickup=true
  381. this.pickuprepairid=id
  382. },
  383. pickupmachine: function () {
  384. this.$Socket.emit('pickupmachine', {
  385. RepairID: this.pickuprepairid,
  386. DatePickedUp: this.pickupdate
  387. }, ({authenticated}) => {
  388. if(authenticated==true)
  389. {
  390. this.pickupdate=""
  391. this.pickup=false
  392. this.pickupsuccess=true
  393. setTimeout( () => {this.pickupsuccess=false}, 1000)
  394. }
  395. })
  396. },
  397. pickupgoback: function () {
  398. this.pickup=false
  399. this.pickupdate=""
  400. },
  401. completejob: function (id) {
  402. this.terminatejob=true
  403. this.finishjobrepairid=id
  404. },
  405. finishjob: function () {
  406. this.$Socket.emit('finishjob', {
  407. RepairID: this.finishjobrepairid,
  408. Hours: this.hours
  409. }, ({authenticated}) => {
  410. if(authenticated==true)
  411. {
  412. this.terminatejob=false
  413. this.finishjobsuccess=true
  414. this.hours='0'
  415. setTimeout( () => {this.finishjobsuccess=false}, 1000)
  416. }
  417. })
  418. },
  419. hoursgoback: function () {
  420. this.terminatejob=false
  421. this.hours='0'
  422. },
  423. partslistgoback: function () {
  424. this.partslistdialog=false
  425. },
  426. getpartslist: function (id) {
  427. this.partslistdialog=true
  428. this.partslistrepairidchosen=id
  429. this.$Socket.emit('getpartslist', {
  430. RepairID: this.partslistrepairidchosen
  431. }, (data) => {
  432. this.partslist=data
  433. })
  434. },
  435. addparts: function () {
  436. this.$Socket.emit('addpart', {
  437. RepairID: this.addpartrepairidchosen,
  438. PartNumber: this.partnumber,
  439. PartName: this.partdescription,
  440. Quantity: this.numquantity
  441. }, ({authenticated}) => {
  442. if(authenticated==true)
  443. {
  444. this.partdescription=""
  445. this.numquantity=0
  446. this.partnumber=""
  447. this.addpartsuccess=true
  448. setTimeout( () => {this.addpartsuccess=false}, 1000)
  449. }
  450. })
  451. },
  452. done: function () {
  453. this.partnumber=""
  454. this.numquantity=0
  455. this.addpartdialog=false
  456. },
  457. addpart: function (id) {
  458. this.addpartdialog=true
  459. this.addpartrepairidchosen=id
  460. },
  461. notpickedup: function () {
  462.  
  463. },
  464. converttobool: function (num) {
  465. if(num==1)
  466. {
  467. return true
  468. }
  469. else
  470. {
  471. return false
  472. }
  473. },
  474. brandchanged: function () {
  475. if(this.brand=="none")
  476. {
  477. this.brand=null
  478. }
  479. },
  480. colorchanged: function () {
  481. if(this.color=="none")
  482. {
  483. this.color=null
  484. }
  485. },
  486. typechanged: function () {
  487. if(this.type=="none")
  488. {
  489. this.type=null
  490. }
  491. },
  492. clearfilters: function () {
  493. this.filtersselected=[]
  494. this.customfilters=[]
  495. this.clearforms()
  496. this.jobarray=[]
  497. },
  498. filterchanged: function () {
  499. if(this.containsvar("selectall"))
  500. {
  501. this.filtersselected=[]
  502. this.filtersselected.push("completed", "rushservice", "purchased", "warranty", "type", "color", "brand", "cusfname", "cuslname", "model")
  503. }
  504. this.findrepair()
  505. if(this.containsvar("cusfname")==false)
  506. {
  507. this.fname=""
  508. }
  509. if(this.containsvar("cuslname")==false)
  510. {
  511. this.lname=""
  512. }
  513. if(this.containsvar("model")==false)
  514. {
  515. this.model=""
  516. }
  517. if(this.containsvar("warranty")==false)
  518. {
  519. this.warranty=false
  520. }
  521. if(this.containsvar("type")==false)
  522. {
  523. this.type=null
  524. }
  525. if(this.containsvar("completed")==false)
  526. {
  527. this.completed=false
  528. }
  529. if(this.containsvar("rushservice")==false)
  530. {
  531. this.rushservice=false
  532. }
  533. if(this.containsvar("purchased")==false)
  534. {
  535. this.purchased=false
  536. }
  537. if(this.containsvar("brand")==false)
  538. {
  539. this.brand=null
  540. }
  541. if(this.containsvar("color")==false)
  542. {
  543. this.color=null
  544. }
  545. },
  546. containsvar: function (variable) {
  547. for(var x=0; x<this.filtersselected.length; x++)
  548. {
  549. if(this.filtersselected[x]==variable)
  550. {
  551. return true
  552. }
  553. }
  554. return false
  555. },
  556. clearforms: function () {
  557. this.fname= ""
  558. this.lname= ""
  559. this.brand= ""
  560. this.color= ""
  561. this.type= ""
  562. this.model=""
  563. this.warranty= false
  564. this.purchased= false
  565. this.rushservice= false
  566. this.completed= false
  567. },
  568. getdatestring: function (date) {
  569. var fulldate=date.slice(8, 10) + "/" + date.slice(5,7) + "/" + date.slice(0,4)
  570. return fulldate
  571. },
  572. findrepair: function () {
  573. var vm=this
  574. this.jobarray=[]
  575. if(this.selectedtab=="notpickedup")
  576. {
  577. vm.$Socket.emit('machinesnotpickedup', (data) => {
  578. this.findsalesreps(data)
  579. })
  580. }
  581. else if(this.selectedtab=="customfilter")
  582. {
  583. var array=[]
  584. if(vm.containsvar('cusfname'))
  585. {
  586. if(vm.fname!=''&&vm.fname!=null)
  587. {
  588. array.push({
  589. name: "FirstName",
  590. type: "text",
  591. table: "",
  592. value: vm.fname
  593. })
  594. }
  595. }
  596. if(vm.containsvar('cuslname'))
  597. {
  598. if(vm.lname!=''&&vm.lname!=null)
  599. {
  600. array.push({
  601. name: "LastName",
  602. type: "text",
  603. table: "",
  604. value: vm.lname
  605. })
  606. }
  607. }
  608. if(vm.containsvar('brand'))
  609. {
  610. if(vm.brand!=''&&vm.brand!=null)
  611. {
  612. array.push({
  613. name: "BrandID",
  614. type: "number",
  615. table: "brands",
  616. value: vm.brand
  617. })
  618. }
  619. }
  620. if(vm.containsvar('color'))
  621. {
  622. if(vm.color!=''&&vm.color!=null)
  623. {
  624. array.push({
  625. name: "ColorID",
  626. type: "number",
  627. table: "colors",
  628. value: vm.color
  629. })
  630. }
  631. }
  632. if(vm.containsvar('type'))
  633. {
  634. if(vm.type!=''&&vm.type!=null)
  635. {
  636. array.push({
  637. name: "TypeID",
  638. type: "number",
  639. table: "types",
  640. value: vm.type
  641. })
  642. }
  643. }
  644. if(vm.containsvar('model'))
  645. {
  646. if(vm.model!=''&&vm.model!=null)
  647. {
  648. array.push({
  649. name: "Model",
  650. type: "text",
  651. table: "",
  652. value: vm.model
  653. })
  654. }
  655. }
  656. var integer=0
  657. if(vm.containsvar('warranty'))
  658. {
  659. if(vm.warranty!=null&&vm.warranty!=null)
  660. {
  661. if(vm.warranty==true)
  662. {
  663. integer=1
  664. }
  665. else if(vm.warranty==false)
  666. {
  667. integer=0
  668. }
  669. array.push({
  670. name: "Warranty",
  671. type: "number",
  672. table: "",
  673. value: integer
  674. })
  675. }
  676. }
  677. if(vm.containsvar('purchased'))
  678. {
  679. if(vm.purchased==true&&vm.purchased!=null)
  680. {
  681. integer=1
  682. }
  683. else
  684. {
  685. integer=0
  686. }
  687. array.push({
  688. name: "Purchased",
  689. type: "number",
  690. table: "",
  691. value: integer
  692. })
  693. }
  694. if(vm.containsvar('rushservice'))
  695. {
  696. if(vm.rushservice==true&&vm.rushservice!=null)
  697. {
  698. integer=1
  699. }
  700. else
  701. {
  702. integer=0
  703. }
  704. array.push({
  705. name: "RushService",
  706. table: "",
  707. type: "number",
  708. table: "",
  709. value: integer
  710. })
  711. }
  712. if(vm.containsvar('completed'))
  713. {
  714. var bool=false
  715. if(vm.completed==true)
  716. {
  717. bool=true
  718. }
  719. else
  720. {
  721. bool=false
  722. }
  723. array.push({
  724. name: "Hours",
  725. type: "bool",
  726. table: "",
  727. value: bool
  728. })
  729. }
  730. vm.$Socket.emit('findrepairbyfilters', {
  731. data: array
  732. }, ({data}) => {
  733. this.findsalesreps(data)
  734. })
  735. }
  736. else
  737. {
  738. if(this.repairid==null||this.repairid==""||isNaN(this.repairid))
  739. {
  740. this.jobarray=[]
  741. }
  742. else
  743. {
  744. vm.$Socket.emit('findrepairbyid', {
  745. RepairID: vm.repairid
  746. }, (data) => {
  747. this.findsalesreps(data)
  748. })
  749. }
  750. }
  751. },
  752. findsalesreps: function (data) {
  753. if(data.length>0)
  754. {
  755. this.$forceUpdate()
  756. var vm=this
  757. this.jobarray=data
  758. var y=0
  759. for(var x in this.jobarray) {
  760. vm.$Socket.emit('getsalesrep', {
  761. UserID: this.jobarray[x].UserID
  762. }, (emp) => {
  763. this.jobarray[y]['Name']=emp[0].FirstName + " " + emp[0].LastName
  764. ++y
  765. this.$forceUpdate()
  766. })
  767. }
  768. }
  769. }
  770. },
  771. computed: {
  772. ... mapState('example', ['UserID']),
  773.  
  774. }
  775. }
  776. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement