index1.vue 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333
  1. <template>
  2. <div class="app-container">
  3. <div v-show="mainTabel == false">
  4. <el-form label-width="88px" ref="form" :model="form">
  5. <el-row>
  6. <el-col :span="6">
  7. <el-form-item label="代码" prop="fNumber">
  8. <el-input size="small" style="width:200px" v-model="form.fNumber"></el-input>
  9. </el-form-item>
  10. </el-col>
  11. <el-col :span="6">
  12. <el-form-item label="中文名" prop="fName">
  13. <el-input size="small" style="width:200px" v-model="form.fName"></el-input>
  14. </el-form-item>
  15. </el-col>
  16. <el-col :span="6">
  17. <el-form-item label="客户名称" prop="fCorpid">
  18. <el-select size="small" style="width:200px" v-model="form.fCorpid" clearable>
  19. <el-option
  20. v-for="item in fMblnoOptions"
  21. :key="item.fId"
  22. :label="item.fName"
  23. :value="item.fId"/>
  24. </el-select>
  25. </el-form-item>
  26. </el-col>
  27. <el-col :span="6">
  28. <el-form-item label="责任人" prop="fPerson">
  29. <el-select size="small" style="width:200px" v-model="form.fPerson" clearable>
  30. <el-option
  31. v-for="item in liableOption"
  32. :key="item.userId"
  33. :label="item.userName"
  34. :value="item.userId"/>
  35. </el-select>
  36. </el-form-item>
  37. </el-col>
  38. </el-row>
  39. <el-collapse-transition>
  40. <div v-show="show">
  41. <el-row>
  42. <el-col :span="6">
  43. <el-form-item label="电话" prop="fTel">
  44. <el-input size="small" style="width:200px" v-model="form.fTel"></el-input>
  45. </el-form-item>
  46. </el-col>
  47. <el-col :span="6">
  48. <el-form-item label="项目地址" prop="fAddress">
  49. <el-input size="small" style="width:200px" v-model="form.fAddress"></el-input>
  50. </el-form-item>
  51. </el-col>
  52. <el-col :span="6">
  53. <el-form-item label="备注" prop="remark">
  54. <el-input size="small" type="textarea" style="width:200px" v-model="form.remark"></el-input>
  55. </el-form-item>
  56. </el-col>
  57. </el-row>
  58. </div>
  59. </el-collapse-transition>
  60. </el-form>
  61. <el-row :gutter="10" class="mb8">
  62. <el-col :span="1.5">
  63. <el-button
  64. type="primary"
  65. icon="el-icon-plus"
  66. size="mini"
  67. @click="handleAdd"
  68. v-hasPermi="['warehouse:project:add']"
  69. >新增
  70. </el-button>
  71. </el-col>
  72. <el-col :span="1.5">
  73. <el-button
  74. type="success"
  75. icon="el-icon-edit"
  76. size="mini"
  77. :disabled="single"
  78. @click="handleUpdate('',3)"
  79. v-hasPermi="['warehouse:project:add']"
  80. >修改
  81. </el-button>
  82. </el-col>
  83. <el-col :span="1.5">
  84. <el-button
  85. type="warning"
  86. icon="el-icon-download"
  87. size="mini"
  88. @click="handleExport"
  89. v-hasPermi="['warehouse:project:export']"
  90. >导出
  91. </el-button>
  92. </el-col>
  93. <div class="tabSetting">
  94. <div style="margin-right: 20px">
  95. <el-button
  96. type="cyan"
  97. icon="el-icon-search"
  98. size="mini"
  99. @click="handleQuery"
  100. >搜索
  101. </el-button
  102. >
  103. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  104. >重置
  105. </el-button
  106. >
  107. <el-button
  108. v-show="show"
  109. @click="show = !show"
  110. icon="el-icon-arrow-up"
  111. size="mini"
  112. >展开
  113. </el-button
  114. >
  115. <el-button
  116. v-show="!show"
  117. @click="show = !show"
  118. icon="el-icon-arrow-down"
  119. size="mini"
  120. >展开
  121. </el-button
  122. >
  123. </div>
  124. <right-toolbar
  125. :showSearch.sync="showSearch"
  126. @queryTable="getList"
  127. ></right-toolbar>
  128. <div style="margin: 0 12px">
  129. <el-button
  130. icon="el-icon-setting"
  131. size="mini"
  132. circle
  133. @click="showSetting = !showSetting"
  134. ></el-button>
  135. </div>
  136. </div>
  137. </el-row>
  138. <el-dialog
  139. title="自定义列显示"
  140. :visible.sync="showSetting"
  141. width="700px"
  142. v-dialogDrag
  143. >
  144. <template slot="title">
  145. <div class="avue-crud__dialog__header">
  146. <span class="el-dialog__title">
  147. <span
  148. style="
  149. display: inline-block;
  150. width: 3px;
  151. height: 20px;
  152. margin-right: 5px;
  153. float: left;
  154. margin-top: 2px;
  155. "
  156. ></span>
  157. </span>
  158. </div>
  159. </template>
  160. <div>配置排序列数据(拖动调整顺序)</div>
  161. <div style="margin-left: 17px">
  162. <el-checkbox
  163. v-model="allCheck"
  164. label="全选"
  165. @change="allChecked"
  166. ></el-checkbox>
  167. </div>
  168. <div style="padding: 4px; display: flex; justify-content: center">
  169. <draggable
  170. v-model="setRowList"
  171. group="site"
  172. animation="300"
  173. @start="onStart"
  174. @end="onEnd"
  175. handle=".indraggable"
  176. >
  177. <transition-group>
  178. <div
  179. v-for="item in setRowList"
  180. :key="item.surface"
  181. class="listStyle"
  182. >
  183. <div style="width: 500px" class="indraggable">
  184. <div class="progress" :style="{ width: item.width + 'px' }">
  185. <el-checkbox
  186. :label="item.name"
  187. v-model="item.checked"
  188. :true-label="0"
  189. :false-label="1"
  190. >{{ item.name }}
  191. </el-checkbox>
  192. </div>
  193. </div>
  194. <el-input-number
  195. v-model.number="item.width"
  196. controls-position="right"
  197. :min="1"
  198. :max="500"
  199. size="mini"
  200. ></el-input-number>
  201. </div>
  202. </transition-group>
  203. </draggable>
  204. </div>
  205. <span slot="footer" class="dialog-footer">
  206. <el-button @click="showSetting = false">取 消</el-button>
  207. <el-button @click="delRow()" type="danger">重 置</el-button>
  208. <el-button type="primary" @click="save()">确 定</el-button>
  209. </span>
  210. </el-dialog>
  211. <el-table v-loading="loading" :data="projectList" @selection-change="handleSelectionChange">
  212. <el-table-column type="selection" width="55" align="center"/>
  213. <el-table-column label="序号" type="index" align="center"/>
  214. <el-table-column
  215. v-for="(item, index) in getRowList"
  216. :key="index"
  217. :label="item.name"
  218. :width="item.width"
  219. :prop="item.label"
  220. align="center"
  221. sortable
  222. :fixed="item.fixed"
  223. >
  224. <template slot-scope="scope">
  225. <span v-if="item.label == 'createTime'">{{scope.row.createTime?scope.row.createTime.slice(0,10):scope.row.createTime}}</span>
  226. <span v-else-if="item.label == 'updateTime'">{{scope.row.updateTime?scope.row.updateTime.slice(0,10):scope.row.updateTime}}</span>
  227. <span v-else>{{scope.row[item.label]}}</span>
  228. </template>
  229. </el-table-column>
  230. <el-table-column
  231. label="操作"
  232. align="center"
  233. class-name="small-padding fixed-width"
  234. min-width="180"
  235. fixed="right"
  236. >
  237. <template slot-scope="scope">
  238. <el-button
  239. size="mini"
  240. type="text"
  241. icon="el-icon-view"
  242. @click="handleUpdate(scope.row, 0)"
  243. v-hasPermi="['warehouse:project:query']"
  244. >查看
  245. </el-button
  246. >
  247. <!-- <el-button-->
  248. <!-- size="mini"-->
  249. <!-- type="text"-->
  250. <!-- icon="el-icon-view"-->
  251. <!-- @click="handleUpdate(scope.row, 1)"-->
  252. <!-- v-hasPermi="['finance:invoiceApplyFor:query']"-->
  253. <!-- v-if="-->
  254. <!-- scope.row.fBillstatusName == '提交审核' ||-->
  255. <!-- scope.row.fBillstatusName == '审核中'-->
  256. <!-- "-->
  257. <!-- >审批进度-->
  258. <!-- </el-button-->
  259. <!-- >-->
  260. <!-- <el-button-->
  261. <!-- size="mini"-->
  262. <!-- type="text"-->
  263. <!-- icon="el-icon-edit"-->
  264. <!-- @click="handleUpdate(scope.row,2)"-->
  265. <!-- v-hasPermi="['finance:invoiceApplyFor:query']"-->
  266. <!-- v-if="-->
  267. <!-- scope.row.fBillstatusName == '保存' ||-->
  268. <!-- scope.row.fBillstatusName == '暂存' ||-->
  269. <!-- scope.row.fBillstatusName == '审批驳回'-->
  270. <!-- "-->
  271. <!-- >修改-->
  272. <!-- </el-button>-->
  273. <el-button
  274. size="mini"
  275. type="text"
  276. icon="el-icon-delete"
  277. @click="handleDelete(scope.row)"
  278. v-hasPermi="['warehouse:project:remove']"
  279. v-if="
  280. scope.row.fBillstatusName == '保存' ||
  281. scope.row.fBillstatusName == '暂存' ||
  282. scope.row.fBillstatusName == '审批驳回'
  283. "
  284. >删除
  285. </el-button>
  286. </template>
  287. </el-table-column>
  288. </el-table>
  289. <pagination
  290. v-show="total > 0"
  291. :total="total"
  292. :page.sync="form.pageNum"
  293. :limit.sync="form.pageSize"
  294. @pagination="getList"
  295. />
  296. </div>
  297. <div v-if="mainTabel == true">
  298. <el-form label-width="88px" ref="detailform" :model="detailform" :rules="rules">
  299. <el-row>
  300. <el-col :span="6">
  301. <el-form-item label="代码" prop="fNumber">
  302. <el-input size="small" :disabled="doNot" style="width:200px" v-model="detailform.fNumber"></el-input>
  303. </el-form-item>
  304. </el-col>
  305. <el-col :span="6">
  306. <el-form-item label="中文名" prop="fName">
  307. <el-input size="small" :disabled="doNot" style="width:200px" v-model="detailform.fName"></el-input>
  308. </el-form-item>
  309. </el-col>
  310. <el-col :span="6">
  311. <el-form-item label="收款单位" prop="fCorpid">
  312. <el-select size="small" :disabled="doNot" style="width:200px" v-model="detailform.fCorpid">
  313. <el-option
  314. v-for="item in fMblnoOptions"
  315. :key="item.fId"
  316. :label="item.fName"
  317. :value="item.fId"/>
  318. </el-select>
  319. </el-form-item>
  320. </el-col>
  321. <el-col :span="6">
  322. <el-form-item label="责任人" prop="fPerson">
  323. <el-select size="small" :disabled="doNot" style="width:200px" v-model="detailform.fPerson">
  324. <el-option
  325. v-for="item in liableOption"
  326. :key="item.userId"
  327. :label="item.userName"
  328. :value="item.userId"/>
  329. </el-select>
  330. </el-form-item>
  331. </el-col>
  332. </el-row>
  333. <el-row>
  334. <el-col :span="6">
  335. <el-form-item label="项目地址" prop="fAddress">
  336. <el-input size="small" :disabled="doNot" style="width:200px" v-model="detailform.fAddress"></el-input>
  337. </el-form-item>
  338. </el-col>
  339. <el-col :span="6">
  340. <el-form-item label="电话" prop="fTel">
  341. <el-input size="small" :disabled="doNot" style="width:200px" v-model="detailform.fTel"></el-input>
  342. </el-form-item>
  343. </el-col>
  344. <el-col :span="12">
  345. <el-form-item label="备注" prop="remark">
  346. <el-input size="small" :disabled="doNot" type="textarea" v-model="detailform.remark"></el-input>
  347. </el-form-item>
  348. </el-col>
  349. </el-row>
  350. </el-form>
  351. <el-row :gutter="10" class="mb8">
  352. <el-col :span="1.5">
  353. <el-button v-if="cancelButton === true" size="mini" type="danger" icon="el-icon-refresh-left" @click="goBack">返回列表</el-button>
  354. </el-col>
  355. <el-col :span="1.5">
  356. <el-button v-if="cancelButton === false" size="mini" icon="el-icon-refresh-left" type="danger" @click="cancelTwo">返回首页</el-button>
  357. </el-col>
  358. <el-col :span="1.5">
  359. <el-button size="mini" :disabled="doNot" icon="el-icon-plus" type="primary" @click="addList">录入</el-button>
  360. </el-col>
  361. <el-col :span="1.5">
  362. <el-button size="mini" :disabled="doNotchange" icon="el-icon-edit" type="info" @click="doNot = false">修改</el-button>
  363. </el-col>
  364. <el-col :span="1.5">
  365. <el-button size="mini" icon="el-icon-download" type="warning">导出</el-button>
  366. </el-col>
  367. <el-col :span="1.5">
  368. <el-button size="mini" :disabled="doNot" icon="el-icon-check" type="success" @click="submit">保存</el-button>
  369. </el-col>
  370. <el-col :span="1.5">
  371. <el-button size="mini" :disabled="doNot" type="primary" @click="approval">请核</el-button>
  372. </el-col>
  373. <el-col :span="1.5">
  374. <el-button size="mini" v-if="approvedBy" type="primary" @click="addOrUpdateHand">审批</el-button>
  375. </el-col>
  376. <el-col :span="1.5">
  377. <el-button size="mini" v-if="detailform.fBillstatus >= 4" type="primary" @click="addOrUpdateHandle">查看审批</el-button>
  378. </el-col>
  379. <el-col :span="1.5">
  380. <el-button size="mini" v-if="detailform.fBillstatus == 4 && this.lander == this.operator" type="danger" @click="backApproval(1)">撤销审批</el-button>
  381. </el-col>
  382. <el-col :span="1.5">
  383. <el-button size="mini" v-if="detailform.fBillstatus == 6 && this.lander == this.before" type="warning" @click="backApproval(2)">撤销项目管理</el-button>
  384. </el-col>
  385. <div style="margin: 0 12px;float: right">
  386. <el-button
  387. icon="el-icon-setting"
  388. size="mini"t
  389. circle
  390. @click="showSetting = !showSetting"
  391. ></el-button>
  392. </div>
  393. </el-row>
  394. <el-dialog
  395. title="自定义列显示"
  396. :visible.sync="showSetting"
  397. width="700px"
  398. v-dialogDrag
  399. >
  400. <template slot="title">
  401. <div class="avue-crud__dialog__header">
  402. <span class="el-dialog__title">
  403. <span
  404. style="
  405. display: inline-block;
  406. width: 3px;
  407. height: 20px;
  408. margin-right: 5px;
  409. float: left;
  410. margin-top: 2px;
  411. "
  412. ></span>
  413. </span>
  414. </div>
  415. </template>
  416. <div>配置排序列数据(拖动调整顺序)</div>
  417. <div style="margin-left: 17px">
  418. <el-checkbox
  419. v-model="allCheck2"
  420. label="全选"
  421. @change="allChecked"
  422. ></el-checkbox>
  423. </div>
  424. <div style="padding: 4px; display: flex; justify-content: center">
  425. <draggable
  426. v-model="setRowList2"
  427. group="site"
  428. animation="300"
  429. @start="onStart"
  430. @end="onEnd"
  431. handle=".indraggable"
  432. >
  433. <transition-group>
  434. <div
  435. v-for="item in setRowList2"
  436. :key="item.surface"
  437. class="listStyle"
  438. >
  439. <div style="width: 500px" class="indraggable">
  440. <div class="progress" :style="{ width: item.width + 'px' }">
  441. <el-checkbox
  442. :label="item.name"
  443. v-model="item.checked"
  444. :true-label="0"
  445. :false-label="1"
  446. >{{ item.name }}
  447. </el-checkbox>
  448. </div>
  449. </div>
  450. <el-input-number
  451. v-model.number="item.width"
  452. controls-position="right"
  453. :min="1"
  454. :max="500"
  455. size="mini"
  456. ></el-input-number>
  457. </div>
  458. </transition-group>
  459. </draggable>
  460. </div>
  461. <span slot="footer" class="dialog-footer">
  462. <el-button @click="showSetting = false">取 消</el-button>
  463. <el-button @click="delRow2()" type="danger">重 置</el-button>
  464. <el-button type="primary" @click="save2()">确 定</el-button>
  465. </span>
  466. </el-dialog>
  467. <el-table v-loading="loading" :data="detailList" @selection-change="handleSelectionChange_s">
  468. <el-table-column type="selection" width="55" align="center"/>
  469. <el-table-column label="序号" type="index" align="center"/>
  470. <el-table-column
  471. v-for="(item, index) in getRowList2"
  472. :key="index"
  473. :label="item.name"
  474. :width="item.width"
  475. :prop="item.label"
  476. align="center"
  477. sortable
  478. :fixed="item.fixed"
  479. >
  480. <template slot-scope="scope">
  481. <el-select v-if="item.label == 'fMaterial'" @change="change" :disabled="doNot" v-model="scope.row.fMaterial" placehoder="111请输入">
  482. <el-option
  483. v-for="item in materialOption"
  484. :key="item.fId"
  485. :label="item.fName"
  486. :value="item.fId"
  487. />
  488. </el-select>
  489. <el-select v-else-if="item.label == 'fMeasure'" :disabled="doNot" v-model="scope.row.fMeasure" placehoder="222请选择">
  490. <el-option
  491. v-for="item in unitOptions"
  492. :key="item.dictValue"
  493. :label="item.dictLabel"
  494. :value="item.dictValue"
  495. />
  496. </el-select>
  497. <el-select v-else-if="item.label == 'fStatus'" :disabled="doNot" v-model="scope.row.fStatus" placehoder="222请选择">
  498. <el-option label="正常" value='0'/>
  499. <el-option label="停用" value='1'/>
  500. </el-select>
  501. <el-input v-else-if="item.label == 'fStudentsWeight'" :disabled="doNot" v-model="scope.row.fStudentsWeight" oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  502. ></el-input>
  503. <el-input v-else-if="item.label == 'fTeachersWeight'" :disabled="doNot" v-model="scope.row.fTeachersWeight" oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  504. ></el-input>
  505. <el-input v-else-if="item.label == 'fCurrencyName'" disabled v-model="scope.row.fCurrencyName"></el-input>
  506. <el-input v-else v-model="scope.row[item.label]" :disabled="doNot" placehoder="请输入"></el-input>
  507. </template>
  508. </el-table-column>
  509. <el-table-column
  510. label="操作"
  511. align="center"
  512. class-name="small-padding fixed-width"
  513. min-width="180"
  514. fixed="right"
  515. >
  516. <template slot-scope="scope">
  517. <el-button
  518. size="mini"
  519. type="text"
  520. :disabled="doNot"
  521. icon="el-icon-delete"
  522. @click="deleteRow(scope.$index,detailList)"
  523. v-hasPermi="['financial:invoiceApplyFor:remove']"
  524. >删除
  525. </el-button>
  526. </template>
  527. </el-table-column>
  528. </el-table>
  529. <div>
  530. </div>
  531. </div>
  532. <add-or-update
  533. v-if="addOrUpdateVisible"
  534. ref="addOrUpdate"
  535. @refreshDataList="getDataList"
  536. ></add-or-update>
  537. <approval-comments
  538. v-if="addOrUpdateVisib"
  539. ref="ApprovalComments"
  540. @refreshDataList="returnData"
  541. ></approval-comments>
  542. </div>
  543. </template>
  544. <script>
  545. import Vue from 'vue'
  546. import draggable from "vuedraggable";
  547. import { addChange, getChange, listCharge, getCorps, getliable, listmaterial, delProject, addproject} from '@/api/project'
  548. import Cookies from 'js-cookie'
  549. import { addSet, resetModule, select } from '@/api/system/set'
  550. import { getName, queryUserVal, revoke, revokeBill } from '@/api/purchaseIssue'
  551. Vue.directive('dialogDrag', {
  552. bind(el, binding, vnode, oldVnode) {
  553. const dialogHeaderEl = el.querySelector('.el-dialog__header')
  554. const dragDom = el.querySelector('.el-dialog')
  555. const enlarge = el.querySelector('.enlarge')
  556. dialogHeaderEl.style.cursor = 'move'
  557. // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
  558. const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null)
  559. if (enlarge) {
  560. enlarge.onclick = (e) => {
  561. dragDom.style.top = '0px'
  562. dragDom.style.left = '0px'
  563. }
  564. }
  565. dialogHeaderEl.onmousedown = (e) => {
  566. // 鼠标按下,计算当前元素距离可视区的距离
  567. const disX = e.clientX - dialogHeaderEl.offsetLeft
  568. const disY = e.clientY - dialogHeaderEl.offsetTop
  569. // 获取到的值带px 正则匹配替换
  570. let styL, styT
  571. // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
  572. if (sty.left.includes('%')) {
  573. styL =
  574. +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100)
  575. styT =
  576. +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100)
  577. } else {
  578. styL = +sty.left.replace(/\px/g, '')
  579. styT = +sty.top.replace(/\px/g, '')
  580. }
  581. document.onmousemove = function(e) {
  582. // 通过事件委托,计算移动的距离
  583. const l = e.clientX - disX
  584. const t = e.clientY - disY
  585. // 移动当前元素
  586. if (t + styT >= 0) {
  587. dragDom.style.top = `${t + styT}px`
  588. }
  589. dragDom.style.left = `${l + styL}px`
  590. // 将此时的位置传出去
  591. // binding.value({x:e.pageX,y:e.pageY})
  592. }
  593. document.onmouseup = function(e) {
  594. document.onmousemove = null
  595. document.onmouseup = null
  596. }
  597. }
  598. }
  599. })
  600. export default {
  601. name: 'index1',
  602. components:{
  603. draggable
  604. },
  605. data() {
  606. return {
  607. // 总条数
  608. total: 0,
  609. operator:'',
  610. lander:'',
  611. before:'',
  612. approvedBy:false,
  613. addOrUpdateVisible: false,
  614. addOrUpdateVisib: false,
  615. liableOption:[],
  616. ids:[],
  617. doNotchange:false,
  618. doNot:false,
  619. materialOption:[],
  620. form:{
  621. pageNum: 1,
  622. pageSize: 10,
  623. },
  624. detailform:{},
  625. show: false,
  626. single:true,
  627. allCheck: false,
  628. // 显示搜索条件
  629. showSearch: true,
  630. showSetting:false,
  631. allCheck2: false,
  632. showSetting2: false,
  633. mainTabel:false,
  634. //返回按钮显示
  635. cancelButton: true,
  636. setRowList:[],
  637. getRowList:[],
  638. setRowList2:[],
  639. getRowList2:[],
  640. projectList:[],
  641. detailList:[],
  642. unitOptions:[],
  643. fMblnoOptions:[],
  644. tableDate: [
  645. {
  646. surface: "1",
  647. label: "fNumber",
  648. name: "代码",
  649. checked: 0,
  650. width: 100,
  651. },
  652. {
  653. surface: "2",
  654. label: "fName",
  655. name: "中文名",
  656. checked: 0,
  657. width: 100,
  658. },
  659. {
  660. surface: "3",
  661. label: "fAddress",
  662. name: "项目地址",
  663. checked: 0,
  664. width: 100,
  665. },
  666. {
  667. surface: "4",
  668. label: "personName",
  669. name: "责任人",
  670. checked: 0,
  671. width: 100,
  672. },
  673. {
  674. surface: "5",
  675. label: "fStatusName",
  676. name: "状态",
  677. checked: 0,
  678. width: 100,
  679. },
  680. {
  681. surface: "6",
  682. label: "fAmtdr",
  683. name: "备注",
  684. checked: 0,
  685. width: 100,
  686. },
  687. {
  688. surface: "7",
  689. label: "createBy",
  690. name: "录入人",
  691. checked: 0,
  692. width: 100,
  693. },
  694. {
  695. surface: "8",
  696. label: "createTime",
  697. name: "录入时间",
  698. checked: 0,
  699. width: 100,
  700. },
  701. {
  702. surface: "9",
  703. label: "updateBy",
  704. name: "最新修改人",
  705. checked: 0,
  706. width: 100,
  707. },
  708. {
  709. surface: "10",
  710. label: "updateTime",
  711. name: "最新修改时间",
  712. checked: 0,
  713. width: 100,
  714. },
  715. {
  716. surface: "11",
  717. label: "fBillstatusName",
  718. name: "审核状态",
  719. checked: 0,
  720. width: 100,
  721. },
  722. ],
  723. tableDate2: [
  724. {
  725. surface: "1",
  726. label: "fMaterial",
  727. name: "物料",
  728. checked: 0,
  729. width: 100,
  730. changeable:2
  731. },
  732. {
  733. surface: "2",
  734. label: "fCurrencyName",
  735. name: "规格",
  736. checked: 0,
  737. width: 100,
  738. changeable:2
  739. },
  740. {
  741. surface: "3",
  742. label: "fStudentsWeight",
  743. name: "学生重量(人)",
  744. checked: 0,
  745. width: 100,
  746. changeable:2
  747. },
  748. {
  749. surface: "4",
  750. label: "fTeachersWeight",
  751. name: "教师重量(人)",
  752. checked: 0,
  753. width: 100,
  754. changeable:2
  755. },
  756. {
  757. surface: "5",
  758. label: "fMeasure",
  759. name: "计量单位",
  760. checked: 0,
  761. width: 100,
  762. changeable:1
  763. },
  764. {
  765. surface: "6",
  766. label: "fError",
  767. name: "误差比列",
  768. checked: 0,
  769. width: 100,
  770. changeable:2
  771. },
  772. {
  773. surface: "7",
  774. label: "fStatus",
  775. name: "状态",
  776. checked: 0,
  777. width: 100,
  778. changeable:2
  779. },
  780. {
  781. surface: "8",
  782. label: "remark",
  783. name: "备注",
  784. checked: 0,
  785. width: 100,
  786. changeable:2
  787. },
  788. // {
  789. // surface: "8",
  790. // label: "fRemarks",
  791. // name: "录入人",
  792. // checked: 0,
  793. // width: 100,
  794. // Changeable:2
  795. // },
  796. // {
  797. // surface: "9",
  798. // label: "fBillstatus",
  799. // name: "录入时间",
  800. // checked: 0,
  801. // width: 100,
  802. // Changeable:3
  803. // },
  804. // {
  805. // surface: "10",
  806. // label: "fBillstat",
  807. // name: "最新修改人",
  808. // checked: 0,
  809. // width: 100,
  810. // Changeable:2
  811. // },
  812. // {
  813. // surface: "11",
  814. // label: "fBillstatu",
  815. // name: "最新修改时间",
  816. // checked: 0,
  817. // width: 100,
  818. // Changeable:3
  819. // },
  820. ],
  821. rules: {
  822. fCorpid:[{required: true, message: "收款单位不能为空", trigger: "blur"}],
  823. fPerson:[{required: true, message: "责任人不能为空", trigger: "blur"}],
  824. fTel:[ {
  825. pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
  826. message: "请输入正确的手机号码",
  827. trigger: "blur"
  828. }]
  829. },
  830. loading:true,
  831. name:''
  832. }
  833. },
  834. activated(){
  835. this.homePage()
  836. },
  837. created(){
  838. //获取登陆人
  839. queryUserVal().then((response) => {
  840. this.lander = response.user.userName;
  841. })
  842. this.setRowList = this.getRowList = this.tableDate
  843. this.setRowList2 = this.getRowList2 = this.tableDate2
  844. this.getList()
  845. this.getDicts('data_unitfees').then((response) => {
  846. if (response.data) {
  847. this.unitOptions = response.data
  848. }
  849. })
  850. this.corpsRemoteMethod()
  851. this.liableRemoteMethod()
  852. this.materialRemoteMethod()
  853. },
  854. methods: {
  855. //撤销审批
  856. backApproval(res) {
  857. if(res == 1){
  858. let data = {
  859. id: this.detailform.fId,
  860. actId: 510,
  861. billId: this.detailform.fId,
  862. };
  863. revoke(data).then((response) => {
  864. if (response.code === 200) {
  865. this.msgSuccess("撤销审批成功");
  866. this.mainTabel = false
  867. this.getList();
  868. }
  869. });
  870. }else if(res == 2){
  871. let data ={
  872. fId:this.detailform.fId
  873. }
  874. revokeBill(data).then(res=>{
  875. if(res.code == 200){
  876. this.$message.success("撤销成功");
  877. this.getList()
  878. this.mainTabel = false
  879. }
  880. })
  881. }
  882. },
  883. //物料带出单位
  884. change(scope){
  885. for(let item in this.detailList){
  886. for(let li in this.materialOption){
  887. if(this.detailList[item].fMaterial == this.materialOption[li].fId){
  888. this.$set(this.detailList[item],'fMeasure',JSON.stringify(this.materialOption[li].fFeeunitid))
  889. this.$set(this.detailList[item],'fCurrencyName',this.materialOption[li].fCurrency)
  890. }
  891. }
  892. }
  893. },
  894. addOrUpdateHand() {
  895. this.addOrUpdateVisib = true;
  896. this.$nextTick(() => {
  897. this.$refs.ApprovalComments.init(this.detailform.fId,510);
  898. });
  899. },
  900. homePage(){
  901. let date = this.$route.query
  902. if (this.$route.query.list){
  903. this.cancelButton = false;
  904. let scope = {
  905. row:{
  906. fId:JSON.parse(this.$route.query.data).billId
  907. }
  908. }
  909. this.handleUpdate(scope.row)
  910. this.approvedBy = true
  911. }else{
  912. this.mainTabel = false
  913. this.cancelButton = true
  914. this.approvedBy = false
  915. }
  916. },
  917. // 查看审批流
  918. getDataList() {
  919. this.addOrUpdateVisible = false;
  920. },
  921. returnData() {
  922. this.addOrUpdateVisib = false;
  923. this.open = false;
  924. this.cancelTwo();
  925. },
  926. addOrUpdateHandle() {
  927. this.addOrUpdateVisible = true;
  928. this.$nextTick(() => {
  929. this.$refs.addOrUpdate.init(this.detailform.fId,510);
  930. });
  931. },
  932. //首页审批跳转关闭返回首页
  933. cancelTwo() {
  934. this.open = false
  935. let view = {
  936. fullPath: "/project",
  937. hash: "",
  938. matched: Array(2),
  939. meta: Object,
  940. name: "Project",
  941. params: Object,
  942. path: "/project",
  943. query: Object,
  944. title: "项目管理"
  945. }
  946. this.$router.push({ path: '/index' })
  947. this.$store
  948. .dispatch('tagsView/delView', view)
  949. .then(({ visitedViews }) => {
  950. if (this.isActive(view)) {
  951. this.toLastView(visitedViews, view)
  952. }
  953. })
  954. Global.$emit('removeCache', 'closeSelectedTag', view)
  955. },
  956. //请核
  957. approval(){
  958. this.$refs['detailform'].validate((valid) => {
  959. if (valid) {
  960. let formData = new window.FormData();
  961. formData.append('tProject', JSON.stringify(this.detailform))
  962. formData.append('tCtnpriceItems', JSON.stringify(this.detailList))
  963. addproject(formData).then(res => {
  964. this.$message.success("操作成功")
  965. this.doNot = true
  966. this.getList()
  967. this.mainTabel = false
  968. })
  969. }
  970. })
  971. },
  972. /** 远程模糊查询用户 */
  973. corpsRemoteMethod(name) {
  974. let queryParams = { fName: name }
  975. getCorps(queryParams).then((response) => {
  976. this.fMblnoOptions = response
  977. })
  978. },
  979. /** 获取责任人*/
  980. liableRemoteMethod(name) {
  981. let queryParams = { fName: name }
  982. getliable(queryParams).then((response) => {
  983. this.liableOption = response.rows
  984. })
  985. },
  986. /** 货物物料*/
  987. materialRemoteMethod(name) {
  988. let queryParams = { fName: name }
  989. listmaterial(queryParams).then((response) => {
  990. this.materialOption = response.rows
  991. })
  992. },
  993. //刷新
  994. getList() {
  995. this.loading = false
  996. listCharge(this.form).then(response => {
  997. if (response.rows) {
  998. this.projectList = response.rows
  999. }
  1000. this.total = response.total;
  1001. })
  1002. },
  1003. handleAdd() {
  1004. this.detailform = {}
  1005. this.detailList = []
  1006. this.doNot = false
  1007. this.mainTabel = true
  1008. },
  1009. handleUpdate(row, res) {
  1010. const fId = row.fId || this.ids
  1011. getChange(fId).then(response => {
  1012. if (response.data.projectItemsList) {
  1013. this.detailform = response.data.tProject
  1014. this.operator = this.detailform.createBy
  1015. }
  1016. if (response.data.tProject) {
  1017. this.detailList = response.data.projectItemsList
  1018. for (let li in this.detailList) {
  1019. this.$set(this.detailList[li], 'fStatus', JSON.stringify(this.detailList[li].fStatus))
  1020. this.$set(this.detailList[li], 'fMeasure', JSON.stringify(this.detailList[li].fMeasure))
  1021. }
  1022. }
  1023. if(this.detailform.fBillstatus >= 4){
  1024. this.doNot = true
  1025. this.doNotchange = true
  1026. }else{
  1027. this.doNot = true
  1028. this.doNotchange = false
  1029. }
  1030. let data = {
  1031. actId: 510,
  1032. id: this.detailform.fId
  1033. }
  1034. getName(data).then(response => {
  1035. if (response.data.length != 0) {
  1036. this.before = response.data[0].userName
  1037. }
  1038. })
  1039. this.mainTabel = true
  1040. })
  1041. },
  1042. handleExport() {
  1043. },
  1044. handleQuery() {
  1045. this.getList();
  1046. },
  1047. resetQuery() {
  1048. this.form = {
  1049. fNumber:null,
  1050. fName:null,
  1051. fCorpid:null,
  1052. fPerson:null,
  1053. fTel:null,
  1054. fAddress:null,
  1055. remark:null,
  1056. }
  1057. this.getList()
  1058. },
  1059. addList() {
  1060. this.detailList.push({
  1061. fMaterial: null,
  1062. fStudentsWeight: null,
  1063. fTeachersWeight: null,
  1064. fMeasure: null,
  1065. fError: null,
  1066. fStatus: '0',
  1067. remark: null,
  1068. })
  1069. },
  1070. submit() {
  1071. this.$refs['detailform'].validate((valid) => {
  1072. if (valid) {
  1073. let formData = new window.FormData()
  1074. formData.append('tProject', JSON.stringify(this.detailform))
  1075. formData.append('tCtnpriceItems', JSON.stringify(this.detailList))
  1076. addChange(formData).then(response => {
  1077. this.$message.success("操作成功")
  1078. if (response.data.tProject) {
  1079. this.detailform = response.data.tProject
  1080. }
  1081. if (response.data.tCtnpriceItems) {
  1082. this.detailList = response.data.tCtnpriceItems
  1083. }
  1084. this.getList()
  1085. })
  1086. }
  1087. })
  1088. },
  1089. goBack() {
  1090. if (this.doNot == true && !this.$route.query.data) {
  1091. this.mainTabel = false
  1092. }else if(this.$route.query.data){
  1093. this.cancelTwo()
  1094. this.$router.push({path:'/index'})
  1095. } else{
  1096. this.$confirm('返回列表,是否保存?', '提示', {
  1097. confirmButtonText: '保存',
  1098. cancelButtonText: '取消',
  1099. type: 'warning'
  1100. })
  1101. .then(() => {
  1102. this.submit(Cookies.get('sysType'))
  1103. this.mainTabel = false
  1104. })
  1105. .catch(() => {
  1106. this.mainTabel = false
  1107. this.getList()
  1108. })
  1109. }
  1110. },
  1111. //列设置全选
  1112. allChecked() {
  1113. if (this.allCheck == true) {
  1114. this.setRowList.map((e) => {
  1115. return (e.checked = 0)
  1116. })
  1117. } else {
  1118. this.setRowList.map((e) => {
  1119. return (e.checked = 1)
  1120. })
  1121. }
  1122. },
  1123. //查询列数据
  1124. getRow() {
  1125. let that = this
  1126. this.data = {
  1127. tableName: '物资主列表',
  1128. userId: Cookies.get('userName')
  1129. }
  1130. select(this.data).then((res) => {
  1131. if (res.data.length != 0) {
  1132. this.getRowList = res.data.filter((e) => e.checked == 0)
  1133. this.setRowList = res.data
  1134. this.setRowList = this.setRowList.reduce((res, item) => {
  1135. res.push({
  1136. surface: item.surface,
  1137. label: item.label,
  1138. name: item.name,
  1139. checked: item.checked,
  1140. width: item.width,
  1141. fixed: item.fixed
  1142. })
  1143. return res
  1144. }, [])
  1145. }
  1146. })
  1147. },
  1148. //保存列设置
  1149. save() {
  1150. this.showSetting = false
  1151. this.data = {
  1152. tableName: '物资主列表',
  1153. userId: Cookies.get('userName'),
  1154. sysTableSetList: this.setRowList
  1155. }
  1156. addSet(this.data).then((res) => {
  1157. this.getRowList = this.setRowList
  1158. })
  1159. },
  1160. //重置列表
  1161. delRow() {
  1162. this.data = {
  1163. tableName: '物资主列表',
  1164. userId: Cookies.get('userName')
  1165. }
  1166. resetModule(this.data).then(res => {
  1167. if (res.code == 200) {
  1168. this.showSetting = false
  1169. this.setRowList = this.getRowList = this.$options.data().tableDate
  1170. }
  1171. })
  1172. },
  1173. //查询列数据
  1174. getRow2() {
  1175. let that = this;
  1176. this.data = {
  1177. tableName: "弹窗列表物资",
  1178. userId: Cookies.get("userName"),
  1179. };
  1180. select(this.data).then((res) => {
  1181. if (res.data.length != 0) {
  1182. this.getRowList2 = res.data.filter((e) => e.checked == 0);
  1183. this.setRowList2 = res.data;
  1184. this.setRowList2 = this.setRowList2.reduce((res, item) => {
  1185. res.push({
  1186. surface: item.surface,
  1187. label: item.label,
  1188. name: item.name,
  1189. checked: item.checked,
  1190. width: item.width,
  1191. fixed: item.fixed,
  1192. });
  1193. return res;
  1194. }, []);
  1195. }
  1196. });
  1197. },
  1198. //保存列设置
  1199. save2() {
  1200. this.showSetting = false;
  1201. this.data = {
  1202. tableName: "弹窗列表物资",
  1203. userId: Cookies.get("userName"),
  1204. sysTableSetList: this.setRowList2,
  1205. };
  1206. addSet(this.data).then((res) => {
  1207. this.getRowList2 = this.setRowList2.filter((e) => e.checked == 0);
  1208. });
  1209. },
  1210. //重置列表
  1211. delRow2() {
  1212. this.data = {
  1213. tableName: "弹窗列表物资",
  1214. userId: Cookies.get("userName"),
  1215. };
  1216. resetModule(this.data).then((res) => {
  1217. if (res.code == 200) {
  1218. this.showSetting = false;
  1219. this.setRowList2 = this.getRowList2 = this.$options.data().tableDate2
  1220. // this.$refs.MainList.resetTwo(this.$options.data().tableDate2)
  1221. }
  1222. });
  1223. },
  1224. //开始拖拽事件
  1225. onStart() {
  1226. this.drag = true
  1227. },
  1228. //拖拽结束事件
  1229. onEnd() {
  1230. this.drag = false
  1231. },
  1232. handleSelectionChange(selection) {
  1233. this.ids = selection.map((item) => item.fId)
  1234. this.single = selection.length != 1
  1235. },
  1236. handleSelectionChange_s(selection) {
  1237. },
  1238. check() {
  1239. this.doNot = true
  1240. },
  1241. //删除从表行
  1242. deleteRow(index, rows) {
  1243. rows.splice(index, 1)
  1244. },
  1245. //删除主列表行
  1246. handleDelete(row){
  1247. const fId = row.fId
  1248. this.$confirm('是否确认删除用户编号为"' + fId + '"的数据项?', "警告", {
  1249. confirmButtonText: "确定",
  1250. cancelButtonText: "取消",
  1251. type: "warning"
  1252. }).then(function() {
  1253. return delProject(fId);
  1254. }).then(() => {
  1255. this.getList();
  1256. this.msgSuccess("删除成功");
  1257. })
  1258. }
  1259. }
  1260. }
  1261. </script>
  1262. <style lang="scss" scoped>
  1263. .tabSetting {
  1264. display: flex;
  1265. justify-content: flex-end;
  1266. }
  1267. .listStyle {
  1268. display: flex;
  1269. border-top: 1px solid #dcdfe6;
  1270. border-left: 1px solid #dcdfe6;
  1271. border-right: 1px solid #dcdfe6;
  1272. }
  1273. .listStyle:last-child {
  1274. border-bottom: 1px solid #dcdfe6;
  1275. }
  1276. .progress {
  1277. display: flex;
  1278. align-items: center;
  1279. padding: 2px;
  1280. background-color: rgba(0, 0, 0, 0.05);
  1281. height: 100%;
  1282. }
  1283. .avue-crud__dialog__header {
  1284. display: -webkit-box;
  1285. display: -ms-flexbox;
  1286. display: flex;
  1287. -webkit-box-align: center;
  1288. -ms-flex-align: center;
  1289. align-items: center;
  1290. -webkit-box-pack: justify;
  1291. -ms-flex-pack: justify;
  1292. justify-content: space-between;
  1293. }
  1294. .el-dialog__title {
  1295. color: rgba(0, 0, 0, 0.85);
  1296. font-weight: 500;
  1297. word-wrap: break-word;
  1298. }
  1299. .avue-crud__dialog__menu {
  1300. padding-right: 20px;
  1301. float: left;
  1302. }
  1303. .avue-crud__dialog__menu i {
  1304. color: #909399;
  1305. font-size: 15px;
  1306. }
  1307. .el-icon-full-screen {
  1308. cursor: pointer;
  1309. }
  1310. .el-icon-full-screen:before {
  1311. content: "\e719";
  1312. }
  1313. .app-container ::v-deep .el-form-item {
  1314. margin-bottom: 4px;
  1315. }
  1316. </style>