renwuUpdateJin.vue 7.6 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'
  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. <!-- 操作键 -->
  40. <view class="project">
  41. <view class="butt quxiao" @click="quxiao">取消</view>
  42. <view class="butt queren" @click="updateJindu">确定</view>
  43. </view>
  44. <view style="width: 100%;height: 60rpx;"></view>
  45. </view>
  46. </view>
  47. </template>
  48. <script>
  49. import configdata from '@/common/config.js'
  50. export default {
  51. data() {
  52. return {
  53. data:{},
  54. fileList3: [],
  55. // 完成进度上传附件
  56. fileList: [],
  57. fileList2: [],
  58. fileList22:'',
  59. listStyles: {
  60. "borderStyle": {
  61. "width": "0", // 边框宽度
  62. },
  63. "border": false, // 是否显示边框
  64. "dividline": false
  65. },
  66. finishRemark:'',//完成说明
  67. }
  68. },
  69. onLoad(option) {
  70. console.log(JSON.parse(decodeURIComponent(option.data)))
  71. this.data=JSON.parse(decodeURIComponent(option.data))
  72. var image=[]
  73. image=this.data.fileUrl.split(',')
  74. this.fileList3 =image.map(item =>{
  75. return {
  76. name: item
  77. }
  78. })
  79. },
  80. methods: {
  81. //跳转页面
  82. navigateToTU(url) {
  83. window.location.href = url;
  84. },
  85. //取消
  86. quxiao(){
  87. uni.navigateBack({
  88. delta:1
  89. })
  90. },
  91. //更新进度
  92. updateJindu(){
  93. let that = this
  94. uni.showLoading({
  95. title: '加载中',
  96. mask: true, // 是否显示透明蒙层,防止触摸穿透
  97. });
  98. var data={
  99. "taskId": that.data.id,
  100. "finishRemark": that.finishRemark,
  101. "fileUrl":that.fileList22
  102. }
  103. that.$Request.postT('/api/sysTask/submitTask',data).then(res => {
  104. if (res.code==200) {
  105. uni.showToast({
  106. title: '更新成功',
  107. icon: 'none',
  108. duration:800
  109. });
  110. uni.hideLoading()
  111. setTimeout(function() {
  112. uni.navigateBack({
  113. delta:1
  114. })
  115. // uni.switchTab({
  116. // url:'/pages/project/index'
  117. // })
  118. }, 1000)
  119. } else {
  120. uni.hideLoading();
  121. uni.showToast({
  122. title: res.message,
  123. icon: 'none',
  124. duration:800
  125. });
  126. }
  127. });
  128. },
  129. // 上传附件
  130. uploadSuccess(e) {
  131. console.log('上传成功', e)
  132. },
  133. uploadFail(e) {
  134. console.log('上传失败:', e)
  135. },
  136. //删除文件
  137. deleteHandle(index){
  138. console.log(index)
  139. this.fileList2.splice(index.index,1)
  140. console.log(this.fileList2)
  141. this.fileList22=this.fileList2.join(",")
  142. console.log(this.fileList22)
  143. // uni.showLoading({
  144. // title: '删除中',
  145. // mask: true, // 是否显示透明蒙层,防止触摸穿透
  146. // });
  147. // var data={
  148. // "fileName": this.fileList2[index]
  149. // }
  150. // this.$Request.postT('/api/sysFile/delete',data).then(res => {
  151. // if (res.code==200) {
  152. // uni.showToast({
  153. // title: '删除成功',
  154. // icon: 'none',
  155. // duration:800
  156. // });
  157. // uni.hideLoading()
  158. // } else {
  159. // uni.hideLoading();
  160. // uni.showToast({
  161. // title: res.message,
  162. // icon: 'none',
  163. // duration:800
  164. // });
  165. // }
  166. // });
  167. },
  168. async selectUpload(e) {
  169. console.log('上传:', e)
  170.  let data = new FormData();
  171.   data.set("file", e.tempFiles[0].file);
  172.   let res = await this.$axios({
  173.     method: "post",
  174.     url: this.config('APIHOST1') + "/api/sysFile/upload",
  175.     headers: {
  176. tokenW: localStorage.getItem("token"),
  177. // tokenP: localStorage.getItem("token"),
  178. "Content-Type": "multipart/form-data"
  179.     },
  180.     data: data,
  181.   });
  182. // return res
  183.   console.log(res, "图片上传成功");
  184.   if (res.data.code == 200) {
  185. console.log(this.fileList)
  186.     this.fileList2.push(res.data.data);
  187. this.fileList22=this.fileList2.join(",")
  188. console.log(this.fileList2.join(","))
  189.   } else if(res.message=="登录凭证已过去,请重新登录"){
  190. uni.removeStorageSync("tokenW")
  191. uni.removeStorageSync("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>