detailsPage.vue 51 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516
  1. <template>
  2. <div class="borderless">
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  6. @click="backToList">返回列表
  7. </el-button>
  8. <div class="upper_right_button">
  9. <!-- <el-button type="success"-->
  10. <!-- size="small"-->
  11. <!-- class="el-button&#45;&#45;small-yh "-->
  12. <!-- :loading="buttonLoading"-->
  13. <!-- :disabled="!form.id || viewDisabled"-->
  14. <!-- @click.stop="mainCheck">-->
  15. <!-- 请核-->
  16. <!-- </el-button>-->
  17. <!-- <el-dropdown style="padding: 0 8px;line-height: 0">-->
  18. <!-- <el-button-->
  19. <!-- type="success"-->
  20. <!-- :loading="buttonLoading"-->
  21. <!-- :disabled="!form.id || viewDisabled"-->
  22. <!-- size="small"-->
  23. <!-- >-->
  24. <!-- 业务处理<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>-->
  25. <!-- </el-button>-->
  26. <!-- <el-dropdown-menu slot="dropdown">-->
  27. <!-- <el-dropdown-item-->
  28. <!-- :loading="buttonLoading"-->
  29. <!-- :disabled="!form.id"-->
  30. <!-- @click.native="createData()">创建单据-->
  31. <!-- </el-dropdown-item>-->
  32. <!-- <el-dropdown-item-->
  33. <!-- :loading="buttonLoading"-->
  34. <!-- :disabled="!form.id"-->
  35. <!-- @click.native="copyData()">复制单据-->
  36. <!-- </el-dropdown-item>-->
  37. <!-- </el-dropdown-menu>-->
  38. <!-- </el-dropdown>-->
  39. <el-button type="primary" size="small" :disabled="buttonLoading" @click="postMessage">发送消息
  40. </el-button>
  41. <el-button type="primary" :loading="buttonLoading" @click.stop="editMainProject" size="small">保存数据
  42. </el-button>
  43. </div>
  44. </div>
  45. </div>
  46. <div class="customer-main">
  47. <trade-card title="基础信息">
  48. <avue-form class="trading-form" ref="form" v-model="form" :option="option">
  49. <template slot="corpId">
  50. <crop-select v-model="form.corpId" corpType="KG" :disabled="viewDisabled" style="width: 100%"></crop-select>
  51. </template>
  52. <template slot="corpAttn">
  53. <el-select v-model="form.corpAttn" :disabled="viewDisabled" icon="el-icon-edit" remote filterable clearable
  54. :remote-method="corpAttnRemoteMethod">
  55. <el-option v-for="item in corpAttnDic" :key="item.value" :label="item.realName" :value="item.realName">
  56. </el-option>
  57. </el-select>
  58. </template>
  59. <template slot="salesName">
  60. <el-select v-model="form.salesName" :disabled="viewDisabled" remote filterable clearable
  61. :remote-method="salesNameRemoteMethod">
  62. <el-option v-for="item in salesNameDic" :key="item.value" :label="item.realName" :value="item.realName">
  63. </el-option>
  64. </el-select>
  65. </template>
  66. <template slot="sourceBusiness">
  67. <el-select v-model="form.sourceBusiness" :disabled="viewDisabled" filterable clearable>
  68. <el-option v-for="(item, index) in sourceBusinessDic" :key="index" :label="item.dictValue"
  69. :value="item.dictValue">
  70. </el-option>
  71. </el-select>
  72. </template>
  73. <template slot="remark">
  74. <el-input type="textarea" v-model="form.remark" size="small" rows="6" autocomplete="off" placeholder="">
  75. </el-input>
  76. </template>
  77. </avue-form>
  78. </trade-card>
  79. <containerTitle title="明细列表"></containerTitle>
  80. <basic-container>
  81. <avue-crud ref="crud" :data="data" :option="optionTable" :table-loading="loading" v-model="optionFrom"
  82. @row-del="rowDel" @row-save="rowSave" @row-update="rowUpdate" @size-change="sizeChange"
  83. @current-change="currentChange" @selection-change="selectionChange" @search-change="searchChange"
  84. @saveColumn="saveColumn" @resetColumn="resetColumn">
  85. <template slot="menuLeft">
  86. <el-tabs v-model="activeName" @tab-click="handleClick">
  87. <el-tab-pane label="原始数据" name="first" :key="'first'">
  88. </el-tab-pane>
  89. <el-tab-pane label="追加" name="second" :key="'second'">
  90. </el-tab-pane>
  91. <el-tab-pane label="退款" name="three" :key="'three'">
  92. </el-tab-pane>
  93. </el-tabs>
  94. <el-button type="primary" size="small" icon="el-icon-plus" :disabled="viewDisabled"
  95. @click="serviceDialog = true">录入明细
  96. </el-button>
  97. </template>
  98. <!-- <el-button type="info"-->
  99. <!-- size="small"-->
  100. <!-- v-if="false"-->
  101. <!-- :disabled="crudSelection == 0"-->
  102. <!-- @click.stop="beforePleaseCheck()">请 核-->
  103. <!-- </el-button>-->
  104. <!-- </template>-->
  105. <template slot-scope="{row,index}" slot="menu">
  106. <el-button v-if="row.status !== 5" type="text" size="small" @click="beforeCloseAccount(row)">结算</el-button>
  107. <el-button v-if="row.status === 5" type="text" size="small" :disabled="viewDisabled"
  108. @click="cancelCloseAccount(row)">取消结算</el-button>
  109. <el-button v-if="row.status !== 5" type="text" size="small" @click="dispatch(row)">派工</el-button>
  110. <el-button type="text" size="small" @click="rowCellTwo(row, index)"
  111. :disabled="row.strStatus == '结算完成' || viewDisabled">{{ row.$cellEdit ? '修改完成' : '修改' }}</el-button>
  112. <el-button type="text" size="small" @click="rowDel(row, index)"
  113. :disabled="row.strStatus == '结算完成' || viewDisabled">删除</el-button>
  114. </template>
  115. <template slot="userid" slot-scope="{row,index}">
  116. <user-select v-if="row.$cellEdit" v-model="row.userName" @value="(values) => value(values, row)"
  117. :configuration="UConfiguration">
  118. </user-select>
  119. <span v-else>{{ row.userName }}</span>
  120. </template>
  121. <!-- <template slot="frequency" slot-scope="{ row }">-->
  122. <!-- <el-select v-if="row.$cellEdit" size="small" v-model="row.frequency" placeholder="请选择"-->
  123. <!-- @change="frequencyChange(row)" clearable>-->
  124. <!-- <el-option v-for="item in frequencyList" :key="item.id" :label="item.dictValue" :value="item.dictKey">-->
  125. <!-- </el-option>-->
  126. <!-- </el-select>-->
  127. <!-- <span v-else>{{ row.frequency | frequencyFormat(frequencyList) }}</span>-->
  128. <!-- </template>-->
  129. <template slot="second" slot-scope="{ row }">
  130. <el-select v-if="row.$cellEdit && row.frequency == 4" size="small" v-model="row.second" placeholder="请选择"
  131. clearable>
  132. <el-option v-for="item in secondList" :key="item.id" :label="item.dictValue" :value="item.dictKey">
  133. </el-option>
  134. </el-select>
  135. <span v-else>{{ row.frequency == 4 ? row.second : '-' }}</span>
  136. </template>
  137. <template slot="amount" slot-scope="{ row }">
  138. <el-input v-if="row.$cellEdit" v-model="row.amount" placeholder="请输入" size="small"
  139. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
  140. @change="totalChange(row, '金额')"></el-input>
  141. <span v-else>{{ row.amount }}</span>
  142. </template>
  143. <template slot="serviceCharge" slot-scope="{ row }">
  144. <el-input v-if="row.$cellEdit" v-model="row.serviceCharge" placeholder="请输入" size="small"
  145. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
  146. @input="costCount(row)" @change="totalChange(row, '服务')"></el-input>
  147. <span v-else>{{ row.serviceCharge }}</span>
  148. </template>
  149. <template slot="matMoney" slot-scope="{ row }">
  150. <el-input v-if="row.$cellEdit" v-model="row.matMoney" placeholder="请输入" size="small"
  151. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
  152. @input="costCount(row)" @change="totalChange(row, '代垫')"></el-input>
  153. <span v-else>{{ row.matMoney }}</span>
  154. </template>
  155. <template slot="otheramt" slot-scope="{ row }">
  156. <el-input v-if="row.$cellEdit" v-model="row.otheramt" placeholder="请输入" size="small"
  157. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
  158. @input="costCount(row)"></el-input>
  159. <span v-else>{{ row.otheramt }}</span>
  160. </template>
  161. </avue-crud>
  162. </basic-container>
  163. <containerTitle title="补充信息"></containerTitle>
  164. <basic-container>
  165. <el-form :model="formTwo" ref="formTwo" label-width="100px" class="demo-ruleForm">
  166. <el-row>
  167. <el-col v-for="(item, index) in basicData.column" :span="item.span ? item.span : 6" :key="index">
  168. <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
  169. <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="formTwo[item.prop]"
  170. size="small" type="datetime" :disabled="item.disabled ? true : false || viewDisabled"
  171. placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss" />
  172. <el-date-picker v-else-if="item.type === 'date'" style="width: 100%;" v-model="formTwo[item.prop]"
  173. size="small" type="date" :disabled="viewDisabled" placeholder="选择日期" value-format="yyyy-MM-dd" />
  174. <el-input type="textarea" v-else-if="(item.prop === 'remark')" v-model="formTwo[item.prop]"
  175. :disabled="viewDisabled" size="small" autocomplete="off" placeholder="请输入"></el-input>
  176. <el-input type="age" v-else-if="item.prop === 'debitAmount'" v-model="formTwo[item.prop]"
  177. @change="debitChange" :disabled="item.disabled ? true : false || viewDisabled" size="small"
  178. autocomplete="off" placeholder="请输入">
  179. <template slot="append">元</template>
  180. </el-input>
  181. <el-input type="age" v-else-if="item.type === 'unit'" v-model="formTwo[item.prop]"
  182. :disabled="item.disabled ? true : false || viewDisabled" size="small" autocomplete="off"
  183. placeholder="请输入">
  184. <template slot="append">元</template>
  185. </el-input>
  186. <el-input type="age" v-else v-model="formTwo[item.prop]"
  187. :disabled="item.disabled ? true : false || viewDisabled" size="small" value="0" autocomplete="off"
  188. placeholder="请输入">
  189. <template
  190. v-if="item.prop === 'advanceAmount' || item.prop === 'settlmentAmount' || item.prop === 'balanceAmount'"
  191. slot="append">元</template>
  192. </el-input>
  193. </el-form-item>
  194. </el-col>
  195. </el-row>
  196. </el-form>
  197. </basic-container>
  198. <containerTitle title="附件上传"></containerTitle>
  199. <basic-container style="margin-bottom: 40px">
  200. <avue-crud :option="upLoadOption" v-model="upLoadForm" :data="upLoadData" @row-save="upLoadSave"
  201. @row-update="upLoadUpdate" @row-del="upLoadDel"></avue-crud>
  202. </basic-container>
  203. </div>
  204. <messagePost v-if="messageVisble" ref="messagePost" @closeDialog="closeDialog"></messagePost>
  205. <el-dialog title="导入服务项目" append-to-body class="el-dialogDeep" :visible.sync="serviceDialog" width="70%"
  206. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false">
  207. <el-row style="height: 0;">
  208. <el-col :span="5">
  209. <div>
  210. <el-scrollbar>
  211. <basic-container>
  212. <avue-tree :option="serviceTreeOption" @node-click="serviceNodeClick" />
  213. </basic-container>
  214. </el-scrollbar>
  215. </div>
  216. </el-col>
  217. <el-col :span="19">
  218. <basic-container>
  219. <avue-crud ref="serviceCrud" :page.sync="servicePage" :search.sync="serviceSearch" :option="serviceOption"
  220. :table-loading="serviceLoading" :data="serviceData" @refresh-change="serviceRefreshChange"
  221. @selection-change="serviceSelectionChange" @search-change="serviceSearchChange" @on-load="serviceOnLoad">
  222. </avue-crud>
  223. </basic-container>
  224. </el-col>
  225. </el-row>
  226. <span slot="footer" class="dialog-footer">
  227. <el-button type="primary" @click="serviceConfirm()" :disabled="this.serviceSelectList.length == 0">导 入
  228. </el-button>
  229. <el-button @click="serviceDialog = false">取 消</el-button>
  230. </span>
  231. </el-dialog>
  232. <el-dialog title="导入用户" :visible.sync="userDialog" class="el-dialogDeep" append-to-body width="80%">
  233. <el-row style="margin-top: -5px;height: 0">
  234. <el-col :span="5">
  235. <div class="box">
  236. <el-scrollbar>
  237. <basic-container>
  238. <avue-tree :option="userTreeOption" :data="userTreeData" @node-click="userNodeClick" />
  239. </basic-container>
  240. </el-scrollbar>
  241. </div>
  242. </el-col>
  243. <el-col :span="19">
  244. <basic-container>
  245. <avue-crud ref="userCrud" :option="userOption" :data="userDataList" :table-loading="userLoading"
  246. :page.sync="userPage" v-model="userForm" @search-change="userSearchChange" @search-reset="userSearchReset"
  247. @refresh-change="userRefreshChange" @selection-change="userSelectionChange" @on-load="userOnLoad">
  248. </avue-crud>
  249. </basic-container>
  250. </el-col>
  251. </el-row>
  252. <span slot="footer" class="dialog-footer">
  253. <el-button @click="userDialog = false">取 消</el-button>
  254. <el-button type="primary" :disabled="this.userSelection.length == 1 ? false : true" @click="userConfirm">确 定
  255. </el-button>
  256. </span>
  257. </el-dialog>
  258. <el-dialog title="流程" append-to-body class="el-dialogDeep" :visible.sync="processDialog" width="60%"
  259. :close-on-click-modal="false" :destroy-on-close="true" :modal-append-to-body='false'
  260. :close-on-press-escape="false" v-dialog-drag>
  261. <examine-approve :itemId="itemId" :closeFun="dialogProcessClose">
  262. </examine-approve>
  263. </el-dialog>
  264. <el-dialog title="结算" append-to-body class="el-dialogDeep" :visible.sync="accountDialog" width="25%"
  265. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false">
  266. <el-form :model="accountFormData" ref="accountFormData">
  267. <el-form-item label="账户名称" class="landConFrom-input" prop="accountName" :rules="rules">
  268. <el-input v-model="accountFormData.accountName" style="width: 220px;" size="small" clearable
  269. placeholder="请输入"></el-input>
  270. </el-form-item>
  271. <el-form-item label="结算日期" class="landConFrom-input" prop="payTime" :rules="rules">
  272. <el-date-picker type="date" v-model="accountFormData.payTime" value-format="yyyy-MM-dd HH:mm:ss" size="small"
  273. clearable placeholder="日期"></el-date-picker>
  274. </el-form-item>
  275. </el-form>
  276. <span slot="footer" style="display: flex; justify-content: center">
  277. <el-button @click.stop="accountDialog = false, accountFormData = {}" size="small">取 消</el-button>
  278. <el-button type="primary" size="small" @click="closeAccount('accountFormData')">结算</el-button>
  279. </span>
  280. </el-dialog>
  281. </div>
  282. </template>
  283. <script>
  284. import option from "./configuration/detailsPage.json";
  285. import startOption from "./configuration/startDialog.json";
  286. import { projectDetail, editMianProject, settleAccounts, getSysNo, masterCheck } from "@/api/workManagement/mainProject";
  287. //上传文件json
  288. import upLoadOption from "../../exportTrade/purchaseContract/config/uploadList.json"
  289. //服务列表接口
  290. import { getServiceProjectList, getServiceTypeTree, } from "@/api/workManagement/serviceProject";
  291. import serviceOption from "./configuration/serviceDialogList.json";
  292. //用户组件
  293. import userOption from "./configuration/userList.json";
  294. import { getList } from "@/api/system/user";
  295. import { getDeptLazyTree } from "@/api/system/dept";
  296. //上传附件删除
  297. import { corpsbank } from "@/api/basicData/configuration"
  298. //事务
  299. import examineApprove from "@/components/examineApprove/index";
  300. //对象数组比较
  301. import { contrastObj, contrastList2 } from "@/util/contrastData";
  302. import _ from "lodash";
  303. import { getUserList } from "@/api/workManagement/mainProject";
  304. import optionAdd from "../receipt/configuration/settleAccountsDetailsADD.json";
  305. import optionReturn from "../receipt/configuration/settleAccountsDetailsReturn.json";
  306. import { getDeptTree } from "@/api/system/dept";
  307. import messagePost from "@/components/messageSend/main"
  308. import clientOption from "../performanceAnalysis/config/clientList.json";
  309. import { getGoodsDescList } from "@/api/standAlone/saleLeads";
  310. export default {
  311. props: {
  312. detailData: {
  313. type: Object
  314. }
  315. },
  316. components: {
  317. examineApprove,
  318. messagePost
  319. },
  320. data() {
  321. return {
  322. goodsDescList: [],
  323. secondList: [],
  324. frequencyList: [],
  325. id: '',
  326. loading: false,
  327. form: {},
  328. formTwo: {},
  329. optionFrom: {},
  330. account: {},
  331. data: [],
  332. dataList: [],
  333. crudSelection: [],
  334. corpAttnDic: [],
  335. salesNameDic: [],
  336. sourceBusinessDic: [],
  337. buttonLoading: false,
  338. messageVisble: false,
  339. viewDisabled: false,
  340. deptDicData: [],//任务部门数据
  341. serviceDialog: false,//服务导入窗口
  342. userDialog: false,//用户导入窗口
  343. accountDialog: false,//结算窗口
  344. //客户组件配置控制
  345. UConfiguration: {
  346. multipleChoices: false,
  347. multiple: false,
  348. disabled: false,
  349. searchShow: true,
  350. collapseTags: false,
  351. placeholder: '请点击右边按钮选择',
  352. dicData: []
  353. },
  354. detailsSelect: {},
  355. //顶部from数据
  356. option: {
  357. menuBtn: false,
  358. labelWidth: 100,
  359. column: [
  360. {
  361. label: '项目名称',
  362. prop: 'cname',
  363. span: 12,
  364. rules: [
  365. {
  366. required: true,
  367. message: ' ',
  368. trigger: 'blur'
  369. }
  370. ]
  371. },
  372. {
  373. label: '客户名称',
  374. prop: 'corpId',
  375. span: 12,
  376. rules: [
  377. {
  378. required: true,
  379. message: ' ',
  380. trigger: 'blur'
  381. }
  382. ]
  383. },
  384. {
  385. label: '责任人',
  386. prop: 'corpAttn',
  387. span: 6,
  388. rules: [
  389. {
  390. required: true,
  391. message: ' ',
  392. trigger: 'blur'
  393. }
  394. ]
  395. },
  396. {
  397. label: '承揽人',
  398. prop: 'salesName',
  399. span: 6,
  400. rules: [
  401. {
  402. required: true,
  403. message: ' ',
  404. trigger: 'blur'
  405. }
  406. ]
  407. },
  408. {
  409. label: '业务来源',
  410. prop: 'sourceBusiness',
  411. span: 6,
  412. rules: [
  413. {
  414. required: true,
  415. message: ' ',
  416. trigger: 'blur'
  417. }
  418. ]
  419. },
  420. {
  421. label: '备注',
  422. span: 24,
  423. minRows: 6,
  424. prop: 'remark'
  425. }
  426. ],
  427. },
  428. basicData: {
  429. column: [
  430. {
  431. label: '合同金额',
  432. prop: 'debitAmount',
  433. rules: [
  434. {
  435. required: false,
  436. message: ' ',
  437. trigger: 'blur'
  438. },
  439. {
  440. pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
  441. message: ' ',
  442. trigger: 'blur'
  443. },
  444. ]
  445. },
  446. {
  447. label: '首付金额',
  448. prop: 'advanceAmount',
  449. type: 'unit',
  450. rules: [
  451. {
  452. pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
  453. message: ' ',
  454. trigger: 'blur'
  455. }
  456. ]
  457. },
  458. {
  459. label: '已收金额',
  460. prop: 'settlmentAmount',
  461. disabled: true,
  462. type: 'unit',
  463. },
  464. {
  465. label: '未收金额',
  466. type: 'unit',
  467. prop: 'balanceAmount',
  468. disabled: true,
  469. },
  470. {
  471. label: '总服务费',
  472. prop: 'serviceCharge',
  473. type: 'unit',
  474. disabled: true,
  475. rules: [
  476. {
  477. pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
  478. message: ' ',
  479. trigger: 'blur'
  480. }
  481. ]
  482. },
  483. {
  484. label: '总成本',
  485. prop: 'matMoney',
  486. type: 'unit',
  487. disabled: true,
  488. rules: [
  489. {
  490. pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
  491. message: ' ',
  492. trigger: 'blur'
  493. }
  494. ]
  495. },
  496. {
  497. label: '制单人',
  498. prop: 'createUserName',
  499. disabled: true
  500. }, {
  501. label: '制单日期',
  502. prop: 'createTime',
  503. type: 'datetime',
  504. valueFormat: "yyyy-MM-dd HH:mm:ss",
  505. format: "yyyy-MM-dd",
  506. disabled: true
  507. },
  508. {
  509. label: '电话',
  510. prop: 'corpTel',
  511. },
  512. {
  513. label: '收款方式',
  514. prop: 'paymentType',
  515. width: 120,
  516. },
  517. {
  518. label: '开始日期',
  519. prop: 'beginTime',
  520. valueFormat: "yyyy-MM-dd HH:mm:ss",
  521. format: "yyyy-MM-dd",
  522. type: 'datetime',
  523. },
  524. {
  525. label: '结束日期',
  526. prop: 'endTime',
  527. valueFormat: "yyyy-MM-dd HH:mm:ss",
  528. format: "yyyy-MM-dd",
  529. type: 'datetime',
  530. }
  531. ],
  532. },
  533. optionTable: {},
  534. //结算
  535. accountFormData: {},
  536. rules: [{
  537. required: true,
  538. message: ' ',
  539. trigger: 'blur'
  540. }
  541. ],
  542. //上传文件
  543. upLoadOption: upLoadOption,
  544. upLoadData: [],
  545. upLoadForm: {},
  546. //服务窗口定义
  547. serviceTreeOption: {
  548. nodeKey: 'id',
  549. lazy: true,
  550. treeLoad: function (node, resolve) {
  551. const parentId = node.level === 0 ? 0 : node.data.id;
  552. getServiceTypeTree(parentId).then(res => {
  553. resolve(
  554. res.data.data.map(item => {
  555. return {
  556. ...item,
  557. leaf: !item.hasChildren
  558. };
  559. })
  560. );
  561. });
  562. },
  563. addBtn: false,
  564. menu: false,
  565. size: 'small',
  566. props: {
  567. labelText: '标题',
  568. label: 'title',
  569. value: 'value',
  570. children: 'children'
  571. }
  572. },
  573. serviceOption: serviceOption,
  574. serviceLoading: false,
  575. serviceData: [],
  576. servicePage: {
  577. currentPage: 1,
  578. total: 0,
  579. pageSize: 10
  580. },
  581. serviceSearch: {},
  582. serviceTreeDeptId: "",
  583. serviceSelectList: [],
  584. //用户窗口定义
  585. userTreeOption: {
  586. nodeKey: 'id',
  587. lazy: true,
  588. treeLoad: function (node, resolve) {
  589. const parentId = (node.level === 0) ? 0 : node.data.id;
  590. getDeptLazyTree(parentId).then(res => {
  591. resolve(res.data.data.map(item => {
  592. return {
  593. ...item,
  594. leaf: !item.hasChildren
  595. }
  596. }))
  597. });
  598. },
  599. addBtn: false,
  600. menu: false,
  601. size: 'small',
  602. props: {
  603. labelText: '标题',
  604. label: 'title',
  605. value: 'value',
  606. children: 'children'
  607. }
  608. },
  609. userTreeData: [],
  610. userOption: userOption,
  611. userLoading: false,
  612. userDataList: [],
  613. userSelection: [],
  614. userTreeDeptId: "",
  615. userForm: {},
  616. userPage: {
  617. currentPage: 1,
  618. total: 0,
  619. pageSize: 10
  620. },
  621. itemId: '',
  622. //请核窗口定义
  623. processDialog: false,
  624. pleaseCheckContact: startOption,
  625. pleaseCheckLoading: false,
  626. pleaseCheckData: [],
  627. pleaseCheckPage: {
  628. pageSize: 10,
  629. currentPage: 1,
  630. total: 0
  631. },
  632. activeName: "first",
  633. tab1: true,
  634. tab2: false,
  635. tab3: false,
  636. secondDisable: 0,
  637. data_one: [],
  638. data_two: [],
  639. data_three: [],
  640. //新旧数据比较
  641. oldData: [],
  642. oldUpLoadData: [],
  643. oldForm: {},
  644. oldFormTwo: {},
  645. };
  646. },
  647. async created() {
  648. this.optionTable = await this.getColumnData(this.getColumnName(56), option);
  649. getDeptTree("096359").then(res => {
  650. this.optionTable.column.forEach(item => {
  651. if (item.prop === "deptid") {
  652. item.dicData = res.data.data;
  653. }
  654. })
  655. })
  656. //承揽人 责任人 默认20条数据
  657. getUserList().then(res => {
  658. res.data.data.map((item, index) => {
  659. if (index <= 20) {
  660. this.corpAttnDic.push(item)
  661. this.salesNameDic.push(item)
  662. }
  663. })
  664. })
  665. if (this.detailData.id) {
  666. this.id = this.detailData.id;//字符串转数字 超长用BigInt
  667. projectDetail(this.id, "0,1,2,3,4,5").then(res => {
  668. this.afterEcho(res.data.data)
  669. })
  670. } else if (this.detailData.data) {
  671. getGoodsDescList().then(res => {
  672. this.goodsDescList = res.data.data
  673. let form = this.detailData.data
  674. this.form.corpId = form.corpId
  675. this.form.corpName = form.corpName
  676. form.itemList.forEach(e => {
  677. this.goodsDescList.forEach(item => {
  678. if (e.spId == item.id) {
  679. this.data.push({
  680. strStatus: "录入",
  681. pname: item.cname,
  682. remarks: item.remarks,
  683. price: item.price,
  684. unit: item.unit,
  685. secondDisable: this.secondDisable,
  686. frequency: item.rate,
  687. projectType: this.secondDisable,
  688. $cellEdit: true
  689. });
  690. }
  691. })
  692. })
  693. })
  694. } else {
  695. //责任人 承揽人 默认当前登录人
  696. this.$set(this.formTwo, "corpAttn", this.$store.getters.userInfo.user_name)
  697. this.$set(this.formTwo, "salesName", this.$store.getters.userInfo.user_name)
  698. this.$set(this.formTwo, "debitAmount", 0)
  699. this.$set(this.formTwo, "advanceAmount", 0)
  700. this.$set(this.formTwo, "settlmentAmount", 0)
  701. this.$set(this.formTwo, "balanceAmount", 0)
  702. this.$set(this.formTwo, "createUserName", this.$store.getters.userInfo.user_name)
  703. let date = new Date();
  704. let strDate = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
  705. this.$set(this.formTwo, "createTime", strDate)
  706. //备注格式
  707. let remark = "收入:\n" +
  708. "1、业务名称:\n" +
  709. "2、费用明细:\n" +
  710. "3、业务负责人:\n" +
  711. "4、优惠合计:\n" +
  712. "5、实际收费:\n" +
  713. "6、付款人:\n" +
  714. "7、收款时间:\n" +
  715. "8、收款人:\n" +
  716. "9、收款方式:\n" +
  717. "10、备注/特别说明:";
  718. this.$nextTick(() => {
  719. this.$set(this.form, "remark", remark)
  720. })
  721. }
  722. if (this.$route.query.itemId) {
  723. this.id = this.$route.query.itemId
  724. projectDetail(this.id, "0,1,2,3,4,5").then(res => {
  725. this.afterEcho(res.data.data)
  726. })
  727. }
  728. //字典值
  729. this.getWorkDicts("source_Business").then(res => {
  730. this.sourceBusinessDic = res.data.data;
  731. })
  732. this.getWorkDicts("frequency").then(res => {
  733. this.frequencyList = res.data.data;
  734. this.findObject(this.optionTable.column, "frequency").dicData = res.data.data
  735. this.findObject(this.optionTable.column, "frequency").change = (data)=>{
  736. this.frequencyChange(data.row)
  737. }
  738. });
  739. this.getWorkDicts("second").then(res => {
  740. this.secondList = res.data.data;
  741. });
  742. },
  743. mounted() {
  744. },
  745. methods: {
  746. //明细切换tab
  747. async handleClick(tab) {
  748. if (tab.name == "first") {
  749. this.tab1 = true;
  750. this.tab2 = false;
  751. this.tab3 = false;
  752. if (this.secondDisable === 1) {
  753. this.data_two = this.data
  754. }
  755. if (this.secondDisable === 2) {
  756. this.data_three = this.data
  757. }
  758. this.secondDisable = 0
  759. await this.switchTab("first")
  760. this.data = this.data_one //切换数据
  761. getDeptTree("096359").then(res => {
  762. this.optionTable.column.forEach(item => {
  763. if (item.prop === "deptid") {
  764. item.dicData = res.data.data;
  765. }
  766. })
  767. })
  768. } else if (tab.name == "second") {
  769. this.tab1 = false;
  770. this.tab2 = true;
  771. this.tab3 = false;
  772. if (this.secondDisable === 0) {
  773. this.data_one = this.data
  774. }
  775. if (this.secondDisable === 2) {
  776. this.data_three = this.data
  777. }
  778. this.secondDisable = 1
  779. await this.switchTab("second")
  780. this.data = this.data_two
  781. } else if (tab.name == "three") {
  782. this.tab1 = false;
  783. this.tab2 = false;
  784. this.tab3 = true;
  785. if (this.secondDisable === 0) {
  786. this.data_one = this.data
  787. }
  788. if (this.secondDisable === 1) {
  789. this.data_two = this.data
  790. }
  791. this.secondDisable = 2
  792. await this.switchTab("three")
  793. this.data = this.data_three
  794. }
  795. },
  796. switchTab(val) { //换option
  797. if (val === 'first') {
  798. this.optionTable = option
  799. } else if (val === 'second') {
  800. this.optionTable = optionAdd
  801. } else if (val === 'three') {
  802. this.optionTable = optionReturn
  803. }
  804. },
  805. //责任人 远程
  806. corpAttnRemoteMethod(val) {
  807. getUserList({ realName: val }).then(res => {
  808. this.corpAttnDic = res.data.data
  809. })
  810. },
  811. //承揽人 远程
  812. salesNameRemoteMethod(val) {
  813. getUserList({ realName: val }).then(res => {
  814. this.salesNameDic = res.data.data
  815. })
  816. },
  817. value(value, row) {
  818. if (value) {
  819. row.userid = value.id
  820. row.deptid = value.deptId
  821. }
  822. },
  823. //合计
  824. totalChange(row, type) {
  825. //明细列表金额合计
  826. if (this.secondDisable === 0) {
  827. this.data_one = this.data
  828. }
  829. let amountList = this.data_one.map(item => {
  830. if (item.amount) {
  831. return parseFloat(item.amount);
  832. } else return 0
  833. });
  834. //明细列表服务费合计
  835. let serviceChargeList = this.data.map(item => {
  836. if (item.serviceCharge) {
  837. return parseFloat(item.serviceCharge);
  838. } else return 0
  839. });
  840. //明细列表成本合计
  841. let matMoneyList = this.data.map(item => {
  842. if (item.matMoney) {
  843. return parseFloat(item.matMoney);
  844. } else return 0
  845. });
  846. if (type === '金额') {
  847. if (this.formTwo.debitAmount) {
  848. if (this.formTwo.debitAmount < amountList.reduce((n, m) => n + m)) {
  849. this.$message.error("明细列表合同金额不能大于总金额!")
  850. }
  851. }
  852. }
  853. // if(type==='服务'){
  854. // this.formTwo.serviceCharge = serviceChargeList.reduce((n,m) => n + m)
  855. // }
  856. // if(type==='代垫'){
  857. // this.formTwo.matMoney = matMoneyList.reduce((n,m) => n + m)
  858. // }
  859. if (row.serviceCharge && row.matMoney && row.otheramt && row.amount) {
  860. if (row.amount < (parseFloat(row.serviceCharge) + parseFloat(row.matMoney) + parseFloat(row.otheramt))) {
  861. this.$message.error("费用之和不能超过合计金额!")
  862. row.serviceCharge = 0;
  863. row.matMoney = 0;
  864. }
  865. }
  866. },
  867. //费用计算计算
  868. costCount(row) {
  869. if (this.activeName === 'first') {
  870. if (row.serviceCharge && row.matMoney && row.otheramt) {
  871. row.amount = parseFloat(row.serviceCharge) + parseFloat(row.matMoney) + parseFloat(row.otheramt)
  872. }
  873. } else {
  874. if (row.serviceCharge && row.matMoney) {
  875. row.amount = parseFloat(row.serviceCharge) + parseFloat(row.matMoney)
  876. }
  877. }
  878. },
  879. //删除列表后面的删除按钮触发触发(row, index, done)
  880. rowDel(row, index) {
  881. this.$confirm("确定将此明细删除?", {
  882. confirmButtonText: "确定",
  883. cancelButtonText: "取消",
  884. type: "warning"
  885. }).then(() => {
  886. this.data.splice(index, 1)
  887. });
  888. },
  889. // 合同金额
  890. debitChange(val) {
  891. if (val) {
  892. if (!this.formTwo.settlmentAmount) {
  893. this.$set(this.formTwo, "balanceAmount", val)
  894. }
  895. }
  896. },
  897. //打开结算窗口
  898. beforeCloseAccount(row) {
  899. if (this.verificationData()) {
  900. this.account = row;
  901. this.accountDialog = true;
  902. }
  903. },
  904. dispatch() {
  905. console.log('paigong')
  906. },
  907. //结算
  908. closeAccount(form) {
  909. this.$refs[form].validate((valid) => {
  910. if (valid) {
  911. settleAccounts(this.account.id, 5,
  912. this.accountFormData.accountName,
  913. this.accountFormData.payTime).then(res => {
  914. if (res.data.success) {
  915. this.$message({
  916. type: "success",
  917. message: "操作成功!"
  918. });
  919. this.accountFormData = {},
  920. this.accountDialog = false;
  921. this.getProjectDetail();
  922. }
  923. })
  924. }
  925. })
  926. },
  927. cancelCloseAccount(row) {
  928. this.$confirm("确认取消结算此明细?", {
  929. confirmButtonText: "确定",
  930. cancelButtonText: "取消",
  931. type: "warning"
  932. }).then(() => {
  933. settleAccounts(row.id, 6).then(res => {
  934. if (res.data.success) {
  935. this.$message({
  936. type: "success",
  937. message: "操作成功!"
  938. });
  939. this.getProjectDetail();
  940. }
  941. })
  942. });
  943. },
  944. //请核
  945. mainCheck() {
  946. if (this.verificationData()) {
  947. this.detailsCollection()
  948. for (let i = 0; i < this.dataList.length; i++) {
  949. if (this.dataList[i].strStatus !== "结算完成") {
  950. return this.$message.error(`明细列表存在未结算数据,请检查!`);
  951. }
  952. }
  953. masterCheck(this.form.id).then(res => {
  954. if (res.data.success) {
  955. this.$message.success("操作成功!")
  956. this.getProjectDetail();
  957. }
  958. })
  959. }
  960. //
  961. },
  962. // 发送消息
  963. postMessage() {
  964. this.messageVisble = true
  965. this.$nextTick(() => {
  966. this.$refs.messagePost.init()
  967. })
  968. },
  969. closeDialog() {
  970. this.messageVisble = false
  971. },
  972. getProjectDetail() {
  973. projectDetail(this.id, "0,1,2,3,4,5").then(res => {
  974. this.afterEcho(res.data.data)
  975. })
  976. },
  977. //新增 修改
  978. editMainProject(type) {
  979. this.$refs["form"].validate((valid) => {
  980. if (valid) {
  981. this.detailsCollection()
  982. for (let i = 0; i < this.dataList.length; i++) {
  983. if (this.dataList[i].deptid === (null || "")) {
  984. return this.$message.error(`请输入明细列表第${i + 1}行的任务部门`);
  985. }
  986. if (this.dataList[i].beginTime === (null || "")) {
  987. return this.$message.error(`请输入明细列表第${i + 1}行的开始日期`);
  988. }
  989. if (this.dataList[i].actualDate === (null || "")) {
  990. return this.$message.error(`请输入明细列表第${i + 1}行的结束`);
  991. }
  992. }
  993. this.buttonLoading = true
  994. const params = {
  995. ...this.form,
  996. ...this.formTwo,
  997. itemList: this.dataList,
  998. filesList: this.upLoadData
  999. }
  1000. editMianProject(params).then(res => {
  1001. if (res.data.success) {
  1002. this.id = res.data.data
  1003. this.$message.success("操作成功!")
  1004. projectDetail(res.data.data, "0,1,2,3,4,5").then(res => {
  1005. this.afterEcho(res.data.data)
  1006. })
  1007. }
  1008. }).finally(() => {
  1009. this.buttonLoading = false
  1010. })
  1011. if (type === true) {
  1012. this.$emit("goBack");
  1013. }
  1014. }
  1015. })
  1016. },
  1017. copyData() {
  1018. if (this.verificationData()) {
  1019. delete this.form.id
  1020. delete this.formTwo.id
  1021. }
  1022. },
  1023. createData() {
  1024. if (this.verificationData()) {
  1025. this.$confirm("确定创建新的单据吗?", "提示", {
  1026. confirmButtonText: "保存",
  1027. cancelButtonText: "取消",
  1028. type: "warning",
  1029. }).then(() => {
  1030. this.form = {}
  1031. this.oldForm = {}
  1032. this.formTwo = {}
  1033. this.oldFormTwo = {}
  1034. this.dataList = []
  1035. this.oldData = []
  1036. this.upLoadData = []
  1037. this.oldUpLoadData = []
  1038. this.$set(this.formTwo, "corpAttn", this.$store.getters.userInfo.user_name)
  1039. this.$set(this.formTwo, "salesName", this.$store.getters.userInfo.user_name)
  1040. this.$set(this.formTwo, "debitAmount", 0)
  1041. this.$set(this.formTwo, "advanceAmount", 0)
  1042. this.$set(this.formTwo, "settlmentAmount", 0)
  1043. this.$set(this.formTwo, "balanceAmount", 0)
  1044. this.$set(this.formTwo, "createUserName", this.$store.getters.userInfo.user_name)
  1045. let date = new Date();
  1046. let strDate = date.getFullYear() + "-" + (date.getsecond() + 1) + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
  1047. this.$set(this.formTwo, "createTime", strDate)
  1048. })
  1049. }
  1050. },
  1051. //明细合集
  1052. detailsCollection() {
  1053. if (this.secondDisable === 0) {
  1054. this.data = this.data_one
  1055. }
  1056. if (this.secondDisable === 1) {
  1057. this.data = this.data_two
  1058. }
  1059. if (this.secondDisable === 2) {
  1060. this.data = this.data_three
  1061. }
  1062. this.dataList = []
  1063. this.dataList.push(...this.data_one, ...this.data_two, ...this.data_three)
  1064. },
  1065. afterEcho(data) {
  1066. this.form = data;
  1067. this.viewDisabled = this.form.status !== 0 ? true : false
  1068. this.option.column.forEach(item => {
  1069. if (item.prop == "cname") {
  1070. this.$set(item, "disabled", this.viewDisabled)
  1071. }
  1072. })
  1073. this.formTwo = Object.assign({}, data);
  1074. delete this.formTwo.cname;
  1075. delete this.formTwo.corpId;
  1076. delete this.formTwo.corpAttn;
  1077. delete this.formTwo.salesName;
  1078. delete this.formTwo.sourceBusiness;
  1079. delete this.formTwo.remark;
  1080. this.oldForm = Object.assign({}, data);
  1081. this.oldFormTwo = Object.assign({}, data);
  1082. if (data.itemList) {
  1083. this.dataList = data.itemList;
  1084. this.oldData = this.deepClone(data.itemList)
  1085. //根据状态区分三种明细
  1086. this.data_one = this.dataList.filter(item => item.projectType === 0)
  1087. this.data_two = this.dataList.filter(item => item.projectType === 1)
  1088. this.data_three = this.dataList.filter(item => item.projectType === 2)
  1089. //判断当前所处哪个明细下 给data赋值
  1090. if (this.secondDisable === 0) {
  1091. this.data = this.data_one
  1092. }
  1093. if (this.secondDisable === 1) {
  1094. this.data = this.data_two
  1095. }
  1096. if (this.secondDisable === 2) {
  1097. this.data = this.data_three
  1098. }
  1099. }
  1100. if (data.filesList) {
  1101. this.upLoadData = data.filesList
  1102. this.oldUpLoadData = this.deepClone(data.filesList)
  1103. }
  1104. },
  1105. verificationData() {
  1106. this.detailsCollection()
  1107. if (contrastObj(this.form, this.oldForm) || contrastObj(this.formTwo, this.oldFormTwo) || contrastList2(this.dataList, this.oldData)
  1108. || contrastList2(this.upLoadData, this.oldUpLoadData)
  1109. ) {
  1110. this.$confirm("数据发生变化,请先提交保存!", "提示", {
  1111. confirmButtonText: "保存",
  1112. cancelButtonText: "取消",
  1113. type: "warning",
  1114. }).then(() => {
  1115. this.editMainProject()
  1116. }).catch(() => {
  1117. return false
  1118. })
  1119. } else {
  1120. return true
  1121. }
  1122. },
  1123. //点击修改或保存时触发
  1124. rowCellTwo(row, index) {
  1125. this.$refs.crud.rowCell(row, index);
  1126. },
  1127. //选择时
  1128. selectionChange(row) {
  1129. this.crudSelection = row;
  1130. },
  1131. //新增修改时保存触发
  1132. rowSave(row, done, loading) {
  1133. done()
  1134. },
  1135. rowUpdate(row, index, done, loading) {
  1136. done(row)
  1137. },
  1138. searchChange(params, done) {
  1139. this.getList(this.page, params);
  1140. done();
  1141. },
  1142. sizeChange(val) {
  1143. this.page.pageSize = val;
  1144. this.getList();
  1145. },
  1146. currentChange(val) {
  1147. this.page.currentPage = val;
  1148. this.getList();
  1149. },
  1150. frequencyChange(row) {
  1151. row.second = null
  1152. },
  1153. //上传文件保存
  1154. upLoadSave(row, done, loading) {
  1155. this.upLoadData.push(row)
  1156. done()
  1157. },
  1158. //修改附件上传触发
  1159. upLoadUpdate(row, done) {
  1160. done(row);
  1161. },
  1162. //删除附件上传触发
  1163. upLoadDel(row, index,) {
  1164. this.$confirm("确定将选择数据删除?", {
  1165. confirmButtonText: "确定",
  1166. cancelButtonText: "取消",
  1167. type: "warning"
  1168. }).then(() => {
  1169. if (row.id) {
  1170. corpsbank(row.id).then(res => {
  1171. if (res.data.success) {
  1172. this.$message({
  1173. type: "success",
  1174. message: "操作成功!"
  1175. });
  1176. this.bankOfDepositData.splice(index, 1);
  1177. }
  1178. })
  1179. } else {
  1180. this.$message({
  1181. type: "success",
  1182. message: "操作成功!"
  1183. });
  1184. this.bankOfDepositData.splice(index, 1);
  1185. }
  1186. })
  1187. },
  1188. //服务窗口事件
  1189. serviceNodeClick(data) {
  1190. this.serviceTreeDeptId = data.id;
  1191. this.serviceOnLoad(this.servicePage);
  1192. },
  1193. serviceRefreshChange() {
  1194. this.serviceOnLoad(this.servicePage, this.serviceSearch)
  1195. },
  1196. serviceSearchChange(params, done) {
  1197. this.serviceOnLoad(this.servicePage, params)
  1198. done();
  1199. },
  1200. serviceSelectionChange(row) {
  1201. this.serviceSelectList = row;
  1202. },
  1203. serviceOnLoad(page, params = {}) {
  1204. this.serviceLoading = true;
  1205. getServiceProjectList(page.currentPage, page.pageSize, params, this.serviceTreeDeptId).then(res => {
  1206. this.serviceData = res.data.data.records
  1207. this.servicePage.total = res.data.data.total
  1208. this.serviceLoading = false
  1209. })
  1210. },
  1211. serviceConfirm() {
  1212. if (this.serviceSelectList.length != 0) {
  1213. this.serviceSelectList.forEach((item) => {
  1214. const params = {
  1215. strStatus: "录入",
  1216. pname: item.cname,
  1217. remarks: item.remarks,
  1218. price: item.price,
  1219. unit: item.unit,
  1220. secondDisable: this.secondDisable,
  1221. frequency: item.rate,
  1222. projectType: this.secondDisable
  1223. }
  1224. this.$refs.crud.rowCellAdd(params);
  1225. this.$refs.crud.rowCell(item, this.optionFrom.length - 1)
  1226. })
  1227. }
  1228. this.serviceSelectList = []
  1229. this.serviceDialog = false
  1230. this.$message({
  1231. type: "success",
  1232. message: "导入成功!"
  1233. });
  1234. },
  1235. //用户窗口事件
  1236. selectUser(row) {
  1237. this.userDialog = true
  1238. this.detailsSelect = row.$index;
  1239. },
  1240. userSearchChange(params, done) {
  1241. this.userOnLoad(this.userPage, params);
  1242. done()
  1243. },
  1244. userSearchReset() {
  1245. },
  1246. userRefreshChange() {
  1247. this.userOnLoad(this.userPage)
  1248. },
  1249. userSelectionChange(row) {
  1250. this.userSelection = row;
  1251. },
  1252. userOnLoad(page, params = {}) {
  1253. this.userLoading = true;
  1254. getList(page.currentPage, page.pageSize, params, this.userTreeDeptId).then(res => {
  1255. this.userDataList = res.data.data.records
  1256. this.userPage.total = res.data.data.total
  1257. this.userLoading = false;
  1258. });
  1259. },
  1260. userNodeClick(data) {
  1261. this.userTreeDeptId = data.id;
  1262. this.userOnLoad(this.userPage);
  1263. },
  1264. //确定
  1265. userConfirm() {
  1266. if (this.userSelection) {
  1267. this.data[this.detailsSelect].userid = this.userSelection[0].id;
  1268. this.$set(this.data[this.detailsSelect], 'userName', this.userSelection[0].realName)
  1269. this.userDialog = !this.userDialog
  1270. }
  1271. },
  1272. dialogProcessClose() {
  1273. this.processDialog = false
  1274. this.getProjectDetail()
  1275. },
  1276. //返回主营项目列表
  1277. backToList() {
  1278. this.detailsCollection()
  1279. if (contrastObj(this.form, this.oldForm) || contrastObj(this.formTwo, this.oldFormTwo) || contrastList2(this.dataList, this.oldData)
  1280. || contrastList2(this.upLoadData, this.oldUpLoadData)
  1281. ) {
  1282. this.$confirm("当前页面有未保存数据,是否保存数据?", "提示", {
  1283. confirmButtonText: "保存",
  1284. cancelButtonText: "取消",
  1285. type: "warning",
  1286. }).then(() => {
  1287. this.editMainProject(true)
  1288. }).catch(() => {
  1289. this.$emit("goBack");
  1290. })
  1291. } else {
  1292. this.$emit("goBack");
  1293. }
  1294. },
  1295. //列保存触发
  1296. async saveColumn() {
  1297. const inSave = await this.saveColumnData(
  1298. this.getColumnName(56),
  1299. this.optionTable
  1300. );
  1301. if (inSave) {
  1302. this.$message.success("保存成功");
  1303. //关闭窗口
  1304. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  1305. }
  1306. },
  1307. async resetColumn() {
  1308. const inSave = await this.delColumnData(
  1309. this.getColumnName(56),
  1310. option
  1311. );
  1312. if (inSave) {
  1313. this.$message.success("重置成功");
  1314. this.optionTable = option;
  1315. //关闭窗口
  1316. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  1317. }
  1318. },
  1319. //1.0版本注释内容
  1320. // operationDetailList(itemList){
  1321. // this.data = itemList;
  1322. // this.oldData = this.deepClone(itemList)
  1323. // let status = [];
  1324. // this.data.forEach(item =>{
  1325. // item.status == 0 ? status.push(true) : status.push(false)
  1326. // })
  1327. // //如果 明细列表存在 请核之后的状态 禁止编辑一些输入框
  1328. // if(status.findIndex(item => item == false) == 0){
  1329. // this.basicData.column.forEach(item =>{
  1330. // if(item.prop == "code" || item.prop == "cname" || item.prop == "corpId" || item.prop == "debitAmount"){
  1331. // item.disabled = true
  1332. // this.configuration.disabled = true
  1333. // }
  1334. // })
  1335. // }else{
  1336. // this.basicData.column.forEach(item =>{
  1337. // if(item.prop == "code" || item.prop == "cname" || item.prop == "corpId" || item.prop == "debitAmount"){
  1338. // item.disabled = false
  1339. // this.configuration.disabled = false
  1340. // }
  1341. // })
  1342. // }
  1343. // },
  1344. // openPleaseCheckDialog(){
  1345. // this.processDialog = true;
  1346. // this.itemId = this.crudSelection[0].id //记得不能写死
  1347. // },
  1348. // //请核之前
  1349. // beforePleaseCheck(){
  1350. // if(this.crudSelection){
  1351. // let id = [];
  1352. // let result = [];
  1353. // this.crudSelection.forEach(item=>{
  1354. // // 新录入状态下 才可提交审核
  1355. // item.id ? id.push(true) : id.push(false) //如果没有id并且为新录入 提示保存
  1356. // item.strStatus === "录入" ? result.push(true) : result.push(false) //判断所有的是否为录入状态
  1357. // })
  1358. // if(id.findIndex(item => item != true) == -1){
  1359. // if(result.findIndex(item => item != true) == -1){
  1360. // if(contrastObj(this.form,this.oldForm) || contrastList2(this.data,this.oldData)){ //判断是否改动过此页面
  1361. // this.$confirm("您已改动此页面,请先保存之后在请核?", "提示", {
  1362. // confirmButtonText: "保存",
  1363. // cancelButtonText: "取消",
  1364. // type: "warning",
  1365. // }).then(() => {
  1366. // this.editMainProject();
  1367. // }).catch(()=>{
  1368. // return
  1369. // })
  1370. // }else{
  1371. // this.pleaseCheck()
  1372. // // this.openPleaseCheckDialog();
  1373. // }
  1374. // }else{
  1375. // this.$message({
  1376. // type: "error",
  1377. // message: "请核数据中存在已请核数据!"
  1378. // });
  1379. // return
  1380. // }
  1381. // }else{
  1382. // this.$confirm("列表内存在新录入数据,是否先保存此数据?", {
  1383. // confirmButtonText: "确定",
  1384. // cancelButtonText: "取消",
  1385. // type: "warning"
  1386. // }).then(() => {
  1387. // this.editMainProject();
  1388. // })
  1389. // }
  1390. // }
  1391. // },
  1392. // //请核
  1393. // pleaseCheck(){
  1394. // this.crudSelection.forEach(item =>{
  1395. // updateItemStatus(this.data[item.$index].id,1).then(res =>{
  1396. //
  1397. // })
  1398. // this.$message({
  1399. // type: "success",
  1400. // message: "请核成功!"
  1401. // });
  1402. // //刷新列表
  1403. // this.getProjectDetail();
  1404. // })
  1405. // },
  1406. },
  1407. filters: {
  1408. frequencyFormat(val, list) {
  1409. let name;
  1410. list.forEach(e => {
  1411. if (e.dictKey == val) {
  1412. name = e.dictValue
  1413. }
  1414. })
  1415. return name;
  1416. }
  1417. },
  1418. watch: {
  1419. dataList: function (list) {
  1420. }
  1421. }
  1422. };
  1423. </script>
  1424. <style scoped lang="scss">
  1425. .main-head {
  1426. position: fixed;
  1427. top: 105px;
  1428. width: 100%;
  1429. margin-left: -10px;
  1430. height: 62px;
  1431. background: #ffffff;
  1432. box-shadow: 0 4px 12px 0px rgba(232, 232, 235, 1);
  1433. z-index: 999;
  1434. }
  1435. .upper_right_button {
  1436. display: flex;
  1437. position: fixed;
  1438. right: 12px;
  1439. top: 47px;
  1440. }
  1441. .main-back {
  1442. cursor: pointer;
  1443. line-height: 62px;
  1444. font-size: 16px;
  1445. color: #323233;
  1446. font-weight: 400;
  1447. }
  1448. .required_fields {
  1449. color: #F56C6C;
  1450. display: inline-block;
  1451. width: 7%
  1452. }
  1453. .avue-tree {
  1454. overflow: hidden;
  1455. max-height: 660px;
  1456. }
  1457. ::v-deep .el-form-item {
  1458. margin-bottom: 0;
  1459. }
  1460. ::v-deep .el-form-item__content {
  1461. line-height: 32px;
  1462. }
  1463. .trading-form ::v-deep .el-form-item {
  1464. margin-bottom: 8px !important;
  1465. }
  1466. .landConFrom-input {
  1467. display: flex;
  1468. justify-content: center;
  1469. }
  1470. </style>