manualModal.vue 9.4 KB

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