You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

489 lines
14 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <div style="display: flex">
  3. <div :style="`width: ${window.pageWidth - 120}px;`">
  4. <el-table
  5. :data="phoneFollowUp"
  6. border
  7. :height="
  8. window.pageHeight < 600
  9. ? 124
  10. : Math.floor((window.pageHeight - 228) / 3)
  11. "
  12. size="small"
  13. highlight-current-row
  14. ref="phoneFollowUp"
  15. @row-click="rowick"
  16. >
  17. <el-table-column type="index" label="序号" width="50" align="center" />
  18. <el-table-column
  19. prop="followUpContent"
  20. label="随访内容"
  21. min-width="250"
  22. />
  23. <el-table-column
  24. prop="replyContent"
  25. label="回复内容"
  26. min-width="200"
  27. align="center"
  28. />
  29. <el-table-column
  30. prop="isComplete"
  31. label="完成"
  32. min-width="40"
  33. align="center"
  34. >
  35. <template slot-scope="scope">
  36. <el-checkbox
  37. v-model="scope.row.isComplete"
  38. true-label="Y"
  39. false-label="N"
  40. disabled
  41. />
  42. </template>
  43. </el-table-column>
  44. <el-table-column
  45. prop="planFollowDate"
  46. label="随访日期"
  47. min-width="100"
  48. align="center"
  49. >
  50. <template slot-scope="scope">
  51. <div>
  52. {{ moment(scope.row.planFollowDate).format("yyyy-MM-DD") }}
  53. </div>
  54. </template>
  55. </el-table-column>
  56. <el-table-column
  57. prop="lastModifierName"
  58. label="修改人"
  59. min-width="80"
  60. align="center"
  61. />
  62. <el-table-column
  63. prop="lastModificationTime"
  64. label="修改日期"
  65. min-width="100"
  66. align="center"
  67. >
  68. <template slot-scope="scope">
  69. <div>{{ moment(scope.row.creationTime).format("yyyy-MM-DD") }}</div>
  70. </template>
  71. </el-table-column>
  72. <el-table-column
  73. prop="creatorName"
  74. label="登记人"
  75. min-width="80"
  76. align="center"
  77. />
  78. <el-table-column
  79. prop="creationTime"
  80. label="登记日期"
  81. min-width="100"
  82. align="center"
  83. >
  84. <template slot-scope="scope">
  85. <div>{{ moment(scope.row.creationTime).format("yyyy-MM-DD") }}</div>
  86. </template>
  87. </el-table-column>
  88. </el-table>
  89. </div>
  90. <div style="width: 120px; margin-top: 50px">
  91. <div style="margin-left: 10px">
  92. <el-button class="commonbutton" type="primary" @click="btnAdd"
  93. >新增随访</el-button
  94. >
  95. </div>
  96. <div style="margin: 10px">
  97. <el-button class="commonbutton" type="primary" @click="btnEdit"
  98. >编辑随访</el-button
  99. >
  100. </div>
  101. <div style="margin-left: 10px">
  102. <el-button class="commonbutton" type="primary" @click="btnDel"
  103. >删除随访</el-button
  104. >
  105. </div>
  106. </div>
  107. <el-dialog
  108. :title="title == 1 ? '新增' : '修改'"
  109. :visible.sync="dialogVisible"
  110. width="75%"
  111. :close-on-click-modal="false"
  112. >
  113. <el-form ref="form" :model="form" label-width="80px">
  114. <el-row>
  115. <el-col :span="title==1?'4':'6'">
  116. <el-form-item label="编号">
  117. <el-input v-model="form.id" disabled size="small"></el-input>
  118. </el-form-item>
  119. </el-col>
  120. <el-col :span="6" v-if="title == 1">
  121. <el-form-item label="生成模式">
  122. <el-select v-model="mode" placeholder="生成模式" size="small">
  123. <el-option
  124. v-for="item in modes"
  125. :key="item.id"
  126. :label="item.displayName"
  127. :value="item.id"
  128. ></el-option>
  129. </el-select>
  130. </el-form-item>
  131. </el-col>
  132. <el-col :span="4" v-if="title == 1&&mode == 1">
  133. <el-form-item label="间隔天数">
  134. <el-input v-model="form.intervalDays" size="small"></el-input>
  135. </el-form-item>
  136. </el-col>
  137. <el-col :span="4" v-if="title == 1&&mode == 1">
  138. <el-form-item label="生成次数">
  139. <el-input v-model="form.generateCount" size="small"></el-input>
  140. </el-form-item>
  141. </el-col>
  142. <el-col :span="4" v-if="title == 1&&mode == 1">
  143. <el-form-item label="开始时间">
  144. <el-date-picker
  145. placeholder="选择日期时间"
  146. size="small"
  147. v-model="form.startDate"
  148. value-format="yyyy-MM-dd"
  149. editable
  150. style="width: 177px"
  151. >
  152. </el-date-picker>
  153. </el-form-item>
  154. </el-col>
  155. <el-col :span="4" v-if="title == 1&&mode == 0">
  156. <el-form-item label="随访日期">
  157. <el-date-picker
  158. placeholder="选择日期时间"
  159. size="small"
  160. v-model="form.planFollowDate"
  161. value-format="yyyy-MM-dd"
  162. editable
  163. style="width: 177px"
  164. >
  165. </el-date-picker>
  166. </el-form-item>
  167. </el-col>
  168. <el-col :span="4" v-if="title != 1">
  169. <el-form-item label="是否完成">
  170. <el-checkbox
  171. v-model="form.isComplete"
  172. true-label="Y"
  173. false-label="N"
  174. />
  175. </el-form-item>
  176. </el-col>
  177. <el-col :span="4" v-if="title !=1">
  178. <el-form-item label="随访日期">
  179. <el-date-picker
  180. placeholder="选择日期时间"
  181. size="small"
  182. v-model="form.planFollowDate"
  183. value-format="yyyy-MM-dd"
  184. editable
  185. style="width: 177px"
  186. >
  187. </el-date-picker>
  188. </el-form-item>
  189. </el-col>
  190. </el-row>
  191. <el-row>
  192. <el-col :span="24">
  193. <el-form-item label="随访内容">
  194. <!-- <el-input
  195. v-model="form.parmValue"
  196. size="small"
  197. ></el-input> -->
  198. <el-input v-model="form.followUpContent"></el-input>
  199. </el-form-item>
  200. </el-col>
  201. </el-row>
  202. <el-row>
  203. <el-col :span="24" v-if="title != 1">
  204. <el-form-item label="回复内容">
  205. <!-- <el-input
  206. v-model="form.parmValue"
  207. size="small"
  208. ></el-input> -->
  209. <el-input v-model="form.replyContent"></el-input>
  210. </el-form-item>
  211. </el-col>
  212. </el-row>
  213. <el-row>
  214. <el-divider></el-divider>
  215. <el-col :span="4" style="margin-left: 15px">
  216. <el-form-item label="创建者">
  217. <el-input
  218. v-model="form.creatorName"
  219. disabled
  220. size="small"
  221. ></el-input>
  222. </el-form-item>
  223. </el-col>
  224. <el-col :span="6">
  225. <el-form-item label="创建时间">
  226. <el-input
  227. :value="form.creationTime | dateFormat"
  228. disabled
  229. size="small"
  230. ></el-input>
  231. </el-form-item>
  232. </el-col>
  233. <el-col :span="4">
  234. <el-form-item label="修改者">
  235. <el-input
  236. v-model="form.lastModifierName"
  237. disabled
  238. size="small"
  239. ></el-input>
  240. </el-form-item>
  241. </el-col>
  242. <el-col :span="6">
  243. <el-form-item label="修改时间">
  244. <el-input
  245. style="width: 85%"
  246. :value="form.lastModificationTime | dateFormat"
  247. disabled
  248. size="small"
  249. ></el-input>
  250. </el-form-item>
  251. </el-col>
  252. </el-row>
  253. </el-form>
  254. <span slot="footer" class="dialog-footer">
  255. <el-button @click="dialogVisible = false" class="difference"
  256. > </el-button
  257. >
  258. <el-button type="primary" @click="addoredit" class="commonbutton"
  259. > </el-button
  260. >
  261. </span>
  262. </el-dialog>
  263. </div>
  264. </template>
  265. <script>
  266. import moment from "moment";
  267. import { mapState } from "vuex";
  268. import { dddw } from "../../utlis/proFunc";
  269. import { getapi, postapi, putapi, deletapi } from "../../api/api";
  270. export default {
  271. components: {},
  272. data() {
  273. return {
  274. phoneFollowUp: [], // 电话随访
  275. dialogVisible: false,
  276. curRow: {},
  277. form: {
  278. followUpContent: "",
  279. replyContent: "",
  280. followUpId: "",
  281. planFollowDate: "",
  282. isComplete: "",
  283. generateCount: "",
  284. intervalDays: "",
  285. generateCount: "",
  286. replyContent:""
  287. },
  288. mode: "0",
  289. modes: [
  290. {
  291. id: "0",
  292. displayName: "生成单条",
  293. },
  294. {
  295. id: "1",
  296. displayName: "生成多条",
  297. },
  298. ],
  299. title: "",
  300. };
  301. },
  302. created() {},
  303. updated() {
  304. this.$nextTick(() => {
  305. this.$refs["phoneFollowUp"].doLayout();
  306. });
  307. },
  308. //挂载完成
  309. mounted() {
  310. this.dictInit();
  311. },
  312. computed: {
  313. ...mapState(["window", "dataTransOpts", "dict", "patientRegister"]),
  314. },
  315. methods: {
  316. dddw,
  317. moment,
  318. // 初始化字典信息
  319. dictInit() {
  320. // 获取组合项目包含的明细
  321. postapi("/api/app/Asbitem/GetSimpleAsbitemWithDetails").then((res) => {
  322. if (res.code > -1) this.asbItems = res.data;
  323. });
  324. },
  325. getLists() {
  326. postapi("/api/app/PhoneFollowUp/GetList", {
  327. followUpId: this.dataTransOpts.tableS.patient_register.followUpId,
  328. }).then((res) => {
  329. if (res.code > -1) this.phoneFollowUp = res.data;
  330. });
  331. },
  332. addoredit() {
  333. if (this.title == 1) {
  334. if (this.mode == 1) {
  335. if (this.form.intervalDays == "") {
  336. this.$message.warning("请输入间隔天数");
  337. } else if (this.form.startDate == "") {
  338. this.$message.warning("请选择开始时间");
  339. } else if (this.form.generateCount == "") {
  340. this.$message.warning("请输入生成次数");
  341. } else {
  342. postapi("/api/app/PhoneFollowUp/AutoCreate", {
  343. followUpId: this.dataTransOpts.tableS.patient_register.followUpId,
  344. intervalDays: this.form.intervalDays,
  345. startDate: this.form.startDate,
  346. followUpContent: this.form.followUpContent,
  347. generateCount: this.form.generateCount,
  348. }).then((res) => {
  349. if (res.code > -1) {
  350. this.getLists();
  351. this.dialogVisible = false;
  352. this.mode = "0";
  353. }
  354. });
  355. }
  356. } else {
  357. if (this.form.planFollowDate == "") {
  358. this.$message.warning("请选择随访日期");
  359. } else {
  360. postapi("/api/app/PhoneFollowUp/Create", {
  361. followUpId: this.dataTransOpts.tableS.patient_register.followUpId,
  362. planFollowDate: this.form.planFollowDate,
  363. followUpContent: this.form.followUpContent,
  364. replyContent: this.form.replyContent,
  365. }).then((res) => {
  366. if (res.code > -1) {
  367. this.getLists();
  368. this.dialogVisible = false;
  369. this.mode = "0";
  370. }
  371. });
  372. }
  373. }
  374. } else {
  375. postapi("/api/app/PhoneFollowUp/Update", {
  376. phoneFollowUpId: this.form.id,
  377. planFollowDate: this.form.planFollowDate,
  378. followUpContent: this.form.followUpContent,
  379. replyContent: this.form.replyContent,
  380. isComplete: this.form.isComplete,
  381. }).then((res) => {
  382. if (res.code > -1) {
  383. this.getLists();
  384. this.dialogVisible = false;
  385. this.mode = "0";
  386. }
  387. });
  388. }
  389. },
  390. rowick(row) {
  391. this.curRow = { ...row };
  392. },
  393. // 设置颜色
  394. setColor(checkCompleteFlag) {
  395. let color = "#52555F";
  396. switch (checkCompleteFlag) {
  397. case "0":
  398. color = "#FF5054";
  399. break;
  400. case "2":
  401. color = "#396FFA";
  402. break;
  403. default:
  404. break;
  405. }
  406. return color;
  407. },
  408. // 新增
  409. btnAdd() {
  410. this.dialogVisible = true;
  411. this.title = 1;
  412. this.form = this.$options.data().form;
  413. },
  414. // 编辑
  415. btnEdit() {
  416. if (this.curRow.id == undefined) {
  417. this.$message.warning("请选择操作的数据");
  418. } else {
  419. this.title = 2;
  420. this.dialogVisible = true;
  421. postapi("/api/app/PhoneFollowUp/Get", {
  422. phoneFollowUpId: this.curRow.id,
  423. }).then((res) => {
  424. if (res.code != -1) {
  425. this.form = res.data;
  426. }
  427. });
  428. }
  429. },
  430. // 删除
  431. btnDel() {
  432. if (this.curRow.id == undefined) {
  433. this.$message.warning("请选择删除的数据");
  434. } else {
  435. this.$confirm("是否确认删除,是否继续", "提示", {
  436. confirmButtonText: "确定",
  437. cancelButtonText: "取消",
  438. type: "warning",
  439. cancelButtonClass: "difference",
  440. confirmButtonClass: "commonbutton",
  441. })
  442. .then(() => {
  443. postapi("/api/app/PhoneFollowUp/Delete", {
  444. phoneFollowUpId: this.curRow.id,
  445. }).then((res) => {
  446. if (res.code != -1) {
  447. this.curRow = this.$options.data().curRow;
  448. this.getLists();
  449. //this.$message.success("删除成功");
  450. }
  451. });
  452. })
  453. .catch(() => {});
  454. }
  455. },
  456. },
  457. //监听事件
  458. watch: {
  459. //人员ID未切换换时 也可以强制刷新数据
  460. "dataTransOpts.refresh.register_check_asbitem.M": {
  461. // immediate:true,
  462. handler(newVal, oldVal) {
  463. console.log(
  464. `watch 人员登记 newVal:${newVal} oldVal:${oldVal} registerCheckId: ${this.dataTransOpts.tableS.patient_register.id}`
  465. );
  466. // if (newVal != oldVal)
  467. this.getLists();
  468. },
  469. },
  470. },
  471. };
  472. </script>
  473. <style scoped>
  474. @import "../../assets/css/global.css";
  475. .box {
  476. display: flex;
  477. }
  478. </style>