index.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <!-- 新增现货品种 -->
  3. <a-modal class="commonModal addSpotVariety"
  4. title="新增现货品种"
  5. v-model:visible="visible"
  6. @cancel="cancel"
  7. width="850px">
  8. <template #footer>
  9. <a-button key="submit"
  10. type="primary"
  11. :loading="loading"
  12. @click="submit">完成</a-button>
  13. </template>
  14. <a-form class="inlineForm">
  15. <fieldset class="formFieldSet">
  16. <legend>基本信息</legend>
  17. <a-row :gutter="24">
  18. <a-col :span="12">
  19. <a-form-item label="现货品种名称">
  20. <a-input class="dialogInput"
  21. style="width: 200px"
  22. placeholder="请输入现货品种名称" />
  23. </a-form-item>
  24. </a-col>
  25. <a-col :span="12">
  26. <a-form-item label="现货品种代码">
  27. <a-input class="dialogInput"
  28. style="width: 200px"
  29. placeholder="请输入现货品种代码" />
  30. </a-form-item>
  31. </a-col>
  32. </a-row>
  33. <a-row :gutter="24">
  34. <a-col :span="24">
  35. <a-form-item label="单位">
  36. <a-select class="inlineFormSelect"
  37. style="width: 200px"
  38. placeholder="请选择单位">
  39. <a-select-option value="1">
  40. 客户一
  41. </a-select-option>
  42. <a-select-option value="2">
  43. 客户二
  44. </a-select-option>
  45. </a-select>
  46. </a-form-item>
  47. </a-col>
  48. </a-row>
  49. <a-row :gutter="24">
  50. <a-col :span="24">
  51. <a-form-item label="备注">
  52. <a-input class="dialogInput"
  53. style="width: 562px"
  54. placeholder="请输入备注" />
  55. </a-form-item>
  56. </a-col>
  57. </a-row>
  58. </fieldset>
  59. <fieldset class="formFieldSet">
  60. <legend>品类信息</legend>
  61. <a-table class="dialogTable" :columns="columns" :data-source="dataSource" :pagination="false">
  62. <template #type>
  63. <a-input class="dialogInput"></a-input>
  64. </template>
  65. <template #customType>
  66. <span>
  67. <span class="red">*</span>
  68. 品类
  69. </span>
  70. </template>
  71. <template #unit>
  72. <a-input class="dialogInput"></a-input>
  73. </template>
  74. <template #customUnit>
  75. <span>
  76. <span class="red">*</span>
  77. 单位
  78. </span>
  79. </template>
  80. <template #coefficient>
  81. <a-input class="dialogInput"></a-input>
  82. </template>
  83. <template #customCoefficient>
  84. <span>
  85. <span class="red">*</span>
  86. 标仓系数
  87. </span>
  88. </template>
  89. <template #action>
  90. <a-button class="minusBtn"></a-button>
  91. <a-button class="plusBtn"></a-button>
  92. </template>
  93. </a-table>
  94. </fieldset>
  95. </a-form>
  96. </a-modal>
  97. </template>
  98. <script lang="ts">
  99. import { defineComponent, ref } from 'vue';
  100. import { closeModal, openModal } from '@/common/setup/modal/index';
  101. import { initData } from '@/common/methods/index';
  102. export default defineComponent({
  103. name: 'addSpotVariety',
  104. components: {},
  105. setup() {
  106. const { visible, cancel } = closeModal('addGoods');
  107. const loading = ref<boolean>(false);
  108. const columns = [
  109. {
  110. dataIndex: 'type',
  111. key: 'type',
  112. slots: { title: 'customType', customRender: 'type' },
  113. },
  114. {
  115. dataIndex: 'unit',
  116. key: 'unit',
  117. slots: { title: 'customUnit', customRender: 'unit' },
  118. },
  119. {
  120. dataIndex: 'coefficient',
  121. key: 'coefficient',
  122. slots: { title: 'customCoefficient', customRender: 'coefficient' },
  123. },
  124. {
  125. title: '操作',
  126. key: 'action',
  127. },
  128. ];
  129. const dataSource = [
  130. {
  131. key: '1',
  132. type: 'John Brown',
  133. age: 32,
  134. address: 'New York No. 1 Lake Park',
  135. tags: ['nice', 'developer'],
  136. },
  137. {
  138. key: '2',
  139. name: 'Jim Green',
  140. age: 42,
  141. address: 'London No. 1 Lake Park',
  142. tags: ['loser'],
  143. },
  144. ];
  145. function submit() {
  146. loading.value = true;
  147. setTimeout(() => {
  148. loading.value = false;
  149. cancel();
  150. }, 2000);
  151. }
  152. initData(() => {});
  153. return {
  154. visible,
  155. cancel,
  156. submit,
  157. loading,
  158. dataSource,
  159. columns
  160. };
  161. },
  162. });
  163. </script>
  164. <style lang="less">
  165. .addSpotVariety {
  166. width: 100%;
  167. height: 100%;
  168. padding: 30px;
  169. .formFieldSet {
  170. border: 1px solid @m-grey19;
  171. padding: 0 20px;
  172. }
  173. .formFieldSet+.formFieldSet {
  174. margin-top: 35px;
  175. }
  176. .ant-form {
  177. legend {
  178. width: auto;
  179. margin-left: 20px;
  180. font-size: 16px;
  181. color: @m-white0;
  182. border-bottom: 0;
  183. padding: 0 10px;
  184. }
  185. }
  186. .ant-form.inlineForm .ant-row.ant-form-item .ant-form-item-label {
  187. width: 120px !important;
  188. }
  189. .upload {
  190. display: inline-flex;
  191. .ant-btn.uploadBtn {
  192. width: 60px;
  193. height: 30px;
  194. background: @m-blue0;
  195. border: 0;
  196. padding: 0;
  197. text-align: center;
  198. font-size: 14px;
  199. color: @m-white0;
  200. .rounded-corners(3px);
  201. &:hover {
  202. background: rgba(@m-blue0, 0);
  203. color: rgba(@m-white0, 0.8);
  204. }
  205. }
  206. .look {
  207. color: @m-blue0;
  208. font-size: 14px;
  209. margin-left: 10px;
  210. cursor: pointer;
  211. }
  212. }
  213. .red {
  214. color: @m-red1;
  215. }
  216. }
  217. </style>