deleteDetails.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <template>
  2. <div class="box-cardTwo">
  3. <el-form
  4. ref="ruleForm"
  5. :model="form"
  6. label-width="90px"
  7. v-loading="loadingStatus"
  8. :element-loading-text="loadingText"
  9. element-loading-background="rgba(0, 0, 0, 0.2)"
  10. >
  11. <LabelTemplate title="删除原因" />
  12. <div style="padding: 20px 0">
  13. <el-form-item>
  14. <div v-html="getStyle(form.deleteRemarks)"></div>
  15. </el-form-item>
  16. </div>
  17. <LabelTemplate title="产品" />
  18. <div style="padding: 20px 0">
  19. <div>
  20. <el-collapse v-model="activeNames">
  21. <div v-for="(item, index) in form.contractProductList" :key="item.id" style="margin-bottom: 20px">
  22. <div style="border: 1px solid #edf0f5">
  23. <table cellspacing="0" cellpadding="0" border="0" class="productTable">
  24. <thead>
  25. <tr>
  26. <th style="width: 230px">
  27. <div>产品</div>
  28. </th>
  29. <th style="width: 150px">
  30. <div>图稿(设计图)</div>
  31. </th>
  32. <th style="width: 330px" v-if="form.draftType !== '2'">
  33. <div>图稿(生产文件)</div>
  34. </th>
  35. <th>
  36. <div>包材配件/单品</div>
  37. </th>
  38. <th style="width: 80px; text-align: center" v-if="item.waybillNo">
  39. <span>操作</span>
  40. </th>
  41. </tr>
  42. </thead>
  43. <tr>
  44. <td>
  45. <div style="display: flex; padding: 8px 20px 0px">
  46. <div v-if="item.pic" style="min-width: 80px">
  47. <img v-if="!item.pic.includes('https')" class="productImg" :src="pathPrefix + item.pic" @click="openImg(pathPrefix + item.pic)" />
  48. <img v-else :src="item.pic" class="productImg" @click="openImg(item.pic)" />
  49. </div>
  50. <div>
  51. <div style="line-height: 28px">
  52. <span>商品名称: {{ item.olnSkuName }}</span>
  53. </div>
  54. <div style="line-height: 28px">
  55. <span>品号: {{ item.specCode }}</span>
  56. </div>
  57. <div style="line-height: 28px">
  58. <span>品名: {{ item.colorName }}</span>
  59. </div>
  60. <div style="line-height: 40px">
  61. <span>数量:{{ Number(item.quantity) }} </span>
  62. </div>
  63. <div style="line-height: 28px">
  64. <span>定制加工费: {{ item.processPrice }}</span>
  65. </div>
  66. <div style="line-height: 28px">
  67. <span>代发费: {{ item.deliverGoodsPrice }}</span>
  68. </div>
  69. <div style="line-height: 28px">
  70. <span>快递包材费: {{ item.expressPrice }}</span>
  71. </div>
  72. <div style="line-height: 28px">
  73. <span>包装人工费: {{ item.expensePrice }}</span>
  74. </div>
  75. <div style="line-height: 28px">
  76. <span>单价: ¥{{ moneyFormat(item.productPrice, 2) }}</span>
  77. </div>
  78. <div style="line-height: 28px">
  79. <span>小计: ¥ {{ statisticalAmount(item) }}</span>
  80. </div>
  81. <div style="line-height: 40px">
  82. <span>打印: <span v-if="item.identification === 1">单面</span> <span v-if="item.identification === 2">双面</span> </span>
  83. </div>
  84. </div>
  85. </div>
  86. </td>
  87. <td>
  88. <div style="padding: 8px 20px 0px">
  89. <div v-if="item.imgPath">
  90. <img
  91. v-if="!item.imgPath.includes('https')"
  92. class="productImg"
  93. :src="pathPrefix + item.imgPath"
  94. style="width: 80px; height: 80px"
  95. @click="openImg(pathPrefix + item.imgPath)"
  96. />
  97. <img v-else :src="item.imgPath" class="productImg" style="width: 80px; height: 80px" @click="openImg(item.imgPath)" />
  98. </div>
  99. </div>
  100. </td>
  101. <td v-if="form.draftType !== '2'">
  102. <div style="padding: 8px 20px 0px">
  103. <div>共享文件夹路径(点击下方链接并上传文件):</div>
  104. <a style="color: #027db4; cursor: pointer; word-break: break-all" @click="clickPath(item.artworkDocument)">
  105. {{ item.artworkDocument.replace(/\\/g, '/') }}
  106. </a>
  107. </div>
  108. </td>
  109. <td>
  110. <div style="padding: 8px 20px 0px">
  111. <el-table
  112. :data="item.partsContractProductList"
  113. size="small"
  114. :row-style="{ height: '35px' }"
  115. :cell-style="{ padding: '0' }"
  116. border
  117. ref="table"
  118. >
  119. <el-table-column label="单价¥" prop="price" align="left" width="120">
  120. <template slot-scope="scope">
  121. <span>{{ moneyFormat(scope.row.price, 2) }}</span>
  122. </template>
  123. </el-table-column>
  124. <el-table-column label="数量" prop="singleQuantity" align="left" width="90"> </el-table-column>
  125. <el-table-column label="名称" prop="name" align="left" min-width="150" />
  126. <el-table-column label="总量" prop="quantity" align="center" width="70">
  127. <template slot-scope="scope">
  128. {{ scope.row.quantity }}
  129. </template>
  130. </el-table-column>
  131. <el-table-column label="小计¥" align="center" width="100">
  132. <template slot-scope="scope">
  133. {{ moneyFormat(scope.row.amount, 2) }}
  134. </template>
  135. </el-table-column>
  136. </el-table>
  137. </div>
  138. </td>
  139. </tr>
  140. </table>
  141. <el-collapse-item title="包装" :name="index">
  142. <div style="display: flex; padding: 8px 10px 0px">
  143. <div style="width: 100%; padding: 0px 10px">
  144. <div>
  145. 包装要求:
  146. <div style="border: 1px solid #d3d3d3; max-height: 500px; overflow: auto; padding: 10px" v-if="item.packageRemarks">
  147. <div v-html="item.packageRemarks"></div>
  148. </div>
  149. <span v-else>无</span>
  150. </div>
  151. </div>
  152. </div>
  153. </el-collapse-item>
  154. </div>
  155. </div>
  156. </el-collapse>
  157. </div>
  158. </div>
  159. </el-form>
  160. </div>
  161. </template>
  162. <script>
  163. import LabelTemplate from '@/components/LabelTemplate'
  164. import { orderDetails } from '@/api/shengde/subsidiary/AddOrModifiedOrder/index.js'
  165. export default {
  166. components: { LabelTemplate },
  167. props: {
  168. rowData: Object,
  169. },
  170. data() {
  171. return {
  172. pathPrefix: process.env.VUE_APP_IMG_URL,
  173. filePrefix: process.env.VUE_APP_FILE_PREFIX,
  174. loadingStatus: false,
  175. loadingText: '',
  176. form: {
  177. deleteRemarks: '',
  178. contractProductList: [],
  179. },
  180. activeNames: '',
  181. }
  182. },
  183. created() {},
  184. mounted() {
  185. if (this.rowData && this.rowData.processInstanceId) {
  186. this.getDetails({ processInstanceId: this.rowData.processInstanceId })
  187. }
  188. },
  189. methods: {
  190. getDetails(data) {
  191. this.loadingText = '获取数据中,请稍后'
  192. this.loadingStatus = true
  193. orderDetails(data).then(
  194. (res) => {
  195. for (let i = 0; i < res.data.data.contractProductList.length; i++) {
  196. res.data.data.contractProductList[i].artworkDocument = (this.filePrefix + res.data.data.contractProductList[i].artworkDocument).replace(/\//g, '\\')
  197. }
  198. this.form = res.data.data
  199. console.log(this.form)
  200. this.loadingStatus = false
  201. },
  202. (err) => {
  203. console.log('orderDetails: ' + err)
  204. this.loadingStatus = false
  205. }
  206. )
  207. },
  208. getStyle(text) {
  209. if (text) {
  210. return text.replace(/\n|\r\n/g, '<br>')
  211. } else {
  212. return ''
  213. }
  214. },
  215. openImg(path) {
  216. window.open(path)
  217. },
  218. getPath(val) {
  219. if (val) {
  220. let path = val.replace(/\\/g, '/')
  221. return 'printer://' + path + '/'
  222. }
  223. return ''
  224. },
  225. statisticalAmount(item) {
  226. if (item.quantity && item.quantity > 0) {
  227. let money = item.productPrice || 0
  228. if (item.processPrice) {
  229. money = parseFloat(Number(money) + Number(item.processPrice)).toFixed(2)
  230. }
  231. if (item.deliverGoodsPrice) {
  232. money = parseFloat(Number(money) + Number(item.deliverGoodsPrice)).toFixed(2)
  233. }
  234. if (item.expressPrice) {
  235. money = parseFloat(Number(money) + Number(item.expressPrice)).toFixed(2)
  236. }
  237. if (item.expensePrice) {
  238. money = parseFloat(Number(money) + Number(item.expensePrice)).toFixed(2)
  239. }
  240. money = parseFloat(Number(money) * Number(item.quantity)).toFixed(2)
  241. return this.moneyFormat(money, 2)
  242. }
  243. return ''
  244. },
  245. clickPath(item) {
  246. let path = JSON.parse(JSON.stringify(item)).replace(/\\/g, '/')
  247. addFolder(path).then(
  248. () => {
  249. let a = document.createElement('a')
  250. a.href = 'printer://' + path.replace(/\//g, '/') + '/'
  251. a.style.display = 'none'
  252. document.body.appendChild(a)
  253. a.click()
  254. document.body.removeChild(a)
  255. },
  256. (err) => {
  257. console.log('addFolder:' + err)
  258. }
  259. )
  260. },
  261. },
  262. }
  263. </script>
  264. <style lang="scss" scoped>
  265. .box-cardTwo {
  266. height: calc(100vh - 110px - 10px - 125px - 40px);
  267. overflow-y: auto;
  268. }
  269. ::v-deep {
  270. .tableHeader th {
  271. background-color: #edf0f5;
  272. height: 35px;
  273. padding: 0;
  274. }
  275. .el-collapse-item__header {
  276. justify-content: center;
  277. }
  278. .el-collapse-item__arrow {
  279. margin: 0;
  280. }
  281. }
  282. .productTable {
  283. width: 100%;
  284. table-layout: fixed;
  285. th {
  286. background-color: #edf0f5;
  287. height: 35px;
  288. line-height: 35px;
  289. padding: 0;
  290. div {
  291. text-align: left;
  292. padding: 0 20px;
  293. }
  294. }
  295. td {
  296. vertical-align: top;
  297. }
  298. }
  299. .productImg {
  300. width: 60px;
  301. height: 60px;
  302. cursor: pointer;
  303. object-fit: contain;
  304. vertical-align: middle;
  305. border: none;
  306. }
  307. p {
  308. margin: 0px;
  309. }
  310. </style>