add.vue 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never">
  4. <el-form
  5. :model="formData"
  6. ref="formName"
  7. label-width="110px"
  8. :rules="rules"
  9. >
  10. <el-row :gutter="20">
  11. <!-- <el-col :span="8">
  12. <el-form-item label="出库单号" prop="bizNum">
  13. <el-input :value="formData.bizNum" disabled /></el-form-item
  14. ></el-col> -->
  15. <el-col :span="8">
  16. <el-form-item label="出库场景" prop="bizType">
  17. <el-select
  18. filterable
  19. placeholder="请选择"
  20. v-model="formData.bizType"
  21. clearable
  22. @change="handleBizSceneChange"
  23. :disabled="
  24. !!(warehousingMaterialList && warehousingMaterialList.length)
  25. "
  26. >
  27. <el-option
  28. v-for="item in outputSceneState"
  29. :key="item.code"
  30. :value="item.code + ''"
  31. :label="item.label"
  32. ></el-option>
  33. </el-select> </el-form-item
  34. ></el-col>
  35. <el-col :span="8">
  36. <el-form-item
  37. :label="
  38. formData.bizType == 3
  39. ? '销售发货单'
  40. : formData.bizType == 4
  41. ? '领料单'
  42. : formData.bizType == 1
  43. ? '采购退货单'
  44. : '来源单据'
  45. "
  46. prop="sourceBizNo"
  47. :rules="[
  48. { required: true, message: '请选择来源单据', trigger: 'change' }
  49. ]"
  50. v-if="formData.extInfo.assetType == 7 && formData.bizType == 4"
  51. >
  52. <el-select
  53. filterable
  54. v-model="formData.sourceBizNo"
  55. :disabled="
  56. !!(formData.sourceBizNo && warehousingMaterialList.length)
  57. "
  58. clearable
  59. placeholder="请输入"
  60. @change="handleDocumentSourceChange"
  61. >
  62. <el-option
  63. v-for="item in options"
  64. :key="item"
  65. :label="item"
  66. :value="item"
  67. >
  68. </el-option> </el-select
  69. ></el-form-item>
  70. <el-form-item
  71. :label="
  72. formData.bizType == 3
  73. ? '销售发货单'
  74. : formData.bizType == 4
  75. ? '领料单'
  76. : formData.bizType == 1
  77. ? '采购退货单'
  78. : '来源单据'
  79. "
  80. v-else
  81. prop="sourceBizNo"
  82. >
  83. <el-input
  84. @input="$forceUpdate()"
  85. placeholder="请输入"
  86. @change="handleDocumentSourceChange"
  87. v-model="formData.sourceBizNo"
  88. @click.native="
  89. formData.bizType == 4
  90. ? handlePickorder()
  91. : formData.bizType == 3
  92. ? handleEom()
  93. : null
  94. "
  95. >
  96. <el-button
  97. v-if="formData.bizType == 4 || formData.bizType == 3"
  98. slot="append"
  99. icon="el-icon-circle-close"
  100. @click.stop="onClear"
  101. ></el-button>
  102. </el-input>
  103. </el-form-item>
  104. </el-col>
  105. <el-col :span="8">
  106. <el-form-item label="出库物品类型" prop="extInfo.assetType">
  107. <!-- <DictSelection
  108. dictName="类型用途"
  109. :disabled="
  110. !!(warehousingMaterialList && warehousingMaterialList.length)
  111. "
  112. clearable
  113. v-model="formData.extInfo.assetType"
  114. @itemChange="handleChange"
  115. /> -->
  116. <!-- <el-select
  117. :disabled="
  118. !!(warehousingMaterialList && warehousingMaterialList.length)
  119. "
  120. clearable
  121. v-model="formData.extInfo.assetType"
  122. @change="handleChanges"
  123. >
  124. <el-option
  125. v-for="(item, index) in codeList"
  126. :key="index"
  127. :label="item.dictValue"
  128. :value="item.dictCode"
  129. ></el-option>
  130. </el-select> -->
  131. <selectTree
  132. ref="trees"
  133. class="form-ipt"
  134. :isBindPlan="
  135. !!(warehousingMaterialList && warehousingMaterialList.length)
  136. "
  137. size="medium"
  138. style="width: 100%"
  139. clearable
  140. :options="codeList"
  141. :props="{
  142. value: 'id',
  143. label: 'name',
  144. children: 'children'
  145. }"
  146. @getValue="codeListValue"
  147. :isAll="false"
  148. />
  149. </el-form-item>
  150. </el-col>
  151. <el-col :span="8" v-if="formData.bizType == 3">
  152. <el-form-item label="客户名称">
  153. <el-input
  154. placeholder="客户名称"
  155. disabled
  156. v-model="formData.clientName"
  157. clearable /></el-form-item
  158. ></el-col>
  159. <el-col :span="8" v-if="formData.bizType == 3">
  160. <el-form-item label="客户联系人">
  161. <el-input
  162. placeholder="客户联系人"
  163. disabled
  164. v-model="formData.clientUser"
  165. clearable /></el-form-item
  166. ></el-col>
  167. <el-col :span="8" v-if="formData.bizType == 3">
  168. <el-form-item label="客户电话">
  169. <el-input
  170. placeholder="客户电话"
  171. disabled
  172. v-model="formData.clientPhone"
  173. clearable /></el-form-item
  174. ></el-col>
  175. <el-col :span="8">
  176. <el-form-item label="权属部门" prop="deptName">
  177. <el-input
  178. placeholder="权属部门"
  179. disabled
  180. v-model="formData.extInfo.deptName"
  181. clearable
  182. />
  183. </el-form-item>
  184. <!-- <selectTree
  185. ref="tree"
  186. style="width: 100%"
  187. size="medium"
  188. :initStr="formData.deptName"
  189. clearable
  190. :options="treeList"
  191. :props="{
  192. value: 'code',
  193. label: 'name',
  194. children: 'children'
  195. }"
  196. @getValue="deptClick"
  197. /> -->
  198. </el-col>
  199. <el-col :span="8">
  200. <el-form-item label="出库登记人">
  201. <el-input
  202. placeholder="登记人"
  203. disabled
  204. v-model="formData.extInfo.createUserName"
  205. clearable /></el-form-item
  206. ></el-col>
  207. <!-- <el-col :span="8">
  208. <el-form-item label="出库时间" prop="outInTime">
  209. <el-date-picker
  210. v-model="formData.outInTime"
  211. clearable
  212. type="datetime"
  213. value-format="yyyy-MM-dd HH:mm:ss"
  214. placeholder="选择日期"
  215. >
  216. </el-date-picker></el-form-item
  217. ></el-col> -->
  218. <el-col :span="8">
  219. <el-form-item label="领料人部门" prop="verifyDeptName">
  220. <selectTree
  221. ref="tree"
  222. class="form-ipt"
  223. size="medium"
  224. style="width: 100%"
  225. clearable
  226. :options="treeList"
  227. :props="{
  228. value: 'code',
  229. label: 'name',
  230. children: 'children'
  231. }"
  232. @getValue="auditorDeptClick"
  233. />
  234. </el-form-item>
  235. </el-col>
  236. <el-col :span="8">
  237. <el-form-item label="领料人" prop="fromUser">
  238. <el-select
  239. v-model="formData.fromUser"
  240. filterable
  241. placeholder="请选择领料人"
  242. >
  243. <el-option
  244. v-for="item in llrLsit"
  245. :key="item.id"
  246. :label="item.name"
  247. :value="item.id"
  248. @click.native="
  249. () => (formData.extInfo.fromUserPhone = item.phone)
  250. "
  251. >
  252. </el-option>
  253. </el-select> </el-form-item
  254. ></el-col>
  255. <el-col :span="8">
  256. <el-form-item label="领料人联系方式" prop="fromUserPhone">
  257. <el-input
  258. placeholder="请输入"
  259. disabled
  260. v-model="formData.extInfo.fromUserPhone"
  261. clearable /></el-form-item
  262. ></el-col>
  263. <!-- <el-col :span="8">
  264. <el-form-item label="紧急状态" prop="urgent">
  265. <el-select
  266. filterable
  267. placeholder="请选择"
  268. v-model="formData.extInfo.urgent"
  269. clearable
  270. >
  271. <el-option
  272. v-for="item in emergencyState"
  273. :key="item.code"
  274. :value="item.code"
  275. :label="item.label"
  276. ></el-option>
  277. </el-select> </el-form-item
  278. ></el-col> -->
  279. <!-- <el-col :span="8">
  280. <el-form-item label="审核人" prop="verifyId">
  281. <el-select
  282. filterable
  283. class="form-ipt"
  284. style="width: 100%"
  285. v-model="formData.verifyId"
  286. placeholder="请选择"
  287. >
  288. <el-option
  289. v-for="item in staffList"
  290. :key="item.id"
  291. :label="item.name"
  292. :value="item.id"
  293. @click.native="() => (formData.verifyName = item.name)"
  294. >
  295. </el-option>
  296. </el-select>
  297. </el-form-item>
  298. </el-col> -->
  299. <!-- <el-col :span="24">
  300. <el-form-item label="附件" prop="contentImage">
  301. <selectUpload @getImgs="upload" :initData="uploadList" />
  302. </el-form-item>
  303. </el-col> -->
  304. <el-col :span="24">
  305. <el-form-item label="备注" prop="remark">
  306. <el-input
  307. v-model="formData.remark"
  308. clearable
  309. type="textarea"
  310. placeholder="请详细说明"
  311. :rows="4"
  312. ></el-input>
  313. </el-form-item>
  314. </el-col>
  315. </el-row>
  316. </el-form>
  317. <div class="material">
  318. <div style="width: 100%; text-align: right"
  319. ><el-button type="primary" @click="addStock">添加</el-button></div
  320. >
  321. <div v-if="dimension != 4">
  322. <div class="flex">
  323. <div><span class="red">*</span>物品清单</div>
  324. <div>
  325. <!-- <el-button type="primary" @click="addStock">添加</el-button> -->
  326. </div>
  327. </div>
  328. <div class="mt10 form-table">
  329. <el-form
  330. ref="warehousingMaterialListRef"
  331. :model="{ warehousingMaterialList: warehousingMaterialList }"
  332. :show-message="false"
  333. >
  334. <el-table
  335. ref="multipleTable"
  336. :data="warehousingMaterialList"
  337. tooltip-effect="dark"
  338. style="width: 100%"
  339. stripe
  340. :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
  341. >
  342. <el-table-column label="序号" type="index" width="50">
  343. </el-table-column>
  344. <el-table-column
  345. label="编码"
  346. prop="assetCode"
  347. ></el-table-column>
  348. <el-table-column
  349. label="名称"
  350. prop="assetName"
  351. ></el-table-column>
  352. <el-table-column
  353. v-for="(item, index) in tableHeader"
  354. :key="index"
  355. align="center"
  356. :label="item.label"
  357. width="150"
  358. :prop="item.prop"
  359. >
  360. <template slot-scope="{ row }">
  361. <template v-if="item.formatter">{{
  362. item.formatter(row)
  363. }}</template>
  364. <template v-else>{{ row[item.prop] }}</template>
  365. </template>
  366. </el-table-column>
  367. <el-table-column
  368. label="批次号"
  369. prop="batchNo"
  370. ></el-table-column>
  371. <el-table-column label="最小包装单元" width="120">
  372. <template slot-scope="{ row }">
  373. {{ row.minPackingCount }}{{ row.measuringUnit }}/{{
  374. row.minUnit
  375. }}
  376. </template>
  377. </el-table-column>
  378. <el-table-column label="包装数量" prop="availableCountBase">
  379. <template slot-scope="{ row }">
  380. {{ row.packingCountBase }}{{ row.minUnit }}
  381. </template>
  382. </el-table-column>
  383. <el-table-column
  384. label="计量数量"
  385. prop="availableCountBase"
  386. ></el-table-column>
  387. <el-table-column
  388. label="计量单位"
  389. prop="measuringUnit"
  390. ></el-table-column>
  391. <el-table-column label="重量" prop="weight"></el-table-column>
  392. <el-table-column
  393. label="重量单位"
  394. prop="weightUnit"
  395. ></el-table-column>
  396. <el-table-column
  397. label="仓库"
  398. width="300"
  399. prop="pathName"
  400. ></el-table-column>
  401. <!-- <el-table-column
  402. label="出库数量"
  403. prop=""
  404. align="center"
  405. width="350px"
  406. >
  407. <template slot-scope="{ row, $index }">
  408. <el-row :gutter="4">
  409. <el-col :span="9" v-if="!row.isUnpack">
  410. <el-input type="text" disabled :value="row.outInNum">
  411. <template slot="append">
  412. {{ row.minPackUnit }}
  413. </template>
  414. </el-input>
  415. </el-col>
  416. <el-col :span="6">
  417. <el-button type="text" @click="handleSetting(row, $index)"
  418. >出库明细选择</el-button
  419. ></el-col
  420. >
  421. </el-row>
  422. </template>
  423. </el-table-column> -->
  424. <el-table-column label="操作" width="200">
  425. <template slot-scope="{ row, $index }">
  426. <el-button type="text" @click="listDel(row, $index)"
  427. >删除</el-button
  428. >
  429. </template>
  430. </el-table-column>
  431. </el-table>
  432. </el-form>
  433. </div>
  434. <div class="flex" style="margin-top: 20px">
  435. <div><span class="red">*</span>包装清单</div>
  436. </div>
  437. <div class="mt10 form-table">
  438. <BatchDetail
  439. :assetType="formData.extInfo.assetType"
  440. :data="batchDetailsVOList"
  441. />
  442. </div>
  443. </div>
  444. <!-- <div class="flex" style="margin-top: 20px">
  445. <div><span class="red">*</span>包装清单</div>
  446. </div>
  447. <div class="mt10 form-table">
  448. <BatchDetail
  449. :assetType="formData.extInfo.assetType"
  450. :codeObj="{ name: '包装编码', prop: 'code' }"
  451. :nameObj="{ name: '名称', prop: 'name' }"
  452. />
  453. </div> -->
  454. <div class="mt20">
  455. <el-tabs v-model="activeName" type="card">
  456. <el-tab-pane :label="`${title}明细`" name="a">
  457. <el-table
  458. ref="multipleTable"
  459. :data="materialCodeReqList"
  460. tooltip-effect="dark"
  461. style="width: 100%"
  462. stripe
  463. :header-cell-style="rowClass"
  464. >
  465. <el-table-column label="序号" type="index" width="50">
  466. </el-table-column>
  467. <el-table-column
  468. :label="`编码`"
  469. min-width="100"
  470. prop="assetCode"
  471. ></el-table-column>
  472. <el-table-column label="名称" prop="name" width="50">
  473. </el-table-column>
  474. <el-table-column label="批次号" prop="batchNo">
  475. </el-table-column>
  476. <el-table-column
  477. v-if="dimension == 4"
  478. label="包装编码"
  479. min-width="100"
  480. prop="onlyCode"
  481. ></el-table-column>
  482. <el-table-column
  483. v-for="(item, index) in tableHeader"
  484. :key="index"
  485. align="center"
  486. :label="item.label"
  487. width="150"
  488. :prop="item.prop"
  489. >
  490. <template slot-scope="{ row }">
  491. <template v-if="item.formatter">{{
  492. item.formatter(row)
  493. }}</template>
  494. <template v-else>{{ row[item.prop] }}</template>
  495. </template>
  496. </el-table-column>
  497. <el-table-column
  498. label="物料编码"
  499. width="250"
  500. prop="no"
  501. ></el-table-column>
  502. <!-- <el-table-column label="生产日期" width="200">
  503. <template slot-scope="{ row }">
  504. <span v-if="row.dateType === 2">
  505. {{ row.produceTime }}
  506. </span>
  507. </template>
  508. </el-table-column>
  509. <el-table-column label="采购日期" width="200">
  510. <template slot-scope="{ row }">
  511. <span v-if="row.dateType === 1">
  512. {{ row.procureTime }}
  513. </span>
  514. </template>
  515. </el-table-column> -->
  516. <el-table-column label="计量数量" prop="">
  517. <template slot-scope="{ row }">1</template>
  518. </el-table-column>
  519. <el-table-column
  520. label="计量单位"
  521. prop="measuringUnit"
  522. ></el-table-column>
  523. <el-table-column label="物料代号" prop="meterielCode">
  524. </el-table-column>
  525. <el-table-column
  526. label="客户代号"
  527. prop="clientCode"
  528. ></el-table-column>
  529. <el-table-column label="刻码" prop="engrave"></el-table-column>
  530. <el-table-column label="重量" prop="weight"></el-table-column>
  531. <el-table-column
  532. label="重量单位"
  533. prop="weightUnit"
  534. ></el-table-column>
  535. <!-- <el-table-column
  536. label="货位"
  537. prop="pathName"
  538. show-overflow-tooltip
  539. >
  540. </el-table-column>
  541. <el-table-column label="转消耗" prop="">
  542. <template slot-scope="{ row }">
  543. <el-checkbox v-model="row.isTransferAsset"></el-checkbox>
  544. </template>
  545. </el-table-column> -->
  546. </el-table>
  547. </el-tab-pane>
  548. </el-tabs>
  549. </div>
  550. </div>
  551. <div class="center mt20">
  552. <el-button type="primary" @click="handleNewSave" :loading="saveLoading"
  553. >保存</el-button
  554. >
  555. <el-button @click="$router.go(-1)">返回</el-button>
  556. </div>
  557. </el-card>
  558. <AssetsDialog
  559. ref="assetsDialogRef"
  560. :title="title"
  561. :warehousingMaterialList="selectionList"
  562. :assetType="formData.extInfo.assetType"
  563. @detailData="detailData"
  564. />
  565. <!-- @selectTableData="onSelectTableData" -->
  566. <!-- 选桶号 -->
  567. <detailSelect
  568. ref="detailSelectRef"
  569. :title="title"
  570. :tableHeader="tableHeader"
  571. />
  572. <!-- 转资产 -->
  573. <!-- <TurnToAsset ref="turnToAssetRef" /> -->
  574. <!-- 选择仓库 -->
  575. <WareHouseDailog ref="wareHouseDailogRef"></WareHouseDailog>
  576. <!-- 选领料单 -->
  577. <pickOrder ref="pickOrderRef" @success="pickOrderRow" />
  578. <!-- 销售订单 -->
  579. <eom ref="eomRef" @success="eomSuccess" />
  580. </div>
  581. </template>
  582. <script>
  583. import outin from '@/api/warehouseManagement/outin';
  584. import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
  585. import { getTreeByPid, getTreeByGroup } from '@/api/classifyManage';
  586. import selectUpload from '@/components/selectUpload';
  587. import upload from '@/components/uploadImg';
  588. import pickOrder from './components/pickOrder.vue';
  589. import {
  590. warehousingType,
  591. outputSceneState,
  592. emergencyState,
  593. materialType
  594. } from '@/utils/dict/index';
  595. import selectTree from '@/components/selectTree';
  596. import AssetsDialog from '../components/AssetsDialog.vue';
  597. import outputType from '../components/outputType.vue';
  598. // import TurnToAsset from '../components/TurnToAsset/index.vue'
  599. import WareHouseDailog from '../components/WareHouseDailog.vue';
  600. // import supplier from '@/api/main/supplier';
  601. // import org from '@/api/main/org';
  602. // import user from '@/api/main/user';
  603. import { tableHeader } from '../common';
  604. import detailSelect from './components/detailSelect';
  605. import eom from './components/eom.vue';
  606. import BatchDetail from './components/batchDetail.vue';
  607. export default {
  608. components: {
  609. BatchDetail,
  610. pickOrder,
  611. selectUpload,
  612. selectTree,
  613. AssetsDialog,
  614. WareHouseDailog,
  615. upload,
  616. detailSelect,
  617. // TurnToAsset,
  618. outputType,
  619. eom
  620. },
  621. data() {
  622. return {
  623. dimension: '3',
  624. llList: [],
  625. codeList: [],
  626. materialType,
  627. warehousingType,
  628. outputSceneState,
  629. emergencyState,
  630. saveLoading: false,
  631. title: '',
  632. tableData2: [],
  633. uploadList: [],
  634. fromUserList: [], //人员数组
  635. warehousingMaterialList: [],
  636. activeName: 'a',
  637. treeList: [],
  638. staffList: [],
  639. formData: {
  640. extInfo: {
  641. assetType: '', //物品类型
  642. deptCode: '', //部门code
  643. deptName: '', //部门名称
  644. verifyDeptCode: '', //审核部门编码
  645. verifyDeptName: '', //审核部门名称
  646. deliveryName: '', //送货人名称
  647. fromUserPhone: '', //送货人电话
  648. sourceBizNo: '', //销售订单
  649. urgent: '', //紧急状态
  650. supplierId: '', //供应商ID
  651. supplierName: '', //供应商名称
  652. createUserName: '', //创建人名字
  653. contentImage: [] //图片数组
  654. },
  655. fromUser: '', //送货人
  656. bizType: '', //物品类型
  657. verifyId: '', //审核人Id
  658. verifyName: '', //审核人名称
  659. createUserId: '',
  660. remark: ''
  661. },
  662. rules: {
  663. // 'extInfo.assetType': {
  664. // required: true,
  665. // message: '请选择出库产品类型',
  666. // trigger: 'change'
  667. // },
  668. bizType: {
  669. required: true,
  670. message: '请选择出库场景',
  671. trigger: 'change'
  672. },
  673. fromUser: {
  674. required: true,
  675. message: '请选择领料人',
  676. trigger: 'change'
  677. }
  678. // verifyDeptName: {
  679. // required: true,
  680. // message: '请选择领料部门',
  681. // trigger: 'blur'
  682. // }
  683. },
  684. llrLsit: [],
  685. options: [],
  686. loading: false,
  687. onSelectTableDataVal: [],
  688. batchDetailsVOList: [],
  689. materialCodeReqList: [],
  690. selectionList: [],
  691. // shouldTriggerPickorder: true,
  692. materialObj: {},
  693. wlParams: {}
  694. };
  695. },
  696. computed: {
  697. tableHeader() {
  698. return tableHeader(this.formData.extInfo.assetType);
  699. }
  700. // 条码信息
  701. // materialCodeReqList() {
  702. // return this.warehousingMaterialList
  703. // .map((i) => i.warehouseLedgerDetails || [])
  704. // .flat();
  705. // }
  706. },
  707. created() {
  708. this.initData();
  709. },
  710. methods: {
  711. detailData(data, dimension) {
  712. this.dimension = dimension;
  713. console.log('总数居', data);
  714. this.onSelectTableDataVal = data.realTimeInventoryVOList;
  715. this.warehousingMaterialList = data.realTimeInventoryVOList.map(
  716. (next) => {
  717. delete next.updateTime;
  718. delete next.createTime;
  719. return {
  720. ...next,
  721. realInventoryAmount: 0,
  722. assetType: this.formData.extInfo.assetType,
  723. outInNum: '',
  724. assetCode: next.code,
  725. assetName: next.name,
  726. bizStatus: 2,
  727. contactCode: next.contactCode
  728. };
  729. }
  730. );
  731. // this.batchDetailsVOList = data.batchDetailsVOList;
  732. if (dimension == 4) {
  733. this.materialCodeReqList = data.wlList;
  734. this.selectionList = data.wlList;
  735. let params = {
  736. realTimeInventoryNewPOList: data.realTimeInventoryVOList
  737. };
  738. for (const item of params.realTimeInventoryNewPOList) {
  739. item.inventoryDetailsNewPOList = item.inventoryDetailsVOList;
  740. for (const detail of item.inventoryDetailsNewPOList) {
  741. detail.outInMaterialDetailsAddPOList = [];
  742. for (const wlItem of data.wlList) {
  743. if (detail.id === wlItem.recordId) {
  744. detail.outInMaterialDetailsAddPOList.push({
  745. ...wlItem
  746. });
  747. }
  748. }
  749. }
  750. }
  751. this.wlParams = params;
  752. this.materialObj = data;
  753. } else if (dimension == 3) {
  754. //包装维度出库
  755. const list = data.realTimeInventoryVOList;
  756. //获取包装维度
  757. let packArr = [];
  758. for (const item of list) {
  759. if (item.inventoryDetailsVOList.length != 0) {
  760. for (const iterator of item.inventoryDetailsVOList) {
  761. packArr.push({ ...iterator, batchNo: iterator.batchNum });
  762. }
  763. }
  764. }
  765. this.batchDetailsVOList = packArr.map((item) => {
  766. return {
  767. ...item,
  768. packingCountBase:
  769. dimension == 4 || dimension == 3 ? 1 : item.packingCountBase,
  770. weight: 0
  771. };
  772. });
  773. //物料维度数据
  774. let meteArr = [];
  775. for (const item of packArr) {
  776. if (item.materialDetailsVOList.length != 0) {
  777. for (const iterator of item.materialDetailsVOList) {
  778. meteArr.push({
  779. ...iterator
  780. });
  781. }
  782. }
  783. }
  784. this.materialCodeReqList = meteArr;
  785. //再次打开选择上
  786. this.selectionList = list;
  787. //send数据
  788. this.wlParams = { realTimeInventoryNewPOList: list };
  789. this.wlParams.realTimeInventoryNewPOList.forEach((item) => {
  790. item.inventoryDetailsNewPOList = item.inventoryDetailsVOList;
  791. item.inventoryDetailsNewPOList.forEach((ite) => {
  792. ite.weight = 0;
  793. ite.outInMaterialDetailsAddPOList = ite.materialDetailsVOList;
  794. });
  795. });
  796. } else {
  797. // else if (dimension == 2) {
  798. // this.batchDetailsVOList = data.wlList;
  799. // this.selectionList = data.wlList;
  800. // }
  801. //物品维度出库
  802. const list = data.realTimeInventoryVOList;
  803. //获取包装维度
  804. let packArr = [];
  805. for (const item of list) {
  806. if (item.inventoryDetailsVOList.length != 0) {
  807. for (const iterator of item.inventoryDetailsVOList) {
  808. packArr.push({ ...iterator, batchNo: iterator.batchNum });
  809. }
  810. }
  811. }
  812. this.batchDetailsVOList = packArr.map((item) => {
  813. return {
  814. ...item,
  815. packingCountBase: dimension == 3 ? 1 : item.packingCountBase,
  816. weight: 0
  817. };
  818. });
  819. //物料维度数据
  820. let meteArr = [];
  821. for (const item of packArr) {
  822. if (item.materialDetailsVOList.length != 0) {
  823. for (const iterator of item.materialDetailsVOList) {
  824. meteArr.push({
  825. ...iterator
  826. });
  827. }
  828. }
  829. }
  830. this.materialCodeReqList = meteArr;
  831. //再次打开选择上
  832. this.selectionList = list;
  833. //send数据
  834. this.wlParams = { realTimeInventoryNewPOList: list };
  835. this.wlParams.realTimeInventoryNewPOList.forEach((item) => {
  836. item.inventoryDetailsNewPOList = item.inventoryDetailsVOList;
  837. item.inventoryDetailsNewPOList.forEach((ite) => {
  838. ite.weight = 0;
  839. ite.outInMaterialDetailsAddPOList = ite.materialDetailsVOList;
  840. });
  841. });
  842. }
  843. },
  844. handleNewSave() {
  845. this.$refs.formName.validate(async (valid) => {
  846. if (valid) {
  847. if (!this.warehousingMaterialList?.length) {
  848. return this.$message.error('请添加出库明细!');
  849. }
  850. let obj = { ...this.formData, type: 2 };
  851. obj.extInfo.sourceBizNo = obj.sourceBizNo;
  852. // obj.fromId=
  853. obj.fromType = obj.type;
  854. this.saveLoading = true;
  855. obj = { ...obj, ...this.wlParams };
  856. if (this.dimension == 4) {
  857. obj.num = this.materialObj.wlList.length;
  858. } else {
  859. obj.num = this.materialCodeReqList.length;
  860. }
  861. console.log('2222', obj);
  862. try {
  863. const res = await outin.saveNew(obj);
  864. if (res.code == 0) {
  865. await await outin.outApprove({ outInId: res.data });
  866. this.$message.success('保存成功!');
  867. }
  868. this.$router.push('/warehouseManagement/outgoingManagement');
  869. if (res?.success) {
  870. this.$message.success('保存成功!');
  871. this.$router.go(-1);
  872. }
  873. this.saveLoading = false;
  874. } catch (error) {
  875. this.saveLoading = false;
  876. }
  877. }
  878. });
  879. },
  880. onClear() {
  881. this.formData.sourceBizNo = '';
  882. this.warehousingMaterialList = [];
  883. this.$refs.trees.valueTitle = '';
  884. this.formData.clientName = '';
  885. this.formData.clientUser = '';
  886. this.formData.clientPhone = '';
  887. this.title = '';
  888. this.$forceUpdate();
  889. },
  890. eomSuccess(row) {
  891. console.log(row);
  892. this.formData.extInfo.assetType = 9;
  893. this.$refs.trees.valueTitle = '产品';
  894. this.title = '产品';
  895. this.formData.sourceBizNo = row.orderNo;
  896. this.formData.sid = row.id;
  897. this.formData.fromId = row.id;
  898. this.formData.clientName = row.contactName;
  899. this.formData.clientUser = row.linkName;
  900. this.formData.clientPhone = row.linkPhone;
  901. this.onSelectTableData(row.tableData, 1);
  902. this.$forceUpdate();
  903. },
  904. pickOrderRow(row) {
  905. this.formData.sid = row.id;
  906. row.tableData = [];
  907. this.formData.sourceBizNo = row.code;
  908. for (const key in row.orderInfoList) {
  909. if (row.orderInfoList[key].bomDetailDTOS.length != 0) {
  910. for (const i in row.orderInfoList[key].bomDetailDTOS) {
  911. row.tableData.push({
  912. ...row.orderInfoList[key].bomDetailDTOS[i],
  913. code: row.orderInfoList[key].bomDetailDTOS[i].categoryCode,
  914. name: row.orderInfoList[key].bomDetailDTOS[i].categoryName,
  915. modelType: row.orderInfoList[key].bomDetailDTOS[i].model,
  916. id: row.orderInfoList[key].bomDetailDTOS[i].categoryId
  917. });
  918. }
  919. }
  920. if (row.orderInfoList[key].instanceList.length != 0) {
  921. for (const j in row.orderInfoList[key].instanceList) {
  922. row.tableData.push({
  923. ...row.orderInfoList[key].instanceList[j],
  924. code: row.orderInfoList[key].instanceList[j].categoryCode,
  925. name: row.orderInfoList[key].instanceList[j].categoryName,
  926. modelType: row.orderInfoList[key].instanceList[j].model,
  927. id: row.orderInfoList[key].instanceList[j].instanceId
  928. });
  929. }
  930. }
  931. }
  932. const uniqueItems = [];
  933. const uniqueIds = new Set();
  934. row.tableData.forEach((item) => {
  935. if (!uniqueIds.has(item.code)) {
  936. uniqueIds.add(item.code);
  937. uniqueItems.push(item);
  938. }
  939. });
  940. row.tableData = uniqueItems;
  941. console.log(row);
  942. this.onSelectTableData(row.tableData, 1);
  943. this.$forceUpdate();
  944. },
  945. handleEom() {
  946. this.$refs.eomRef.open();
  947. },
  948. handlePickorder() {
  949. this.$refs.pickOrderRef.open();
  950. },
  951. async handleDocumentSourceChange() {
  952. // this.formData.sourceBizNo = '';
  953. if (!this.formData.sourceBizNo) {
  954. if (this.formData.bizType == 4) {
  955. this.warehousingMaterialList = [];
  956. }
  957. return;
  958. }
  959. if (
  960. !(this.formData.extInfo.assetType == 7 && this.formData.bizType == 4)
  961. ) {
  962. return;
  963. }
  964. const loading = this.$loading({ fullscreen: true });
  965. const res = await getSparePartsInfo({
  966. code: this.formData.sourceBizNo
  967. });
  968. if (res?.success && res.data.length) {
  969. const curMap = {
  970. assetId: 'classificationId',
  971. assetCode: 'informationCode', //编码
  972. assetName: 'informationName', //名称
  973. materialId: 'classificationId',
  974. materialName: 'informationName',
  975. batchNo: '', //批次号
  976. unit: 'measuringUnit', //单位
  977. minPackUnit: 'packingUnit' //最小包装单位
  978. };
  979. res.data.forEach((item) => {
  980. let obj = {};
  981. for (const key in curMap) {
  982. obj[key] = curMap[key] ? item[curMap[key]] : '';
  983. }
  984. obj.curId =
  985. obj.assetCode +
  986. (obj.measurementUnit || '') +
  987. (obj.minPackUnit || '') +
  988. (obj.unit || '');
  989. console.log(obj.curId);
  990. const index = this.warehousingMaterialList.findIndex(
  991. (i) => i.curId === obj.curId
  992. );
  993. if (index === -1) {
  994. Object.assign(obj, item);
  995. obj.sparePartsNum = item.num;
  996. this.warehousingMaterialList.push(obj);
  997. } else {
  998. this.warehousingMaterialList[index].sparePartsNum = item.num;
  999. }
  1000. });
  1001. }
  1002. loading.close();
  1003. },
  1004. // 备品备件来源单号
  1005. async remoteMethod(code) {
  1006. // if (code !== '') {
  1007. // this.loading = true
  1008. const res = await getDocumentSource({ code });
  1009. if (res?.success) {
  1010. this.options = res.data;
  1011. }
  1012. // this.loading = false
  1013. // } else {
  1014. // this.options = []
  1015. // }
  1016. },
  1017. rowClass({ row, column, rowIndex, columnIndex }) {
  1018. if (rowIndex === 1) {
  1019. return {
  1020. display: 'none',
  1021. background: '#EEEEEE',
  1022. border: 'none'
  1023. };
  1024. }
  1025. return { background: '#EEEEEE', border: 'none' };
  1026. },
  1027. // 部门 点击事件
  1028. async auditorDeptClick(data) {
  1029. console.log(data);
  1030. this.formData.extInfo.verifyDeptCode = data?.id;
  1031. this.formData.extInfo.verifyDeptName = data?.name;
  1032. this.formData.verifyId = '';
  1033. this.formData.verifyName = '';
  1034. this.$refs.formName.validateField('verifyDeptName');
  1035. if (data) {
  1036. this.getStaffList(data);
  1037. }
  1038. },
  1039. async getStaffList(data) {
  1040. let res = await warehouseDefinition.getUserPage({
  1041. groupId: data.id,
  1042. size: 9999,
  1043. page: 1
  1044. });
  1045. this.llrLsit = res.list;
  1046. },
  1047. // // 转资产
  1048. // turnToAssets (row) {
  1049. // this.$refs.turnToAssetRef
  1050. // .open(row.transferCurVal)
  1051. // .then(({ code, name }) => {
  1052. // row.transferType = name
  1053. // row.materialId = code
  1054. // row.materialName = name.split('/').pop()
  1055. // row.transferType = name
  1056. // this.$set(row, 'transferCurVal', code)
  1057. // })
  1058. // },
  1059. handleSetting(row) {
  1060. row.bizTypes = this.formData.bizType;
  1061. row.type = this.formData.bizType == 3 ? 1 : 0;
  1062. this.$refs.detailSelectRef
  1063. .open(row, row.warehouseLedgerDetails || [])
  1064. .then((res) => {
  1065. console.log(res);
  1066. console.log(row);
  1067. this.$set(
  1068. row,
  1069. 'warehouseLedgerDetails',
  1070. (res || []).map((item) => {
  1071. delete item.updateTime;
  1072. delete item.createTime;
  1073. this.$set(item, 'isTransferAsset', false);
  1074. item.isUnpack = row.isUnpack;
  1075. return item;
  1076. })
  1077. );
  1078. this.$set(row, 'outInNum', res.length);
  1079. this.$set(row, 'minPackUnit', res[0].minPackUnit);
  1080. this.$set(
  1081. row,
  1082. 'selfSum',
  1083. row.warehouseLedgerDetails.reduce((sum, pre) => {
  1084. if (row.isUnpack) {
  1085. return ++sum;
  1086. }
  1087. return sum + pre.measurementUnit;
  1088. }, 0)
  1089. );
  1090. });
  1091. },
  1092. // 仓库编辑
  1093. handleWareHouse(row) {
  1094. this.$refs.wareHouseDailogRef.open(row);
  1095. },
  1096. // 出库操作
  1097. listEdit(row) {
  1098. this.$set(row, 'isSave', false);
  1099. },
  1100. //出库明细删除
  1101. listDel(row, index) {
  1102. this.warehousingMaterialList.splice(index, 1);
  1103. if (this.warehousingMaterialList.length == 0) {
  1104. this.formData.sourceBizNo = '';
  1105. this.formData.extInfo.clientName = '';
  1106. this.formData.extInfo.clientUser = '';
  1107. this.formData.extInfo.clientUserPhone = '';
  1108. }
  1109. },
  1110. // 出库明细生成条码信息
  1111. async createMaterialCode(row) {
  1112. let arr = [];
  1113. const res = await getAssetNum({
  1114. assetCode: row.assetCode,
  1115. num: row.outInNum || 1
  1116. });
  1117. if (res?.success) {
  1118. delete row.createTime;
  1119. arr = Array.from(new Array(res.data.length), (val, idx) => ({
  1120. ...row,
  1121. num: res.data[idx],
  1122. bizStatus: 2,
  1123. isTransferAsset: false
  1124. }));
  1125. }
  1126. return arr;
  1127. },
  1128. handleSave() {
  1129. this.$refs.formName.validate(async (valid) => {
  1130. if (valid) {
  1131. if (!this.warehousingMaterialList?.length) {
  1132. return this.$message.error('请添加出库明细!');
  1133. } else if (
  1134. this.warehousingMaterialList.some(
  1135. (item) => !item.warehouseLedgerDetails?.length
  1136. )
  1137. ) {
  1138. return this.$message.error('请完善出库明细数据!');
  1139. }
  1140. console.log('qqqq===>', this.warehousingMaterialList);
  1141. let arr = this.warehousingMaterialList.map((item) => {
  1142. return {
  1143. batchNo: item.batchNo,
  1144. categoryId: item.id,
  1145. count: item.outInNum,
  1146. num: item.outInNum,
  1147. minPackingCount: item.selfSum,
  1148. packingCount: item.outInNum,
  1149. outInDetailRecordAddPOList: item.warehouseLedgerDetails,
  1150. ...item
  1151. // position: `${item.warehouseName}-${item.areaName}-${item.shelfCode}-${item.cargoSpaceCode}`,
  1152. // // pathIds: item.categoryLevelPathId.toString(),
  1153. // pathIds: `${item.warehouseId},${item.areaId},${item.shelfId},${item.cargoSpaceId}`,
  1154. // totalMoney:
  1155. // item.outInNum * item.minPackingCount * item.univalence
  1156. };
  1157. });
  1158. arr.forEach((item) => {
  1159. item.warehouseId =
  1160. item.warehouseLedgerDetails[0].pathIds.split(',')[0];
  1161. delete item.id;
  1162. delete item.warehouseLedgerDetails;
  1163. if (item.outInDetailRecordAddPOList.length > 0) {
  1164. let list = item.outInDetailRecordAddPOList.map((it) => {
  1165. return {
  1166. positionId: it.positionId,
  1167. code: it.sourceBizNo,
  1168. dateType: it.dateType,
  1169. dateValue: it.dateValue,
  1170. minUnit: it.minUnit,
  1171. batchNo: it.sourceBatchNo,
  1172. position: it.pathName,
  1173. // minPositionId: it.cargoSpaceId,
  1174. minPositionId: it.minPositionId,
  1175. name: it.name,
  1176. pathIds: it.pathIds,
  1177. unit: it.unit,
  1178. packageNo: it.packageNo,
  1179. minPackingCount: it.minPackingCount,
  1180. procureTime: it.procureTime,
  1181. produceTime: it.produceTime
  1182. // num: it.minPackingCount
  1183. };
  1184. });
  1185. item.outInDetailRecordAddPOList = list;
  1186. }
  1187. });
  1188. let obj = { ...this.formData, type: 2 };
  1189. for (const key in arr) {
  1190. arr[key].count = arr[key].outInNum;
  1191. }
  1192. obj.outInDetailAddPOList = arr;
  1193. obj.extInfo.sourceBizNo = obj.sourceBizNo;
  1194. obj.fromType = obj.type;
  1195. this.saveLoading = true;
  1196. // console.log('明细', this.warehousingMaterialList);
  1197. // const categoryLevelId = this.$refs.assetsDialogRef.materialType;
  1198. // let newObj = {
  1199. // inOutAddPO: {
  1200. // ...this.formData,
  1201. // ...this.formData.extInfo,
  1202. // bizStatus: 2
  1203. // },
  1204. // warehouseLedgerInfos: this.handelArr(
  1205. // this.warehousingMaterialList,
  1206. // categoryLevelId
  1207. // )
  1208. // };
  1209. // delete newObj.inOutAddPO.extInfo;
  1210. console.log('2222', obj);
  1211. const res = await outin.save(obj);
  1212. if (res.code == 0) {
  1213. this.$message.success('保存成功!');
  1214. }
  1215. this.saveLoading = false;
  1216. this.$router.push('/warehouseManagement/outgoingManagement');
  1217. if (res?.success) {
  1218. this.$message.success('保存成功!');
  1219. this.$router.go(-1);
  1220. }
  1221. }
  1222. });
  1223. },
  1224. handelArr(arr, id) {
  1225. for (const key in arr) {
  1226. arr[key].inLedgerId = arr[key].id;
  1227. arr[key].categoryLevelId = id;
  1228. for (const k in arr[key].warehouseLedgerDetails) {
  1229. arr[key].warehouseLedgerDetails[k].ledgerDetailId =
  1230. arr[key].warehouseLedgerDetails[k].id;
  1231. arr[key].warehouseLedgerDetails[k].inDetailId = arr[key].inLedgerId;
  1232. arr[key].warehouseLedgerDetails[k].isTransferAsset = arr[key]
  1233. .warehouseLedgerDetails[k].isTransferAsset
  1234. ? 1
  1235. : 0;
  1236. arr[key].warehouseLedgerDetails[k].bizStatus = 2;
  1237. }
  1238. }
  1239. return arr;
  1240. // let newArr = arr.map((item) => {
  1241. // return { ...item, ledgerId: item.id };
  1242. // });
  1243. // newArr.map((item) => {
  1244. // item.warehouseLedgerDetails.map((ite) => {
  1245. // return { ...ite, ledgerDetailId: ite.id, ledgerId: item.id };
  1246. // });
  1247. // });
  1248. // return newArr;
  1249. },
  1250. //添加明细
  1251. onSelectTableData(val, e) {
  1252. // if (e == 1) {
  1253. // this.llList = val;
  1254. // } else {
  1255. // this.llList = [];
  1256. // }
  1257. // .concat(this.llList)
  1258. // if (this.warehousingMaterialList.length != 0) {
  1259. // val = this.warehousingMaterialList.concat(val);
  1260. // }
  1261. this.onSelectTableDataVal = val;
  1262. this.warehousingMaterialList = val.map((next) => {
  1263. delete next.updateTime;
  1264. delete next.createTime;
  1265. return {
  1266. ...next,
  1267. realInventoryAmount: 0,
  1268. // cargoSpaceCode: '', //货位编码
  1269. // cargoSpaceId: '', //货位id
  1270. // shelfId: '', //货架id
  1271. // shelfCode: '', //货架名称
  1272. // areaId: '', //库区id
  1273. // areaName: '', //库区名称
  1274. // warehouseId: '', //仓库id
  1275. // warehouseName: '', //仓库名称
  1276. assetType: this.formData.extInfo.assetType,
  1277. outInNum: '',
  1278. assetCode: next.code,
  1279. assetName: next.name,
  1280. bizStatus: 2,
  1281. contactCode: next.contactCode
  1282. };
  1283. });
  1284. console.log('sasasasa===>>>', this.warehousingMaterialList);
  1285. },
  1286. codeListValue(val) {
  1287. console.log(val);
  1288. this.formData.extInfo.assetType = val.id;
  1289. this.$forceUpdate();
  1290. this.title = val?.name;
  1291. this.selectEquiType = val?.id;
  1292. console.log(this.title);
  1293. },
  1294. async initData() {
  1295. const { data } = await getTreeByGroup({ type: 1 });
  1296. this.codeList = data;
  1297. const res = await warehouseDefinition.tree();
  1298. this.treeList = this.$util.toTreeData({
  1299. data: res,
  1300. idField: 'id',
  1301. parentIdField: 'parentId'
  1302. });
  1303. let res22 = await warehouseDefinition.getUserPage({
  1304. size: -1,
  1305. page: 1
  1306. });
  1307. this.fromUserList = res22.list;
  1308. // /
  1309. // const res111 = await warehouseDefinition.list();
  1310. // this.warehouseList = res111.list;
  1311. // console.log('res=====', res);
  1312. const info = JSON.parse(localStorage.getItem('info'));
  1313. let obj = res.find(
  1314. (item) => item.id === info.deptId[info.deptId.length - 1]
  1315. );
  1316. // console.log('obj=====', obj);
  1317. this.formData.extInfo.deptName = obj.name;
  1318. this.formData.extInfo.deptCode = obj.id;
  1319. this.formData.extInfo.createUserName = info.name;
  1320. this.formData.createUserId = info.userId;
  1321. },
  1322. addStock() {
  1323. if (!this.title) return this.$message.error('请选择出库产品类型');
  1324. if (!this.formData.bizType && this.formData.bizType !== 0)
  1325. return this.$message.error('请选择出库场景');
  1326. // if (this.formData.bizType == 4&& !this.formData.sourceBizNo) {
  1327. // return this.$message.error('请选择来源单据');
  1328. // }
  1329. this.$refs.assetsDialogRef.open();
  1330. },
  1331. handleChange(data) {
  1332. this.title = data?.dictValue;
  1333. if (this.formData.bizType == 4) {
  1334. this.formData.sourceBizNo = '';
  1335. }
  1336. },
  1337. handleChanges(code) {
  1338. const data = this.codeList.find((item) => item.dictCode == code);
  1339. this.title = data?.dictValue;
  1340. this.selectEquiType = data?.dictCode;
  1341. if (this.formData.bizType == 4) {
  1342. this.formData.sourceBizNo = '';
  1343. }
  1344. },
  1345. handleBizSceneChange() {
  1346. if (this.formData.extInfo.assetType == 7) {
  1347. this.formData.extInfo.sourceBizNo = '';
  1348. }
  1349. this.formData.sourceBizNo = '';
  1350. },
  1351. getSupplier() {
  1352. return new Promise((resolve, reject) => {
  1353. supplier.list({ page: 1, size: 999 }).then((res) => {
  1354. if (res.success) {
  1355. resolve(res);
  1356. }
  1357. });
  1358. });
  1359. },
  1360. upload(data) {
  1361. this.formData.contentImage = data;
  1362. this.$refs.formName.validateField('contentImage');
  1363. },
  1364. deptClick(data) {
  1365. this.formData.deptName = data?.name;
  1366. this.formData.deptCode = data?.code;
  1367. }
  1368. }
  1369. };
  1370. </script>
  1371. <style lang="scss" scoped>
  1372. ::v-deep.form-table {
  1373. .el-form-item {
  1374. margin-bottom: 0;
  1375. }
  1376. .el-input__inner {
  1377. padding: 0 10px;
  1378. }
  1379. }
  1380. .p20 {
  1381. padding: 20px;
  1382. }
  1383. .el-select,
  1384. .el-date-editor {
  1385. width: 100%;
  1386. }
  1387. .el-form-item {
  1388. margin-bottom: 22px;
  1389. }
  1390. .material {
  1391. margin-top: 20px;
  1392. .flex {
  1393. display: flex;
  1394. justify-content: space-between;
  1395. font-size: 14px;
  1396. align-items: center;
  1397. .red {
  1398. color: #ff4949;
  1399. }
  1400. }
  1401. }
  1402. .mt10 {
  1403. margin-top: 10px;
  1404. }
  1405. .mt20 {
  1406. margin-top: 20px;
  1407. }
  1408. .center {
  1409. text-align: center;
  1410. }
  1411. </style>