index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802
  1. <template>
  2. <div class="user">
  3. <div class="content">
  4. <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
  5. :selectConfig="selectConfig" :action-list="[
  6. ]" @get-list="getList">
  7. <template #code="{ item }">
  8. <div style="width: 100%" class="el-click" @click="lookDetails(item)">
  9. {{item.code}}
  10. </div>
  11. </template>
  12. <template #prodTag="{ item }">
  13. <div style="width: 100%">
  14. <!-- <el-icon :size="16" style="cursor:pointer;margin-right: 5px;position:relative;top:5px" color="#409EFF" @click="handleEditTag(item)">
  15. <Edit />
  16. </el-icon> -->
  17. <!-- closable @close="prodTagClose(index, item)" -->
  18. <el-tag style="margin-right: 8px" type="success" v-for="(tag, index) in item.prodTags" :key="index">
  19. {{ dictKeyValue(tag, contractTag) }}
  20. </el-tag>
  21. </div>
  22. </template>
  23. <template #list="{ item }">
  24. <div style="width:100%">
  25. <span v-for="(product ,index) in item.produceOrderDetailList" style="margin-right:15px">
  26. <el-popover placement="top-start" :width="400" trigger="hover">
  27. <div>
  28. <div>产品编码:{{product.productCode}}</div>
  29. <div>产品名称:{{product.productName}}</div>
  30. <div>产品尺寸:{{product.productLength}}cm*{{product.productWidth}}cm*{{product.productHeight}}cm</div>
  31. <div>产品数量:{{product.quantity}}</div>
  32. </div>
  33. <template #reference>
  34. <el-progress type="circle" :percentage="(Number(product.finishQuantity) / Number(product.quantity))*100" width="60"
  35. :status="(Number(product.finishQuantity) / Number(product.quantity))*100 == 100 ? 'success' : ''" />
  36. </template>
  37. </el-popover>
  38. </span>
  39. </div>
  40. </template>
  41. </byTable>
  42. </div>
  43. <div class="schedule-right">
  44. <div class="schedule-top">
  45. <el-row>
  46. <!-- <el-col :span="10" style="text-align: left">
  47. <el-select v-model="status" style="width: 110px">
  48. <el-option v-for="item in tableStatus" :key="item.value" :label="item.label" :value="item.value" />
  49. </el-select>
  50. <el-button type="info" style="margin-left: 8px" @click="clickToday()" plain>今日</el-button>
  51. </el-col> -->
  52. <el-col :span="24" style="text-align: center; height: 32px; line-height: 32px">
  53. <div style="display: flex; justify-content: space-between">
  54. <el-button @click="clickToday()" plain>今日</el-button>
  55. <el-button :icon="ArrowLeftBold" @click="prevMonth()" />
  56. <span style="font-weight: 700">{{ month }}</span>
  57. <el-button :icon="ArrowRightBold" @click="nextMonth()" />
  58. </div>
  59. </el-col>
  60. <!-- <el-col :span="10" style="text-align: right">
  61. <el-button type="primary" @click="newSchedule()">新建日程</el-button>
  62. </el-col> -->
  63. </el-row>
  64. </div>
  65. <div class="schedule-bottom">
  66. <el-calendar v-model="today" ref="calendar">
  67. <template #date-cell="{ data }">
  68. <div style="text-align:center;height: 100%;">
  69. <div>
  70. {{ data.day.substr(8, 10) }}
  71. </div>
  72. <el-popover placement="left" :width="400" trigger="hover" @show="onShow(data.day)">
  73. <template #reference>
  74. <div v-if="isShow(data.day)" style="height: calc(100% - 20px);">
  75. <div style="height:5px;margin-bottom:5px;border-radius:2px" v-for="(item,index) in judgeDay(data.day)" :key="index"
  76. :style="{ background: colorData[item]}">
  77. </div>
  78. </div>
  79. </template>
  80. <div>
  81. <div v-for="item in showData" :key="item" style="margin-bottom:20px">
  82. <div style="display:flex">
  83. <div>颜色:</div>
  84. <div :style="{ background: colorData[item]}" style="width:20px;height:20px;border-radius:10px"></div>
  85. </div>
  86. <div>
  87. 订单号:<span v-if="rightDataObj[item]">{{rightDataObj[item]['code']}}</span>
  88. </div>
  89. <div>
  90. 产品:<span v-if="rightDataObj[item]">{{rightDataObj[item]['productName']}}</span>
  91. </div>
  92. </div>
  93. </div>
  94. </el-popover>
  95. </div>
  96. </template>
  97. </el-calendar>
  98. </div>
  99. </div>
  100. <el-dialog :title="modalType == 'add' ? '添加店铺' : '编辑店铺'" v-model="dialogVisible" width="500px" destroy-on-close>
  101. <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="formDom" v-loading="submitLoading">
  102. </byForm>
  103. <template #footer>
  104. <el-button @click="dialogVisible = false" size="defualt">取 消</el-button>
  105. <el-button type="primary" @click="submitForm()" size="defualt" :loading="submitLoading">
  106. 确 定
  107. </el-button>
  108. </template>
  109. </el-dialog>
  110. <el-dialog :title="'投产'" v-model="productionDialog" width="500px" destroy-on-close>
  111. <byForm :formConfig="productionFormConfig" :formOption="formOption" v-model="formData.data" :rules="productionRules" ref="productionFormDom"
  112. v-loading="formLoading">
  113. </byForm>
  114. <template #footer>
  115. <el-button @click="productionDialog =false" size="default" v-debounce>取 消</el-button>
  116. <el-button @click="submitProduction" type="primary" size="default" v-debounce>提 交</el-button>
  117. </template>
  118. </el-dialog>
  119. <el-dialog :title="'订单详情'" v-model="dialogVisible" width="90%" destroy-on-close>
  120. <byForm :formConfig="formConfig" :formOption="formOptionOne" v-model="formData.orderData" ref="formDom">
  121. <template #commodity>
  122. <div style="width: 100%">
  123. <el-table :data="formData.orderData.contractProductList" style="width: 100%; ">
  124. <el-table-column type="expand" width="50" align="center">
  125. <template #default="scope">
  126. <div style="padding-left:50px">
  127. <div style="margin-bottom:10px;">
  128. <TitleInfo content='BOM单:'></TitleInfo>
  129. </div>
  130. <el-table :data="scope.row.contractProductBomList" style="width: 100%;" border class="bom-table">
  131. <el-table-column label="图片" width="80">
  132. <template #default="{ row }">
  133. <div v-if="row.fileUrl">
  134. <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
  135. </div>
  136. <div v-else></div>
  137. </template>
  138. </el-table-column>
  139. <el-table-column prop="productCode" label="物料编码" width="190" />
  140. <el-table-column prop="productName" label="物料名称" min-width="200" />
  141. <el-table-column label="尺寸 (cm)" width="150">
  142. <template #default="{ row, $index }">
  143. <div style="width: 100%">
  144. {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
  145. </div>
  146. </template>
  147. </el-table-column>
  148. <el-table-column prop="quantity" label="数量" width="110" />
  149. <el-table-column prop="remark" label="备注" width="180" />
  150. </el-table>
  151. </div>
  152. </template>
  153. </el-table-column>
  154. <el-table-column label="商品图片" width="80">
  155. <template #default="{ row }">
  156. <div v-if="row.fileUrl">
  157. <img :src="row.fileUrl" class="pic" @click="onPicture(row.fileUrl)" />
  158. </div>
  159. <div v-else></div>
  160. </template>
  161. </el-table-column>
  162. <el-table-column prop="productCnName" label="商品名称" min-width="130" />
  163. <el-table-column prop="productCode" label="商品编码" width="130" />
  164. <el-table-column label="尺寸 cm*cm*cm" width="180">
  165. <template #default="{ row, $index }">
  166. <div style="width: 100%">
  167. {{row.productLength}} * {{row.productWidth}} * {{row.productHeight}}
  168. </div>
  169. </template>
  170. </el-table-column>
  171. <el-table-column label="设计图稿" width="80">
  172. <template #default="{ row, $index }">
  173. <div style="width: 100%">
  174. <el-upload action="https://winfaster.obs.cn-south-1.myhuaweicloud.com" accept=".gif, .jpeg, .jpg, .png" :show-file-list="false"
  175. :data="uploadData" :before-upload="(file)=>handleBeforeUpload(file,$index)" :on-success="()=>handleSuccess($index)">
  176. <div v-loading="row.imgLoading">
  177. <img v-if="row.imageUrl" :src="row.imageUrl" class="pic" />
  178. <!-- <el-icon v-else class="avatar-uploader-icon">
  179. <Plus />
  180. </el-icon> -->
  181. </div>
  182. </el-upload>
  183. </div>
  184. </template>
  185. </el-table-column>
  186. <el-table-column label="生产源文件" width="140">
  187. <template #default="{ row, $index }">
  188. <span class="el-click" v-if="row.prodFilePath" @click="handleClickUpload('prodFilePath',false,$index)">点击上传 (查看)</span>
  189. </template>
  190. </el-table-column>
  191. <el-table-column label="数量" width="150" prop="quantity" />
  192. <el-table-column label="备注" min-width="200" prop="remark" />
  193. </el-table>
  194. </div>
  195. </template>
  196. </byForm>
  197. <template #footer>
  198. <el-button @click="dialogVisible = false" size="defualt">取 消</el-button>
  199. </template>
  200. </el-dialog>
  201. </div>
  202. </template>
  203. <script setup>
  204. import byTable from "@/components/byTable/index";
  205. import byForm from "@/components/byForm/index";
  206. import moment from "moment";
  207. import * as date from "@/utils/date.js";
  208. import { ArrowLeftBold, ArrowRightBold } from "@element-plus/icons-vue";
  209. const { proxy } = getCurrentInstance();
  210. const contractTag = computed(
  211. () => proxy.useUserStore().allDict["contract_prod_tag"]
  212. );
  213. const loading = ref(false);
  214. const submitLoading = ref(false);
  215. const sourceList = ref({
  216. data: [],
  217. pagination: {
  218. total: 3,
  219. pageNum: 1,
  220. pageSize: 10,
  221. keyword: "",
  222. produceStatus: "",
  223. staDeliveryPeriod: "",
  224. endDeliveryPeriod: "",
  225. beginTime: "",
  226. endTime: "",
  227. },
  228. });
  229. const treeData = ref([]);
  230. const dialogVisible = ref(false);
  231. const modalType = ref("add");
  232. const status = ref("0");
  233. const today = ref(moment().format("yyyy-MM-DD"));
  234. const dateList = ref({});
  235. const month = ref(moment().format("yyyy年MM月"));
  236. const monthOne = ref(moment().format("yyyy-MM"));
  237. const calendar = ref(null);
  238. const statusData = ref([
  239. {
  240. label: "未开始",
  241. value: "0",
  242. },
  243. {
  244. label: "进行中",
  245. value: "1",
  246. },
  247. {
  248. label: "已完成",
  249. value: "2",
  250. },
  251. ]);
  252. const selectConfig = computed(() => [
  253. {
  254. label: "生产状态",
  255. prop: "produceStatus",
  256. data: statusData.value,
  257. },
  258. {
  259. type: "time",
  260. label: "交期",
  261. placeholder: "开始日期",
  262. prop: "staDeliveryPeriod",
  263. placeholderOne: "结束日期",
  264. propOne: "endDeliveryPeriod",
  265. },
  266. {
  267. type: "time",
  268. label: "下单日期",
  269. placeholder: "开始日期",
  270. prop: "beginTime",
  271. placeholderOne: "结束日期",
  272. propOne: "endTime",
  273. },
  274. ]);
  275. const config = computed(() => {
  276. return [
  277. {
  278. attrs: {
  279. label: "订单号",
  280. slot: "code",
  281. width: 150,
  282. },
  283. },
  284. {
  285. attrs: {
  286. label: "下单时间",
  287. prop: "createTime",
  288. width: 160,
  289. },
  290. },
  291. {
  292. attrs: {
  293. label: "交期",
  294. prop: "deliveryPeriod",
  295. width: 160,
  296. },
  297. },
  298. {
  299. attrs: {
  300. label: "投产时间",
  301. prop: "produceTime",
  302. width: 160,
  303. },
  304. },
  305. {
  306. attrs: {
  307. label: "生产状态",
  308. prop: "produceStatus",
  309. width: 120,
  310. },
  311. render(val) {
  312. return proxy.dictValueLabel(val, statusData.value);
  313. },
  314. },
  315. {
  316. attrs: {
  317. label: "生产指示",
  318. slot: "prodTag",
  319. "min-width": 220,
  320. },
  321. },
  322. {
  323. attrs: {
  324. slot: "list",
  325. label: "产品生产进度",
  326. // prop: "name",
  327. "min-width": 300,
  328. },
  329. },
  330. {
  331. attrs: {
  332. label: "操作",
  333. width: "100",
  334. align: "center",
  335. fixed: "right",
  336. },
  337. renderHTML(row) {
  338. return [
  339. row.produceTime
  340. ? {}
  341. : {
  342. attrs: {
  343. label: "投产",
  344. type: "primary",
  345. text: true,
  346. },
  347. el: "button",
  348. click() {
  349. // proxy
  350. // .msgConfirm()
  351. // .then((res) => {
  352. // proxy
  353. // .post("/produceOrder/putProduction", {
  354. // id: row.id,
  355. // })
  356. // .then((res) => {
  357. // proxy.msgTip("操作成功", 1);
  358. // getList();
  359. // });
  360. // })
  361. // .catch((err) => {});
  362. clickDistributeProduction(row);
  363. },
  364. },
  365. ];
  366. },
  367. },
  368. ];
  369. });
  370. const formData = reactive({
  371. data: {},
  372. orderData: {},
  373. });
  374. const formOption = reactive({
  375. inline: true,
  376. labelWidth: 100,
  377. itemWidth: 100,
  378. });
  379. const formOptionOne = reactive({
  380. inline: true,
  381. labelWidth: 100,
  382. itemWidth: 100,
  383. disabled: true,
  384. });
  385. const formDom = ref(null);
  386. const formConfig = computed(() => {
  387. return [
  388. {
  389. type: "title1",
  390. title: "基本信息",
  391. },
  392. {
  393. type: "text",
  394. prop: "code",
  395. label: "合同号:",
  396. disabled: true,
  397. isShow: formData.orderData.code ? true : false,
  398. },
  399. {
  400. type: "title1",
  401. title: "商品信息",
  402. haveLine: true,
  403. },
  404. {
  405. type: "slot",
  406. slotName: "commodity",
  407. label: "",
  408. },
  409. ];
  410. });
  411. const rules = ref({
  412. deptId: [{ required: true, message: "请选择负责部门", trigger: "change" }],
  413. name: [{ required: true, message: "请输入店铺名称", trigger: "blur" }],
  414. code: [{ required: true, message: "请输入店铺编号", trigger: "blur" }],
  415. });
  416. const getList = async (req) => {
  417. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  418. loading.value = true;
  419. proxy.post("/produceOrder/page", sourceList.value.pagination).then((res) => {
  420. res.rows.forEach((x) => {
  421. if (x.prodTag) {
  422. x.prodTags = x.prodTag.split(",");
  423. } else {
  424. x.prodTags = [];
  425. }
  426. });
  427. sourceList.value.data = res.rows;
  428. sourceList.value.pagination.total = res.total;
  429. setTimeout(() => {
  430. loading.value = false;
  431. }, 200);
  432. });
  433. };
  434. const openModal = () => {
  435. dialogVisible.value = true;
  436. modalType.value = "add";
  437. formData.data = {
  438. definition: "2",
  439. fileList: [],
  440. };
  441. if (currencyData.value && currencyData.value.length > 0) {
  442. formData.data.currency = currencyData.value[0].dictKey;
  443. formData.data.costCurrency = currencyData.value[0].dictKey;
  444. }
  445. };
  446. const submitForm = () => {
  447. formDom.value.handleSubmit((valid) => {
  448. submitLoading.value = true;
  449. proxy.post("/shopInfo/" + modalType.value, formData.data).then(
  450. (res) => {
  451. proxy.msgTip("操作成功", 1);
  452. dialogVisible.value = false;
  453. submitLoading.value = false;
  454. getList();
  455. },
  456. (err) => {
  457. submitLoading.value = false;
  458. }
  459. );
  460. });
  461. };
  462. const getDtl = (row) => {
  463. modalType.value = "edit";
  464. proxy.post("/shopInfo/detail", { id: row.id }).then((res) => {
  465. formData.data = res;
  466. dialogVisible.value = true;
  467. });
  468. };
  469. getList();
  470. const productionFormDom = ref(null);
  471. const productionDialog = ref(false);
  472. const formLoading = ref(false);
  473. const productionFormConfig = computed(() => [
  474. {
  475. type: "date",
  476. itemType: "datetime",
  477. label: "投产时间",
  478. prop: "produceTime",
  479. // placeholder: "合同开始时间",
  480. itemWidth: 100,
  481. clearable: true,
  482. },
  483. ]);
  484. const productionRules = ref({
  485. produceTime: [
  486. { required: true, message: "请选择投产时间", trigger: "change" },
  487. ],
  488. });
  489. const clickDistributeProduction = (row) => {
  490. formData.data = {
  491. id: row.id,
  492. produceTime: moment().format("yyyy-MM-DD HH:mm:ss"),
  493. };
  494. productionDialog.value = true;
  495. };
  496. const submitProduction = () => {
  497. productionFormDom.value.handleSubmit(() => {
  498. formLoading.value = true;
  499. proxy.post("/produceOrder/putProduction", formData.data).then((res) => {
  500. proxy.msgTip("操作成功");
  501. formLoading.value = false;
  502. productionDialog.value = false;
  503. getList();
  504. getRightData();
  505. });
  506. });
  507. };
  508. const rightData = ref([]);
  509. const rightDataObj = ref({});
  510. const colorData = ref({});
  511. let colorList = [
  512. "#BBFF00",
  513. "#FFFF00",
  514. "#FFBB00",
  515. "#FF3333",
  516. "#D28EFF",
  517. "#CCEEFF",
  518. "#FFC8B4",
  519. "#CCDDFF",
  520. "#007799",
  521. "#550088",
  522. "#AAFFEE",
  523. "#FFB3FF",
  524. "#FFFF33",
  525. ];
  526. const getRightData = () => {
  527. proxy
  528. .post("/produceOrder/schedulingList", { beginDate: monthOne.value })
  529. .then(
  530. (res) => {
  531. rightDataObj.value = {};
  532. rightData.value = res.map((x, index) => ({
  533. ...x,
  534. produceTimeOne: x.produceTime,
  535. produceTime: x.produceTime.substr(0, 10),
  536. deliveryPeriod: x.deliveryPeriod.substr(0, 10),
  537. }));
  538. for (let i = 0; i < res.length; i++) {
  539. const ele = res[i];
  540. rightDataObj.value[ele.id] = ele;
  541. if (i <= 19) {
  542. colorData.value[ele.id] = colorList[i];
  543. } else {
  544. colorData.value[ele.id] = colorList[19 - i] || colorList[0];
  545. }
  546. }
  547. },
  548. (err) => {
  549. loading.value = false;
  550. }
  551. );
  552. };
  553. getRightData();
  554. const getBackGround = (id) => {
  555. return { background: colorData.value[id] };
  556. };
  557. const prodTagClose = (index, row) => {
  558. row.prodTags.splice(index, 1);
  559. proxy
  560. .post("/contract/updateProductionTag", {
  561. id: row.contractId,
  562. prodTag: row.prodTags.join(","),
  563. })
  564. .then((res) => {
  565. getList();
  566. });
  567. };
  568. const clickToday = () => {
  569. today.value = moment().format("yyyy-MM-DD");
  570. month.value = moment().format("yyyy年MM月");
  571. monthOne.value = moment().format("yyyy-MM");
  572. getRightData();
  573. };
  574. const isShow = (day) => {
  575. let nowDay = new Date(day + " 23:59:59").getTime();
  576. let flag = false;
  577. for (let i = 0; i < rightData.value.length; i++) {
  578. const e = rightData.value[i];
  579. let startDay = new Date(e.produceTime).getTime();
  580. let endDay = new Date(e.deliveryPeriod + " 23:59:59").getTime();
  581. if (nowDay >= startDay && nowDay <= endDay) {
  582. flag = true;
  583. break;
  584. }
  585. }
  586. return flag;
  587. };
  588. const judgeDay = (day) => {
  589. // return dateList.value[day] && dateList.value[day].length > 0;
  590. let nowDay = new Date(day + " 23:59:59").getTime();
  591. let rows = [];
  592. for (let i = 0; i < rightData.value.length; i++) {
  593. const e = rightData.value[i];
  594. let startDay = new Date(e.produceTime).getTime();
  595. let endDay = new Date(e.deliveryPeriod + " 23:59:59").getTime();
  596. if (nowDay >= startDay && nowDay <= endDay) {
  597. rows.push(e.id);
  598. }
  599. }
  600. return rows;
  601. };
  602. const showData = ref([]);
  603. const onShow = (day) => {
  604. let rows = judgeDay(day);
  605. showData.value = rows;
  606. };
  607. const getData = (id, att) => {
  608. const current = rightData.value.find((x) => x.id == id);
  609. if (current && current[att]) {
  610. return current[att];
  611. }
  612. };
  613. const selectDate = (val) => {
  614. calendar.value.selectDate(val);
  615. };
  616. const prevMonth = () => {
  617. month.value = moment(
  618. moment(month.value, "yyyy年MM月").add(-1, "month").calendar()
  619. ).format("yyyy年MM月");
  620. monthOne.value = moment(moment(month.value, "yyyy年MM月")).format("yyyy-MM");
  621. selectDate("prev-month");
  622. getRightData();
  623. };
  624. const nextMonth = () => {
  625. month.value = moment(
  626. moment(month.value, "yyyy年MM月").add(+1, "month").calendar()
  627. ).format("yyyy年MM月");
  628. monthOne.value = moment(moment(month.value, "yyyy年MM月")).format("yyyy-MM");
  629. selectDate("next-month");
  630. getRightData();
  631. };
  632. watch(
  633. () => today.value,
  634. (newValue) => {
  635. if (month.value !== moment(newValue).format("yyyy年MM月")) {
  636. month.value = moment(newValue).format("yyyy年MM月");
  637. monthOne.value = moment(moment(month.value, "yyyy年MM月")).format(
  638. "yyyy-MM"
  639. );
  640. getRightData();
  641. }
  642. }
  643. );
  644. const getFileData = () => {
  645. let ids = [];
  646. formData.orderData.contractProductList.map((x) => {
  647. ids.push(x.productId);
  648. x.contractProductBomList.map((y) => {
  649. ids.push(y.materialId);
  650. });
  651. });
  652. ids = Array.from(new Set(ids));
  653. proxy
  654. .post("/fileInfo/getList", {
  655. businessIdList: ids,
  656. })
  657. .then((fileObj) => {
  658. formData.orderData.contractProductList.map((x) => {
  659. if (fileObj[x.productId] && fileObj[x.productId].length > 0) {
  660. x.fileUrl = fileObj[x.productId][0].fileUrl;
  661. }
  662. x.contractProductBomList.map((y) => {
  663. y.fileList = fileObj[y.materialId] || [];
  664. if (y.fileList && y.fileList.length > 0) {
  665. y.fileUrl = y.fileList[0].fileUrl;
  666. }
  667. });
  668. });
  669. });
  670. };
  671. const lookDetails = (item) => {
  672. proxy.post("/contract/detail", { id: item.contractId }).then((res) => {
  673. formData.orderData = res;
  674. dialogVisible.value = true;
  675. if (
  676. formData.orderData.contractProductList &&
  677. formData.orderData.contractProductList.length > 0
  678. ) {
  679. getFileData();
  680. }
  681. });
  682. };
  683. const handleClickUpload = async (att, flag, index) => {
  684. let res = null;
  685. let path = "";
  686. if (flag) {
  687. proxy.msgTip("请稍后", 2);
  688. res = await proxy.post("/fileService/createTempFolder");
  689. if (res && res.path) {
  690. formData.data.contractProductList[index][att] = res.path;
  691. path = res.path;
  692. }
  693. } else {
  694. path = formData.data.contractProductList[index][att];
  695. }
  696. let a = document.createElement("a");
  697. a.href = "printer://" + "ftp://121.37.194.75/" + path + "/";
  698. a.style.display = "none";
  699. document.body.appendChild(a);
  700. a.click();
  701. document.body.removeChild(a);
  702. };
  703. </script>
  704. <style lang="scss" scoped>
  705. ::v-deep(.el-progress__text) {
  706. font-size: 14px !important;
  707. }
  708. .user {
  709. padding: 10px;
  710. display: flex;
  711. justify-content: space-between;
  712. .schedule-right {
  713. width: 400px;
  714. .schedule-top {
  715. width: 100%;
  716. background: #fff;
  717. padding: 20px;
  718. }
  719. .schedule-bottom {
  720. width: 100%;
  721. background: #fff;
  722. height: calc(100vh - 100px - 20px - 83px);
  723. padding: 20px;
  724. margin-top: 10px;
  725. overflow-y: auto;
  726. &::-webkit-scrollbar {
  727. width: 0px;
  728. }
  729. .line-class {
  730. height: 18px;
  731. line-height: 18px;
  732. overflow: hidden;
  733. white-space: nowrap;
  734. text-overflow: ellipsis;
  735. -o-text-overflow: ellipsis;
  736. margin: 1px 0;
  737. }
  738. }
  739. }
  740. .content {
  741. width: calc(100% - 410px);
  742. }
  743. }
  744. ::v-deep(.el-calendar__header) {
  745. display: none;
  746. }
  747. ::v-deep(.el-calendar__body) {
  748. padding: 0;
  749. }
  750. ::v-deep(.el-calendar-table .el-calendar-day) {
  751. // padding: 0;
  752. min-height: 50px;
  753. height: calc((100vh - 100px - 20px - 83px - 95px) / 5);
  754. overflow-y: hidden;
  755. }
  756. .el-icon.avatar-uploader-icon {
  757. font-size: 20px;
  758. color: #8c939d;
  759. width: 50px;
  760. height: 50px;
  761. text-align: center;
  762. border: 1px dashed var(--el-border-color);
  763. }
  764. </style>