checkingTipsModal.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <a-modal
  3. centered
  4. class="checkingTipsEdit-modal"
  5. :footer="null"
  6. :maskClosable="false"
  7. title="提示"
  8. v-model="isShow"
  9. @cancle="isShow=false"
  10. width="80%">
  11. <div class="checkingTipsEdit-header">
  12. <strong>以下为影响出入库的未完成单据</strong>
  13. <a-button type="danger" @click="handleExport" :loading="exportLoading" id="checkingTipsEdit-export">导出</a-button>
  14. </div>
  15. <!-- 列表 -->
  16. <s-table
  17. class="sTable"
  18. ref="table"
  19. size="small"
  20. :rowKey="(record) => record.id"
  21. :columns="columns"
  22. :data="loadData"
  23. bordered>
  24. </s-table>
  25. <a-divider />
  26. <div class="checkingTipsEdit-explain">
  27. <strong>盘点说明:</strong>
  28. <ul class="checkingTipsEdit-explain-list">
  29. <li>1、以上影响出入库的未完成单据,不处理也可进行盘点,但建议处理完再进行盘点。</li>
  30. <li>2、开始盘点到盘点结束期间,所有出入库单据将不能操作。</li>
  31. </ul>
  32. </div>
  33. <div class="btn-cont">
  34. <a-button type="primary" id="checking-tips-edit-modal-check" @click="handleCheck">开始盘点</a-button>
  35. <a-button id="checking-tips-edit-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
  36. </div>
  37. <checking-type-modal :openModal="openTypeModal" :nowData="nowTypeData" :itemId="itemId" @ok="handleOk" @close="closeModal" />
  38. </a-modal>
  39. </template>
  40. <script>
  41. import { STable } from '@/components'
  42. import checkingTypeModal from './checkingTypeModal.vue'
  43. // import { checkingTipsSave } from '@/api/checkingTips'
  44. export default {
  45. name: 'CheckingTipsEditModal',
  46. components: { STable, checkingTypeModal },
  47. props: {
  48. openModal: { // 弹框显示状态
  49. type: Boolean,
  50. default: false
  51. },
  52. itemId: {
  53. type: [Number, String],
  54. default: ''
  55. },
  56. nowData: {
  57. type: Object,
  58. default: null
  59. }
  60. },
  61. data () {
  62. return {
  63. isShow: this.openModal, // 是否打开弹框
  64. exportLoading: false, // 导出loading
  65. columns: [
  66. { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
  67. { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
  68. { title: '单号', dataIndex: 'nsso', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
  69. { title: '单据类型', dataIndex: 'sort', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
  70. { title: '单据状态', dataIndex: 'name', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
  71. ],
  72. // 加载数据方法 必须为 Promise 对象
  73. loadData: parameter => {
  74. this.disabled = true
  75. // return warehouseAllList( this.queryParam ).then(res => {
  76. // const data = res.data
  77. // this.disabled = false
  78. // return data
  79. // })
  80. const _this = this
  81. return new Promise(function (resolve, reject) {
  82. const data = {
  83. pageNo: 1,
  84. pageSize: 10,
  85. list: [
  86. { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
  87. ],
  88. count: 10
  89. }
  90. for (var i = 0; i < data.list.length; i++) {
  91. data.list[i].no = i + 1
  92. }
  93. _this.disabled = false
  94. resolve(data)
  95. })
  96. },
  97. openTypeModal: false, // 新增编辑 弹框
  98. nowTypeData: null // 当前记录数据
  99. }
  100. },
  101. methods: {
  102. // 详情
  103. getDetail () {
  104. },
  105. // 开始盘点
  106. handleCheck () {
  107. this.openTypeModal = true
  108. },
  109. // 新增/编辑 成功
  110. handleOk (type) {
  111. this.$emit('ok', type)
  112. this.isShow = false
  113. },
  114. // 关闭弹框
  115. closeModal () {
  116. this.openTypeModal = false
  117. },
  118. // 导出
  119. handleExport () {
  120. this.exportLoading = true
  121. customerBundleExportDelay({}).then(res => {
  122. this.exportLoading = false
  123. this.download(res)
  124. })
  125. },
  126. download (data) {
  127. if (!data) { return }
  128. const url = window.URL.createObjectURL(new Blob([data]))
  129. const link = document.createElement('a')
  130. link.style.display = 'none'
  131. link.href = url
  132. const a = moment().format('YYYYMMDDHHmmss')
  133. const fname = '未完成单据_盘点' + a
  134. link.setAttribute('download', fname + '.xlsx')
  135. document.body.appendChild(link)
  136. link.click()
  137. }
  138. },
  139. watch: {
  140. // 父页面传过来的弹框状态
  141. openModal (newValue, oldValue) {
  142. this.isShow = newValue
  143. },
  144. // 重定义的弹框状态
  145. isShow (newValue, oldValue) {
  146. if (!newValue) {
  147. this.$emit('close')
  148. } else {
  149. this.form = {
  150. name: '',
  151. sort: ''
  152. }
  153. }
  154. },
  155. itemId (newValue, oldValue) {
  156. if (this.isShow && newValue) {
  157. this.getDetail()
  158. }
  159. }
  160. }
  161. }
  162. </script>
  163. <style lang="less">
  164. .checkingTipsEdit-modal{
  165. .ant-modal-body {
  166. padding: 40px 40px 24px;
  167. }
  168. .checkingTipsEdit-header{
  169. display: flex;
  170. justify-content: space-between;
  171. align-items: center;
  172. margin-bottom: 20px;
  173. strong{
  174. font-size: 15px;
  175. }
  176. }
  177. .checkingTipsEdit-explain{
  178. strong{
  179. display: block;
  180. margin-bottom: 5px;
  181. }
  182. .checkingTipsEdit-explain-list{
  183. list-style: none;
  184. margin: 0;
  185. padding: 0;
  186. li{
  187. padding: 3px 0;
  188. }
  189. }
  190. }
  191. .btn-cont {
  192. text-align: center;
  193. margin: 35px 0 10px;
  194. }
  195. }
  196. </style>