index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783
  1. <template>
  2. <div class="addStore pagePadding">
  3. <div
  4. v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
  5. >
  6. 123{{}}
  7. <el-form
  8. ref="ruleForm"
  9. :model="ruleForm"
  10. status-icon
  11. :rules="rulesThis"
  12. label-width="100px"
  13. class="demo-ruleForm"
  14. v-if="addId === 'add'"
  15. >
  16. <el-divider content-position="center">仓库信息:</el-divider>
  17. <el-row>
  18. <el-col :span="12"
  19. ><el-form-item
  20. label="所属公司"
  21. prop="storeToCompany"
  22. style="width: 100%"
  23. >
  24. <search-supplier @searchCard="getCompanyName"></search-supplier>
  25. </el-form-item>
  26. </el-col>
  27. <el-col :span="12">
  28. <el-form-item label="仓库名称" prop="accountName">
  29. <el-input
  30. placeholder="请输入仓库名称"
  31. filterable
  32. clearable
  33. v-model="ruleForm.accountName"
  34. @change="getValue1"
  35. >
  36. </el-input>
  37. </el-form-item>
  38. </el-col>
  39. </el-row>
  40. <el-row>
  41. <el-col :span="12">
  42. <!-- 省/市/区选择组件 -->
  43. <el-form-item label="省/市/区" prop="accountToArea">
  44. <select-area @areaSelect="areaSelect"></select-area>
  45. </el-form-item>
  46. </el-col>
  47. <el-col :span="12"
  48. ><!-- 仓库详细地址 -->
  49. <el-form-item label="详细地址" prop="accountDetail">
  50. <el-input
  51. placeholder="请输入内容"
  52. v-model="ruleForm.accountDetail"
  53. clearable
  54. @change="accountDetail"
  55. >
  56. </el-input>
  57. </el-form-item>
  58. </el-col>
  59. </el-row>
  60. <el-row>
  61. <el-col :span="12">
  62. <el-form-item label="负责人" prop="accountDutyer" style="width: 100%">
  63. <search-account
  64. :size="searchSize"
  65. :code="accountNo"
  66. :placeholder="'请输入负责人'"
  67. :is-detail="true"
  68. :disabled="false"
  69. :names="accountNames"
  70. @change="accountChange"
  71. />
  72. </el-form-item></el-col
  73. >
  74. <el-col :span="12">
  75. <el-form-item label="负责人电话" prop="dutyer_mobile">
  76. <el-input
  77. type="number"
  78. placeholder="请输入联系人电话"
  79. v-model="ruleForm.dutyer_mobile"
  80. clearable
  81. >
  82. </el-input> </el-form-item
  83. ></el-col>
  84. </el-row>
  85. <el-divider content-position="center">收发货信息:</el-divider>
  86. <!-- 收发货联系信息 -->
  87. <el-row>
  88. <el-col :span="12"
  89. ><!-- 收发货联系人 -->
  90. <el-form-item label="联系人" prop="linker">
  91. <el-input
  92. placeholder="请填写联系人"
  93. v-model="ruleForm.linker"
  94. clearable
  95. @change="linker"
  96. >
  97. </el-input> </el-form-item
  98. ></el-col>
  99. <el-col :span="12">
  100. <!-- 联系人电话 -->
  101. <el-form-item label="电话" prop="linker_mobile">
  102. <el-input
  103. type="number"
  104. placeholder="请输入联系人电话"
  105. v-model="ruleForm.linker_mobile"
  106. clearable
  107. @change="linkerMobile"
  108. >
  109. </el-input> </el-form-item
  110. ></el-col>
  111. </el-row>
  112. <el-row>
  113. <el-col :span="12">
  114. <!-- 收发货地址 -->
  115. <el-form-item label="省/市/区" prop="linker_addr">
  116. <select-area @areaSelect="selectArea"/> </el-form-item
  117. ></el-col>
  118. <el-col :span="12">
  119. <!-- 收发货详细地址 -->
  120. <el-form-item label="详细地址" prop="linker_detail">
  121. <el-input
  122. placeholder="请输入详细地址"
  123. v-model="ruleForm.linker_detail"
  124. clearable
  125. @change="linkerDetail"
  126. >
  127. </el-input> </el-form-item
  128. ></el-col>
  129. </el-row>
  130. </el-form>
  131. <!-- 仓库详情 -->
  132. <el-form
  133. ref="ruleForm"
  134. :disabled="addId === 'detail'"
  135. :model="ruleForm"
  136. status-icon
  137. :rules="rulesThis"
  138. label-width="100px"
  139. class="demo-ruleForm"
  140. v-if="addId === 'detail'"
  141. >
  142. <el-divider content-position="center">仓库信息:</el-divider>
  143. <el-row>
  144. <el-col :span="12"
  145. ><el-form-item label="所属公司" prop="storeToCompany">
  146. <el-cascader
  147. placeholder="请选择所属公司"
  148. filterable
  149. clearable
  150. style="width: 100%"
  151. v-model="ruleForm.storeToCompany"
  152. :options="ruleForm.selectaccount_go_options"
  153. @change="getValue"
  154. ></el-cascader>
  155. </el-form-item>
  156. </el-col>
  157. <el-col :span="12">
  158. <el-form-item label="仓库名称" prop="accountName">
  159. <el-input
  160. placeholder="请输入仓库名称"
  161. filterable
  162. clearable
  163. v-model="ruleForm.accountName"
  164. @change="getValue1"
  165. >
  166. </el-input>
  167. </el-form-item>
  168. </el-col>
  169. </el-row>
  170. <el-row>
  171. <el-col :span="12">
  172. <!-- 省/市/区选择组件 -->
  173. <el-form-item label="省/市/区" prop="accountToArea">
  174. <select-area @areaSelect="areaSelect"></select-area>
  175. </el-form-item>
  176. </el-col>
  177. <el-col :span="12"
  178. ><!-- 仓库详细地址 -->
  179. <el-form-item label="详细地址" prop="accountDetail">
  180. <el-input
  181. placeholder="请输入内容"
  182. v-model="ruleForm.accountDetail"
  183. clearable
  184. @change="accountDetail"
  185. >
  186. </el-input>
  187. </el-form-item>
  188. </el-col>
  189. </el-row>
  190. <el-form-item label="负责人" prop="accountDutyer" style="width: 50%">
  191. <el-select
  192. style="width: 100%"
  193. v-model="ruleForm.accountDutyer"
  194. placeholder="请选择仓库负责人"
  195. >
  196. <el-option
  197. v-for="item in ruleForm.accountDutyer_options"
  198. :key="item.id"
  199. :label="item.nickname"
  200. :value="item.id"
  201. >
  202. {{ item }}
  203. <!-- <span style="float: left">{{ item.nickname }}</span>
  204. <span style="float: right; color: #8492a6; font-size: 13px">{{
  205. item.role_name
  206. }}</span> -->
  207. </el-option>
  208. </el-select>
  209. </el-form-item>
  210. <el-divider content-position="center">收发货信息:</el-divider>
  211. <!-- 收发货联系信息 -->
  212. <el-row>
  213. <el-col :span="12"
  214. ><!-- 收发货联系人 -->
  215. <el-form-item label="联系人" prop="linker">
  216. <el-input
  217. placeholder="请填写联系人"
  218. v-model="ruleForm.linker"
  219. clearable
  220. @change="linker"
  221. >
  222. </el-input> </el-form-item
  223. ></el-col>
  224. <el-col :span="12">
  225. <!-- 联系人电话 -->
  226. <el-form-item label="电话" prop="linker_mobile">
  227. <el-input
  228. type="number"
  229. placeholder="请输入联系人电话"
  230. v-model="ruleForm.linker_mobile"
  231. clearable
  232. @change="linkerMobile"
  233. >
  234. </el-input> </el-form-item
  235. ></el-col>
  236. </el-row>
  237. <el-row>
  238. <el-col :span="12">
  239. <!-- 收发货地址 -->
  240. <el-form-item label="省/市/区" prop="linker_addr">
  241. <select-area @areaSelect="selectArea"></select-area> </el-form-item
  242. ></el-col>
  243. <el-col :span="12">
  244. <!-- 收发货详细地址 -->
  245. <el-form-item label="详细地址" prop="linker_detail">
  246. <el-input
  247. placeholder="请输入详细地址"
  248. v-model="ruleForm.linker_detail"
  249. clearable
  250. @change="linkerDetail"
  251. >
  252. </el-input> </el-form-item
  253. ></el-col>
  254. </el-row>
  255. </el-form>
  256. <el-col :span="24" style="text-align: right">
  257. <el-button
  258. v-if="addId === 'add'"
  259. type="primary"
  260. @click="submitForm('ruleForm')"
  261. >保 存
  262. </el-button>
  263. <el-button @click="showModelThis = false">{{
  264. isDetail ? "关 闭" : "取 消"
  265. }}</el-button>
  266. </el-col>
  267. </div>
  268. <div v-else>
  269. <no-auth></no-auth>
  270. </div>
  271. </div>
  272. </template>
  273. <script>
  274. import asyncRequest from "@/apis/service/purchaseIn/addStore";
  275. // import resToken from "@/mixins/resToken";
  276. import mixinPage from "@/mixins/elPaginationHandle";
  277. import resToken from "@/mixins/resToken";
  278. // import statusList from "@/assets/js/statusList";
  279. import addEdit from "./addEdit";
  280. import { mapGetters } from "vuex";
  281. import { isMobile } from "@/utils/validate";
  282. export default {
  283. name: "addStore",
  284. // props: ["showModel", "id", "isDetail", "sitem"],
  285. // mixins: [resToken],
  286. mixins: [mixinPage, resToken],
  287. components: {
  288. addEdit,
  289. },
  290. computed: {
  291. ...mapGetters(["tablebtnSize", "searchSize", "size"]),
  292. powers() {
  293. let tran =
  294. this.$store.getters.btnList.find(
  295. (item) => item.menu_route == "addStore"
  296. ) || {};
  297. if (tran && tran.action && tran.action.length > 0) {
  298. return tran.action;
  299. } else {
  300. return [];
  301. }
  302. },
  303. },
  304. data() {
  305. const validatemobile = (rule, value, callback) => {
  306. if (value === "") {
  307. callback(new Error("手机号不能为空!"));
  308. } else {
  309. if (!isMobile(value)) {
  310. callback(new Error("手机号格式不正确!"));
  311. } else {
  312. callback();
  313. }
  314. }
  315. };
  316. return {
  317. stockNo: [""],
  318. stockNames: "",
  319. accountDutyer: "", //仓库负责人
  320. // addId: this.$route.query.id,
  321. addId: "",
  322. // route: this.$route,
  323. roleList: [],
  324. loading: false,
  325. title: "添加账号",
  326. organizeList: [],
  327. showModelThis: this.showModel,
  328. //省市区接口入参
  329. addr_code: {
  330. provice_code: "",
  331. city_code: "",
  332. area_code: "",
  333. },
  334. ruleForm: {
  335. storeToCompany: "",
  336. selectaccount_go: "", //公司
  337. accountName: "", //仓库名称
  338. accountDutyer: "", //仓库负责人
  339. dutyer_mobile: "",
  340. linker: "", //收发货联系人
  341. linker_mobile: "", //收发货人联系电话
  342. linker_detail: "",
  343. // linker_addr: [], //收发货地址
  344. // accountDutyer_options: [], //仓库负责人列表
  345. // accountDetail: [], //仓库详细地址
  346. // selectaccount_go_options: [], //公司列表
  347. // accountToArea: [],
  348. }, //
  349. rulesThis: this.rules,
  350. rules: {
  351. storeToCompany: [
  352. {
  353. // type: "array",
  354. required: true,
  355. message: "请选择仓库所在公司",
  356. trigger: "blur",
  357. // trigger: "change",
  358. },
  359. ],
  360. accountName: [
  361. {
  362. required: true,
  363. message: "请输入仓库名称",
  364. trigger: "blur",
  365. },
  366. ],
  367. accountDutyer: [
  368. {
  369. // type: "array",
  370. required: true,
  371. message: "请选择仓库负责人",
  372. // trigger: "change",
  373. trigger: "blur",
  374. },
  375. ],
  376. accountToArea: [
  377. {
  378. type: "array",
  379. required: true,
  380. message: "请选择仓库所在地址",
  381. trigger: "change",
  382. },
  383. ],
  384. accountDetail: [
  385. {
  386. required: true,
  387. message: "请选择仓库详细地址",
  388. trigger: "blur",
  389. },
  390. ],
  391. linker: [
  392. {
  393. required: true,
  394. message: "请填写收发货联系人",
  395. trigger: "blur",
  396. },
  397. ],
  398. linker_mobile: [
  399. {
  400. required: true,
  401. trigger: "blur",
  402. validator: validatemobile,
  403. },
  404. ],
  405. dutyer_mobile: [
  406. {
  407. required: true,
  408. trigger: "blur",
  409. validator: validatemobile,
  410. },
  411. ],
  412. linker_addr: [
  413. {
  414. type: "array",
  415. required: true,
  416. message: "请填写收发货联系人地址",
  417. trigger: "change",
  418. },
  419. ],
  420. linker_detail: [
  421. {
  422. required: true,
  423. message: "请输入详细地址",
  424. trigger: "blur",
  425. },
  426. ],
  427. },
  428. parmValue: {
  429. //入参
  430. name: "", //仓库名称
  431. supplierNo: "", //供应商编码
  432. wsmtype: 1, //仓库类型
  433. addr: "", //仓库地址
  434. contactor: "", //仓库联系人
  435. mobile: "", //仓库联系方式
  436. position: "", //联系人职位
  437. wsm_name: "", // 收发货联系人
  438. wsm_mobile: "", //收发货联系方式
  439. addr_code: {
  440. provice_code: "",
  441. city_code: "",
  442. area_code: "",
  443. },
  444. wsm_addr: "", //地址详细
  445. },
  446. };
  447. },
  448. watch: {
  449. $route: function (val, old) {
  450. this.addId = val.query.id;
  451. },
  452. },
  453. mounted() {
  454. this.addId = this.$route.query.id;
  455. this.getCompany();
  456. this.initForm();
  457. },
  458. methods: {
  459. stockChange(e) {
  460. console.log(e);
  461. },
  462. // 获取公司列表
  463. getCompanyName(val) {
  464. this.ruleForm.storeToCompany = val[1];
  465. console.log(this.ruleForm.storeToCompany);
  466. },
  467. // 联系人电话
  468. linkerMobile(val) {
  469. this.parmValue.wsm_mobile = val;
  470. },
  471. // 联系人
  472. linker(val) {
  473. this.parmValue.wsm_name = val;
  474. },
  475. // 仓库详细地址
  476. accountDetail(val) {
  477. console.log(val);
  478. this.parmValue.addr = val;
  479. },
  480. //仓库地址选择
  481. areaSelect(val) {
  482. console.log(val);
  483. this.ruleForm.accountToArea = val;
  484. this.parmValue.addr = val;
  485. },
  486. // 收发货地址选择
  487. selectArea(val) {
  488. this.parmValue.addr_code.provice_code = val[0];
  489. this.parmValue.addr_code.city_code = val[1];
  490. this.parmValue.addr_code.area_code = val[2];
  491. this.ruleForm.linker_addr = val;
  492. },
  493. // 收发货详细地址
  494. linkerDetail(val) {
  495. this.parmValue.wsm_addr = val;
  496. },
  497. // 仓库所在公司
  498. getValue(val) {
  499. this.parmValue.supplierNo = val;
  500. },
  501. // 仓库名
  502. getValue1(val) {
  503. this.parmValue.name = val;
  504. },
  505. // 负责人
  506. getValue2(val) {
  507. console.log(val);
  508. this.accountDutyer = val;
  509. },
  510. closeModel() {
  511. console.log("closeModel!!");
  512. },
  513. async initForm() {
  514. this.loading = true;
  515. // await this.getClist();
  516. // await this.getRole();
  517. this.ruleForm = {
  518. accountName: "my-account", //仓库名称
  519. accountDutyer: "", //仓库负责人
  520. linker: "", //收发货联系人
  521. linker_mobile: "", //收发货人联系电话
  522. linker_addr: "", //收发货地址
  523. selectaccount_go_options: [],
  524. accountDutyer_options: [],
  525. };
  526. console.log(this.addId);
  527. if (this.addId === "add") {
  528. console.log("新建仓库节点");
  529. console.log(this.ruleForm);
  530. this.rulesThis = this.rules;
  531. await this.resetForm();
  532. } else if (this.addId === "detail") {
  533. console.log("detail");
  534. this.rulesThis = {};
  535. await this.resetForm(this.sitem);
  536. // await this.initData()
  537. } else {
  538. console.log("当前是编辑按钮");
  539. this.rulesThis = this.rules;
  540. }
  541. this.loading = false;
  542. },
  543. async getClist() {
  544. this.organizeList = [];
  545. const res = await asyncRequest.getClist({});
  546. if (res && res.code === 0 && res.data) {
  547. this.organizeList = res.data;
  548. this.recursion(this.organizeList);
  549. }
  550. },
  551. recursion(list) {
  552. list.map((v) => {
  553. if (v && Array.isArray(v.child)) {
  554. v.value = v.id + "";
  555. v.label = v.name;
  556. if (v.child.length === 0) {
  557. delete v["child"];
  558. } else {
  559. this.recursion(v.child);
  560. }
  561. }
  562. return v;
  563. });
  564. },
  565. async getRole() {
  566. const model = {
  567. status: "", // 状态
  568. level: "", // 姓名
  569. role_name: "",
  570. };
  571. const res = await asyncRequest.getRole(model);
  572. if (res && res.code === 0 && res.data) {
  573. this.roleList = res.data;
  574. this.roleList.map((v1) => {
  575. v1.id += "";
  576. v1.status += "";
  577. return v1;
  578. });
  579. }
  580. },
  581. async resetForm(sitem) {
  582. // 重置
  583. await this.$nextTick(() => {
  584. if (this.$refs.ruleForm) {
  585. this.$refs.ruleForm.resetFields();
  586. this.$refs.ruleForm.clearValidate();
  587. this.ruleForm = {
  588. dutyer_mobile: "18818818818",
  589. accountDetail: "顺义区宏远888",
  590. selectaccount_go: "", //出库仓库
  591. selectaccount_go_options: [], //出库仓库列表
  592. accountName: "my-account", //仓库名称
  593. linker: "张三",
  594. linker_mobile: "13223289230",
  595. linker_detail: "朝阳区太阳城666",
  596. accountDutyer: "", //仓库负责人
  597. accountDutyer_options: [], //仓库负责人列表
  598. };
  599. if (this.id === "add" || this.isDetail) {
  600. this.rules.username[0].required = false;
  601. }
  602. }
  603. });
  604. },
  605. async submitForm(formName) {
  606. let paraValue = {
  607. name: this.ruleForm.accountName,
  608. supplierNo: this.ruleForm.storeToCompany,
  609. wsmtype: "1", //仓库类型
  610. addr: this.ruleForm.accountDetail, //仓库地址
  611. contactor: this.accountDutyer, //仓库联系人职位
  612. mobile: this.ruleForm.dutyer_mobile, //仓库联系人
  613. position: "采购",
  614. // wsm_type:"",后台暂时不用
  615. wsm_name: this.ruleForm.linker,
  616. wsm_mobile: this.ruleForm.linker_mobile,
  617. addr_code: {
  618. // provice_code: this.ruleForm.linker_addr[0],
  619. // city_code: this.ruleForm.linker_addr[1],
  620. // area_code: this.ruleForm.linker_addr[2],
  621. },
  622. wsm_addr: this.ruleForm.linker_detail,
  623. addrs_code: {
  624. // provice_code: this.ruleForm.accountToArea[0],
  625. // city_code: this.ruleForm.accountToArea[1],
  626. // area_code: this.ruleForm.accountToArea[2],
  627. },
  628. };
  629. console.log(paraValue);
  630. console.log(this.ruleForm);
  631. this.$refs[formName].validate((valid) => {
  632. console.log(valid);
  633. if (valid) {
  634. console.log("submit!");
  635. this.getList(paraValue);
  636. } else {
  637. console.log("error submit!!");
  638. return false;
  639. }
  640. });
  641. },
  642. // 表单提交
  643. async getList(paraValue) {
  644. const res = await asyncRequest.add(paraValue);
  645. if (res && res.code === 0 && res.data) {
  646. console.log(res.data);
  647. } else if (res && res.code >= 100 && res.code <= 104) {
  648. await this.logout();
  649. } else {
  650. }
  651. this.loading = false;
  652. },
  653. async getDutyer() {
  654. this.loading = true;
  655. const obj = {
  656. name: "",
  657. page: 1,
  658. size: 15,
  659. status: "",
  660. username: "",
  661. };
  662. const res = await asyncRequest.getlist(obj);
  663. if (res && res.code === 0 && res.data) {
  664. const { list } = res.data;
  665. this.ruleForm.accountDutyer_options = list;
  666. console.log(this.ruleForm.accountDutyer_options);
  667. // console.log(res.data.list);
  668. // res.data.list.forEach((element) => {
  669. // // let dutyer = {
  670. // // label: element.nickname,
  671. // // value: element.depart[0] ? element.depart[0].name : "",
  672. // // };
  673. // // console.log(this.ruleForm.accountDutyer_options);
  674. // this.ruleForm.accountDutyer_options.push(element);
  675. // });
  676. } else if (res && res.code >= 100 && res.code <= 104) {
  677. await this.logout();
  678. } else {
  679. this.tableData = [];
  680. this.pageInfo.total = 0;
  681. }
  682. this.loading = false;
  683. },
  684. async getCompany() {
  685. this.loading = true;
  686. const obj = {
  687. page: 1,
  688. size: 15,
  689. };
  690. const res = await asyncRequest.getCompany(obj);
  691. if (res && res.code === 0 && res.data) {
  692. console.log(res.data.list);
  693. res.data.list.forEach((element) => {
  694. let company = {
  695. label: element.name,
  696. value: element.code,
  697. };
  698. // console.log(this.ruleForm.selectaccount_go_options);
  699. this.ruleForm.selectaccount_go_options.push(company);
  700. // this.ruleForm.accountDutyer_options.push(dutyer);
  701. });
  702. // console.log(this.ruleForm.selectaccount_go_options);
  703. // this.tableData = res.data.list;
  704. // this.pageInfo.total = Number(res.data.count);
  705. } else if (res && res.code >= 100 && res.code <= 104) {
  706. await this.logout();
  707. } else {
  708. this.tableData = [];
  709. this.pageInfo.total = 0;
  710. }
  711. this.getDutyer();
  712. this.loading = false;
  713. },
  714. // 新建仓库
  715. async addaccount() {
  716. this.loading = true;
  717. console.log(this.parmValue);
  718. const res = await asyncRequest.addaccount(this.parmValue);
  719. if (res && res.code === 0 && res.data) {
  720. console.log(res.data.list);
  721. res.data.list.forEach((element) => {
  722. // console.log(element.nickname);
  723. let company = {
  724. label: element.name,
  725. value: element.code,
  726. };
  727. this.ruleForm.selectaccount_go_options.push(company);
  728. // this.ruleForm.accountDutyer_options.push(dutyer);
  729. });
  730. console.log(this.ruleForm.selectaccount_go_options);
  731. // this.tableData = res.data.list;
  732. // this.pageInfo.total = Number(res.data.count);
  733. } else if (res && res.code >= 100 && res.code <= 104) {
  734. await this.logout();
  735. } else {
  736. // this.tableData = [];
  737. // this.pageInfo.total = 0;
  738. }
  739. this.loading = false;
  740. },
  741. // 获取仓库详情
  742. async getStocDetail() {
  743. this.loading = true;
  744. // console.log(this.parmValue);
  745. const res = await asyncRequest.detail(5);
  746. if (res && res.code === 0 && res.data) {
  747. console.log(res.data.list);
  748. res.data.list.forEach((element) => {
  749. // console.log(element.nickname);
  750. let company = {
  751. label: element.name,
  752. value: element.code,
  753. };
  754. this.ruleForm.selectaccount_go_options.push(company);
  755. // this.ruleForm.accountDutyer_options.push(dutyer);
  756. });
  757. console.log(this.ruleForm.selectaccount_go_options);
  758. // this.tableData = res.data.list;
  759. // this.pageInfo.total = Number(res.data.count);
  760. } else if (res && res.code >= 100 && res.code <= 104) {
  761. await this.logout();
  762. } else {
  763. // this.tableData = [];
  764. // this.pageInfo.total = 0;
  765. }
  766. this.loading = false;
  767. },
  768. },
  769. };
  770. </script>
  771. <style lang="scss" scoped>
  772. </style>