engin_examine.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. <template>
  2. <div class="detail-container">
  3. <el-page-header @back="goBack" content="审批"></el-page-header>
  4. <div class="main-title">
  5. <div class="title">工程信息单</div>
  6. </div>
  7. <div class="diy-table-1">
  8. <el-row>
  9. <el-col :span="8" class="item">
  10. <div class="label">工程订单号</div>
  11. <div class="value">{{detailData.enginInfoNo}}</div>
  12. </el-col>
  13. <el-col :span="8" class="item">
  14. <div class="label">订单日期</div>
  15. <div class="value">{{detailData.orderDate}}</div>
  16. </el-col>
  17. <el-col :span="8" class="item">
  18. <div class="label">单据状态</div>
  19. <div class="value">{{detailData.examineStatus | statusFilter}}</div>
  20. </el-col>
  21. <el-col :span="8" class="item">
  22. <div class="label">经销商编码</div>
  23. <div class="value">{{detailData.customerNumber}}</div>
  24. </el-col>
  25. <el-col :span="8" class="item">
  26. <div class="label">项目名称</div>
  27. <div class="value">{{detailData.projectName}}</div>
  28. </el-col>
  29. <el-col :span="8" class="item">
  30. <div class="label">单据类型</div>
  31. <div class="value">{{detailData.orderType}}</div>
  32. </el-col>
  33. <el-col :span="8" class="item">
  34. <div class="label">经销商名称</div>
  35. <div class="value">{{detailData.customerName}}</div>
  36. </el-col>
  37. <el-col :span="8" class="item">
  38. <div class="label">使用单位</div>
  39. <div class="value">{{detailData.useUnit}}</div>
  40. </el-col>
  41. <el-col :span="8" class="item">
  42. <div class="label">安装地址</div>
  43. <div class="value">{{detailData.installAddress}}</div>
  44. </el-col>
  45. <el-col :span="8" class="item">
  46. <div class="label">工程编号</div>
  47. <div class="value">{{detailData.projectNo}}</div>
  48. </el-col>
  49. <el-col :span="8" class="item">
  50. <div class="label">厂工程编码</div>
  51. <div class="value">{{detailData.enginFactoryNo}}</div>
  52. </el-col>
  53. <el-col :span="8" class="item">
  54. <div class="label">工程登录类型</div>
  55. <div class="value">{{detailData.enginSignType}}</div>
  56. </el-col>
  57. <el-col :span="8" class="item">
  58. <div class="label">联系人</div>
  59. <div class="value">{{detailData.linkman}}</div>
  60. </el-col>
  61. <el-col :span="8" class="item">
  62. <div class="label">联系电话</div>
  63. <div class="value">{{detailData.phone}}</div>
  64. </el-col>
  65. <el-col :span="8" class="item">
  66. <div class="label">固定电话</div>
  67. <div class="value">{{detailData.tel}}</div>
  68. </el-col>
  69. <el-col :span="8" class="item">
  70. <div class="label">制单人</div>
  71. <div class="value">{{detailData.createName}}</div>
  72. </el-col>
  73. <el-col :span="8" class="item">
  74. <div class="label">制单日期</div>
  75. <div class="value">{{detailData.createTime}}</div>
  76. </el-col>
  77. <el-col :span="8" class="item">
  78. <div class="label">合同有效期</div>
  79. <div class="value">
  80. <el-date-picker
  81. v-model="detailData.contractExpireDate"
  82. type="date"
  83. prefix-icon="none"
  84. value-format="yyyy-MM-dd"
  85. style="width: 100%;"
  86. placeholder="选择日期">
  87. </el-date-picker>
  88. </div>
  89. </el-col>
  90. <el-col :span="16" class="item">
  91. <div class="label">备注</div>
  92. <div class="value">{{detailData.remark}}</div>
  93. </el-col>
  94. <el-col :span="8" class="item">
  95. <div class="label">业务员</div>
  96. <div class="value">{{detailData.serviceId}}</div>
  97. </el-col>
  98. </el-row>
  99. </div>
  100. <div class="main-title">
  101. <div class="title">货品信息</div>
  102. </div>
  103. <div class="table" style="margin-top: 20px">
  104. <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
  105. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  106. <el-table-column align="center" label="销售类型" prop="saleTypeId" min-width="160" show-overflow-tooltip>
  107. <template slot-scope="scope">
  108. <el-select v-model="scope.row.saleTypeId" placeholder="选择销售类型" size="small" @change="changeSaleType(scope.$index)">
  109. <el-option
  110. v-for="item in salesTypeList"
  111. :key="item.id"
  112. :label="item.saleName"
  113. :value="item.id">
  114. </el-option>
  115. </el-select>
  116. </template>
  117. </el-table-column>
  118. <el-table-column align="center" label="产品名称" prop="materialNumber" min-width="160" show-overflow-tooltip>
  119. <template slot-scope="scope">
  120. <el-select v-model="scope.row.materialNumber" placeholder="选择产品" size="small" @change="changeGoods(scope.$index)">
  121. <el-option
  122. v-for="item in retailProductList"
  123. :key="item.id"
  124. :label="item.name"
  125. :value="item.number">
  126. </el-option>
  127. </el-select>
  128. </template>
  129. </el-table-column>
  130. <el-table-column align="center" label="产品编码" prop="materialNumber" min-width="120" show-overflow-tooltip></el-table-column>
  131. <el-table-column align="center" label="规格型号" prop="specification" min-width="200" show-overflow-tooltip></el-table-column>
  132. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  133. <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip>
  134. <template slot-scope="scope">
  135. <el-input v-model="scope.row.price" size="small" type="number"></el-input>
  136. </template>
  137. </el-table-column>
  138. <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip>
  139. <template slot-scope="scope">
  140. <el-input v-model="scope.row.qty" size="small" type="number"></el-input>
  141. </template>
  142. </el-table-column>
  143. <el-table-column align="center" label="订单金额" min-width="100" show-overflow-tooltip>
  144. <template slot-scope="scope">
  145. {{(scope.row.price || 0) * (scope.row.qty || 0)}}
  146. </template>
  147. </el-table-column>
  148. <el-table-column align="center" label="备注" prop="remark" min-width="200" show-overflow-tooltip>
  149. <template slot-scope="scope">
  150. <el-input v-model="scope.row.remark" size="small"></el-input>
  151. </template>
  152. </el-table-column>
  153. <el-table-column align="center" label="税率" prop="taxRate" min-width="100" show-overflow-tooltip></el-table-column>
  154. <el-table-column align="center" label="操作" width="100" fixed="right">
  155. <template slot-scope="scope">
  156. <el-button type="text" @click="deleteItem(scope.$index)">删除</el-button>
  157. </template>
  158. </el-table-column>
  159. </el-table>
  160. <div class="add"><el-button type="text" icon="el-icon-plus" @click="addGoods">添加产品</el-button></div>
  161. </div>
  162. <div class="main-title">
  163. <div class="title">审批信息</div>
  164. </div>
  165. <div class="diy-table-1">
  166. <el-row :gutter="0">
  167. <el-col :span="12" class="item">
  168. <div class="label">审批人</div>
  169. <div class="value">{{userName}}</div>
  170. </el-col>
  171. <el-col :span="12" class="item">
  172. <div class="label">审批结果</div>
  173. <div class="value">
  174. <el-radio-group v-model="examineForm.examineResult">
  175. <el-radio :label="true">通过</el-radio>
  176. <el-radio :label="false">驳回</el-radio>
  177. </el-radio-group>
  178. </div>
  179. </el-col>
  180. <el-col :span="24" class="item">
  181. <div class="label">审批说明</div>
  182. <div class="value"><el-input v-model="examineForm.remark" placeholder="请输入内容"></el-input></div>
  183. </el-col>
  184. </el-row>
  185. </div>
  186. <div class="page-footer">
  187. <div class="footer">
  188. <el-button type="primary" @click="clickSubmitForm" :loading="formLoading">{{ formLoading ? '提交中 ...' : '提 交' }}</el-button>
  189. <el-popconfirm
  190. title="确定关闭吗?"
  191. @onConfirm="goBack"
  192. style="margin-left: 10px;"
  193. >
  194. <el-button slot="reference">关 闭</el-button>
  195. </el-popconfirm>
  196. </div>
  197. </div>
  198. </div>
  199. </template>
  200. <script>
  201. import { getEnginDetail, getRetailProductList, examineEngin } from "@/api/supply/engin";
  202. import { getTypeList } from "@/api/common";
  203. export default {
  204. name: 'EnginExamine',
  205. componentName: 'EnginExamine',
  206. props: ['listItem'],
  207. filters: {
  208. statusFilter(val) {
  209. const statusList = [
  210. { label: '已保存', value: 'SAVE' },
  211. { label: '待审核', value: 'WAIT' },
  212. { label: '审核通过', value: 'OK' },
  213. { label: '审核驳回', value: 'FAIL' },
  214. { label: '已关闭', value: 'CLOSE' },
  215. ];
  216. let obj = statusList.find(o => o.value == val);
  217. return obj ? obj.label : ''
  218. }
  219. },
  220. data() {
  221. return {
  222. detailData: {},
  223. goodsList: [],
  224. userName: JSON.parse(localStorage.getItem("supply_user")).nickName,
  225. formLoading: false,
  226. examineForm: {
  227. examineResult: true,
  228. remark: '',
  229. },
  230. salesTypeList: [],
  231. retailProductList: [],
  232. }
  233. },
  234. created() {
  235. this.getDetail();
  236. this.getTypeList();
  237. this.getRetailProductList();
  238. },
  239. methods: {
  240. // 返回列表
  241. goBack() {
  242. this.$emit('backListFormDetail');
  243. },
  244. // 获取详情
  245. getDetail() {
  246. getEnginDetail({id: this.listItem.enginInfoId}).then(res => {
  247. this.detailData = res.data;
  248. this.goodsList = res.data.items;
  249. })
  250. },
  251. // 获取销售类型列表
  252. getTypeList() {
  253. getTypeList({
  254. pageNum: 1,
  255. pageSize: -1,
  256. }).then((res) => {
  257. this.salesTypeList = res.data.records;
  258. });
  259. },
  260. // 获取商品列表
  261. getRetailProductList() {
  262. getRetailProductList({
  263. pageNum: 1,
  264. pageSize: -1,
  265. }).then(res => {
  266. this.retailProductList = res.data.records;
  267. })
  268. },
  269. // 修改销售类型
  270. changeSaleType(index) {
  271. if(this.goodsList[index].saleTypeId) {
  272. let obj = this.salesTypeList.find(o => o.id == this.goodsList[index].saleTypeId);
  273. this.goodsList[index].saleTypeName = obj.saleName;
  274. this.goodsList[index].saleTypeCode = obj.saleCode;
  275. }
  276. },
  277. // 修改产品
  278. changeGoods(index) {
  279. if(this.goodsList[index].materialNumber) {
  280. let obj = this.retailProductList.find(o => o.number == this.goodsList[index].materialNumber);
  281. this.goodsList[index].materialName = obj.name;
  282. this.goodsList[index].materialId = obj.materialId;
  283. this.goodsList[index].specification = obj.specification;
  284. this.goodsList[index].baseUnitId = obj.baseUnit;
  285. this.goodsList[index].price = obj.batchPrice;
  286. this.goodsList[index].taxRate = obj.taxRate;
  287. this.goodsList[index].mainId = obj.mainId;
  288. }
  289. },
  290. // 添加产品
  291. addGoods() {
  292. this.goodsList.push({})
  293. },
  294. // 删除产品
  295. deleteItem(index) {
  296. this.goodsList.splice(index, 1);
  297. },
  298. clickSubmitForm() {
  299. this.formLoading = true;
  300. examineEngin({
  301. enginInfoId: this.listItem.enginInfoId,
  302. mainId: this.listItem.mainId,
  303. examineResult: this.examineForm.examineResult,
  304. examineNote: this.examineForm.remark,
  305. contractExpireDate: this.detailData.contractExpireDate,
  306. items: this.goodsList,
  307. }).then(res => {
  308. this.$successMsg('审批成功');
  309. this.goBack();
  310. this.$parent.getList();
  311. }).finally(res => {
  312. this.formLoading = false;
  313. })
  314. },
  315. }
  316. }
  317. </script>
  318. <style scoped lang="scss">
  319. .detail-container {
  320. width: 100%;
  321. height: 100%;
  322. }
  323. .main-title {
  324. display: flex;
  325. justify-content: space-between;
  326. align-items: center;
  327. margin-top: 20px;
  328. height: 60px;
  329. border-bottom: 1px solid #DCDFE6;
  330. margin-bottom: 20px;
  331. .title {
  332. font-size: 16px;
  333. font-weight: 600;
  334. padding-left: 10px;
  335. }
  336. }
  337. .add {
  338. display: flex;
  339. align-items: center;
  340. justify-content: center;
  341. border: 1px solid #EBEEF5;
  342. border-top: none;
  343. height: 50px;
  344. }
  345. ::v-deep input::-webkit-outer-spin-button,
  346. ::v-deep input::-webkit-inner-spin-button {
  347. -webkit-appearance: none;
  348. }
  349. ::v-deep input[type='number'] {
  350. -moz-appearance: textfield;
  351. }
  352. </style>