receiptSettleDetailsPage.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  1. <template>
  2. <div class="borderless">
  3. <div class="main-head">
  4. <div class="main-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. <el-button type="info"
  9. class="el-button--small-yh add-customer-btn-two"
  10. :disabled="true"
  11. @click.stop="">请核
  12. </el-button>
  13. <el-button class="el-button--small-yh add-customer-btn" type="primary"
  14. @click.stop="editFinance "
  15. >{{this.id?"确认修改" :"确认结算"}}
  16. </el-button>
  17. </div>
  18. </div>
  19. <div style="margin-top: 60px">
  20. <containerTitle title="基础信息"></containerTitle>
  21. <basic-container>
  22. <el-form :model="form" ref="form" label-width="130px">
  23. <el-row>
  24. <el-col v-for="(item, index) in basicData.column" :span="item.span?item.span:8" :key="index">
  25. <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
  26. <el-date-picker v-if="item.type === 'date'" style="width: 100%;" v-model="form[item.prop]" size="small" :disabled="item.disabled?true:false" type="date" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
  27. <el-select v-else-if="item.type === 'select'" style="width: 100%" size="small" placeholder="请选择" clearable filterable></el-select>
  28. <selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]" :configuration="configuration"/>
  29. <el-select v-else-if="item.prop === 'currency'" style="width: 100%" v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
  30. <el-option v-for="(item,index) in currencyDic" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
  31. </el-select>
  32. <el-select v-else-if="item.prop === 'financeStatus'" style="width: 100%" v-model="form[item.prop]" size="small" placeholder="请选择" clearable filterable>
  33. <el-option
  34. v-for="item in financeStatusDic"
  35. :key="item.value"
  36. :label="item.label"
  37. :value="item.value">
  38. </el-option>
  39. </el-select>
  40. <el-input type="age" v-else-if="item.prop === 'exchangeRate'" v-model="form[item.prop]" size="small" autocomplete="off" placeholder="请输入">
  41. <template slot="append">%</template>
  42. </el-input>
  43. <el-input type="textarea" v-else-if="(item.prop === 'remark')" v-model="form[item.prop]" size="small" autocomplete="off" placeholder="请输入"></el-input>
  44. <el-input type="age" v-else v-model="form[item.prop]" size="small" :disabled="item.disabled?true:false" autocomplete="off" placeholder="请输入"></el-input>
  45. </el-form-item>
  46. </el-col>
  47. </el-row>
  48. </el-form>
  49. </basic-container>
  50. <basic-container>
  51. <avue-crud :option="option"
  52. :data="dataList"
  53. ref="crud"
  54. v-model="form"
  55. :page.sync="page"
  56. @search-reset="searchReset"
  57. @selection-change="selectionChange"
  58. @current-change="currentChange"
  59. @size-change="sizeChange"
  60. @refresh-change="refreshChange">
  61. <template slot="menuLeft">
  62. <el-button type="primary"
  63. size="small"
  64. icon="el-icon-shopping-cart-2"
  65. @click=""
  66. >选择销售合同
  67. </el-button>
  68. </template>
  69. <template slot="menuRight">
  70. <el-button type="info"
  71. size="small"
  72. @click="">发送收款信息
  73. </el-button>
  74. </template>
  75. <template slot-scope="scope" slot="menu">
  76. <el-button
  77. type="text"
  78. icon="el-icon-view"
  79. size="small"
  80. @click.stop=""
  81. >费用确认
  82. </el-button>
  83. <el-button
  84. type="text"
  85. icon="el-icon-edit"
  86. size="small"
  87. @click.stop=""
  88. >移除数据
  89. </el-button>
  90. </template>
  91. </avue-crud>
  92. </basic-container>
  93. </div>
  94. </div>
  95. </template>
  96. <script>
  97. import option from "./configuration/detailsPage.json";
  98. import { getDetail,editFinance } from "@/api/financialManagement/financialManagement"
  99. import {getSysNo} from "@/api/importTrade/purchase";
  100. import { getUserInfo } from "@/api/system/user";
  101. import { contrastObj,contrastList } from "@/util/contrastData";
  102. export default {
  103. name: "receiptDetailsPage",
  104. props: {
  105. detailData: {
  106. type: Object
  107. }
  108. },
  109. data() {
  110. return {
  111. form: {},
  112. option: option,
  113. id:'',
  114. dataList: [],
  115. currencyDic:[],
  116. page: {
  117. pageSize: 10,
  118. pagerCount: 5,
  119. total: 0,
  120. },
  121. query:{},
  122. //新旧数据对比
  123. oldForm:{},
  124. oldItemList:[],
  125. //客户组件配置控制
  126. configuration:{
  127. multipleChoices:false,
  128. multiple:false,
  129. disabled:false,
  130. searchShow:true,
  131. collapseTags:false,
  132. placeholder:'请点击右边按钮选择',
  133. dicData:[]
  134. },
  135. financeStatusDic:[{
  136. value: '正常',
  137. label: '正常'
  138. },
  139. {
  140. value: '停用',
  141. label: '停用'
  142. }],
  143. basicData: {
  144. column: [
  145. {
  146. label: '系统号',
  147. prop: 'sysNo',
  148. disabled:true,
  149. rules: [
  150. {
  151. required: true,
  152. message: ' ',
  153. trigger: 'blur'
  154. }
  155. ]
  156. }, {
  157. label: '合同号',
  158. prop: 'srcOrderno',
  159. rules: [
  160. {
  161. required: true,
  162. message: ' ',
  163. trigger: 'blur'
  164. }
  165. ]
  166. },{
  167. label: '客户名称',
  168. prop: 'corpId',
  169. rules: [
  170. {
  171. required: false,
  172. message: ' ',
  173. trigger: 'blur'
  174. }
  175. ]
  176. }, {
  177. label: '金额',
  178. prop: 'amount',
  179. rules: [
  180. {
  181. required: false,
  182. message: ' ',
  183. trigger: 'blur'
  184. }
  185. ]
  186. },
  187. {
  188. label: '币别',
  189. prop: 'currency',
  190. rules: [
  191. {
  192. required: false,
  193. message: ' ',
  194. trigger: 'blur'
  195. }
  196. ]
  197. },
  198. {
  199. label: '汇率',
  200. prop: 'exchangeRate',
  201. rules: [
  202. {
  203. required: false,
  204. message: ' ',
  205. trigger: 'blur'
  206. }
  207. ]
  208. },
  209. {
  210. label: '银行名称',
  211. prop: 'accountBank',
  212. rules: [
  213. {
  214. required: false,
  215. message: ' ',
  216. trigger: 'blur'
  217. }
  218. ]
  219. },
  220. {
  221. label: '银行户头',
  222. prop: 'accountName',
  223. rules: [
  224. {
  225. required: false,
  226. message: ' ',
  227. trigger: 'blur'
  228. }
  229. ]
  230. }, {
  231. label: '银行账号',
  232. prop: 'accountNo',
  233. rules: [
  234. {
  235. required: false,
  236. message: ' ',
  237. trigger: 'blur'
  238. }
  239. ]
  240. }, {
  241. label: '收款日期',
  242. prop: 'settlementDate',
  243. type:'date',
  244. rules: [
  245. {
  246. required: false,
  247. message: ' ',
  248. trigger: 'blur'
  249. }
  250. ]
  251. }, {
  252. label: '制单人',
  253. prop: 'createUserName',
  254. disabled:true,
  255. rules: [
  256. {
  257. required: false,
  258. message: ' ',
  259. trigger: 'blur'
  260. }
  261. ]
  262. },{
  263. label: '制单日期',
  264. prop: 'createTime',
  265. disabled:true,
  266. type:'date',
  267. rules: [
  268. {
  269. required: false,
  270. message: ' ',
  271. trigger: 'blur'
  272. }
  273. ]
  274. }, {
  275. label: '单据状态',
  276. prop: 'financeStatus',
  277. },
  278. {
  279. label: '备注',
  280. prop: 'remark',
  281. span:24,
  282. rules: [
  283. {
  284. required: false,
  285. message: ' ',
  286. trigger: 'blur'
  287. }
  288. ]
  289. },
  290. ],
  291. },
  292. }
  293. },
  294. created() {
  295. //币别
  296. this.getWorkDicts("currency").then(res =>{
  297. this.currencyDic = res.data.data
  298. })
  299. if (this.detailData.id) {
  300. this.id = BigInt(this.detailData.id);//字符串转数字 超长用BigInt
  301. getDetail(this.id).then(res => {
  302. this.form = res.data.data;
  303. this.oldForm = Object.assign({},res.data.data);
  304. this.configuration.dicData = res.data.data.customerModel;
  305. if(res.data.data.itemsList){
  306. this.dataList = res.data.data.itemsList
  307. this.oldItemList = this.deepClone(res.data.data.itemsList)
  308. }
  309. })
  310. }else{
  311. getSysNo("CW-SK").then(res =>{
  312. this.$set(this.form,"sysNo", res.data.data)
  313. let date = new Date();
  314. let strDate = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
  315. this.$set(this.form,"createTime",strDate)
  316. })
  317. getUserInfo().then(res =>{
  318. this.$set(this.form,"createUserName", res.data.data.name)
  319. })
  320. }
  321. },
  322. mounted() {
  323. option.height = window.innerHeight - 640 ;
  324. },
  325. methods: {
  326. searchReset() {
  327. console.log('1')
  328. },
  329. selectionChange() {
  330. console.log('1')
  331. },
  332. currentChange() {
  333. console.log('1')
  334. },
  335. sizeChange() {
  336. console.log('1')
  337. },
  338. refreshChange() {
  339. console.log('1')
  340. },
  341. editFinance(status){
  342. this.$refs["form"].validate((valid) => {
  343. if(valid){
  344. const params = {
  345. ...this.form,
  346. billType:"收费",
  347. itemsList: this.dataList,
  348. }
  349. editFinance(params).then(res =>{
  350. if(res.data.success){
  351. this.$message.success("操作成功!")
  352. }
  353. })
  354. if(status === true){
  355. this.$emit("goBack");
  356. }
  357. }
  358. })
  359. },
  360. backToList(){
  361. this.$confirm("是否保存当前页面?", "提示", {
  362. confirmButtonText: "保存",
  363. cancelButtonText: "取消",
  364. type: "warning",
  365. }).then(() => {
  366. this.editFinance(true)
  367. }).catch(() => {
  368. this.$emit("goBack");
  369. })
  370. }
  371. }
  372. }
  373. </script>
  374. <style scoped>
  375. ::v-deep .el-form-item {
  376. margin-bottom: 0;
  377. }
  378. .main-head {
  379. position: fixed;
  380. top: 105px;
  381. width: 100%;
  382. margin-left: -10px;
  383. height: 62px;
  384. background: #ffffff;
  385. box-shadow: 0 4px 12px 0px rgba(232, 232, 235, 1);
  386. z-index: 999;
  387. }
  388. .main-back {
  389. cursor: pointer;
  390. line-height: 62px;
  391. font-size: 16px;
  392. color: #323233;
  393. font-weight: 400;
  394. }
  395. .add-customer-btn-two {
  396. position: fixed;
  397. right: 150px;
  398. top: 115px;
  399. }
  400. .add-customer-btn {
  401. position: fixed;
  402. right: 36px;
  403. top: 115px;
  404. }
  405. </style>