receiptDetailsPage.vue 12 KB

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