updateSopTempOld.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
  1. <template>
  2. <div class="app-container">
  3. <div style="margin: 30px;" v-if="this.form.sendType == 1 "> sop规则【企微接口】模板</div>
  4. <div style="margin: 30px;" v-if="this.form.sendType == 2 "> sop规则【AI插件】模板</div>
  5. <div style="margin-top: 10px;margin-left: 50px;margin-right: 100px;margin-bottom: 60px;">
  6. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  7. <el-form-item label="名称" prop="name">
  8. <el-input v-model="form.name" placeholder="请输入模板标题" />
  9. </el-form-item>
  10. <el-form-item label="状态">
  11. <el-radio-group v-model="form.status">
  12. <el-radio
  13. v-for="dict in statusOptions"
  14. :key="dict.dictValue"
  15. :label="dict.dictValue"
  16. >{{dict.dictLabel}}</el-radio>
  17. </el-radio-group>
  18. </el-form-item>
  19. <el-form-item label="间隔天数" prop="gap">
  20. <el-input-number v-model="form.gap" :min="1" label="间隔天数"></el-input-number>
  21. </el-form-item>
  22. <el-form-item label="排序" prop="sort">
  23. <el-input-number v-model="form.sort" :min="0" label="排序"></el-input-number>
  24. </el-form-item>
  25. <el-form-item label="规则" prop="setting">
  26. <el-timeline >
  27. <el-timeline-item :timestamp="'第'+(1+(form.gap*index))+'天'" :color="'#0bbd87'" placement="top" v-for="(item, index) in setting" style="margin-top: 10px;">
  28. <el-row>
  29. <el-col :span="22">
  30. <div style="background-color: #fbfbfb;padding: 15px; border: 1px solid #e6e6e6; margin-bottom: 20px;">
  31. <el-form :model="item" label-width="80px">
  32. <el-form-item label="内容名称" style="height: 50px;">
  33. <el-input v-model="item.name" placeholder="内容名称,仅内部可见" />
  34. </el-form-item>
  35. <el-form-item label="规则" >
  36. <div v-for="(content, contentIndex) in item.content" style="background-color: #fdfdfd;padding: 15px; border: 1px solid #e6e6e6; margin-bottom: 20px;">
  37. <el-row>
  38. <el-col el-col :span="22" >
  39. <el-form :model="content" label-width="70px">
  40. <el-form-item label="时间" >
  41. <el-time-picker
  42. class="custom-input"
  43. v-model="content.time"
  44. value-format="HH:mm"
  45. format="HH:mm"
  46. :picker-options="{ selectableRange: '00:00:00 - 23:59:59' }"
  47. placeholder="时间"
  48. style="width: 100px;height: 20px;" >
  49. </el-time-picker>
  50. </el-form-item>
  51. <el-form-item label="消息类别" >
  52. <el-radio-group v-model="content.type" @change="() => content.contentType = '1'" >
  53. <el-radio
  54. :label="1"
  55. >普通</el-radio>
  56. <el-radio
  57. :label="2"
  58. >课程</el-radio>
  59. <el-radio
  60. :label="3"
  61. >订单</el-radio>
  62. </el-radio-group>
  63. </el-form-item>
  64. <el-form-item label="课程" v-if="content.type == 2 " required>
  65. <el-select v-model="content.courseId" placeholder="请选择课程" style=" margin-right: 10px;" size="mini" @change="courseChangeUpdate(content,index,contentIndex)">
  66. <el-option
  67. v-for="dict in courseList"
  68. :key="dict.dictValue"
  69. :label="dict.dictLabel"
  70. :value="parseInt(dict.dictValue)"
  71. />
  72. </el-select>
  73. <el-select v-model="content.videoId" placeholder="请选择小节" size="mini" style=" margin-right: 10px;" @change="videoIdChange(content,index,contentIndex)">
  74. <el-option
  75. v-for="dict in videoList[index][contentIndex]"
  76. :key="dict.dictValue"
  77. :label="dict.dictLabel"
  78. :value="parseInt(dict.dictValue)"
  79. />
  80. </el-select>
  81. <el-select v-model="content.courseType" placeholder="请选择消息类型" size="mini" style=" margin-right: 10px;">
  82. <el-option
  83. v-for="dict in sysFsSopWatchStatus"
  84. :key="dict.dictValue"
  85. :label="dict.dictLabel"
  86. :value="parseInt(dict.dictValue)"
  87. />
  88. </el-select>
  89. </el-form-item>
  90. <el-form-item label="内容类别" >
  91. <div v-if="form.sendType == 1 ">
  92. <el-radio-group v-model="content.contentType">
  93. <el-radio :label="item.dictValue" v-for="item in sysQwSopContentType">{{item.dictLabel}}</el-radio>
  94. </el-radio-group>
  95. </div>
  96. <div v-if="form.sendType == 2 ">
  97. <div v-if="content.type == 2 ">
  98. <el-radio-group v-model="content.contentType" @change="handleContentTypeChange(content,index,contentIndex)">
  99. <el-radio :label="item.dictValue" v-for="item in sysQwSopSettingType">{{item.dictLabel}}</el-radio>
  100. </el-radio-group>
  101. </div>
  102. <div v-else>
  103. <el-radio-group v-model="content.contentType" @change="handleContentTypeChange(content,index,contentIndex)">
  104. <el-radio :label="item.dictValue" v-for="item in sysQwSopAiContentType">{{item.dictLabel}}</el-radio>
  105. </el-radio-group>
  106. </div>
  107. </div>
  108. <!-- <el-radio-group v-model="content.contentType">-->
  109. <!-- <el-radio-->
  110. <!-- :label="1"-->
  111. <!-- >文字</el-radio>-->
  112. <!-- <el-radio-->
  113. <!-- :label="2"-->
  114. <!-- >图片</el-radio>-->
  115. <!-- </el-radio-group>-->
  116. </el-form-item>
  117. <el-form-item label="内容" >
  118. <el-input v-if="content.contentType == 1 " v-model="content.value" type="textarea" :rows="3" placeholder="内容" style="width: 90%;margin-top: 10px;"/>
  119. <ImageUpload v-if="content.contentType == 2 " v-model="content.imgUrl" type="image" :num="1" :width="150" :height="150" />
  120. <div v-if="content.contentType == 3 ">
  121. <el-card class="box-card">
  122. <el-form-item label="链接标题:" label-width="100px" required >
  123. <el-input v-model="content.linkTitle" placeholder="请输入链接标题" style="width: 90%;"/>
  124. </el-form-item>
  125. <el-form-item label="链接描述:" label-width="100px" required >
  126. <el-input type="textarea" :rows="3" v-model="content.linkDescribe" placeholder="请输入链接描述" style="width: 90%;margin-top: 1%;"/>
  127. </el-form-item>
  128. <el-form-item label="链接封面:" label-width="100px" required>
  129. <ImageUpload v-model="content.linkImageUrl" type="image" :num="1" :width="150" :height="150" style="margin-top: 1%;" />
  130. </el-form-item>
  131. <div v-if="content.type != 2 " style="margin-top: 1%" >
  132. <el-form-item label="链接地址:" label-width="100px" required>
  133. <el-input v-model="content.linkUrl" placeholder="请输入链接地址" style="width: 90%;"/>
  134. </el-form-item>
  135. </div>
  136. <div v-if="content.type == 2 ">
  137. <el-form-item label="链接地址:" label-width="100px" >
  138. <el-tag type="warning" v-model="content.isBindUrl = 1 ">选择的课程小节 即为卡片链接地址</el-tag>
  139. </el-form-item>
  140. </div>
  141. </el-card>
  142. </div>
  143. <div v-if="content.contentType == 5 ">
  144. <el-form-item label="上传文件:" prop="fileUrl" label-width="100px">
  145. <el-upload
  146. v-model="content.fileUrl"
  147. class="avatar-uploader"
  148. :action="uploadUrl"
  149. :show-file-list="false"
  150. :on-success="(res, file) => handleAvatarSuccessFile(res, file, content)"
  151. :before-upload="beforeAvatarUploadFile">
  152. <i class="el-icon-plus avatar-uploader-icon"></i>
  153. </el-upload>
  154. <el-link v-if="content.fileUrl" type="primary" :href="downloadUrl(content.fileUrl)" download>
  155. {{content.fileUrl}}
  156. </el-link>
  157. </el-form-item>
  158. </div>
  159. <div v-if="content.contentType == 6 ">
  160. <el-form-item label="上传视频:" prop="videoUrl" label-width="100px">
  161. <el-upload
  162. v-model="content.videoUrl"
  163. class="avatar-uploader"
  164. :action="uploadUrl"
  165. :show-file-list="false"
  166. :on-success="(res, file) => handleAvatarSuccessVideo(res, file, content)"
  167. :before-upload="beforeAvatarUploadVideo">
  168. <i class="el-icon-plus avatar-uploader-icon"></i>
  169. </el-upload>
  170. <video v-if="content.videoUrl"
  171. :src="content.videoUrl"
  172. controls style="width: 200px;height: 100px">
  173. </video>
  174. </el-form-item>
  175. </div>
  176. <div v-if="content.contentType == 7 ">
  177. <el-form-item label="上传语音:" prop="videoUrl" label-width="100px">
  178. <el-upload
  179. v-model="content.voiceUrl"
  180. class="avatar-uploader"
  181. :action="uploadUrl"
  182. :show-file-list="false"
  183. :on-success="(res, file) => handleAvatarSuccessVoice(res, file, content)"
  184. :before-upload="beforeAvatarUploadVoice">
  185. <i class="el-icon-plus avatar-uploader-icon"></i>
  186. </el-upload>
  187. <audio v-if="content.voiceUrl"
  188. :src="content.voiceUrl"
  189. controls style="width: 300px;height: 50px">
  190. </audio >
  191. </el-form-item>
  192. </div>
  193. </el-form-item>
  194. <el-form-item label="添加短链" v-if="content.type == 2 && content.contentType == 1 " >
  195. <el-tooltip content="请先根据课程选定课程小节之后再添加" effect="dark" :disabled="!!content.videoId">
  196. <el-switch
  197. v-model="content.isBindUrl"
  198. :disabled="!content.videoId"
  199. active-color="#13ce66"
  200. inactive-color="#DCDFE6"
  201. active-value="1"
  202. inactive-value="2">
  203. </el-switch>
  204. </el-tooltip>
  205. <span v-if="content.isBindUrl == '1'" style="margin-left: 10px; color: #13ce66">添加URL</span>
  206. <span v-if="content.isBindUrl == '2'" style="margin-left: 10px; color: #b1b4ba">不加URL</span>
  207. </el-form-item>
  208. <el-form-item label="课节过期时间" v-if="content.type == 2 && content.isBindUrl == '1' && content.contentType != 2 && content.contentType != 5 && content.contentType != 6 ">
  209. <el-row>
  210. <el-input-number v-model="content.expiresDays" :min="0" :max="100" ></el-input-number>
  211. (天)
  212. </el-row>
  213. <el-row>
  214. <span class="tip">填写0或不填时,默认为系统配置的默认时间</span>
  215. </el-row>
  216. </el-form-item>
  217. </el-form>
  218. </el-col>
  219. <el-col :span="1" :offset="1">
  220. <i class="el-icon-delete" @click="delContent(index,contentIndex)" style="margin-top: 20px;" v-if="item.content.length>1"></i>
  221. </el-col>
  222. </el-row>
  223. </div>
  224. <el-link type="primary" class="el-icon-plus" :underline="false" @click='addContent(index)'>添加规则</el-link>
  225. </el-form-item>
  226. </el-form>
  227. </div>
  228. </el-col>
  229. <el-col :span="1" :offset="1">
  230. <i class="el-icon-delete-solid" @click="delSetting(index)" v-if="setting.length>1"></i>
  231. </el-col>
  232. </el-row>
  233. </el-timeline-item>
  234. </el-timeline>
  235. <el-link type="primary" class="el-icon-plus" :underline="false" @click='addSetting()'>添加天数</el-link>
  236. </el-form-item>
  237. </el-form>
  238. <div slot="footer" class="dialog-footer" style="display: flex;justify-content: flex-end;">
  239. <el-button type="primary" @click="submitForm">确 定</el-button>
  240. <el-button @click="cancel">取 消</el-button>
  241. </div>
  242. </div>
  243. </div>
  244. </template>
  245. <script>
  246. import { listSopTemp, getSopTemp, delSopTemp, addSopTemp, updateSopTemp, exportSopTemp } from "@/api/qw/sopTemp";
  247. import { courseList,videoList } from "@/api/qw/sop";
  248. import ImageUpload from "@/views/qw/sop/ImageUpload";
  249. export default {
  250. name: "SopTemp",
  251. components: { ImageUpload},
  252. data() {
  253. return {
  254. uploadUrl:process.env.VUE_APP_BASE_API+"/common/uploadOSS",
  255. // 遮罩层
  256. loading: true,
  257. // 导出遮罩层
  258. exportLoading: false,
  259. // 选中数组
  260. ids: [],
  261. sysFsSopWatchStatus: [],
  262. //消息内容类型 企微版
  263. sysQwSopContentType:[],
  264. //插件版
  265. sysQwSopAiContentType:[],
  266. //类别
  267. sysQwSopSettingType:[],
  268. courseList:[],
  269. videoList:[],
  270. // 非单个禁用
  271. single: true,
  272. // 非多个禁用
  273. multiple: true,
  274. // 显示搜索条件
  275. showSearch: true,
  276. // 总条数
  277. total: 0,
  278. // sop模板表格数据
  279. setting: [],
  280. // 弹出层标题
  281. title: "",
  282. // 是否显示弹出层
  283. open: false,
  284. // 状态字典
  285. statusOptions: [],
  286. // 查询参数
  287. form: {
  288. name: null,
  289. setting: null,
  290. status: "1",
  291. sort: 1,
  292. companyId: null,
  293. gap:1,
  294. },
  295. // 表单校验
  296. rules: {
  297. name: [
  298. { required: true, message: '名称不能为空', trigger: 'blur' }
  299. ],
  300. status: [
  301. { required: true, message: '状态不能为空', trigger: 'blur' }
  302. ],
  303. sort: [
  304. { required: true, message: '排序不能为空', trigger: 'blur' }
  305. ],
  306. gap: [
  307. { required: true, message: '间隔天数不能为空', trigger: 'blur' }
  308. ],
  309. }
  310. };
  311. },
  312. created() {
  313. this.getDicts("sys_qwSopAi_contentType").then(response => {
  314. this.sysQwSopAiContentType = response.data;
  315. });
  316. this.getDicts("sys_fs_sop_watch_status").then(response => {
  317. this.sysFsSopWatchStatus = response.data;
  318. });
  319. this.getDicts("sys_qwSop_contentType").then(response => {
  320. this.sysQwSopContentType = response.data;
  321. });
  322. this.getDicts("sys_company_status").then(response => {
  323. this.statusOptions = response.data;
  324. });
  325. this.getDicts("sys_qwSop_settingType").then(response => {
  326. this.sysQwSopSettingType = response.data;
  327. });
  328. courseList().then(response => {
  329. this.courseList = response.list;
  330. });
  331. const id = this.$route.params && this.$route.params.id;
  332. this.handleUpdate(id);
  333. },
  334. methods: {
  335. addContent(index){
  336. if (this.setting[index].content.length>0 && this.form.sendType==1){
  337. return this.$message.error("因为企微接口限制,企微模板一天只能设置一条消息~")
  338. }else {
  339. this.setting[index].content.push({type:1,contentType:1})
  340. this.videoList[index].push([])
  341. }
  342. },
  343. delContent(index,contentIndex){
  344. this.setting[index].content.splice(contentIndex,1)
  345. this.videoList[index].splice(contentIndex,1)
  346. },
  347. addSetting(){
  348. this.setting.push({name:null,type:1,content:[],day:"0",hour:"0",minute:"0",time:""})
  349. this.videoList.push([])
  350. },
  351. delSetting(index){
  352. this.setting.splice(index,1)
  353. this.videoList.splice(index,1)
  354. },
  355. handleClosegroupUser(list){
  356. const index = this.userSelectList.findIndex(t => t === list);
  357. if (index !== -1) {
  358. this.userSelectList.splice(index, 1);
  359. }
  360. },
  361. //首次刷新
  362. courseChange(content,index,countIndex){
  363. this.courseUpdate(content,index,countIndex);
  364. },
  365. //修改
  366. courseChangeUpdate(content,index,countIndex){
  367. this.$set(content, 'videoId', null);
  368. this.$set(content, 'linkTitle', null);
  369. this.$set(content, 'linkDescribe', null);
  370. this.$set(content, 'linkImageUrl', null);
  371. //如果是链接的才上
  372. if (content.contentType==3 && content.type==2 && content.courseId!=null){
  373. // 查找选中的课程对应的 label
  374. const selectedCourse = this.courseList.find(course => parseInt(course.dictValue) === content.courseId);
  375. //响应式直接给链接的标题/封面上值
  376. if (selectedCourse) {
  377. this.$set(content, 'linkTitle', selectedCourse.dictLabel);
  378. this.$set(content, 'linkImageUrl', selectedCourse.dictImgUrl);
  379. }
  380. }
  381. this.courseUpdate(content,index,countIndex);
  382. },
  383. courseUpdate(content,index,countIndex){
  384. videoList(content.courseId).then(response => {
  385. this.videoList[index].splice(countIndex, 1, response.list);
  386. });
  387. },
  388. handleContentTypeChange(content,index,countIndex){
  389. //如果是链接的才上
  390. if (content.contentType==3 && content.type==2 ) {
  391. if (content.courseId!=null) {
  392. // 查找选中的课程对应的 label
  393. const selectedCourse = this.courseList.find(course => parseInt(course.dictValue) === content.courseId);
  394. //响应式直接给链接的标题/封面上值
  395. if (selectedCourse) {
  396. this.$set(content, 'linkTitle', selectedCourse.dictLabel);
  397. this.$set(content, 'linkImageUrl', selectedCourse.dictImgUrl);
  398. }
  399. }
  400. if (content.videoId!=null){
  401. // 查找选中的课程对应的 label
  402. const selectedVideo = this.videoList[index][countIndex].find(course => parseInt(course.dictValue) === content.videoId);
  403. //响应式直接给链接的描述上值
  404. if (selectedVideo) {
  405. this.$set(content, 'linkDescribe', selectedVideo.dictLabel);
  406. }
  407. }
  408. }
  409. },
  410. videoIdChange(content,index,countIndex){
  411. //选择了课程小节则 默认绑上
  412. this.$set(content,'isBindUrl','1');
  413. //如果是链接的才上
  414. if (content.contentType==3 && content.type==2 && content.videoId!=null) {
  415. // 查找选中的课程对应的 label
  416. const selectedVideo = this.videoList[index][countIndex].find(course => parseInt(course.dictValue) === content.videoId);
  417. //响应式直接给链接的描述上值
  418. if (selectedVideo) {
  419. this.$set(content, 'linkDescribe', selectedVideo.dictLabel);
  420. }
  421. }
  422. },
  423. //上传文件
  424. handleAvatarSuccessFile(res, file, content) {
  425. if (res.code === 200) {
  426. // 使用 $set 确保响应式更新
  427. this.$set(content, 'fileUrl', res.url);
  428. } else {
  429. this.msgError(res.msg);
  430. }
  431. },
  432. beforeAvatarUploadFile(file){
  433. const isLt1M = file.size / 1024 / 1024 < 30;
  434. if (!isLt1M) {
  435. this.$message.error('上传大小不能超过 30MB!');
  436. }
  437. return isLt1M;
  438. },
  439. //下载文件
  440. downloadUrl(materialUrl) {
  441. // 直接返回文件 URL
  442. return materialUrl;
  443. },
  444. handleAvatarSuccessVideo(res, file, content) {
  445. if(res.code==200){
  446. // 使用 $set 确保响应式更新
  447. this.$set(content, 'videoUrl', res.url);
  448. }
  449. else{
  450. this.msgError(res.msg);
  451. }
  452. },
  453. beforeAvatarUploadVideo(file){
  454. const isLt30M = file.size / 1024 / 1024 < 50;
  455. const isMP4 = file.type === 'video/mp4';
  456. if (!isMP4) {
  457. this.$message.error('仅支持上传 MP4 格式的视频文件!');
  458. return false;
  459. }
  460. if (!isLt30M) {
  461. this.$message.error('上传大小不能超过 50MB!');
  462. return false;
  463. }
  464. return true;
  465. },
  466. handleAvatarSuccessVoice(res, file, content){
  467. if(res.code==200){
  468. // 使用 $set 确保响应式更新
  469. this.$set(content, 'voiceUrl', res.url);
  470. }
  471. else{
  472. this.msgError(res.msg);
  473. }
  474. },
  475. beforeAvatarUploadVoice(file){
  476. const isLt10M = file.size / 1024 / 1024 < 10; //语音文件大小限制为10MB
  477. const isVoiceType = ['audio/mp3'].includes(file.type); // 支持的语音文件类型
  478. if (!isVoiceType) {
  479. this.$message.error('仅支持上传 MP3 格式的语音文件!');
  480. return false;
  481. }
  482. if (!isLt10M) {
  483. this.$message.error('上传大小不能超过 10MB!');
  484. return false;
  485. }
  486. return true;
  487. },
  488. /** 查询sop模板列表 */
  489. getList() {
  490. this.loading = true;
  491. listSopTemp(this.queryParams).then(response => {
  492. this.sopTempList = response.rows;
  493. this.total = response.total;
  494. this.loading = false;
  495. });
  496. },
  497. // 取消按钮
  498. cancel() {
  499. this.$store.dispatch("tagsView/delView", this.$route);
  500. this.$router.replace('/qw/conversion/sopTemp')
  501. this.reset();
  502. },
  503. // 表单重置
  504. reset() {
  505. this.form = {
  506. id: null,
  507. name: null,
  508. setting: null,
  509. status: "0",
  510. sort: null,
  511. createTime: null,
  512. createBy: null,
  513. companyId: null
  514. };
  515. this.resetForm("form");
  516. },
  517. /** 修改按钮操作 */
  518. handleUpdate(id) {
  519. getSopTemp(id).then(response => {
  520. this.videoList=[]
  521. this.form=response.data;
  522. this.setting = JSON.parse(response.data.setting);
  523. for (let i = 0; i < this.setting.length; i++) {
  524. this.videoList.push([])
  525. for (let j = 0; j < this.setting[i].content.length; j++) {
  526. this.videoList[i].push([])
  527. if(this.setting[i].content[j].type==2){
  528. if(this.setting[i].content[j].hasOwnProperty('courseId')){
  529. this.courseChange(this.setting[i].content[j],i,j);
  530. }
  531. }
  532. }
  533. }
  534. });
  535. },
  536. /** 提交按钮 */
  537. submitForm() {
  538. this.$refs["form"].validate(valid => {
  539. this.form.setting=JSON.stringify(this.setting)
  540. if (valid) {
  541. if (this.form.id != null) {
  542. updateSopTemp(this.form).then(response => {
  543. this.msgSuccess("修改成功");
  544. this.$store.dispatch("tagsView/delView", this.$route);
  545. // this.$router.replace('/qw/conversion/sopTemp')
  546. window.location.replace('/qw/conversion/sopTemp')
  547. this.reset();
  548. });
  549. }
  550. }
  551. });
  552. },
  553. /** 删除按钮操作 */
  554. handleDelete(row) {
  555. const ids = row.id || this.ids;
  556. this.$confirm('是否确认删除sop模板编号为"' + ids + '"的数据项?', "警告", {
  557. confirmButtonText: "确定",
  558. cancelButtonText: "取消",
  559. type: "warning"
  560. }).then(function() {
  561. return delSopTemp(ids);
  562. }).then(() => {
  563. this.getList();
  564. this.msgSuccess("删除成功");
  565. }).catch(() => {});
  566. },
  567. /** 导出按钮操作 */
  568. handleExport() {
  569. const queryParams = this.queryParams;
  570. this.$confirm('是否确认导出所有sop模板数据项?', "警告", {
  571. confirmButtonText: "确定",
  572. cancelButtonText: "取消",
  573. type: "warning"
  574. }).then(() => {
  575. this.exportLoading = true;
  576. return exportSopTemp(queryParams);
  577. }).then(response => {
  578. this.download(response.msg);
  579. this.exportLoading = false;
  580. }).catch(() => {});
  581. }
  582. }
  583. };
  584. </script>
  585. <style scoped>
  586. .custom-input /deep/ .el-input__inner {
  587. height: 20px;
  588. text-align:center;
  589. }
  590. .custom-input /deep/ .el-input__icon {
  591. line-height: 10px;
  592. }
  593. </style>