index.vue 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088
  1. <template>
  2. <div class="app-container">
  3. <div class = "search-bx" >
  4. <div class="search">
  5. <el-row :gutter="0">
  6. <el-input v-model="tableObj.getdataListParm.parammaps.remoteCode" placeholder="远程服务编号" class="filter-item" style="width: 120px" />
  7. <el-select v-model="tableObj.getdataListParm.parammaps.costStatus" placeholder="收款状态" class="filter-item" style="width: 120px;" clearable>
  8. <el-option v-for="item in moneyNameList" :key="item.id" :label="item.name" :value="item.id" />
  9. </el-select>
  10. <el-date-picker v-model="tableObj.getdataListParm.parammaps.inputDatetime1" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="服务开始时间" end-placeholder="服务开始时间" style="width: 250px;" />
  11. <el-date-picker v-model="tableObj.getdataListParm.parammaps.inputDatetime2" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="服务完成时间" end-placeholder="服务完成时间" style="width: 250px;" />
  12. <!-- <el-autocomplete v-model="tableObj.getdataListParm.parammaps.customerName" :fetch-suggestions="customer_search" placeholder="客户名称" style="width: 200px;margin-right:10px" @select="change_customer_select" @clear="clear_customer_select" @blur="customer_search_blur" clearable>
  13. <template slot-scope="{ item }">
  14. <span class="name">{{ item.name }}</span>
  15. </template>
  16. </el-autocomplete> -->
  17. <el-input v-model="tableObj.getdataListParm.parammaps.customerName" placeholder="客户名称" style="width: 180px;" class="filter-item" clearable />
  18. <el-select v-model="tableObj.getdataListParm.parammaps.groupId" placeholder="集团" class="filter-item" style="width: 120px;" clearable>
  19. <el-option v-for="item in groupNameList" :key="item.id" :label="item.name" :value="item.id" />
  20. </el-select>
  21. <el-input v-model="tableObj.getdataListParm.parammaps.receiverName" placeholder="客户对接人" style="width:120px"></el-input>
  22. <el-select v-model="tableObj.getdataListParm.parammaps.employeeId" placeholder="技术人员" class="filter-item" style="width: 120px;" clearable filterable>
  23. <el-option v-for="(item,index) in employeeNameList" :key="index" :label="item.name" :value="item.id" />
  24. </el-select>
  25. <el-input v-model="tableObj.getdataListParm.parammaps.beginRemoteCost" placeholder="服务费用" style="width:90px"></el-input>
  26. -
  27. <el-input v-model="tableObj.getdataListParm.parammaps.endRemoteCost" placeholder="服务费用" style="width:90px;margin-right:10px;"></el-input>
  28. <el-date-picker v-model="tableObj.getdataListParm.parammaps.inputDatetime3" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="支付时间" end-placeholder="支付时间" style="width: 250px;" />
  29. <el-date-picker v-model="tableObj.getdataListParm.parammaps.inputDatetime4" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="收款时间" end-placeholder="收款时间" style="width: 250px;" />
  30. <el-button class="successBorder" @click="form_search">查询</el-button>
  31. <el-button class="successBorder" @click="form_clear">重置</el-button>
  32. <!-- <el-button class="success" icon="el-icon-upload2" @click="form_export">导出</el-button> -->
  33. </el-row>
  34. </div>
  35. </div>
  36. <div class="table" >
  37. <el-table :key="tableObj.tableKey" v-loading="tableObj.listLoading" element-loading-text="给我一点时间" :data="tableObj.list" border fit highlight-current-row style="width: 100%;" :row-style="rowStyle" :cell-style="cellStyle" class="elTable table-fixed" :max-height="myHeight">
  38. <el-table-column label="序号" align="center" type="index" width="50px" fixed="left">
  39. <template slot-scope="scope">
  40. <span>{{ scope.$index + (tableObj.pageNum-1) * tableObj.pageSize + 1 }}</span>
  41. </template>
  42. </el-table-column>
  43. <el-table-column label="远程服务编号" min-width="130px" align="center" fixed="left">
  44. <template slot-scope="scope">
  45. <span style = "color:#409EFF; cursor: pointer;" @click="form_see(scope.row)">{{ scope.row.remoteCode }}</span>
  46. </template>
  47. </el-table-column>
  48. <el-table-column label="收款状态" min-width="90px" align="center" fixed="left">
  49. <template slot-scope="scope">
  50. <span>{{ scope.row.payStatus }}</span>
  51. </template>
  52. </el-table-column>
  53. <el-table-column label="客户名称" min-width="120px" align="center" show-overflow-tooltip fixed="left">
  54. <template slot-scope="scope">
  55. <span>{{ scope.row.customerName }}</span>
  56. </template>
  57. </el-table-column>
  58. <el-table-column label="所属集团" min-width="90px" align="center" fixed="left">
  59. <template slot-scope="scope">
  60. <span>{{ scope.row.groupName }}</span>
  61. </template>
  62. </el-table-column>
  63. <el-table-column label="客户对接人" min-width="110px" align="center" >
  64. <template slot-scope="scope">
  65. <span>{{ scope.row.receiverName }}</span>
  66. </template>
  67. </el-table-column>
  68. <!-- <el-table-column label="款项状态" min-width="90px" align="center" >
  69. <template slot-scope="scope">
  70. <span>{{ scope.row.costStatus }}</span>
  71. </template>
  72. </el-table-column> -->
  73. <el-table-column label="服务费用" min-width="100px" align="center" >
  74. <template slot-scope="scope">
  75. <span>{{ scope.row.remoteCost }}</span>
  76. </template>
  77. </el-table-column>
  78. <el-table-column label="支付时间" min-width="100px" align="center" >
  79. <template slot-scope="scope">
  80. <span>{{ scope.row.payDate }}</span>
  81. </template>
  82. </el-table-column>
  83. <el-table-column label="收款时间" min-width="100px" align="center" >
  84. <template slot-scope="scope">
  85. <span>{{ scope.row.collectDate }}</span>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="服务开始时间" min-width="120px" align="center">
  89. <template slot-scope="scope">
  90. <span>{{ scope.row.remoteBeginDate }}</span>
  91. </template>
  92. </el-table-column>
  93. <el-table-column label="服务完成时间" min-width="110px" align="center" show-overflow-tooltip>
  94. <template slot-scope="scope">
  95. <span>{{ scope.row.remoteEndDate }}</span>
  96. </template>
  97. </el-table-column>
  98. <el-table-column label="服务内容" min-width="110px" align="center" show-overflow-tooltip>
  99. <template slot-scope="scope">
  100. <span>{{ scope.row.content }}</span>
  101. </template>
  102. </el-table-column>
  103. <el-table-column label="技术人员" min-width="110px" align="center" show-overflow-tooltip>
  104. <template slot-scope="scope">
  105. <span>{{ scope.row.employeeName }}</span>
  106. </template>
  107. </el-table-column>
  108. <el-table-column label="备注" min-width="120px" align="center" show-overflow-tooltip>
  109. <template slot-scope="scope">
  110. <span>{{ scope.row.remark }}</span>
  111. </template>
  112. </el-table-column>
  113. <el-table-column label="拜访记录关联" min-width="120px" align="center" show-overflow-tooltip >
  114. <template slot-scope="scope">
  115. <span>{{ scope.row.visitName }}</span>
  116. </template>
  117. </el-table-column>
  118. <el-table-column label="回访记录关联" min-width="120px" align="center" show-overflow-tooltip>
  119. <template slot-scope="scope">
  120. <span>{{ scope.row.telvisitName }}</span>
  121. </template>
  122. </el-table-column>
  123. <el-table-column label="服务总结" min-width="90px" align="center" show-overflow-tooltip>
  124. <template slot-scope="scope">
  125. <span>{{ scope.row.remoteSummary }}</span>
  126. </template>
  127. </el-table-column>
  128. <el-table-column label="录入时间" min-width="110px" align="center" show-overflow-tooltip>
  129. <template slot-scope="scope">
  130. <span>{{ scope.row.createrDate }}</span>
  131. </template>
  132. </el-table-column>
  133. <el-table-column label="操作" align="center" :width="autoWidth" v-if="autoWidth !== 0" class-name="small-padding fixed-width" fixed="right">
  134. <template slot-scope="{row}">
  135. <el-button class="miniSuccess" @click="form_sure(row)" v-if="isRemotepayRevoke && row.isComplete == '1'">完成收款</el-button>
  136. <el-button class="miniSuccess" @click="form_revoke(row)" v-if="isRemotepayRevoke && row.isRevoke == '1'">撤销</el-button>
  137. </template>
  138. </el-table-column>
  139. </el-table>
  140. <el-row :gutter="0">
  141. <el-col :span="6" :offset="12" style="color:#f00">
  142. 列表合同总金额:{{tableSumMoney}}
  143. </el-col>
  144. <el-col :span="6" style="color:#f00">
  145. 超时未支付金额:{{tableNoMoney}}
  146. </el-col>
  147. </el-row>
  148. <pagination v-show="tableObj.total>=0" :total="tableObj.total" :page.sync="tableObj.getdataListParm.offset" :limit.sync="tableObj.getdataListParm.pagecount" @pagination="get_table_data" />
  149. </div>
  150. <!-- 查看/反馈 -->
  151. <el-dialog title="远程服务详情" :visible.sync="createSee.dialogFormVisible" :close-on-click-modal="false" width="95%" :before-close="dialog_close">
  152. <div class="app-add">
  153. <RemotePayDetail :remote-data="remoteData" />
  154. <div slot="footer" class="dialog-footer">
  155. <el-button class="success" @click="form_sure(createSee.temp)" v-if="isRemotepayRevoke && createSee.temp.isComplete == '1'">完成收款</el-button>
  156. <el-button class="cancelClose" @click="dialog_close()">关闭</el-button>
  157. </div>
  158. </div>
  159. </el-dialog>
  160. <!-- 确认回收 -->
  161. <el-dialog title="确认是否已收款" :visible.sync="sure.dialogFormVisible" :close-on-click-modal="false" width="50%" :before-close="dialog_sure_close">
  162. <div class="app-add">
  163. <el-form ref="suretemp" :rules="sure.rules" :model="sure.temp" label-position="right" label-width="150px" style="width: 70%;margin:0 auto 50px">
  164. <el-form-item label="收款时间:" prop="collectDate">
  165. <el-date-picker v-model="sure.temp.collectDate" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :picker-options="setDisabled" style="width: 100%;" :clearable="false" />
  166. </el-form-item>
  167. </el-form>
  168. <div slot="footer" class="dialog-footer">
  169. <el-button class="cancelClose" @click="dialog_sure_close()">关闭</el-button>
  170. <el-button class="success" @click="form_sure_save()">确认</el-button>
  171. </div>
  172. </div>
  173. </el-dialog>
  174. <!-- 撤销 -->
  175. <el-dialog title="确认是否撤销" :visible.sync="revoke.dialogFormVisible" :close-on-click-modal="false" width="50%">
  176. <div class="app-add">
  177. <el-form ref="revoketemp" :rules="revoke.rules" :model="revoke.temp" label-position="right" label-width="150px" style="width: 70%;margin:0 auto 50px">
  178. <el-form-item label="撤销原因:" prop="revokeReason">
  179. <el-input ref="remark" v-model="revoke.temp.revokeReason" type="textarea" :autosize="{ minRows: 4, maxRows: 8} " :rows="8" placeholder="请输入备注,最多200个字" maxlength="200" class="filter-item" style="width: 100%;" />
  180. </el-form-item>
  181. </el-form>
  182. <div slot="footer" class="dialog-footer">
  183. <el-button class="cancelClose" @click="revoke.dialogFormVisible = false;get_table_data()">关闭</el-button>
  184. <el-button class="success" @click="form_revoke_save()">确认</el-button>
  185. </div>
  186. </div>
  187. </el-dialog>
  188. </div>
  189. </template>
  190. <script>
  191. import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons, calculativeWidth, wxpush } from '@/api/common'
  192. import Cookies from 'js-cookie'
  193. import { parseTime, json2excel } from '@/utils/index.js'
  194. // import littleTable from './components/littleTable'
  195. import { getToken } from '@/utils/auth'
  196. import Pagination from '@/components/Pagination'
  197. import { MessageBox } from 'element-ui'
  198. import RemotePayDetail from '@/componentView/RemotePayDetail.vue'
  199. import { constants } from 'zlib';
  200. export default {
  201. name: 'RemotePayment',
  202. components: { Pagination , RemotePayDetail },
  203. data() {
  204. return {
  205. myHeight:document.documentElement.clientHeight - 85 - 220,
  206. employeid: Cookies.get('employeid'),
  207. disabled: false,
  208. rowData:{},
  209. isHome:"",
  210. isRoleEdit: [],isRemotepayRevoke: [],
  211. send_select_list: [
  212. { name: 'getDictListSelect', offset: 0, pagecount: 0, parammaps: { "pid": "54" } },
  213. { name: 'getUsersSelect', offset: 0, pagecount: 0, parammaps: {} },
  214. { name: 'getEmployeesSelect', offset: 0, pagecount: 0, parammaps: {} },
  215. ],
  216. customerNameList: [], // 客户名称
  217. groupNameList: [], // 集团
  218. // 下拉框 - 技术人员
  219. employeeNameList: [],
  220. // 下拉框 - 创建人
  221. createrNameList: [],
  222. // 下拉框 - 款项状态
  223. moneyNameList: [
  224. { "name": "未收款", "id": "未收款" },
  225. { "name": "已收款", "id": "已收款" }
  226. ],
  227. setDisabled: {
  228. disabledDate(time) {
  229. return time.getTime() > Date.now(); // 可选历史天、可选当前天、不可选未来天
  230. //return time.getTime() > Date.now() - 8.64e7; // 可选历史天、不可选当前天、不可选未来天
  231. // return time.getTime() < Date.now() - 8.64e7; // 不可选历史天、可选当前天、可选未来天
  232. // return time.getTime() < Date.now(); // 不可选历史天、不可选当前天、可选未来天
  233. },
  234. },
  235. autoWidth: 130,
  236. //表格 - 列表 - 查询
  237. tableObj: {
  238. getdataListParm: {
  239. name: 'getRemoteCostList',
  240. page: 1,
  241. offset: 1,
  242. pagecount: parseInt(Cookies.get('pagecount')),
  243. returntype: 'Map',
  244. parammaps: {
  245. remoteCode: "",
  246. customerName: "",
  247. customerId: "",
  248. groupId: "",
  249. costStatus: "",
  250. employeeId: "",
  251. receiverName: "",
  252. beginRemoteCost: "",
  253. endRemoteCost: "",
  254. inputDatetime1: "",
  255. inputDatetime2: "",
  256. inputDatetime3: "",
  257. inputDatetime4: "",
  258. beginRemoteBeginDate: "",
  259. endRemoteBeginDate: "",
  260. beginRemoteEndDate: "",
  261. endRemoteEndDate: "",
  262. beginPayDate: "",
  263. endPayDate: "",
  264. beginCollectDate: "",
  265. endCollectDate: "",
  266. }
  267. },
  268. tableKey: 0,
  269. list: [],
  270. total: 0,
  271. listLoading: true,
  272. temp: {}
  273. },
  274. tableSumMoney:0,
  275. tableNoMoney:0,
  276. download: {
  277. getdataListParm: {
  278. name: 'getRemoteCostList',
  279. page: 1,
  280. offset: 1,
  281. pagecount: 0,
  282. returntype: 'Map',
  283. parammaps: {
  284. remoteCode: "",
  285. customerName: "",
  286. customerId: "",
  287. groupId: "",
  288. costStatus: "",
  289. employeeId: "",
  290. receiverName: "",
  291. beginRemoteCost: "",
  292. endRemoteCost: "",
  293. inputDatetime1: "",
  294. inputDatetime2: "",
  295. inputDatetime3: "",
  296. inputDatetime4: "",
  297. beginRemoteBeginDate: "",
  298. endRemoteBeginDate: "",
  299. beginRemoteEndDate: "",
  300. endRemoteEndDate: "",
  301. beginPayDate: "",
  302. endPayDate: "",
  303. beginCollectDate: "",
  304. endCollectDate: "",
  305. }
  306. },
  307. tableKey: 0,
  308. list: [],
  309. total: 0,
  310. listLoading: true,
  311. temp: {}
  312. },
  313. createSee:{
  314. temp:{},
  315. dialogFormVisible: false,
  316. },
  317. textMap: {
  318. create: '新增',
  319. see: '查看',
  320. update: '编辑'
  321. },
  322. imageUrl0:"",
  323. // 撤销
  324. revoke: {
  325. dialogFormVisible: false,
  326. dialogStatus: '',
  327. temp: { revokeReason: '', id: '' },
  328. rules: {
  329. revokeReason: [{ required: true, message: '必填', trigger: 'blur' }],
  330. }
  331. },
  332. // 确认回收
  333. sure: {
  334. dialogFormVisible: false,
  335. dialogStatus: '',
  336. temp: { collectDate: '', id: '' },
  337. // rules: {
  338. // revokeReason: [{ required: true, message: '必填', trigger: 'blur' }],
  339. // }
  340. },
  341. remoteData:{ id:"" },
  342. requestParam: {},
  343. isokDisable: false,
  344. selectList: [],
  345. rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
  346. cellStyle: { padding: 0 + 'px' }
  347. }
  348. },
  349. watch: {
  350. },
  351. created() {
  352. this.get_select_list()
  353. this.get_auto_buttons()
  354. var rowData = this.$route.params.rowData
  355. var isHome = this.$route.params.isHome
  356. var codeNum = this.$route.params.codeNum
  357. console.log("rowData",rowData,"======isHome",isHome,"======codeNum",codeNum)
  358. if(isHome == 'home'){
  359. this.rowData = rowData
  360. this.isHome = isHome
  361. this.tableObj.getdataListParm.parammaps.remoteCode = codeNum
  362. this.get_table_data()
  363. } else {
  364. this.rowData = {}
  365. this.isHome = ""
  366. this.codeNum = ""
  367. this.get_table_data()
  368. }
  369. },
  370. methods: {
  371. //获取按钮权限
  372. get_auto_buttons() {
  373. const Edit = 'RemotePayment'
  374. const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
  375. this.isRoleEdit = isRoleEdit
  376. const RemotepayRevoke = 'review:remotepay:revoke'
  377. const isRemotepayRevoke = checkButtons(this.$store.state.user.buttons, RemotepayRevoke)
  378. this.isRemotepayRevoke = isRemotepayRevoke
  379. },
  380. //获取所有下拉框的内容
  381. get_select_list() {
  382. GetDataByNames(this.send_select_list).then(response => {
  383. // this.customerNameList = response.data.getCustomerSelect.list
  384. // console.log("客户名称下拉框", this.houseNameList)
  385. this.groupNameList = response.data.getDictListSelect.list
  386. console.log("集团下拉框", this.groupNameList)
  387. this.createrNameList = response.data.getUsersSelect.list
  388. console.log("创建人下拉框", this.createrNameList)
  389. this.employeeNameList = response.data.getEmployeesSelect.list
  390. console.log("技术人员下拉框", this.employeeNameList)
  391. })
  392. },
  393. //加载表格
  394. get_table_data() {
  395. var me = this
  396. this.tableObj.listLoading = true
  397. console.log("this.tableObj.getdataListParm======>", this.tableObj.getdataListParm)
  398. GetDataByName(this.tableObj.getdataListParm).then(response => {
  399. console.log('table数据======>', response.data.list)
  400. if (response.data.list !== null) {
  401. this.tableObj.list = response.data.list
  402. this.tableObj.pageNum = response.data.pageNum
  403. this.tableObj.pageSize = response.data.pageSize
  404. this.tableObj.total = response.data.total
  405. console.log('table数据======>', this.tableObj.list)
  406. //计算操作栏宽度
  407. var btnNum = 0
  408. var arrList = response.data.list
  409. arrList.forEach(function(row){
  410. var itemBtnNum = 0
  411. if(me.isRemotepayRevoke && row.isComplete == '1'){
  412. itemBtnNum = itemBtnNum + 1
  413. }
  414. if(me.isRemotepayRevoke && row.isRevoke == '1'){
  415. itemBtnNum = itemBtnNum + 1
  416. }
  417. console.log(itemBtnNum)
  418. if(itemBtnNum > btnNum){
  419. btnNum = itemBtnNum
  420. }
  421. })
  422. console.log("btnNum=============",btnNum)
  423. me.autoWidth = btnNum * 90
  424. } else {
  425. this.tableObj.list = []
  426. }
  427. setTimeout(() => {
  428. this.tableObj.listLoading = false
  429. }, 100)
  430. })
  431. var send_price = {
  432. name: 'getRemoteCostOfPrice',
  433. parammaps: this.tableObj.getdataListParm.parammaps
  434. }
  435. GetDataByName(send_price).then(response => {
  436. console.log('table总价格数据======>', response )
  437. if (response.data.list !== null) {
  438. this.tableSumMoney = response.data.list[0].totlePrice
  439. this.tableNoMoney = response.data.list[0].unpaid
  440. } else {
  441. this.tableSumMoney = ""
  442. this.tableNoMoney = ""
  443. }
  444. })
  445. },
  446. form_search() {
  447. console.log('点击了查询')
  448. if (this.tableObj.getdataListParm.parammaps.inputDatetime1 !== '' && this.tableObj.getdataListParm.parammaps.inputDatetime1 !== null) {
  449. this.tableObj.getdataListParm.parammaps.beginRemoteBeginDate = parseTime(this.tableObj.getdataListParm.parammaps.inputDatetime1[0], '{y}-{m}-{d}')
  450. this.tableObj.getdataListParm.parammaps.endRemoteBeginDate = parseTime(this.tableObj.getdataListParm.parammaps.inputDatetime1[1], '{y}-{m}-{d}')
  451. } else {
  452. this.tableObj.getdataListParm.parammaps.inputDatetime1 = ''
  453. this.tableObj.getdataListParm.parammaps.beginRemoteBeginDate = ''
  454. this.tableObj.getdataListParm.parammaps.endRemoteBeginDate = ''
  455. }
  456. if (this.tableObj.getdataListParm.parammaps.inputDatetime2 !== '' && this.tableObj.getdataListParm.parammaps.inputDatetime2 !== null) {
  457. this.tableObj.getdataListParm.parammaps.beginRemoteEndDate = parseTime(this.tableObj.getdataListParm.parammaps.inputDatetime2[0], '{y}-{m}-{d}')
  458. this.tableObj.getdataListParm.parammaps.endRemoteEndDate = parseTime(this.tableObj.getdataListParm.parammaps.inputDatetime2[1], '{y}-{m}-{d}')
  459. } else {
  460. this.tableObj.getdataListParm.parammaps.inputDatetime2 = ''
  461. this.tableObj.getdataListParm.parammaps.beginRemoteEndDate = ''
  462. this.tableObj.getdataListParm.parammaps.endRemoteEndDate = ''
  463. }
  464. if (this.tableObj.getdataListParm.parammaps.inputDatetime3 !== '' && this.tableObj.getdataListParm.parammaps.inputDatetime3 !== null) {
  465. this.tableObj.getdataListParm.parammaps.beginPayDate = parseTime(this.tableObj.getdataListParm.parammaps.inputDatetime3[0], '{y}-{m}-{d}')
  466. this.tableObj.getdataListParm.parammaps.endPayDate = parseTime(this.tableObj.getdataListParm.parammaps.inputDatetime3[1], '{y}-{m}-{d}')
  467. } else {
  468. this.tableObj.getdataListParm.parammaps.inputDatetime3 = ''
  469. this.tableObj.getdataListParm.parammaps.beginPayDate = ''
  470. this.tableObj.getdataListParm.parammaps.endPayDate = ''
  471. }
  472. if (this.tableObj.getdataListParm.parammaps.inputDatetime4 !== '' && this.tableObj.getdataListParm.parammaps.inputDatetime4 !== null) {
  473. this.tableObj.getdataListParm.parammaps.beginCollectDate = parseTime(this.tableObj.getdataListParm.parammaps.inputDatetime4[0], '{y}-{m}-{d}')
  474. this.tableObj.getdataListParm.parammaps.endCollectDate = parseTime(this.tableObj.getdataListParm.parammaps.inputDatetime4[1], '{y}-{m}-{d}')
  475. } else {
  476. this.tableObj.getdataListParm.parammaps.inputDatetime4 = ''
  477. this.tableObj.getdataListParm.parammaps.beginCollectDate = ''
  478. this.tableObj.getdataListParm.parammaps.endCollectDate = ''
  479. }
  480. this.tableObj.getdataListParm.offset = 1
  481. this.get_table_data()
  482. },
  483. form_clear() {
  484. console.log('点击了重置')
  485. this.tableObj.getdataListParm.parammaps.customerName = ''
  486. this.tableObj.getdataListParm.parammaps.remoteCode = ''
  487. this.tableObj.getdataListParm.parammaps.customerId = ''
  488. this.tableObj.getdataListParm.parammaps.groupId = ''
  489. this.tableObj.getdataListParm.parammaps.costStatus = ''
  490. this.tableObj.getdataListParm.parammaps.employeeId = ''
  491. this.tableObj.getdataListParm.parammaps.receiverName = ''
  492. this.tableObj.getdataListParm.parammaps.beginRemoteCost = ''
  493. this.tableObj.getdataListParm.parammaps.endRemoteCost = ''
  494. this.tableObj.getdataListParm.parammaps.inputDatetime1 = ''
  495. this.tableObj.getdataListParm.parammaps.inputDatetime2 = ''
  496. this.tableObj.getdataListParm.parammaps.inputDatetime3 = ''
  497. this.tableObj.getdataListParm.parammaps.inputDatetime4 = ''
  498. this.tableObj.getdataListParm.parammaps.beginRemoteBeginDate = ''
  499. this.tableObj.getdataListParm.parammaps.endRemoteBeginDate = ''
  500. this.tableObj.getdataListParm.parammaps.beginRemoteEndDate = ''
  501. this.tableObj.getdataListParm.parammaps.endRemoteEndDate = ''
  502. this.tableObj.getdataListParm.parammaps.beginPayDate = ''
  503. this.tableObj.getdataListParm.parammaps.endPayDate = ''
  504. this.tableObj.getdataListParm.parammaps.beginCollectDate = ''
  505. this.tableObj.getdataListParm.parammaps.endCollectDate = ''
  506. this.tableObj.getdataListParm.offset = 1
  507. this.get_table_data()
  508. },
  509. //客户失去焦点
  510. customer_search_blur(item) {
  511. console.log("客户失去焦点")
  512. this.tableObj.getdataListParm.parammaps.customerId = ""
  513. this.tableObj.getdataListParm.parammaps.customerName = ""
  514. this.customerNameList = []
  515. },
  516. //模糊查询客户
  517. customer_search(queryString, cb) {
  518. console.log('模糊查询输入值', queryString)
  519. GetDataByName({ name: 'getCustomerNameFuzzy', page: 1, offset: 1, pagecount: 10, returntype: 'Map', parammaps: { inputvalue: queryString } }).then(response => {
  520. this.customerNameList = response.data.list
  521. console.log("客户名称下拉框", response)
  522. cb(response.data.list)
  523. })
  524. },
  525. //模糊查询客户选择
  526. change_customer_select(item) {
  527. console.log('客户名称模糊查询选中值', item)
  528. this.tableObj.getdataListParm.parammaps.customerId = item.id
  529. this.tableObj.getdataListParm.parammaps.customerName = item.name
  530. this.$forceUpdate()
  531. },
  532. //清空客户选择
  533. clear_customer_select(item) {
  534. document.activeElement.blur()
  535. this.tableObj.getdataListParm.parammaps.customerId = ""
  536. this.tableObj.getdataListParm.parammaps.customerName = ""
  537. },
  538. //监听 - 集团
  539. change_group(item) {
  540. console.log(item)
  541. console.log(this.create.temp.groupId)
  542. this.create.temp.groupId = item
  543. this.create.getdataListParmCust.parammaps.groupId = item
  544. this.create.temp.customerName = ""
  545. this.create.temp.customerId = ""
  546. this.create.customerNameList = []
  547. this.get_customer_list()
  548. this.$forceUpdate()
  549. },
  550. // 弹窗中的客户
  551. get_customer_list() {
  552. GetDataByName(this.create.getdataListParmCust).then(response => {
  553. if (response.data.list !== null) {
  554. this.create.customerNameList = response.data.list
  555. console.log('弹窗中的客户数据', response.data.list)
  556. } else {
  557. this.create.customerNameList = []
  558. }
  559. })
  560. },
  561. //监听 - 下拉中客户名称
  562. change_customer(item) {
  563. console.log(item)
  564. this.create.temp.customerId = item
  565. },
  566. //小表格中的删除单号
  567. form_deleteCode(item, index) {
  568. console.log('小表格中的删除单号', item)
  569. this.tableArrList.splice(index, 1)
  570. this.stockupIdArr.splice(this.stockupIdArr.indexOf(item.stockupId), 1)
  571. console.log("stockupIdArr===>", this.stockupIdArr)
  572. },
  573. //图片展示
  574. show_pic1() {
  575. this.imageIsShow = true
  576. },
  577. // 查看
  578. form_see(row) {
  579. console.log('点击了编辑', row)
  580. row.barid = String(row.barid)
  581. this.createSee.temp = Object.assign({}, row)
  582. this.remoteData.id = row.id
  583. console.log('点击了查看')
  584. this.createSee.dialogFormVisible = true
  585. },
  586. // 确认回收
  587. form_sure(row) {
  588. console.log('点击了确认', row)
  589. this.reset_sure()
  590. this.sure.temp.id = row.id
  591. this.sure.dialogFormVisible = true
  592. },
  593. // 确认回收 - 重置
  594. reset_sure() {
  595. this.sure.temp.collectDate = ""
  596. },
  597. // 确认回收 - 确认
  598. form_sure_save() {
  599. this.$refs['suretemp'].validate(valid => {
  600. if (valid) {
  601. var send_data = {
  602. name: 'completeRemoteCost',
  603. parammaps: this.sure.temp
  604. }
  605. PostDataByName(send_data).then(response => {
  606. console.log('确认回收参数', send_data)
  607. if (response.msg !== 'fail') {
  608. this.$notify({ title: '成功', message: '提交成功', type: 'success', duration: 2000 })
  609. this.sure.dialogFormVisible = false
  610. this.createSee.dialogFormVisible = false
  611. this.get_table_data()
  612. var send_weixin_data1 = {
  613. name: 'getRemindData',
  614. parammaps: {
  615. "userId":Cookies.get('g_userId'),
  616. "remindId":29,
  617. "remindTypeName":'远程服务',
  618. "rowId":this.sure.temp.id
  619. }
  620. }
  621. GetDataByName(send_weixin_data1).then(response => {
  622. console.log('微信推送(获取参数)======>', response )
  623. if (response.data.message == 'ok') {
  624. var receiverStr = response.data.list[0].receivers
  625. var receiverArr = receiverStr.split(',')
  626. var value1 = response.data.list[0].value1
  627. var value2 = response.data.list[0].value2
  628. var value3 = response.data.list[0].value3
  629. var value4 = response.data.list[0].value4
  630. var send_weixin_data2 = {
  631. "target": receiverArr,
  632. "serviceId": 29,
  633. "content": [
  634. { "color": "#173177","value": value1 },
  635. { "color": "#173177", "value": value2 },
  636. { "color": "#173177", "value": value3 },
  637. { "color": "#173177","value": value4 }
  638. ]
  639. }
  640. wxpush(send_weixin_data2).then(response => {
  641. console.log('微信推送(获取参数)======>', response )
  642. })
  643. // this.tableSumMoney = response.data.list[0].totlePrice
  644. } else {
  645. // this.$notify({ title: '失败', message: '消息推送失败', type: 'error', duration: 2000 })
  646. }
  647. })
  648. if(this.isHome == 'home'){
  649. // 返回首页
  650. this.$router.push({ name: 'Dashboard', params: { isTodo: 'remotep' }})
  651. }
  652. } else {
  653. this.$notify({ title: '失败', message: '提交失败' + response.data, type: 'error', duration: 2000 })
  654. }
  655. })
  656. }
  657. })
  658. },
  659. // 撤销
  660. form_revoke(row) {
  661. console.log('点击了撤销', row)
  662. this.reset_revoke()
  663. this.revoke.temp.id = row.id
  664. this.revoke.dialogFormVisible = true
  665. },
  666. // 撤销 - 重置
  667. reset_revoke() {
  668. this.revoke.temp.revokeReason = ""
  669. },
  670. // 撤销 - 确认
  671. form_revoke_save() {
  672. this.$refs['revoketemp'].validate(valid => {
  673. if (valid) {
  674. var send_data = {
  675. name: 'revokeRemoteCost',
  676. parammaps: this.revoke.temp
  677. }
  678. this.$confirm('是否撤销该条记录?', '提示', {
  679. confirmButtonText: '确定',
  680. cancelButtonText: '取消',
  681. type: 'warning'
  682. }).then(() => {
  683. PostDataByName(send_data).then(response => {
  684. console.log('撤销发送参数', send_data)
  685. if (response.msg !== 'fail') {
  686. this.$notify({ title: '成功', message: '撤销成功', type: 'success', duration: 2000 })
  687. this.revoke.dialogFormVisible = false
  688. this.get_table_data()
  689. var send_weixin_data1 = {
  690. name: 'getRemindData',
  691. parammaps: {
  692. "userId":Cookies.get('g_userId'),
  693. "remindId":30,
  694. "remindTypeName":'远程服务',
  695. "rowId":this.revoke.temp.id
  696. }
  697. }
  698. GetDataByName(send_weixin_data1).then(response => {
  699. console.log('微信推送(获取参数)======>', response )
  700. if (response.data.message == 'ok') {
  701. var receiverStr = response.data.list[0].receivers
  702. var receiverArr = receiverStr.split(',')
  703. var value1 = response.data.list[0].value1
  704. var value2 = response.data.list[0].value2
  705. var value3 = response.data.list[0].value3
  706. var value4 = response.data.list[0].value4
  707. var send_weixin_data2 = {
  708. "target": receiverArr,
  709. "serviceId": 30,
  710. "content": [
  711. { "color": "#173177","value": value1 },
  712. { "color": "#173177", "value": value2 },
  713. { "color": "#173177", "value": value3 },
  714. { "color": "#173177","value": value4 }
  715. ]
  716. }
  717. wxpush(send_weixin_data2).then(response => {
  718. console.log('微信推送(获取参数)======>', response )
  719. })
  720. // this.tableSumMoney = response.data.list[0].totlePrice
  721. } else {
  722. // this.$notify({ title: '失败', message: '消息推送失败', type: 'error', duration: 2000 })
  723. }
  724. })
  725. } else {
  726. this.$notify({ title: '失败', message: '撤销失败' + response.data, type: 'error', duration: 2000 })
  727. }
  728. })
  729. }).catch(() => {
  730. this.$message({
  731. type: 'info',
  732. message: '已取消删除'
  733. });
  734. });
  735. }
  736. })
  737. },
  738. dialog_close(){
  739. this.createSee.dialogFormVisible = false
  740. this.get_table_data()
  741. if(this.isHome == 'home'){
  742. // 返回首页
  743. this.$router.push({ name: 'Dashboard', params: { isTodo: 'remotep' }})
  744. }
  745. },
  746. dialog_sure_close(){
  747. this.sure.dialogFormVisible = false
  748. this.get_table_data()
  749. if(this.isHome == 'home'){
  750. // 返回首页
  751. this.$router.push({ name: 'Dashboard', params: { isTodo: 'remotep' }})
  752. }
  753. },
  754. // 导出
  755. form_export(item) {
  756. this.download.getdataListParm.parammaps = this.tableObj.getdataListParm.parammaps
  757. GetDataByName(this.download.getdataListParm).then(response => {
  758. if (response.data.list !== null) {
  759. this.download.list = response.data.list
  760. } else {
  761. this.download.list = []
  762. }
  763. var excelDatas = [
  764. {
  765. tHeader: ['序号', '远程服务编号', '收款状态', '客户名称', '客户集团', '客户对接人', '服务费用', '支付时间', '收款时间', '服务开始时间', '服务完成时间', '服务内容', '技术人员', '备注', '拜访记录关联', '回访记录关联', '服务总结', '录入时间' ],
  766. filterVal: ['sort', 'remoteCode', 'payStatus', 'customerName', 'groupName', 'receiverName', 'remoteCost', 'payDate', 'collectDate', 'remoteBeginDate', 'remoteEndDate', 'content', 'employeeName', 'remark', 'visitName', 'telvisitName', 'remoteSummary', 'createrDate'],
  767. tableDatas: this.download.list,
  768. sheetName: 'Sheet1'
  769. }
  770. ]
  771. json2excel(excelDatas, '远程服务款项', true, 'xlsx')
  772. })
  773. },
  774. // 导入
  775. form_inport() {
  776. console.log('点击了导入')
  777. }
  778. }
  779. }
  780. </script>
  781. <style lang="scss" scoped>
  782. .search {
  783. padding-top: 10px;
  784. clear: both;
  785. }
  786. .table {
  787. margin-top: 10px;
  788. }
  789. #uploadPic {
  790. width: 700px;
  791. }
  792. .avatar-uploader .el-upload {
  793. border: 1px dashed #d9d9d9;
  794. border-radius: 6px;
  795. cursor: pointer;
  796. position: relative;
  797. overflow: hidden;
  798. }
  799. .avatar-uploader .el-upload:hover {
  800. border-color: #409EFF;
  801. }
  802. .avatar-uploader-icon {
  803. font-size: 28px;
  804. color: #8c939d;
  805. width: 178px;
  806. height: 178px;
  807. line-height: 178px;
  808. text-align: center;
  809. }
  810. .avatar {
  811. width: 178px;
  812. height: 178px;
  813. display: block;
  814. }
  815. // #uploadPic .el-upload-list--picture-card .el-upload-list__item {
  816. // width: 70px;
  817. // height: 70px;
  818. // }
  819. // #uploadPic .el-upload--picture-card {
  820. // width: 70px;
  821. // height: 70px;
  822. // line-height: 70px;
  823. // }
  824. // #uploadPic .hide .el-upload--picture-card {
  825. // display: none;
  826. // }
  827. // // 查看 隐藏删除
  828. // #uploadPicSee {
  829. // height: 70px;
  830. // }
  831. // #uploadPicSee .el-upload-list--picture-card .el-upload-list__item {
  832. // width: 70px;
  833. // height: 70px;
  834. // }
  835. // #uploadPicSee .el-upload--picture-card {
  836. // width: 70px;
  837. // height: 70px;
  838. // line-height: 70px;
  839. // }
  840. // #uploadPicSee
  841. // .el-upload-list--picture-card
  842. // .el-upload-list__item-actions
  843. // .el-upload-list__item-delete {
  844. // display: none;
  845. // }
  846. /deep/ .el-input.is-disabled .el-input__inner {color: #000000!important;}
  847. /deep/ .el-textarea.is-disabled .el-textarea__inner {color: #000000!important;}
  848. /deep/ .el-radio__input.is-disabled+span.el-radio__label {color: #000000!important;}
  849. /deep/ .el-checkbox__input.is-disabled+span.el-checkbox__label { color: #000000!important;}
  850. </style>