addEditForm.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875
  1. <template>
  2. <el-form
  3. ref="ruleForm"
  4. :loading="loading"
  5. :model="ruleForm"
  6. status-icon
  7. :size="'mini'"
  8. :rules="rulesThis"
  9. label-width="86px"
  10. style="width: 100%"
  11. >
  12. <el-row>
  13. <el-col :span="6">
  14. <el-form-item label="竞价类型" prop="is_project" class="clear">
  15. <el-select
  16. v-model="ruleForm.is_project"
  17. style="width: 100%"
  18. :disabled="false"
  19. placeholder="竞价类型"
  20. @change="projectChange([])"
  21. >
  22. <el-option
  23. v-for="item in options"
  24. :key="item.value"
  25. :label="item.label"
  26. :value="item.value"
  27. >
  28. </el-option>
  29. </el-select>
  30. </el-form-item>
  31. </el-col>
  32. <el-col :span="6">
  33. <el-form-item
  34. label="竞价截止时间"
  35. label-width="110px"
  36. prop="endtime"
  37. class="clear"
  38. >
  39. <el-date-picker
  40. v-model="ruleForm.endtime"
  41. type="datetime"
  42. value-format="yyyy-MM-dd HH:mm:ss"
  43. style="width: 100%"
  44. :picker-options="pickerOptions"
  45. placeholder="竞价截止时间"
  46. >
  47. </el-date-picker>
  48. </el-form-item>
  49. </el-col>
  50. <el-col :span="12">
  51. <el-form-item label="所属平台" prop="platform_code" class="clear">
  52. <search-terrace
  53. :value="ruleForm.platform_code"
  54. :disabled="type === 'view' || ruleForm.is_project === '1'"
  55. :size="'mini'"
  56. :is_show="'1'"
  57. :isDetail="type === 'view'"
  58. :names="platform_code_name"
  59. :placeholder="'所属平台'"
  60. @searchChange="platform_code_codesearchChange"
  61. />
  62. </el-form-item>
  63. </el-col>
  64. <el-col :span="12">
  65. <el-form-item label="销售方" prop="companyNo" class="clear">
  66. <el-input :value="getCompanyWithCode(ruleForm.companyNo).name" disabled />
  67. </el-form-item>
  68. </el-col>
  69. <el-col :span="12">
  70. <el-form-item label="购买方" prop="khNo" class="clear">
  71. <search-customer
  72. :value="ruleForm.khNo"
  73. :names="ruleForm.customer_name"
  74. :placeholder="'购买方公司'"
  75. :size="'mini'"
  76. @searchChange="customerChange"
  77. :disabled="type === 'view' || ruleForm.is_project === '1'"
  78. :is-detail="type === 'view' || ruleForm.is_project === '1'"
  79. />
  80. </el-form-item>
  81. </el-col>
  82. <el-col :span="24" v-if="ruleForm.is_project === '1'">
  83. <el-form-item label="项目信息" prop="projectNo" class="clear">
  84. <show-data-table
  85. :newTime="fnewTime"
  86. v-if="fnewTime !== '' && ruleForm.projectNo !== ''"
  87. :sitem="projectSitem"
  88. border
  89. :columns="projectColumns"
  90. />
  91. <div class="hasHover" v-else @click="showProjectModel = true">
  92. <el-alert
  93. center
  94. show-icon
  95. title="点击此处选择项目"
  96. type="warning"
  97. :closable="false"
  98. />
  99. </div>
  100. </el-form-item>
  101. </el-col>
  102. <el-col :span="24" v-if="ruleForm.is_project === '1'">
  103. <el-form-item label="项目商品要求" class="clear" required>
  104. <el-table
  105. ref="multipleTable"
  106. :data="ptableData"
  107. :size="'mini'"
  108. border
  109. stripe
  110. tooltip-effect="dark"
  111. style="width: 100%"
  112. @selection-change="handleSelectionChange"
  113. >
  114. <el-table-column type="selection" width="40"> </el-table-column>
  115. <el-table-column label="商品阶梯" width="70px">
  116. <template slot-scope="scope"> {{ scope.$index + 1 }}</template>
  117. </el-table-column>
  118. <el-table-column prop="good_type" label="商品类型" width="80px">
  119. <template slot-scope="scope">
  120. <el-tag
  121. :size="'mini'"
  122. v-text="
  123. (
  124. statusOptions.find((item) => item.value == scope.row.good_type) ||
  125. {}
  126. ).label || '--'
  127. "
  128. ></el-tag
  129. ></template>
  130. </el-table-column>
  131. <el-table-column prop="budget_price" label="预算单价" width="110" />
  132. <el-table-column prop="num" label="购买数量" width="110" />
  133. <el-table-column prop="cat_name" label="商品分类" />
  134. <el-table-column prop="good_img" label="图片" width="50">
  135. <template slot-scope="scope">
  136. <div
  137. v-if="scope.row.good_img"
  138. style="width: 20px; height: 20px"
  139. class="hover"
  140. v-viewer
  141. >
  142. <img
  143. :src="scope.row.good_img"
  144. style="display: inline-block; width: 100%; height: 100%"
  145. alt=""
  146. />
  147. </div>
  148. </template>
  149. </el-table-column>
  150. <el-table-column prop="good_name" label="商品名称" />
  151. </el-table>
  152. </el-form-item>
  153. </el-col>
  154. <el-col :span="24">
  155. <el-form-item label="竞价商品要求" class="clear" required>
  156. <el-table :data="tableData" stripe border :size="'mini'" style="width: 100%">
  157. <el-table-column
  158. prop="arrival_time"
  159. label="到货时间"
  160. width="100"
  161. show-overflow-tooltip
  162. />
  163. <el-table-column
  164. prop="budget_price"
  165. label="预算单价"
  166. show-overflow-tooltip
  167. width="110"
  168. />
  169. <el-table-column prop="num" label="购买数量" show-overflow-tooltip width="80">
  170. <template slot-scope="scope">
  171. <span>{{ scope.row.num }}</span
  172. ><span>{{ scope.row.unit_name }}</span>
  173. </template>
  174. </el-table-column>
  175. <el-table-column
  176. prop="cat_id_name"
  177. label="商品分类"
  178. show-overflow-tooltip
  179. min-width="170"
  180. />
  181. <el-table-column
  182. prop="good_img"
  183. label="图片"
  184. width="50"
  185. show-overflow-tooltip
  186. >
  187. <template slot-scope="scope">
  188. <img
  189. v-viewer
  190. style="width: 23px; height: 23px; margin: 0 5px 0 0"
  191. class="fl"
  192. v-if="scope.row.good_img"
  193. :src="scope.row.good_img"
  194. alt=""
  195. />
  196. </template>
  197. </el-table-column>
  198. <el-table-column
  199. prop="good_name"
  200. label="商品名称"
  201. show-overflow-tooltip
  202. min-width="170"
  203. />
  204. <el-table-column
  205. prop="specinfo"
  206. label="商品规格"
  207. show-overflow-tooltip
  208. width="170"
  209. >
  210. <template slot-scope="scope">
  211. <span v-for="(si, sii) in scope.row.specinfo" :key="si.spec_name + sii"
  212. ><span v-if="sii !== 0">-</span>{{ si.spec_name }}:[{{
  213. si.spec_value_name
  214. }}]</span
  215. >
  216. </template>
  217. </el-table-column>
  218. <el-table-column
  219. prop="is_addrs"
  220. label="是否多地"
  221. width="70"
  222. show-overflow-tooltip
  223. >
  224. <template slot-scope="scope">
  225. {{ scope.row.is_addrs === "1" ? "多地" : "一地" }}
  226. </template>
  227. </el-table-column>
  228. <el-table-column
  229. prop="is_custom"
  230. label="是否定制"
  231. width="70"
  232. show-overflow-tooltip
  233. >
  234. <template slot-scope="scope">
  235. {{ scope.row.is_custom === "1" ? "定制" : "非定制" }}
  236. </template>
  237. </el-table-column>
  238. <el-table-column fixed="right" width="80">
  239. <template slot="header" slot-scope="scope">
  240. <span>操作</span>
  241. <el-tooltip
  242. class="item"
  243. effect="dark"
  244. v-if="status === ''"
  245. content="添加活动商品"
  246. placement="top"
  247. >
  248. <i
  249. class="el-icon-circle-plus-outline fr"
  250. style="font-size: 18px; margin-top: 2px"
  251. @click="openEdit(-1, {})"
  252. />
  253. </el-tooltip>
  254. </template>
  255. <template slot-scope="scope">
  256. <el-tooltip effect="dark" content="修改" placement="top">
  257. <i
  258. class="el-icon-edit tb-icon"
  259. @click="openEdit(scope.$index, scope.row)"
  260. ></i>
  261. </el-tooltip>
  262. <el-tooltip
  263. v-if="status === ''"
  264. effect="dark"
  265. content="删除"
  266. placement="top"
  267. >
  268. <i
  269. class="el-icon-delete tb-icon"
  270. @click="openCostEditDelete(scope.$index)"
  271. ></i>
  272. </el-tooltip>
  273. </template>
  274. </el-table-column>
  275. </el-table>
  276. </el-form-item>
  277. <add-edit-good-modal
  278. :showModel="showModel"
  279. :sitem="editItem"
  280. :company-no="currentCompany"
  281. @cancel="showModel = false"
  282. @refresh="editGoodRefresh"
  283. />
  284. <search-project-modal
  285. :once="true"
  286. :showModel="showProjectModel"
  287. @cancel="showProjectModel = false"
  288. :status="'1'"
  289. @searchChange="projectChange"
  290. />
  291. </el-col>
  292. <el-col :span="24" style="text-align: right" v-if="id === 'add'">
  293. <el-button type="primary" @click="submitForm" :size="'mini'">保 存</el-button>
  294. </el-col>
  295. </el-row>
  296. </el-form>
  297. </template>
  298. <script>
  299. import asyncRequest from "@/apis/service/sellOut/zixunOrder";
  300. import resToken from "@/mixins/resToken";
  301. import addEditGoodModal from "./addEditGoodModal";
  302. import { mapGetters } from "vuex";
  303. import { projectColumns } from "./ShowDataTableColumns";
  304. import searchProjectModal from "@/components/search-project-modal/index.vue";
  305. import companyHelper from '@/mixins/companyHelper'
  306. export default {
  307. name: "handover",
  308. props: ["id", "sitem", "newTime"],
  309. mixins: [resToken, companyHelper],
  310. components: {
  311. addEditGoodModal,
  312. searchProjectModal,
  313. },
  314. computed: {
  315. ...mapGetters(["business_companyNo"]),
  316. powers() {
  317. const { btnList } = this.$store.getters
  318. const tran = btnList.find( (item) => item.menu_route == "zixunOrderDetail") || {};
  319. const { action } = tran ?? {};
  320. return action ?? [];
  321. },
  322. },
  323. data() {
  324. return {
  325. showProjectModel: false,
  326. multipleSelection: [],
  327. fnewTime: "",
  328. pay_name: "",
  329. // 表格 - 数据
  330. tableData: [],
  331. ptableData: [],
  332. showModel: false,
  333. editItem: {},
  334. options: [
  335. { value: "0", label: "非项目" },
  336. { value: "1", label: "项目" },
  337. ],
  338. statusOptions: [
  339. { value: "1", label: "竞品" },
  340. { value: "2", label: "竞聘" },
  341. ],
  342. configOptions: ["证书", "包装盒", "绒布袋", "标签", "其他"],
  343. poptions: [],
  344. loading: false,
  345. selectLoading: false,
  346. pickerOptions: {
  347. disabledDate(time) {
  348. return time.getTime() < Date.now() - 60 * 60 * 24 * 1000;
  349. },
  350. },
  351. status: "", //存储详情接口返的状态
  352. ruleForm: {
  353. is_project: "0", //竞价类型 1非项目2项目,
  354. projectNo: "", //项目编号
  355. khNo: [], //客户编号
  356. customer_name: "", //客户名称
  357. companyNo: "",
  358. endtime: "", //竞价截止时间
  359. pendtime: "", //项目竞价截止时间
  360. platform_code: "", //平台id
  361. use_desc: "",
  362. budget_total: "",
  363. arrtime: "",
  364. },
  365. rulesThis: this.rules,
  366. projectColumns,
  367. projectSitem: null,
  368. // 验证规则
  369. rules: {
  370. companyNo: [
  371. {
  372. required: true,
  373. message: "请选择销售方公司",
  374. trigger: "change",
  375. },
  376. ],
  377. khNo: [
  378. {
  379. type: "array",
  380. required: true,
  381. message: "请选择购买方公司",
  382. trigger: "change",
  383. },
  384. ],
  385. platform_code: [
  386. {
  387. required: true,
  388. message: "请选择所属平台",
  389. trigger: "change",
  390. },
  391. ],
  392. pay_id: [
  393. {
  394. required: true,
  395. message: "请选择支付渠道",
  396. trigger: "change",
  397. },
  398. ],
  399. endtime: [
  400. {
  401. required: true,
  402. message: "竞价截止时间不能为空",
  403. trigger: "change",
  404. },
  405. ],
  406. is_project: [
  407. {
  408. required: true,
  409. message: "请选择竞价类型!",
  410. trigger: "change",
  411. },
  412. ],
  413. projectNo: [
  414. {
  415. required: true,
  416. message: "请选择项目",
  417. trigger: "change",
  418. },
  419. ],
  420. },
  421. };
  422. },
  423. async mounted() {
  424. await this.initForm();
  425. await this.onCompanyChange()
  426. },
  427. watch: {
  428. id: function (val) {
  429. if (val) {
  430. this.initForm();
  431. }
  432. },
  433. newTime: function (val) {
  434. if (val) {
  435. this.initForm();
  436. }
  437. },
  438. },
  439. methods: {
  440. onCompanyChange(){
  441. this.ruleForm.companyNo = this.currentCompany
  442. },
  443. async initForm() {
  444. this.loading = true;
  445. this.status = "";
  446. this.rulesThis = this.rules;
  447. this.disabled = false;
  448. await this.resetForm();
  449. this.getNewTime();
  450. this.loading = false;
  451. },
  452. openEdit(index, editItem) {
  453. const { is_project } = this.ruleForm;
  454. if(!this.currentIsBusinessCompany()) return
  455. if (index + "" == "-1" && is_project === "1") {
  456. if (this.multipleSelection.length === 0) {
  457. this.$message.warning("请选择一个项目商品要求!");
  458. return;
  459. }
  460. if (this.multipleSelection.length > 1) {
  461. this.$message.warning("每次创建只能选择一个项目商品要求!");
  462. return;
  463. }
  464. const {
  465. cat_info,
  466. budget_price,
  467. pgNo,
  468. num,
  469. good_type,
  470. good_name,
  471. good_img,
  472. } = this.multipleSelection[0];
  473. let cat_id = [];
  474. if (cat_info && cat_info.length > 0) {
  475. cat_info.forEach((e) => {
  476. cat_id.push(e.id);
  477. });
  478. }
  479. this.editItem = {
  480. p_cat_info: cat_info,
  481. p_cat_id: cat_id,
  482. p_budget_price: budget_price,
  483. p_pgNo: pgNo,
  484. p_num: num,
  485. p_good_type: good_type,
  486. p_good_name: good_name,
  487. p_good_img: good_img,
  488. p_arrtime: this.projectSitem.arrtime
  489. };
  490. this.editItem.index = index;
  491. this.showModel = true;
  492. } else {
  493. this.editItem = editItem;
  494. this.editItem.index = index;
  495. this.showModel = true;
  496. }
  497. },
  498. handleSelectionChange(val) {
  499. this.multipleSelection = val;
  500. },
  501. editGoodRefresh(e) {
  502. console.log(e);
  503. const { index } = e;
  504. if (index + "" === "-1") {
  505. this.tableData.push(JSON.parse(JSON.stringify(e)));
  506. } else {
  507. const fsindex = parseInt(index + "");
  508. this.tableData[fsindex] = JSON.parse(JSON.stringify(e));
  509. this.$set(this.tableData, fsindex, this.tableData[fsindex]);
  510. }
  511. this.showModel = false;
  512. },
  513. openCostEditDelete(index) {
  514. this.tableData.splice(index, 1);
  515. },
  516. async resetForm() {
  517. this.resign_name = "";
  518. this.hand_name = "";
  519. this.status = "";
  520. // 重置
  521. await this.$nextTick(async () => {
  522. if (this.$refs.ruleForm) {
  523. this.$refs.ruleForm.resetFields();
  524. this.$refs.ruleForm.clearValidate();
  525. let {
  526. is_project, //竞价类型 1销售2竞价,
  527. projectNo, //项目编号
  528. khNo, //客户编号
  529. customer_name, //客户名称
  530. companyNo,
  531. endtime, //竞价截止时间
  532. platform_code, //平台id
  533. ladder,
  534. pay_id,
  535. pay_name,
  536. } = this.sitem;
  537. this.ruleForm = {
  538. is_project: is_project || "0", //竞价类型 1项目 0 非项目
  539. projectNo: projectNo || "", //项目编号
  540. khNo: khNo ? [khNo] : [], //客户编号
  541. customer_name: customer_name || "", //客户名称
  542. companyNo: companyNo || this.business_companyNo || "",
  543. endtime: endtime || "", //竞价截止时间
  544. platform_code: platform_code || "", //平台id
  545. use_desc: "",
  546. budget_total: "",
  547. arrtime: "",
  548. pay_id: pay_id || "",
  549. };
  550. this.tableData =
  551. ladder && ladder.length > 0 ? JSON.parse(JSON.stringify(ladder)) : [];
  552. this.pay_name =
  553. pay_id + "" == "0" ? "不选择" : pay_id + "" === "" ? "" : pay_name;
  554. if (this.ruleForm.projectNo) {
  555. await this.projectChange([{ projectNo: this.ruleForm.projectNo }]);
  556. }
  557. }
  558. });
  559. },
  560. async submitForm() {
  561. await this.$refs.ruleForm.validate(async (valid) => {
  562. if (valid) {
  563. if (this.loading) return;
  564. this.loading = true;
  565. if (this.tableData.length === 0) {
  566. this.$message.warning("至少提供一条商品要求!");
  567. this.loading = false;
  568. return;
  569. }
  570. let model = JSON.parse(JSON.stringify(this.ruleForm));
  571. const { is_project, endtime } = model;
  572. const pendtime = this.projectSitem ? this.projectSitem.endtime : "";
  573. if (
  574. is_project === "1" &&
  575. new Date(endtime).getTime() > new Date(pendtime).getTime()
  576. ) {
  577. this.$message.warning("竞价截止时间不能晚于项目竞价截止时间!");
  578. this.loading = false;
  579. return;
  580. }
  581. if (new Date(endtime).getTime() <= new Date().getTime()) {
  582. this.$message.warning("竞价截止时间应该大于当前时间!");
  583. this.loading = false;
  584. return;
  585. }
  586. model.khNo = model.khNo.toString();
  587. model.projectNo = model.projectNo.toString();
  588. model.ladder = [];
  589. model.companyNo = this.currentCompany
  590. let list = JSON.parse(JSON.stringify(this.tableData));
  591. list.forEach((e) => {
  592. let im = {
  593. good_name: e.good_name,
  594. good_img: e.good_img,
  595. cat_id: e.cat_id[e.cat_id.length - 1],
  596. unit: e.unit.toString(),
  597. brand_id: e.brand_id.toString(),
  598. arrival_time: e.arrival_time,
  599. cost_desc: e.cost_desc,
  600. is_addrs: e.is_addrs,
  601. is_custom: e.is_custom,
  602. metal_id: e.metal_id,
  603. config: e.config.toString(),
  604. other_config: e.other_config,
  605. specs_weight: e.specs_weight,
  606. gold_price: e.gold_price,
  607. budget_price: e.budget_price,
  608. num: e.num,
  609. use_desc: e.use_desc,
  610. remark: e.remark,
  611. pgNo: e.pgNo,
  612. total_weight: e.total_weight,
  613. is_gold_price: e.is_gold_price,
  614. enclosure_file: e.enclosure_file,
  615. specinfo: [],
  616. };
  617. e.specinfo.forEach((a) => {
  618. let am = {
  619. specid: a.specid,
  620. spec_value_id: a.spec_value_id,
  621. };
  622. im.specinfo.push(am);
  623. });
  624. model.ladder.push(im);
  625. });
  626. console.log(model);
  627. const { code, data, message } = await asyncRequest.add(model);
  628. this.loading = false;
  629. if (code === 0) {
  630. this.$notify.success({
  631. title: "创建成功!",
  632. message: "",
  633. });
  634. this.$emit("refresh", true);
  635. } else if (code >= 100 && code <= 104) {
  636. await this.logout();
  637. } else {
  638. this.$message.warning(message);
  639. }
  640. } else {
  641. console.log("error submit!!");
  642. return false;
  643. }
  644. });
  645. },
  646. //项目选择
  647. async projectChange(e) {
  648. const { is_project } = this.ruleForm;
  649. if (is_project + "" === "1") {
  650. const key = e && e.length > 0 ? e[0].projectNo : "";
  651. if (key) {
  652. const { code, data, message } = await asyncRequest.pdetail({
  653. projectNo: key,
  654. });
  655. if (code === 0) {
  656. const {
  657. khNo,
  658. khName,
  659. pay_id,
  660. pay_name,
  661. platform_id,
  662. platform_name,
  663. ladder,
  664. companyNo,
  665. company,
  666. } = data;
  667. this.ruleForm.projectNo = key;
  668. this.projectSitem = JSON.parse(JSON.stringify(data));
  669. //平台赋值
  670. this.platform_code_codesearchChange({
  671. id: platform_id,
  672. code: platform_id,
  673. label: platform_name,
  674. });
  675. //支付渠道赋值
  676. this.pay_id_change({
  677. id: pay_id,
  678. code: pay_id,
  679. label: pay_id + "" == "0" ? "不选择" : pay_name,
  680. });
  681. //销售方公司赋值
  682. this.company_idsearchChange({
  683. id: companyNo,
  684. code: companyNo,
  685. label: company,
  686. });
  687. //购买方公司赋值
  688. this.customerChange({
  689. id: khNo,
  690. code: khNo,
  691. label: khName,
  692. });
  693. this.ptableData = ladder;
  694. this.ptableData.forEach((e) => {
  695. e.cat_name = "";
  696. const { cat_info } = e;
  697. if (cat_info && cat_info.length > 0) {
  698. cat_info.forEach((b, bi) => {
  699. e.cat_name += bi !== 0 ? "/" + b.name : b.name;
  700. });
  701. }
  702. });
  703. this.tableData = [];
  704. } else if (code >= 100 && code <= 104) {
  705. await this.logout();
  706. this.resetProject();
  707. } else {
  708. this.$message.warning(message);
  709. this.resetProject();
  710. }
  711. } else {
  712. //平台赋值
  713. this.platform_code_codesearchChange({
  714. id: "",
  715. code: "",
  716. label: "",
  717. });
  718. //支付渠道赋值
  719. this.pay_id_change({
  720. id: "",
  721. code: "",
  722. label: "",
  723. });
  724. //销售方公司赋值
  725. this.company_idsearchChange({
  726. id: "",
  727. code: "",
  728. label: "",
  729. });
  730. //购买方公司赋值
  731. this.customerChange({
  732. id: "",
  733. code: "",
  734. label: "",
  735. });
  736. this.resetProject();
  737. }
  738. } else {
  739. this.resetProject();
  740. }
  741. this.getNewTime();
  742. },
  743. resetProject() {
  744. this.ruleForm.projectNo = "";
  745. this.projectSitem = null;
  746. this.ptableData = [];
  747. this.tableData = [];
  748. },
  749. //平台选择
  750. platform_code_codesearchChange(e) {
  751. const { id, code, label } = e;
  752. this.ruleForm.platform_code = id || "";
  753. this.$refs.ruleForm.validateField("platform_code");
  754. },
  755. //支付渠道选择
  756. pay_id_change(e) {
  757. const { id, code, label } = e;
  758. this.ruleForm.pay_id = id || "";
  759. this.pay_name = label || "";
  760. this.$refs.ruleForm.validateField("pay_id");
  761. },
  762. //销售方公司选择
  763. company_idsearchChange(e) {
  764. const { id, code, label } = e;
  765. this.ruleForm.companyNo = code || "";
  766. this.$refs.ruleForm.validateField("companyNo");
  767. },
  768. //购买方公司选择
  769. customerChange(e) {
  770. const { id, code, label } = e;
  771. this.ruleForm.khNo = code ? [code] : [];
  772. this.ruleForm.customer_name = label ? label : "";
  773. this.$refs.ruleForm.validateField("khNo");
  774. },
  775. getNewTime() {
  776. this.fnewTime = new Date().valueOf();
  777. },
  778. },
  779. };
  780. </script>
  781. <style lang="scss" scoped>
  782. .el-form-item-error-img {
  783. width: 100%;
  784. ul {
  785. width: 100%;
  786. li {
  787. float: left;
  788. border: 1px solid rgb(220, 223, 230);
  789. // border-left: 0;
  790. box-sizing: border-box;
  791. width: 254px;
  792. height: 164px;
  793. line-height: 164px;
  794. position: relative;
  795. img {
  796. display: inline-block;
  797. width: 100%;
  798. height: 100%;
  799. }
  800. .el-icon-close {
  801. position: absolute;
  802. top: 0;
  803. right: 0;
  804. z-index: 2;
  805. width: 25px;
  806. height: 25px;
  807. text-align: center;
  808. line-height: 25px;
  809. font-size: 19px;
  810. &:hover {
  811. color: #6954f0;
  812. }
  813. }
  814. }
  815. }
  816. }
  817. .images_li {
  818. // width: 254px;
  819. // height: 164px;
  820. float: left;
  821. }
  822. .btnupload {
  823. float: left;
  824. border: 1px solid rgb(220, 223, 230);
  825. // border-left: 0;
  826. box-sizing: border-box;
  827. width: 254px;
  828. height: 164px;
  829. line-height: 164px;
  830. text-align: center;
  831. }
  832. .Upload {
  833. width: 254px;
  834. height: 164px;
  835. line-height: 164px;
  836. text-align: center;
  837. position: absolute;
  838. line-height: 0px;
  839. top: 0;
  840. left: 0;
  841. z-index: 2;
  842. line-height: 164px;
  843. }
  844. .avatar-uploader-icon {
  845. font-size: 33px;
  846. color: #8c939d;
  847. width: 50px;
  848. height: 50px;
  849. line-height: 50px;
  850. text-align: center;
  851. }
  852. </style>