renwuUpdateJin.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. <template>
  2. <view class="content">
  3. <view class="param">
  4. <view class="proMiao mingchen">{{data.taskName}}</view>
  5. <view class="proMiao title">评分标准</view>
  6. <view class="prolittle">{{data.scoreStandard}}</view>
  7. <view class="proMiao title">任务负责人</view>
  8. <view class="prolittle">{{data.headerName}}</view>
  9. <view class="proMiao title">评分上限</view>
  10. <view class="prolittle">{{data.scoreLimit}}</view>
  11. <view class="proMiao">附件</view>
  12. <view class="prolittle" v-for="(item,index) in fileList3">
  13. <view style="color: rgba(0, 97, 255, 1);" @click="navigateToTU(item.name)">{{item.name}}</view>
  14. </view>
  15. <view class="proMiao title">权重</view>
  16. <view class="prolittle">{{data.weight}}</view>
  17. <view class="proMiao title">提醒时间</view>
  18. <view class="prolittle">{{data.remindTime}}</view>
  19. <view class="proMiao title">预警时间</view>
  20. <view class="prolittle">{{data.warnTime}}</view>
  21. <view class="proMiao title">任务周期</view>
  22. <view class="prolittle">{{data.startTime}} - {{data.endTime}}</view>
  23. <view class="proMiao title">完成说明</view>
  24. <textarea class="proINname proIMi" v-model="finishRemark" placeholder="请输入完成说明"/>
  25. <view class="proMiao">上传附件</view>
  26. <view class="upload-img">
  27. <uni-file-picker limit="3"
  28. @select='selectUpload'
  29. @delete="deleteHandle"
  30. :auto-upload='false'
  31. file-extname='pdf,docx,jpg,png,jpeg,doc,docm,dot,dotm,dotx,xlsx,xls,csv,xlsm,slxb,xlt,xltx'
  32. file-mediatype="all"
  33. @success='uploadSuccess'
  34. @fail='uploadFail'
  35. :list-styles='listStyles'
  36. v-model='fileList'
  37. ></uni-file-picker>
  38. </view>
  39. <span style="margin: 20rpx 0 0 20rpx;width: 700rpx;">支持pdf,docx,jpg,png,jpeg,doc,docm,dot,dotm,dotx,xlsx,xls,csv,xlsm,slxb,xlt,xltx格式,单个文件大小不超过5MB</span>
  40. <!-- 操作键 -->
  41. <view class="project">
  42. <view class="butt quxiao" @click="quxiao">取消</view>
  43. <view class="butt queren" @click="updateJindu">确定</view>
  44. </view>
  45. <view style="width: 100%;height: 60rpx;"></view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. import configdata from '@/common/config.js'
  51. export default {
  52. data() {
  53. return {
  54. data:{},
  55. fileList3: [],
  56. // 完成进度上传附件
  57. fileList: [],
  58. fileList2: [],
  59. fileList22:'',
  60. listStyles: {
  61. "borderStyle": {
  62. "width": "0", // 边框宽度
  63. },
  64. "border": false, // 是否显示边框
  65. "dividline": false
  66. },
  67. finishRemark:'',//完成说明
  68. }
  69. },
  70. onLoad(option) {
  71. console.log(JSON.parse(decodeURIComponent(option.data)))
  72. this.data=JSON.parse(decodeURIComponent(option.data))
  73. var image=[]
  74. image=this.data.fileUrl.split(',')
  75. this.fileList3 =image.map(item =>{
  76. return {
  77. name: item
  78. }
  79. })
  80. },
  81. methods: {
  82. //跳转页面
  83. navigateToTU(url) {
  84. window.location.href = url;
  85. },
  86. //取消
  87. quxiao(){
  88. uni.navigateBack({
  89. delta:1
  90. })
  91. },
  92. //更新进度
  93. updateJindu(){
  94. let that = this
  95. uni.showLoading({
  96. title: '加载中',
  97. mask: true, // 是否显示透明蒙层,防止触摸穿透
  98. });
  99. var data={
  100. "taskId": that.data.id,
  101. "finishRemark": that.finishRemark,
  102. "fileUrl":that.fileList22
  103. }
  104. that.$Request.postT('/api/sysTask/submitTask',data).then(res => {
  105. if (res.code==200) {
  106. uni.showToast({
  107. title: '更新成功',
  108. icon: 'none',
  109. duration:800
  110. });
  111. uni.hideLoading()
  112. setTimeout(function() {
  113. uni.navigateBack({
  114. delta:1
  115. })
  116. // uni.switchTab({
  117. // url:'/pages/project/index'
  118. // })
  119. }, 1000)
  120. } else {
  121. uni.hideLoading();
  122. uni.showToast({
  123. title: res.message,
  124. icon: 'none',
  125. duration:800
  126. });
  127. }
  128. });
  129. },
  130. // 上传附件
  131. uploadSuccess(e) {
  132. console.log('上传成功', e)
  133. },
  134. uploadFail(e) {
  135. console.log('上传失败:', e)
  136. },
  137. //删除文件
  138. deleteHandle(index){
  139. console.log(index)
  140. this.fileList2.splice(index.index,1)
  141. console.log(this.fileList2)
  142. this.fileList22=this.fileList2.join(",")
  143. console.log(this.fileList22)
  144. // uni.showLoading({
  145. // title: '删除中',
  146. // mask: true, // 是否显示透明蒙层,防止触摸穿透
  147. // });
  148. // var data={
  149. // "fileName": this.fileList2[index]
  150. // }
  151. // this.$Request.postT('/api/sysFile/delete',data).then(res => {
  152. // if (res.code==200) {
  153. // uni.showToast({
  154. // title: '删除成功',
  155. // icon: 'none',
  156. // duration:800
  157. // });
  158. // uni.hideLoading()
  159. // } else {
  160. // uni.hideLoading();
  161. // uni.showToast({
  162. // title: res.message,
  163. // icon: 'none',
  164. // duration:800
  165. // });
  166. // }
  167. // });
  168. },
  169. async selectUpload(e) {
  170. console.log('上传:', e)
  171.  let data = new FormData();
  172.   data.set("file", e.tempFiles[0].file);
  173.   let res = await this.$axios({
  174.     method: "post",
  175.     url: this.config('APIHOST1') + "/api/sysFile/upload",
  176.     headers: {
  177. tokenW: sessionStorage.getItem("token"),
  178. // tokenP: sessionStorage.getItem("token"),
  179. "Content-Type": "multipart/form-data"
  180.     },
  181.     data: data,
  182.   });
  183. // return res
  184.   console.log(res, "图片上传成功");
  185.   if (res.data.code == 200) {
  186. console.log(this.fileList)
  187.     this.fileList2.push(res.data.data);
  188. this.fileList22=this.fileList2.join(",")
  189. console.log(this.fileList2.join(","))
  190.   } else if(res.message=="登录凭证已过去,请重新登录"){
  191. sessionStorage.removeItem("token") sessionStorage.removeItem("roleId")
  192. uni.showModal({
  193. title: '提示',
  194. content: '用户信息失效,请重新登录!',
  195. showCancel: false, // 是否显示取消按钮,默认为 true // 是否显示取消按钮,默认为 true
  196. success: function(res) {
  197. if (res.confirm) {
  198. }
  199. }
  200. });
  201. }else {
  202.     uni.showToast({
  203. title: res.message,
  204. icon: 'none',
  205. duration:800
  206. });
  207.   }
  208. },
  209. config: function (name) {
  210. var info = null
  211. if (name) {
  212. var name2 = name.split('.') //字符分割
  213. if (name2.length > 1) {
  214. info = configdata[name2[0]][name2[1]] || null
  215. } else {
  216. info = configdata[name] || null
  217. }
  218. if (info == null) {
  219. let web_config = cache.get('web_config')
  220. if (web_config) {
  221. if (name2.length > 1) {
  222. info = web_config[name2[0]][name2[1]] || null
  223. } else {
  224. info = web_config[name] || null
  225. }
  226. }
  227. }
  228. }
  229. return info
  230. },
  231. }
  232. }
  233. </script>
  234. <style>
  235. .content {
  236. display: flex;
  237. flex-direction: column;
  238. align-items: center;
  239. justify-content: center;
  240. }
  241. .param{
  242. margin: 20rpx 0 0 0;
  243. width: 100%;
  244. background-color: rgba(255, 255, 255, 1);
  245. font-size: 28rpx;
  246. font-weight: 400;
  247. line-height: 41rpx;
  248. color: rgba(0, 0, 0, 1);
  249. }
  250. .proMiao{
  251. margin: 31rpx 0 0 20rpx;
  252. width: 710rpx;
  253. }
  254. .prolittle{
  255. margin: 5rpx 0 0 20rpx;
  256. width: 710rpx;
  257. word-wrap: break-word;
  258. word-break: break-all;
  259. white-space: pre-line;
  260. }
  261. .proINname{
  262. margin: 25rpx 0 0 21rpx;
  263. width: 709rpx;
  264. height: 90rpx;
  265. border-radius: 13rpx;
  266. background: rgba(245, 248, 252, 1);
  267. border: 1rpx solid rgba(229, 229, 229, 1);
  268. font-size: 28rpx;
  269. line-height: 90rpx;
  270. /* color: rgba(179, 179, 179, 1); */
  271. }
  272. .proIMi{
  273. height: 315rpx;
  274. }
  275. .mingchen{
  276. font-size: 32rpx;
  277. font-weight: 500;
  278. line-height: 46rpx;
  279. }
  280. .title{
  281. color: rgba(102, 102, 102, 1);
  282. }
  283. /* 操作键 */
  284. .project{
  285. display: flex;
  286. margin: 61rpx 0 0 0;
  287. justify-content: space-evenly;
  288. }
  289. .butt{
  290. width: 330rpx;
  291. height: 90rpx;
  292. border-radius: 117rpx;
  293. font-size: 32rpx;
  294. line-height: 90rpx;
  295. text-align: center;
  296. }
  297. .quxiao{
  298. border: 1rpx solid rgba(0, 97, 255, 1);
  299. color: rgba(0, 97, 255, 1);
  300. }
  301. .queren{
  302. background: rgba(0, 97, 255, 1);
  303. color: rgba(255, 255, 255, 1);
  304. }
  305. </style>