transRequirement.vue 72 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287
  1. <template>
  2. <div class="transRequirementClass">
  3. <!-- 头部代码块查询等 -->
  4. <div class="top">
  5. <dil-form
  6. :formId="searchFormId"
  7. v-model="form1"
  8. @clearChange="clearChange"
  9. :statusIcon="false"
  10. labelPosition="right"
  11. @defaultValueGet="defaultValueGet"
  12. ></dil-form>
  13. </div>
  14. <div class="elDivider">
  15. <el-divider></el-divider>
  16. </div>
  17. <div class="buttonModel">
  18. <div class="operation">
  19. <el-button
  20. size="mini"
  21. type="primary"
  22. @click="btnclick(0)"
  23. v-privilege="activeMenu + 'ADD'"
  24. >
  25. <i class="el-icon-plus"></i>新增
  26. </el-button>
  27. <el-button size="mini" type="primary" @click="batchSubmit">
  28. 申报
  29. </el-button>
  30. <el-button
  31. size="mini"
  32. type="danger"
  33. @click="logicDelete()"
  34. :disabled="deleteButton === 0 ? true : false"
  35. v-privilege="activeMenu + 'DELETE'"
  36. >
  37. 删除
  38. </el-button>
  39. <el-button size="mini" type="primary" @click="exportData()"
  40. ><i class="el-icon-download"></i>导出(Excel)</el-button
  41. >
  42. <el-button
  43. size="mini"
  44. type="primary"
  45. icon="el-icon-edit-outline"
  46. @click="logicbulu()"
  47. :disabled="buluButton === 0 ? true : false"
  48. >
  49. 补录(仅计次信息)
  50. </el-button>
  51. <el-button size="mini" type="primary" class="btn" @click="preview()">
  52. 查阅应急操作手册
  53. </el-button>
  54. </div>
  55. <el-dialog
  56. title="文件预览"
  57. :visible.sync="dialogVisible3"
  58. destroy-on-close
  59. width="90%"
  60. top="10vh"
  61. >
  62. <iframe
  63. :src="previewUrl"
  64. width="100%"
  65. :height="singleTableHeight"
  66. ></iframe>
  67. </el-dialog>
  68. <div class="search">
  69. <el-button
  70. size="mini"
  71. type="primary"
  72. class="btn"
  73. @click="onclick(1)"
  74. v-privilege="activeMenu + 'QUERY'"
  75. >
  76. <i class="el-icon-search"></i>查询
  77. </el-button>
  78. <el-button
  79. size="mini"
  80. type="primary"
  81. class="btn"
  82. @click="onclickFixed"
  83. v-privilege="activeMenu + 'QUERYFIXED'"
  84. >
  85. <i class="el-icon-search"></i>查询固定需求
  86. </el-button>
  87. <el-button
  88. size="mini"
  89. type="primary"
  90. class="btn"
  91. @click="option.showFilter = !option.showFilter"
  92. >
  93. {{ option.showFilter ? '关闭表格过滤' : '开启表格过滤' }}
  94. </el-button>
  95. </div>
  96. </div>
  97. <el-dialog
  98. :title="'实际转运吨位录入'"
  99. :visible.sync="buludialogVisible"
  100. width="90%"
  101. :show-close="!loading"
  102. :close-on-click-modal="false"
  103. >
  104. <el-input
  105. v-model="alternateFields6"
  106. placeholder="请输入实际转运吨位"
  107. ></el-input>
  108. <el-button size="mini" type="primary" class="btn" @click="buluClick()">
  109. <i class="el-icon-search"></i>确定
  110. </el-button>
  111. </el-dialog>
  112. <el-dialog
  113. :title="
  114. '运输需求 - ' + (dialog.editorBox.type === 'ADD' ? '新增' : '修改')
  115. "
  116. :visible.sync="dialogVisible"
  117. width="90%"
  118. @close="clearAll"
  119. :show-close="!loading"
  120. :close-on-click-modal="false"
  121. >
  122. <el-drawer
  123. title="选择运单"
  124. :visible.sync="drawerLn2"
  125. direction="rtl"
  126. size="45%"
  127. :modal-append-to-body="false"
  128. >
  129. <div>
  130. <el-input
  131. v-model="inputLn"
  132. placeholder="请输入物资名称"
  133. clearable
  134. style="width: 200px"
  135. ></el-input>
  136. <el-button
  137. size="mini"
  138. type="primary"
  139. class="btn"
  140. @click="onclickLnSearchClick()"
  141. >
  142. <i class="el-icon-search"></i>查询
  143. </el-button>
  144. </div>
  145. <dilTable
  146. v-bind.sync="optionSearchClick"
  147. @radio-change="selectionChangeLn2"
  148. ></dilTable>
  149. <el-button
  150. size="mini"
  151. type="primary"
  152. class="btn"
  153. @click="handClickSearchClick()"
  154. >
  155. <i class="el-icon-search"></i>确定
  156. </el-button>
  157. </el-drawer>
  158. <el-tabs v-model="dialog.editorBox.activeName" type="border-card">
  159. <dil-form
  160. :formId="addFormId"
  161. :statusIcon="false"
  162. labelPosition="right"
  163. v-model="form2"
  164. @searchClick="searchClick"
  165. ref="form2"
  166. v-if="dialogVisible"
  167. labelWidth="120px"
  168. @selectChange="selectChangeForm2"
  169. >
  170. </dil-form>
  171. </el-tabs>
  172. <div class="insertClass">
  173. <el-button size="mini" type="primary" @click="addRow">
  174. <i class="el-icon-plus"></i>新增
  175. </el-button>
  176. <el-button size="mini" type="primary" @click="clearAll">
  177. <i class="el-icon-refresh"></i>清空
  178. </el-button>
  179. </div>
  180. <div class="table">
  181. <el-table
  182. :data="tableData"
  183. style="width: 100%; min-height: 200px !important"
  184. border
  185. >
  186. <el-table-column
  187. v-for="(item, index) in capacityType === '吊车'
  188. ? tableColumnList2
  189. : tableColumnList"
  190. :label="item.label"
  191. :prop="item.prop"
  192. :key="index"
  193. :type="item.type"
  194. align="center"
  195. :column-key="item.key"
  196. :width="item.width"
  197. >
  198. <template slot-scope="scope">
  199. <el-form :model="scope.row" ref="tableForm_1" label-width="120px">
  200. <template v-if="item.slotType === 'auto'">
  201. <el-form-item
  202. label-width="0"
  203. v-if="item.isValidate"
  204. :prop="item.prop"
  205. :rules="[
  206. { required: true, message: '请输入' + item.label + '' }
  207. ]"
  208. >
  209. <el-autocomplete
  210. clearable
  211. :index="scope.$index"
  212. :ref="item.prop"
  213. v-autocomplete-scroll="handleScroll"
  214. style="width: 100%"
  215. class="inline-input"
  216. v-model="scope.row[item.prop]"
  217. :fetch-suggestions="
  218. (queryString, cb) => {
  219. querySearchTable(
  220. queryString,
  221. cb,
  222. scope.row,
  223. item.prop
  224. )
  225. }
  226. "
  227. :placeholder="`请输入${item.label}`"
  228. @select="
  229. handleSelectTable(
  230. $event,
  231. scope.row,
  232. item.prop,
  233. scope.$index
  234. )
  235. "
  236. @blur="onBlur"
  237. >
  238. <template slot-scope="{ item }">
  239. <div class="name">
  240. {{ item[item.prop] }}
  241. <br />
  242. <span
  243. v-if="item.lineName"
  244. style="color: #8492a6; font-size: 13px"
  245. >
  246. {{ item.lineDesk }}
  247. </span>
  248. </div>
  249. </template>
  250. </el-autocomplete>
  251. </el-form-item>
  252. <el-form-item
  253. label-width="0"
  254. v-if="!item.isValidate"
  255. :prop="item.prop"
  256. >
  257. <el-autocomplete
  258. class="inline-input"
  259. style="width: 100%"
  260. v-model="scope.row[item.prop]"
  261. :fetch-suggestions="
  262. (queryString, cb) => {
  263. querySearchTable(
  264. queryString,
  265. cb,
  266. scope.row,
  267. item.prop
  268. )
  269. }
  270. "
  271. :placeholder="`请输入${item.label}`"
  272. @select="handleSelectTable($event, scope.row, item.prop)"
  273. @blur="onBlur"
  274. >
  275. <template slot-scope="{ item }">
  276. <div class="name">{{ item[item.prop] }}</div>
  277. </template>
  278. </el-autocomplete>
  279. </el-form-item>
  280. </template>
  281. <template v-else-if="item.slotType === 'input'">
  282. <el-form-item
  283. label-width="0"
  284. v-model="scope.row[item.prop]"
  285. v-if="item.isValidate"
  286. :prop="item.prop"
  287. :rules="[
  288. { required: true, message: '请输入' + item.label + '' }
  289. ]"
  290. >
  291. <el-input
  292. @focus="getInputFocus($event)"
  293. v-model="scope.row[item.prop]"
  294. :placeholder="`请输入${item.label}`"
  295. :type="item.inputType"
  296. clearable
  297. >
  298. </el-input>
  299. </el-form-item>
  300. <el-form-item
  301. label-width="0"
  302. v-model="scope.row[item.prop]"
  303. v-if="!item.isValidate"
  304. :prop="item.prop"
  305. >
  306. <el-input
  307. @focus="getInputFocus($event)"
  308. v-model="scope.row[item.prop]"
  309. :placeholder="`请输入${item.label}`"
  310. :type="item.inputType"
  311. clearable
  312. >
  313. </el-input>
  314. </el-form-item>
  315. </template>
  316. <template v-else-if="item.slotType === 'select'">
  317. <el-form-item
  318. label-width="0"
  319. v-if="item.isValidate"
  320. :prop="item.prop"
  321. :rules="[
  322. { required: true, message: '请选择' + item.label + '' }
  323. ]"
  324. >
  325. <el-select
  326. clearable
  327. v-model="scope.row[item.prop]"
  328. :placeholder="`请选择${item.label}`"
  329. >
  330. <el-option
  331. v-for="(e, index) in item.options"
  332. :key="index"
  333. :label="e.label"
  334. :value="e.value"
  335. ></el-option>
  336. </el-select>
  337. </el-form-item>
  338. <el-select
  339. clearable
  340. v-if="!item.isValidate"
  341. v-model="scope.row[item.prop]"
  342. :placeholder="`请选择${item.label}`"
  343. >
  344. <el-option
  345. v-for="(e, index) in item.options"
  346. :key="index"
  347. :label="e.label"
  348. :value="e.value"
  349. ></el-option>
  350. </el-select>
  351. </template>
  352. <template v-else-if="item.slotType === 'dateTime'">
  353. <el-date-picker
  354. v-model="scope.row[item.prop]"
  355. :type="item.dateType"
  356. placeholder="选择日期时间"
  357. clearable
  358. value-format="timestamp"
  359. >
  360. </el-date-picker>
  361. </template>
  362. <template v-else-if="item.slotType === 'button'">
  363. <el-button
  364. size="mini"
  365. type="danger"
  366. @click="deleteRow(scope.$index, scope.row)"
  367. v-privilege="activeMenu + 'DELETE'"
  368. >
  369. 删除
  370. </el-button>
  371. <el-button
  372. size="mini"
  373. type="primary"
  374. @click="copyRow(scope.$index, scope.row)"
  375. v-privilege="activeMenu + 'DELETE'"
  376. >
  377. 复制
  378. </el-button>
  379. </template>
  380. <template v-else>
  381. <span>{{ scope.row[item.prop] }}</span>
  382. </template>
  383. </el-form>
  384. </template>
  385. </el-table-column>
  386. </el-table>
  387. </div>
  388. <el-drawer
  389. title="选择匹配需求代码"
  390. :visible.sync="drawerLn"
  391. direction="rtl"
  392. size="45%"
  393. :modal-append-to-body="false"
  394. >
  395. <div>
  396. <el-button
  397. size="mini"
  398. type="primary"
  399. class="btn"
  400. @click="onclickLn()"
  401. >
  402. <i class="el-icon-search"></i>查询
  403. </el-button>
  404. </div>
  405. <dilTable
  406. v-bind.sync="optionLn"
  407. @radio-change="selectionChangeLnCode"
  408. ></dilTable>
  409. <el-button size="mini" type="primary" class="btn" @click="handClick()">
  410. <i class="el-icon-search"></i>确定
  411. </el-button>
  412. </el-drawer>
  413. <span slot="footer" class="dialog-footer">
  414. <el-button size="mini" type="success" @click="showLineDrawer()">
  415. 快捷规则查询
  416. </el-button>
  417. <el-button size="mini" @click="dialogVisible = false">取 消</el-button>
  418. <el-button
  419. size="mini"
  420. type="primary"
  421. @click="submitBut()"
  422. :disabled="buttonType === 0 ? true : false"
  423. >确 定</el-button
  424. >
  425. </span>
  426. </el-dialog>
  427. <el-dialog
  428. :title="'运输需求 - 操作'"
  429. :visible.sync="dialogVisible2"
  430. width="90%"
  431. :show-close="!loading"
  432. :close-on-click-modal="false"
  433. >
  434. <el-tabs v-model="dialog.editorBox.activeName2" type="border-card">
  435. <dil-form
  436. :formId="574"
  437. :statusIcon="false"
  438. labelPosition="right"
  439. v-model="form4"
  440. ref="form4"
  441. v-if="dialogVisible2"
  442. labelWidth="120px"
  443. >
  444. </dil-form>
  445. </el-tabs>
  446. <div class="table">
  447. <el-table
  448. :data="tableData"
  449. style="width: 100%; min-height: 200px !important"
  450. border
  451. >
  452. <el-table-column
  453. v-for="item in tableColumnList"
  454. :label="item.label"
  455. :prop="item.prop"
  456. :key="item.key"
  457. align="center"
  458. :column-key="item.key"
  459. :width="item.width"
  460. >
  461. <template slot-scope="scope">
  462. <template v-if="item.slotType === 'auto'">
  463. <el-autocomplete
  464. class="inline-input"
  465. v-model="scope.row[item.prop]"
  466. :fetch-suggestions="
  467. (queryString, cb) => {
  468. querySearchTable(queryString, cb, scope.row, item.prop)
  469. }
  470. "
  471. :placeholder="`请输入${item.label}`"
  472. @select="handleSelectTable($event, scope.row, item.prop)"
  473. @blur="onBlur"
  474. ><template slot-scope="{ item }">
  475. <div class="name">{{ item[item.prop] }}</div>
  476. </template></el-autocomplete
  477. >
  478. </template>
  479. <template v-else-if="item.slotType === 'input'">
  480. <el-input
  481. v-model="scope.row[item.prop]"
  482. :placeholder="`请输入${item.label}`"
  483. :type="item.inputType"
  484. clearable
  485. >
  486. </el-input>
  487. </template>
  488. <template v-else-if="item.slotType === 'select'">
  489. <el-select
  490. v-model="scope.row[item.prop]"
  491. :placeholder="`请选择${item.label}`"
  492. >
  493. <el-option
  494. v-for="(e, index) in item.options"
  495. :key="index"
  496. :label="e.label"
  497. :value="e.value"
  498. ></el-option>
  499. </el-select>
  500. </template>
  501. <template v-else-if="item.slotType === 'dateTime'">
  502. <el-date-picker
  503. v-model="scope.row[item.prop]"
  504. :type="item.dateType"
  505. placeholder="选择日期时间"
  506. clearable
  507. value-format="timestamp"
  508. >
  509. </el-date-picker>
  510. </template>
  511. <template v-else-if="item.slotType === 'button'">
  512. <el-button
  513. type="danger"
  514. @click="deleteRow(scope.$index, scope.row)"
  515. v-privilege="activeMenu + 'DELETE'"
  516. disabled="false"
  517. >
  518. 删除
  519. </el-button>
  520. </template>
  521. <template v-else>
  522. <span>{{ scope.row[item.prop] }}</span>
  523. </template>
  524. </template>
  525. </el-table-column>
  526. </el-table>
  527. </div>
  528. <span slot="footer" class="dialog-footer">
  529. <el-button
  530. size="mini"
  531. type="danger"
  532. @click="handleClose()"
  533. :disabled="buttonType2 === 0 ? true : false"
  534. >撤 回</el-button
  535. >
  536. <el-button
  537. size="mini"
  538. type="primary"
  539. @click="handleClose2()"
  540. :disabled="buttonType1 === 0 ? true : false"
  541. >提 交
  542. </el-button>
  543. <el-button size="mini" type="primary" @click="delpaiche()">
  544. 取消派车
  545. </el-button>
  546. </span>
  547. </el-dialog>
  548. <div class="main">
  549. <dilTable
  550. ref="excelDom"
  551. v-bind.sync="tableSel"
  552. @func="func"
  553. @selection-change="selectionChangeLn"
  554. >
  555. <el-table-column
  556. label="操作"
  557. align="center"
  558. width="300px"
  559. fixed="right"
  560. >
  561. <template slot-scope="scope">
  562. <div
  563. style="
  564. display: flex;
  565. justify-content: center;
  566. align-items: center;
  567. "
  568. >
  569. <el-button
  570. class="el-button--mini"
  571. size="mini"
  572. type="primary"
  573. @click="updatePriceMaterial(scope.row)"
  574. v-if="['待申报'].includes(scope.row.status)"
  575. >
  576. 修改
  577. </el-button>
  578. <el-button
  579. class="el-button--mini"
  580. size="mini"
  581. type="danger"
  582. @click="withdraw(scope.row)"
  583. v-if="!['待申报'].includes(scope.row.status)"
  584. >
  585. 请求撤回
  586. </el-button>
  587. <el-button size="mini" type="primary" @click="copy(scope.row)">
  588. 复制
  589. </el-button>
  590. <el-button
  591. size="mini"
  592. type="primary"
  593. @click="operate(scope.row)"
  594. v-if="['待申报', '已申报'].includes(scope.row.status)"
  595. >
  596. 业务操作
  597. </el-button>
  598. <el-button
  599. size="mini"
  600. type="primary"
  601. @click="transOrderDetails(scope.row)"
  602. v-if="['已制订计划'].includes(scope.row.status)"
  603. >
  604. 运输详情
  605. </el-button>
  606. <el-button
  607. size="mini"
  608. type="primary"
  609. @click="requirementApproveDetails(scope.row)"
  610. v-if="['已申报', '已审批', '拒绝'].includes(scope.row.status)"
  611. >
  612. 审批详情
  613. </el-button>
  614. </div>
  615. </template>
  616. </el-table-column>
  617. </dilTable>
  618. </div>
  619. <!-- 尾部代码块表格等 -->
  620. <div class="footer"></div>
  621. <el-dialog
  622. title="运单详情"
  623. :visible.sync="dialogVisibleTransOrder"
  624. width="80%"
  625. >
  626. <transOrder
  627. :requirementId="transRequirementId"
  628. :operateRole="false"
  629. v-if="dialogVisibleTransOrder"
  630. ></transOrder>
  631. </el-dialog>
  632. <el-dialog
  633. title="取消派车原因"
  634. :visible.sync="delpaicheVisible"
  635. width="30%"
  636. >
  637. <el-input
  638. v-model="delpaicheInput"
  639. placeholder="请输入取消派车原因"
  640. ></el-input>
  641. <el-button
  642. size="mini"
  643. type="primary"
  644. class="btn"
  645. @click="delpaicheClick()"
  646. >
  647. <i class="el-icon-search"></i>确定
  648. </el-button>
  649. </el-dialog>
  650. <el-dialog
  651. :title="approveTitle"
  652. :visible.sync="dialogVisibleApprove"
  653. width="30%"
  654. >
  655. <div>
  656. <el-steps
  657. direction="vertical"
  658. :active="Number(approveStepList[0].active)"
  659. v-if="approveStepList.length > 1"
  660. space="60px"
  661. >
  662. <el-step
  663. v-for="item in approveStepList"
  664. :key="item.workFlowId"
  665. :title="item.companyName"
  666. :description="`${item.approveStatus}${
  667. item.approveReason ? '-' + item.approveReason : ''
  668. }`"
  669. :status="item.processStatus"
  670. ></el-step>
  671. </el-steps>
  672. </div>
  673. </el-dialog>
  674. </div>
  675. </template>
  676. <script>
  677. import transOrder from '../transOrder/transOrder.vue'
  678. import { toNumber } from 'xe-utils'
  679. import { getCompanyId } from '../../app.js'
  680. export default {
  681. components: {
  682. transOrder
  683. },
  684. data() {
  685. return {
  686. matchTransRequirementId: null,
  687. dialogVisible4: false,
  688. capacityType: '',
  689. formTable: {
  690. materialTypeName: ''
  691. },
  692. searchClickValue: null,
  693. matchSelection: [],
  694. inputLn: '',
  695. drawerLn2: false,
  696. updateIds: [],
  697. rowData: {},
  698. tableColumnList: [
  699. {
  700. type: 'index',
  701. label: '序号',
  702. prop: 'index',
  703. width: '40px',
  704. key: Math.floor(Math.random() * 1000) + '' // 止重复
  705. },
  706. {
  707. prop: 'materialTypeName',
  708. label: '业务名称',
  709. slotType: 'auto',
  710. isValidate: true,
  711. key: Math.floor(Math.random() * 1000) + ''
  712. },
  713. {
  714. prop: 'transrangeName',
  715. label: '业务区间',
  716. slotType: 'auto',
  717. isValidate: true,
  718. key: Math.floor(Math.random() * 1000) + ''
  719. },
  720. {
  721. prop: 'lineName',
  722. label: '运输路线',
  723. slotType: 'auto',
  724. isValidate: true,
  725. lineName: true,
  726. key: Math.floor(Math.random() * 1000) + ''
  727. },
  728. {
  729. prop: 'materialName',
  730. label: '物资',
  731. slotType: 'auto',
  732. // isValidate: true,
  733. width: '300px',
  734. key: Math.floor(Math.random() * 1000) + ''
  735. },
  736. {
  737. prop: 'capacityTypeName',
  738. label: '运力类型',
  739. slotType: 'auto',
  740. isValidate: true,
  741. key: Math.floor(Math.random() * 1000) + ''
  742. },
  743. {
  744. prop: 'billingType',
  745. label: '计费类型',
  746. slotType: 'select',
  747. isValidate: true,
  748. options: [
  749. { label: '计重', value: '计重' },
  750. { label: '计时', value: '计时' },
  751. { label: '计次', value: '计次' },
  752. { label: '计重且计时', value: '计重且计时' },
  753. { label: '计重或计时', value: '计重或计时' },
  754. { label: '计次且计重', value: '计次且计重' }
  755. ],
  756. key: Math.floor(Math.random() * 1000) + ''
  757. },
  758. {
  759. prop: 'materialNumber',
  760. label: '转运件数',
  761. slotType: 'input',
  762. dateType: 'number',
  763. key: Math.floor(Math.random() * 1000) + ''
  764. },
  765. {
  766. prop: 'materialWeight',
  767. label: '转运吨位',
  768. slotType: 'input',
  769. inputType: 'number',
  770. key: Math.floor(Math.random() * 1000) + ''
  771. },
  772. {
  773. prop: 'transTruckNumber',
  774. label: '转运车数',
  775. slotType: 'input',
  776. dateType: 'number',
  777. key: Math.floor(Math.random() * 1000) + ''
  778. },
  779. {
  780. prop: 'operate',
  781. label: '操作',
  782. slot: true,
  783. slotType: 'button',
  784. width: '200px',
  785. key: Math.floor(Math.random() * 1000) + ''
  786. }
  787. ],
  788. tableColumnList2: [
  789. {
  790. type: 'index',
  791. label: '序号',
  792. prop: 'index',
  793. width: '40px',
  794. key: Math.floor(Math.random() * 1000) + '' // 止重复
  795. },
  796. {
  797. prop: 'materialTypeName',
  798. label: '业务名称',
  799. slotType: 'auto',
  800. isValidate: true,
  801. key: Math.floor(Math.random() * 1000) + ''
  802. },
  803. {
  804. prop: 'transrangeName',
  805. label: '业务区间',
  806. slotType: 'auto',
  807. isValidate: true,
  808. key: Math.floor(Math.random() * 1000) + ''
  809. },
  810. {
  811. prop: 'lineName',
  812. label: '运输路线',
  813. slotType: 'auto',
  814. isValidate: true,
  815. lineName: true,
  816. key: Math.floor(Math.random() * 1000) + ''
  817. },
  818. {
  819. prop: 'materialName',
  820. label: '物资',
  821. slotType: 'auto',
  822. // isValidate: true,
  823. width: '300px',
  824. key: Math.floor(Math.random() * 1000) + ''
  825. },
  826. {
  827. prop: 'capacityTypeName',
  828. label: '运力类型',
  829. slotType: 'auto',
  830. isValidate: true,
  831. key: Math.floor(Math.random() * 1000) + ''
  832. },
  833. {
  834. prop: 'billingType',
  835. label: '计费类型',
  836. slotType: 'select',
  837. isValidate: true,
  838. options: [
  839. { label: '计重', value: '计重' },
  840. { label: '计时', value: '计时' },
  841. { label: '计次', value: '计次' },
  842. { label: '计重且计时', value: '计重且计时' },
  843. { label: '计次且计重', value: '计次且计重' }
  844. ],
  845. key: Math.floor(Math.random() * 1000) + ''
  846. },
  847. {
  848. prop: 'materialNumber',
  849. label: '转运件数',
  850. slotType: 'input',
  851. dateType: 'number',
  852. key: Math.floor(Math.random() * 1000) + ''
  853. },
  854. {
  855. prop: 'materialWeight',
  856. label: '转运吨位',
  857. slotType: 'input',
  858. inputType: 'number',
  859. key: Math.floor(Math.random() * 1000) + ''
  860. },
  861. {
  862. prop: 'transTruckNumber',
  863. label: '转运车数',
  864. slotType: 'input',
  865. dateType: 'number',
  866. key: Math.floor(Math.random() * 1000) + ''
  867. },
  868. {
  869. prop: 'operate',
  870. label: '操作',
  871. slot: true,
  872. slotType: 'button',
  873. width: '200px',
  874. key: Math.floor(Math.random() * 1000) + ''
  875. }
  876. ],
  877. activeMenu: window.top.localStorage.getItem('activeMenu'),
  878. approveTitle: '',
  879. dialogVisibleApprove: false,
  880. transRequirementId: null,
  881. dialogVisibleTransOrder: false,
  882. dialog: {
  883. cell: [],
  884. editorBox: {
  885. activeName: 1,
  886. activeName2: 1,
  887. nameObj: {
  888. companyid: {
  889. obj: {},
  890. arr: [],
  891. showDataArr: []
  892. },
  893. materiaid: {
  894. obj: {},
  895. arr: [],
  896. showDataArr: []
  897. },
  898. transRange: {
  899. obj: {},
  900. arr: [],
  901. showDataArr: []
  902. }
  903. },
  904. type: ''
  905. }
  906. },
  907. previewUrl: '',
  908. cell: [],
  909. dialogVisible: false,
  910. delpaicheInput: '',
  911. delpaicheVisible: false,
  912. alternateFields6: 0,
  913. buluButton: 0,
  914. tableData: [],
  915. deleteButton: 0,
  916. buttonType: 1,
  917. buttonType1: 1,
  918. buttonType2: 1,
  919. fileList: [],
  920. singleTableHeight: 600,
  921. buludialogVisible: false,
  922. form1: {},
  923. form2: {},
  924. drawerLn: false,
  925. idcount: [],
  926. idcount2: [],
  927. codecount: {},
  928. form3: {},
  929. form4: {},
  930. form5: {},
  931. dialogVisible: false,
  932. dialogVisible2: false,
  933. dialogVisible3: false,
  934. activeName: 'first',
  935. isKuang: false,
  936. loading: false,
  937. input: '',
  938. option: {
  939. // 表格请求数据的地址
  940. requestUrl:
  941. '/api/v1/ams/getproductionRequirementList?apiId=543&i=' + new Date(),
  942. selectionType: 'select',
  943. requestQuery: {},
  944. compareField: 'auditNumber',
  945. showFilter: false
  946. // height: 350
  947. },
  948. optionNoMerge: {
  949. // 表格请求数据的地址
  950. requestUrl:
  951. '/api/v1/ams/getproductionRequirementList?apiId=656&i=' + new Date(),
  952. selectionType: 'select',
  953. requestQuery: {},
  954. showFilter: false
  955. // height: 350
  956. },
  957. optionSearchClick: {
  958. requestUrl: '',
  959. requestQuery: {
  960. deleted: 0
  961. },
  962. selectionType: 'radio',
  963. reserveSelection: false,
  964. showFilter: false
  965. // height: 350
  966. },
  967. tableTitle: '生产运输需求',
  968. showFilter: true,
  969. searchFormId: 480,
  970. addFormId: 464,
  971. approveStepList: []
  972. }
  973. },
  974. computed: {
  975. tableSel() {
  976. console.log(this.form1, 'form1')
  977. if (this.form1.requirementStatus == '待申报') {
  978. this.onclick()
  979. return this.option
  980. } else {
  981. this.onclick()
  982. return this.optionNoMerge
  983. }
  984. }
  985. },
  986. created() {
  987. this.activeMenu = window.top.localStorage.getItem('activeMenu')
  988. // 接收路由参数
  989. let that = this
  990. if (that.$route.query.businessType) {
  991. that.form1.businessType = that.$route.query.businessType
  992. that.form2.businessType = that.$route.query.businessType
  993. }
  994. let businessCompanyId = getCompanyId()
  995. // that.form1.businessCompanyId = businessCompanyId
  996. that.form2.businessCompanyId = businessCompanyId
  997. // if (localStorage.getItem('roleCodes').includes('admin')) {
  998. // this.searchFormId = 480
  999. // this.addFormId = 464
  1000. // } else {
  1001. // this.searchFormId = 605
  1002. // this.addFormId = 606
  1003. // }
  1004. },
  1005. mounted() {
  1006. let that = this
  1007. if (that.$route.query.capacityType) {
  1008. that.form1.capacityTypes = that.$route.query.capacityType.split(',')
  1009. that.capacityType = that.$route.query.capacityType
  1010. }
  1011. // this.onclick()
  1012. },
  1013. directives: {
  1014. 'autocomplete-scroll': {
  1015. bind(el, binding, vnode) {
  1016. // 此处为了简单,直接判断触底了
  1017. function handleScroll(e) {
  1018. let isBottom =
  1019. e.target.clientHeight + e.target.scrollTop >
  1020. e.target.scrollHeight - 1
  1021. //console.log(e.target.clientHeight + e.target.scrollTop, e.target.scrollHeight, vnode.context.loading, vnode.context, 'debounce')
  1022. if (isBottom && !vnode.context.loading) {
  1023. // console.log(e.target.clientHeight + e.target.scrollTop, e.target.scrollHeight, vnode.context.loading, 'debounce')
  1024. binding.value(vnode)
  1025. }
  1026. }
  1027. // 监听滚动
  1028. let wrapDom = el.querySelector('.el-autocomplete-suggestion__wrap')
  1029. el.__handleScroll__ = handleScroll
  1030. el.__wrapDom__ = wrapDom
  1031. wrapDom.addEventListener('scroll', handleScroll, false)
  1032. },
  1033. unbind(el, binding, vnode) {
  1034. console.log('unbind')
  1035. // 解除事件监听
  1036. el.__wrapDom__.removeEventListener('scroll', el.__handleScroll__, false)
  1037. }
  1038. }
  1039. },
  1040. methods: {
  1041. matchSubmit() {
  1042. if (this.matchSelection == 0) {
  1043. return this.$message.error('请选择需求!')
  1044. }
  1045. console.log(this.matchSelection)
  1046. console.log(this.matchTransRequirementId)
  1047. let model = {
  1048. model: {
  1049. amsFixedNeeds: this.matchSelection.map((res) => res.fixedNeedsId),
  1050. transRequirementId: this.matchTransRequirementId
  1051. }
  1052. }
  1053. this.axios
  1054. .post('/api/v1/ams/addAmsFixedBindRequirement', model)
  1055. .then((res) => {
  1056. if (res.data.status == 'succeed') {
  1057. this.$message({
  1058. type: 'success',
  1059. message: '操作成功!'
  1060. })
  1061. }
  1062. })
  1063. },
  1064. getInputFocus(event) {
  1065. event.currentTarget.select()
  1066. },
  1067. selectChangeForm2(val) {
  1068. if (val.businessCompanyId) {
  1069. console.log('val=>', val)
  1070. this.form2.parentCompanyId = val.businessCompanyId[0].parentCompanyId
  1071. }
  1072. },
  1073. async handleScroll(val) {
  1074. console.log(val)
  1075. console.log(val.data.attrs.index, 'val.data')
  1076. let index = val.data.attrs.index
  1077. let prop = val.data.ref
  1078. let url = ''
  1079. let queryMap = {
  1080. index: this.$refs[prop][index].$props.value,
  1081. lastIndex: this.$refs[prop][index].$data.suggestions.slice(-1)[0].value
  1082. }
  1083. if (prop == 'organization' || 'materialTypeName') {
  1084. url = '/api/v1/uc/getMaterialTypeByLike'
  1085. queryMap.remark = '生产'
  1086. queryMap.companyType = '业务单位'
  1087. }
  1088. if (prop == 'transrangeName') {
  1089. if (this.form2.businessType && this.form2.businessType == 12) {
  1090. queryMap.remark = '生产'
  1091. queryMap.isNc = 'NC'
  1092. }
  1093. url = '/api/v1/uc/getTransRangeByLike'
  1094. queryMap.companyType = '业务单位'
  1095. }
  1096. if (prop == 'lineName') {
  1097. url = '/api/v1/uc/getLineByLike'
  1098. queryMap.lineType = '生产'
  1099. }
  1100. if (prop == 'materialName') {
  1101. url = '/api/v1/uc/getMaterialByLike'
  1102. }
  1103. if (prop == 'capacityTypeName') {
  1104. url = '/api/v1/uc/getCapacityTypeByLike'
  1105. }
  1106. this.axios.post(url, queryMap).then((res) => {
  1107. let data = res.data.data
  1108. if (data.length == 0) {
  1109. } else {
  1110. this.$refs[prop][index].$data.suggestions.push(...data)
  1111. }
  1112. })
  1113. },
  1114. copyRow(index, row) {
  1115. this.tableData.push({
  1116. ...row,
  1117. index: this.tableData.length + 1
  1118. })
  1119. },
  1120. clearTableItem(prop) {
  1121. console.log(prop)
  1122. console.log('prop')
  1123. delete this.formTable[prop]
  1124. },
  1125. onclickLnSearchClick() {
  1126. this.optionSearchClick.requestQuery = {}
  1127. },
  1128. async handClickSearchClick() {
  1129. if (this.searchClickValue) {
  1130. if (
  1131. !this.searchClickValue.forwardingPointId &&
  1132. !this.searchClickValue.receivingPointId
  1133. ) {
  1134. return this.$message.error('请选择运单')
  1135. }
  1136. //查询装货点
  1137. let map = {
  1138. startPointId: this.searchClickValue.forwardingPointId,
  1139. endPointId: this.searchClickValue.receivingPointId
  1140. }
  1141. let res = await this.axios.post(
  1142. '/api/v1/rms/queryInsertTransRange',
  1143. map
  1144. )
  1145. if (!res.data.succeed) {
  1146. return this.$message.error('查询装卸点失败')
  1147. }
  1148. if (this.form2.sourceOrderId) {
  1149. this.tableData.forEach((item, index) => {
  1150. if (item.isOrder) {
  1151. console.log(item, 'item')
  1152. let temp = {
  1153. isOrder: true,
  1154. transrangeName: res.data.data.transRangeName,
  1155. operationRange: res.data.data.transRangeId,
  1156. operationRangeId: res.data.data.transRangeId + '',
  1157. operationRangeName: res.data.data.transRangeName,
  1158. shippingPointId: res.data.data.startPointId,
  1159. receivingPointId: res.data.data.endPointId,
  1160. materialName: this.searchClickValue.materialName,
  1161. materialId: this.searchClickValue.materialId,
  1162. index: this.tableData.length + 1
  1163. }
  1164. this.$set(this.tableData, index, temp)
  1165. // this.formTable = temp;
  1166. console.log(this.tableData, 'tableData22')
  1167. }
  1168. })
  1169. } else {
  1170. this.tableData.push({
  1171. isOrder: true,
  1172. transrangeName: res.data.data.transRangeName,
  1173. operationRange: res.data.data.transRangeId,
  1174. operationRangeId: res.data.data.transRangeId + '',
  1175. operationRangeName: res.data.data.transRangeName,
  1176. shippingPointId: res.data.data.startPointId,
  1177. receivingPointId: res.data.data.endPointId,
  1178. materialName: this.searchClickValue.materialName,
  1179. materialId: this.searchClickValue.materialId,
  1180. index: this.tableData.length + 1
  1181. })
  1182. // this.formTable = {
  1183. // isOrder:true,
  1184. // transrangeName:res.data.data.transRangeName,
  1185. // operationRange: res.data.data.transRangeId,
  1186. // operationRangeId:res.data.data.transRangeId+"",
  1187. // operationRangeName:res.data.data.transRangeName,
  1188. // shippingPointId :res.data.data.startPointId,
  1189. // receivingPointId : res.data.data.endPointId,
  1190. // materialName: this.searchClickValue.materialName,
  1191. // materialId: this.searchClickValue.materialId,
  1192. // index: this.tableData.length + 1,
  1193. // };
  1194. }
  1195. // this.form2 = this.searchClickValue;
  1196. this.$set(this.form2, 'orderId', this.searchClickValue.orderId)
  1197. this.$set(
  1198. this.form2,
  1199. 'orderChildId',
  1200. this.searchClickValue.orderChildId
  1201. )
  1202. this.$set(this.form2, 'order', this.searchClickValue.serialNumber)
  1203. console.log(this.tableData)
  1204. }
  1205. this.drawerLn2 = false
  1206. },
  1207. selectionChangeLn2(selection) {
  1208. console.log(selection, 'selection')
  1209. this.searchClickValue = selection
  1210. },
  1211. selectionChangeLn3(selection) {
  1212. this.matchSelection = selection
  1213. },
  1214. searchClick(val) {
  1215. console.log(val)
  1216. this.drawerLn2 = true
  1217. this.optionSearchClick.requestUrl = val.url
  1218. },
  1219. clearChange(item) {
  1220. console.log(item, 'item')
  1221. Object.keys(item).forEach((i) => {
  1222. delete this.form1[i]
  1223. })
  1224. },
  1225. clearAll() {
  1226. this.form2 = {}
  1227. this.tableData = []
  1228. },
  1229. deleteRow(index, row) {
  1230. console.log(index, 'index')
  1231. this.tableData.splice(index, 1)
  1232. },
  1233. defaultValueGet(item) {
  1234. this.onclick()
  1235. console.log(item)
  1236. }, //取消派车
  1237. handleSelectTable(item, row, prop, index) {
  1238. console.log(index, 'index')
  1239. // this.$set(this.formTable,prop,item.text)
  1240. // console.log(this.formTable,"formTable");
  1241. if (prop == 'organization' || prop == 'materialTypeName') {
  1242. row.materialTypeName = item.operationsName
  1243. row.operationsNameId = item.operationsNameId
  1244. }
  1245. if (prop == 'transrangeName') {
  1246. row.transrangeName = item.operationRangeName
  1247. row.operationRangeName = item.operationRangeName //解决
  1248. row.operationRange = item.operationRangeId
  1249. row.operationRangeId = item.operationRangeId
  1250. row.shippingPointId = item.shippingPointId
  1251. row.receivingPointId = item.receivingPointId
  1252. }
  1253. if (prop == 'lineName') {
  1254. console.log(row)
  1255. row.lineName = item.lineName
  1256. row.lineId = item.lineId
  1257. }
  1258. if (prop == 'materialName') {
  1259. row.materialName = item.materialName
  1260. row.materialId = item.materialId
  1261. }
  1262. if (prop == 'capacityTypeName') {
  1263. row.capacityTypeName = item.capacityTypeName
  1264. row.capacityTypeId = item.capacityTypeId
  1265. }
  1266. row = { ...row, ...item }
  1267. },
  1268. querySearchTable(queryString, cb, row, prop) {
  1269. console.log(row[prop], 'prop')
  1270. console.log(queryString, 'queryString')
  1271. let url = ''
  1272. let queryMap = {
  1273. // lastIndex:0,
  1274. index: row[prop]
  1275. }
  1276. if (prop == 'organization' || 'materialTypeName') {
  1277. url = '/api/v1/uc/getMaterialTypeByLike'
  1278. queryMap.remark = '生产'
  1279. queryMap.companyType = '业务单位'
  1280. }
  1281. if (prop == 'transrangeName') {
  1282. if (this.form2.businessType && this.form2.businessType == 12) {
  1283. queryMap.remark = '生产'
  1284. queryMap.isNc = 'NC'
  1285. }
  1286. url = '/api/v1/uc/getTransRangeByLike'
  1287. queryMap.companyType = '业务单位'
  1288. }
  1289. if (prop == 'lineName') {
  1290. url = '/api/v1/uc/getLineByLike'
  1291. queryMap.lineType = '生产'
  1292. }
  1293. if (prop == 'materialName') {
  1294. url = '/api/v1/uc/getMaterialByLike'
  1295. }
  1296. if (prop == 'capacityTypeName') {
  1297. url = '/api/v1/uc/getCapacityTypeByLike'
  1298. queryMap.capacityTypeNameList = this.form1.capacityTypes
  1299. }
  1300. this.axios.post(url, queryMap).then((res) => {
  1301. let data = res.data.data
  1302. console.log('querySearchTable===>', data)
  1303. if (data.length == 0) {
  1304. let item = {}
  1305. item['prop'] = prop
  1306. item[prop] = '暂无数据,请核验或注册数据'
  1307. cb([item])
  1308. } else {
  1309. cb(data)
  1310. }
  1311. })
  1312. },
  1313. onBlur() {},
  1314. addRow() {
  1315. this.tableData.push({
  1316. index: this.tableData.length + 1,
  1317. carrierName: '',
  1318. materialNumber: null,
  1319. transTruckNumber: null,
  1320. dueTime: null,
  1321. materialTypeName: '',
  1322. operate: '',
  1323. transTruckNumber: '',
  1324. materialWeight: '',
  1325. billingType: '',
  1326. capacityTypeName: '',
  1327. materialName: '',
  1328. lineName: '',
  1329. transrangeName: ''
  1330. })
  1331. },
  1332. //批量申报
  1333. batchSubmit() {
  1334. if (this.idcount.length == 0) {
  1335. this.$message({
  1336. type: 'warning',
  1337. message: '请先选择需要申报的数据',
  1338. duration: 2000
  1339. })
  1340. return
  1341. }
  1342. this.$confirm('是否确认批量提交?', '提示', {
  1343. confirmButtonText: '确定',
  1344. cancelButtonText: '取消',
  1345. type: 'warning'
  1346. }).then(() => {
  1347. let map = {
  1348. approve: 'ok',
  1349. mapList: this.idcount
  1350. }
  1351. this.axios
  1352. .post('/api/v1/ams/productionRequirementChangeList', map)
  1353. .then((res) => {
  1354. if (res.data.status == 'succeed') {
  1355. this.$message({
  1356. type: 'success',
  1357. message: res.data.message
  1358. })
  1359. this.onclick()
  1360. } else {
  1361. this.$message({
  1362. type: 'error',
  1363. message: res.data.message
  1364. })
  1365. this.onclick()
  1366. }
  1367. })
  1368. })
  1369. },
  1370. //查看审批详情
  1371. requirementApproveDetails(row) {
  1372. this.approveTitle = row.serialNumber + '-' + '审批详情'
  1373. this.transRequirementId = row.transRequirementId
  1374. let map = {
  1375. transRequirementId: row.transRequirementId
  1376. }
  1377. this.dialogVisibleApprove = true
  1378. this.axios
  1379. .post('/api/v1/ams/requirementApproveDetails', map)
  1380. .then((res) => {
  1381. this.approveStepList = res.data.data
  1382. })
  1383. },
  1384. //查看运输详情
  1385. transOrderDetails(row) {
  1386. this.transRequirementId = row.transRequirementId
  1387. this.dialogVisibleTransOrder = true
  1388. console.log(row.transRequirementId)
  1389. },
  1390. handClick() {
  1391. let that = this
  1392. let change = that.form2.alternateFields1
  1393. that.$set(that.form2, 'alternateFields1', change)
  1394. that.form2.alternateFields1 = that.codecount.RULES_ID
  1395. that.form2.operationRange = that.codecount.TRANS_RANGE_ID
  1396. that.form2.businessCompanyId = that.codecount.COMPANY_ID
  1397. that.form2.operationsNameId = that.codecount.MATERIAL_ID
  1398. that.drawerLn = false
  1399. },
  1400. onclickLn() {
  1401. this.optionLn.requestQuery = JSON.parse(JSON.stringify(this.form1))
  1402. },
  1403. showLineDrawer(scope) {
  1404. this.drawerLn = true
  1405. },
  1406. selectionChangeLnCode(selection) {
  1407. let that = this
  1408. that.codecount = selection
  1409. },
  1410. // fileRemoveHandle4(file, fileList) {
  1411. // let that = this
  1412. // console.log('file,fileList' + file, fileList)
  1413. // // if (file.id) {
  1414. // // this.instFilePics.push(file.id);
  1415. // // }
  1416. // that.fileList = fileList
  1417. // },
  1418. selectionChangeLn(selection) {
  1419. let that = this
  1420. that.idcount = selection
  1421. that.idcount2 = []
  1422. console.log('selection======>', selection)
  1423. for (let item of that.idcount) {
  1424. that.idcount2 += item.transRequirementId + ','
  1425. if (item.status === '已审核' || item.status === '已申报') {
  1426. that.deleteButton = 0
  1427. } else {
  1428. that.deleteButton = 1
  1429. }
  1430. }
  1431. for (let item of that.idcount) {
  1432. that.idcount2 += item.requirementChildId
  1433. if (item.billingType === '计次') {
  1434. that.buluButton = 1
  1435. } else {
  1436. that.buluButton = 0
  1437. }
  1438. }
  1439. },
  1440. validateForms() {
  1441. this.tableData.forEach((item, index) => {
  1442. const formRef = this.$refs[`tableForm_${index}`]
  1443. console.log(formRef[0])
  1444. if (formRef) {
  1445. formRef[0].validate((valid) => {
  1446. console.log(valid, 'valid')
  1447. return valid
  1448. })
  1449. }
  1450. })
  1451. },
  1452. // validateForm(val) {
  1453. // console.log( eval('this.$refs.tableForm' + val)[0]);
  1454. // let flag = null
  1455. // eval('this.$refs.tableForm' + val)[0].validate(valid => {
  1456. // console.log(valid,"valid");
  1457. // if (!valid) {
  1458. // flag = true
  1459. // } else {
  1460. // flag = false
  1461. // }
  1462. // })
  1463. // return flag
  1464. // },
  1465. submitBut() {
  1466. let flag = true
  1467. this.$refs['tableForm_1'].forEach((item) => {
  1468. item.validate((valid) => {
  1469. flag = valid && flag
  1470. })
  1471. })
  1472. let that = this
  1473. if (this.$refs['form2'].validateForm() && flag) {
  1474. if (
  1475. new Date(that.form2.requirementStartTime).getTime() >
  1476. new Date(that.form2.requirementEndTime).getTime()
  1477. ) {
  1478. this.$message({
  1479. message: '用车开始时间不能大于用车结束时间',
  1480. type: 'warning'
  1481. })
  1482. return
  1483. }
  1484. if (
  1485. new Date(that.form2.requirementEndTime).getTime() -
  1486. 60 * 60 * 1000 * 13 >
  1487. new Date(that.form2.requirementStartTime).getTime()
  1488. ) {
  1489. this.$message({
  1490. message: '用车起止时间不能超过13小时',
  1491. type: 'warning'
  1492. })
  1493. return
  1494. }
  1495. const startTime = new Date(that.form2.requirementStartTime)
  1496. const endTime = new Date(that.form2.requirementEndTime)
  1497. const startHour = startTime.getHours()
  1498. const endHour = endTime.getHours()
  1499. const endMinutes = endTime.getMinutes()
  1500. const endSeconds = endTime.getSeconds()
  1501. let startArr1 = [8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
  1502. let endArr1 = [8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
  1503. let startArr2 = [19, 20, 21, 22, 23, 24, 0, 1, 2, 3, 4, 5, 6, 7, 8]
  1504. let endArr2 = [19, 20, 21, 22, 23, 24, 0, 1, 2, 3, 4, 5, 6, 7, 8]
  1505. if (startArr1.includes(startHour) && endArr1.includes(endHour)) {
  1506. if (endHour == 19 && (endMinutes > 0 || endSeconds > 0)) {
  1507. this.$message({
  1508. message: '用车结束时间为19点时,请勿选择时分秒',
  1509. type: 'warning'
  1510. })
  1511. return
  1512. }
  1513. } else if (startArr2.includes(startHour) && endArr2.includes(endHour)) {
  1514. if (endHour == 8 && (endMinutes > 0 || endSeconds > 0)) {
  1515. this.$message({
  1516. message: '用车结束时间为8点时,请勿选择时分秒',
  1517. type: 'warning'
  1518. })
  1519. return
  1520. }
  1521. } else {
  1522. this.$message({
  1523. message:
  1524. '用车起止时间不符合要求,白班在8点到19点之间,夜班在19点到8点之间',
  1525. type: 'warning'
  1526. })
  1527. return
  1528. }
  1529. if (true) {
  1530. if (that.dialog.editorBox.type === 'ADD') {
  1531. that
  1532. .$confirm('是否保存?', '提示', {
  1533. confirmButtonText: '确定',
  1534. cancelButtonText: '取消',
  1535. type: 'warning'
  1536. })
  1537. .then(() => {
  1538. that.dataSave()
  1539. })
  1540. .catch(() => {})
  1541. } else {
  1542. that
  1543. .$confirm('是否修改?', '提示', {
  1544. confirmButtonText: '确定',
  1545. cancelButtonText: '取消',
  1546. type: 'warning'
  1547. })
  1548. .then(() => {
  1549. that.dataSave()
  1550. })
  1551. .catch(() => {})
  1552. }
  1553. }
  1554. }
  1555. },
  1556. //撤回
  1557. handleClose() {
  1558. let that = this
  1559. that
  1560. .$confirm('是否撤回?', '提示', {
  1561. confirmButtonText: '确定',
  1562. cancelButtonText: '取消',
  1563. type: 'warning'
  1564. })
  1565. .then(() => {
  1566. that.valueUpdate(0)
  1567. })
  1568. .catch(() => {})
  1569. },
  1570. //提交
  1571. handleClose2() {
  1572. let that = this
  1573. that
  1574. .$confirm('是否提交?', '提示', {
  1575. confirmButtonText: '确定',
  1576. cancelButtonText: '取消',
  1577. type: 'warning'
  1578. })
  1579. .then(() => {
  1580. that.valueUpdate(1)
  1581. })
  1582. .catch(() => {})
  1583. },
  1584. //导出方法
  1585. exportAllExcel() {},
  1586. // 导入方法
  1587. beforeUpload(event, file, fileList) {
  1588. let _this = this
  1589. let formData = new FormData()
  1590. formData.append('file', file.raw)
  1591. _this.loading = true
  1592. this.axios
  1593. .post('/api/v1/rms/readExcel/', formData, {
  1594. headers: { 'Content-Type': 'multipart/form-data' }
  1595. })
  1596. .then((res) => {
  1597. console.log('res.code=======>', res)
  1598. if (res.data.code === '0') {
  1599. this.$message.success('操作成功')
  1600. _this.onclick()
  1601. } else {
  1602. this.$message.error(res.message)
  1603. }
  1604. _this.loading = false
  1605. })
  1606. .catch(() => {
  1607. _this.loading = false
  1608. })
  1609. },
  1610. copy(row) {
  1611. console.log('复制')
  1612. let that = this
  1613. that.dialog.editorBox.type = 'ADD'
  1614. that.dialogVisible = true
  1615. that.dialog.editorBox.activeName = '1'
  1616. if (this.form1.requirementStatus == '待申报') {
  1617. that.tableData = that.cell
  1618. .filter((i) => i.auditNumber == row.auditNumber)
  1619. .map((item, index) => {
  1620. //序号
  1621. item.index = index + 1
  1622. return item
  1623. })
  1624. } else {
  1625. that.tableData = [row].map((item, index) => {
  1626. //序号
  1627. item.index = index + 1
  1628. return item
  1629. })
  1630. }
  1631. let { index, ...temp } = {
  1632. ...row,
  1633. alternateFields8: Number(row.alternateFields8)
  1634. }
  1635. that.form2 = temp
  1636. this.form2.sbddList = []
  1637. if (row.sbdd) {
  1638. row.sbdd.split(',').forEach((item) => {
  1639. this.form2.sbddList.push(toNumber(item))
  1640. })
  1641. }
  1642. let submitBut = {
  1643. type: 'add'
  1644. }
  1645. this.axios
  1646. .post('/api/v1/ams/getSerialNumber', submitBut)
  1647. .then((res) => {
  1648. if (res.data.code == '0') {
  1649. // this.form2.serialNumber = res.data.data.serialNumber
  1650. // this.form2.transRequirementId = res.data.data.transRequirementId
  1651. this.$set(this.form2, 'serialNumber', res.data.data.serialNumber)
  1652. // this.$set(this.form2,"transRequirementId",res.data.data.transRequirementId);
  1653. } else {
  1654. }
  1655. })
  1656. .catch(() => {
  1657. this.isHaveArea = false
  1658. })
  1659. // that.form2.transRequirementId = row.transRequirementId
  1660. // that.form3.shippingCompanyId = row.shippingCompanyId
  1661. // that.form2.transShipmentType = row.transShipmentType
  1662. // that.form2.receivingPointId = row.receivingPointId
  1663. // that.form2.materialId = row.materialId
  1664. // that.form2.businessType = row.businessType
  1665. // that.form2.billingType = row.billingType
  1666. // that.form2.requirementContactPhone = row.requirementContactPhone
  1667. // that.form2.requirementContact = row.requirementContact
  1668. // that.form2.dueTime = row.dueTime
  1669. // that.form2.alternateFields1 = row.rulesId
  1670. // that.form2.shippingPointId = row.shippingPointId
  1671. // ;(that.form2.operationRange = row.transrangeId), //业务区间
  1672. // (that.form2.businessCompanyId = row.businessCompanyId), //用车单位
  1673. // (that.form2.operationsNameId = row.materialTypeId), //业务名称
  1674. // (that.form3.lineId = row.lineId), //作业路径
  1675. // (that.form2.transMode = row.transMode), //运输方式
  1676. // (that.form3.receivingCompanyId = row.receivingCompanyId), //收获单位
  1677. // (that.form2.capacityTypeId = row.capacityTypeId), //运力类型
  1678. // (that.form2.requirementStartTime = row.requirementStartTime), //用车起始时间
  1679. // (that.form2.requirementEndTime = row.requirementEndTime), //用车结束时间
  1680. // (that.form2.materialWeight = row.materialWeight), //物资吨位
  1681. // (that.form3.transTruckNumber = row.transTruckNumber), //承运车数
  1682. // (that.form3.controlRate = row.controlRate), //控制率
  1683. // (that.form3.controlMode = row.controlMode), //控制方式
  1684. // (that.form3.printStampList = row.printStampList), //磅单打印
  1685. // (that.form3.nuclearLoadControl = row.nuclearLoadControl), //核载控制
  1686. // (that.form3.theoryWeight = row.theoryWeight), //理重控制
  1687. // (that.form3.isDomestic = row.isDomestic), //是否内销
  1688. // (that.form3.insertUpdateRemark = row.isDomestic) //
  1689. // (that.form2.alternateFields8 = row.alternateFields8) //新增
  1690. },
  1691. //操作
  1692. operate(row) {
  1693. let that = this
  1694. that.dialogVisible2 = true
  1695. that.dialog.editorBox.activeName2 = '1'
  1696. that.rowData = row
  1697. that.form4.transRequirementId = row.transRequirementId
  1698. that.form4.shippingCompanyId = row.shippingPointName
  1699. that.form4.transShipmentType = row.transShipmentType
  1700. that.form4.receivingPointId = row.receivingPointName
  1701. that.form4.requirementType = row.requirementType
  1702. that.form4.materialId = row.materialName
  1703. that.form4.businessType = row.businessType
  1704. that.form4.billingType = row.billingType
  1705. that.form4.requirementContactPhone = row.requirementContactPhone
  1706. that.form4.requirementContact = row.requirementContact
  1707. that.form4.dueTime = row.dueTime
  1708. that.form4.alternateFields1 = row.rulesCode
  1709. that.form4.shippingPointId = row.shippingPointName
  1710. that.form4.operationRange = row.transrangeName //业务区间
  1711. that.form4.businessCompanyId = row.organization //用车单位
  1712. that.form4.operationsNameId = row.materialTypeName //业务名称
  1713. that.form4.lineId = row.lineName //作业路径
  1714. that.form4.transMode = row.transMode //运输方式
  1715. that.form4.receivingCompanyId = row.receiveCompanyName //收获单位
  1716. that.form4.capacityTypeId = row.capacityTypeName //运力类型
  1717. that.form4.requirementStartTime = row.requirementStartTime //用车起始时间
  1718. that.form4.requirementEndTime = row.requirementEndTime //用车结束时间
  1719. that.form4.materialWeight = row.materialWeight //物资吨位
  1720. that.form4.transTruckNumber = row.transTruckNumber //承运车数
  1721. that.form4.controlRate = row.controlRate //控制率
  1722. that.form4.controlMode = row.controlModeStr //控制方式
  1723. that.form4.printStampList = row.printStampListStr //磅单打印
  1724. that.form4.nuclearLoadControl = row.nuclearLoadControlStr //核载控制
  1725. that.form4.theoryWeight = row.theoryWeight //理重控制
  1726. that.form4.isDomestic = row.isDomestic //是否内销
  1727. that.form4.insertUpdateRemark = row.insertUpdateRemark //
  1728. that.form4.alternateFields2 = row.alternateFields2
  1729. let aa = that.cell.filter((i) => i.auditNumber == row.auditNumber)
  1730. console.log('hat.cell.filter(i=>i.auditNumber==row.auditNumber)====>', aa)
  1731. this.tableData = aa
  1732. if (row.status === '待申报' || row.status === '已撤回') {
  1733. that.buttonType1 = 1
  1734. } else {
  1735. that.buttonType1 = 0
  1736. }
  1737. if (row.status === '已申报' || row.status === '已审批') {
  1738. that.buttonType2 = 1
  1739. } else {
  1740. that.buttonType2 = 0
  1741. }
  1742. console.log('row====>', row)
  1743. },
  1744. func(res) {
  1745. console.log('res====>', res)
  1746. this.loading = false
  1747. this.isKuang = false
  1748. let label = []
  1749. for (let item of res.columnData) {
  1750. label += item.label + ','
  1751. }
  1752. this.dialog.cell = label
  1753. this.cell = res.list
  1754. },
  1755. onclick(val) {
  1756. if (val) {
  1757. this.addFormId = 464
  1758. delete this.form1.alternateFields15
  1759. if (this.form1.insertTimeRange1) {
  1760. this.form1.insertTimeRange = this.form1.insertTimeRange1
  1761. delete this.form1.insertTimeRange1
  1762. }
  1763. }
  1764. console.log('onclick')
  1765. // let {transrangeName,...temp} = this.form1
  1766. this.option.requestQuery = JSON.parse(JSON.stringify(this.form1))
  1767. this.optionNoMerge.requestQuery = JSON.parse(JSON.stringify(this.form1))
  1768. },
  1769. onclickFixed() {
  1770. this.addFormId = 690
  1771. // let {transrangeName,...temp} = this.form1
  1772. this.form1.alternateFields15 = 1
  1773. console.log(this.form1)
  1774. if (this.form1.insertTimeRange) {
  1775. this.form1.insertTimeRange1 = this.form1.insertTimeRange
  1776. delete this.form1.insertTimeRange
  1777. }
  1778. console.log(this.form1)
  1779. this.option.requestQuery = JSON.parse(JSON.stringify(this.form1))
  1780. },
  1781. logicDelete() {
  1782. if (this.idcount.length == 0) {
  1783. this.$message({
  1784. type: 'warning',
  1785. message: '请选择要删除的数据!'
  1786. })
  1787. return
  1788. }
  1789. this.$confirm(
  1790. '是否删除(系统自动过滤无法删除的需求-仅待申报能删除)',
  1791. '提示',
  1792. {
  1793. confirmButtonText: '确定',
  1794. cancelButtonText: '取消',
  1795. type: 'warning',
  1796. center: true
  1797. }
  1798. )
  1799. .then(() => {
  1800. let that = this
  1801. let idcount2 = []
  1802. let idcount3 = []
  1803. for (let item of that.idcount) {
  1804. idcount2 += item.transRequirementId + ','
  1805. console.log('idcount2====>', idcount2)
  1806. }
  1807. let SubmitData = {
  1808. transRequirementId: idcount2
  1809. }
  1810. that.axios
  1811. .post('/api/v1/ams/getProductiveRequirementDelete/', SubmitData)
  1812. .then((res) => {
  1813. if (res.data.code == '0') {
  1814. that.$message.success('删除成功')
  1815. that.dialogVisible = false
  1816. that.isHaveArea = false
  1817. that.onclick()
  1818. } else {
  1819. that.$message.error('删除失败')
  1820. that.isHaveArea = false
  1821. that.dialogVisible = false
  1822. }
  1823. })
  1824. .catch(() => {
  1825. that.$message.error('删除失败')
  1826. that.isHaveArea = false
  1827. })
  1828. })
  1829. .catch(() => {
  1830. this.$message.info('用户取消操作')
  1831. })
  1832. },
  1833. exportAllExcel() {
  1834. var today = new Date()
  1835. var year = today.getFullYear() //获取年份
  1836. var month = today.getMonth() + 1 //获取月份
  1837. var day = today.getDate() //获取日期
  1838. this.tableTitle = year + '-' + month + '-' + day + '实时库存'
  1839. this.loading = true
  1840. this.isKuang = true
  1841. let deleted = 0
  1842. let submitBut = {
  1843. deleted: deleted
  1844. }
  1845. if (this.input) {
  1846. this.axios
  1847. .post(
  1848. '/api/v1/wms/wmsgridmaterialsList?apiId=544&deleted=0&i=' +
  1849. this.input +
  1850. '&i=' +
  1851. new Date(),
  1852. submitBut
  1853. )
  1854. .then((res) => {
  1855. console.log(res.data.data)
  1856. this.exportAllList = res.data.data.list
  1857. this.noSettleDetailsColumn = res.data.data.columnData
  1858. this.exportAllReportToExcel(
  1859. this.tableTitle,
  1860. this.exportAllList,
  1861. this.noSettleDetailsColumn
  1862. )
  1863. })
  1864. } else {
  1865. this.axios
  1866. .post(
  1867. '/api/v1/wms/wmsgridmaterialsList?apiId=544&i=' + new Date(),
  1868. submitBut
  1869. )
  1870. .then((res) => {
  1871. console.log(res.data.data)
  1872. this.exportAllList = res.data.data.list
  1873. this.noSettleDetailsColumn = res.data.data.columnData
  1874. this.exportAllReportToExcel(
  1875. this.tableTitle,
  1876. this.exportAllList,
  1877. this.noSettleDetailsColumn
  1878. )
  1879. })
  1880. }
  1881. this.loading = false
  1882. },
  1883. //导出excel
  1884. exportAllReportToExcel(tableTitle, dataArr, columnData) {
  1885. var title = tableTitle
  1886. let tHeader = []
  1887. let filterVal = []
  1888. columnData.forEach((e1) => {
  1889. if (tHeader.indexOf(e1.label) === -1) {
  1890. tHeader.push(e1.label)
  1891. }
  1892. if (filterVal.indexOf(e1.prop) === -1) {
  1893. filterVal.push(e1.prop)
  1894. }
  1895. })
  1896. //导出为excel
  1897. this.downloadLoading = true
  1898. require.ensure([], () => {
  1899. const {
  1900. export_json_to_excel
  1901. } = require('@/assets/excel/Export2Excel.js') //这里必须使用绝对路径,使用@/+存放export2Excel的路径
  1902. // let list = this.$refs.excelDom.dataTabel;
  1903. let data = dataArr.map((v) => filterVal.map((j) => v[j])) //3.formatJson格式转换
  1904. export_json_to_excel(tHeader, data, title) // (title)导出的表格名称
  1905. })
  1906. },
  1907. //修改
  1908. updatePriceMaterial(row) {
  1909. let that = this
  1910. that.dialog.editorBox.activeName = '1'
  1911. that.dialog.editorBox.type = 'PUT'
  1912. that.dialogVisible = true
  1913. row.key = 1
  1914. if (
  1915. row.status === '已申报' ||
  1916. row.status === '已审批' ||
  1917. row.status === '已制订计划'
  1918. ) {
  1919. that.$message.error('该需求已申报或审批,无法修改!')
  1920. that.buttonType = 0
  1921. } else {
  1922. that.buttonType = 1
  1923. }
  1924. this.tableData = that.cell
  1925. .filter((i) => i.auditNumber == row.auditNumber)
  1926. .map((item, index) => {
  1927. if (item.isDomestic == '是') {
  1928. item.isDomestic = '1'
  1929. } else {
  1930. item.isDomestic = '0'
  1931. }
  1932. item.index = index + 1
  1933. return item
  1934. })
  1935. console.log('tableData====>', this.tableData)
  1936. that.updateIds = that.cell
  1937. .filter((i) => i.auditNumber == row.auditNumber)
  1938. .map((item) => item.transRequirementId + '')
  1939. let { index, ...temp } = {
  1940. ...row,
  1941. alternateFields8: Number(row.alternateFields8)
  1942. }
  1943. that.form2 = temp
  1944. this.form2.sbddList = []
  1945. if (row.sbdd) {
  1946. row.sbdd.split(',').forEach((item) => {
  1947. this.form2.sbddList.push(toNumber(item))
  1948. })
  1949. }
  1950. },
  1951. withdraw(row) {
  1952. this.$prompt('请输入撤回理由', '提示', {
  1953. cancelButtonText: '取消',
  1954. confirmButtonText: '确定'
  1955. }).then((value) => {
  1956. if (value.value) {
  1957. row.reason = value.value
  1958. this.axios
  1959. .post('/api/v1/ams/withdrawRequirement', row)
  1960. .then((res) => {
  1961. if (res.data.status == 'succeed') {
  1962. this.$message({
  1963. type: 'success',
  1964. message: '操作成功'
  1965. })
  1966. this.onclick()
  1967. } else {
  1968. this.$message({
  1969. type: 'error',
  1970. message: res.data.data
  1971. })
  1972. }
  1973. })
  1974. } else {
  1975. this.$message({
  1976. type: 'error',
  1977. message: '请输入撤回理由'
  1978. })
  1979. }
  1980. })
  1981. },
  1982. //状态修改
  1983. valueUpdate(sum) {
  1984. let that = this
  1985. if (sum == 1) {
  1986. let SubmitData = {
  1987. transRequirementId: that.form4.transRequirementId,
  1988. alternateFields2: that.form4.alternateFields2,
  1989. approve: 'ok',
  1990. deleted: 1
  1991. // ...that.rowData
  1992. }
  1993. let map = {
  1994. approve: 'ok',
  1995. mapList: that.cell.filter(
  1996. (i) => i.auditNumber == that.rowData.auditNumber
  1997. )
  1998. }
  1999. console.log(map)
  2000. that.axios
  2001. .post('/api/v1/ams/productionRequirementChangeList', map)
  2002. .then((res) => {
  2003. if (res.data.code == '0') {
  2004. that.$message.success('提交成功')
  2005. that.dialogVisible2 = false
  2006. that.isHaveArea = false
  2007. that.onclick()
  2008. } else {
  2009. that.$message.error('提交失败')
  2010. that.isHaveArea = false
  2011. that.dialogVisible2 = false
  2012. }
  2013. })
  2014. .catch(() => {
  2015. that.$message.error('提交失败')
  2016. that.isHaveArea = false
  2017. })
  2018. } else {
  2019. let SubmitData2 = {
  2020. transRequirementId: that.form4.transRequirementId,
  2021. alternateFields2: that.form4.alternateFields2,
  2022. withdraw: 'no'
  2023. }
  2024. that.axios
  2025. .post('/api/v1/ams/productionRequirementChange/', SubmitData2)
  2026. .then((res) => {
  2027. if (res.data.code == '0') {
  2028. that.$message.success('撤回成功')
  2029. that.dialogVisible2 = false
  2030. that.isHaveArea = false
  2031. that.onclick()
  2032. } else {
  2033. that.$message.error('撤回失败')
  2034. that.isHaveArea = false
  2035. that.dialogVisible2 = false
  2036. }
  2037. })
  2038. .catch(() => {
  2039. that.$message.error('撤回失败')
  2040. that.isHaveArea = false
  2041. })
  2042. }
  2043. },
  2044. dataSave() {
  2045. let that = this
  2046. let obj = {
  2047. businessCompanyId: that.form2.businessCompanyId,
  2048. businessType: that.form2.businessType,
  2049. requirementStartTime: that.form2.requirementStartTime,
  2050. requirementEndTime: that.form2.requirementEndTime,
  2051. requirementType: that.form2.requirementType,
  2052. dueTime: that.form2.dueTime,
  2053. requirementContact: that.form2.requirementContact,
  2054. requirementContactPhone: that.form2.requirementContactPhone,
  2055. controlMode: that.form2.controlMode,
  2056. controlRate: that.form2.controlRate,
  2057. alternateFields8: that.form2.alternateFields8,
  2058. serialNumber: that.form2.serialNumber,
  2059. insertUpdateRemark: that.form2.insertUpdateRemark
  2060. }
  2061. this.tableData = this.tableData.map((i) => {
  2062. return {
  2063. ...i,
  2064. ...obj
  2065. }
  2066. })
  2067. let SubmitData = {
  2068. ...that.form2,
  2069. tableData: that.tableData,
  2070. updateIds: that.updateIds
  2071. }
  2072. if (that.dialog.editorBox.type === 'ADD') {
  2073. that.axios
  2074. .post('/api/v1/ams/productionRequirementAdd', SubmitData)
  2075. .then((res) => {
  2076. if (res.data.code == '0') {
  2077. that.dialogVisible = false
  2078. that.isHaveArea = false
  2079. that.$message({
  2080. type: 'success',
  2081. message: res.data.message,
  2082. duration: 2000
  2083. })
  2084. // that.$refs.form2.resetFields();
  2085. console.log('that.$refs.form2=========>', that.$refs.form2)
  2086. that.onclick()
  2087. } else {
  2088. that.$message({
  2089. type: 'error',
  2090. message: res.data.message,
  2091. duration: 2000
  2092. })
  2093. // that.isHaveArea = false
  2094. // that.dialogVisible = false
  2095. }
  2096. })
  2097. .catch((err) => {
  2098. that.$message({
  2099. type: 'error',
  2100. message: err,
  2101. duration: 2000
  2102. })
  2103. that.isHaveArea = false
  2104. })
  2105. } else {
  2106. that.axios
  2107. .post('/api/v1/ams/productionRequirementBatchUpdate', SubmitData)
  2108. .then((res) => {
  2109. if (res.data.code == '0') {
  2110. that.$message.success('修改成功')
  2111. that.dialogVisible = false
  2112. that.isHaveArea = false
  2113. that.onclick()
  2114. } else {
  2115. that.$message.error(res.data.message)
  2116. that.isHaveArea = false
  2117. // that.dialogVisible = false
  2118. }
  2119. })
  2120. }
  2121. },
  2122. //文件预览
  2123. preview() {
  2124. let that = this
  2125. let parmas = {
  2126. filename: '应急操作手册.docx',
  2127. filepath: '/应急预案/应急操作手册.docx'
  2128. }
  2129. let url = '/api/v1/systemfiles/previewfile/'
  2130. let type = 'text/html'
  2131. let responseType = 'application/json'
  2132. let fileExtension = '应急操作手册.docx'
  2133. that.axios.post(url, parmas).then(function (res) {
  2134. if (res.data.code === '0') {
  2135. let urlObject = window.URL || window.webkitURL || window
  2136. // 将二进制流转为blob
  2137. let blob = new Blob([res], { type: type })
  2138. if (fileExtension !== 'pdf') {
  2139. blob = new Blob([res.data.data], { type: type })
  2140. }
  2141. // if (typeof window.navigator.msSaveBlob !== 'undefined') {
  2142. // // 兼容IE,window.navigator.msSaveBlob:以本地方式保存文件
  2143. // window.navigator.msSaveBlob(blob, decodeURI(fileName))
  2144. // } else {
  2145. // 创建新的URL并指向File对象或者Blob对象的地址
  2146. let blobURL = urlObject.createObjectURL(blob)
  2147. that.dialogVisible3 = true
  2148. that.previewUrl = blobURL
  2149. that.loading = false
  2150. setTimeout(() => {
  2151. urlObject.revokeObjectURL(blobURL)
  2152. }, 1000)
  2153. } else {
  2154. that.$message.error('预览失败')
  2155. that.loading = false
  2156. }
  2157. })
  2158. },
  2159. btnclick() {
  2160. this.dialog.editorBox.type = 'ADD'
  2161. console.log('reff=========', this.form1)
  2162. this.dialog.editorBox.activeName = '1'
  2163. this.dialogVisible = true
  2164. this.buttonType = 1
  2165. let submitBut = {
  2166. type: 'add'
  2167. }
  2168. this.axios
  2169. .post('/api/v1/ams/getSerialNumber', submitBut)
  2170. .then((res) => {
  2171. if (res.data.code == '0') {
  2172. // this.form2.serialNumber = res.data.data.serialNumber
  2173. // this.form2.transRequirementId = res.data.data.transRequirementId
  2174. this.$set(this.form2, 'serialNumber', res.data.data.serialNumber)
  2175. // this.$set(this.form2,"transRequirementId",res.data.data.transRequirementId);
  2176. } else {
  2177. }
  2178. })
  2179. .catch(() => {
  2180. this.isHaveArea = false
  2181. })
  2182. },
  2183. qjnyClick() {
  2184. console.log('this.idcount', this.idcount)
  2185. if (this.idcount.length > 1) {
  2186. this.$message.error('只允许勾选一条数据上传!')
  2187. }
  2188. console.log(this.idcount[0], 'this.idcount.length[0]')
  2189. this.$confirm('此操作不可撤销, 是否继续?', '提示', {
  2190. confirmButtonText: '确定',
  2191. cancelButtonText: '取消',
  2192. type: 'warning'
  2193. })
  2194. .then(() => {
  2195. this.axios
  2196. .post('/api/v1/ams/qjnyChange', this.idcount[0])
  2197. .then((res) => {
  2198. if (res.data.status == 'succeed') {
  2199. this.$message({
  2200. type: 'success',
  2201. message: '操作成功!'
  2202. })
  2203. this.visible = false
  2204. this.onclick()
  2205. } else {
  2206. this.$message.error(res.data.message)
  2207. }
  2208. })
  2209. })
  2210. .catch(() => {
  2211. this.$message({
  2212. type: 'info',
  2213. message: '已取消'
  2214. })
  2215. })
  2216. }
  2217. }
  2218. }
  2219. </script>
  2220. <style lang="scss" scoped>
  2221. td .el-button--mini {
  2222. padding: 4px 16px;
  2223. }
  2224. // .el-input--mini {
  2225. // width: 88%;
  2226. // }
  2227. // .el-form-item__label {
  2228. // width: 30%;
  2229. // }
  2230. .transRequirementClass {
  2231. .top {
  2232. margin-left: 5px;
  2233. margin-top: 5px;
  2234. // height: 100%;
  2235. }
  2236. .elDivider {
  2237. height: 100%;
  2238. }
  2239. .buttonModel {
  2240. margin-top: 5px;
  2241. display: flex;
  2242. justify-content: space-between;
  2243. align-items: center;
  2244. .operation {
  2245. margin-left: 10px;
  2246. }
  2247. .search {
  2248. margin-right: 10px;
  2249. }
  2250. height: 100%;
  2251. }
  2252. .main {
  2253. margin-left: 5px;
  2254. margin-top: 5px;
  2255. }
  2256. }
  2257. </style>