当前位置:   article > 正文

若依前端-APP中使用数据字典_dict-tag

dict-tag

 

  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
  4. <el-form-item label="入库单编号" prop="recptCode">
  5. <el-input
  6. v-model="queryParams.recptCode"
  7. placeholder="请输入入库单编号"
  8. clearable
  9. @keyup.enter.native="handleQuery"
  10. />
  11. </el-form-item>
  12. <el-form-item label="入库单名称" prop="recptName">
  13. <el-input
  14. v-model="queryParams.recptName"
  15. placeholder="请输入入库单名称"
  16. clearable
  17. @keyup.enter.native="handleQuery"
  18. />
  19. </el-form-item>
  20. <el-form-item label="生产工单" prop="workorderCode">
  21. <el-input
  22. v-model="queryParams.workorderCode"
  23. placeholder="请输入生产工单编码"
  24. clearable
  25. @keyup.enter.native="handleQuery"
  26. />
  27. </el-form-item>
  28. <el-form-item label="仓库" prop="warehouseName">
  29. <el-input
  30. v-model="queryParams.warehouseName"
  31. placeholder="请输入仓库名称"
  32. clearable
  33. @keyup.enter.native="handleQuery"
  34. />
  35. </el-form-item>
  36. <el-form-item>
  37. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  38. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  39. </el-form-item>
  40. </el-form>
  41. <el-row :gutter="10" class="mb8">
  42. <el-col :span="1.5">
  43. <el-button
  44. type="primary"
  45. plain
  46. icon="el-icon-plus"
  47. size="mini"
  48. @click="handleAdd"
  49. v-hasPermi="['mes:wm:productrecpt:add']"
  50. >新增</el-button>
  51. </el-col>
  52. <el-col :span="1.5">
  53. <el-button
  54. type="success"
  55. plain
  56. icon="el-icon-edit"
  57. size="mini"
  58. :disabled="single"
  59. @click="handleUpdate"
  60. v-hasPermi="['mes:wm:productrecpt:edit']"
  61. >修改</el-button>
  62. </el-col>
  63. <el-col :span="1.5">
  64. <el-button
  65. type="danger"
  66. plain
  67. icon="el-icon-delete"
  68. size="mini"
  69. :disabled="multiple"
  70. @click="handleDelete"
  71. v-hasPermi="['mes:wm:productrecpt:remove']"
  72. >删除</el-button>
  73. </el-col>
  74. <el-col :span="1.5">
  75. <el-button
  76. type="warning"
  77. plain
  78. icon="el-icon-download"
  79. size="mini"
  80. @click="handleExport"
  81. v-hasPermi="['mes:wm:productrecpt:export']"
  82. >导出</el-button>
  83. </el-col>
  84. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  85. </el-row>
  86. <el-table v-loading="loading" :data="productrecptList" @selection-change="handleSelectionChange">
  87. <el-table-column type="selection" width="55" align="center" />
  88. <el-table-column label="入库单编号" width="130px" align="center" prop="recptCode" >
  89. <template slot-scope="scope">
  90. <el-button
  91. type="text"
  92. @click="handleView(scope.row)"
  93. v-hasPermi="['mes:wm:productrecpt:query']"
  94. >{{scope.row.recptCode}}</el-button>
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="入库单名称" width="150px" align="center" prop="recptName" :show-overflow-tooltip="true"/>
  98. <el-table-column label="生产工单编码" width="150px" align="center" prop="workorderCode" />
  99. <el-table-column label="产品编码" align="center" prop="itemCode" />
  100. <el-table-column label="产品名称" align="center" prop="itemName" />
  101. <el-table-column label="入库日期" align="center" prop="recptDate" width="120">
  102. <template slot-scope="scope">
  103. <span>{{ parseTime(scope.row.recptDate, '{y}-{m}-{d}') }}</span>
  104. </template>
  105. </el-table-column>
  106. <el-table-column label="单据状态" align="center" prop="status">
  107. <template slot-scope="scope">
  108. <dict-tag :options="dict.type.mes_order_status" :value="scope.row.status"/>
  109. </template>
  110. </el-table-column>
  111. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  112. <template slot-scope="scope">
  113. <el-button
  114. size="mini"
  115. type="text"
  116. icon="el-icon-video-play"
  117. v-if="scope.row.status =='PREPARE'"
  118. @click="handleExecute(scope.row)"
  119. v-hasPermi="['mes:wm:productrecpt:edit']"
  120. >执行入库</el-button>
  121. <el-button
  122. size="mini"
  123. type="text"
  124. icon="el-icon-edit"
  125. @click="handleUpdate(scope.row)"
  126. v-if="scope.row.status =='PREPARE'"
  127. v-hasPermi="['mes:wm:productrecpt:edit']"
  128. >修改</el-button>
  129. <el-button
  130. size="mini"
  131. type="text"
  132. icon="el-icon-delete"
  133. @click="handleDelete(scope.row)"
  134. v-if="scope.row.status =='PREPARE'"
  135. v-hasPermi="['mes:wm:productrecpt:remove']"
  136. >删除</el-button>
  137. </template>
  138. </el-table-column>
  139. </el-table>
  140. <pagination
  141. v-show="total>0"
  142. :total="total"
  143. :page.sync="queryParams.pageNum"
  144. :limit.sync="queryParams.pageSize"
  145. @pagination="getList"
  146. />
  147. <!-- 添加或修改产品入库录对话框 -->
  148. <el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
  149. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  150. <el-row>
  151. <el-col :span="8">
  152. <el-form-item label="入库单编号" prop="recptCode">
  153. <el-input v-model="form.recptCode" placeholder="请输入入库单编号" />
  154. </el-form-item>
  155. </el-col>
  156. <el-col :span="4">
  157. <el-form-item label-width="80">
  158. <el-switch v-model="autoGenFlag"
  159. active-color="#13ce66"
  160. active-text="自动生成"
  161. @change="handleAutoGenChange(autoGenFlag)" v-if="optType != 'view' && form.status =='PREPARE'">
  162. </el-switch>
  163. </el-form-item>
  164. </el-col>
  165. <el-col :span="12">
  166. <el-form-item label="入库单名称" prop="recptName">
  167. <el-input v-model="form.recptName" placeholder="请输入入库单名称" />
  168. </el-form-item>
  169. </el-col>
  170. </el-row>
  171. <el-row>
  172. <el-col :span="8">
  173. <el-form-item label="生产工单" prop="workorderCode">
  174. <el-input v-model="form.workorderCode" placeholder="请选择生产工单" >
  175. <el-button slot="append" icon="el-icon-search" @click="handleWorkorderSelect"></el-button>
  176. </el-input>
  177. <WorkorderSelect ref="woSelect" @onSelected="onWorkorderSelected"></WorkorderSelect>
  178. </el-form-item>
  179. </el-col>
  180. <el-col :span="8">
  181. <el-form-item label="生产工单名称" prop="workorderName">
  182. <el-input v-model="form.workorderName" readonly="readonly" />
  183. </el-form-item>
  184. </el-col>
  185. <el-col :span="8">
  186. <el-form-item label="入库日期" prop="recptDate">
  187. <el-date-picker clearable
  188. v-model="form.recptDate"
  189. type="date"
  190. value-format="yyyy-MM-dd"
  191. placeholder="请选择入库日期">
  192. </el-date-picker>
  193. </el-form-item>
  194. </el-col>
  195. </el-row>
  196. <el-row>
  197. <el-col :span="24">
  198. <el-form-item label="备注" prop="remark">
  199. <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
  200. </el-form-item>
  201. </el-col>
  202. </el-row>
  203. </el-form>
  204. <el-divider v-if="form.recptId !=null" content-position="center">物料信息</el-divider>
  205. <el-card shadow="always" v-if="form.recptId !=null" class="box-card">
  206. <Productrecptline :recptId="form.recptId" :optType="optType" :workorderId="form.workorderId" :itemId="form.itemId"></Productrecptline>
  207. </el-card>
  208. <div slot="footer" class="dialog-footer">
  209. <el-button type="primary" @click="cancel" v-if="optType =='view' || form.status !='PREPARE' ">返回</el-button>
  210. <el-button type="primary" @click="submitForm" v-if="form.status =='PREPARE' && optType !='view' ">保 存</el-button>
  211. <el-button @click="cancel">取 消</el-button>
  212. </div>
  213. </el-dialog>
  214. </div>
  215. </template>
  216. <script>
  217. import { listProductrecpt, getProductrecpt, delProductrecpt, addProductrecpt, updateProductrecpt ,execute} from "@/api/mes/wm/productrecpt";
  218. import WorkorderSelect from "@/components/workorderSelect/single.vue"
  219. import Productrecptline from "./line.vue"
  220. import {getTreeList} from "@/api/mes/wm/warehouse"
  221. import {genCode} from "@/api/system/autocode/rule"
  222. export default {
  223. name: "Productrecpt",
  224. dicts: ['mes_order_status'],
  225. components:{WorkorderSelect,Productrecptline},
  226. data() {
  227. return {
  228. //自动生成编码
  229. autoGenFlag:false,
  230. optType: undefined,
  231. warehouseInfo:[],
  232. warehouseOptions:[],
  233. warehouseProps:{
  234. multiple: false,
  235. value: 'pId',
  236. label: 'pName',
  237. },
  238. // 遮罩层
  239. loading: true,
  240. // 选中数组
  241. ids: [],
  242. // 非单个禁用
  243. single: true,
  244. // 非多个禁用
  245. multiple: true,
  246. // 显示搜索条件
  247. showSearch: true,
  248. // 总条数
  249. total: 0,
  250. // 产品入库录表格数据
  251. productrecptList: [],
  252. // 弹出层标题
  253. title: "",
  254. // 是否显示弹出层
  255. open: false,
  256. // 查询参数
  257. queryParams: {
  258. pageNum: 1,
  259. pageSize: 10,
  260. recptCode: null,
  261. recptName: null,
  262. workorderId: null,
  263. workorderCode: null,
  264. workorderName: null,
  265. warehouseId: null,
  266. warehouseCode: null,
  267. warehouseName: null,
  268. locationId: null,
  269. locationCode: null,
  270. locationName: null,
  271. areaId: null,
  272. areaCode: null,
  273. areaName: null,
  274. recptDate: null,
  275. status: null,
  276. },
  277. // 表单参数
  278. form: {},
  279. // 表单校验
  280. rules: {
  281. recptCode: [
  282. { required: true, message: "入库单编号不能为空", trigger: "blur" }
  283. ],
  284. recptDate: [
  285. { required: true, message: "请选择入库日期", trigger: "blur" }
  286. ],
  287. workorderCode: [
  288. { required: true, message: "请选择生产工单", trigger: "blur" }
  289. ],
  290. }
  291. };
  292. },
  293. created() {
  294. this.getList();
  295. this.getWarehouseList();
  296. },
  297. methods: {
  298. /** 查询产品入库录列表 */
  299. getList() {
  300. this.loading = true;
  301. listProductrecpt(this.queryParams).then(response => {
  302. this.productrecptList = response.rows;
  303. this.total = response.total;
  304. this.loading = false;
  305. });
  306. },
  307. getWarehouseList(){
  308. getTreeList().then( response =>{
  309. this.warehouseOptions = response.data;
  310. this.warehouseOptions.map(w =>{
  311. w.children.map(l =>{
  312. let lstr =JSON.stringify(l.children).replace(/locationId/g,'lId').replace(/areaId/g, 'pId').replace(/areaName/g,'pName');
  313. l.children = JSON.parse(lstr);
  314. });
  315. let wstr = JSON.stringify(w.children).replace(/warehouseId/g,'wId').replace(/locationId/g, 'pId').replace(/locationName/g,'pName');
  316. w.children = JSON.parse(wstr);
  317. });
  318. let ostr=JSON.stringify(this.warehouseOptions).replace(/warehouseId/g,'pId').replace(/warehouseName/g, 'pName');
  319. this.warehouseOptions = JSON.parse(ostr);
  320. });
  321. },
  322. // 取消按钮
  323. cancel() {
  324. this.open = false;
  325. this.reset();
  326. },
  327. // 表单重置
  328. reset() {
  329. this.form = {
  330. recptId: null,
  331. recptCode: null,
  332. recptName: null,
  333. workorderId: null,
  334. workorderCode: null,
  335. workorderName: null,
  336. warehouseId: null,
  337. warehouseCode: null,
  338. warehouseName: null,
  339. locationId: null,
  340. locationCode: null,
  341. locationName: null,
  342. itemId: null,
  343. itemCode: null,
  344. itemName: null,
  345. unitOfMeasure: null,
  346. clientCode: null,
  347. clientName: null,
  348. areaId: null,
  349. areaCode: null,
  350. areaName: null,
  351. recptDate: new Date(),
  352. status: "PREPARE",
  353. remark: null,
  354. attr1: null,
  355. attr2: null,
  356. attr3: null,
  357. attr4: null,
  358. createBy: null,
  359. createTime: null,
  360. updateBy: null,
  361. updateTime: null
  362. };
  363. this.autoGenFlag = false;
  364. this.resetForm("form");
  365. },
  366. /** 搜索按钮操作 */
  367. handleQuery() {
  368. this.queryParams.pageNum = 1;
  369. this.getList();
  370. },
  371. /** 重置按钮操作 */
  372. resetQuery() {
  373. this.resetForm("queryForm");
  374. this.handleQuery();
  375. },
  376. // 多选框选中数据
  377. handleSelectionChange(selection) {
  378. this.ids = selection.map(item => item.recptId)
  379. this.single = selection.length!==1
  380. this.multiple = !selection.length
  381. },
  382. // 查询明细按钮操作
  383. handleView(row){
  384. this.reset();
  385. const recptId = row.recptId || this.ids
  386. getProductrecpt(recptId).then(response => {
  387. this.form = response.data;
  388. this.open = true;
  389. this.title = "查看产品入库单";
  390. this.optType = "view";
  391. });
  392. },
  393. /** 新增按钮操作 */
  394. handleAdd() {
  395. this.reset();
  396. this.open = true;
  397. this.title = "添加产品入库单";
  398. },
  399. /** 修改按钮操作 */
  400. handleUpdate(row) {
  401. this.reset();
  402. const recptId = row.recptId || this.ids
  403. getProductrecpt(recptId).then(response => {
  404. this.form = response.data;
  405. this.open = true;
  406. this.title = "修改产品入库单";
  407. });
  408. },
  409. //执行入库
  410. handleExecute(row){
  411. const recptIds = row.recptId || this.ids;
  412. this.$modal.confirm('确认执行入库?').then(function() {
  413. return execute(recptIds)//执行入库
  414. }).then(() => {
  415. this.getList();
  416. this.$modal.msgSuccess("入库成功");
  417. }).catch(() => {});
  418. },
  419. /** 提交按钮 */
  420. submitForm() {
  421. this.$refs["form"].validate(valid => {
  422. if (valid) {
  423. if (this.form.recptId != null) {
  424. updateProductrecpt(this.form).then(response => {
  425. this.$modal.msgSuccess("修改成功");
  426. this.open = false;
  427. this.getList();
  428. });
  429. } else {
  430. addProductrecpt(this.form).then(response => {
  431. this.$modal.msgSuccess("新增成功");
  432. this.open = false;
  433. this.getList();
  434. });
  435. }
  436. }
  437. });
  438. },
  439. /** 删除按钮操作 */
  440. handleDelete(row) {
  441. const recptIds = row.recptId || this.ids;
  442. this.$modal.confirm('是否确认删除产品入库单编号为"' + recptIds + '"的数据项?').then(function() {
  443. return delProductrecpt(recptIds);
  444. }).then(() => {
  445. this.getList();
  446. this.$modal.msgSuccess("删除成功");
  447. }).catch(() => {});
  448. },
  449. /** 导出按钮操作 */
  450. handleExport() {
  451. this.download('wm/productrecpt/export', {
  452. ...this.queryParams
  453. }, `productrecpt_${new Date().getTime()}.xlsx`)
  454. },
  455. //选择生产工单
  456. handleWorkorderSelect(){
  457. this.$refs.woSelect.showFlag = true;
  458. },
  459. onWorkorderSelected(row){
  460. if(row != undefined && row != null){
  461. debugger;
  462. this.form.workorderId = row.workorderId;
  463. this.form.workorderCode = row.workorderCode;
  464. this.form.workorderName = row.workorderName;
  465. this.form.itemId = row.productId;
  466. this.form.itemCode = row.productCode;
  467. this.form.itemName = row.productName;
  468. this.form.unitOfMeasure = row.unitOfMeasure;
  469. this.form.clientCode = row.clientCode;
  470. this.form.clientName = row.clientName;
  471. }
  472. },
  473. //选择默认的仓库、库区、库位
  474. handleWarehouseChanged(obj){
  475. if(obj !=null){
  476. this.form.warehouseId = obj[0];
  477. this.form.locationId = obj[1];
  478. this.form.areaId = obj[2];
  479. }
  480. },
  481. //自动生成编码
  482. handleAutoGenChange(autoGenFlag){
  483. if(autoGenFlag){
  484. genCode('PRODUCTRECPT_CODE').then(response =>{
  485. this.form.recptCode = response;
  486. });
  487. }else{
  488. this.form.recptCode = null;
  489. }
  490. }
  491. }
  492. };
  493. </script>

 

  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="10" class="mb8">
  4. <el-col :span="1.5">
  5. <el-button
  6. type="primary"
  7. plain
  8. icon="el-icon-plus"
  9. size="mini"
  10. @click="handleAdd"
  11. v-hasPermi="['mes:wm:productrecpt:add']"
  12. >新增</el-button>
  13. </el-col>
  14. <el-col :span="1.5">
  15. <el-button
  16. type="success"
  17. plain
  18. icon="el-icon-edit"
  19. size="mini"
  20. :disabled="single"
  21. @click="handleUpdate"
  22. v-if="optType != 'view'"
  23. v-hasPermi="['mes:wm:productrecpt:edit']"
  24. >修改</el-button>
  25. </el-col>
  26. <el-col :span="1.5">
  27. <el-button
  28. type="danger"
  29. plain
  30. icon="el-icon-delete"
  31. size="mini"
  32. :disabled="multiple"
  33. @click="handleDelete"
  34. v-if="optType != 'view'"
  35. v-hasPermi="['mes:wm:productrecpt:remove']"
  36. >删除</el-button>
  37. </el-col>
  38. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  39. </el-row>
  40. <el-table v-loading="loading" :data="productrecptlineList" @selection-change="handleSelectionChange">
  41. <el-table-column type="selection" width="55" align="center" />
  42. <el-table-column label="产品物料编码" width="120px" align="center" prop="itemCode" />
  43. <el-table-column label="产品物料名称" width="150px" align="center" prop="itemName" :show-overflow-tooltip="true"/>
  44. <el-table-column label="规格型号" width="120px" align="center" prop="specification" :show-overflow-tooltip="true"/>
  45. <el-table-column label="单位" align="center" prop="unitOfMeasure" />
  46. <el-table-column label="入库数量" align="center" prop="quantityRecived" />
  47. <el-table-column label="良品数" align="center" prop="quantityQualified" />
  48. <el-table-column label="不良品数" align="center" prop="quantityUnqualified" />
  49. <el-table-column label="批次号" align="center" prop="batchCode" />
  50. <el-table-column label="仓库名称" align="center" prop="warehouseName" />
  51. <el-table-column label="库区名称" align="center" prop="locationName" />
  52. <el-table-column label="库位名称" align="center" prop="areaName" />
  53. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  54. <template slot-scope="scope">
  55. <el-button
  56. size="mini"
  57. type="text"
  58. icon="el-icon-edit"
  59. @click="handleUpdate(scope.row)"
  60. v-if="optType != 'view'"
  61. v-hasPermi="['mes:wm:productrecpt:edit']"
  62. >修改</el-button>
  63. <el-button
  64. size="mini"
  65. type="text"
  66. icon="el-icon-delete"
  67. @click="handleDelete(scope.row)"
  68. v-if="optType != 'view'"
  69. v-hasPermi="['mes:wm:productrecpt:remove']"
  70. >删除</el-button>
  71. </template>
  72. </el-table-column>
  73. </el-table>
  74. <pagination
  75. v-show="total>0"
  76. :total="total"
  77. :page.sync="queryParams.pageNum"
  78. :limit.sync="queryParams.pageSize"
  79. @pagination="getList"
  80. />
  81. <!-- 添加或修改产品入库记录行对话框 -->
  82. <el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
  83. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  84. <el-row>
  85. <el-col :span="8">
  86. <el-form-item label="产品物料编码" prop="itemCode">
  87. <el-input v-model="form.itemCode" placeholder="请输入产品物料编码" >
  88. <el-button slot="append" @click="handleSelectStock" icon="el-icon-search"></el-button>
  89. </el-input>
  90. <StockSelect ref="stockSelect" :workorderId="workorderId" :itemId="itemId" warehouseCode="XBK_VIRTUAL" @onSelected="onStockSelected"></StockSelect>
  91. </el-form-item>
  92. </el-col>
  93. <el-col :span="8">
  94. <el-form-item label="产品物料名称" prop="itemName">
  95. <el-input v-model="form.itemName" placeholder="请输入产品物料名称" />
  96. </el-form-item>
  97. </el-col>
  98. <el-col :span="8">
  99. <el-form-item label="单位" prop="unitOfMeasure">
  100. <el-input v-model="form.unitOfMeasure" placeholder="请输入单位" />
  101. </el-form-item>
  102. </el-col>
  103. </el-row>
  104. <el-row>
  105. <el-col :span="24">
  106. <el-form-item label="规格型号" prop="specification">
  107. <el-input v-model="form.specification" type="textarea" placeholder="请输入内容" />
  108. </el-form-item>
  109. </el-col>
  110. </el-row>
  111. <el-row>
  112. <el-col :span="8">
  113. <el-form-item label="入库数量" prop="quantityRecived">
  114. <el-input-number :min="0" :max="form.quantityMax" v-model="form.quantityRecived" placeholder="请输入入库数量" />
  115. </el-form-item>
  116. </el-col>
  117. <el-col :span="8">
  118. <el-form-item label="批次号" prop="batchCode">
  119. <el-input v-model="form.batchCode" placeholder="请输入批次号" />
  120. </el-form-item>
  121. </el-col>
  122. <el-col :span="8">
  123. <el-form-item label="入库仓库" prop="warehouseId">
  124. <el-cascader v-model="warehouseInfo"
  125. :options="warehouseOptions"
  126. :props="warehouseProps"
  127. @change="handleWarehouseChanged"
  128. >
  129. </el-cascader>
  130. </el-form-item>
  131. </el-col>
  132. </el-row>
  133. <el-row>
  134. <el-col :span="24">
  135. <el-form-item label="备注" prop="remark">
  136. <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
  137. </el-form-item>
  138. </el-col>
  139. </el-row>
  140. </el-form>
  141. <div slot="footer" class="dialog-footer">
  142. <el-button type="primary" @click="submitForm">确 定</el-button>
  143. <el-button @click="cancel">取 消</el-button>
  144. </div>
  145. </el-dialog>
  146. </div>
  147. </template>
  148. <script>
  149. import { listProductrecptline, getProductrecptline, delProductrecptline, addProductrecptline, updateProductrecptline } from "@/api/mes/wm/productrecptline";
  150. import StockSelect from "@/components/stockSelect/single.vue"
  151. import {getTreeList} from "@/api/mes/wm/warehouse"
  152. export default {
  153. name: "Productrecptline",
  154. components:{
  155. StockSelect
  156. },
  157. props: {
  158. recptId: null,
  159. optType: null,
  160. workorderId:null,
  161. itemId: null
  162. },
  163. data() {
  164. return {
  165. warehouseInfo:[],
  166. warehouseOptions:[],
  167. warehouseProps:{
  168. multiple: false,
  169. value: 'pId',
  170. label: 'pName',
  171. },
  172. // 遮罩层
  173. loading: true,
  174. // 选中数组
  175. ids: [],
  176. // 非单个禁用
  177. single: true,
  178. // 非多个禁用
  179. multiple: true,
  180. // 显示搜索条件
  181. showSearch: true,
  182. // 总条数
  183. total: 0,
  184. // 产品入库记录行表格数据
  185. productrecptlineList: [],
  186. // 弹出层标题
  187. title: "",
  188. // 是否显示弹出层
  189. open: false,
  190. // 查询参数
  191. queryParams: {
  192. pageNum: 1,
  193. pageSize: 10,
  194. recptId: this.recptId,
  195. materialStockId: null,
  196. itemId: null,
  197. itemCode: null,
  198. itemName: null,
  199. specification: null,
  200. unitOfMeasure: null,
  201. quantityRecived: null,
  202. batchCode: null,
  203. warehouseId: null,
  204. warehouseCode: null,
  205. warehouseName: null,
  206. locationId: null,
  207. locationCode: null,
  208. locationName: null,
  209. areaId: null,
  210. areaCode: null,
  211. areaName: null,
  212. },
  213. // 表单参数
  214. form: {},
  215. // 表单校验
  216. rules: {
  217. itemId: [
  218. { required: true, message: "产品不能为空", trigger: "blur" }
  219. ],
  220. warehouseId: [
  221. { required: true, message: "入库仓库不能为空", trigger: "blur" }
  222. ],
  223. quantityRecived: [
  224. { required: true, message: "入库数量不能为空", trigger: "blur" }
  225. ],
  226. }
  227. };
  228. },
  229. created() {
  230. this.getList();
  231. this.getWarehouseList();
  232. },
  233. methods: {
  234. /** 查询产品入库记录行列表 */
  235. getList() {
  236. this.loading = true;
  237. listProductrecptline(this.queryParams).then(response => {
  238. this.productrecptlineList = response.rows;
  239. this.total = response.total;
  240. this.loading = false;
  241. });
  242. },
  243. getWarehouseList(){
  244. getTreeList().then( response =>{
  245. this.warehouseOptions = response.data;
  246. this.warehouseOptions.map(w =>{
  247. w.children.map(l =>{
  248. let lstr =JSON.stringify(l.children).replace(/locationId/g,'lId').replace(/areaId/g, 'pId').replace(/areaName/g,'pName');
  249. l.children = JSON.parse(lstr);
  250. });
  251. let wstr = JSON.stringify(w.children).replace(/warehouseId/g,'wId').replace(/locationId/g, 'pId').replace(/locationName/g,'pName');
  252. w.children = JSON.parse(wstr);
  253. });
  254. let ostr=JSON.stringify(this.warehouseOptions).replace(/warehouseId/g,'pId').replace(/warehouseName/g, 'pName');
  255. this.warehouseOptions = JSON.parse(ostr);
  256. });
  257. },
  258. // 取消按钮
  259. cancel() {
  260. this.open = false;
  261. this.reset();
  262. },
  263. // 表单重置
  264. reset() {
  265. this.form = {
  266. lineId: null,
  267. recptId: this.recptId,
  268. materialStockId: null,
  269. itemId: null,
  270. itemCode: null,
  271. itemName: null,
  272. specification: null,
  273. unitOfMeasure: null,
  274. quantityRecived: null,
  275. batchCode: null,
  276. warehouseId: null,
  277. warehouseCode: null,
  278. warehouseName: null,
  279. locationId: null,
  280. locationCode: null,
  281. locationName: null,
  282. areaId: null,
  283. areaCode: null,
  284. areaName: null,
  285. remark: null,
  286. attr1: null,
  287. attr2: null,
  288. attr3: null,
  289. attr4: null,
  290. createBy: null,
  291. createTime: null,
  292. updateBy: null,
  293. updateTime: null
  294. };
  295. this.resetForm("form");
  296. },
  297. /** 搜索按钮操作 */
  298. handleQuery() {
  299. this.queryParams.pageNum = 1;
  300. this.getList();
  301. },
  302. /** 重置按钮操作 */
  303. resetQuery() {
  304. this.resetForm("queryForm");
  305. this.handleQuery();
  306. },
  307. // 多选框选中数据
  308. handleSelectionChange(selection) {
  309. this.ids = selection.map(item => item.lineId)
  310. this.single = selection.length!==1
  311. this.multiple = !selection.length
  312. },
  313. /** 新增按钮操作 */
  314. handleAdd() {
  315. this.reset();
  316. this.open = true;
  317. this.title = "添加产品入库记录行";
  318. },
  319. /** 修改按钮操作 */
  320. handleUpdate(row) {
  321. this.reset();
  322. const lineId = row.lineId || this.ids
  323. getProductrecptline(lineId).then(response => {
  324. this.form = response.data;
  325. this.open = true;
  326. this.title = "修改产品入库记录行";
  327. });
  328. },
  329. /** 提交按钮 */
  330. submitForm() {
  331. this.$refs["form"].validate(valid => {
  332. if (valid) {
  333. if (this.form.lineId != null) {
  334. updateProductrecptline(this.form).then(response => {
  335. this.$modal.msgSuccess("修改成功");
  336. this.open = false;
  337. this.getList();
  338. });
  339. } else {
  340. addProductrecptline(this.form).then(response => {
  341. this.$modal.msgSuccess("新增成功");
  342. this.open = false;
  343. this.getList();
  344. });
  345. }
  346. }
  347. });
  348. },
  349. /** 删除按钮操作 */
  350. handleDelete(row) {
  351. const lineIds = row.lineId || this.ids;
  352. this.$modal.confirm('是否确认删除产品入库记录行编号为"' + lineIds + '"的数据项?').then(function() {
  353. return delProductrecptline(lineIds);
  354. }).then(() => {
  355. this.getList();
  356. this.$modal.msgSuccess("删除成功");
  357. }).catch(() => {});
  358. },
  359. /** 导出按钮操作 */
  360. handleExport() {
  361. this.download('wm/productrecptline/export', {
  362. ...this.queryParams
  363. }, `productrecptline_${new Date().getTime()}.xlsx`)
  364. },
  365. handleSelectStock(){
  366. this.$refs.stockSelect.showFlag = true;
  367. this.$refs.stockSelect.getList();
  368. },
  369. //物料选择弹出框
  370. onStockSelected(obj){
  371. if(obj != undefined && obj != null){
  372. this.form.materialStockId = obj.materialStockId;
  373. this.form.itemId = obj.itemId;
  374. this.form.itemCode = obj.itemCode;
  375. this.form.itemName = obj.itemName;
  376. this.form.specification = obj.specification;
  377. this.form.unitOfMeasure = obj.unitOfMeasure;
  378. this.form.batchCode = obj.batchCode;
  379. this.form.quantityRecived = obj.quantityOnhand;
  380. this.form.quantityMax = obj.quantityOnhand;
  381. }
  382. },
  383. //选择默认的仓库、库区、库位
  384. handleWarehouseChanged(obj){
  385. if(obj !=null){
  386. this.form.warehouseId = obj[0];
  387. this.form.locationId = obj[1];
  388. this.form.areaId = obj[2];
  389. }
  390. },
  391. }
  392. };
  393. </script>

  1. <template>
  2. <view class="container">
  3. <!-- 显示收料单表头 -->
  4. <uni-section title="扫码委外收料表身" type="line" class="mb-10">
  5. <template v-slot:right>
  6. 查询清单
  7. </template>
  8. <uni-collapse>
  9. <uni-collapse-item :title="'委外收料单:'+outreceive.receiveCode+' 状态:'+outreceive.status"
  10. thumb="/static/images/workorder.png">
  11. <view class="content">
  12. <view class="container">
  13. <uni-list>
  14. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'location-filled'}" title="ID"
  15. :rightText="outreceive.receiveId" />
  16. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'wallet-filled'}" title="类型"
  17. :rightText="outreceive.receiveType" />
  18. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'wallet-filled'}" title="供应商"
  19. :rightText="outreceive.vendorCode" />
  20. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'chat-filled'}" title="供应商名称"
  21. :rightText="outreceive.vendorName" />
  22. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" title="开单时间"
  23. :rightText="outreceive.createTime" />
  24. </uni-list>
  25. </view>
  26. </view>
  27. </uni-collapse-item>
  28. <view class="dist-flex">
  29. <button type="primary" class="uni-btn-small" size="mini"
  30. @click="openAddOutreceiveLine">增加收料数量</button>
  31. <button type="primary" class="uni-btn-small" size="mini" @click="openEditOutissueLine"
  32. v-show="false">修改收料数量</button>
  33. <button type="primary" class="uni-btn-small" size="mini"
  34. @click="openQueryOutreceiveLine">查询收料明细</button>
  35. </view>
  36. </uni-collapse>
  37. </uni-section>
  38. <!-- 显示收料单表头 -->
  39. <!-- 显示收料单明细 -->
  40. <uni-section title="查询收料单明细" type="line" class="mb-10" v-show="showQueryOutreceiveLine">
  41. <template v-slot:right>
  42. </template>
  43. <uni-collapse v-for="(value, key, index) in outrececLineList">
  44. <uni-collapse-item :title="'料号:'+value.productCode+' 良品数:'+value.quantityQualified"
  45. thumb="/static/images/workorder.png">
  46. <view class="container">
  47. <view class="container">
  48. <uni-list>
  49. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'location-filled'}" title="ID"
  50. :rightText="value.receiveLineId" />
  51. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'wallet-filled'}" title="委外工单号码"
  52. :rightText="value.outworkorderCode" />
  53. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'wallet-filled'}" title="生产工单号码"
  54. :rightText="value.workorderCode" />
  55. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'wallet-filled'}" title="委外工序"
  56. :rightText="value.productCode" />
  57. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'wallet-filled'}" title="工序名称"
  58. :rightText="value.productName" />
  59. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'wallet-filled'}" title="需求数量"
  60. :rightText="value.quantityScrot" />
  61. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'wallet-filled'}" title="发料数量"
  62. :rightText="value.quantityIssue" />
  63. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'wallet-filled'}" title="收料良品数"
  64. :rightText="value.quantityQualified" />
  65. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'wallet-filled'}" title="收料不良品数"
  66. :rightText="value.quantityUnquanlified" />
  67. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'wallet-filled'}" title="收料时间"
  68. :rightText="value.createTime" />
  69. </uni-list>
  70. </view>
  71. </view>
  72. </uni-collapse-item>
  73. </uni-collapse>
  74. </uni-section>
  75. <!-- 显示收料单明细 -->
  76. <!-- 编辑收料单明细 -->
  77. <view class="content example" v-show="showEditOutreceiveLine">
  78. <uni-forms ref="form" :model="outreceiveLine" labelWidth="100px">
  79. <uni-forms-item label="扫码委外发料行码" name="issueCode" label-width="100">
  80. <view class="dist-flex">
  81. <uni-easyinput v-model="outreceiveLine.issueCode" placeholder="委外工单号码"></uni-easyinput>
  82. <uni-icons type="camera-filled" size="30" @click="onH5Scan"></uni-icons>
  83. </view>
  84. </uni-forms-item>
  85. <uni-forms-item label="收料单ID" name="receiveId" labelWidth="100">
  86. <uni-easyinput disabled v-model="outreceiveLine.receiveId" placeholder="收料单" />
  87. </uni-forms-item>
  88. <uni-forms-item label="收料单号" name="receiveCode" labelWidth="100">
  89. <uni-easyinput disabled v-model="outreceiveLine.receiveCode" placeholder="收料单" />
  90. </uni-forms-item>
  91. <uni-forms-item label="发料行ID" name="issueLineId" labelWidth="100">
  92. <uni-easyinput disabled v-model="outreceiveLine.issueLineId" placeholder="系统自动生成" />
  93. </uni-forms-item>
  94. <uni-forms-item label="委外工单" name="outworkorderCode" label-width="100">
  95. <uni-easyinput disabled v-model="outreceiveLine.outworkorderCode" placeholder="收料数量" />
  96. </uni-forms-item>
  97. <uni-forms-item label="生厂工单" name="workorderCode" label-width="100">
  98. <uni-easyinput disabled v-model="outreceiveLine.workorderCode" placeholder="收料数量" />
  99. </uni-forms-item>
  100. <uni-forms-item label="需求数量" name="quantityScrot" labelWidth="100">
  101. <uni-easyinput disabled v-model="outreceiveLine.quantityScrot" placeholder="需求数量" />
  102. </uni-forms-item>
  103. <uni-forms-item label="发料数量" name="quantity" label-width="100">
  104. <uni-easyinput disabled v-model="outreceiveLine.quantity" placeholder="收料数量" />
  105. </uni-forms-item>
  106. <uni-forms-item label="收料良品数" name="quantityQualifiedReceive" label-width="100">
  107. <uni-easyinput v-model="outreceiveLine.quantityQualifiedReceive" placeholder="收料良品数" />
  108. </uni-forms-item>
  109. <uni-forms-item label="收料不良品数" name="quantityUnqualifiedReceive" label-width="100">
  110. <uni-easyinput v-model="outreceiveLine.quantityUnqualifiedReceive" placeholder="收料不良品数" />
  111. </uni-forms-item>
  112. </uni-forms>
  113. </uni-section>
  114. <view style="text-align: center;">
  115. <button type="primary" @click="submitForm" size="mini">保存委外收料单明细</button>
  116. </view>
  117. </view>
  118. <!-- 编辑收料单明细 -->
  119. </view>
  120. </template>
  121. <script>
  122. import {
  123. getUserProfile
  124. } from "@/api/system/user"
  125. import {
  126. updateUserProfile
  127. } from "@/api/system/user"
  128. import {
  129. listWorkorder
  130. } from "@/api/mes/pro/workorder"
  131. import {
  132. listOutworkorder
  133. } from "@/api/mes/pro/outworkorder"
  134. import {
  135. getOutissue,
  136. addOutissue,
  137. listOutissue,
  138. updateOutissue,
  139. getOutissueByIssueCode
  140. } from "@/api/mes/pro/outissue.js"
  141. import {
  142. getOutissueLine,
  143. addOutissueLine,
  144. listOutissueLine,
  145. updateOutissueLine
  146. } from "@/api/mes/pro/outissueLine.js"
  147. import {
  148. getOutrececive,
  149. addOutrececive,
  150. listOutrececive,
  151. updateOutrececive,
  152. getOutreceiveByReceiveCode
  153. } from "@/api/mes/pro/outreceive.js"
  154. import {
  155. getOutreceiveLine,
  156. addOutreceiveLine,
  157. listOutreceiveLine,
  158. updateOutreceiveLine
  159. } from "@/api/mes/pro/outreceiveLine.js"
  160. import {
  161. listUser,
  162. getUser,
  163. delUser,
  164. addUser,
  165. updateUser,
  166. resetUserPwd,
  167. changeUserStatus
  168. } from "@/api/system/user"
  169. import {
  170. getJsapiSignature
  171. } from "@/api/notice/qywx.js"
  172. import storage from '@/utils/storage'
  173. import {
  174. getDicts
  175. } from "@/api/system/dict/data"
  176. import {
  177. listVendor,
  178. getVendor,
  179. delVendor,
  180. addVendor,
  181. updateVendor
  182. } from "@/api/mes/md/vendor"
  183. import {
  184. genCode
  185. } from "@/api/system/autocode/rule"
  186. import {
  187. listOutworkorderline
  188. } from "../../../../api/mes/pro/outworkorderline"
  189. export default {
  190. dicts: ['mes_order_status'],
  191. data() {
  192. return {
  193. vendorList: [],
  194. selectVendorCode: null,
  195. rules: {
  196. nickName: {
  197. rules: [{
  198. required: true,
  199. errorMessage: '用户昵称不能为空'
  200. }]
  201. },
  202. phonenumber: {
  203. rules: [{
  204. required: true,
  205. errorMessage: '手机号码不能为空'
  206. }, {
  207. pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
  208. errorMessage: '请输入正确的手机号码'
  209. }]
  210. },
  211. email: {
  212. rules: [{
  213. required: true,
  214. errorMessage: '邮箱地址不能为空'
  215. }, {
  216. format: 'email',
  217. errorMessage: '请输入正确的邮箱地址'
  218. }]
  219. }
  220. },
  221. workorderCodeList: [],
  222. selectWorkorderCode: null,
  223. outworkorderCodeList: [],
  224. selectOutworkorderCode: null,
  225. outworkorderLineProductList: [],
  226. outworkorderLineWorkorderList: [],
  227. outissueCodeList: [],
  228. outissueLineList: [],
  229. selectOutissueCode: null,
  230. selectProductCode: null,
  231. workorderList: [],
  232. protaskList: [],
  233. receiveCode: null,
  234. outissue: {
  235. issueId: null,
  236. issueCode: null,
  237. issueName: null,
  238. issueType: null,
  239. orderSource: null,
  240. sourceCode: null,
  241. productId: null,
  242. productCode: null,
  243. productName: null,
  244. productSpc: null,
  245. unitOfMeasure: null,
  246. quantity: null,
  247. quantityProduced: null,
  248. quantityChanged: null,
  249. quantityScheduled: null,
  250. clientId: null,
  251. clientCode: null,
  252. clientName: null,
  253. vendorId: null,
  254. vendorCode: null,
  255. vendorName: null,
  256. requestDate: null,
  257. parentId: null,
  258. status: null,
  259. remark: null,
  260. createBy: null,
  261. createTime: null,
  262. updateBy: null,
  263. updateTime: null
  264. },
  265. outissueline: {
  266. issueLineId: null,
  267. issueId: null,
  268. issueCode: null,
  269. issueName: null,
  270. issueType: null,
  271. outworkorderId: null,
  272. outwrkorderCode: null,
  273. outworkorderLineId: null,
  274. workorderId: null,
  275. workorderCode: null,
  276. lineNo: null,
  277. routeId: null,
  278. routeCode: null,
  279. processId: null,
  280. processCode: null,
  281. processName: null,
  282. productId: null,
  283. productCode: null,
  284. productName: null,
  285. productSpc: null,
  286. unitOfMeasure: null,
  287. quantity: null,
  288. quantityProduced: null,
  289. quantityChanged: null,
  290. quantityScheduled: null,
  291. quantityScrot: null,
  292. clientId: null,
  293. clientCode: null,
  294. clientName: null,
  295. vendorId: null,
  296. vendorCode: null,
  297. vendorName: null,
  298. requestDate: null,
  299. parentId: null,
  300. status: null,
  301. remark: null,
  302. createBy: null,
  303. createTime: null,
  304. updateBy: null,
  305. updateTime: null
  306. },
  307. outissueLineList: [],
  308. outreceive: {
  309. receiveId: null,
  310. receiveCode: null,
  311. receiveName: null,
  312. receiveType: null,
  313. orderSource: null,
  314. sourceCode: null,
  315. productId: null,
  316. productCode: null,
  317. productName: null,
  318. productSpc: null,
  319. unitOfMeasure: null,
  320. quantity: null,
  321. quantityProduced: null,
  322. quantityChanged: null,
  323. quantityScheduled: null,
  324. clientId: null,
  325. clientCode: null,
  326. clientName: null,
  327. vendorId: null,
  328. vendorCode: null,
  329. vendorName: null,
  330. requestDate: null,
  331. parentId: null,
  332. status: null,
  333. remark: null,
  334. createBy: null,
  335. createTime: null,
  336. updateBy: null,
  337. updateTime: null
  338. },
  339. outreceiveLine: {
  340. receiveLineId: null,
  341. receiveId: null,
  342. receiveCode: null,
  343. receiveName: null,
  344. receiveType: null,
  345. issueId: null,
  346. issueCode: null,
  347. issueName: null,
  348. issueType: null,
  349. issueLineId: null,
  350. outworkorderId: null,
  351. outwrkorderCode: null,
  352. outworkorderLineId: null,
  353. workorderId: null,
  354. workorderCode: null,
  355. lineNo: null,
  356. routeId: null,
  357. routeCode: null,
  358. processId: null,
  359. processCode: null,
  360. processName: null,
  361. productId: null,
  362. productCode: null,
  363. productName: null,
  364. productSpc: null,
  365. unitOfMeasure: null,
  366. quantity: null,
  367. quantityProduced: null,
  368. quantityChanged: null,
  369. quantityScheduled: null,
  370. quantityScrot: null,
  371. quantityIssue: null,
  372. quantityUnquanlified: null,
  373. clientId: null,
  374. clientCode: null,
  375. clientName: null,
  376. vendorId: null,
  377. vendorCode: null,
  378. vendorName: null,
  379. requestDate: null,
  380. parentId: null,
  381. status: null,
  382. remark: null,
  383. createBy: null,
  384. createTime: null,
  385. updateBy: null,
  386. updateTime: null
  387. },
  388. outreceiveLineList: [],
  389. workorderStatus: [],
  390. // 遮罩层
  391. loading: true,
  392. showEditOutworkorderLine: false,
  393. showQueryOutworkorderLine: false,
  394. showOutissueLine: false,
  395. showQueryOutreceiveLine: false,
  396. showEditOutreceiveLine: false,
  397. // 查询参数
  398. queryOutissueParams: {
  399. issueCode: null,
  400. },
  401. queryOutissueLineParams: {
  402. issueCode: null,
  403. },
  404. queryOutreceiveParams: {
  405. receiveCode: null,
  406. },
  407. queryOutreceiveLineParams: {
  408. receiveCode: null,
  409. },
  410. queryOutworkorderLineParams: {
  411. outworkorderCode: null,
  412. },
  413. //卡片相关数据
  414. cover: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/shuijiao.jpg',
  415. avatar: 'https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png',
  416. extraIcon: {
  417. color: '#4cd964',
  418. size: '22',
  419. type: 'gear-filled'
  420. }
  421. }
  422. },
  423. created() {
  424. },
  425. onLoad: function(option) {
  426. this.receiveCode = JSON.parse(decodeURIComponent(option.item));
  427. console.log("receiveCode:" + this.receiveCode)
  428. this.outreceive.receiveCode = this.receiveCode
  429. this.queryOutreceiveParams.receiveCode = this.receiveCode
  430. this.queryOutreceiveLineParams.receiveCode = this.receiveCode
  431. this.queryOutreceive();
  432. this.queryOutreceiveLineList();
  433. this.queryListOutworkorder();
  434. //调用微信扫一扫的配置
  435. this.getCofig()
  436. },
  437. onReady() {
  438. //设定Form提交的规则
  439. this.$refs.form.setRules(this.rules)
  440. },
  441. methods: {
  442. /** 提交按钮 保存报工按钮 */
  443. submitForm() {
  444. console.log("保存委外收料单开始")
  445. console.log(this.outissueLineList)
  446. this.$refs.form.validate().then(res => {
  447. console.log("收料行数据");
  448. console.log(this.outreceiveLine);
  449. addOutreceiveLine(this.outreceiveLine).then(response => {
  450. //this.showEditOutworkorderLine=false
  451. this.$modal.msgSuccess("新增成功:" + this.outreceiveLine.productName);
  452. });
  453. });
  454. console.log("保存委外收料单结束")
  455. },
  456. changeOutissue(e) {
  457. console.log("选择委外发料单号码")
  458. console.log(e)
  459. let row = JSON.parse(e)
  460. console.log(row.issueCode)
  461. this.showOutissueLine = true
  462. this.queryOutissueParams.issueCode = row.issueCode;
  463. this.outworkorderLineProductList = []
  464. this.outworkorderLineWorkorderList = []
  465. this.outissueline.productCode = null
  466. this.outissueline.productName = null
  467. this.outissueline.quantityScrot = null
  468. this.outissueline.quantity = null
  469. this.outworkorderCodeList = []
  470. listOutissueLine(this.queryOutissueParams).then(response => {
  471. this.loading = false;
  472. this.outissueLineList = response.rows;
  473. for (var i in response.rows) {
  474. this.outworkorderCodeList.push({
  475. value: JSON.stringify(response.rows[i]),
  476. text: response.rows[i].outworkorderCode
  477. });
  478. }
  479. })
  480. //委外工单发料列表
  481. console.log(row.outworkorderCodeList)
  482. },
  483. changeOutworkorder(e) {
  484. console.log("选择委外工单号码")
  485. console.log(e)
  486. let row = JSON.parse(e)
  487. console.log(row.outworkorderCode)
  488. this.queryOutworkorderLineParams.outworkorderCode = row.outworkorderCode;
  489. this.outworkorderLineProductList = []
  490. this.outworkorderLineWorkorderList = []
  491. this.outissueline.productCode = null
  492. this.outissueline.productName = null
  493. this.outissueline.quantityScrot = null
  494. this.outissueline.quantity = null
  495. listOutworkorderline(this.queryOutworkorderLineParams).then(response => {
  496. //this.protaskList = response.rows;
  497. this.loading = false;
  498. for (var i in response.rows) {
  499. this.outworkorderLineProductList.push({
  500. value: JSON.stringify(response.rows[i]),
  501. text: response.rows[i].productCode + "|" + response.rows[i].productName
  502. });
  503. this.outworkorderLineWorkorderList.push({
  504. value: JSON.stringify(response.rows[i]),
  505. text: response.rows[i].workorderCode
  506. });
  507. }
  508. })
  509. //委外工单发料列表
  510. console.log(row.outworkorderLineProductList)
  511. },
  512. changeOutworkorderLineWorkorder(e) {
  513. console.log("选择委外工单明细的生产工单")
  514. console.log(e)
  515. let row = JSON.parse(e)
  516. console.log(row)
  517. this.outissueline.processId = row.processId
  518. this.outissueline.productCode = row.productCode
  519. this.outissueline.productName = row.productName
  520. this.outissueline.quantityScrot = row.quantity
  521. this.outissueline.outworkorderId = row.outworkorderId
  522. this.outissueline.outworkorderCode = row.outworkorderCode
  523. this.outissueline.outworkorderLineId = row.outworkorderLineId
  524. this.outissueline.workorderId = row.workorderId
  525. this.outissueline.workorderCode = row.workorderCode
  526. this.outissueline.routeId = row.routeId
  527. this.outissueline.routeCode = row.routeCode
  528. this.outissueline.routeName = row.routeName
  529. this.outissueline.processId = row.processId
  530. this.outissueline.processCode = row.processCode
  531. this.outissueline.processName = row.processName
  532. },
  533. changeUser(e) {
  534. console.log("选择审核人")
  535. console.log(e)
  536. let row = JSON.parse(e)
  537. console.log(row.userName)
  538. this.feedback.recordUser = row.userName
  539. this.feedback.recordNick = row.nickNamethis.outissueline.outworkorderId = row.outworkorderId
  540. this.loading = true
  541. getOutissueByreceiveCode(this.receiveCode).then(response => {
  542. this.loading = false;
  543. console.log("委外收料单表头");
  544. console.log(response.data);
  545. this.outissue = response.data;
  546. this.outissueline.issueId = response.data.issueId;
  547. this.outissueline.receiveCode = response.data.receiveCode;
  548. });
  549. },
  550. queryOutreceive() {
  551. this.loading = true
  552. getOutreceiveByReceiveCode(this.receiveCode).then(response => {
  553. this.loading = false;
  554. console.log("委外收料单表头");
  555. console.log(response.data);
  556. this.outreceive = response.data;
  557. });
  558. },
  559. queryOutreceiveLineList() {
  560. this.loading = true
  561. listOutreceiveLine(this.queryOutreceiveLineParams).then(response => {
  562. this.loading = false;
  563. console.log("委外收料单明细");
  564. console.log(response.rows);
  565. this.outrececLineList = response.rows;
  566. });
  567. },
  568. queryListOutissue() {
  569. console.log("查询委外发料单-可发料范围")
  570. listOutissue().then(response => {
  571. this.loading = false;
  572. for (var i in response.rows) {
  573. this.outissueCodeList.push({
  574. value: JSON.stringify(response.rows[i]),
  575. text: response.rows[i].issueCode
  576. });
  577. }
  578. });
  579. console.log(this.outissueCodeList);
  580. console.log("查询委外发料单-可发料范围")
  581. },
  582. queryListOutworkorder() {
  583. console.log("查询委外工单清单-可发料范围")
  584. listOutworkorder().then(response => {
  585. this.loading = false;
  586. for (var i in response.rows) {
  587. this.outworkorderCodeList.push({
  588. value: JSON.stringify(response.rows[i]),
  589. text: response.rows[i].outworkorderCode
  590. });
  591. }
  592. });
  593. console.log(this.outworkorderCodeList);
  594. console.log("查询委外工单清单-可发料范围")
  595. },
  596. getListProTask() {
  597. console.log("查询排产任务开始")
  598. listProtask(this.queryProTaskParams).then(response => {
  599. //this.protaskList = response.rows;
  600. this.loading = false;
  601. for (var i in response.rows) {
  602. this.protaskList.push({
  603. value: JSON.stringify(response.rows[i]),
  604. text: response.rows[i].taskCode + "|" + response.rows[i].workstationName
  605. });
  606. }
  607. });
  608. console.log(this.protaskList);
  609. console.log("查询排产任务结束")
  610. },
  611. openAddOutreceiveLine() {
  612. //this.$refs.showRight.open();
  613. //this.$tab.navigateTo('/pages/mes/pro/workorder/saveowoissueline?item=' + encodeURIComponent(JSON.stringify(this
  614. // .outissue)));
  615. this.showEditOutreceiveLine = true;
  616. this.showQueryOutreceiveLine = false;
  617. //查询发料单可发料列表
  618. //this.queryListOutissue();
  619. },
  620. openQueryOutreceiveLine() {
  621. console.log("查询委外工单收料明细")
  622. this.showQueryOutreceiveLine = true;
  623. this.showEditOutreceiveLine = false;
  624. this.queryOutreceiveLineList();
  625. },
  626. closeDrawer() {
  627. this.$refs.showRight.close();
  628. },
  629. //微信扫描save
  630. onH5Scan() {
  631. //如果有调用相关的内容,要使用that的这个常量
  632. const that = this;
  633. console.log('onH5Scan进来了');
  634. this.$wx.scanQRCode({
  635. needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
  636. scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
  637. success: function(res) {
  638. //alert(JSON.stringify(res)) //测试使用
  639. var result = res.resultStr; // 当 needResult 为 1 时,扫码返回的结果
  640. var resultArr = result.split(',') // 扫描结果以逗号分割数组
  641. var codeContent = resultArr[resultArr.length - 1] // 获取数组最后一个元素,也就是最终的内容
  642. 扫描结果赋值
  643. console.log('onH5Scan——success');
  644. console.log("onH5Scan" + result + "===" + resultArr + "===" + codeContent);
  645. var str = codeContent.trim();
  646. var array = str.split('^');
  647. alert(array);
  648. that.outreceiveLine.receiveId=that.outreceive.receiveId
  649. that.outreceiveLine.receiveCode=that.outreceive.receiveCode
  650. that.outreceiveLine.issueLineId = parseInt(array[0])
  651. that.outreceiveLine.issueId = parseInt(array[1])
  652. that.outreceiveLine.issueCode = array[2]
  653. that.outreceiveLine.outworkorderLineId = parseInt(array[3])
  654. that.outreceiveLine.outworkorderId = parseInt(array[4])
  655. that.outreceiveLine.outworkorderCode = array[5]
  656. that.outreceiveLine.workorderId = parseInt(array[6])
  657. that.outreceiveLine.workorderCode = array[7]
  658. that.outreceiveLine.productId = parseInt(array[8])
  659. that.outreceiveLine.productCode = array[9]
  660. that.outreceiveLine.productName = array[10]
  661. that.outreceiveLine.routeId = parseInt(array[11])
  662. that.outreceiveLine.routeCode = array[12]
  663. //that.outissueline.routeName = array[13]
  664. that.outreceiveLine.processId = parseInt(array[14])
  665. that.outreceiveLine.processCode = array[15]
  666. that.outreceiveLine.processName = array[16]
  667. that.outreceiveLine.quantityScrot = parseFloat(array[17])
  668. that.outreceiveLine.quantity = array[18]
  669. },
  670. fail: function(response) {
  671. if (res.errMsg.indexOf('function_not_exist') > 0) {
  672. console.log('onH5Scan版本过低请升级');
  673. }
  674. uni.showToast({
  675. icon: "none",
  676. title: "onH5Scan——调用扫码失败" + response.errMsg
  677. })
  678. },
  679. });
  680. },
  681. // 配置信息
  682. getCofig() {
  683. const that = this;
  684. let url = window.location.href.split('#')[0];
  685. let params = {
  686. 'url': url
  687. }
  688. getJsapiSignature(params).then(res => {
  689. const result = res;
  690. if (res) {
  691. that.wxConfig(
  692. result.appId,
  693. result.timestamp,
  694. result.nonceStr,
  695. result.signature
  696. );
  697. } else {
  698. alert('获取配置信息返回为空');
  699. }
  700. })
  701. },
  702. //wx.config的配置
  703. wxConfig(appId, timestamp, nonceStr, signature) {
  704. this.$wx.config({
  705. debug: false, // 开启调试模式,
  706. appId: appId, // 必填,企业号的唯一标识
  707. timestamp: timestamp, // 必填,生成签名的时间戳
  708. nonceStr: nonceStr, // 必填,生成签名的随机串
  709. signature: signature, // 必填,签名
  710. jsApiList: [
  711. 'chooseImage',
  712. 'previewImage',
  713. 'uploadImage',
  714. 'downloadImage',
  715. 'scanQRCode',
  716. 'checkJsApi'
  717. ], // 必填,需要使用的JS接口列表
  718. });
  719. this.$wx.ready(() => {
  720. this.$wx.checkJsApi({ //判断当前客户端版本是否支持指定JS接口
  721. jsApiList: [
  722. 'chooseImage',
  723. 'previewImage',
  724. 'uploadImage',
  725. 'downloadImage',
  726. 'scanQRCode',
  727. ],
  728. success: function(
  729. res
  730. ) { // 以键值对的形式返回,可用true,不可用false。如:{"checkResult":{"scanQRCode":true},"errMsg":"checkJsApi:ok"}
  731. //alert(res)
  732. //取消配置提示框
  733. this.$modal.msgSuccess(res.checkResult)
  734. if (res.checkResult.scanQRCode != true) {
  735. this.$modal.msgSuccess('抱歉,当前客户端版本不支持扫一扫')
  736. }
  737. },
  738. fail: function(res) { //检测getNetworkType该功能失败时处理
  739. this.$modal.msgSuccess(res)
  740. alert('checkJsApi error');
  741. }
  742. });
  743. console.log("wxConfig配置完成,扫码前准备完成");
  744. //this.$modal.msgSuccess("wxConfig配置完成,扫码前准备完成")
  745. })
  746. this.$wx.error(function(res) {
  747. this.$modal.msgSuccess('wxConfig出错了:' + res.errMsg)
  748. console.log('wxConfig出错了:' + res.errMsg);
  749. //wx.config配置错误,会弹出窗口哪里错误,然后根据微信文档查询即可。
  750. });
  751. },
  752. }
  753. }
  754. </script>
  755. <style lang="scss">
  756. page {
  757. background-color: #ffffff;
  758. }
  759. .example {
  760. padding: 15px;
  761. background-color: #ffffff;
  762. }
  763. .segmented-control {
  764. margin-bottom: 15px;
  765. }
  766. .button-group {
  767. margin-top: 15px;
  768. display: flex;
  769. justify-content: space-around;
  770. }
  771. .form-item {
  772. display: flex;
  773. align-items: center;
  774. flex: 1;
  775. }
  776. .button {
  777. display: flex;
  778. align-items: center;
  779. height: 35px;
  780. line-height: 35px;
  781. margin-left: 10px;
  782. }
  783. .dist-flex {
  784. display: flex !important;
  785. }
  786. /*卡片格式*/
  787. .container {
  788. overflow: hidden;
  789. }
  790. .custom-cover {
  791. flex: 1;
  792. flex-direction: row;
  793. position: relative;
  794. }
  795. .cover-content {
  796. position: absolute;
  797. bottom: 0;
  798. left: 0;
  799. right: 0;
  800. height: 40px;
  801. background-color: rgba($color: #000000, $alpha: 0.4);
  802. display: flex;
  803. flex-direction: row;
  804. align-items: center;
  805. padding-left: 15px;
  806. font-size: 14px;
  807. color: #fff;
  808. }
  809. .card-actions {
  810. display: flex;
  811. flex-direction: row;
  812. justify-content: space-around;
  813. align-items: center;
  814. height: 45px;
  815. border-top: 1px #eee solid;
  816. }
  817. .card-actions-item {
  818. display: flex;
  819. flex-direction: row;
  820. align-items: center;
  821. }
  822. .card-actions-item-text {
  823. font-size: 12px;
  824. color: #666;
  825. margin-left: 5px;
  826. }
  827. .cover-image {
  828. flex: 1;
  829. height: 150px;
  830. }
  831. .no-border {
  832. border-width: 0;
  833. }
  834. </style>
  1. ALTER TABLE ryvue_mes.pro_task ADD first_flag INT NULL COMMENT '首道工序(0否/1是)';
  2. ALTER TABLE ryvue_mes.pro_task ADD last_flag INT NULL COMMENT '末道工序(0否/1是)';
  3. ALTER TABLE ryvue_mes.pro_task ADD bf_flag INT NULL COMMENT 'BFFlag 倒冲工序(0否/1是)';
  4. ALTER TABLE ryvue_mes.pro_task ADD report_flag INT NULL COMMENT 'ReportFlag 报告点 (0否/1是)';
  5. ALTER TABLE ryvue_mes.pro_task ADD fee_flag INT NULL COMMENT 'FeeFlag 计费点(0否/1是)';
  6. ALTER TABLE ryvue_mes.pro_task ADD delivery_days DECIMAL NULL COMMENT 'DeliveryDays 交货天数';
 1 在main.js文件中注册有关字典的组件和相关的属性等,如下所示,有添加字典注解的地方
  1. import Vue from 'vue'
  2. import App from './App'
  3. import wx from 'weixin-js-sdk'
  4. import store from './store' // store
  5. import plugins from './plugins' // plugins
  6. import './permission' // permission
  7. //字典
  8. import { getDicts } from "@/api/system/dict/data"
  9. // 字典标签组件
  10. import DictTag from '@/components/DictTag'
  11. // 字典数据组件
  12. import DictData from '@/components/DictData'
  13. Vue.use(plugins)
  14. //安装字典
  15. DictData.install()
  16. Vue.config.productionTip = false
  17. Vue.prototype.$store = store
  18. Vue.prototype.getDicts = getDicts
  19. //全局注册字典
  20. Vue.component('DictTag', DictTag)
  21. App.mpType = 'app'
  22. const app = new Vue({
  23. ...App
  24. })
  25. app.$mount()
2  在D:\ideaProject\RuoYi-App-master\components目录,添加从前端的项目复制DictData,DictTag两个目录的全部文件
3在D:\ideaProject\RuoYi-App-master\utils目录,添加从前端的项目复制utils的文件,存在的文件就跳过
4 在组件文件中直接使用<dict-tag :options="dict.type.mes_order_status" value="CONFIRMED" />来表示字典显示的内容

4.1 定义字典的内容

dicts: ['mes_order_status','mes_workorder_sourcetype','mes_workorder_type'],

 4.2 在要显示标签的地方,写下dict-tag标签的语法,vaule属性可以使用变量

<dict-tag :options="dict.type.mes_order_status" value="CONFIRMED" />
  1. <template>
  2. <view class="normal-login-container">
  3. <view class="logo-content align-center justify-center flex">
  4. <image style="width: 100rpx;height: 100rpx;" :src="globalConfig.appInfo.logo" mode="widthFix">
  5. </image>
  6. <text class="title">若依移动端登录</text>
  7. <view>
  8. <dict-tag :options="dict.type.mes_order_status" value="CONFIRMED" />
  9. </view>
  10. </view>
  11. <view class="login-form-content">
  12. <view class="input-item flex align-center">
  13. <view class="iconfont icon-user icon"></view>
  14. <input v-model="loginForm.username" class="input" type="text" placeholder="请输入账号" maxlength="30" />
  15. </view>
  16. <view class="input-item flex align-center">
  17. <view class="iconfont icon-password icon"></view>
  18. <input v-model="loginForm.password" type="password" class="input" placeholder="请输入密码" maxlength="20" />
  19. </view>
  20. <view class="input-item flex align-center" style="width: 60%;margin: 0px;" v-if="captchaEnabled">
  21. <view class="iconfont icon-code icon"></view>
  22. <input v-model="loginForm.code" type="number" class="input" placeholder="请输入验证码" maxlength="4" />
  23. <view class="login-code">
  24. <image :src="codeUrl" @click="getCode" class="login-code-img"></image>
  25. </view>
  26. </view>
  27. <view class="action-btn">
  28. <button @click="handleLogin" class="login-btn cu-btn block bg-blue lg round">登录</button>
  29. </view>
  30. <view class="reg text-center" v-if="register">
  31. <text class="text-grey1">没有账号?</text>
  32. <text @click="handleUserRegister" class="text-blue">立即注册</text>
  33. </view>
  34. <view class="xieyi text-center">
  35. <text class="text-grey1">登录即代表同意</text>
  36. <text @click="handleUserAgrement" class="text-blue">《用户协议》</text>
  37. <text @click="handlePrivacy" class="text-blue">《隐私协议》</text>
  38. </view>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. import {
  44. getCodeImg
  45. } from '@/api/login'
  46. export default {
  47. dicts: ['mes_order_status','mes_workorder_sourcetype','mes_workorder_type'],
  48. data() {
  49. return {
  50. codeUrl: "",
  51. captchaEnabled: true,
  52. // 用户注册开关
  53. register: false,
  54. globalConfig: getApp().globalData.config,
  55. loginForm: {
  56. username: "admin",
  57. password: "admin123",
  58. code: "",
  59. uuid: ''
  60. }
  61. }
  62. },
  63. created() {
  64. this.getCode()
  65. },
  66. methods: {
  67. // 用户注册
  68. handleUserRegister() {
  69. this.$tab.redirectTo(`/pages/register`)
  70. },
  71. // 隐私协议
  72. handlePrivacy() {
  73. let site = this.globalConfig.appInfo.agreements[0]
  74. this.$tab.navigateTo(`/pages/common/webview/index?title=${site.title}&url=${site.url}`)
  75. },
  76. // 用户协议
  77. handleUserAgrement() {
  78. let site = this.globalConfig.appInfo.agreements[1]
  79. this.$tab.navigateTo(`/pages/common/webview/index?title=${site.title}&url=${site.url}`)
  80. },
  81. // 获取图形验证码
  82. getCode() {
  83. getCodeImg().then(res => {
  84. this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled
  85. if (this.captchaEnabled) {
  86. this.codeUrl = 'data:image/gif;base64,' + res.img
  87. this.loginForm.uuid = res.uuid
  88. }
  89. })
  90. },
  91. // 登录方法
  92. async handleLogin() {
  93. if (this.loginForm.username === "") {
  94. this.$modal.msgError("请输入您的账号")
  95. } else if (this.loginForm.password === "") {
  96. this.$modal.msgError("请输入您的密码")
  97. } else if (this.loginForm.code === "" && this.captchaEnabled) {
  98. this.$modal.msgError("请输入验证码")
  99. } else {
  100. this.$modal.loading("登录中,请耐心等待...")
  101. this.pwdLogin()
  102. }
  103. },
  104. // 密码登录
  105. async pwdLogin() {
  106. this.$store.dispatch('Login', this.loginForm).then(() => {
  107. this.$modal.closeLoading()
  108. this.loginSuccess()
  109. }).catch(() => {
  110. if (this.captchaEnabled) {
  111. this.getCode()
  112. }
  113. })
  114. },
  115. // 登录成功后,处理函数
  116. loginSuccess(result) {
  117. // 设置用户信息
  118. this.$store.dispatch('GetInfo').then(res => {
  119. this.$tab.reLaunch('/pages/index')
  120. })
  121. }
  122. }
  123. }
  124. </script>
  125. <style lang="scss">
  126. page {
  127. background-color: #ffffff;
  128. }
  129. .normal-login-container {
  130. width: 100%;
  131. .logo-content {
  132. width: 100%;
  133. font-size: 21px;
  134. text-align: center;
  135. padding-top: 15%;
  136. image {
  137. border-radius: 4px;
  138. }
  139. .title {
  140. margin-left: 10px;
  141. }
  142. }
  143. .login-form-content {
  144. text-align: center;
  145. margin: 20px auto;
  146. margin-top: 15%;
  147. width: 80%;
  148. .input-item {
  149. margin: 20px auto;
  150. background-color: #f5f6f7;
  151. height: 45px;
  152. border-radius: 20px;
  153. .icon {
  154. font-size: 38rpx;
  155. margin-left: 10px;
  156. color: #999;
  157. }
  158. .input {
  159. width: 100%;
  160. font-size: 14px;
  161. line-height: 20px;
  162. text-align: left;
  163. padding-left: 15px;
  164. }
  165. }
  166. .login-btn {
  167. margin-top: 40px;
  168. height: 45px;
  169. }
  170. .reg {
  171. margin-top: 15px;
  172. }
  173. .xieyi {
  174. color: #333;
  175. margin-top: 20px;
  176. }
  177. .login-code {
  178. height: 38px;
  179. float: right;
  180. .login-code-img {
  181. height: 38px;
  182. position: absolute;
  183. margin-left: 10px;
  184. width: 200rpx;
  185. }
  186. }
  187. }
  188. }
  189. </style>

1 为表添加数据同步相关的信息 

  1. ALTER TABLE ryvue_mes.out_workorder ADD sync_id varchar(100) NULL COMMENT '同步ID(接名名称或AP名行或JOB名称等)';
  2. ALTER TABLE ryvue_mes.out_workorder ADD sync_status INT NULL COMMENT '同步状态(0成功1失败2执行3重传)';
  3. ALTER TABLE ryvue_mes.out_workorder ADD sync_time DATETIME NULL COMMENT '同步完成时间';
  4. ALTER TABLE ryvue_mes.out_workorder ADD sync_qty INT NULL COMMENT '同步记录数';
  5. ALTER TABLE ryvue_mes.out_workorder ADD sync_message varchar(100) NULL COMMENT '同步消息';
  1. ALTER TABLE ryvue_mes.pro_route ADD run_card_flag INT NULL COMMENT '启用流转卡 (0否1是)';
  2. ALTER TABLE ryvue_mes.pro_route ADD aux_unit_code varchar(100) NULL COMMENT '辅助计量单位';
  3. ALTER TABLE ryvue_mes.pro_route ADD runcard_batch_qty DECIMAL NULL COMMENT '流转卡批量数据';
  4. ALTER TABLE ryvue_mes.pro_route ADD route_tyype INT NULL COMMENT 'RountingType 类型(1-主要/2-替代) ';
  5. ALTER TABLE ryvue_mes.pro_route ADD route_version varchar(100) NULL COMMENT '版本';
  6. ALTER TABLE ryvue_mes.pro_route ADD version_desc varchar(100) NULL COMMENT '版本说明';
  7. ALTER TABLE ryvue_mes.pro_route ADD version_start_date DATE NULL COMMENT '版本生效日期';
  8. ALTER TABLE ryvue_mes.pro_route ADD version_end_date DATE NULL COMMENT '版本结束日期';
  9. ALTER TABLE ryvue_mes.pro_route ADD ident_code varchar(100) NULL COMMENT '替代标识';
  10. ALTER TABLE ryvue_mes.pro_route ADD ident_desc varchar(100) NULL COMMENT '替代说明';
  11. ALTER TABLE ryvue_mes.pro_route ADD auditor_user varchar(100) NULL COMMENT '审核人员';
  12. ALTER TABLE ryvue_mes.pro_route ADD auditor_time DATETIME NULL;
  13. ALTER TABLE ryvue_mes.pro_route ADD close_user varchar(100) NULL COMMENT '关闭人员';
  14. ALTER TABLE ryvue_mes.pro_route ADD close_time varchar(100) NULL;
  15. ALTER TABLE ryvue_mes.pro_route ADD change_rate DECIMAL NULL COMMENT '换算率';
  16. ALTER TABLE ryvue_mes.pro_route ADD update_count varchar(100) NULL COMMENT '修改次数';
  17. ALTER TABLE ryvue_mes.pro_route ADD print_count varchar(100) NULL COMMENT '打印次数';
  1. <select id="checkFirstProTask" parameterType="ProTask" resultMap="ProTaskResult">
  2. <include refid="selectProTaskVo"/>
  3. <where>
  4. <if test="workorderCode != null and workorderCode != ''"> and t.workorder_code = #{workorderCode}</if>
  5. <if test="processCode != null"> and t.process_code = #{processCode} </if>
  6. <if test="workorderCode != null and workorderCode != ''"> and (workorder_code,process_order_num) in (select workorder_code,min(process_order_num) from ryvue_mes.pro_task where workorder_code =#{workorderCode} ) </if>
  7. </where>
  8. </select>
  9. <select id="checkLastProTask" parameterType="ProTask" resultMap="ProTaskResult">
  10. <include refid="selectProTaskVo"/>
  11. <where>
  12. <if test="workorderCode != null and workorderCode != ''"> and t.workorder_code = #{workorderCode}</if>
  13. <if test="processCode != null"> and t.process_code = #{processCode} </if>
  14. <if test="workorderCode != null and workorderCode != ''"> and (workorder_code,process_order_num) in (select workorder_code,min(process_order_num) from pro_task where workorder_code =#{workorderCode} ) </if>
  15. </where>
  16. </select>
  17. <select id="queryPreviousProTask" parameterType="ProTask" resultMap="ProTaskResult">
  18. <include refid="selectProTaskVo"/>
  19. <where>
  20. <if test="workorderCode != null and workorderCode != ''"> and t.workorder_code = #{workorderCode}</if>
  21. <if test="workorderCode != null and workorderCode != '' and processCode != null "> and process_order_num &lt; (select min(process_order_num) from pro_task where workorder_code =#{workorderCode} and process_code = #{processCode} ) </if>
  22. </where>
  23. order by process_order_num desc limit 1
  24. </select>
  25. <select id="queryNextProTask" parameterType="ProTask" resultMap="ProTaskResult">
  26. <include refid="selectProTaskVo"/>
  27. <where>
  28. <if test="workorderCode != null and workorderCode != ''"> and t.workorder_code = #{workorderCode}</if>
  29. <if test="workorderCode != null and workorderCode != '' and processCode != null "> and process_order_num &gt; (select min(process_order_num) from pro_task where workorder_code =#{workorderCode} and process_code = #{processCode} ) </if>
  30. </where>
  31. order by process_order_num limit 1
  32. </select>
https://blog.csdn.net/hmmmmm/article/details/124625612

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/码创造者/article/detail/810872
推荐阅读
相关标签
  

闽ICP备14008679号