paymentSlip.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. <template>
  2. <div class="paymentSlipEdit-wrap">
  3. <a-page-header :ghost="false" @back="handleBack" >
  4. <!-- 自定义的二级文字标题 -->
  5. <template slot="subTitle">
  6. <a id="paymentSlipEdit-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
  7. </template>
  8. <!-- 操作区,位于 title 行的行尾 -->
  9. <template slot="extra">
  10. <a-button key="2" id="paymentSlipEdit-preview-btn">打印预览</a-button>
  11. <a-button key="1" type="primary" id="paymentSlipEdit-print-btn">快速打印</a-button>
  12. </template>
  13. </a-page-header>
  14. <!-- 内容 -->
  15. <a-page-header title="客户:抢个汽修厂" ></a-page-header>
  16. <!-- 付款信息 -->
  17. <a-card :bordered="false" class="paymentSlipEdit-cont">
  18. <a-collapse :activeKey="['1']">
  19. <a-collapse-panel key="1" header="付款信息">
  20. <a-form-model
  21. id="paymentSlipEdit-form"
  22. ref="ruleForm"
  23. :model="form"
  24. :rules="rules"
  25. :label-col="formItemLayout.labelCol"
  26. :wrapper-col="formItemLayout.wrapperCol" >
  27. <a-row :gutter="15">
  28. <a-col :span="8">
  29. <a-form-model-item label="总计应付金额" prop="name">
  30. <a-input-number id="paymentSlipEdit-name" disabled v-model="form.name" :precision="0" :min="0" :max="999999" placeholder="请输入总计应付金额" style="width: 90%;" /> 元
  31. </a-form-model-item>
  32. </a-col>
  33. </a-row>
  34. <a-row :gutter="15">
  35. <a-col :span="8">
  36. <a-form-model-item label="付款金额" prop="mobile">
  37. <a-input-number id="paymentSlipEdit-mobile" v-model="form.mobile" :precision="0" :min="0" :max="999999" placeholder="请输入付款金额" style="width: 90%;" /> 元
  38. </a-form-model-item>
  39. </a-col>
  40. <a-col :span="8">
  41. <a-form-model-item label="折让金额" prop="name">
  42. <a-input-number id="paymentSlipEdit-name" v-model="form.name" :precision="0" :min="0" :max="999999" placeholder="请输入折让金额" style="width: 90%;" /> 元
  43. </a-form-model-item>
  44. </a-col>
  45. <a-col :span="8">
  46. <a-form-model-item label="结算方式" prop="paymentType">
  47. <v-select
  48. code="DISPATCH_FASHION"
  49. id="paymentSlipEdit-paymentType"
  50. v-model="form.paymentType"
  51. allowClear
  52. placeholder="请选择结算方式"
  53. ></v-select>
  54. </a-form-model-item>
  55. </a-col>
  56. </a-row>
  57. <a-row :gutter="15">
  58. <a-col :span="8">
  59. <a-form-model-item label="实付金额" prop="name">
  60. <a-input-number id="paymentSlipEdit-name" disabled v-model="form.name" :precision="0" :min="0" :max="999999" placeholder="请输入实付金额" style="width: 90%;" /> 元
  61. </a-form-model-item>
  62. </a-col>
  63. <a-col :span="16">
  64. <a-form-model-item label="备注" prop="remarks" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
  65. <a-input id="paymentSlipEdit-remarks" :maxLength="500" v-model="form.remarks" placeholder="请输入备注(最多500个字符)" allowClear />
  66. </a-form-model-item>
  67. </a-col>
  68. </a-row>
  69. </a-form-model>
  70. </a-collapse-panel>
  71. </a-collapse>
  72. </a-card>
  73. <!-- 付款明细 -->
  74. <a-card :bordered="false" class="paymentSlipEdit-cont">
  75. <a-collapse :activeKey="['1']">
  76. <a-collapse-panel key="1">
  77. <template slot="header">
  78. 付款明细
  79. <a-button size="small" class="add-bill-btn" id="paymentSlipEdit-bill-btn" @click.stop="handleBill" style="margin-left: 15px;">添加单据</a-button>
  80. <a-button size="small" class="amount-btn" id="paymentSlipEdit-amount-btn" @click.stop="handleAmount" style="margin-left: 15px;">分配结算金额</a-button>
  81. </template>
  82. <!-- 付款明细 -->
  83. <div>
  84. <!-- 搜索条件 -->
  85. <div class="table-page-search-wrapper">
  86. <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
  87. <a-row :gutter="15">
  88. <a-col :md="6" :sm="24">
  89. <a-form-item label="单据号">
  90. <a-input id="paymentSlipEdit-purchaseNo" v-model.trim="queryParam.purchaseNo" allowClear placeholder="请输入单据号"/>
  91. </a-form-item>
  92. </a-col>
  93. <a-col :md="6" :sm="24">
  94. <a-form-item label="审核时间">
  95. <a-range-picker v-model="queryParam.creatDate" id="paymentSlipEdit-creatDate"/>
  96. </a-form-item>
  97. </a-col>
  98. <a-col :md="6" :sm="24">
  99. <span class="table-page-search-submitButtons">
  100. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="paymentSlipEdit-refresh">查询</a-button>
  101. <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="paymentSlipEdit-reset">重置</a-button>
  102. </span>
  103. </a-col>
  104. </a-row>
  105. </a-form>
  106. </div>
  107. <!-- 总计 -->
  108. <a-alert type="info" showIcon style="margin-bottom:15px">
  109. <div slot="message">共 <strong>6</strong> 条明细,金额合计 <strong>¥6</strong> ,余额合计<strong>¥6.33</strong></div>
  110. </a-alert>
  111. <div style="margin-bottom: 15px">
  112. <a-button type="primary" id="paymentSlipEdit-export" :disabled="!hasSelected" :loading="loading" @click="handleNoCollection">
  113. 批量暂不收款
  114. </a-button>
  115. <span style="margin-left: 8px">
  116. <template v-if="hasSelected">
  117. {{ `已选 ${selectedRowKeys.length} 项` }}
  118. </template>
  119. </span>
  120. </div>
  121. <!-- 列表 -->
  122. <s-table
  123. class="sTable"
  124. ref="table"
  125. size="default"
  126. :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
  127. :rowKey="(record) => record.id"
  128. :columns="columns"
  129. :data="loadData"
  130. bordered>
  131. <!-- 结算金额 -->
  132. <template slot="storageQuantity" slot-scope="text, record">
  133. <a-input-number
  134. id="paymentSlipEdit-storageQuantity"
  135. :value="record.storageQuantity"
  136. :precision="0"
  137. :min="0"
  138. :max="999999"
  139. placeholder="请输入" />
  140. </template>
  141. <!-- 操作 -->
  142. <template slot="action" slot-scope="text, record">
  143. <a-button size="small" type="primary" @click="handleDel(record)" id="paymentSlipEdit-del-btn">删除</a-button>
  144. </template>
  145. </s-table>
  146. </div>
  147. </a-collapse-panel>
  148. </a-collapse>
  149. </a-card>
  150. <a-affix :offset-bottom="0">
  151. <div style="text-align: center;width: 100%;background-color: #fff;padding: 30px 0;box-shadow: 0 0 20px #dcdee2;">
  152. <a-button type="primary" id="paymentSlipEdit-submit-btn" size="large" @click="handleSubmit" style="padding: 0 60px;">提交</a-button>
  153. </div>
  154. </a-affix>
  155. </div>
  156. </template>
  157. <script>
  158. import { STable, VSelect } from '@/components'
  159. export default{
  160. components: { STable, VSelect },
  161. data(){
  162. return{
  163. queryParam: {
  164. },
  165. brandData: [], // 产品品牌 下拉数据
  166. typeData: [], // 产品类别 下拉数据
  167. advanced: false, // 高级搜索 展开/关闭
  168. disabled: false, // 查询、重置按钮是否可操作
  169. formItemLayout: {
  170. labelCol: { span: 8 },
  171. wrapperCol: { span: 16 }
  172. },
  173. form: {
  174. name: '', // 客户名称
  175. mobile: '', // 联系手机
  176. contact: '', // 联系人
  177. provinceId: undefined, // 省
  178. province: '',
  179. cityId: undefined, // 市
  180. city: '',
  181. areaId: undefined, // 区
  182. area: '',
  183. address: '', // 详细地址
  184. fax: '', // 客户传真
  185. distributionType: '', // 配送方式
  186. remarks: '', // 是否卫星仓客户
  187. custType: undefined, // 客户类型
  188. priceType: '', // 价格类型
  189. payType: '', // 支付方式
  190. paymentType: '', // 收款方式
  191. contactTel: '' // 联系电话
  192. },
  193. rules: {
  194. // name: [{ required: true, message: '请输入客户名称', trigger: 'blur' }],
  195. mobile: [{ required: true, message: '请输入联系手机', trigger: 'blur' }],
  196. provinceId: [{ required: true, message: '请选择省', trigger: 'change' }],
  197. cityId: [{ required: true, message: '请选择市', trigger: 'change' }],
  198. areaId: [{ required: true, message: '请选择区/县', trigger: 'change' }],
  199. custType: [{ required: true, message: '请选择客户类型', trigger: 'change' }],
  200. priceType: [{ required: true, message: '请选择价格类型', trigger: 'change' }],
  201. payType: [{ required: true, message: '请选择支付方式', trigger: 'change' }],
  202. paymentType: [{ required: true, message: '请选择收款方式', trigger: 'change' }]
  203. },
  204. // 表头
  205. columns: [
  206. { title: '序号', dataIndex: 'no', align: 'center' },
  207. { title: '单据号', dataIndex: 'creatDate', align: 'center', customRender: function (text) { return text || '--' } },
  208. { title: '类型', dataIndex: 'custName', align: 'center', customRender: function (text) { return text || '--' } },
  209. { title: '审核时间', dataIndex: 'custsName', align: 'center', customRender: function (text) { return text || '--' } },
  210. { title: '金额', dataIndex: 'totalP', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  211. { title: '余额', dataIndex: 'totalNums', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  212. { title: '结算金额', scopedSlots: { customRender: 'storageQuantity' }, align: 'center' },
  213. ],
  214. selectedRowKeys: [], // Check here to configure the default column
  215. loading: false,
  216. // 加载数据方法 必须为 Promise 对象
  217. loadData: parameter => {
  218. this.disabled = true
  219. // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
  220. // const data = res.data
  221. // const no = (data.pageNo - 1) * data.pageSize
  222. // for (var i = 0; i < data.list.length; i++) {
  223. // data.list[i].no = no + i + 1
  224. // }
  225. // this.disabled = false
  226. // return data
  227. // })
  228. const _this = this
  229. return new Promise(function(resolve, reject){
  230. const data = {
  231. pageNo: 1,
  232. pageSize: 10,
  233. list: [
  234. { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
  235. ],
  236. count: 10
  237. }
  238. const no = (data.pageNo - 1) * data.pageSize
  239. for (var i = 0; i < data.list.length; i++) {
  240. data.list[i].no = no + i + 1
  241. }
  242. _this.disabled = false
  243. resolve(data)
  244. })
  245. },
  246. }
  247. },
  248. computed: {
  249. hasSelected () {
  250. return this.selectedRowKeys.length > 0
  251. }
  252. },
  253. methods: {
  254. // 重置
  255. resetSearchForm () {
  256. this.queryParam.orderBundleNo = ''
  257. this.queryParam.orderBundle.custMobile = ''
  258. this.queryParam.bundleName = ''
  259. this.queryParam.itemName = ''
  260. this.oldTime = undefined
  261. this.newTime = undefined
  262. this.$refs.table.refresh(true)
  263. },
  264. // 添加
  265. handleAdd(row){},
  266. // 删除
  267. handleDel(row){},
  268. // 编辑基本信息
  269. handleEditInfo(){
  270. this.openModal = true
  271. },
  272. // 提交
  273. handleSubmit(){
  274. },
  275. // 返回列表
  276. handleBack(){
  277. this.$router.push({ path: '/financialManagement/companyReceivablePayable/list'})
  278. },
  279. // 批量暂不收款
  280. handleNoCollection () {
  281. this.loading = true
  282. // ajax request after empty completing
  283. setTimeout(() => {
  284. this.loading = false
  285. this.selectedRowKeys = []
  286. }, 1000)
  287. },
  288. // 添加单据
  289. handleBill(){
  290. console.log(333)
  291. },
  292. // 分配结算金额
  293. handleAmount(){
  294. console.log(444)
  295. },
  296. onSelectChange (selectedRowKeys) {
  297. console.log('selectedRowKeys changed: ', selectedRowKeys)
  298. this.selectedRowKeys = selectedRowKeys
  299. },
  300. filterOption(input, option) {
  301. return (
  302. option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
  303. )
  304. },
  305. },
  306. beforeRouteEnter (to, from, next) {
  307. next(vm => {
  308. vm.openModal = false
  309. })
  310. }
  311. }
  312. </script>
  313. <style lang="less">
  314. .paymentSlipEdit-wrap{
  315. .paymentSlipEdit-cont{
  316. margin-bottom: 15px;
  317. .sub-title{
  318. font-size: 12px;
  319. color: #808695;
  320. margin-left: 10px;
  321. }
  322. .tag-txt{
  323. font-size: 12px;
  324. color: #ed1c24;
  325. }
  326. .edit-circle-btn{
  327. margin-left: 15px;
  328. i{
  329. vertical-align: text-bottom;
  330. }
  331. }
  332. .import-btn{
  333. margin-left: 15px;
  334. }
  335. }
  336. }
  337. </style>