subcontractOrderModal.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <template>
  2. <div id="manualModal">
  3. <a-modal
  4. title="手工匹配订单"
  5. v-model="subcontractOrderModVis"
  6. :confirmLoading="confirmLoading"
  7. @cancel="handleCancel"
  8. width="80%"
  9. style="top:330px;left:100px;"
  10. >
  11. <!-- 主表信息 回显 -->
  12. <a-card :bordered="false" >
  13. <div class="table-page-search-wrapper">
  14. <a-form layout="inline" @keyup.enter.native="searchQuery">
  15. <a-row :gutter="24">
  16. <a-col :md="6" :sm="8">
  17. <a-form-item label="委外订单号">
  18. <a-input placeholder="请输入委外订单号" v-model="queryParam.CCode"></a-input>
  19. </a-form-item>
  20. </a-col>
  21. <template v-if="toggleSearchStatus">
  22. </template>
  23. <a-col :md="6" :sm="8">
  24. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  25. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  26. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  27. <a @click="handleToggleSearch" style="margin-left: 8px">
  28. {{ toggleSearchStatus ? '收起' : '展开' }}
  29. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  30. </a>
  31. </span>
  32. </a-col>
  33. </a-row>
  34. </a-form>
  35. </div>
  36. </a-card>
  37. <!-- 増行 子表 -->
  38. <a-card :bordered="false" style="margin:10px 0;">
  39. <!-- 子表 -->
  40. <a-spin :spinning="confirmLoading">
  41. <a-table
  42. bordered
  43. :row-key="record => record.ivouchRowNo"
  44. :columns="subcontractOrderColumns"
  45. :data-source="subcontractOrderData"
  46. :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
  47. :scroll="{x: 1200,y:300 }"
  48. :pagination="pagination"
  49. @change="handleTableChange"
  50. >
  51. <span slot="operationSlot" slot-scope="text, record,index">
  52. <a @click="handleExportXls(record)" style="color:green;">关联委外</a>
  53. <a-divider type="vertical" />
  54. <a @click="handleDelete(record,index)" style="color:red;">删行</a>
  55. </span>
  56. </a-table>
  57. </a-spin>
  58. </a-card>
  59. <!-- 页面底部保存取消 -->
  60. <div
  61. :style="{
  62. position: 'absolute',
  63. right: 0,
  64. bottom: 0,
  65. width: '100%',
  66. borderTop: '1px solid #e9e9e9',
  67. padding: '10px 16px',
  68. background: '#fff',
  69. textAlign: 'right',
  70. zIndex: 1
  71. }"
  72. >
  73. <a-popconfirm title="确定放弃?" @confirm="handleCancel" okText="确定" cancelText="取消">
  74. <a-button :style="{ marginRight: '8px' }">返回</a-button>
  75. </a-popconfirm>
  76. <a-button type="primary" @click="addSave">
  77. 保存
  78. </a-button>
  79. </div>
  80. </a-modal>
  81. </div>
  82. </template>
  83. <script>
  84. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  85. import JEllipsis from '@/components/jeecg/JEllipsis'
  86. import moment from 'moment'
  87. import {subcontractOrder } from '@api/document/order'
  88. export default {
  89. name: 'subcontractOrderModal', // 报关要素
  90. mixins: [JeecgListMixin],
  91. components: { JEllipsis, moment },
  92. data() {
  93. let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略
  94. return {
  95. queryParam:{},
  96. subcontractOrderModVis:false,
  97. confirmLoading: false,
  98. subcontractOrderData:[ ],
  99. subcontractOrderColumns:[
  100. {
  101. title: '委外订单号',
  102. width: 100,
  103. dataIndex: 'ccode',
  104. className: 'replacecolor',
  105. ellipsis: true
  106. },
  107. {
  108. title: '委外订单行号',
  109. width: 120,
  110. dataIndex: 'ivouchRowNo',
  111. className: 'replacecolor',
  112. ellipsis: true
  113. },
  114. {
  115. title: '存货编码',
  116. width: 120,
  117. dataIndex: 'inventoryCode',
  118. className: 'replacecolor',
  119. ellipsis: true
  120. },
  121. {
  122. title: '存货名称',
  123. width: 120,
  124. dataIndex: 'inventoryName',
  125. className: 'replacecolor',
  126. ellipsis: true
  127. },
  128. {
  129. title: '规格型号',
  130. width: 120,
  131. dataIndex: 'specificationAndModel',
  132. className: 'replacecolor',
  133. ellipsis: true
  134. },
  135. {
  136. title: '颜色',
  137. width: 80,
  138. dataIndex: 'colour',
  139. className: 'replacecolor',
  140. ellipsis: true
  141. },
  142. ],
  143. selectedRowKeys:[],
  144. selectedRows:[],
  145. fatherList:'',
  146. pagination:{}
  147. }
  148. },
  149. // 接收父组件 方法
  150. props: {},
  151. created() {
  152. },
  153. methods: {
  154. //获取数据
  155. getData(){
  156. var that = this;
  157. this.confirmLoading = true
  158. this.$nextTick(() => {
  159. subcontractOrder(this.queryParam).then(res => {
  160. this.confirmLoading = false
  161. if (res.success) {
  162. that.subcontractOrderData = res.result.records;
  163. that.pagination = {
  164. total: res.result.total,
  165. current: res.result.current,
  166. pageSize: res.result.size
  167. }
  168. }else{
  169. that.$message.error(res.message);
  170. }
  171. })
  172. })
  173. },
  174. //查询
  175. searchQuery(){
  176. if(this.queryParam.CCode == '' || !this.queryParam.CCode){
  177. this.$message.error('请选择委外订单号')
  178. }else{
  179. this.getData()
  180. }
  181. },
  182. //重置
  183. searchReset(){
  184. this.subcontractOrderData = []
  185. this.queryParam={}
  186. },
  187. //返回
  188. handleCancel(){
  189. this.close
  190. },
  191. //保存
  192. addSave(){
  193. if(this.selectedRowKeys.length == 0){
  194. this.$message.error('请勾选数据')
  195. }else if(this.selectedRowKeys.length >1){
  196. this.$message.error('只可选择一行数据')
  197. }else{
  198. this.close()
  199. this.$emit('close',this.fatherList,this.selectedRows[0])
  200. }
  201. },
  202. //关闭弹窗
  203. close(){
  204. this.subcontractOrderModVis = false
  205. this.subcontractOrderData = []
  206. this.queryParam={}
  207. this.selectedRowKeys = []
  208. },
  209. //选中行
  210. onSelectChange(keys,rows){
  211. this.selectedRowKeys = keys;
  212. this.selectedRows = rows;
  213. },
  214. // 分页变化时触发
  215. handleTableChange(pagination, filters, sorter) {
  216. this.queryParam.pageNo = pagination.current
  217. this.getData()
  218. },
  219. },
  220. computed: {}
  221. }
  222. </script>
  223. <style lang="less" scoped>
  224. @import '~@assets/less/common.less';
  225. @import '~@assets/less/overwriter.less';
  226. /deep/ .ant-table-thead > tr > th {
  227. text-align: center;
  228. // font-weight: 700;
  229. }
  230. /deep/ .ant-table-tbody {
  231. text-align: center;
  232. }
  233. // th.replacecolor {
  234. // background-color: #ccc;
  235. // }
  236. // 对话框里的card样式
  237. /deep/ .ant-modal-content {
  238. background-color: #f0f2f5;
  239. }
  240. /deep/ .ant-modal-body {
  241. padding: 10px;
  242. }
  243. /deep/.ant-form-item{
  244. margin-bottom: 0px !important;
  245. }
  246. /deep/.ant-table-tbody .ant-table-row td{
  247. padding-top: 8px;
  248. padding-bottom: 8px;
  249. }
  250. /deep/ .ant-table-thead > tr > th, .ant-table-tbody > tr > td{
  251. padding: 9px 16px
  252. }
  253. /deep/.ant-card-body{
  254. padding-top: 10px !important;
  255. padding-bottom: 0px !important;
  256. }
  257. /deep/ .table-page-search-wrapper .table-page-search-submitButtons{
  258. margin-bottom: 8px;
  259. }
  260. </style>