ApproveInfoEdit.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. <template>
  2. <view>
  3. <view class="businessMain" :style="'font-size:'+fieldInfo.fontsize+'rpx'">
  4. <view class="businessTitle" v-if="false">{{fieldInfo.title}}</view>
  5. <view v-for="(item,i) in fieldList" :key="i" class="oawork-item" :class="getClass(item)">
  6. <template v-if="item.type.indexOf('uview')>-1">
  7. <view v-if="item.type.indexOf('divider')>-1">
  8. <u-divider bg-color="#fff" border-color="#6d6d6d">{{item.text}}</u-divider>
  9. </view>
  10. </template>
  11. <template v-else>
  12. <view class="oawork-item1">
  13. <view class="oawork-item1_a">{{item.text}}<span v-if="item.isrequset" style="color:red">*</span>
  14. </view>
  15. <view class="oawork-item1_b">
  16. <template v-if="item.view">
  17. {{formData[item.key]?formData[item.key]:getViewItem(item)}}
  18. </template>
  19. <template v-else>
  20. <template v-if="item.type.indexOf('text')>-1">
  21. <u-input v-model="formData[item.key]" :placeholder="'请输入'+item.text"
  22. :placeholderStyle="placeholderStyle" class="oawork-line"
  23. :customStyle="{textAlign: 'right'}" />
  24. </template>
  25. <template v-if="item.type.indexOf('textnumber')>-1">
  26. <u-input v-model="formData[item.key]" type="number" :placeholder="'请输入'+item.text"
  27. :placeholderStyle="placeholderStyle" class="oawork-line"
  28. :customStyle="{textAlign: 'right'}" />
  29. </template>
  30. <template v-if="item.type.indexOf('radio')>-1">
  31. <u-radio-group v-model="formData[item.key]">
  32. <u-radio v-for="(item, index) in item.list?item.list:radioListDefault"
  33. :key="index" :name="item.value">
  34. {{item.name}}
  35. </u-radio>
  36. </u-radio-group>
  37. </template>
  38. <template v-if="item.type.indexOf('selecttime')>-1">
  39. <u-calendar max-date="2060-01-01" v-model="showCalendar" mode="date"
  40. @change="changeCalendar"></u-calendar>
  41. <view @click="showCalendar = true,keyCalendar=item">
  42. {{formData[item.key]?formData[item.key]:getViewItem(item)}}</view>
  43. </template>
  44. <template v-if="item.type.indexOf('selecttime2')>-1">
  45. <u-calendar max-date="2060-01-01" v-model="showCalendar" mode="range"
  46. @change="changeCalendar2"></u-calendar>
  47. <view @click="showCalendar = true,keyCalendar=item">
  48. {{formData[item.key]?formData[item.key]:createTime}}至{{formData[item.key2]?formData[item.key2]:createTime}}
  49. </view>
  50. </template>
  51. </template>
  52. </view>
  53. <view class="oawork-item1_c" v-if="item.type.indexOf('unit')>-1">
  54. {{item.unit}}
  55. </view>
  56. </view>
  57. <view class="oawork-item2">
  58. <template v-if="item.type.indexOf('textlong')>-1">
  59. <u-input v-model="formData[item.key]" :placeholder="'请输入'+item.text"
  60. :placeholderStyle="placeholderStyle" class="oawork-line" type="textarea" />
  61. </template>
  62. <template v-if="item.type.indexOf('upload')>-1">
  63. <view class="upload">
  64. <u-upload-file-all ref="uUpload" :max-size="50 * 1024 * 1024"
  65. :file-max-size="50 * 1024 * 1024" :maxCount="9"
  66. :file-list="fileList"></u-upload-file-all>
  67. </view>
  68. </template>
  69. <template v-if="item.type.indexOf('texteditor')>-1">
  70. <view class="container">
  71. <view class="page-body">
  72. <view class='wrapper'>
  73. <view class='toolbar' @tap="format" style="overflow-y: auto;">
  74. <view :class="formats.bold ? 'ql-active' : ''"
  75. class="iconfont icon-zitijiacu" data-name="bold"></view>
  76. <view :class="formats.italic ? 'ql-active' : ''"
  77. class="iconfont icon-zitixieti" data-name="italic"></view>
  78. <view :class="formats.underline ? 'ql-active' : ''"
  79. class="iconfont icon-zitixiahuaxian" data-name="underline"></view>
  80. <view :class="formats.strike ? 'ql-active' : ''"
  81. class="iconfont icon-zitishanchuxian" data-name="strike"></view>
  82. <view :class="formats.align === 'center' ? 'ql-active' : ''"
  83. class="iconfont icon-juzhongduiqi" data-name="align"
  84. data-value="center"></view>
  85. <view :class="formats.align === 'right' ? 'ql-active' : ''"
  86. class="iconfont icon-youduiqi" data-name="align" data-value="right">
  87. </view>
  88. <view :class="formats.align === 'justify' ? 'ql-active' : ''"
  89. class="iconfont icon-zuoyouduiqi" data-name="align"
  90. data-value="justify"></view>
  91. <view class="iconfont icon-clearedformat" @tap="removeFormat"></view>
  92. <view :class="formats.color === '#0000ff' ? 'ql-active' : ''"
  93. class="iconfont icon-text_color" data-name="color" data-value="#0000ff">
  94. </view>
  95. <view :class="formats.backgroundColor === '#00ff00' ? 'ql-active' : ''"
  96. class="iconfont icon-fontbgcolor" data-name="backgroundColor"
  97. data-value="#00ff00"></view>
  98. <view class="iconfont icon-date" @tap="insertDate"></view>
  99. <view class="iconfont icon--checklist" data-name="list" data-value="check">
  100. </view>
  101. <view :class="formats.list === 'ordered' ? 'ql-active' : ''"
  102. class="iconfont icon-youxupailie" data-name="list" data-value="ordered">
  103. </view>
  104. <view :class="formats.list === 'bullet' ? 'ql-active' : ''"
  105. class="iconfont icon-wuxupailie" data-name="list" data-value="bullet">
  106. </view>
  107. <view class="iconfont icon-undo" @tap="undo"></view>
  108. <view class="iconfont icon-redo" @tap="redo"></view>
  109. <view class="iconfont icon-outdent" data-name="indent" data-value="-1">
  110. </view>
  111. <view class="iconfont icon-indent" data-name="indent" data-value="+1">
  112. </view>
  113. <view class="iconfont icon-fengexian" @tap="insertDivider"></view>
  114. <view class="iconfont icon-charutupian" @tap="insertImage"></view>
  115. <view :class="formats.header === 1 ? 'ql-active' : ''"
  116. class="iconfont icon-format-header-1" data-name="header"
  117. :data-value="1"></view>
  118. <view :class="formats.script === 'sub' ? 'ql-active' : ''"
  119. class="iconfont icon-zitixiabiao" data-name="script" data-value="sub">
  120. </view>
  121. <view :class="formats.script === 'super' ? 'ql-active' : ''"
  122. class="iconfont icon-zitishangbiao" data-name="script"
  123. data-value="super"></view>
  124. <view class="iconfont icon-shanchu" @tap="clear"></view>
  125. <view :class="formats.direction === 'rtl' ? 'ql-active' : ''"
  126. class="iconfont icon-direction-rtl" data-name="direction"
  127. data-value="rtl"></view>
  128. </view>
  129. <view class="editor-wrapper">
  130. <editor id="editor" class="ql-container" placeholder="开始输入..." show-img-size
  131. show-img-toolbar show-img-resize @statuschange="onStatusChange"
  132. :read-only="readOnly" @ready="onEditorReady">
  133. </editor>
  134. </view>
  135. </view>
  136. </view>
  137. </view>
  138. </template>
  139. </view>
  140. </template>
  141. </view>
  142. </view>
  143. </view>
  144. </template>
  145. <script>
  146. export default {
  147. name:"ApproveInfo",
  148. props:{
  149. fieldInfo: {},
  150. personInfo: {},
  151. createTime: "",
  152. createTime2: "",
  153. fileList:{
  154. type: Array,
  155. default () {
  156. return [];
  157. }
  158. },
  159. formData: {},
  160. placeholderStyle: "font-size: 24rpx",
  161. },
  162. watch: {
  163. fieldInfo: {
  164. immediate: true,
  165. handler(val) {
  166. //("fieldList",val)
  167. if(val){
  168. this.fieldList=val.list
  169. }
  170. }
  171. },
  172. // 监听lists的变化,发出事件
  173. lists(n) {
  174. this.$emit('on-list-change', n, this.index);
  175. }
  176. },
  177. data() {
  178. return {
  179. fieldList: [],
  180. };
  181. },
  182. created() {
  183. //this.init()
  184. },
  185. methods:{
  186. init() {
  187. // this.personInfo = this.carhelp.getPersonInfo()
  188. // this.createTime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}');
  189. // this.createTime2 = parseUnixTime(currentTimeStamp());
  190. for (var i in this.fieldList) {
  191. var obj = this.fieldList[i];
  192. this.formData[obj.key] = ""
  193. }
  194. //this.action = process.car.BASE_URL + "uploadPicture"
  195. //this.uploadData.subFolder = "oawork11" + this.oatype;
  196. //接口应该免登陆
  197. var token = this.carhelp.getToken()
  198. this.header = {
  199. 'Authorization': token
  200. }
  201. },
  202. getViewItem(item) {
  203. //(item)
  204. if (item.viewSql) {
  205. var obj = this;
  206. for (var i in item.viewSql) {
  207. var k = item.viewSql[i];
  208. //(k)
  209. obj = obj[k]
  210. }
  211. return obj;
  212. }
  213. },
  214. getClass(item) {
  215. if (item) {
  216. var list = item.type.map(it => {
  217. return 'oawork-' + it
  218. })
  219. return list.join(' ')
  220. }
  221. },
  222. }
  223. }
  224. </script>
  225. <style scoped lang="scss">
  226. .oawork-line {
  227. border-bottom: 1px solid #c8c8c8;
  228. }
  229. .oawork-paddingTop {
  230. padding-top: 40rpx;
  231. }
  232. .businessMain {
  233. /deep/.uni-input-input {
  234. font-size: 24rpx;
  235. }
  236. font-size: 32rpx;
  237. background: #fff;
  238. padding-top: 10rpx;
  239. padding-bottom: 50rpx;
  240. margin-bottom: 40rpx;
  241. display: flex;
  242. flex-wrap: wrap;
  243. .oawork-item {
  244. padding: 4rpx 16rpx 4rpx 16rpx;
  245. width: 100%;
  246. .oawork-item1 {
  247. display: flex;
  248. align-items: center;
  249. .oawork-item1_a {
  250. min-width: 160rpx;
  251. font-weight: bold;
  252. }
  253. .oawork-item1_b {
  254. color: #777777;
  255. width: 100%;
  256. text-align: right;
  257. }
  258. .oawork-item1_c {
  259. padding-left: 16rpx;
  260. }
  261. }
  262. }
  263. .oawork-selecttime,
  264. .oawork-selecttime2 {
  265. margin: 10rpx 0;
  266. display: flex;
  267. .oawork-item1 {
  268. width: 100%;
  269. }
  270. .oawork-item1_b {
  271. display: flex;
  272. align-items: center;
  273. justify-content: flex-end;
  274. height: 100%;
  275. border-bottom: 1px solid #c8c8c8;
  276. }
  277. }
  278. .oawork-itemrow {
  279. .oawork-item1_a {
  280. font-weight: 400 !important;
  281. width: 200%;
  282. }
  283. }
  284. .oawork-textlong {
  285. .oawork-item1_a {
  286. width: 100%;
  287. }
  288. }
  289. .oawork-title {
  290. padding: 20rpx 0px 4rpx 20rpx;
  291. .oawork-item1_a {
  292. width: 100%;
  293. font-size: 32rpx;
  294. }
  295. }
  296. .width200 {
  297. // padding:20rpx 0px 4rpx 20rpx;
  298. .oawork-item1_a {}
  299. }
  300. /deep/.oawork-width49 {
  301. padding: 4rpx 0px 4rpx 20rpx;
  302. width: 49%;
  303. .oawork-item1_a {
  304. min-width: 140rpx !important;
  305. }
  306. }
  307. }
  308. .submitBtn {
  309. bottom: 0;
  310. position: fixed;
  311. width: 100%;
  312. padding: 20rpx 40rpx;
  313. background-color: #fff;
  314. border-top: 3px solid #f3f4f4;
  315. z-index: 9999;
  316. display: flex;
  317. .submitBtn30 {
  318. width: 30%;
  319. }
  320. .submitBtn60 {
  321. width: 60%;
  322. }
  323. }
  324. //@import "../data/editor-icon.css";
  325. </style>