renwuUpdateJin.vue 7.5 KB

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