list.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  1. <template>
  2. <div>
  3. <i-page-header :title="pageTitle"></i-page-header>
  4. <Card :bordered="false" dis-hover class="ivu-mt">
  5. <div style="padding: 20px 0;">
  6. <!-- <el-select v-model="detial.is_hot" placeholder="是否热门" style="margin:0px 10px 10px 0px;width: 140px;">
  7. <el-option label="选择是否热门" value=""></el-option>
  8. <el-option label="热门" value="1"></el-option>
  9. <el-option label="常规" value="0"></el-option>
  10. </el-select> -->
  11. <Input placeholder="请输入甲方姓名" style="width:140px;" class="mr10" v-model="detial.name" />
  12. <Input placeholder="请输入乙方姓名" style="width:140px;" class="mr10" v-model="detial.to_name" />
  13. <el-select v-model="detial.status" placeholder="签约状态" style="margin:0px 10px 10px 0px;width: 140px;">
  14. <el-option label="选择签约状态" value=""></el-option>
  15. <el-option label="未签约" :value="0"></el-option>
  16. <el-option label="进行中" :value="1"></el-option>
  17. <el-option label="已完成" :value="2"></el-option>
  18. <el-option label="已取消" :value="-1"></el-option>
  19. </el-select>
  20. <!-- <DatePicker style="width: 250px" format="yyyy-MM-dd HH:mm:ss" v-model="detial.time" type="datetimerange"
  21. placement="bottom-start" placeholder="更新时间范围" :options="options"></DatePicker> -->
  22. <el-button type="primary" style="margin-left: 6px;" @click="tapSeach">查询</el-button>
  23. <!-- <el-button type="danger" style="margin-top: 10px;" @click="tapAdd">添加模板</el-button> -->
  24. </div>
  25. <!-- <div class="muser-tab-continer">
  26. <a class="muser-tab-a" :class="detial.status == '' ? 'active' : ''" @click="statusChange('')">全部</a>
  27. <a class="muser-tab-a" :class="detial.status == '1' ? 'active' : ''" @click="statusChange('1')">上线</a>
  28. <a class="muser-tab-a" :class="detial.status == '0' ? 'active' : ''" @click="statusChange('0')">下架</a>
  29. </div> -->
  30. <el-table :data="detial.data" v-loading="detial.loading" :stripe="true" :border="true">
  31. <el-table-column prop="id" label="ID" width="80" align="center"></el-table-column>
  32. <el-table-column prop="contract_no" label="合约编号" width="120" align="center"></el-table-column>
  33. <!-- contract_no -->
  34. <el-table-column prop="name" label="甲方" width="250">
  35. <template slot-scope="scope">
  36. <div v-if="scope.row.content && scope.row.content.jsonAr">
  37. <div v-for="item in scope.row.content.jsonAr" v-if="item.type == 'text' || item.type == 'number'">{{item.name}}: {{item.value}}</div>
  38. </div>
  39. <div v-else>
  40. <div>姓名:{{ scope.row.name }}</div>
  41. <div>电话:{{ scope.row.phone }}</div>
  42. <div>地址:{{ scope.row.address }}</div>
  43. <div>身份证:{{ scope.row.card }}</div>
  44. <div>服务费:{{scope.row.price}}</div>
  45. <div>定金:{{scope.row.deposit}}</div>
  46. <div>尾款:{{scope.row.balance}}</div>
  47. </div>
  48. </template>
  49. </el-table-column>
  50. <el-table-column prop="to_name" label="乙方" width="200">
  51. <template slot-scope="scope">
  52. <div v-if="scope.row.content && scope.row.content.jsonBr">
  53. <div v-for="item in scope.row.content.jsonBr" v-if="item.type == 'text' || item.type == 'number'">{{item.name}}: {{item.value}}</div>
  54. </div>
  55. <div v-else>
  56. <div>姓名:{{ scope.row.to_name }}</div>
  57. <div>电话:{{ scope.row.to_phone }}</div>
  58. <div>地址:{{ scope.row.to_address }}</div>
  59. <div>身份证:{{ scope.row.to_card }}</div>
  60. </div>
  61. </template>
  62. </el-table-column>
  63. <el-table-column prop="total" label="状态" width="100" align="left">
  64. <template slot-scope="scope">
  65. <div>
  66. <el-tag type="primary" size="mini" v-if="scope.row.status == 1">进行中</el-tag>
  67. <el-tag type="warning" size="mini" v-if="scope.row.status == 0">待签约</el-tag>
  68. <el-tag type="success" size="mini" v-if="scope.row.status == 2">已完成</el-tag>
  69. <el-tag type="info" size="mini" v-if="scope.row.status == -1">已取消</el-tag>
  70. </div>
  71. </template>
  72. </el-table-column>
  73. <el-table-column prop="start_time" label="开始时间" width="200">
  74. <template slot-scope="scope">
  75. <div>{{scope.row.start_time | showTime}}</div>
  76. </template>
  77. </el-table-column>
  78. <el-table-column prop="end_time" label="结束时间" width="200">
  79. <template slot-scope="scope">
  80. <div>{{scope.row.end_time | showTime}}</div>
  81. </template>
  82. </el-table-column>
  83. <!-- <el-table-column prop="price" label="服务费" width="200"></el-table-column>
  84. <el-table-column prop="deposit" label="定金" width="100"></el-table-column>
  85. <el-table-column prop="balance" label="余款" width="150"></el-table-column> -->
  86. <!-- <el-table-column prop="give_score" label="赠送积分" width="100"></el-table-column> -->
  87. <!-- <el-table-column prop="describe" label="描述" width="200"></el-table-column> -->
  88. <el-table-column prop="uid_img" label="甲方签名" min-width="160" align="left">
  89. <template slot-scope="scope">
  90. <img v-lazy="scope.row.uid_img" :src="scope.row.uid_img" v-image-preview
  91. style="width: 60px;cursor: pointer;margin-right: 5px;" />
  92. <div v-if="scope.row.check_time">签约时间:{{scope.row.check_time | showTime}}</div>
  93. </template>
  94. </el-table-column>
  95. <el-table-column prop="to_uid_img" label="乙方签名" min-width="160" align="left">
  96. <template slot-scope="scope">
  97. <img v-lazy="scope.row.to_uid_img" :src="scope.row.to_uid_img" v-image-preview
  98. style="width: 60px;cursor: pointer;margin-right: 5px;" />
  99. <div v-if="scope.row.to_check_time">签约时间:{{scope.row.to_check_time | showTime}}</div>
  100. </template>
  101. </el-table-column>
  102. <!-- <el-table-column prop="descs" label="详情图" width="160" align="left">
  103. <template slot-scope="scope">
  104. <img v-for="(item,index) in scope.row.descs" :key="index" v-lazy="item" :src="item" v-image-preview style="width: 60px;cursor: pointer;margin-right: 5px;"/>
  105. </template>
  106. </el-table-column> -->
  107. <el-table-column prop="mark" label="附加条款" width="150"></el-table-column>
  108. <el-table-column prop="reason" label="终止原因" width="200"></el-table-column>
  109. <el-table-column prop="handle" label="操作" width="150" align="center">
  110. <template slot-scope="scope">
  111. <div><el-button plain size="mini" @click="tapDk(scope.row)">查看打卡</el-button></div>
  112. <br />
  113. <div><el-button plain size="mini" @click="tapPj(scope.row)">查看评价</el-button></div>
  114. <br />
  115. <div><el-button plain size="mini" v-if="scope.row.status == 1" @click="tapZz(scope.row)">终止合同</el-button></div>
  116. </template>
  117. </el-table-column>
  118. </el-table>
  119. <div class="acea-row row-right page">
  120. <Page :total="detial.pageCount" show-elevator show-total @on-change="tapPage"
  121. :page-size="detial.pageSize" />
  122. </div>
  123. </Card>
  124. <Modal v-model="dialogVisible" :title="title" @on-cancel="editClose" width="800">
  125. <div>
  126. <Table :columns="columns" :data="dk.data"></Table>
  127. <div class="acea-row row-right page">
  128. <Page :total="dk.pageCount" show-elevator show-total @on-change="tapPages"
  129. :page-size="dk.pageSize" />
  130. </div>
  131. </div>
  132. </Modal>
  133. <!-- 终止合同 模态框 -->
  134. <Modal v-model="zzdialogVisibles" :title="title" @on-cancel="editClose" width="800" >
  135. <div style="padding: 20px;">
  136. <el-form :model="form" label-width="100px">
  137. <el-form-item label="终止原因">
  138. <el-input type="textarea" v-model="reason" placeholder="请输入终止合同的原因" rows="4"></el-input>
  139. </el-form-item>
  140. </el-form>
  141. </div>
  142. <span slot="footer" class="dialog-footer">
  143. <el-button @click="zzdialogVisibles = false">取 消</el-button>
  144. <el-button type="primary" @click="confirmEndContract">确 定</el-button>
  145. </span>
  146. </Modal>
  147. <Modal v-model="dialogVisibles" :title="title" @on-cancel="editCloses" width="800">
  148. <div>
  149. {{content || '暂无评价'}}
  150. </div>
  151. </Modal>
  152. </div>
  153. </template>
  154. <script>
  155. import {
  156. SystemShowTemplateList,
  157. SystemShowTemplateAdd
  158. } from "../../../api/system/showTemplate";
  159. import IPageHeader from "../../../layouts/system/page-header/index";
  160. import UiUpload from "@/ui/upload/index";
  161. import Setting from '@/setting';
  162. import {
  163. getSigningList,
  164. getDkList,
  165. getPjList,
  166. endComment
  167. } from '@/api/system/signing.js'
  168. export default {
  169. name: "system_showTemplate_list",
  170. components: {
  171. UiUpload,
  172. IPageHeader
  173. },
  174. computed: {},
  175. data() {
  176. return {
  177. checkItem: {
  178. id: 0
  179. },
  180. zzdialogVisibles: false,
  181. reason: '',//终止原因
  182. dialogVisibles: false,
  183. pageTitle: '预约列表',
  184. upHeaders: {},
  185. upUrl: "",
  186. cateData: [],
  187. dk: {
  188. uid: 0,
  189. contract_id: 0,
  190. data: [],
  191. page: 1,
  192. loading: true,
  193. pageSize: 0,
  194. pageCount: 0,
  195. },
  196. detial: {
  197. name: '',
  198. to_name: '',
  199. status: "",
  200. data: [],
  201. page: 1,
  202. loading: true,
  203. pageSize: 0,
  204. pageCount: 0,
  205. },
  206. columns: [{
  207. title: '打卡时间',
  208. key: 'create_time'
  209. },
  210. {
  211. title: '经度',
  212. key: 'longitude'
  213. },
  214. {
  215. title: '纬度',
  216. key: 'latitude'
  217. }
  218. ],
  219. options: {
  220. shortcuts: [{
  221. text: '今天',
  222. value() {
  223. const end = new Date();
  224. const start = new Date();
  225. start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(), new Date()
  226. .getDate()));
  227. return [start, end];
  228. }
  229. },
  230. {
  231. text: '昨天',
  232. value() {
  233. const end = new Date();
  234. const start = new Date();
  235. start.setTime(start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(),
  236. new Date().getDate() - 1)));
  237. end.setTime(end.setTime(new Date(new Date().getFullYear(), new Date().getMonth(),
  238. new Date().getDate())));
  239. return [start, end];
  240. }
  241. },
  242. {
  243. text: '最近7天',
  244. value() {
  245. const end = new Date();
  246. const start = new Date();
  247. start.setTime(start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(),
  248. new Date().getDate() - 6)));
  249. return [start, end];
  250. }
  251. },
  252. {
  253. text: '最近30天',
  254. value() {
  255. const end = new Date();
  256. const start = new Date();
  257. start.setTime(start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(),
  258. new Date().getDate() - 29)));
  259. return [start, end];
  260. }
  261. },
  262. {
  263. text: '本月',
  264. value() {
  265. const end = new Date();
  266. const start = new Date();
  267. start.setTime(start.setTime(new Date(new Date().getFullYear(), new Date().getMonth(),
  268. 1)));
  269. return [start, end];
  270. }
  271. },
  272. {
  273. text: '本年',
  274. value() {
  275. const end = new Date();
  276. const start = new Date();
  277. start.setTime(start.setTime(new Date(new Date().getFullYear(), 0, 1)));
  278. return [start, end];
  279. }
  280. }
  281. ]
  282. },
  283. dialogVisible: false,
  284. title: "",
  285. add_parms_name: "",
  286. formActiveName: "tab_base",
  287. form: {
  288. id: "",
  289. imgs: [],
  290. // descs : [],
  291. status: 1,
  292. is_hot: 0,
  293. is_recommend: 0,
  294. is_init: 0,
  295. data: [],
  296. },
  297. defaultParms: [],
  298. content: '',
  299. }
  300. },
  301. created() {
  302. this.initView();
  303. },
  304. filters: {
  305. showTime(val) {
  306. let date = new Date(val * 1000)
  307. const year = date.getFullYear();
  308. const month = String(date.getMonth() + 1).padStart(2, '0');
  309. const day = String(date.getDate()).padStart(2, '0');
  310. return `${year}-${month}-${day}`;
  311. }
  312. },
  313. methods: {
  314. /**
  315. * 添加
  316. */
  317. tapAdd: function(sassid) {
  318. var that = this;
  319. this.dialogVisible = true;
  320. that.add_parms_name = "",
  321. that.formActiveName = "tab_base",
  322. this.$refs['form'].resetFields();
  323. this.form = this.$utils.resetFields(this.form, {
  324. imgs: [],
  325. // descs : [],
  326. status: 1,
  327. is_hot: 0,
  328. is_recommend: 0,
  329. data: JSON.parse(JSON.stringify(that.defaultParms)),
  330. });
  331. },
  332. initView: function() {
  333. var upHeaders = {};
  334. this.upUrl = Setting.apiBaseURL + "/systemv1/upload/index";
  335. const token = this.$utils.util.cookies.get('system_token');
  336. if (token) {
  337. upHeaders['SYSTEM-ACC-TOKEN'] = token;
  338. }
  339. this.upHeaders = upHeaders;
  340. this.getData();
  341. },
  342. removeParms: function(index) {
  343. this.$delete(this.form.data, index);
  344. },
  345. addParms: function() {
  346. var name = this.add_parms_name;
  347. if (this.add_parms_name) {
  348. this.form.data.push({
  349. title: name,
  350. content: "",
  351. })
  352. this.add_parms_name = "";
  353. }
  354. },
  355. statusChange: function(status) {
  356. this.detial.status = status;
  357. this.detial.page = 1
  358. this.getData()
  359. },
  360. /**
  361. * 上传文件
  362. * @param res
  363. */
  364. onUpload: function(res) {
  365. if (res.code == -1) {
  366. Notice.error({
  367. title: "系统提示",
  368. content: res.msg
  369. });
  370. } else {
  371. this.form.imgs.push(res.data.img);
  372. }
  373. },
  374. onUploadDescs: function(res) {
  375. if (res.code == -1) {
  376. Notice.error({
  377. title: "系统提示",
  378. content: res.msg
  379. });
  380. } else {
  381. this.form.descs.push(res.data.img);
  382. }
  383. },
  384. tapEdit: function(row) {
  385. this.formActiveName = "tab_base";
  386. this.form = JSON.parse(JSON.stringify(row));
  387. this.dialogVisible = true;
  388. this.title = "编辑模板";
  389. },
  390. getDk() {
  391. this.dk.loading = true;
  392. getDkList(this.dk).then(res => {
  393. this.dk.loading = false;
  394. this.dk.data = res.data.list;
  395. this.dk.pageSize = res.data.pageSize;
  396. this.dk.pageCount = res.data.pageCount;
  397. }).catch(err => {
  398. this.dk.loading = false;
  399. this.$alert('网络繁忙,加载失败,请稍等片刻在尝试!', '系统提示');
  400. });
  401. },
  402. getPj(id) {
  403. this.content = ''
  404. getPjList({
  405. contract_id: id
  406. }).then(res => {
  407. if(res.data && res.data.list && res.data.list.length > 0) {
  408. this.content = res.data.list[0].content
  409. }
  410. })
  411. },
  412. tapDk(item) {
  413. this.dialogVisible = true;
  414. this.title = "打卡记录";
  415. // this.dk.uid = item.to_uid
  416. // this.dk.contract_id = item.id
  417. this.getDk()
  418. },
  419. tapZz(item) {
  420. this.checkItem = item
  421. this.zzdialogVisibles = true;
  422. this.title = "终止合同";
  423. },
  424. tapPj(item) {
  425. this.dialogVisibles = true;
  426. this.title = "用户评价";
  427. console.log(item,item.contract_id)
  428. // this.dk.uid = item.to_uid
  429. // this.dk.contract_id = item.id
  430. this.getPj(item.id)
  431. },
  432. //关闭
  433. editClose: function() {
  434. this.dialogVisible = false;
  435. this.zzdialogVisibles = false;
  436. },
  437. editCloses: function() {
  438. this.dialogVisibles = false;
  439. },
  440. // 确认终止合同
  441. confirmEndContract: function() {
  442. if (!this.reason) {
  443. this.$alert('请输入终止合同的原因', '系统提示');
  444. return;
  445. }
  446. let loading = this.$loading("提交数据中...");
  447. endComment({
  448. id: this.checkItem.id,
  449. reason: this.reason
  450. }).then(res => {
  451. loading.close();
  452. if (res.code == 200) {
  453. this.zzdialogVisibles = false;
  454. this.$Message.success("操作成功");
  455. this.getData();
  456. } else {
  457. this.$alert(res.msg, '系统提示');
  458. }
  459. }).catch(err => {
  460. loading.close();
  461. this.$alert("网络繁忙,加载失败,请稍等片刻在尝试!", '系统提示');
  462. });
  463. },
  464. removeImgs: function(index) {
  465. this.$delete(this.form.imgs, index);
  466. },
  467. removeDescs: function(index) {
  468. this.$delete(this.form.descs, index);
  469. },
  470. /**
  471. * 修改数据
  472. */
  473. subAdmin: function(e) {
  474. this.$refs['form'].validate((valid) => {
  475. if (valid) {
  476. let loading = this.$loading("提交数据中...");
  477. var data = {};
  478. for (var i in this.form) {
  479. data[i] = this.form[i];
  480. }
  481. SystemShowTemplateAdd(data)
  482. .then(res => {
  483. loading.close();
  484. if (res.code == 200) {
  485. this.dialogVisible = false;
  486. this.$Message.success("操作成功");
  487. this.getData();
  488. } else {
  489. this.$alert(res.msg, '系统提示');
  490. }
  491. })
  492. .catch(err => {
  493. loading.close();
  494. this.$alert("网络繁忙,加载失败,请稍等片刻在尝试!", '系统提示');
  495. });
  496. }
  497. });
  498. },
  499. //搜索栏目
  500. tapSeach: function() {
  501. this.detial.page = 1;
  502. this.getData();
  503. },
  504. //分页
  505. tapPage: function(page) {
  506. this.detial.page = page;
  507. this.getData();
  508. },
  509. tapPages(page) {
  510. this.dk.page = page;
  511. this.getDk();
  512. },
  513. getData: function() {
  514. var data = {};
  515. var that = this;
  516. this.detial.loading = true;
  517. getSigningList(this.detial).then(res => {
  518. this.detial.loading = false;
  519. this.detial.data = res.data.list.map(item => {
  520. if(item.content) {
  521. try {
  522. item.content = JSON.parse(JSON.parse(item.content))
  523. } catch (error) {
  524. //TODO handle the exception
  525. item.content = JSON.parse(item.content)
  526. }
  527. }
  528. console.log(item.content);
  529. return item
  530. });
  531. this.detial.pageSize = res.data.pageSize;
  532. this.detial.pageCount = res.data.pageCount;
  533. // if(that.defaultParms.length<=0 && res.data.defaultParms){
  534. // that.defaultParms = res.data.defaultParms;
  535. // }
  536. }).catch(err => {
  537. this.detial.loading = false;
  538. this.$alert('网络繁忙,加载失败,请稍等片刻在尝试!', '系统提示');
  539. });
  540. },
  541. }
  542. }
  543. </script>
  544. <style scoped>
  545. iframe.videoIframe {
  546. border: 0px;
  547. padding: 0px;
  548. }
  549. .el-dialog__body {
  550. padding: 0px;
  551. }
  552. .el-dialog__body iframe body {
  553. padding: 0px;
  554. }
  555. .muser-tab-continer {
  556. border: 1px solid #EEEEEE
  557. }
  558. a.muser-tab-a {
  559. display: inline-block;
  560. padding: 0px 28px;
  561. height: 42px;
  562. line-height: 42px;
  563. border-bottom: 3px solid transparent;
  564. font-size: 17px;
  565. color: #595959;
  566. }
  567. a.muser-tab-a.active {
  568. border-bottom: 3px solid #EA312B;
  569. color: #EA312B
  570. }
  571. .upimg-item {
  572. width: 82px;
  573. height: 82px;
  574. margin-right: 5px;
  575. overflow: hidden;
  576. float: left;
  577. margin-bottom: 5px;
  578. position: relative;
  579. }
  580. .upimg-item img {
  581. width: 82px;
  582. cursor: pointer;
  583. }
  584. .img-remove-btn {
  585. position: absolute;
  586. top: 0px;
  587. right: 0px;
  588. font-size: 24px;
  589. }
  590. </style>