otherYarnsInModal.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <a-modal
  3. title="其他入库的纱"
  4. v-model="otherYarnsInModVis"
  5. :confirmLoading="confirmLoading"
  6. width="86%"
  7. :footer="null"
  8. >
  9. <!-- tabel 加载 -->
  10. <a-spin :spinning="confirmLoading">
  11. <!-- 查询 -->
  12. <div class="table-page-search-wrapper">
  13. <a-form layout="inline" @keyup.enter.native="searchQuery">
  14. <a-row :gutter="24">
  15. <a-col :md="6" :sm="8">
  16. <a-form-item label="委外订单号">
  17. <a-input placeholder="请输入委外订单号" v-model="queryParam.ccode"></a-input>
  18. </a-form-item>
  19. </a-col>
  20. <a-col :md="6" :sm="8">
  21. <a-form-item label="计划号">
  22. <a-input placeholder="请输入计划号" v-model="queryParam.cplanCode"></a-input>
  23. </a-form-item>
  24. </a-col>
  25. <a-col :md="6" :sm="8">
  26. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  27. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  28. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  29. <a @click="handleToggleSearch" style="margin-left: 8px">
  30. {{ toggleSearchStatus ? '收起' : '展开' }}
  31. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  32. </a>
  33. </span>
  34. </a-col>
  35. </a-row>
  36. </a-form>
  37. </div>
  38. <!-- table -->
  39. <div>
  40. <a-table
  41. bordered
  42. :loading="loading"
  43. :columns="otherYarnsInColumns"
  44. :data-source="otherYarnsInData"
  45. :pagination="false"
  46. :scroll="{ y: 500 }"
  47. :footer="showTotal"
  48. >
  49. </a-table>
  50. <!-- 导出 打印 返回 -->
  51. <a-row style="marginTop:20px;">
  52. <a-col :md="24" :sm="12">
  53. <span style="float: right;" class="table-operator">
  54. <a-button type="primary" icon="download" @click="handleExportXls('其他入库的纱')">导出</a-button>
  55. <a-button type="primary" @click="print" icon="printer" style="margin:0 10px;">打印</a-button>
  56. <a-button type="primary" @click="backFabricLossTable" icon="rollback">返回</a-button>
  57. </span>
  58. </a-col>
  59. </a-row>
  60. </div>
  61. </a-spin>
  62. </a-modal>
  63. </template>
  64. <script>
  65. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  66. import JEllipsis from '@/components/jeecg/JEllipsis'
  67. export default {
  68. name: 'OtherYarnsInModal', // 其他入库的纱 弹框
  69. mixins: [JeecgListMixin],
  70. components: { JEllipsis },
  71. data() {
  72. return {
  73. // 表头
  74. otherYarnsInColumns: [
  75. {
  76. title: '序号',
  77. width:80,
  78. customRender: (text, record, index) => {
  79. if (record.ccode == "合计")
  80. return "";
  81. else
  82. return index + 1;
  83. }
  84. },
  85. {
  86. title: '委外订单号',
  87. dataIndex: 'ccode',
  88. width: 120,
  89. className: 'replacecolor'
  90. },
  91. {
  92. title: '批号',
  93. dataIndex: 'cbatch',
  94. width: 120,
  95. className: 'replacecolor'
  96. },
  97. {
  98. title: '使用数量',
  99. dataIndex: 'iquantity',
  100. width: 120,
  101. className: 'replacecolor'
  102. },
  103. {
  104. title: '计划号',
  105. dataIndex: 'cplanCode',
  106. width: 120,
  107. className: 'replacecolor'
  108. },
  109. {
  110. title: '采购单价',
  111. dataIndex: 'iprice',
  112. width: 120,
  113. className: 'replacecolor'
  114. }
  115. ],
  116. otherYarnsInData: [],
  117. allDataList:[],
  118. loading: false, // 表格加载
  119. // orderDataform: this.$form.createForm(this),
  120. confirmLoading: false,
  121. otherYarnsInModVis: false,
  122. // 查询条件
  123. queryParam: {
  124. purchaseAboardOrderNum: '', // 委外订单号
  125. planNum: '' // 计划号
  126. }
  127. }
  128. },
  129. // 接收父组件 方法
  130. props: {
  131. father: {
  132. type: Function,
  133. default: null
  134. }
  135. },
  136. created() {},
  137. computed: {
  138. // 合计展示
  139. totalDataSource(){
  140. // 开票成本-衬衣 合计
  141. var item = {
  142. "ccode":"合计"
  143. };
  144. var iquantity = 0;
  145. for (let row of this.otherYarnsInData){
  146. iquantity += row.iquantity*1;
  147. }
  148. item.iquantity= parseFloat(iquantity.toFixed(4));
  149. return [item];
  150. }
  151. },
  152. methods: {
  153. // 第一行 导出
  154. handleExportXls() {},
  155. // 打印
  156. print() {},
  157. // 返回
  158. backFabricLossTable() {
  159. console.log('返回到面料损耗表')
  160. // this.$router.push('fabricLoss-table')
  161. // this.surplusYarnModVis = false
  162. this.close()
  163. },
  164. // 弹框查询按钮
  165. searchQuery() {
  166. this.otherYarnsInData = this.allDataList.filter(e=>(this.queryParam.ccode == null || e.ccode.toLowerCase().indexOf(this.queryParam.ccode.toLowerCase())>-1)
  167. && (this.queryParam.cplanCode == null || e.cplanCode.toLowerCase().indexOf(this.queryParam.cplanCode.toLowerCase())>-1));
  168. },
  169. // 重置
  170. searchReset() {
  171. this.queryParam = {}
  172. // this.getShipmentList()
  173. },
  174. close() {
  175. this.$emit('close')
  176. this.otherYarnsInModVis = false
  177. },
  178. showTotal(data) {
  179. return (
  180. <a-table
  181. rowKey={Math.random}
  182. bordered={false}
  183. pagination={false}
  184. columns={this.otherYarnsInColumns}
  185. dataSource={this.totalDataSource || []}
  186. showHeader={false}
  187. ></a-table>
  188. )
  189. },
  190. }
  191. }
  192. </script>
  193. <style lang="less" scoped>
  194. @import '~@assets/less/common.less';
  195. @import '~@assets/less/overwriter.less';
  196. /deep/ .ant-table-thead > tr > th {
  197. text-align: center;
  198. // font-weight: 700;
  199. }
  200. /deep/ .ant-table-tbody {
  201. text-align: center;
  202. }
  203. // /deep/ th.replacecolor {
  204. // background-color: #ccc;
  205. // }
  206. </style>