index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  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" placeholder="请输入品类"></a-input>
  64. </template>
  65. <template #customType>
  66. <span>
  67. <span class="red">*</span>
  68. 品类
  69. </span>
  70. </template>
  71. <template #unit>
  72. <a-select class="dialogSelect" placeholder="请选择单位">
  73. <a-select-option value="1">
  74. 一口价
  75. </a-select-option>
  76. <a-select-option value="2">
  77. 一口价2
  78. </a-select-option>
  79. </a-select>
  80. </template>
  81. <template #customUnit>
  82. <span>
  83. <span class="red">*</span>
  84. 单位
  85. </span>
  86. </template>
  87. <template #coefficient>
  88. <a-input class="dialogInput" placeholder="请输入标仓系数"></a-input>
  89. </template>
  90. <template #customCoefficient>
  91. <span>
  92. <span class="red">*</span>
  93. 标仓系数
  94. </span>
  95. </template>
  96. <template #action>
  97. <a-button class="plusBtn">
  98. <template #icon>
  99. <MinusOutlined />
  100. </template>
  101. </a-button>
  102. <a-button class="minusBtn">
  103. <template #icon>
  104. <PlusOutlined />
  105. </template>
  106. </a-button>
  107. </template>
  108. </a-table>
  109. </fieldset>
  110. <fieldset class="formFieldSet">
  111. <legend>品牌信息</legend>
  112. <a-table class="dialogTable" :columns="columns1" :data-source="dataSource1" :pagination="false">
  113. <template #type>
  114. <a-input class="dialogInput" placeholder="请输入品牌"></a-input>
  115. </template>
  116. <template #customType>
  117. <span>
  118. <span class="red">*</span>
  119. 品牌
  120. </span>
  121. </template>
  122. <template #action>
  123. <a-button class="plusBtn">
  124. <template #icon>
  125. <MinusOutlined />
  126. </template>
  127. </a-button>
  128. <a-button class="minusBtn">
  129. <template #icon>
  130. <PlusOutlined />
  131. </template>
  132. </a-button>
  133. </template>
  134. </a-table>
  135. </fieldset>
  136. <fieldset class="formFieldSet">
  137. <legend>套保品种信息</legend>
  138. <a-table class="dialogTable" :columns="columns" :data-source="dataSource" :pagination="false">
  139. <template #type>
  140. <a-select class="dialogSelect" placeholder="请选择套保品种">
  141. <a-select-option value="1">
  142. 一口价
  143. </a-select-option>
  144. <a-select-option value="2">
  145. 一口价2
  146. </a-select-option>
  147. </a-select>
  148. </template>
  149. <template #customType>
  150. <span>
  151. <span class="red">*</span>
  152. 套保品种
  153. </span>
  154. </template>
  155. <template #unit>
  156. <span class="white">选择套保品种后自动填入</span>
  157. </template>
  158. <template #customUnit>
  159. <span>
  160. 单位
  161. </span>
  162. </template>
  163. <template #coefficient>
  164. <a-input class="dialogInput" placeholder="请输入套保系数"></a-input>
  165. </template>
  166. <template #customCoefficient>
  167. <span>
  168. <span class="red">*</span>
  169. 套保系数
  170. </span>
  171. </template>
  172. <template #action>
  173. <a-button class="plusBtn">
  174. <template #icon>
  175. <MinusOutlined />
  176. </template>
  177. </a-button>
  178. <a-button class="minusBtn">
  179. <template #icon>
  180. <PlusOutlined />
  181. </template>
  182. </a-button>
  183. </template>
  184. </a-table>
  185. </fieldset>
  186. </a-form>
  187. </a-modal>
  188. </template>
  189. <script lang="ts">
  190. import { defineComponent, ref } from 'vue';
  191. import { closeModal, openModal } from '@/common/setup/modal/index';
  192. import { initData } from '@/common/methods/index';
  193. import { PlusOutlined, MinusOutlined } from '@ant-design/icons-vue';
  194. export default defineComponent({
  195. name: 'addSpotVariety',
  196. components: {
  197. PlusOutlined,
  198. MinusOutlined,
  199. },
  200. setup() {
  201. const { visible, cancel } = closeModal('addGoods');
  202. const loading = ref<boolean>(false);
  203. const columns = [
  204. {
  205. dataIndex: 'type',
  206. key: 'type',
  207. slots: { title: 'customType', customRender: 'type' },
  208. width: 200,
  209. align: 'center'
  210. },
  211. {
  212. dataIndex: 'unit',
  213. key: 'unit',
  214. slots: { title: 'customUnit', customRender: 'unit' },
  215. width: 200,
  216. align: 'center'
  217. },
  218. {
  219. dataIndex: 'coefficient',
  220. key: 'coefficient',
  221. slots: { title: 'customCoefficient', customRender: 'coefficient' },
  222. width: 200,
  223. align: 'center'
  224. },
  225. {
  226. title: '操作',
  227. key: 'action',
  228. slots: { customRender: 'action' },
  229. align: 'center'
  230. },
  231. ];
  232. const dataSource = [
  233. {
  234. key: '1',
  235. type: 'John Brown',
  236. age: 32,
  237. address: 'New York No. 1 Lake Park',
  238. tags: ['nice', 'developer'],
  239. },
  240. {
  241. key: '2',
  242. name: 'Jim Green',
  243. age: 42,
  244. address: 'London No. 1 Lake Park',
  245. tags: ['loser'],
  246. },
  247. ];
  248. const columns1 = [
  249. {
  250. dataIndex: 'type',
  251. key: 'type',
  252. slots: { title: 'customType', customRender: 'type' },
  253. width: 598,
  254. align: 'center'
  255. },
  256. {
  257. title: '操作',
  258. key: 'action',
  259. slots: { customRender: 'action' },
  260. align: 'center'
  261. },
  262. ];
  263. const dataSource1 = [
  264. {
  265. key: '1',
  266. type: 'John Brown',
  267. age: 32,
  268. address: 'New York No. 1 Lake Park',
  269. tags: ['nice', 'developer'],
  270. },
  271. {
  272. key: '2',
  273. name: 'Jim Green',
  274. age: 42,
  275. address: 'London No. 1 Lake Park',
  276. tags: ['loser'],
  277. },
  278. ];
  279. function submit() {
  280. loading.value = true;
  281. setTimeout(() => {
  282. loading.value = false;
  283. cancel();
  284. }, 2000);
  285. }
  286. initData(() => {});
  287. return {
  288. visible,
  289. cancel,
  290. submit,
  291. loading,
  292. dataSource,
  293. columns,
  294. dataSource1,
  295. columns1
  296. };
  297. },
  298. });
  299. </script>
  300. <style lang="less">
  301. .addSpotVariety {
  302. width: 100%;
  303. height: 100%;
  304. padding: 30px;
  305. .formFieldSet {
  306. border: 1px solid @m-grey19;
  307. padding: 0 20px 20px;
  308. }
  309. .formFieldSet+.formFieldSet {
  310. margin-top: 35px;
  311. }
  312. .ant-form {
  313. legend {
  314. width: auto;
  315. margin-left: 20px;
  316. font-size: 16px;
  317. color: @m-white0;
  318. border-bottom: 0;
  319. padding: 0 10px;
  320. }
  321. }
  322. .ant-form.inlineForm .ant-row.ant-form-item .ant-form-item-label {
  323. width: 120px !important;
  324. }
  325. .upload {
  326. display: inline-flex;
  327. .ant-btn.uploadBtn {
  328. width: 60px;
  329. height: 30px;
  330. background: @m-blue0;
  331. border: 0;
  332. padding: 0;
  333. text-align: center;
  334. font-size: 14px;
  335. color: @m-white0;
  336. .rounded-corners(3px);
  337. &:hover {
  338. background: rgba(@m-blue0, 0);
  339. color: rgba(@m-white0, 0.8);
  340. }
  341. }
  342. .look {
  343. color: @m-blue0;
  344. font-size: 14px;
  345. margin-left: 10px;
  346. cursor: pointer;
  347. }
  348. }
  349. .red {
  350. color: @m-red1;
  351. }
  352. .ant-btn.minusBtn,.ant-btn.plusBtn {
  353. width: 26px;
  354. height: 26px;
  355. .inlineflex;
  356. justify-content: center;
  357. background: @m-blue0;
  358. .rounded-corners(3px);
  359. border: 0;
  360. .anticon {
  361. font-size: 12px;
  362. color: @m-white0;
  363. align-self: center;
  364. align-items: center;
  365. }
  366. &:hover,&:focus {
  367. background: rgba(@m-blue0, .8);
  368. .anticon {
  369. color: rgba(@m-white0, .8);
  370. }
  371. }
  372. }
  373. .ant-btn.plusBtn{
  374. margin-right: 10px;
  375. background: transparent;
  376. border: 1px solid #3A87F7;
  377. .anticon {
  378. color: @m-blue0;
  379. }
  380. }
  381. .white {
  382. color: @m-white0;
  383. }
  384. .dialogTable {
  385. .ant-table {
  386. .ant-table-content {
  387. .ant-table-body {
  388. table {
  389. tr {
  390. td {
  391. padding: 0;
  392. .ant-input.dialogInput {
  393. height: 34px;
  394. line-height: 34px;
  395. border: 0;
  396. border-radius: 0;
  397. }
  398. .dialogSelect.ant-select-single {
  399. float: left;
  400. margin-right: 0;
  401. .ant-select-selector {
  402. padding: 0 10px;
  403. height: 34px;
  404. background: @m-grey21;
  405. border: 0;
  406. border-radius: 0;
  407. .ant-select-selection-placeholder {
  408. color: @m-grey10;
  409. text-align: left;
  410. }
  411. }
  412. .ant-select-arrow {
  413. color: @m-blue0;
  414. }
  415. }
  416. }
  417. }
  418. }
  419. }
  420. }
  421. }
  422. }
  423. }
  424. </style>