receiptDetailsPage.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  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. export default {
  108. data() {
  109. return {
  110. form: {},
  111. option: option,
  112. id:'',
  113. dataList: [],
  114. currencyDic:[],
  115. page: {
  116. pageSize: 10,
  117. pagerCount: 5,
  118. total: 0,
  119. },
  120. query:{},
  121. //客户组件配置控制
  122. configuration:{
  123. multipleChoices:false,
  124. multiple:false,
  125. disabled:false,
  126. searchShow:false,
  127. collapseTags:false,
  128. placeholder:'请点击右边按钮选择',
  129. dicData:[]
  130. },
  131. financeStatusDic:[{
  132. value: '正常',
  133. label: '正常'
  134. },
  135. {
  136. value: '停用',
  137. label: '停用'
  138. }],
  139. basicData: {
  140. column: [
  141. {
  142. label: '系统号',
  143. prop: 'sysNo',
  144. disabled:true,
  145. rules: [
  146. {
  147. required: true,
  148. message: ' ',
  149. trigger: 'blur'
  150. }
  151. ]
  152. }, {
  153. label: '合同号',
  154. prop: 'srcOrderno',
  155. rules: [
  156. {
  157. required: true,
  158. message: ' ',
  159. trigger: 'blur'
  160. }
  161. ]
  162. },{
  163. label: '客户名称',
  164. prop: 'corpId',
  165. rules: [
  166. {
  167. required: false,
  168. message: ' ',
  169. trigger: 'blur'
  170. }
  171. ]
  172. }, {
  173. label: '金额',
  174. prop: 'amount',
  175. rules: [
  176. {
  177. required: false,
  178. message: ' ',
  179. trigger: 'blur'
  180. }
  181. ]
  182. },
  183. {
  184. label: '币别',
  185. prop: 'currency',
  186. rules: [
  187. {
  188. required: false,
  189. message: ' ',
  190. trigger: 'blur'
  191. }
  192. ]
  193. },
  194. {
  195. label: '汇率',
  196. prop: 'exchangeRate',
  197. rules: [
  198. {
  199. required: false,
  200. message: ' ',
  201. trigger: 'blur'
  202. }
  203. ]
  204. },
  205. {
  206. label: '银行名称',
  207. prop: 'accountBank',
  208. rules: [
  209. {
  210. required: false,
  211. message: ' ',
  212. trigger: 'blur'
  213. }
  214. ]
  215. },
  216. {
  217. label: '银行户头',
  218. prop: 'accountName',
  219. rules: [
  220. {
  221. required: false,
  222. message: ' ',
  223. trigger: 'blur'
  224. }
  225. ]
  226. }, {
  227. label: '银行账号',
  228. prop: 'accountNo',
  229. rules: [
  230. {
  231. required: false,
  232. message: ' ',
  233. trigger: 'blur'
  234. }
  235. ]
  236. }, {
  237. label: '收款日期',
  238. prop: 'settlementDate',
  239. type:'date',
  240. rules: [
  241. {
  242. required: false,
  243. message: ' ',
  244. trigger: 'blur'
  245. }
  246. ]
  247. }, {
  248. label: '制单人',
  249. prop: 'createUserName',
  250. disabled:true,
  251. rules: [
  252. {
  253. required: false,
  254. message: ' ',
  255. trigger: 'blur'
  256. }
  257. ]
  258. },{
  259. label: '制单日期',
  260. prop: 'createTime',
  261. disabled:true,
  262. type:'date',
  263. rules: [
  264. {
  265. required: false,
  266. message: ' ',
  267. trigger: 'blur'
  268. }
  269. ]
  270. }, {
  271. label: '单据状态',
  272. prop: 'financeStatus',
  273. },
  274. {
  275. label: '备注',
  276. prop: 'remark',
  277. span:24,
  278. rules: [
  279. {
  280. required: false,
  281. message: ' ',
  282. trigger: 'blur'
  283. }
  284. ]
  285. },
  286. ],
  287. },
  288. }
  289. },
  290. created() {
  291. //币别
  292. this.getWorkDicts("currency").then(res =>{
  293. this.currencyDic = res.data.data
  294. })
  295. if (this.$route.query.id) {
  296. this.id = BigInt(this.$route.query.id);//字符串转数字 超长用BigInt
  297. getDetail(this.id).then(res => {
  298. this.form = res.data.data;
  299. this.configuration.dicData = res.data.data.customerModel;
  300. this.dataList = res.data.data.itemsList
  301. })
  302. }else{
  303. getSysNo("CW-SK").then(res =>{
  304. this.$set(this.form,"sysNo", res.data.data)
  305. let date = new Date();
  306. let strDate = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
  307. this.$set(this.form,"createTime",strDate)
  308. })
  309. getUserInfo().then(res =>{
  310. this.$set(this.form,"createUserName", res.data.data.name)
  311. })
  312. }
  313. },
  314. mounted() {
  315. option.height = window.innerHeight - 640 ;
  316. },
  317. methods: {
  318. searchReset() {
  319. console.log('1')
  320. },
  321. selectionChange() {
  322. console.log('1')
  323. },
  324. currentChange() {
  325. console.log('1')
  326. },
  327. sizeChange() {
  328. console.log('1')
  329. },
  330. refreshChange() {
  331. console.log('1')
  332. },
  333. editFinance(){
  334. this.$refs["form"].validate((valid) => {
  335. if(valid){
  336. const params = {
  337. ...this.form,
  338. billType:"收费",
  339. itemsList: this.dataList,
  340. }
  341. editFinance(params).then(res =>{
  342. if(res.data.success){
  343. this.$message.success("操作成功!")
  344. }
  345. })
  346. }
  347. })
  348. },
  349. backToList(){
  350. this.$router.$avueRouter.closeTag();
  351. this.$router.push({
  352. path: '/financialManagement/receipt',
  353. query: {}
  354. });
  355. }
  356. }
  357. }
  358. </script>
  359. <style scoped>
  360. ::v-deep .el-form-item {
  361. margin-bottom: 0;
  362. }
  363. .main-head {
  364. position: fixed;
  365. top: 105px;
  366. width: 100%;
  367. margin-left: -10px;
  368. height: 62px;
  369. background: #ffffff;
  370. box-shadow: 0 4px 12px 0px rgba(232, 232, 235, 1);
  371. z-index: 999;
  372. }
  373. .main-back {
  374. cursor: pointer;
  375. line-height: 62px;
  376. font-size: 16px;
  377. color: #323233;
  378. font-weight: 400;
  379. }
  380. .add-customer-btn-two {
  381. position: fixed;
  382. right: 150px;
  383. top: 115px;
  384. }
  385. .add-customer-btn {
  386. position: fixed;
  387. right: 36px;
  388. top: 115px;
  389. }
  390. </style>