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.

359 lines
10 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. <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. ? 150
  10. : Math.floor((window.pageHeight+20) / 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 prop="patientName" label="姓名" min-width="80" />
  19. <el-table-column
  20. prop="mobileTelephone"
  21. label="手机号"
  22. min-width="130"
  23. align="center"
  24. />
  25. <!-- <el-table-column prop="SmsTypeName" label="短信类别" min-width="80" align="center">
  26. </el-table-column> -->
  27. <el-table-column prop="content" label="短信内容" min-width="300" />
  28. <el-table-column
  29. prop="isComplete"
  30. label="完成"
  31. min-width="40"
  32. align="center"
  33. >
  34. <template slot-scope="scope">
  35. <el-checkbox
  36. v-model="scope.row.isComplete"
  37. true-label="Y"
  38. false-label="N"
  39. disabled
  40. />
  41. </template>
  42. </el-table-column>
  43. <el-table-column prop="planSendDate" label="推送时间" min-width="300" />
  44. <el-table-column
  45. prop="lastModifierName"
  46. label="修改人"
  47. min-width="80"
  48. align="center"
  49. />
  50. <el-table-column
  51. prop="lastModificationTime"
  52. label="修改日期"
  53. min-width="100"
  54. align="center"
  55. >
  56. <template slot-scope="scope">
  57. <div>{{ moment(scope.row.creationTime).format("yyyy-MM-DD") }}</div>
  58. </template>
  59. </el-table-column>
  60. <el-table-column
  61. prop="creatorName"
  62. label="登记人"
  63. min-width="80"
  64. align="center"
  65. />
  66. <el-table-column
  67. prop="creationTime"
  68. label="登记日期"
  69. min-width="100"
  70. align="center"
  71. >
  72. <template slot-scope="scope">
  73. <div>{{ moment(scope.row.creationTime).format("yyyy-MM-DD") }}</div>
  74. </template>
  75. </el-table-column>
  76. </el-table>
  77. </div>
  78. <div style="width: 120px; margin-top: 50px">
  79. <div style="margin-left: 10px">
  80. <el-button class="commonbutton" type="primary" @click="btnAdd"
  81. >新增随访</el-button
  82. >
  83. </div>
  84. <!-- <div style="margin: 10px;">
  85. <el-button class="commonbutton" type="primary" @click="btnEdit">编辑随访</el-button>
  86. </div> -->
  87. <div style="margin: 10px">
  88. <el-button class="commonbutton" type="primary" @click="btnDel"
  89. >删除随访</el-button
  90. >
  91. </div>
  92. </div>
  93. <el-dialog
  94. :title="title == 1 ? '新增' : '修改'"
  95. :visible.sync="dialogVisible"
  96. width="75%"
  97. :close-on-click-modal="false"
  98. >
  99. <el-form ref="form" :model="form" label-width="80px">
  100. <el-row>
  101. <el-col :span="6">
  102. <el-form-item label="编号">
  103. <el-input v-model="form.id" disabled size="small"></el-input>
  104. </el-form-item>
  105. </el-col>
  106. <el-col :span="4">
  107. <el-form-item label="间隔天数">
  108. <el-input v-model="form.intervalDays" size="small"></el-input>
  109. </el-form-item>
  110. </el-col>
  111. <el-col :span="4">
  112. <el-form-item label="生成次数">
  113. <el-input v-model="form.generateCount" size="small"></el-input>
  114. </el-form-item>
  115. </el-col>
  116. <el-col :span="4">
  117. <el-form-item label="开始时间">
  118. <el-date-picker
  119. placeholder="选择日期时间"
  120. size="small"
  121. v-model="form.startDate"
  122. value-format="yyyy-MM-dd"
  123. editable
  124. style="width: 177px"
  125. >
  126. </el-date-picker>
  127. </el-form-item>
  128. </el-col>
  129. </el-row>
  130. <el-row>
  131. <el-col :span="24">
  132. <el-form-item label="短信内容">
  133. <!-- <el-input
  134. v-model="form.parmValue"
  135. size="small"
  136. ></el-input> -->
  137. <el-input v-model="form.content"></el-input>
  138. </el-form-item>
  139. </el-col>
  140. </el-row>
  141. <el-row>
  142. <el-divider></el-divider>
  143. <el-col :span="4" style="margin-left: 15px">
  144. <el-form-item label="创建者">
  145. <el-input
  146. v-model="form.creatorName"
  147. disabled
  148. size="small"
  149. ></el-input>
  150. </el-form-item>
  151. </el-col>
  152. <el-col :span="6">
  153. <el-form-item label="创建时间">
  154. <el-input
  155. :value="form.creationTime | dateFormat"
  156. disabled
  157. size="small"
  158. ></el-input>
  159. </el-form-item>
  160. </el-col>
  161. <el-col :span="4">
  162. <el-form-item label="修改者">
  163. <el-input
  164. v-model="form.lastModifierName"
  165. disabled
  166. size="small"
  167. ></el-input>
  168. </el-form-item>
  169. </el-col>
  170. <el-col :span="6">
  171. <el-form-item label="修改时间">
  172. <el-input
  173. style="width: 85%"
  174. :value="form.lastModificationTime | dateFormat"
  175. disabled
  176. size="small"
  177. ></el-input>
  178. </el-form-item>
  179. </el-col>
  180. </el-row>
  181. </el-form>
  182. <span slot="footer" class="dialog-footer">
  183. <el-button @click="dialogVisible = false" class="difference"
  184. > </el-button
  185. >
  186. <el-button type="primary" @click="addoredit" class="commonbutton"
  187. > </el-button
  188. >
  189. </span>
  190. </el-dialog>
  191. </div>
  192. </template>
  193. <script>
  194. import moment from "moment";
  195. import { mapState } from "vuex";
  196. import { dddw } from "../../utlis/proFunc";
  197. import { getapi, postapi, putapi, deletapi } from "../../api/api";
  198. export default {
  199. components: {},
  200. data() {
  201. return {
  202. phoneFollowUp: [], // 电话随访
  203. curRow: {},
  204. dialogVisible: false,
  205. form: {
  206. startDate:"",
  207. intervalDays:"",
  208. generateCount:"",
  209. content:""
  210. },
  211. title: "",
  212. };
  213. },
  214. created() {},
  215. updated() {
  216. this.$nextTick(() => {
  217. this.$refs["phoneFollowUp"].doLayout();
  218. });
  219. },
  220. //挂载完成
  221. mounted() {
  222. this.dictInit();
  223. },
  224. computed: {
  225. ...mapState(["window", "dataTransOpts", "dict", "patientRegister"]),
  226. },
  227. methods: {
  228. dddw,
  229. moment,
  230. // 初始化字典信息
  231. dictInit() {
  232. // 获取组合项目包含的明细
  233. postapi("/api/app/Asbitem/GetSimpleAsbitemWithDetails").then((res) => {
  234. if (res.code > -1) this.asbItems = res.data;
  235. });
  236. },
  237. getLists() {
  238. if(this.dataTransOpts.tableS.patient_register.followUpId){
  239. postapi("/api/app/SmsSend/GetList", {
  240. followUpId: this.dataTransOpts.tableS.patient_register.followUpId,
  241. }).then((res) => {
  242. if (res.code > -1) this.phoneFollowUp = res.data;
  243. });
  244. }else{
  245. this.phoneFollowUp=[]
  246. }
  247. },
  248. rowick(row) {
  249. this.curRow = { ...row };
  250. },
  251. addoredit() {
  252. if (this.title == 1) {
  253. if (this.form.intervalDays == "") {
  254. this.$message.warning("请输入间隔天数");
  255. } else if (this.form.startDate == "") {
  256. this.$message.warning("请选择开始时间");
  257. } else if (this.form.generateCount == "") {
  258. this.$message.warning("请输入生成天数");
  259. } else if (this.form.content == "") {
  260. this.$message.warning("请输入短信内容");
  261. } else {
  262. postapi("/api/app/SmsSend/AutoCreate", {
  263. followUpId: this.dataTransOpts.tableS.patient_register.followUpId,
  264. intervalDays: this.form.intervalDays,
  265. startDate: this.form.startDate,
  266. generateCount: this.form.generateCount,
  267. content: this.form.content,
  268. }).then((res) => {
  269. if (res.code > -1) {
  270. this.getLists();
  271. this.dialogVisible = false;
  272. }
  273. });
  274. }
  275. }
  276. },
  277. // 设置颜色
  278. setColor(checkCompleteFlag) {
  279. let color = "#52555F";
  280. switch (checkCompleteFlag) {
  281. case "0":
  282. color = "#FF5054";
  283. break;
  284. case "2":
  285. color = "#396FFA";
  286. break;
  287. default:
  288. break;
  289. }
  290. return color;
  291. },
  292. // 新增
  293. btnAdd() {
  294. this.dialogVisible = true;
  295. this.title = 1;
  296. this.form = this.$options.data().form;
  297. },
  298. // 编辑
  299. btnEdit() {},
  300. // 删除
  301. btnDel() {
  302. if (this.curRow.id == undefined) {
  303. this.$message.warning("请选择删除的数据");
  304. } else {
  305. this.$confirm("是否确认删除,是否继续", "提示", {
  306. confirmButtonText: "确定",
  307. cancelButtonText: "取消",
  308. type: "warning",
  309. cancelButtonClass: "difference",
  310. confirmButtonClass: "commonbutton",
  311. })
  312. .then(() => {
  313. postapi("/api/app/SmsSend/Delete", {
  314. smsSendId: this.curRow.id,
  315. }).then((res) => {
  316. if (res.code != -1) {
  317. this.curRow = this.$options.data().curRow;
  318. this.getLists();
  319. //this.$message.success("删除成功");
  320. }
  321. });
  322. })
  323. .catch(() => {});
  324. }
  325. },
  326. },
  327. //监听事件
  328. watch: {
  329. //人员ID未切换换时 也可以强制刷新数据
  330. "dataTransOpts.refresh.register_check_asbitem.M": {
  331. // immediate:true,
  332. handler(newVal, oldVal) {
  333. console.log(
  334. `watch 人员登记 newVal:${newVal} oldVal:${oldVal} registerCheckId: ${this.dataTransOpts.tableS.patient_register.id}`
  335. );
  336. // if (newVal != oldVal)
  337. this.getLists();
  338. },
  339. },
  340. },
  341. };
  342. </script>
  343. <style scoped>
  344. @import "../../assets/css/global.css";
  345. .box {
  346. display: flex;
  347. }
  348. </style>