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.

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