engin_examine.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730
  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">
  20. <el-select v-model="detailData.serviceId" placeholder="选择业务员" size="small" filterable clearable style="width: 100%">
  21. <el-option
  22. v-for="item in salesmanList"
  23. :key="item.adminUserId"
  24. :label="item.nickName"
  25. :value="item.adminUserId">
  26. </el-option>
  27. </el-select>
  28. </div>
  29. </el-col>
  30. <el-col :span="8" class="item">
  31. <div class="label">经销商编码</div>
  32. <div class="value">{{detailData.customerNumber}}</div>
  33. </el-col>
  34. <el-col :span="8" class="item">
  35. <div class="label">项目名称</div>
  36. <div class="value">
  37. <el-input v-model="detailData.projectName" placeholder="请输入项目名称"></el-input>
  38. </div>
  39. </el-col>
  40. <el-col :span="8" class="item">
  41. <div class="label">机型类别</div>
  42. <div class="value">
  43. <el-select v-model="detailData.machineType" placeholder="选择机型类别" size="small" clearable style="width: 100%">
  44. <el-option
  45. v-for="item in machineTypeList"
  46. :key="item.dictCode" :label="item.dictValue" :value="item.dictCode">
  47. </el-option>
  48. </el-select>
  49. </div>
  50. </el-col>
  51. <el-col :span="8" class="item">
  52. <div class="label">经销商名称</div>
  53. <div class="value">{{detailData.customerName}}</div>
  54. </el-col>
  55. <el-col :span="8" class="item">
  56. <div class="label">使用单位</div>
  57. <div class="value">
  58. <el-input v-model="detailData.useUnit" placeholder="请输入使用单位"></el-input>
  59. </div>
  60. </el-col>
  61. <el-col :span="8" class="item">
  62. <div class="label">行业类别</div>
  63. <div class="value">
  64. <el-select v-model="detailData.tradeCategory" placeholder="选择行业类别" size="small" clearable style="width: 100%">
  65. <el-option
  66. v-for="item in tradeCategoryList"
  67. :key="item.value" :label="item.label" :value="item.value">
  68. </el-option>
  69. </el-select>
  70. </div>
  71. </el-col>
  72. <el-col :span="8" class="item">
  73. <div class="label">工程编号</div>
  74. <div class="value">
  75. <el-input v-model="detailData.projectNo" placeholder="请输入工程编号"></el-input>
  76. </div>
  77. </el-col>
  78. <el-col :span="8" class="item">
  79. <div class="label">厂工程编码</div>
  80. <div class="value">
  81. <el-input v-model="detailData.enginFactoryNo" placeholder="请输入厂工程编码"></el-input>
  82. </div>
  83. </el-col>
  84. <el-col :span="8" class="item">
  85. <div class="label">工程登录类型</div>
  86. <div class="value">
  87. <el-select v-model="detailData.enginSignType" placeholder="选择工程登录类型" size="small" clearable style="width: 100%">
  88. <el-option
  89. v-for="item in loginTypeList"
  90. :key="item.dictCode" :label="item.dictValue" :value="item.dictCode">
  91. </el-option>
  92. </el-select>
  93. </div>
  94. </el-col>
  95. <el-col :span="8" class="item">
  96. <div class="label">联系人</div>
  97. <div class="value">
  98. <el-input v-model="detailData.linkman" placeholder="请输入联系人"></el-input>
  99. </div>
  100. </el-col>
  101. <el-col :span="8" class="item">
  102. <div class="label">联系电话</div>
  103. <div class="value">
  104. <el-input v-model="detailData.phone" placeholder="请输入联系电话"></el-input>
  105. </div>
  106. </el-col>
  107. <el-col :span="8" class="item">
  108. <div class="label">固定电话</div>
  109. <div class="value">
  110. <el-input v-model="detailData.tel" placeholder="请输入固定电话"></el-input>
  111. </div>
  112. </el-col>
  113. <el-col :span="8" class="item">
  114. <div class="label">文件编号</div>
  115. <div class="value">{{detailData.fileNo}}</div>
  116. </el-col>
  117. <el-col :span="24" class="item">
  118. <div class="label">安装地址</div>
  119. <div class="value">
  120. <el-input v-model="detailData.installAddress" placeholder="请输入安装地址"></el-input>
  121. </div>
  122. </el-col>
  123. <el-col :span="24" class="item" v-if="!isCustomer">
  124. <div class="label">格力内部备注</div>
  125. <div class="value">
  126. <el-input v-model="detailData.geLiInerNote" placeholder="请输入格力内部备注"></el-input>
  127. </div>
  128. </el-col>
  129. <el-col :span="24" class="item">
  130. <div class="label">格力回复</div>
  131. <div class="value">
  132. <el-input v-model="detailData.geLiNote" placeholder="请输入格力回复"></el-input>
  133. </div>
  134. </el-col>
  135. <el-col :span="24" class="item">
  136. <div class="label">备注</div>
  137. <div class="value">
  138. <el-input v-model="detailData.remark" placeholder="请输入备注"></el-input>
  139. </div>
  140. </el-col>
  141. <el-col :span="8" class="item">
  142. <div class="label">制单人</div>
  143. <div class="value">{{detailData.createName}}</div>
  144. </el-col>
  145. <el-col :span="8" class="item">
  146. <div class="label">制单日期</div>
  147. <div class="value">{{detailData.createTime}}</div>
  148. </el-col>
  149. <el-col :span="8" class="item">
  150. <div class="label">合同有效期</div>
  151. <div class="value">
  152. <el-date-picker
  153. v-model="detailData.contractExpireDate"
  154. type="date"
  155. prefix-icon="none"
  156. value-format="yyyy-MM-dd"
  157. style="width: 100%;"
  158. placeholder="选择日期">
  159. </el-date-picker>
  160. </div>
  161. </el-col>
  162. </el-row>
  163. </div>
  164. <div class="main-title">
  165. <div class="title">货品信息</div>
  166. <div>
  167. <el-button type="primary" size="small" icon="el-icon-plus" @click="openDialog">添加货品</el-button>
  168. </div>
  169. </div>
  170. <div class="table" style="margin-top: 20px">
  171. <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400"
  172. show-summary
  173. :summary-method="$getSummaries">
  174. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  175. <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="120" show-overflow-tooltip></el-table-column>
  176. <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="120" show-overflow-tooltip></el-table-column>
  177. <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="120" show-overflow-tooltip></el-table-column>
  178. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  179. <el-table-column align="left" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip>
  180. <template slot-scope="scope">
  181. <el-input v-model="scope.row.specification" size="small"></el-input>
  182. </template>
  183. </el-table-column>
  184. <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  185. <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
  186. <template slot-scope="scope">
  187. <el-input v-model="scope.row.price" size="small" type="number" @mousewheel.native.prevent></el-input>
  188. </template>
  189. </el-table-column>
  190. <el-table-column align="right" label="数量" prop="qty" min-width="100" show-overflow-tooltip>
  191. <template slot-scope="scope">
  192. <el-input v-model="scope.row.qty" size="small" type="number" @mousewheel.native.prevent></el-input>
  193. </template>
  194. </el-table-column>
  195. <el-table-column align="right" label="订单金额" min-width="100" prop="compute_amount" show-overflow-tooltip>
  196. <template slot-scope="scope">
  197. {{scope.row.compute_amount | numToFixed}}
  198. </template>
  199. </el-table-column>
  200. <el-table-column align="left" label="备注" prop="remark" min-width="200" show-overflow-tooltip>
  201. <template slot-scope="scope">
  202. <el-input v-model="scope.row.remark" size="small"></el-input>
  203. </template>
  204. </el-table-column>
  205. <el-table-column align="left" label="税率" prop="taxRate" min-width="100" show-overflow-tooltip></el-table-column>
  206. <el-table-column align="center" label="操作" width="100" fixed="right">
  207. <template slot-scope="scope">
  208. <el-button type="text" @click="deleteItem(scope.$index)">删除</el-button>
  209. </template>
  210. </el-table-column>
  211. </el-table>
  212. </div>
  213. <div class="main-title">
  214. <div class="title">审批信息</div>
  215. </div>
  216. <div class="diy-table-1">
  217. <el-row :gutter="0">
  218. <el-col :span="12" class="item">
  219. <div class="label">审批人</div>
  220. <div class="value">{{userName}}</div>
  221. </el-col>
  222. <el-col :span="12" class="item">
  223. <div class="label">审批结果</div>
  224. <div class="value">
  225. <el-radio-group v-model="examineForm.examineResult">
  226. <el-radio :label="true">通过</el-radio>
  227. <el-radio :label="false">驳回</el-radio>
  228. </el-radio-group>
  229. </div>
  230. </el-col>
  231. <el-col :span="24" class="item">
  232. <div class="label">审批说明</div>
  233. <div class="value"><el-input v-model="examineForm.remark" placeholder="请输入内容"></el-input></div>
  234. </el-col>
  235. </el-row>
  236. </div>
  237. <div class="page-footer">
  238. <div class="footer">
  239. <el-button type="primary" @click="clickSubmitForm" :loading="formLoading">{{ formLoading ? '提交中 ...' : '提 交' }}</el-button>
  240. <el-popconfirm
  241. title="确定关闭吗?"
  242. @onConfirm="goBack"
  243. style="margin-left: 10px;"
  244. >
  245. <el-button slot="reference">返回列表</el-button>
  246. </el-popconfirm>
  247. </div>
  248. </div>
  249. <el-dialog title="添加产品" :visible.sync="isShowGoodsDialog" width="80%">
  250. <el-form ref="goodsScreenForm" :model="goodsScreenForm" size="small" label-position="left">
  251. <el-row :gutter="20">
  252. <el-col :xs="12" :sm="6" :lg="6">
  253. <el-form-item prop="salesType">
  254. <el-select v-model="goodsScreenForm.salesType" placeholder="选择销售类型" style="width: 100%" clearable>
  255. <el-option v-for="item in salesTypeList" :key="item.id" :label="item.saleName" :value="item.id"></el-option>
  256. </el-select>
  257. </el-form-item>
  258. </el-col>
  259. <el-col :xs="12" :sm="6" :lg="6">
  260. <el-form-item prop="proNum">
  261. <el-input v-model="goodsScreenForm.proNum" placeholder="请输入产品编码"></el-input>
  262. </el-form-item>
  263. </el-col>
  264. <el-col :xs="12" :sm="6" :lg="6">
  265. <el-form-item prop="proName">
  266. <el-input v-model="goodsScreenForm.proName" placeholder="请输入产品名称"></el-input>
  267. </el-form-item>
  268. </el-col>
  269. <el-col :xs="12" :sm="6" :lg="6">
  270. <el-form-item prop="proModel">
  271. <el-input v-model="goodsScreenForm.proModel" placeholder="请输入产品型号"></el-input>
  272. </el-form-item>
  273. </el-col>
  274. <el-col :xs="12" :sm="6" :lg="6">
  275. <el-form-item prop="price1" style="display: flex">
  276. <el-input v-model="goodsScreenForm.price1" placeholder="请输入价格" style="width: 46%"></el-input>
  277. <span> - </span>
  278. <el-input v-model="goodsScreenForm.price2" placeholder="请输入价格" style="width: 46%"></el-input>
  279. </el-form-item>
  280. </el-col>
  281. <el-col :xs="12" :sm="18" :lg="18" class="tr">
  282. <el-form-item label="">
  283. <el-button size="small" @click="resetGoodsScreenForm">清空</el-button>
  284. <el-button size="small" type="primary" @click="submitGoodsScreenForm">搜索</el-button>
  285. </el-form-item>
  286. </el-col>
  287. </el-row>
  288. </el-form>
  289. <div class="tables">
  290. <div class="table">
  291. <el-table :data="leftGoodsList" element-loading-text="Loading" border fit highlight-current-row stripe height="400" @selection-change="leftSelectionChange">
  292. <el-table-column align="center" type="selection" width="55" :selectable='checkboxSelect'></el-table-column>
  293. <el-table-column align="center" label="产品编码" prop="number" min-width="100" show-overflow-tooltip></el-table-column>
  294. <el-table-column align="center" label="产品名称" prop="name" min-width="160" show-overflow-tooltip></el-table-column>
  295. <el-table-column align="center" label="产品型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  296. <el-table-column align="center" label="产品价格" prop="batchPrice" min-width="80" show-overflow-tooltip></el-table-column>
  297. </el-table>
  298. <div class="pagination clearfix" style="margin-top: 10px">
  299. <div class="fr">
  300. <el-pagination
  301. @current-change="handleTableCurrentChange"
  302. :current-page="currentPage"
  303. :page-size="10"
  304. background
  305. layout="prev, pager, next"
  306. :total="listTotal">
  307. </el-pagination>
  308. </div>
  309. </div>
  310. </div>
  311. <div class="buttons">
  312. <el-button size="small" type="primary" @click="addAllGoods">全部添加</el-button>
  313. <el-button size="small" type="primary" @click="addGoods">添&emsp;加</el-button>
  314. <el-button size="small" type="danger" @click="deleteGoods">删&emsp;除</el-button>
  315. <el-button size="small" type="danger" @click="deleteAllGoods">全部删除</el-button>
  316. </div>
  317. <div class="table">
  318. <el-table :data="rightGoodsList" element-loading-text="Loading" border fit highlight-current-row stripe height="400" @selection-change="rightSelectionChange">
  319. <el-table-column align="center" type="selection" width="55"></el-table-column>
  320. <el-table-column align="center" label="产品编码" prop="number" min-width="100" show-overflow-tooltip></el-table-column>
  321. <el-table-column align="center" label="产品名称" prop="name" min-width="160" show-overflow-tooltip></el-table-column>
  322. <el-table-column align="center" label="产品型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  323. <el-table-column align="center" label="产品价格" prop="batchPrice" min-width="80" show-overflow-tooltip></el-table-column>
  324. </el-table>
  325. </div>
  326. </div>
  327. <span slot="footer" class="dialog-footer">
  328. <el-button @click="closeDialog">取 消</el-button>
  329. <el-button type="primary" @click="submitAddGoods">确 定</el-button>
  330. </span>
  331. </el-dialog>
  332. </div>
  333. </template>
  334. <script>
  335. import { getEnginDetail, getRetailProductList, examineEngin } from "@/api/supply/engin";
  336. import { getTypeList, getSalesmanList, getDictList } from "@/api/common";
  337. import { mapGetters } from "vuex";
  338. export default {
  339. name: 'EnginExamine',
  340. componentName: 'EnginExamine',
  341. props: ['listItem'],
  342. filters: {
  343. statusFilter(val) {
  344. const statusList = [
  345. { label: '已保存', value: 'SAVE' },
  346. { label: '待审核', value: 'WAIT' },
  347. { label: '审核通过', value: 'OK' },
  348. // { label: '审核驳回', value: 'FAIL' },,
  349. { label: '已关闭', value: 'CLOSE' },
  350. ];
  351. let obj = statusList.find(o => o.value == val);
  352. return obj ? obj.label : ''
  353. }
  354. },
  355. data() {
  356. return {
  357. detailData: {},
  358. goodsList: [],
  359. userName: JSON.parse(localStorage.getItem("supply_user")).nickName,
  360. formLoading: false,
  361. examineForm: {
  362. examineResult: true,
  363. remark: '',
  364. },
  365. salesTypeList: [],
  366. salesmanList: [],
  367. machineTypeList: [],
  368. loginTypeList: [],
  369. powerList: [],
  370. tradeCategoryList: [
  371. {value: '房地产', label: '房地产'},
  372. {value: '公共建筑', label: '公共建筑'},
  373. {value: '工业制造', label: '工业制造'},
  374. {value: '商业项目', label: '商业项目'},
  375. {value: '采暖及清洁能源', label: '采暖及清洁能源'},
  376. {value: '轨道交通', label: '轨道交通'},
  377. {value: '数据通讯', label: '数据通讯'},
  378. {value: '冷冻冷藏', label: '冷冻冷藏'},
  379. {value: '高端制造', label: '高端制造'},
  380. {value: '医院医疗', label: '医院医疗'},
  381. {value: '其他', label: '其他'},
  382. ],
  383. isShowGoodsDialog: false,
  384. goodsScreenForm: {
  385. proNum: '',
  386. proName: '',
  387. proModel: '',
  388. price1: '',
  389. price2: '',
  390. salesType: '',
  391. },
  392. currentPage: 1,
  393. listTotal: 0,
  394. leftGoodsList: [],
  395. rightGoodsList: [],
  396. leftSelection: [],
  397. rightSelection: [],
  398. salesTypeList:[]
  399. }
  400. },
  401. computed:{
  402. ...mapGetters(['isCustomer']),
  403. },
  404. watch: {
  405. goodsList: {
  406. handler(newValue, oldValue) {
  407. if(newValue && newValue.length) {
  408. newValue.forEach((item, index) => {
  409. this.goodsList[index].compute_amount = item.price * item.qty;
  410. })
  411. }
  412. },
  413. immediate: true,
  414. deep: true
  415. }
  416. },
  417. created() {
  418. this.getDetail();
  419. this.getTypeList();
  420. this.getSalesmanList();
  421. this.getDictList();
  422. },
  423. methods: {
  424. // 返回列表
  425. goBack() {
  426. this.$emit('backListFormDetail');
  427. },
  428. // 获取详情
  429. getDetail() {
  430. getEnginDetail({id: this.listItem.enginInfoId}).then(res => {
  431. this.detailData = res.data;
  432. res.data.items.forEach(item => {
  433. item.sums1 = ['qty', 'hasOrderQty', 'hasDeliverQty'];
  434. item.sums2 = ['compute_amount', 'price'];
  435. })
  436. this.goodsList = res.data.items;
  437. })
  438. },
  439. // 获取销售类型列表
  440. getTypeList() {
  441. getTypeList({
  442. pageNum: 1,
  443. pageSize: -1,
  444. }).then((res) => {
  445. this.salesTypeList = res.data.records;
  446. });
  447. },
  448. getSalesmanList() {
  449. getSalesmanList({
  450. pageNum: 1,
  451. pageSize: -1,
  452. isCustomer: 0,
  453. status: true,
  454. }).then(res => {
  455. this.salesmanList = res.data.records;
  456. })
  457. },
  458. // 获取产品大类列表
  459. getDictList() {
  460. getDictList({sysDictEnum: 'MACHINE_TYPE'}).then(res => {
  461. this.machineTypeList = res.data;
  462. })
  463. getDictList({sysDictEnum: 'POWER_CATEGORY'}).then(res => {
  464. this.powerList = res.data;
  465. })
  466. getDictList({sysDictEnum: 'SIGN_TYPE'}).then(res => {
  467. this.loginTypeList = res.data;
  468. })
  469. },
  470. // 获取商品列表
  471. getGoodsList() {
  472. getRetailProductList({
  473. pageNum: this.currentPage,
  474. pageSize: 10,
  475. saleId: this.goodsScreenForm.salesType,
  476. materialCode: this.goodsScreenForm.proNum,
  477. materialName: this.goodsScreenForm.proName,
  478. specification: this.goodsScreenForm.proModel,
  479. price1: this.goodsScreenForm.price1,
  480. price2: this.goodsScreenForm.price2,
  481. }).then(res => {
  482. let oldGoodsList = this.goodsList;
  483. let newGoodsList = res.data.records;
  484. for(let i = 0; i < oldGoodsList.length; i++) {
  485. let oldItem = oldGoodsList[i]
  486. for(let j = 0; j < newGoodsList.length; j++) {
  487. let newItem = newGoodsList[j]
  488. if(newItem.id === oldItem.id){
  489. newGoodsList[j].selected = true;
  490. break;
  491. }
  492. }
  493. }
  494. res.data.records.forEach(item => {
  495. item.materialName = item.name;
  496. item.materialCode = item.number;
  497. item.saleTypeName = item.saleName;
  498. item.unit = item.baseUnit;
  499. item.price = item.batchPrice;
  500. item.tax = item.taxRate;
  501. item.isDirectTransfer = false;
  502. item.directTransferQty = '';
  503. item.status1 = '';
  504. item.status2 = '';
  505. item.rebateAmount = '';
  506. item.rebateRate = '';
  507. item.productPriceId = item.id;
  508. // item.customerWalletId = (item.wallets && item.wallets.length) ? item.wallets[0].customerWalletId : '';
  509. });
  510. this.leftGoodsList = res.data.records;
  511. this.listTotal = res.data.total;
  512. })
  513. },
  514. // 查询重复值并禁选
  515. checkboxSelect(row, rowIndex) {
  516. if (row.selected) {
  517. return false // 禁用
  518. }else{
  519. return true // 不禁用
  520. }
  521. },
  522. // 点击 选择商品
  523. openDialog() {
  524. this.isShowGoodsDialog = true;
  525. this.getGoodsList();
  526. },
  527. // 提交筛选表单
  528. submitGoodsScreenForm() {
  529. this.currentPage = 1;
  530. this.getGoodsList();
  531. },
  532. // 重置筛选表单
  533. resetGoodsScreenForm() {
  534. this.$refs.goodsScreenForm.resetFields();
  535. this.currentPage = 1;
  536. this.getGoodsList();
  537. },
  538. // 更改列表当前页
  539. handleTableCurrentChange(val) {
  540. this.currentPage = val;
  541. this.getGoodsList();
  542. },
  543. // 关闭 弹窗
  544. closeDialog() {
  545. this.isShowGoodsDialog = false;
  546. },
  547. // 左侧列表选择
  548. leftSelectionChange(val) {
  549. this.leftSelection = val;
  550. },
  551. // 右侧列表选择
  552. rightSelectionChange(val) {
  553. this.rightSelection = val;
  554. },
  555. // 数组去重
  556. delRepeat(arr1, arr2) {
  557. let allArr = arr1.concat(arr2); // 两个数组对象合并
  558. let newArr = []; // 存放去重后数据的新数组
  559. for(let i=0; i<allArr.length; i++){ // 循环allArr数组对象的内容
  560. let flag = true; // 建立标记,判断数据是否重复,true为不重复
  561. for(let j=0; j<newArr.length; j++){ // 循环新数组的内容
  562. if(allArr[i].id == newArr[j].id){ // 让allArr数组对象的内容与新数组的内容作比较,相同的话,改变标记为false
  563. flag = false;
  564. }
  565. }
  566. if(flag){ // 判断是否重复
  567. newArr.push(allArr[i]); // 不重复的放入新数组。 新数组的内容会继续进行上边的循环。
  568. }
  569. }
  570. return newArr;
  571. },
  572. // 全部添加
  573. addAllGoods() {
  574. this.rightGoodsList = this.delRepeat(this.leftGoodsList, this.rightGoodsList);
  575. },
  576. // 添加
  577. addGoods() {
  578. this.rightGoodsList = this.delRepeat(this.leftSelection, this.rightGoodsList);
  579. },
  580. // 删除
  581. deleteGoods() {
  582. let rightGoodsList = this.rightGoodsList;
  583. let rightSelection = this.rightSelection;
  584. for(let i = 0; i < rightGoodsList.length; i++) {
  585. for(let j = 0; j < rightSelection.length; j++) {
  586. if(rightSelection[j].materialId == rightGoodsList[i].materialId){
  587. this.rightGoodsList.splice(i, 1);
  588. }
  589. }
  590. }
  591. },
  592. // 全部删除
  593. deleteAllGoods() {
  594. this.rightGoodsList = [];
  595. },
  596. // 确定 添加产品
  597. submitAddGoods() {
  598. // this.goodsList = this.delRepeat(this.rightGoodsList, this.goodsList);
  599. this.goodsList = this.goodsList.concat(this.rightGoodsList);
  600. this.isShowGoodsDialog = false;
  601. this.leftGoodsList = [];
  602. this.rightGoodsList = [];
  603. },
  604. // 删除产品
  605. deleteItem(index) {
  606. this.goodsList.splice(index, 1);
  607. },
  608. clickSubmitForm() {
  609. if(!this.detailData.serviceId) {
  610. return this.$errorMsg('请选择业务员');
  611. }
  612. this.$confirm('此操作将审批订单, 是否继续?', '提示', {
  613. confirmButtonText: '确定',
  614. cancelButtonText: '取消',
  615. type: 'warning'
  616. }).then(() => {
  617. let saleManItem = this.salesmanList.find(o => o.adminUserId == this.detailData.serviceId);
  618. let params = JSON.parse(JSON.stringify(this.detailData));
  619. params.enginInfoId = this.listItem.enginInfoId;
  620. params.mainId = this.listItem.mainId;
  621. params.examineResult = this.examineForm.examineResult;
  622. params.examineNote = this.examineForm.remark;
  623. params.serviceName = saleManItem.nickName;
  624. params.items = this.goodsList;
  625. this.formLoading = true;
  626. examineEngin(params).then(res => {
  627. this.$successMsg('审批成功');
  628. this.goBack();
  629. this.$parent.getList();
  630. }).finally(res => {
  631. this.formLoading = false;
  632. })
  633. }).catch(() => {});
  634. },
  635. }
  636. }
  637. </script>
  638. <style scoped lang="scss">
  639. .detail-container {
  640. width: 100%;
  641. height: 100%;
  642. }
  643. .main-title {
  644. display: flex;
  645. justify-content: space-between;
  646. align-items: center;
  647. margin-top: 20px;
  648. height: 60px;
  649. border-bottom: 1px solid #DCDFE6;
  650. margin-bottom: 20px;
  651. .title {
  652. font-size: 16px;
  653. font-weight: 600;
  654. padding-left: 10px;
  655. }
  656. }
  657. .tables {
  658. display: flex;
  659. margin-top: 10px;
  660. .table {
  661. width: 45%;
  662. }
  663. .buttons {
  664. display: flex;
  665. flex-direction: column;
  666. justify-content: center;
  667. align-items: center;
  668. padding: 0 10px;
  669. button {
  670. margin: 0;
  671. margin-top: 10px;
  672. }
  673. }
  674. }
  675. ::v-deep input::-webkit-outer-spin-button,
  676. ::v-deep input::-webkit-inner-spin-button {
  677. -webkit-appearance: none;
  678. }
  679. ::v-deep input[type='number'] {
  680. -moz-appearance: textfield;
  681. }
  682. </style>