materialList.vue 71 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878
  1. <style lang="scss" scoped>
  2. .orderDetail{
  3. ul,li{
  4. margin: 0;
  5. padding: 0;
  6. }
  7. width: 100%;
  8. .topBody{
  9. width: 100%;
  10. background: #FFFFFF;
  11. margin-bottom: 12px;
  12. padding: 20px;
  13. box-sizing: border-box;
  14. .breadcrumb{
  15. height: 22px;
  16. font-size: 12px;
  17. font-family: PingFangSC-Regular, PingFang SC;
  18. font-weight: 400;
  19. color: #000000;
  20. line-height: 22px;
  21. }
  22. .bottom{
  23. display: flex;
  24. position: relative;
  25. justify-content: space-between;
  26. // padding: 20px;
  27. .orderIcon{
  28. width: 28px;
  29. height: 28px;
  30. margin-right: 15px;
  31. img{
  32. width: 100%;
  33. }
  34. }
  35. .tip{
  36. .greet{
  37. width: 300px;
  38. height: 28px;
  39. font-size: 20px;
  40. font-family: PingFangSC-Medium, PingFang SC;
  41. font-weight: 500;
  42. color: rgba(0, 0, 0, 0.85);
  43. line-height: 28px;
  44. margin-bottom: 5px;
  45. }
  46. .descPosition{
  47. font-size: 14px;
  48. font-family: PingFangSC-Regular, PingFang SC;
  49. font-weight: 400;
  50. color: rgba(0, 0, 0, 0.45);
  51. overflow: hidden;
  52. margin-bottom: 0;
  53. li{
  54. height: 22px;
  55. line-height: 22px;
  56. margin-top:3px ;
  57. }
  58. span{
  59. width: 250px;
  60. display: inline-block;
  61. }
  62. }
  63. }
  64. .optBody{
  65. width: 200px;
  66. flex-shrink:0;
  67. // justify-content: flex-end;
  68. text-align: right;
  69. .btnBody{
  70. margin-bottom: 10px;
  71. }
  72. .orderInfo{
  73. display: flex;
  74. justify-content: space-between;
  75. text-align: right;
  76. p{
  77. margin-bottom: 0;
  78. }
  79. .markName{
  80. height: 22px;
  81. font-size: 14px;
  82. font-family: PingFangSC-Regular, PingFang SC;
  83. font-weight: 400;
  84. color: rgba(0, 0, 0, 0.45);
  85. line-height: 22px;
  86. }
  87. .big{
  88. height: 28px;
  89. font-size: 20px;
  90. font-family: PingFangSC-Regular, PingFang SC;
  91. font-weight: 400;
  92. color: rgba(0, 0, 0, 0.85);
  93. line-height: 28px;
  94. }
  95. }
  96. }
  97. }
  98. }
  99. .section{
  100. background: white;
  101. padding:20px ;
  102. .breadcrumb{
  103. height: 22px;
  104. font-size: 12px;
  105. font-family: PingFangSC-Regular, PingFang SC;
  106. font-weight: 400;
  107. color: #000000;
  108. line-height: 22px;
  109. }
  110. .sectionBody{
  111. p{
  112. margin-bottom: 0;
  113. }
  114. .section-item{
  115. background: white;
  116. margin-bottom: 20px;
  117. }
  118. .tabBox{
  119. padding: 15px 20px 0;
  120. display: flex;
  121. flex-wrap: wrap;
  122. position: relative;
  123. .search-item{
  124. margin-bottom: 12px;
  125. width: 30%;
  126. }
  127. .opt-item{
  128. position: absolute;
  129. right: 20px;
  130. top: 16px;
  131. }
  132. }
  133. .sectionHead{
  134. padding: 15px 20px;
  135. // height: 24px;
  136. font-size: 16px;
  137. font-family: PingFangSC-Medium, PingFang SC;
  138. font-weight: 500;
  139. color: rgba(0, 0, 0, 0.85);
  140. line-height: 24px;
  141. border-bottom: 1px solid #E9E9E9;;
  142. .allOrder{
  143. float: right;
  144. }
  145. }
  146. .section-box{
  147. margin-top: 30px;
  148. padding: 20px 20px;
  149. border: 1px solid #E9E9E9;
  150. .description{
  151. margin-top: 10px;
  152. .time{
  153. height: 32px;
  154. line-height: 32px;
  155. }
  156. }
  157. ul{
  158. display: flex;
  159. flex-wrap: wrap;
  160. // justify-content: space-around;
  161. }
  162. li{
  163. width: 30%;
  164. height: 22px;
  165. font-size: 14px;
  166. font-family: PingFangSC-Regular, PingFang SC;
  167. font-weight: 400;
  168. color: rgba(0, 0, 0, 0.85);
  169. line-height: 22px;
  170. text-align: left;
  171. margin-bottom: 15px;
  172. }
  173. .top{
  174. margin-bottom: 25px;
  175. }
  176. .bottom{
  177. h4{
  178. font-size: 15px;
  179. font-family: PingFangSC-Medium, PingFang SC;
  180. font-weight: 600;
  181. color: rgba(0, 0, 0, 0.85);
  182. margin-bottom: 25px;
  183. }
  184. }
  185. .shenhe{
  186. width: 6px;
  187. height: 6px;
  188. display: inline-block;
  189. background: #52C41A;
  190. border-radius: 50%;
  191. position: relative;
  192. top: -2px;
  193. }
  194. .wancheng{
  195. width: 6px;
  196. height: 6px;
  197. display: inline-block;
  198. background: #1890FF;
  199. border-radius: 50%;
  200. // margin-right: 3px;
  201. position: relative;
  202. top: -2px;
  203. }
  204. .bohui{
  205. width: 6px;
  206. height: 6px;
  207. display: inline-block;
  208. background: #F5222D;
  209. border-radius: 50%;
  210. position: relative;
  211. top: -2px;
  212. }
  213. }
  214. }
  215. }
  216. }
  217. .videoBox{
  218. height: 240px;
  219. }
  220. .imgBox{
  221. width: 90%;
  222. }
  223. .videomarterialInfo{
  224. position: relative;
  225. height: 800px;
  226. }
  227. .marterialInfo{
  228. overflow: auto;
  229. height: 800px;
  230. position: relative;
  231. p{margin-bottom: 0;}
  232. ul,li{
  233. margin: 0;
  234. padding: 0;
  235. }
  236. .info-item{
  237. margin-bottom: 20px;
  238. display: flex;
  239. // justify-content: center;
  240. align-items: flex-start;
  241. span{
  242. display: inline-block;
  243. width: 70px;
  244. text-align: left;
  245. flex-shrink: 0;
  246. }
  247. .ant-tag{
  248. width: auto;
  249. min-width: 50px;
  250. text-align: center;
  251. }
  252. }
  253. .info{
  254. ul{
  255. width: 100%;
  256. display: flex;
  257. justify-content: space-between;
  258. flex-wrap: wrap;
  259. }
  260. li{
  261. width: 33.3%;
  262. margin-bottom: 20px;
  263. }
  264. margin-bottom: 0;
  265. }
  266. // .btnBody{
  267. // width: 100%;
  268. // height: 80px;
  269. // position: relative;
  270. // }
  271. .bottom-btn{
  272. width: 100%;
  273. text-align: center;
  274. position: absolute;
  275. bottom: 0px;
  276. left: 0;
  277. // margin-top: 20px;
  278. }
  279. .scriptbottom-btn{
  280. width: 100%;
  281. // height: 60px;
  282. line-height: 60px;
  283. text-align: center;
  284. position: absolute;
  285. bottom: 0px;
  286. left: 0;
  287. }
  288. }
  289. </style>
  290. <style lang="less">
  291. .orderDetail{
  292. .ant-timeline-item-head{
  293. background: rgb(240,242,245);
  294. }
  295. .muen{
  296. cursor: pointer;
  297. }
  298. .muen:hover{
  299. color: #1890ff;
  300. }
  301. }
  302. </style>
  303. <template>
  304. <div class="orderDetail ">
  305. <div class="section">
  306. <p class="breadcrumb">
  307. <a-breadcrumb style="display:block;width:100%">
  308. <a-breadcrumb-item ><span class="muen" @click="goPlantForm()">工作台</span></a-breadcrumb-item>
  309. <!-- <a-breadcrumb-item>订单列表</a-breadcrumb-item> -->
  310. <a-breadcrumb-item>物料列表</a-breadcrumb-item>
  311. </a-breadcrumb>
  312. </p>
  313. <div class="sectionBody">
  314. <div class="tabBody">
  315. <a-tabs v-model="activeKey" @change='tabChange'>
  316. <a-tab-pane v-for="pane in panes" :key="pane.key" :tab="pane.title" >
  317. <!-- {{ pane.content }}{{pane.role+'-'+roleCode}} -->
  318. </a-tab-pane>
  319. </a-tabs>
  320. </div>
  321. <!-- 素材列表 -->
  322. <div class="section-item">
  323. <div class="tabBox">
  324. <!-- <div class="search-item">
  325. <span>物料名称:</span>
  326. <a-input placeholder="请输入名称" allow-clear v-model="materialName" style="width:300px" />
  327. </div>
  328. <div class="search-item">
  329. <span>物料编号:</span>
  330. <a-input placeholder="请输入编号" allow-clear v-model="materialId" style="width:300px" />
  331. </div>
  332. <div class="search-item">
  333. <span>所属订单:</span>
  334. <a-input placeholder="请输入订单名称" allow-clear v-model="orderName" style="width:300px" />
  335. </div>
  336. <div class="opt-item">
  337. <a-button type='primary' @click="search" style="margin-right:20px">查询</a-button>
  338. <a-button type='default' @click="reset">查询</a-button>
  339. </div> -->
  340. </div>
  341. <div class="section-box">
  342. <a-table
  343. size="middle"
  344. :columns="columns"
  345. :dataSource="data"
  346. id="outTable"
  347. :pagination="ipagination"
  348. :loading="loading"
  349. @change="sort"
  350. style="word-break: break-all;"
  351. >
  352. <div slot="materialStatus" slot-scope="text" >
  353. <span class="wancheng" v-if="text==7"> </span>
  354. <span class="bohui" v-else-if="text==6||text==3"> </span>
  355. <span class="shenhe" v-else> </span>
  356. {{text | handlerMaterialStatus}}
  357. </div>
  358. <div slot="scriptStatus" slot-scope="text,record">
  359. <span v-if="record.materialStatus==0&&role=='design'">-</span>
  360. <a href="javascript:;" v-if="record.materialStatus==0&&role=='designLeader'" @click="scriptAssign(record)">指派</a>
  361. <span v-else>
  362. <a href="javascript:;" @click="scriptViewDetails(record)">{{record.planName}}</a>
  363. </span>
  364. </div>
  365. <div slot="videoStatus" slot-scope="text,record">
  366. <span v-if="record.materialStatus==0&&role=='design'">-</span>
  367. <a href="javascript:;" v-if="record.materialStatus==0&&role=='designLeader'" @click="videoAssign(record)">指派</a>
  368. <span v-else>
  369. <a href="javascript:;" @click="viewDetails(record)">{{record.clipName}}</a>
  370. </span>
  371. </div>
  372. <div slot="orderTitle" slot-scope="text,record">
  373. <a href="javascript:;" @click="goOrderDetail(record)">{{text}}</a>
  374. </div>
  375. </a-table>
  376. </div>
  377. <a-drawer
  378. title="视频详情"
  379. width="700"
  380. :placement="placement"
  381. :closable="false"
  382. :visible="visible"
  383. @close="onClose"
  384. >
  385. <a-spin :spinning="visibleLoading">
  386. <a-drawer
  387. :title="add ? '上传视频' : '修改视频'"
  388. width="600"
  389. :closable="false"
  390. :visible="childrenDrawer"
  391. @close="onChildrenDrawerClose"
  392. >
  393. <a-form :form="form" :label-col="labelCol" :wrapper-col="wrapperCol">
  394. <a-form-item label="视频上传">
  395. <uploadFile
  396. :checkFile="file"
  397. :value.sync="urlList.url"
  398. @overUpload="overUpload"
  399. @removeUpload="removeUpload"
  400. :fileCount="10"
  401. uploadType="video"
  402. :multiple="false"
  403. />
  404. <span v-if="repeat" style="color: red">此素材重复,请重新选择上传</span>
  405. <span v-if="confirmLoading && urlList.url != ''" style="color: green">上传成功</span>
  406. </a-form-item>
  407. <a-form-item
  408. label="封面上传"
  409. class="add-image-material"
  410. v-if="currentMaterial.projectId && add && urlList.url != ''"
  411. >
  412. <uploadFile
  413. :value.sync="urlListImage.url"
  414. :checkFile="fileWater"
  415. @overUpload="overUploadImage"
  416. @removeUpload="deleteImage"
  417. :fileCount="15"
  418. uploadType="image"
  419. />
  420. <span
  421. v-if="material.filter((item) => item == false).length > 0 && urlListImage.url.length > 0"
  422. style="color: red"
  423. >
  424. 上传素材的尺寸不符,请修改(
  425. <span v-for="(item, index) of material" :key="index" v-show="!item">第{{ index + 1 }}张</span>出错)
  426. </span>
  427. <span
  428. v-else-if="urlListImage.url.length > 0 && material.filter((item) => item == false).length == 0"
  429. style="color: green"
  430. >上传成功</span
  431. >
  432. </a-form-item>
  433. <a-form-item
  434. label="形式标签"
  435. v-if="add && visible"
  436. >
  437. <el-cascader
  438. placeholder="搜索你想要的形式标签"
  439. :options="departTreeModality"
  440. v-decorator="[
  441. 'modalityTagList', // 给表单赋值或拉取表单时,该input对应的key
  442. { rules: [{ required: true, message: '请选择形式标签!' }] },
  443. ]"
  444. :props="{ multiple: true, value: 'id', label: 'tagName', emitPath: false }"
  445. filterable
  446. style="width: 100%"
  447. ></el-cascader>
  448. </a-form-item>
  449. <a-form-item
  450. :label-col="labelCol"
  451. :wrapper-col="{
  452. xs: { span: 24 },
  453. sm: { span: 12 },
  454. }"
  455. label="内容标签"
  456. v-if="add && visible"
  457. >
  458. <el-cascader
  459. placeholder="搜索你想要的内容标签"
  460. :options="departTreeContent"
  461. class="only-video-material-disable-modal"
  462. v-decorator="[
  463. 'contentTagList', // 给表单赋值或拉取表单时,该input对应的key
  464. { rules: [{ required: true, message: '请选择内容标签!' }] },
  465. ]"
  466. :props="{
  467. multiple: true,
  468. value: 'id',
  469. label: 'tagName',
  470. emitPath: false,
  471. checkStrictly: true,
  472. expandTrigger: 'hover',
  473. }"
  474. filterable
  475. style="width: 100%"
  476. ></el-cascader>
  477. </a-form-item>
  478. <a-form-item
  479. :label-col="labelCol"
  480. :wrapper-col="{
  481. xs: { span: 24 },
  482. sm: { span: 12 },
  483. }"
  484. label="场景标签"
  485. v-if="add && visible"
  486. >
  487. <el-cascader
  488. placeholder="搜索你想要的场景标签"
  489. :options="departTreeSence"
  490. v-decorator="[
  491. 'senceTagList', // 给表单赋值或拉取表单时,该input对应的key
  492. { rules: [{ required: true, message: '请选择场景标签!' }] },
  493. ]"
  494. :props="{ multiple: true, value: 'id', label: 'tagName', emitPath: false }"
  495. filterable
  496. style="width: 100%"
  497. ></el-cascader>
  498. </a-form-item>
  499. <a-form-item
  500. label="基调标签"
  501. v-if="add && visible"
  502. >
  503. <el-cascader
  504. placeholder="搜索你想要的基调标签"
  505. :options="departTreeMod"
  506. v-decorator="[
  507. 'modTagList', // 给表单赋值或拉取表单时,该input对应的key
  508. { rules: [{ required: true, message: '请选择基调标签!' }] },
  509. ]"
  510. :props="{ multiple: true, value: 'id', label: 'tagName', emitPath: false }"
  511. filterable
  512. style="width: 100%"
  513. ></el-cascader>
  514. </a-form-item>
  515. <a-form-item
  516. label="描述"
  517. v-if="add"
  518. >
  519. <a-textarea
  520. placeholder="请输入描述"
  521. v-decorator="[
  522. 'materialDescribe', // 给表单赋值或拉取表单时,该input对应的key
  523. ]"
  524. :auto-size="{ minRows: 3, maxRows: 10 }"
  525. />
  526. </a-form-item>
  527. </a-form>
  528. <div
  529. :style="{
  530. position: 'absolute',
  531. bottom: 0,
  532. width: '100%',
  533. borderTop: '1px solid #e8e8e8',
  534. padding: '10px 16px',
  535. textAlign: 'right',
  536. left: 0,
  537. background: '#fff',
  538. borderRadius: '0 0 4px 4px',
  539. }"
  540. >
  541. <a-button key="back" @click="onChildrenDrawerClose" style="margin-right:15px">取消</a-button>
  542. <a-button type="primary" :disabled="!confirmLoading" @click="onChildrenDrawerOk" :loading="loadingElse2">确定</a-button>
  543. </div>
  544. </a-drawer>
  545. <div class="marterialInfo videomarterialInfo">
  546. <div class="info-item">
  547. <span>视频状态:</span>
  548. <p>{{ currentVideo.videoStatus | handlerVideoStatus }}</p>
  549. </div>
  550. <div class="info-item">
  551. <span>视频预览:</span>
  552. <div class="videoBox" v-if="currentVideo.videoStatus>=1">
  553. <video style="height:100%" :src="currentVideo.url" controls v-if="currentVideo.url"></video>
  554. <img :src="defaultPic" alt="" style="width:100px;margin:0 10px 8px 0" v-else>
  555. </div>
  556. <div v-else >
  557. <!-- :disabled="!(currentVideo.clip==userInfo.id)" -->
  558. <a-button type='primary' @click="showChildrenDrawer" :disabled="!(currentVideo.clip==userInfo.id)">上传视频</a-button>
  559. </div>
  560. </div>
  561. <div class="info-item">
  562. <span>封面预览:</span>
  563. <div class="imgBox">
  564. <div v-if="currentVideo.videoStatus!=0">
  565. <template v-if="currentVideo.imgList&&currentVideo.imgList.length">
  566. <img alt="" style="width:100px;margin:0 10px 8px 0" v-for="(item,index) in currentVideo.imgList" :key='index' :src="item">
  567. </template>
  568. <span v-else>暂无封面</span>
  569. </div>
  570. <!-- <img :src="defaultPic" alt="" style="width:100px;margin:0 10px 8px 0" v-else> -->
  571. <span v-else>暂无封面</span>
  572. </div>
  573. </div>
  574. <div class="info-item" v-if="currentVideo.videoStatus>=1">
  575. <span>视频标签:</span>
  576. <p>
  577. <a-tag v-for="(item,index) in currentVideo.tagList" :key="index" style="margin-bottom:8px">{{item}}</a-tag>
  578. <!-- {{currentVideo.tag}} -->
  579. </p>
  580. </div>
  581. <div class="info-item info">
  582. <ul style="position:relative">
  583. <li><span>编导:</span> {{ currentVideo.planName }} </li>
  584. <li><span>拍摄:</span> {{ currentVideo.shotName }} </li>
  585. <li><span>剪辑:</span> {{ currentVideo.clipName }} </li>
  586. <!-- v-if="role=='designLeader'&&currentVideo.videoStatus==0" -->
  587. <a-button type='link' style="margin-left:15px;position:absolute;top:-6px;right:0" @click="updataPeople" v-if="role=='designLeader'&&currentVideo.videoStatus==0">重新指派</a-button>
  588. </ul>
  589. </div>
  590. <div class="info-item" v-if="currentVideo.videoStatus==2">
  591. <span>驳回理由:</span>
  592. <p>{{ currentVideo.videoAdvise }}</p>
  593. </div>
  594. <!-- <div class="info-item btnBody"> -->
  595. <div class="bottom-btn">
  596. <a-button type='primary' v-if="currentVideo.videoStatus==2" @click="modifyVideo" style="margin-right:20px">修改视频信息</a-button>
  597. <a-button type='default' @click="onClose">关闭</a-button>
  598. </div>
  599. <!-- </div> -->
  600. </div>
  601. </a-spin>
  602. </a-drawer>
  603. <a-drawer
  604. title="脚本详情"
  605. width="600"
  606. :placement="placement"
  607. :closable="false"
  608. :visible="scriptVisible"
  609. @close="scriptClose"
  610. >
  611. <div class="marterialInfo">
  612. <div class="info-item">
  613. <span>脚本状态:</span>
  614. <p>{{ currentScript.scriptStatus | handlerVideoStatus }}</p>
  615. </div>
  616. <div class="info-item">
  617. <span>所属项目:</span>
  618. <p>{{currentScript.projectName}}</p>
  619. </div>
  620. <div class="info-item">
  621. <span>所属物料:</span>
  622. <p>{{currentScript.materialName}}</p>
  623. </div>
  624. <div class="info-item">
  625. <span style="height: 32px;line-height: 32px;">编导:</span>
  626. <p style="height:32px;line-height:32px">
  627. {{currentScript.planName}}
  628. <a-button type='link' style="margin-left:15px" @click="updataPeople" v-if="role=='designLeader'&&currentScript.scriptStatus==0">重新指派</a-button>
  629. </p>
  630. </div>
  631. <div class="info-item" v-if="currentScript.scriptStatus==2">
  632. <span>驳回理由:</span>
  633. <p>{{currentScript.scriptAdvise}}</p>
  634. </div>
  635. <div class="info-item">
  636. <span>脚本:</span>
  637. <div v-if="currentScript.scriptStatus>0" style="margin-right:20px">
  638. <a :href="currentScript.url">{{currentScript.scriptName}}</a>
  639. </div>
  640. <div v-if="currentScript.scriptStatus==0||currentScript.scriptStatus==2">
  641. <p v-if="currentMaterial.plan==userInfo.id">
  642. <a-upload
  643. name="file"
  644. :multiple="false"
  645. :action="uploadAction"
  646. :headers="tokenHeader"
  647. :showUploadList="false"
  648. :beforeUpload="beforeUpload"
  649. @change="handleChange"
  650. style="margin-right:20px"
  651. >
  652. <a-button :disabled="loadDisabled">
  653. <a-icon type="upload" />
  654. {{loadDisabled?'上传中,请稍后':'文件上传'}}
  655. </a-button>
  656. </a-upload>
  657. </p>
  658. <p v-else>
  659. <a-upload
  660. name="file"
  661. :multiple="false"
  662. :action="uploadAction"
  663. :headers="tokenHeader"
  664. :showUploadList="false"
  665. :beforeUpload="beforeUpload"
  666. @change="handleChange"
  667. style="margin-right:20px"
  668. >
  669. <a-button :disabled="true">
  670. <a-icon type="upload" />文件上传</a-button>
  671. </a-upload>
  672. </p>
  673. </div>
  674. </div>
  675. <div class="scriptbottom-btn">
  676. <a-button type='default' @click="scriptClose">关闭</a-button>
  677. </div>
  678. </div>
  679. </a-drawer>
  680. <!-- 指派 -->
  681. <a-modal v-model="assignVisible" title="物料指派" width='600px'>
  682. <template slot="footer">
  683. <a-button key="back" @click="quxiao">取消</a-button>
  684. <a-button type="primary" @click="handleOk" :loading="loadingElse">确定</a-button>
  685. </template>
  686. <a-spin :spinning='assignVisibleLoading'>
  687. <a-form-model ref="ruleForm" :rules="rules" :model="formPerson" :label-col="labelCol" :wrapper-col="wrapperCol">
  688. <a-form-model-item label="编导" ref="plan" prop="plan">
  689. <a-select
  690. v-model="formPerson.plan"
  691. showSearch
  692. optionFilterProp="children"
  693. :filterOption="filterOption"
  694. :disabled="currentMaterial.materialStatus>=4"
  695. >
  696. <a-select-option :value="item.userId" v-for="item of ascription" :key="item.userId">{{item.userName}}</a-select-option>
  697. </a-select>
  698. </a-form-model-item>
  699. <a-form-model-item label="拍摄" ref="shot" prop="shot">
  700. <a-select
  701. v-model="formPerson.shot"
  702. showSearch
  703. optionFilterProp="children"
  704. :filterOption="filterOption"
  705. >
  706. <a-select-option :value="item.userId" v-for="item of ascription" :key="item.userId">{{item.userName}}</a-select-option>
  707. </a-select>
  708. </a-form-model-item>
  709. <a-form-model-item label="剪辑" ref="clip" prop="clip">
  710. <a-select
  711. v-model="formPerson.clip"
  712. showSearch
  713. optionFilterProp="children"
  714. :filterOption="filterOption"
  715. >
  716. <a-select-option :value="item.userId" v-for="item of ascription" :key="item.userId">
  717. {{item.userName}}
  718. </a-select-option>
  719. </a-select>
  720. </a-form-model-item>
  721. </a-form-model>
  722. </a-spin>
  723. </a-modal>
  724. </div>
  725. </div>
  726. </div>
  727. </div>
  728. </template>
  729. <script>
  730. import moment from 'moment';
  731. import qs from 'qs'
  732. import { getAction, postAction, downFile, downFilePost } from '@/api/manage';
  733. import Vue from 'vue'
  734. import {ACCESS_TOKEN} from "@/store/mutation-types"
  735. import BMF from 'browser-md5-file'
  736. import { fileCheck, fileCheckImage, fileEdit, fileEditAll,orderFileInsert} from '@/api/actor'
  737. import uploadFile from '@/components/uploadFile.vue'
  738. import { closeAllVideoFun, stopOtherVideo } from '@/utils/videoControl'
  739. import UploadToAli from '@femessage/upload-to-ali'
  740. import { mapGetters } from 'vuex'
  741. import TrendVue from '../../../components/Trend/Trend.vue';
  742. const fileSuffix = [
  743. 'xls',
  744. 'xlt',
  745. 'et',
  746. 'xlsx',
  747. 'xltx',
  748. 'csv',
  749. 'xlsm',
  750. 'xltm',
  751. 'doc',
  752. 'dot',
  753. 'wps',
  754. 'wpt',
  755. 'docx',
  756. 'dotx',
  757. 'docm',
  758. 'dotm',
  759. 'ppt',
  760. 'pptx',
  761. 'pptm',
  762. 'ppsx',
  763. 'ppsm',
  764. 'pps',
  765. 'potx',
  766. 'potm',
  767. 'dpt',
  768. 'dps',
  769. 'pdf',
  770. ]
  771. const videofileSuffix = [
  772. 'avi',
  773. 'wmv',
  774. 'mpg',
  775. 'mpeg',
  776. 'mov',
  777. 'rm',
  778. 'ram',
  779. 'swf',
  780. 'flv',
  781. 'mp4',
  782. ]
  783. let listColumns=[
  784. {
  785. title: '物料名称',
  786. dataIndex: 'materialName',
  787. align: 'center',
  788. key: 'materialName',
  789. scopedSlots: { customRender: 'materialName' }
  790. },
  791. {
  792. title: '物料编号',
  793. dataIndex: 'materialId',
  794. align: 'center',
  795. key: 'tag',
  796. scopedSlots: { customRender: 'materialId' }
  797. },
  798. {
  799. title: '物料状态',
  800. dataIndex: 'materialStatus',
  801. align: 'center',
  802. key: 'materialStatus',
  803. scopedSlots: { customRender: 'materialStatus' }
  804. },
  805. {
  806. title: '脚本',
  807. dataIndex: 'scriptStatus',
  808. align: 'center',
  809. key: 'scriptStatus',
  810. scopedSlots: { customRender: 'scriptStatus' }
  811. },
  812. {
  813. title: '视频',
  814. dataIndex: 'videoStatus',
  815. align: 'center',
  816. key: 'videoStatus',
  817. width:250,
  818. scopedSlots: { customRender: 'videoStatus' }
  819. },
  820. {
  821. title: '所属订单',
  822. dataIndex: 'orderTitle',
  823. align: 'center',
  824. key: 'orderTitle',
  825. scopedSlots: { customRender: 'orderTitle' }
  826. },
  827. ]
  828. export default {
  829. name:'material-list',
  830. components: {
  831. UploadToAli,
  832. uploadFile,
  833. },
  834. data() {
  835. const operatorPanes = [
  836. { title: '待审核的', content: '', key: 1 , },
  837. { title: '已完成的', content: '', key: 2 ,},
  838. ];
  839. const designLeaderPanes=[
  840. { title: '我参与的', content: '', key: 1 , },
  841. { title: '被驳回的', content: '', key: 2 , },
  842. { title: '待指派的', content: '', key: 4 , },
  843. // { title: '已完成的', content: '', key: 3 ,},
  844. ]
  845. const designPanes=[
  846. { title: '指派给我', content: '', key: 1 , },
  847. { title: '被驳回的', content: '', key: 2 , },
  848. { title: '已完成的', content: '', key: 3 ,},
  849. { title: '全部物料', content: '', key: 4 ,},
  850. ]
  851. return {
  852. assignVisibleLoading:false,
  853. visibleLoading:false,
  854. loadingElse2:false,
  855. rules: {
  856. clip: [{ required: true, message: '剪辑人员必须指派', trigger: 'change' }],
  857. // shot: [{ required: true, message: '拍摄人员必须指派', trigger: 'change' }],
  858. plan: [{ required: true, message: '编导人员必须指派', trigger: 'change' }],
  859. },
  860. // 上传视频
  861. labelCol: {xs: {span: 24,},sm: {span: 5,},},
  862. wrapperCol: {xs: {span: 24,},sm: {span: 12,},},
  863. form:this.$form.createForm(this),
  864. repeat: false,
  865. confirmLoading: false,
  866. urlList: {
  867. url: '',
  868. md5: '',
  869. name: '',
  870. },
  871. urlListImage: {
  872. url: [],
  873. md5: [],
  874. name: [],
  875. size: [],
  876. },
  877. tags: [],
  878. addImageVisible: false,
  879. addImageData: null,
  880. material: [],
  881. // 标签的数据
  882. labelValue: [],
  883. options: [],
  884. departTree: [],
  885. departTreeModality: [],
  886. departTreeContent: [],
  887. departTreeSence: [],
  888. departTreeMod: [],
  889. departValue: [],
  890. departValueInfo: [],
  891. departValueInfoModality: [],
  892. departValueInfoContent: [],
  893. departValueInfoSence: [],
  894. departValueInfoMod: [],
  895. tagInfoList: [],
  896. tagInfoListVisible: false,
  897. tagCode: null,
  898. loadingTag: false,
  899. showImageChouzhen: false,
  900. showImageStr: null,
  901. add: true,
  902. inputVisible: false,
  903. inputValue: '',
  904. childrenDrawer:false,
  905. videoAdvise:'',
  906. scriptAdvise:'',
  907. defaultPic: require('@/assets/noImg.png') ,
  908. tokenHeader: {'X-Access-Token': Vue.ls.get(ACCESS_TOKEN)},
  909. uploadAction:'',
  910. videoLoad:false,
  911. loadDisabled:false,
  912. labelCol: { span: 4 },
  913. wrapperCol: { span: 14 },
  914. loadingElse: false,
  915. formPerson:{
  916. plan:'',
  917. shot:'',
  918. clip:'',
  919. },
  920. ascription: [],
  921. acceptLoading:false,
  922. videoAdvise:'',
  923. scriptAdvise:'',
  924. currentScript:{},
  925. currentVideo:{},
  926. visible: false,
  927. scriptVisible:false,
  928. placement: 'right',
  929. currentMaterial:{},
  930. url:{
  931. assgin:'/platform/designer/assign',
  932. scriptDetail:'/platform/material/scriptDetail',
  933. videoDetail:'/platform/material/videoDetail',
  934. scriptAccept:'/platform/material/script/accept',
  935. scriptReject:'/platform/material/script/reject',
  936. videoAccept:'/platform/material/video/accept',
  937. videoReject:'/platform/material/video/reject',
  938. },
  939. operatorPanes,
  940. designLeaderPanes,
  941. designPanes,
  942. userInfo:{},
  943. roleCode:'',
  944. panes:[],
  945. activeKey: '1',
  946. orderInfo:{ },
  947. columns:[...listColumns],
  948. data:[],
  949. loading:false,
  950. ipagination: {
  951. current: 1,
  952. pageSize: 10,
  953. // pageSizeOptions: ['10', '20', '30'],
  954. showTotal: (total, range) => {
  955. return range[0] + "-" + range[1] + " 共" + total + "条"
  956. },
  957. showQuickJumper: true,
  958. showSizeChanger:true,
  959. pageSizeOptions: ['10', '30', '50'],
  960. total: 0,
  961. onChange: (current, pageSize) => {
  962. // 切换分页时的回调,
  963. // 当在页面定义change事件时,切记要把此处的事件清除,因为这两个事件重叠了,可能到时候会导致一些莫名的bug
  964. this.ipagination.current = current;
  965. this.ipagination.pageSize= pageSize;
  966. }
  967. },
  968. // 订单进度
  969. orderName:'',
  970. materialName:'',
  971. materialId:'',
  972. sizeType:[],
  973. size: "4",
  974. role:"",
  975. assignVisible:false,
  976. }
  977. },
  978. methods: {
  979. quxiao(){
  980. this.assignVisible=false;
  981. this.$refs.ruleForm.resetFields();
  982. this.loadingElse=false;
  983. },
  984. handleOk(e) {
  985. console.log(e);
  986. this.$refs.ruleForm.validate(valid => {
  987. if (valid) {
  988. this.loadingElse=true;
  989. if(this.currentMaterial.clip&&this.currentMaterial.plan&&this.currentMaterial.shot){
  990. postAction('/platform/designer/assignAgain',{
  991. id:this.currentMaterial.materialId,
  992. ...this.formPerson
  993. }).then(res=>{
  994. this.loadingElse=false;
  995. this.assignVisible = false;
  996. this.$message.success(res.message);
  997. this.materialHttp(this.activeKey)
  998. })
  999. }else{
  1000. postAction(this.url.assgin,{
  1001. id:this.currentMaterial.materialId,
  1002. ...this.formPerson
  1003. }).then(res=>{
  1004. this.loadingElse=false;
  1005. this.assignVisible = false;
  1006. this.$message.success(res.message);
  1007. this.materialHttp(this.activeKey)
  1008. })
  1009. }
  1010. } else {
  1011. console.log('error submit!!');
  1012. return false;
  1013. }
  1014. });
  1015. },
  1016. // 脚本指派
  1017. scriptAssign(record){
  1018. console.log(record)
  1019. this.currentMaterial=record;
  1020. this.assignVisible=true;
  1021. this.formPerson={
  1022. plan:'',
  1023. shot:'',
  1024. clip:'',
  1025. },
  1026. this.getProjectId(record.projectId)
  1027. },
  1028. // 视频指派
  1029. videoAssign(record){
  1030. console.log(record)
  1031. this.formPerson={
  1032. plan:'',
  1033. shot:'',
  1034. clip:'',
  1035. },
  1036. this.currentMaterial=record;
  1037. this.assignVisible=true;
  1038. this.getProjectId(record.projectId)
  1039. },
  1040. updataPeople(){
  1041. this.formPerson={
  1042. plan:this.currentMaterial.plan,
  1043. shot:this.currentMaterial.shot,
  1044. clip:this.currentMaterial.clip,
  1045. },
  1046. this.assignVisible=true;
  1047. this.scriptVisible=false;
  1048. this.visible=false;
  1049. this.assignVisibleLoading=true;
  1050. this.getProjectId(this.currentMaterial.projectId)
  1051. },
  1052. getProjectId(id) {
  1053. this.ascription=[];
  1054. getAction('/ctop/projectMember/getMemberList', {
  1055. projectId: id,
  1056. }).then((res) => {
  1057. this.assignVisibleLoading=false;
  1058. if (res.code == 0) {
  1059. this.ascription = res.result.filter((item) => {
  1060. if (
  1061. item.roleCode == 'clip' ||
  1062. item.roleCode == 'plan' ||
  1063. item.roleCode == 'designTeamLeader' ||
  1064. item.roleCode == 'shot' ||
  1065. item.roleCode == 'plane'
  1066. ) {
  1067. return {
  1068. userId: item.userId,
  1069. userName: item.userName,
  1070. }
  1071. }
  1072. })
  1073. }
  1074. })
  1075. },
  1076. modifyVideo(){
  1077. this.childrenDrawer=true;
  1078. console.log(this.currentVideo);
  1079. // urlList: {
  1080. // url: '',
  1081. // md5: '',
  1082. // name: '',
  1083. // },
  1084. // urlListImage: {
  1085. // url: [],
  1086. // md5: [],
  1087. // name: [],
  1088. // size: [],
  1089. // },
  1090. },
  1091. goOrderDetail(record){
  1092. console.log(record)
  1093. this.$parent.currentTabComponent='orderDetail';
  1094. this.$parent.orderId=record.orderId
  1095. },
  1096. goPlantForm(){
  1097. if(this.$parent.role=='operator'){
  1098. this.$parent.currentTabComponent='operatorPlatform'
  1099. }else if(this.$parent.role=='designLeader'){
  1100. this.$parent.currentTabComponent='designleaderPlatform'
  1101. }else if(this.$parent.role=='design'){
  1102. this.$parent.currentTabComponent='designPlatform'
  1103. }
  1104. },
  1105. tabChange(key){
  1106. console.log(key)
  1107. this.materialHttp(key)
  1108. },
  1109. handleChange(value) {
  1110. console.log(`selected ${value}`);
  1111. },
  1112. filterOption(input, option) {
  1113. return (
  1114. option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
  1115. );
  1116. },
  1117. onClose() {
  1118. this.visible = false;
  1119. },
  1120. // 上传素材
  1121. uploadMaterial(){
  1122. },
  1123. sort(pagination, filters, sorter, { currentDataSource }){
  1124. this.ipagination.current=pagination.current;
  1125. this.ipagination.pageSize=pagination.pageSize;
  1126. this.materialHttp(this.activeKey)
  1127. },
  1128. // 请求素材
  1129. materialHttp(type){
  1130. this.loading=true;
  1131. this.data=[];
  1132. let params=this.handlerParams(type)
  1133. params={
  1134. ...params,
  1135. pageNo:this.ipagination.current,
  1136. pageSize:this.ipagination.pageSize
  1137. }
  1138. getAction('/platform/material/listByRole',params).then(res=>{
  1139. console.log(res);
  1140. if(res.success){
  1141. this.loading=false;
  1142. this.data=res.result.list;
  1143. this.ipagination.total=res.result.total;
  1144. }
  1145. })
  1146. },
  1147. onClose() {
  1148. this.visible = false;
  1149. },
  1150. scriptClose() {
  1151. this.scriptVisible = false;
  1152. },
  1153. // 视频查看详情
  1154. viewDetails(record){
  1155. console.log(record)
  1156. this.currentMaterial=record
  1157. if(record.materialStatus>=4){
  1158. this.currentVideo={};
  1159. this.visible = true;
  1160. if(record.videoId){
  1161. this.visibleLoading=true
  1162. getAction(this.url.videoDetail,{
  1163. videoId:record.videoId
  1164. }).then(res=>{
  1165. console.log(res);
  1166. this.visibleLoading=false
  1167. if(res.success){
  1168. if(res.result){
  1169. let tagList=res.result.tag?res.result.tag.split(','):[]
  1170. let imgList=res.result.imageUrl?res.result.imageUrl.split(','):[]
  1171. console.log(tagList)
  1172. this.currentVideo={
  1173. ...res.result,
  1174. tagList,
  1175. imgList
  1176. }
  1177. }
  1178. }else{
  1179. this.currentVideo={};
  1180. }
  1181. })
  1182. }else{
  1183. this.currentVideo=record
  1184. this.visible = true;
  1185. }
  1186. }else{
  1187. this.$message.error('请等待脚本审核通过后,上传视频')
  1188. }
  1189. },
  1190. // 脚本查看详情
  1191. scriptViewDetails(record){
  1192. console.log(record)
  1193. this.currentMaterial=record
  1194. this.currentScript={};
  1195. if(record.scriptId){
  1196. getAction(this.url.scriptDetail,{
  1197. scriptId:record.scriptId
  1198. }).then(res=>{
  1199. console.log(res);
  1200. if(res.success){
  1201. this.currentScript=res.result;
  1202. this.scriptVisible = true;
  1203. }else{
  1204. this.currentScript={};
  1205. }
  1206. })
  1207. }else{
  1208. this.currentScript=record
  1209. this.scriptVisible = true;
  1210. }
  1211. },
  1212. search(){
  1213. },
  1214. reset(){
  1215. this.materialName='';
  1216. this.materialId='';
  1217. this.orderStatus='';
  1218. this.orderParticipants="";
  1219. this.orderSponsor='';
  1220. },
  1221. handlerParams(status){
  1222. if(this.$parent.role=='designLeader'){
  1223. if(status==1){
  1224. return {
  1225. materialStatus:'1234567',
  1226. designUserId:this.userInfo.id
  1227. }
  1228. }else if(status==2){
  1229. return {
  1230. materialStatus:'36',
  1231. designUserId:this.userInfo.id
  1232. }
  1233. }else if(status==4){
  1234. return {
  1235. materialStatus:'0',
  1236. designUserId:this.userInfo.id
  1237. }
  1238. }
  1239. }else if(this.$parent.role=='design'){
  1240. if(status==1){
  1241. return {
  1242. materialStatus:'1346',
  1243. designUserId:this.userInfo.id
  1244. }
  1245. }else if(status==2){
  1246. return {
  1247. materialStatus:'36',
  1248. designUserId:this.userInfo.id
  1249. }
  1250. }else if(status==3){
  1251. return {
  1252. materialStatus:'7',
  1253. designUserId:this.userInfo.id
  1254. }
  1255. }else if(status==4){
  1256. return {
  1257. materialStatus:'1234567',
  1258. designUserId:this.userInfo.id
  1259. }
  1260. }
  1261. }
  1262. },
  1263. handlerParamsRole(role){
  1264. if(this.$parent.role=='operator'){
  1265. this.panes=this.operatorPanes
  1266. }else if(this.$parent.role=='designLeader'){
  1267. this.panes=this.designLeaderPanes
  1268. }
  1269. },
  1270. beforeUpload(file) {
  1271. this.uploadAction= `http://api.tjyourong.com.cn/jeecg-boot/platform/file/uploadScript?materialId=${this.currentMaterial.materialId}&projectId=${this.currentMaterial.projectId}`
  1272. this.loadDisabled = true
  1273. const size = (Number(file.size) / (1024 * 1024)).toFixed(2)
  1274. const fileName = file.name
  1275. const fileStrArr = fileName.split('.')
  1276. const suffix = fileStrArr[fileStrArr.length - 1]
  1277. let result = fileSuffix.some((item) => {
  1278. return item === suffix
  1279. })
  1280. if (!result) {
  1281. this.$message.error('不支持该文件类型')
  1282. this.loadDisabled = false
  1283. return false
  1284. }
  1285. if (size > 10) {
  1286. this.$message.error('文件不能大于10MB')
  1287. this.loadDisabled = false
  1288. return false
  1289. }
  1290. },
  1291. handleChange(info) {
  1292. if (info.file.status !== 'uploading') {
  1293. console.log(info.file, info.fileList)
  1294. }
  1295. if (info.file.status === 'done') {
  1296. this.$message.success(`${info.file.name} 上传成功`)
  1297. this.loadDisabled = false
  1298. this.scriptVisible=false;
  1299. this.materialHttp(this.activeKey)
  1300. } else if (info.file.status === 'error') {
  1301. this.$message.error(`${info.file.name} file upload failed.`)
  1302. this.loadDisabled = false
  1303. this.scriptVisible=false;
  1304. }
  1305. },
  1306. showChildrenDrawer() {
  1307. this.childrenDrawer = true;
  1308. this.getTagListAll()
  1309. },
  1310. onChildrenDrawerClose() {
  1311. this.childrenDrawer = false;
  1312. this.loadingElse2=false
  1313. this.dataElse = []
  1314. this.form.resetFields()
  1315. this.urlList = {
  1316. url: '',
  1317. md5: '',
  1318. name: '',
  1319. }
  1320. this.tags = []
  1321. this.urlListImage = {
  1322. url: [],
  1323. md5: [],
  1324. name: [],
  1325. size: [],
  1326. }
  1327. this.imageArrList = []
  1328. },
  1329. onChildrenDrawerOk(){
  1330. this.form.validateFieldsAndScroll((err, values) => {
  1331. if (!err) {
  1332. console.log(values)
  1333. this.loadingElse2 = true
  1334. var params = {
  1335. ...values,
  1336. }
  1337. // var roleCode = {}
  1338. // for (const key in this.role) {
  1339. // if (key == 'roleCode') {
  1340. // this.role[key] = this.role[key] + 'Id'
  1341. // roleCode[this.role[key]] = this.userInfo.id
  1342. // }
  1343. // }
  1344. params.id = this.add ? null : this.id
  1345. params.code = this.urlList.md5
  1346. params.url = this.urlList.url
  1347. params.materialName = this.urlList.name
  1348. params.userId = this.userInfo.id
  1349. params.projectId = values.projectId
  1350. params.materialDescribe = values.materialDescribe
  1351. params.type = 'VIDEO'
  1352. // params.tagList = values.tagList
  1353. params.ascription ={
  1354. planId: this.currentMaterial.plan,
  1355. shotId: this.currentMaterial.shot,
  1356. clipId: this.currentMaterial.clip,
  1357. }
  1358. params.projectId=this.currentMaterial.projectId
  1359. params.materialId=this.currentMaterial.id||this.currentMaterial.materialId
  1360. params.tag = this.tags
  1361. params.imageArr = this.imageArrList
  1362. if (this.add) {
  1363. orderFileInsert(params).then((res) => {
  1364. if (res.success) {
  1365. this.form.resetFields()
  1366. this.urlList = {
  1367. url: '',
  1368. md5: '',
  1369. name: '',
  1370. }
  1371. this.urlListImage = {
  1372. url: [],
  1373. md5: [],
  1374. name: [],
  1375. size: [],
  1376. }
  1377. this.imageArrList = []
  1378. this.tags = []
  1379. this.childrenDrawer = false
  1380. this.visible=false;
  1381. this.add = true
  1382. for (const key in this.role) {
  1383. if (key == 'roleCode') {
  1384. this.role[key] = this.role[key].substr(0, this.role[key].length - 2)
  1385. }
  1386. }
  1387. this.$message.success('素材上传成功')
  1388. this.loadingElse2 = false
  1389. this.materialHttp(this.activeKey)
  1390. // this.departValue = []
  1391. } else {
  1392. this.$message.error(res.message)
  1393. this.loadingElse2 = false
  1394. this.childrenDrawer = false
  1395. this.visible=false;
  1396. }
  1397. })
  1398. } else {
  1399. fileEdit({
  1400. ...params,
  1401. status: '0',
  1402. }).then((res) => {
  1403. if (res.success) {
  1404. this.form.resetFields()
  1405. this.urlList = {
  1406. url: '',
  1407. md5: '',
  1408. name: '',
  1409. }
  1410. this.tags = []
  1411. this.childrenDrawer = false
  1412. this.add = true
  1413. for (const key in this.role) {
  1414. if (key == 'roleCode') {
  1415. this.role[key] = this.role[key].substr(0, this.role[key].length - 2)
  1416. }
  1417. }
  1418. } else {
  1419. this.$message.error(res.message)
  1420. this.childrenDrawer = false
  1421. }
  1422. })
  1423. }
  1424. }else {
  1425. }
  1426. })
  1427. },
  1428. // 上传视频相关方法
  1429. removeUpload() {
  1430. this.form.setFieldsValue({
  1431. contentTagList: null,
  1432. modalityTagList: null,
  1433. modTagList: null,
  1434. senceTagList: null,
  1435. })
  1436. },
  1437. overUpload(urlAll) {
  1438. console.log(urlAll)
  1439. this.confirmLoading = true
  1440. this.repeat = false
  1441. this.urlList.url = urlAll[0].url
  1442. this.$message.success('上传成功')
  1443. getAction('/ctop/materialTagInfo/detail', {
  1444. code: this.urlList.md5,
  1445. }).then((res) => {
  1446. if (res.success) {
  1447. if (res.modalityTagList.length > 0) {
  1448. this.form.setFieldsValue({
  1449. contentTagList: res.contentTagList.map((item) => {
  1450. return item.tagId
  1451. }),
  1452. modalityTagList: res.modalityTagList.map((item) => {
  1453. return item.tagId
  1454. }),
  1455. modTagList: res.modTagList.map((item) => {
  1456. return item.tagId
  1457. }),
  1458. senceTagList: res.senceTagList.map((item) => {
  1459. return item.tagId
  1460. }),
  1461. })
  1462. }
  1463. }
  1464. })
  1465. },
  1466. deleteImage(url) {
  1467. console.log(url, this.urlListImage.url)
  1468. var index = this.imageArrList.findIndex((v) => v.url === url)
  1469. this.imageArrList.splice(index, 1)
  1470. console.log(index)
  1471. },
  1472. overUploadImage(urlAll) {
  1473. var that = this
  1474. that.material = []
  1475. that.imageArrList = []
  1476. var img
  1477. if (urlAll.length > 0) {
  1478. for (var i = 0; i < urlAll.length; i++) {
  1479. that.imageArrList.push({
  1480. // width: img.width,
  1481. // height: img.height,
  1482. // size: this.urlListImage.size[i],
  1483. code: this.urlListImage.md5[i],
  1484. url: urlAll[i].url,
  1485. materialName: this.urlListImage.name[i],
  1486. })
  1487. img = new Image()
  1488. img.src = urlAll[i].url
  1489. }
  1490. } else {}
  1491. },
  1492. addImage(item) {
  1493. this.addImageVisible = true
  1494. this.addImageData = item
  1495. },
  1496. showImage(item) {
  1497. this.chouzhen = true
  1498. this.chouzhenList = []
  1499. var params = {
  1500. videoSignature: item.code,
  1501. pageSize: 20,
  1502. pageNo: 1,
  1503. }
  1504. getAction('/cutFrame/material/list', params).then((res) => {
  1505. console.log(res)
  1506. if (res.success) {
  1507. this.chouzhenList.push(...res.result.records)
  1508. }
  1509. })
  1510. },
  1511. closeImage() {
  1512. this.addImageVisible = false
  1513. this.urlListImage = {
  1514. url: [],
  1515. md5: [],
  1516. name: [],
  1517. size: [],
  1518. }
  1519. this.imageArrList = []
  1520. },
  1521. file(file) {
  1522. var bmf = new BMF()
  1523. var that = this
  1524. return new Promise(function (resolve, reject) {
  1525. bmf.md5(file, (err, md5) => {
  1526. that.urlList.name = file.name
  1527. that.urlList.md5 = md5
  1528. fileCheck({
  1529. code: md5,
  1530. projectId: that.currentMaterial.projectId,
  1531. }).then((res) => {
  1532. if (res.code == 0) {
  1533. that.$message.error('此素材已经上传')
  1534. that.repeat = true
  1535. reject()
  1536. } else {
  1537. that.repeat = false
  1538. resolve()
  1539. // reject()
  1540. }
  1541. })
  1542. })
  1543. })
  1544. },
  1545. fileWater(file) {
  1546. var bmf = new BMF()
  1547. var that = this
  1548. var codeData = that.urlList.md5 != '' ? that.urlList.md5 : that.addImageData.code
  1549. console.log(codeData)
  1550. this.urlListImage = {
  1551. url: [],
  1552. md5: [],
  1553. name: [],
  1554. size: [],
  1555. }
  1556. return new Promise(function (resolve, reject) {
  1557. bmf.md5(file, (err, md5) => {
  1558. that.urlListImage.name.push(file.name)
  1559. that.urlListImage.md5.push(md5)
  1560. that.urlListImage.size.push(file.size)
  1561. resolve()
  1562. })
  1563. })
  1564. },
  1565. getTagListAll() {
  1566. this.departTree = []
  1567. this.departTreeModality = [] //形式
  1568. this.departTreeContent = [] // 内容
  1569. this.departTreeSence = [] // 场景
  1570. this.departTreeMod = [] //基调
  1571. this.getQueryTree(1, 'departTreeModality')
  1572. this.getQueryTree(2, 'departTreeMod')
  1573. this.getQueryTree(3, 'departTreeContent')
  1574. this.getQueryTree(4, 'departTreeSence')
  1575. },
  1576. getQueryTree(type, arr) {
  1577. getAction('/ctop/tagInfo/queryTreeList', {
  1578. categoryId: type,
  1579. }).then((res) => {
  1580. if (res.success) {
  1581. if (res.result) {
  1582. this[arr] = this.getTreeData(res.result)
  1583. }
  1584. }
  1585. })
  1586. },
  1587. getTreeData(data) {
  1588. for (var i = 0; i < data.length; i++) {
  1589. if (data[i].children) {
  1590. if (data[i].children.length < 1) {
  1591. // children若为空数组,则将children设为undefined
  1592. data[i].disabled = false
  1593. } else {
  1594. // // children若不为空数组,则继续 递归调用 本方法
  1595. data[i].disabled = true
  1596. this.getTreeData(data[i].children)
  1597. }
  1598. } else {
  1599. data[i].disabled = false
  1600. }
  1601. }
  1602. return data
  1603. },
  1604. getTagListInfo(md5) {
  1605. this.departValueInfoModality = []
  1606. this.departValueInfoMod = []
  1607. this.departValueInfoContent = []
  1608. this.departValueInfoSence = []
  1609. getAction('/ctop/materialTagInfo/detail', {
  1610. code: md5,
  1611. }).then((res) => {
  1612. if (res.success) {
  1613. this.tagInfoList = [...res.modalityTagList, ...res.contentTagList, ...res.senceTagList, ...res.modTagList]
  1614. if (this.tagInfoListVisible) {
  1615. this.departValueInfoModality = res.modalityTagList.map((item) => {
  1616. return item.tagId
  1617. })
  1618. this.departValueInfoMod = res.modTagList.map((item) => {
  1619. return item.tagId
  1620. })
  1621. this.departValueInfoContent = res.contentTagList.map((item) => {
  1622. return item.tagId
  1623. })
  1624. this.departValueInfoSence = res.senceTagList.map((item) => {
  1625. return item.tagId
  1626. })
  1627. }
  1628. }
  1629. })
  1630. },
  1631. showInput() {
  1632. this.inputVisible = true
  1633. this.$nextTick(function () {
  1634. this.$refs.input.focus()
  1635. })
  1636. },
  1637. handleInputChange(e) {
  1638. this.inputValue = e.target.value
  1639. },
  1640. handleInputConfirm() {
  1641. const inputValue = this.inputValue
  1642. let tags = this.tags
  1643. if (inputValue && tags.indexOf(inputValue) === -1) {
  1644. tags = [...tags, inputValue]
  1645. }
  1646. Object.assign(this, {
  1647. tags,
  1648. inputVisible: false,
  1649. inputValue: '',
  1650. })
  1651. },
  1652. },
  1653. mounted(){
  1654. let userInfo=localStorage.getItem('pro__Login_Userinfo');
  1655. if(userInfo){
  1656. this.userInfo=JSON.parse(userInfo).value
  1657. }
  1658. this.roleCode=localStorage.getItem('roleCode')
  1659. console.log(this.$parent.materialStatus)
  1660. this.role=this.$parent.role;
  1661. this.activeKey=this.$parent.materialStatus
  1662. this.materialHttp(this.$parent.materialStatus)
  1663. },
  1664. activated() {
  1665. if(this.$parent.role=='operator'){
  1666. this.panes=this.operatorPanes
  1667. }else if(this.$parent.role=='designLeader'){
  1668. this.panes=this.designLeaderPanes
  1669. }else if(this.$parent.role=='design'){
  1670. this.panes=this.designPanes
  1671. }
  1672. this.activeKey=this.$parent.materialStatus
  1673. this.materialHttp(this.$parent.materialStatus)
  1674. },
  1675. filters:{
  1676. handlerMaterialStatus(val){
  1677. let str='';
  1678. switch(val){
  1679. case 0:
  1680. str= '待指派'
  1681. break;
  1682. case 1:
  1683. str= '脚本待上传'
  1684. break;
  1685. case 2:
  1686. str= '脚本待审核'
  1687. break;
  1688. case 3:
  1689. str= '脚本被驳回'
  1690. break;
  1691. case 4:
  1692. str= '视频待上传'
  1693. break;
  1694. case 5:
  1695. str= '视频待审核'
  1696. break;
  1697. case 6:
  1698. str= '视频被驳回'
  1699. break;
  1700. case 7:
  1701. str= '物料已完结'
  1702. break;
  1703. default:
  1704. str='出错了'
  1705. break;
  1706. }
  1707. return str
  1708. },
  1709. handlerVideoStatus(val){
  1710. let str='';
  1711. switch(val){
  1712. case 0:
  1713. str= '待上传'
  1714. break;
  1715. case 1:
  1716. str= '待审核'
  1717. break;
  1718. case 2:
  1719. str= '被驳回'
  1720. break;
  1721. case 3:
  1722. str= '已审核'
  1723. break;
  1724. default:
  1725. str='出错了'
  1726. break;
  1727. }
  1728. return str
  1729. },
  1730. },
  1731. }
  1732. </script>