index1.vue 41 KB

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